How to return a string value from a Bash function
I'd like to return a string from a Bash function. I'll write the example in java to show what I'd like to do: ``` public String getSomeString() { return "tadaa"; } String variable = getSomeString...
- Modified
- 2 Nov at 21:14
How to write a simple Html.DropDownListFor()?
In ASP.NET MVC 2, I'd like to write a very simple dropdown list which gives static options. For example I'd like to provide choices between "Red", "Blue", and "Green".
- Modified
- 25 Aug at 20:31
Wait .5 seconds before continuing code VB.net
I have a code and I want it to wait somewhere in the middle before going forward. After the WebBrowser1.Document.Window.DomWindow.execscript("checkPasswordConfirm();","JavaScript") I want it to wait ....
Safe String to BigDecimal conversion
I'm trying to read some BigDecimal values from the string. Let's say I have this String: "1,000,000,000.999999999999999" and I want to get a BigDecimal out of it. What is the way to do it? First of a...
- Modified
- 30 May at 07:18
Does Notepad++ show all hidden characters?
In Notepad++ I have set "replace tab with 2 spaces". When coding in Python I copy-pasted some code from the web and it appeared indented correctly. But running the code resulted in indentation errors...
- Modified
- 26 Jun at 18:45
C# listView, how do I add items to columns 2, 3 and 4 etc?
To add items to column 1 in my `listView` control (`Winform`) I'm using `listView1.Items.Add`, this works fine but how do I add items to columns 2 and 3 etc?
How to use CURL via a proxy?
I am looking to set curl to use a proxy server. The url is provided by an html form, which has not been a problem. Without the proxy it works fine. I have found code on this and other sites, but they ...
Operation Not Permitted when on root - El Capitan (rootless disabled)
I am trying to move something to on OS X El Capitan. I have disabled rootless using the following commands: `sudo nvram boot-args="rootless=0"; sudo reboot`, but I keep getting the same error: ``` ...
- Modified
- 7 Jan at 12:0
Basic example of using .ajax() with JSONP?
Please could someone help me work out how to get started with JSONP? Code: ``` $('document').ready(function() { var pm_url = 'http://twitter.com/status'; pm_url += '/user_timeline/stephenfry...
How to post data in PHP using file_get_contents?
I'm using PHP's function `file_get_contents()` to fetch contents of a URL and then I process headers through the variable `$http_response_header`. Now the problem is that some of the URLs need some d...
- Modified
- 3 Nov at 10:46
VBA Excel sort range by specific column
I have a table that can contain any number of rows: ![enter image description here](https://i.stack.imgur.com/LwwBf.png) As I said it can contain 1 or ∞ rows. I want to sort range `A3:D∞` by the Da...
Boolean vs boolean in Java
There are discussions around `Integer` vs `int` in Java. The default value of the former is `null` while in the latter it's `0`. How about `Boolean` vs `boolean`? A variable in my application can ha...
In a Django form, how do I make a field readonly (or disabled) so that it cannot be edited?
In a Django form, how do I make a field read-only (or disabled)? When the form is being used to create a new entry, all fields should be enabled - but when the record is in update mode some fields ne...
How to set gradle home while importing existing project in Android studio
How to set gradle home while importing existing project in Android studio. While trying to import I need to set up this path. ![enter image description here](https://i.stack.imgur.com/e2k3g.png)
- Modified
- 21 May at 15:33
What is the difference between React Native and React?
I have started to learn out of curiosity and wanted to know the difference between React and React Native - though could not find a satisfactory answer using Google. React and React Native seems to h...
- Modified
- 21 Jan at 12:36
Pass a PHP array to a JavaScript function
I am trying to get a PHP array variable into a JavaScript variable. This is my code: ``` <html> <head> <script type="text/javascript"> function drawChart(row,day,week,month...
- Modified
- 26 Sep at 17:28
When do Java generics require <? extends T> instead of <T> and is there any downside of switching?
Given the following example (using JUnit with Hamcrest matchers): ``` Map<String, Class<? extends Serializable>> expected = null; Map<String, Class<java.util.Date>> result = null; assertThat(result, ...
How to trim a string to N chars in Javascript?
How can I, using Javascript, make a function that will trim string passed as argument, to a specified length, also passed as argument. For example: ``` var string = "this is a string"; var length = 6...
- Modified
- 13 Sep at 21:4
How to remove outliers from a dataset
I've got some multivariate data of beauty vs ages. The ages range from 20-40 at intervals of 2 (20, 22, 24....40), and for each record of data, they are given an age and a beauty rating from 1-5. When...
- Modified
- 11 Mar at 02:35
How to run a class from Jar which is not the Main-Class in its Manifest file
I have a JAR with 4 classes, each one has Main method. I want to be able to run each one of those as per the need. I am trying to run it from command-line on Linux box. ``` E.g. The name of my JAR is...
- Modified
- 29 Mar at 15:2
How best to include other scripts?
The way you would normally include a script is with "source" eg: main.sh: ``` #!/bin/bash source incl.sh echo "The main script" ``` incl.sh: ``` echo "The included script" ``` The output of ...
- Modified
- 22 Feb at 01:28
How do I get today's date in C# in mm/dd/yyyy format?
How do I get today's date in C# in mm/dd/yyyy format? I need to set a string variable to today's date (preferably without the year), but there's got to be a better way than building it month-/-day 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
How do I install Java on Mac OSX allowing version switching?
I want to install OpenJDK Java on Mac OSX and have it work alongside other JDK's since it is a newer release. Currently, I downloaded the tar.gz and placed it in my path but that is hard to maintain....