Vote count: -1 I need to parse the line from the stream that would look like this: command "string1" "string2" string can contain spaces and escaped double-quotes. I need to split it so that I get command, string1 and string2 as array elements. I think split() with regex matching " but not " ( .split("(? ) would do the job, but I hear that that is not a good idea. What's the best way to do that in Java? asked 50 secs agouser1902247 Let's block ads! بخوانید...
ادامه مطلبVote count: 0 So my problem is about creating new element in ordered list with exact content. I have this homework and I am studying JS only for a couple of days. I have to make an ordered list and a button ADD ITEM. When I click the button it must create a new element in the ordered list with next number containig in it. So now when I click the button the prompt window appear and the text that I write goes in the next "li", but I can't figure how next "li" will display item 1, item 2, item 3 etc. And also I need to hide the first element cause "item 1: Text always shows up." < script > function addItem() { var item = prompt("Please insert a text", "It will be added to the list"); if (item !...
ادامه مطلبVote count: 0 I am currently figuring out how to implement a JS bridge to communicate from webview -> app. Especially for iOS with the new WKWebView there is a new cool solution using the webkit messagehandlers (good blog post: http://www.kinderas.com/technology/2014/6/15/wkwebview-and-javascript-in-ios-8-using-swift). Question: In my understanding this is an iOS only solution, right? Usually we have Android & iOS apps which are using the same webpage, which means that a general solution is needed. There is one alterate "old" solution which is described here: http://stackoverflow.com/a/9473941/5156317 Is this really the only possibility which works with Android & iOS? Or is there any support...
ادامه مطلبVote count: 0 Hi can someone please assist. I wish to modify Column A, on Sheet 3 of an Excel Work book to change the Date Format from: Sep-15 to 2016-09-15. In Excel this the format is mmm-yy I wish to change it to yyyy-mm-dd. Trying to get my head around it, I know you could use a module like pandas, or xlsxwriter but the example are not making sense. Thanks asked 39 secs agoGavin Jones Let's block ads! بخوانید...
ادامه مطلبVote count: 0 i'm whiling to know how to add a side menu on my current NativeScript + Angular 2 project, I know that has a side menu template, but i started it as blank project and i'm wonder how to add this feature. asked 31 secs agoBenevides Lecontes Let's block ads! بخوانید...
ادامه مطلبVote count: 0 Does anybody heard of or has an idea about possibility of integration some scripting engine (like tcl, perl, python etc.) into U-boot? The reason is that U-boot is major tool used during board bring-up and it's programming possibilities are quite limited and more abilities are wanted. Thanks. asked 23 secs agoIlya Krasavin Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I have two buttons, show time, and stop time. when click on show time, it set up setTimeout() to update the current time. when stop time is clicked, i want to stop the time 5 sec later. the problem I'm having is that if I click on show time once, then I click stop time, the time is till ticking. I need to click stop time twice in order to stop the time. so I think there are multiple instances of setTimeout() when i click show time multiple times. I'm wondering how can I make sure there is only one setTimeout(), so even show time is clicked multiple times, it only requires to click on stop time once to stop the time. var iTimeout; function startTime() { var today = new Date(); v...
ادامه مطلبVote count: 0 I want to migrate my routing logic from plain javascript to typescript. In javascript I would use below logic. How can I achieve the same the below in typescript to implement a route by implementing the IRoute interface.The idea is to use a class which handles routing. route.ts: var express = require('express'); var myRouter = express.Router(); myRouter.route('/') .all(function(req,res,next) { res.writeHead(200, { 'Content-Type': 'text/plain' }); next(); }) .get(function(req,res,next){ res.end('Will send all the promotions to you!'); }) .post(function(req, res, next){ res.end('Will add the promotions: ' + req.body.name + ' with details: ' + req.body.description); }) .delete(fun...
ادامه مطلبVote count: 0 I'm trying to get the ID of a signed in user in Google Chrome using a separate function, however the gaiaId variable always seems to be 'undefined' even though userId contains the ID (I checked). How do I retu the id from the function that's called? function getGaia(){ chrome.identity.getProfileUserInfo(function(userInfo) { var userId = userInfo.id; alert(userId); retu userId; }); } var gaiaId = getGaia(); alert(gaiaId); asked 21 secs agoShmeelZanvill Let's block ads! بخوانید...
ادامه مطلبVote count: 0 Can anyone explain this (using node version 4.2.4 repl)? var n; //undefined /^[a-z0-9]+$/.test(n); // true! /^[a-f0-9]+$/.test(n); // false asked 16 secs agoVictor Grey Let's block ads! بخوانید...
ادامه مطلبVote count: 0 Sample code with actual results and Browser version (user agent): > [{count:1},{count:2},{count:3}].reduce(function(prev,curr){console.log(arguments);retu 5;}) [Object, Object, 1, Array[3]] [5, Object, 2, Array[3]] 5 > navigator.appVersion "5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36" Sample code with expected results: -> [{count:1},{count:2},{count:3}].reduce(function(prev,curr){console.log(arguments);retu 5;}) [0, Object, 0, Array[3]] [5, Object, 1, Array[3]] [5, Object, 2, Array[3]] 5 MDN Link: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce Another Link: https...
ادامه مطلبVote count: 0 I'm studying React and trying see what the benefits to using this library versus using straight HTML and javascript. So in the tutorial they offer up this simple example: var CommentBox = React.createClass({ render: function() { retu ( Comments ); } }); var CommentList = React.createClass({ render: function() { retu ( Hello, world! I am a CommentList. ); } }); var CommentForm = React.createClass({ render: function() { retu ( Hello, world! I am a CommentForm. ); } }); ReactDOM.render( , document.getElementById('container') ); https://jsfiddle.net/znibble/mvf6vr9k/ Which create3 3 elements. All that code above, just to create what is essentially a legacy HTML!!??: Comments Commen...
ادامه مطلبVote count: 0 I have table with 4 columns. Each row has set of 3 identical values and one different value. I want to highlight the one which has the different value than the rest of the three. How do I do it in react js ? asked 1 min agouser17422 Let's block ads! بخوانید...
ادامه مطلبVote count: 0 i have customized select option menu by java script but there is a problem,this code is not working when option tag is disabled or selected as true. i want this solution by javas cript. apple mango banana var select = document.getElementsByTagName('select'); var customselect = []; var menu = []; var items = []; for(var i = 0 ; iasked 47 secs agoAbdul Munem Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I need to run this bat script on an F:/ drive. Cd "c:WindowsSystem32inetsrv" appcmd stop apppool /apppool.name:mywebsite.com TIMEOUT /T 10 appcmd start apppool /apppool.name:mywebsite.com Is there a way to make it work? When I run this script ( from c: to c: ) , it works. But my watch dog php script is on an f:/ drive. Both the c: and f: are on the same server. asked 1 min agoAverage Joe Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I want to add dynamic data into this JavaScript. So how to do this? Please help me... Thanx in Advance $(document).ready(function(){ new jPlayerPlaylist({ jPlayer: "#jquery_jplayer_2", cssSelectorAncestor: "#jp_container_2" }, [ { title:"Do Pag Mar aur Bhul Ja", mp3:"http://download.apunkabollywood.us/songs/Audio/indian/movies/One Night Stand (2016)/01 - Do Peg Maar - Neha Kakkar @ fmw11.com.mp3", }, { title:"Your Face", mp3:"http://www.jplayer.org/audio/mp3/TSP-05-Your_face.mp3", oga:"http://www.jplayer.org/audio/ogg/TSP-05-Your_face.ogg" }, { title:"Cyber Soet", mp3:"http://www.jplayer.org/audio/mp3/TSP-07-Cybersoet.mp3", oga:"http://www.jplayer.org/audio/ogg/TSP-07-Cybersoet...
ادامه مطلبVote count: 0 I have developed a site with Google´s Apps Script, however, I need to put this within a Google site, the problem is when I insert the Apps Script's URL in the Google´s site this is not allowing to the script takes the full size of the page. Is there any form to do this? Thank you very much for all the help and orientation that you can give me. asked 1 min agoDarthAE Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I have an exam which mandates the use of 3.14 D8 javascript compiler.Can anyone point me out to where I can get Javascript d8 version 3.14.I searched a lot and I can't find it in the archives too??? asked 21 secs agouser5381186 Let's block ads! بخوانید...
ادامه مطلبVote count: 0 ive been working on a simple google map project where I want it to add marker of your actual location and also track your orientation based on your Iphones compass direction. So far I got everything working fine except for one little quirk. When i load the map alot of the times the icon dosent actually point to where you orientating your Iphone. I would usually have to point my phone usually oposite direction, reload the page and then it sorta gets it correctly. It dosent seem to be using actual compass data bu rather rotational data from the gyro. My code is quite long but this is the part that does all the magic. myLocationMarker = new google.maps.Marker({ clickable : false, ...
ادامه مطلبVote count: 0 I am trying since many day to build a simple demo autocomplete search form. I'm using javascript and typeahead.js library. I have a probleme to get all of them working together. I am using Elasticsearch service from amazon web services. When i type the first letter of the word am searching, the form doesn't suggest a list of words indexed in my cluster which start with the letter entered. I read the Completion suggester documentation but i don't understand how i can query completion suggester by using javascript. Here is my code : $('#remote .typeahead').typeahead({ highlight: true, }, { source: function(query, process){ $.ajax({ url:'https://xxxxxxxxxxxxxxx.es.amazonaws.com/xx...
ادامه مطلب