Vote count: 0 I'm trying to write a bash script that will search a folder for specific file extensions (lets say .txt and .csv). The folder can have thousands of each type of extension. If the folder has only these two extensions across all files then the script can proceed. If any other extensions are present (and the two allowed extesions may also be preset), the script copies the folder to a holding bucket and writes to a log file. The folder that is being searched will never have subfolders. So, if the folder has: .txt and .csv, this passes If the folder has: .mp3, this fails If the folder has: .txt, .csv and .mp3, this also fails. Thanks! asked 47 secs agoDylan E Let's block ads! بخوانی...
ادامه مطلبVote count: 3 i have the following problem: I started to create a form with HTML an JS and there are two Dropdowns (Country and City). now i want to make these two dynamic with JQuery so that only the cities of the selected countries are visible. I've started with some basic JS which worked fine but makes some trouble in IE. Now i'm trying to convert my JS to JQuery for a better compatibility. My original JS looks like this: function populate(s1, s2) { var s1 = document.getElementById(s1); var s2 = document.getElementById(s2); s2.ierHTML = ""; if (s1.value == "Germany") { var optionArray = ["|", "magdeburg|Magdeburg", "duesseldorf|Duesseldorf", "leinfelden-echterdingen|Leinfelden-Echterdinge...
ادامه مطلبVote count: 0 I am coding something like: if (x=1 && y=2 && z=3 && (a=1 or 2 or 3)) That concept where I can have multiple values for a. I currently have this coded into 3 different if statements which is tedious. Is there a simple solution, for example, calling 1,2,3 into an array and say if (x=1 && y=2 && z=3 && a=array of 1,2,3) Thanks asked 2 mins agoAreki This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers....
ادامه مطلبVote count: 0 I want to create a website exactly same like this on joomla. But don`t know how to do it. It is basically an urdu daily newspaper. And it should be updated on daily bases. I think joomla would be simple for maintaining the daily updates. Should I use joomla or I can use any other way like PHP or something. I have no idea about where to start. Any help would be greatly appreciated. asked 1 min agoRasheeq This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers....
ادامه مطلبVote count: 0 I am working on a phonegap app, and have so far set-up the database to which I have the insert and delete function's working correctly. I am now struggling on checking input values with the data in the database, so for example for now I am just simply attempting to check if any rows are retued, and if there is that will mean the user and pass entered are in the database, if no rows are retued then the user and pass is false. I am not getting any errors from the sql statement (function errorCB), as well I did put an debug alert within the function LoginSuccess and that worked, however after removing the debug alert in the LoginSuccess function, I do not get prompted with any ale...
ادامه مطلبVote count: 0 I would like to use expressjs but ideally through typescript. I was hoping to be able to replace the express standard callbacks with something like async/await or promises using typescript but I can't seem to find any examples. Is anyone using expressjs with something other than callbacks, maybe promises ? From typescript would be ideal. I would appreciate any input anyone has. I did look at Koa but my experience is this expressjs but just wanted to be able to write it a little better and considering I am using typescript (or am able to use typescript), i thought there would be an alteative. I know its possible to wrap things using the Q library but it just doesn't seem natural...
ادامه مطلبVote count: 0 Hello i am making a game like flappy bird and I put up in a browser and it is not moving upwards but it is moving right like its supposed too. the main flying code is var dudeYSpeed = 0; var dudeXSpeed = 0; var dudeJumping = false; var jumpSpeed = -3; if(mouseDown && dudeJumping === false){ dudeJumping = true; dudeYSpeed = jumpSpeed; } else{ translateY += dudeYSpeed; dudeYSpeed += gravity; dudeJumping = false; } translateX+=dudeXSpeed; }; asked 42 secs agoCrazy Gamer231 This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers....
ادامه مطلبVote count: 0 I have recently read tutorial associated with JavaScript from this page, I tried some piece of code but i didn't understand some logic. Below is author code. function itself: var lz=""; lz.memo = function (fn) { var cache = {}; retu function () { var key = [].join.call(arguments, '§') + '§'; if (key in cache) { retu cache[key]; } retu cache[key] = fn.apply(this, arguments); }; }; and its execution var foo = 1; function bar(baz) { retu baz + foo; } var cached = lz.memo(bar); console.log(cached(1)); foo += 1; console.log(cached(1)); //2 But if I change var key = [].join.call(arguments, '§') + '§'; to var key=arguments[0]; it also works (Caching works). What is the purpose here th...
ادامه مطلبVote count: 0 Hello i have an array passed it through the url to another html page but when i attempt to decode it's no longer an array. var a = ["Boy", "Girl"]; var b = []; var conv_a = JSON.stringify(a); b.push(encodeURIComponent('myArray')+'='+encodeURIComponent(conv_a)); location.href='nextpage.html?'+b.join('&'); Now when decoding: var results ={}; var c = location.search.replace('?', '').split('&'); for(var i=0, l=fs.length;i...
ادامه مطلبVote count: 0 I am new to programming. I have 4 functions: function 1,function 2, function 3,function 4. Now, a value is being calculated in each of the first 3 functions. I want to store these 3 values in a global array and use it in the 4th function. Is the following approach correct? : var array1=[] function1(){ array1[0]=calculated value1; } function2(){ array1[1]=calculated value2; } function3(){ array1[2]=calculated value3; } This array will be used in the 4th function. asked 40 secs agoCerberus This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publisher...
ادامه مطلبVote count: 0 I am doing a Chrome extention, and I am facing an issue : I first inject a file.js in a Website open in a Webview. In this file.js I have a function which execute a retu value include in a setTimeout. The probleme is when I call the function using executeScript, the callback doesn't wait for the end of setTimeout, and retu [null]. Does someone could tell me what could I do ? thank you! (Without the setTimeout, it retu the expected value) //content of file.js function foo(){ setTimeout(function (){ retu {key:"value"}; }, 5000); } //I inject the file.js in the website webview.executeScript({file:"file.js"}, function(result){ console.log(result); }); //I call foo() in the website ...
ادامه مطلبVote count: 0 I'm following Get Started with the PowerShell Gallery which states that the PowerShellGet module exists in Windows 10 (which I am using - build 14721). To confirm, I am ruing PowerShell v5: >$PSVersionTable Name Value ---- ----- PSVersion 5.0.14271.1000 PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.14271.1000 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 Get Started with the PowerShell Gallery states: PowerShellGet also requires the NuGet provider to work with the PowerShell Gallery. You will be prompted to install the NuGet provider automatically upon first use of PowerShellGet if the NuGet provider...
ادامه مطلبVote count: 0 Issue: My Java WebDriver script is creating the text file, printing everything to console properly, but will not print to the said text file. The file is always blank. My Observation: It's got some to do with how I have written the buffered writer write() and close() functions, but I can't quiet place my finger on it being a noob. All help is highly appreciated. My Code: public class WebTableToTxtFile { static WebDriver driver = new FirefoxDriver(); public static void main(String[] args) throws Throwable { driver.navigate().to("http://www.bloomberg.com/markets/stocks/futures"); driver.manage().window().maximize(); driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);...
ادامه مطلبVote count: 0 For the life of me I don't understand why this doesn't work. It looks similar if not identical to many solutions i've seen. Clearly there is something i'm missing. If anyone would care to explain id appreciate it. var isEven = function(number) { if (isEven % 2 === 0) { retu true; } else { retu false; } }; asked 1 min agoDane Christian This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers....
ادامه مطلبVote count: 0 In ChaiScript, there is a .use() function which takes a file path and loads the file and makes every function and variable available in the script. This is great functionality if you want a file from disk, however I'm looking to do the same but from a file which has been loaded, preprocessed as a string and stored in memory. So pretty much an equivalent to the .use function, taking a string representing the whole script instead of just a path. Is this possible somehow? asked 3 mins agoTobias This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publi...
ادامه مطلبVote count: 0 I took an existing ASP.NET 4/MVC 5 web site and manually converted to an ASP.NET 5/MVC 6 project. When I got the application fully functional locally I attempted to publish to the previous web app on Azure. To do this I: Downloaded the publish profile from the Azure portal. Right clicked the web project and selected "Publish". Imported the publish profile and attempted to publish. Amazingly it worked the first time. However on subsequent publish attempts I received the error: Error : The 'prepublish' script failed with status code 1. Looking at the output of the publish I see the following: [13:25:07] 'min:ngAppJs' errored after 307 ms[13:25:07] Error: EPERM, open 'C:SCMHolos P...
ادامه مطلبVote count: 0 I load the raster in a function in a text/paperscript file as : function loadRaster(name) { var raster = new Raster(name,view.center); raster.scale(0.2); } Raster then appears on canvas as expected. In a different paperscript file (both paperscript files are referring the same canvas object in the tag as specified in https://github.com/paperjs/paper.js/issues/153 ), in another function I rotate the raster: function rotateRaster(raster, angle) { raster.rotate(angle); .... processLater(); } function processLater() { ... window.setTimeout(function() { view.update(); },0); .. } Now I find that when I call loadRaster() and then rotateRaster() with the appropriate arguments, for an i...
ادامه مطلبVote count: 0 I have a simple class, and I'm trying to figure out how to set a default value in the constructor: var Foo = function(bar = Foo.VAL1) { bar = {VAL1 : 1, VAL2: 2}; } but this is apparently wrong. What's the correct way to set a default enum value, or do I need to set the default to null, and check for the null in the constructor and set accordingly? asked 1 min agouser3791372 This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers....
ادامه مطلبVote count: 0 I am trying to create a VBA script that would allow me to select a range of data, and then, skipping the first column in the range, move the values the succeeding columns under the first column. Example current spreadsheet layout: --------------------------- URL1 | URL2 | URL3 | URL4 | --------------------------- | | | | -----+------+------+------- | | | | -----+------+------+------- 1URL| 2URL | 3URL | | -----+------+------+------- aURL| bURL | | | --------------------------- You'll notice that not all the cells in the range are populated Example result spreadsheet (after ruing script): --------------------------- URL1 | URL2 | URL3 | URL4 | --------------------------- | | | |...
ادامه مطلبVote count: 1 Setup: Local *nix machine with a SQL script script.sql (Postgres). Remote machine remote with Postgres. I can SSH in as some_user, who is a sudoer. Anything with Postgres needs to be done as postgres user. The server only listens on localhost:5432. How do I execute script.sql on remote without copying it there first? This works well: ssh -t some_user@remote 'sudo -u postgres psql -c "COMMANDS FOO BAR"' The -t flag means that sudo will ask for some_user's password correctly on the local terminal. One thing remains, to be able to pipe script.sql to psql. This does not work: ssh -t some_user@remote 'sudo -u postgres psql' < script.sql It fails with the message: Pseudo-terminal wil...
ادامه مطلب