How to mix numpy slices to list of indices?
◷
تاریخ انتشار: 1395/1/24 | ساعت: 8:07
Vote count: 0 I have a numpy.array, called grid, with shape: grid.shape = [N, M_1, M_2, ..., M_N] The values of N, M_1, M_2, ..., M_N are known only after initialization. For this example, let's say N=3 and M_1 = 20, M_2 = 17, M_3 = 9 I am trying to loop over this array, as follows: for indices, val...
Google App Engine: Only serve existing files in static directory
◷
تاریخ انتشار: 1395/1/24 | ساعت: 8:07
Vote count: 0 Is there a way to only serve existing files in a static directory? For example in my app.yaml file I have - url: /img static_dir: img Which works fine if you go to /img/exists.jpg. However if you go to /img/doesnt-exist.jpg you get an ugly Error: Not Found message. Is there a way to ma...
Cannot hide message box when I close modal overlay
◷
تاریخ انتشار: 1395/1/24 | ساعت: 8:07
Vote count: 0 I'm trying to create my own modal overlay. If you don't know what that is, it is an effect where you if you activate a certain element by clicking on it an black opaque overlay will show up on your screen, and usually a message box will be in the center of the overlay. I think I have s...
Assign a returned array from a function to a variable in c
◷
تاریخ انتشار: 1395/1/24 | ساعت: 6:49
Vote count: 0 I'm having trouble assigning a character array retu ed from a function to a variable in main. char *read(char filename[]) { int i = 0; am = 0; char line[80]; char *record[100]; FILE *infile; infile = fopen(filename, "r"); while (fgets(line, sizeof line, infile) != NULL) { record[i] = s...
How does python do list slices and modification on the LHS?
◷
تاریخ انتشار: 1395/1/24 | ساعت: 6:49
Vote count: 0 I know how thew syntax works for this, but I would like to know the process of how python replaces and alters the list on the left hand side. Ex. L = [0, 1, 2, 3, 4] L[0:2] = [5] print L #L is now [5, 2, 3, 4] So how does python go about the process above? This may be very unclear and ...
having problems with marker cluster on mobile phones?
◷
تاریخ انتشار: 1395/1/24 | ساعت: 6:49
Vote count: 0 I am using google maps V3 which working well on computer - but on mobile phone the marker cluster is not working correctly issues are on page load the map displays OK and shows clusters - i then click and its split the icons correctly - if i then click again on cluster to split again -...
SQL Query is slow when order by statement added
◷
تاریخ انتشار: 1395/1/24 | ساعت: 5:13
Vote count: 1 I have a table [Documents] with the following fields Name (string) Status (string) DateCreated [datetime] This table is around 1 million records. All three of these columns have an index (a single index for each one) When I run this query: select top 50 * from [Documents] where (Name =...
Neo4j: Create index for nodes with same property
◷
تاریخ انتشار: 1395/1/24 | ساعت: 5:13
Vote count: 0 I have a graph with many different elements but every element has a property "ID". Now i would like to CREATE INDEX ON :anyType(ID) How can i trigger the index creation for any type? asked 4 mins agoJoe Let's block ads! (Why?)
How to split a string on another string with space characters?
◷
تاریخ انتشار: 1395/1/24 | ساعت: 5:13
Vote count: 0 I'm having troubles with splitting a String with another String that has space characters in. Example: "Team 1 vs Team 2" I would like to split on " vs " (note the blank spaces before and after the vs). I tried "\svs\s", " vs ", "\s vs \s" but it does not work. asked 4 mins agoTiago Si...
In C/C++, do dereferencing and getting index zero do the same tihng?
◷
تاریخ انتشار: 1395/1/24 | ساعت: 4:12
Vote count: 0 I just tried this code: int i = 33; int * pi = &i; cout << "i: " << *pi << endl; cout << "i: " << pi[0] << endl; Both lines retu the same thing. Essentially, if I get index zero of any pointer, I'll get the value of the correct type at the location of the pointer. Isn't that the same t...
NoFlo UI Components Suddenly Broken ... Just One Box Visible That Says Wait Forward
◷
تاریخ انتشار: 1395/1/24 | ساعت: 4:12
Vote count: 0 Our NoFlo graph components have suddenly compressed themselves all into one uneditable box that says "WaitForward". See attached image. For a while, this was happening on every browser, except Opera, so I could go in there and update graphs. Then, a couple of weeks later, even Opera wo...
Rest-API V2 How to load specifiv Posts by ID?
◷
تاریخ انتشار: 1395/1/24 | ساعت: 4:12
Vote count: 0 I am using $.ajax({ url: 'http://localhost/wordpress-dev/mi/wp-json/wp/v2/cpt/', type: "GET", dataType: "json", }); to load posts of a custom post type. I have an array with ids and i need to modify the url to load only the posts with this ids. How is this possible? something like: url...
Override MVC form submit in js, but then override that
◷
تاریخ انتشار: 1395/1/24 | ساعت: 2:42
Vote count: 0 I have a view that has a delete button on it that makes a form in each row of the table @using (Html.BeginForm("Delete", "FP/WorkItem", new { fId = Model.FPId, workId = @w.FId })) { <input name="deleteWorkItem" type="submit" value="Delete" class="btn btn-default" onclick="retu confirm(...
Performance degradation on reading .txt files in Swift
◷
تاریخ انتشار: 1395/1/24 | ساعت: 2:42
Vote count: 0 I have a text file filled with numbers and reading the content of file as follows func arrayFromContentsOfFileWithName(fileName: String) -> [String]? { guard let path = NSBundle.mainBundle().pathForResource(fileName, ofType: "txt") else { retu nil } do { let content = try String(conten...
On Heroku, Is it possible for a single app to have multiple environments?
◷
تاریخ انتشار: 1395/1/24 | ساعت: 2:42
Vote count: 0 I would like to have at least two environments on Heroku for the same app, so we can use one of them for testing. Is it possible for a single app to have multiple environments? Or must we have multiple apps and treat each one of them as a different environment? asked 26 secs agoanquadr...
Javascript / Php content locking issue
◷
تاریخ انتشار: 1395/1/24 | ساعت: 1:18
Vote count: 0 I have a page on my website which id like to lock down the content to an article with a survey, I have added the JS survey script in the header of the page as instructed but it seems to be doing nothing asked 56 secs agoCosmin George Let's block ads! (Why?)
Combine elements from two arrays into subarrays in a third array
◷
تاریخ انتشار: 1395/1/24 | ساعت: 1:18
Vote count: 0 I'm starting with two equal-length arrays, and I'd like to create a new array made up of sub arrays, each of which are made from combining elements at each index of both arrays. Here is what I mean: // the 2 initial arrays: var arr1 = ["Quote1", "Quote2", "Quote3"]; var arr2 = ["Author...
Matlab sim command called from c# with MLApp
◷
تاریخ انتشار: 1395/1/24 | ساعت: 1:18
Vote count: 0 I am using the matlab COM object to automate matlab/simulink from c#. It works to read and write from workspace or to call functions. But the SIM command to run a Simulink model does not work. What could be the problem for this? Thanks in advance, Andreas asked 41 secs agoAndreas Bitte...
Getting current class
◷
تاریخ انتشار: 1395/1/24 | ساعت: 0:07
Vote count: 0 how can I get the current class in Kotlin. For example if there are the abstract class "Animal" and the child-class "Dog" (witch is a child of "Animal") how can I get the class of "Dog" in "Animal". I don't now witch classes will use "Animal" I already tried to use: this::class (what c...
How do I remove a key completely from Database
◷
تاریخ انتشار: 1395/1/24 | ساعت: 0:07
Vote count: 0 I want to completely remove a vehicle from geoFire, but when I run this: @Override public void onKeyExited(String key) { // Remove any old marker Marker marker = this.markers.get(key); if (marker != null) { marker.remove(); this.markers.remove(key); } } It is removed from the current v...