How to combine two same lengths array into one same length array with element joined by a separator
◷
تاریخ انتشار: 1395/4/29 | ساعت: 8:43
Vote count: -1 Given a=["a", "b", "c"]; x=["x", "y", "z"]; combine/join the two list: the expected result: ax=["a:x", "b:y", "c:z"]; How? Thanks asked 1 min agomilesma 1 Answer Vote count: 1 var ax = []; for (var i = 0; i < a.length; i++) { ax.push(a[i] + ":" + x[i]); } answered 22 secs agosmarx Let...
Avoid SIGSEGV when subsetting data.frame with call to `[data.frame` in Rcpp
◷
تاریخ انتشار: 1395/4/29 | ساعت: 8:43
Vote count: 0 My Rcpp code is occasionally failing (SEGFAULT, etc.) for reasons I don't understand. The code creates a large data.frame, and then tries to obtain a subset of this data.frame by calling the R subset function, [.data.frame), from within the same method that is creating the frame. A ver...
Append an INSERT into SQL by a loop
◷
تاریخ انتشار: 1395/4/29 | ساعت: 5:45
Vote count: 0 I want to generate an "insert into" SQL by a loop. $orderrecord='INSERT into counter SET'; for ($rank=0; $rank<10; $rank++) { if (array_search($names[$rank],$POST['v'])!==FALSE) { $orderrecord.=" $names[$rank]=1, "; } ;} The problem is, there will always be 1 extra comma that render th...
How do I close a popup window after running a Javascript function in Chrome?
◷
تاریخ انتشار: 1395/4/29 | ساعت: 5:45
Vote count: 0 I have a hyperlink that runs a function, refreshes a parent window and closes a popup window. <a href="#" onclick="javascript:DoSave(); window.opener.location.reload(); window.close('Edit')">Save Record</a>" The link works correctly in both FF and IE but for some reason not Chrome. In ...
gSOAP communication is always interrupted
◷
تاریخ انتشار: 1395/4/29 | ساعت: 5:45
Vote count: 0 I am trying to test my proxy object and co ecting to server, but somehow it's not receiving response at all. After I spent a day googling around I did not find anything related to the issue. Error -1 fault at source [no subcode] "End of file or no input: message transfer interrupted or...
Error message "Could not authenticate you" with code 32 when calling twitter API?
◷
تاریخ انتشار: 1395/4/29 | ساعت: 4:44
Vote count: 0 When calling this api: https://api.twitter.com/1.1/followers/list.json?amp%3Binclude_user_entities=false&%3Bscreen_name=twitterdev&%3Bskip_status=true&cursor=-1 with the following Authorization: OAuth oauth_consumer_key="XXXXXXXXXXXXXXXXXXXXXXXXX", oauth_nonce="0ddddff20481ae3567...
couchDB no result searching the DB with curl
◷
تاریخ انتشار: 1395/4/29 | ساعت: 4:44
Vote count: 0 I don't understand why query in javascript retu s a result whereas the curl command doesn't : usersDatabase.query(mapByEmail, { key: email, include_docs: true }).then(function (result) { if (!result.rows.length) { //email doesn't exist in DB retu callback(false); } if (result.rows.leng...
Can't figure out how to construct HIT from XML template using boto?
◷
تاریخ انتشار: 1395/4/29 | ساعت: 4:44
Vote count: 0 In the past, I have created my HITs for Mechanical Turk using the cmd line tool. Here is the command I have used in the past to create my HITs. I am now trying to write a script which will do this automatically using Python and Boto. ./loadHITs.sh -input /Users/xyz/mturk/1/input.test.c...
Xquery: Counting the number of occurrences of a term in each record within a set of records
◷
تاریخ انتشار: 1395/4/29 | ساعت: 3:18
Vote count: 0 Given a set of xml records and a set of terms $terms . The terms in $terms sequence are extracted from the set of records. I want to count the number of occurrences of each term in each paragraph record. I used the following code to do so: for $record in /rec:Record for $term in $terms...
How to return an object in laravel 5.2
◷
تاریخ انتشار: 1395/4/29 | ساعت: 3:18
Vote count: 0 I need to retu an object of class User in laravel 5.2 but all I get is 'Undefined variable: user' and I am sure that I am logged and there is an instance of the User. The code is: $name = 'Random'; $this->createCustomer($name); dd($user); public function createCustomer($name) { $user =...
Generate a vector of functions
◷
تاریخ انتشار: 1395/4/29 | ساعت: 3:18
Vote count: 0 I have a function of a single variable, and various parameters. For each value of one of the parameters (the others are fixed) there is a single root of the function. From a vector of the parameter I would like to generate a vector of the roots (using uniroot). The actual example I'm w...
Reading the XMl Response and Extracting the nodes using c#
◷
تاریخ انتشار: 1395/4/29 | ساعت: 1:56
Vote count: 0 I am trying to extract the XML Response from an API. My XML response looks like below. I tried different methods. can you please help me in reading and extracting the individual nodes from the XMl response. For Example: I want to extract node from below XML response. 54378451898093/24/...
Can I use ternary operator with a lambda expression?
◷
تاریخ انتشار: 1395/4/29 | ساعت: 1:56
Vote count: 0 I am trying to understand if I can use te ary operators within a lambda expression. For example: public class Foo { public int ID {get; set;} public string Name {get; set;} public Address MyAdd {get; set;} } I then want to do something like this: var config = new MapperConfiguration(c ...
How do I make a navigation bar stay visible with UISearchController?
◷
تاریخ انتشار: 1395/4/29 | ساعت: 1:56
Vote count: 0 So I have a navigation controller hooked up to a view controller. That obviously provides the default navigation bar. Below that, I have another navigation bar with two buttons. In code I am manually adding the search bar that the UISearchController provides to that navigation bar. Bel...
papal plus malformed_request JSON with shipping address
◷
تاریخ انتشار: 1395/4/29 | ساعت: 0:51
Vote count: 0 To show the Paypal plus iFrame (REST API) i make a Request with JSON {"intent": "sale","experience_profile_id": "XP-XXXX-XXXX-XXX-XXX","redirect_urls": {"retu _url": "https://www.XXXXXXX.de/bestellen.php","cancel_url": "https://www.XXXXXXX.de/zahlungabbruch.php"}, "payer": { "payment_m...
Beginner...WinForm DataGridView Multi-Line
◷
تاریخ انتشار: 1395/4/29 | ساعت: 0:51
Vote count: 0 This is my DataGridView. I'd like to make multiple lines. From: 1abcdefghijklmno To: 1abcdefghijklmno pqrstuvwxyzabcde fghijklmnopqrstu vwxyz What do I have to do ? My codes: private void Form1_Load(object sender, EventArgs e) { var myArray1 = new string[] { "1abcdefghijklmnopqrstuvwxy...
I have a column of functions in an excel workbook that i want to be executed after a minute. How can i do this?
◷
تاریخ انتشار: 1395/4/29 | ساعت: 0:51
Vote count: 0 In my excel file, I have a column with about 100 functions that run continuously. I want to time them to run once every minute or so, and then save the file. Can someone please help me out with this? asked 27 secs agoEdmond Let's block ads! (Why?)
Meteor.wrapAsync type Error
◷
تاریخ انتشار: 1395/4/28 | ساعت: 22:54
Vote count: 0 I am trying to call a very basic function with a callback from Meteor.methods. The function I'm calling is "fakeInit" and is defined as follow: var session.prototype.fakeInit = function(user,labId,callback){ callback(null,"here"); } My call is in Meteor.methods, the method call gets ha...
Call async method in an inner lambda?
◷
تاریخ انتشار: 1395/4/28 | ساعت: 22:54
Vote count: 0 I have the following code let rec consume() : Async<unit> = async { ..... listA |> Seq.iter(fun i -> ..... let listB : seq<...> option = let c = getListB a b match c with | Some d -> Seq.filter(....) |> Some | None -> None Now the function getListB is converted to retu async<Seq<B>> in...
Issue with Firebase deployment
◷
تاریخ انتشار: 1395/4/28 | ساعت: 22:54
Vote count: 0 Obviously I am missing something (!)obvious but I simply ca ot deploy my app to firebase. I am following this google guide for progressive web apps. Web server didn't work for me ( to access my app from other devices ), so I tried using firebase as was suggested in the end of the guide...