Format date to MM/dd/yyyy in JavaScript
I have a dateformat like this `'2010-10-11T00:00:00+05:30'`. I have to format in to `MM/dd/yyyy` using JavaScript or jQuery . Anyone help me to do the same.
- Modified
- 23 Jul at 11:46
Gradle does not find tools.jar
I am using javadoc doclets with gradle, so I need to use the package tools.jar, which is in the lib folder from the jdk (1.6.0_26 in my case). The point is that gradle does not take it automatically,...
Error message 'java.net.SocketException: socket failed: EACCES (Permission denied)'
I get the error message > java.net.SocketException: socket failed: EACCES (Permission denied) when I try to apply the code below. This is the function I call and gives me this exception. ``` public...
ScalaTest in sbt: is there a way to run a single test without tags?
I know that a single test can be ran by running, in sbt, ``` testOnly *class -- -n Tag ``` Is there a way of telling sbt/scalatest to run a single test without tags? For example: ``` testOnly *cl...
Convert array of strings to List<string>
I've seen examples of this done using `.ToList()` on array types, this seems to be available only [in .Net 3.5+](http://msdn.microsoft.com/en-us/library/bb342261.aspx). I'm working with .NET Framework...
How to delete all records from table in sqlite with Android?
My app has two buttons, the first button is for deleting record on user input and the second button is for deleting all records. But when I want to delete data it shows the message "Your application h...
How does origin/HEAD get set?
I have a branch set up to track a ref in origin. `git checkout <branchname>` switches to that branch, and a `git status` will show me how far ahead or behind my branch is from origin, but I'm surpris...
- Modified
- 12 Jan at 18:48
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'db'
I want to begin writing queries in MySQL. `show grants` shows: ``` +--------------------------------------+ | Grants for @localhost | +--------------------------------------+ | GRANT ...
- Modified
- 20 Oct at 21:43
Get HTML5 localStorage keys
I'm just wondering how to get all key values in `localStorage`. --- I have tried to retrieve the values with a simple JavaScript loop ``` for (var i=1; i <= localStorage.length; i++) { alert...
- Modified
- 4 Nov at 10:19
How do I install a custom font on an HTML site
I am not using flash or php - and I have been asked to add a custom font to a simple HTML layout. "KG June Bug" I have it downloaded locally - is there a simple CSS trick to accomplish this?
- Modified
- 11 Apr at 22:4
One line if-condition-assignment
I have the following code ``` num1 = 10 someBoolValue = True ``` I need to set the value of `num1` to `20` if `someBoolValue` is `True`; and do nothing otherwise. So, here is my code for that ``` ...
- Modified
- 4 Dec at 12:15
Find out whether Chrome console is open
I am using this little script to find out whether Firebug is open: ``` if (window.console && window.console.firebug) { //is open }; ``` And it works well. Now I was searching for half an hour t...
- Modified
- 23 May at 12:34
Escaping keyword-like column names in Postgres
If the column in Postgres' table has the name `year`, how should look `INSERT` query to set the value for that column? E.g.: `INSERT INTO table (id, name, year) VALUES ( ... );` gives an error near t...
- Modified
- 4 Oct at 16:58
Prevent row names to be written to file when using write.csv
Commands: ``` t <- data.frame(v = 5:1, v2 = 9:5) write.csv(t, "t.csv") ``` Resulting file: ``` # "","v","v2" # "1",5,9 # "2",4,8 # "3",3,7 # "4",2,6 # "5",1,5 ``` How do I prevent first column w...
How to insert a line break before an element using CSS
I feel like I saw a way, using the CSS content property, to insert a line break tag before an element. Obviously this doesn't work: ``` #restart:before { content: '<br/>'; } ``` But how do you do t...
- Modified
- 18 Apr at 21:22
Compute the DateTime of an upcoming weekday
How can I get the date of next Tuesday? In PHP, it's as simple as `strtotime('next tuesday');`. How can I achieve something similar in .NET
SQL Server: converting UniqueIdentifier to string in a case statement
We have a log table that has a message column that sometimes has an exception stack trace. I have some criteria that determines if the message has this. We do not want to show these messages to the cu...
- Modified
- 8 Nov at 23:30
Get child node index
In straight up javascript (i.e., no extensions such as jQuery, etc.), is there a way to determine a child node's index inside of its parent node without iterating over and comparing all children nodes...
- Modified
- 12 Oct at 13:50
How to align a div to the top of its parent but keeping its inline-block behaviour?
See: [http://jsfiddle.net/b2BpB/1/](http://jsfiddle.net/b2BpB/1/) Q: How can you make box1 and box3 align to the top of the parent div `boxContainer`? ``` #boxContainerContainer { background: #fdd...
Accessing localhost (xampp) from another computer over LAN network - how to?
I have just set up a wi-fi network at home. I have all my files on my desktop computer (192.168.1.56) and want to access localhost over there from another computer (192.168.1.2). On my desktop I can a...
- Modified
- 9 Feb at 15:20
R memory management / cannot allocate vector of size n Mb
I am running into issues trying to use large objects in R. For example: ``` > memory.limit(4000) > a = matrix(NA, 1500000, 60) > a = matrix(NA, 2500000, 60) > a = matrix(NA, 3500000, 60) Error: canno...
- Modified
- 6 Jul at 14:13
Get Insert Statement for existing row in MySQL
Using MySQL I can run the query: ``` SHOW CREATE TABLE MyTable; ``` And it will return the create table statement for the specificed table. This is useful if you have a table already created, and w...
How do you read a file into a list in Python?
I want to prompt a user for a number of random numbers to be generated and saved to a file. He gave us that part. The part we have to do is to open that file, convert the numbers into a list, then fin...
How do I use InputFilter to limit characters in an EditText in Android?
I want to restrict the chars to 0-9, a-z, A-Z and spacebar only. Setting inputtype I can limit to digits but I cannot figure out the ways of Inputfilter looking through the docs.
- Modified
- 28 Jul at 00:49
Remove columns from dataframe where ALL values are NA
I have a data frame where some of the columns contain NA values. How can I remove columns where rows contain NA values?