How to get subarray from array?
I have `var ar = [1, 2, 3, 4, 5]` and want some function `getSubarray(array, fromIndex, toIndex)`, that result of call `getSubarray(ar, 1, 3)` is new array `[2, 3, 4]`.
- Modified
- 21 Mar at 17:14
How can I make my custom objects Parcelable?
I'm trying to make my objects Parcelable. However, I have custom objects and those objects have `ArrayList` attributes of other custom objects I have made. What would be the best way to do this?
- Modified
- 26 Oct at 13:23
Most efficient way to reverse a numpy array
Believe it or not, after profiling my current code, the repetitive operation of numpy array reversion ate a giant chunk of the running time. What I have right now is the common view-based method: ``` ...
How can I unstage my files again after making a local commit?
I have executed the following command ``` git add <foo.java> git commit -m "add the foo.java file" ``` How can I delete my local commit now and unstage foo.java? If I type `git reset --hard`, I fo...
- Modified
- 15 May at 14:52
Get month name from number
How can I get the month name from the month number? For instance, if I have `3`, I want to return `march` ``` date.tm_month() ``` How to get the string `march`?
Should ol/ul be inside <p> or outside?
Which is standard compliant between these two? ``` <p>Text text text ... <ol> <li>First element</li> </ol> </p> <p> Other text text ... </p> ``` ## OR ``` <p> Text text ...
- Modified
- 7 Jul at 21:56
Run a task every x-minutes with Windows Task Scheduler
I'm trying to get Windows Task Scheduler to run a particular .exe every 10 minutes or so, but the options only allow for once a day execution. Is there a way I can get it to run a .exe every 10 or 20...
- Modified
- 10 Aug at 17:4
JavaScript file upload size validation
Is there any way to check before uploading it using JavaScript?
- Modified
- 30 Jul at 21:32
How do I subtract one list from another?
I want to take the [difference](https://en.wikipedia.org/wiki/Complement_(set_theory)#Relative_complement) between lists `x` and `y`: ``` >>> x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> y = [1, 3, 5, 7, 9]...
Jquery - How to make $.post() use contentType=application/json?
I've noticed that when using $.post() in jquery that the default contentType is application/x-www-form-urlencoded - when my asp.net mvc code needs to have contentType=application/json (See this quest...
- Modified
- 17 Aug at 21:28
how do I query sql for a latest record date for each user
I have a table that is a collection entries as to when a user was logged on. ``` username, date, value -------------------------- brad, 1/2/2010, 1.1 fred, 1/3/2010, 1.0 bob, 8/4/...
- Modified
- 27 Aug at 06:18
Convert a timedelta to days, hours and minutes
I've got a timedelta. I want the days, hours and minutes from that - either as a tuple or a dictionary... I'm not fussed. I must have done this a dozen times in a dozen languages over the years but P...
Git command to display HEAD commit id?
What command can I use to print out the commit id of HEAD? This is what I'm doing by hand: ``` $ cat .git/HEAD ref: refs/heads/v3.3 $ cat .git/refs/heads/v3.3 6050732e725c68b83c35c873ff8808dff1c406e...
- Modified
- 1 Apr at 02:46
Entity Framework: "Store update, insert, or delete statement affected an unexpected number of rows (0)."
I am using Entity Framework to populate a grid control. Sometimes when I make updates I get the following error: > Store update, insert, or delete statement affected an unexpected number of rows (0)....
- Modified
- 6 Aug at 03:38
How to find the Number of CPU Cores via .NET/C#?
Is there a way via to find out the number of CPU cores? PS This is a straight code question, not a "Should I use multi-threading?" question! :-)
How do I automatically scroll to the bottom of a multiline text box?
I have a textbox with the .Multiline property set to true. At regular intervals, I am adding new lines of text to it. I would like the textbox to automatically scroll to the bottom-most entry (the n...
Enum ToString with user friendly strings
My enum consists of the following values: ``` private enum PublishStatusses{ NotCompleted, Completed, Error }; ``` I want to be able to output these values in a user friendly way though...
How to access the last value in a vector?
Suppose I have a vector that is nested in a dataframe with one or two levels. Is there a quick and dirty way to access the last value, without using the `length()` function? Something ala PERL's `$#...
Getting ssh to execute a command in the background on target machine
This is a follow-on question to the [How do you use ssh in a shell script?](https://stackoverflow.com/questions/29061/how-do-you-use-ssh-in-a-shell-script) question. If I want to execute a command on...
Missing visible-** and hidden-** in Bootstrap
In Bootstrap v3 I often use the hidden-** classes combined with clearfix to control multi column layouts at different screen widths. For example, I could combine multiple hidden-** in one DIV to mak...
- Modified
- 15 Dec at 13:43
Error message: "'chromedriver' executable needs to be available in the path"
I am using selenium with python and have downloaded the chromedriver for my windows computer from this site: [http://chromedriver.storage.googleapis.com/index.html?path=2.15/](http://chromedriver.stor...
- Modified
- 24 Apr at 22:46
How to export iTerm2 Profiles
I needed to reformat my computer and now I'm having trouble copying the settings/profiles over. I copied the files in `~/Library/Application\ Support/iTerm/` I also copied `~/Library/Preferences/com...
Find the closest ancestor element that has a specific class
How can I find an element's ancestor that is closest up the tree that has a particular class, ? For example, in a tree like so: ``` <div class="far ancestor"> <div class="near ancestor"> ...
- Modified
- 28 Aug at 02:17
Converting numpy dtypes to native python types
If I have a numpy dtype, how do I automatically convert it to its closest python data type? For example, ``` numpy.float32 -> "python float" numpy.float64 -> "python float" numpy.uint32 -> "python ...
Serializing with Jackson (JSON) - getting "No serializer found"?
I get the an exception when trying to serialize a very simple object using Jackson. The error: > org.codehaus.jackson.map.JsonMappingException: No serializer found for class MyPackage.TestA and no ...