Questions

How to run cron once, daily at 10pm

I had entered: ``` * 22 * * * test > /dev/null ``` However, I am being notified via email that this is running every minute. I am confused I guess because I thought this was correct for what I am w...

6 Apr at 09:53

Issue with virtualenv - cannot activate

I created a virtualenv around my project, but when I try to activate it I cannot. It might just be syntax or folder location, but I am stumped right now. You can see below, I create the virtualenv an...

1 Dec at 02:21

php is null when empty?

I have a question regarding `NULL` in PHP: ``` $a = ''; if($a == NULL) { echo 'is null'; } ``` Why do I see when `$a` is an empty string? Is that a bug?

20 Jul at 12:29

Save the console.log in Chrome to a file

Does anyone know of a way to save the console.log output in Chrome to a file? Or how to copy the text out of the console? Say you are running a few hours of functional tests and you've got thousands...

2 Oct at 15:2

Why use 'git rm' to remove a file instead of 'rm'?

On SVN, removing something from the filesystem directly (rather than using svn) created a load of headaches. I haven't found this to be an issue when using `git`, but I notice that git has its own `rm...

15 Jan at 17:35

Where is body in a nodejs http.get response?

I'm reading the docs at [http://nodejs.org/docs/v0.4.0/api/http.html#http.request](http://nodejs.org/docs/v0.4.0/api/http.html#http.request), but for some reason, I can't seem to to actually find the ...

23 May at 15:21

Is an empty href valid?

One of our web developers uses the following html as a placeholder for styling a drop down list. ``` <a href="" class="arrow"></a> ``` Is this considered anchor tag valid? Since there is no href...

11 May at 04:57

JMS Topic vs Queues

I was wondering what is the difference between a JMS Queue and JMS Topic. [ActiveMQ page](http://activemq.apache.org/how-does-a-queue-compare-to-a-topic.html) says > ## Topics In JMS a Topic impl...

19 Mar at 10:42

Parse query string into an array

How can I turn a below into an ? ``` pg_id=2&parent_id=2&document&video ``` This is the array I am looking for, ``` array( 'pg_id' => 2, 'parent_id' => 2, 'document' => , 'video' ...

8 Dec at 01:18

For a boolean field, what is the naming convention for its getter/setter?

Eg. ``` boolean isCurrent = false; ``` What do you name its getter and setter?

Showing Difference between two datetime values in hours

I am retrieving two date time values from the database. Once the value is retrieved, I need the difference between the two values. For that, I create a timespan variable to store the difference of the...

20 Jan at 14:28

Convert [key1,val1,key2,val2] to a dict?

Let's say I have a list `a` in Python whose entries conveniently map to a dictionary. Each even element represents the key to the dictionary, and the following odd element is the value for example, ...

12 Jun at 17:21

How to set enum to null

I have an enum ``` string name; public enum Color { Red, Green, Yellow } ``` How to set it to NULL on load. ``` name = ""; Color color = null; //error ``` Edited: My bad, I didn't explai...

16 Jul at 11:13

How to sort in mongoose?

I find no doc for the sort modifier. The only insight is in the unit tests: [spec.lib.query.js#L12](https://github.com/Automattic/mongoose/blob/13d957f6e54d6a0b358ea61cf9437699079fd2d9/tests/unit/spec...

13 Dec at 08:15

Can I get the name of the current controller in the view?

Is there a way to figure out what the current controller is from within the view? For an example of why I would want to know this: if several controllers share the same layout, I may have a part in t...

How to escape double quotes in a title attribute

I am trying to use a string that contains double quotes in the title attribute of an anchor. So far I tried these: ``` <a href=".." title="Some \"text\"">Some text</a> <!-- The title looks like `Some...

11 Aug at 19:4

How can I get the current screen orientation?

I just want to set some flags when my orientation is in landscape so that when the activity is recreated in onCreate() i can toggle between what to load in portrait vs. landscape. I already have a lay...

What is the maximum float in Python?

I think the maximum integer in python is available by calling `sys.maxint`. What is the maximum `float` or `long` in Python? --- [Maximum and Minimum values for ints](https://stackoverflow.com/ques...

IIS7 deployment - duplicate 'system.web.extensions/scripting/scriptResourceHandler' section

On attempting to deploy a .net 3.5 website on the default app pool in IIS7 having the framework section set to 4.0, I get the following error. > There is a duplicate 'system.web.extensions/scriptin...

1 Jul at 08:39

How to split a dos path into its components in Python

I have a string variable which represents a dos path e.g: `var = "d:\stuff\morestuff\furtherdown\THEFILE.txt"` I want to split this string into: `[ "d", "stuff", "morestuff", "furtherdown", "THEFIL...

3 Jul at 18:38

How do I get the path of the current executed file in Python?

Is there a approach in Python, to find out the path to the file that is currently executing? ## Failing approaches ### path = os.path.abspath(os.path.dirname(sys.argv[0])) This does not work if...

10 Jan at 01:6

How do I get the "id" after INSERT into MySQL database with Python?

I execute an INSERT INTO statement ``` cursor.execute("INSERT INTO mytable(height) VALUES(%s)",(height)) ``` and I want to get the primary key. My table has 2 columns: ``` id primary, auto ...

24 Apr at 09:41

Getting the minimum of two values in SQL

I have two variables, one is called `PaidThisMonth`, and the other is called `OwedPast`. They are both results of some subqueries in SQL. How can I select the smaller of the two and return it as a val...

13 Dec at 00:22

How to insert &nbsp; in XSLT

How can I insert > `&nbsp;` Into an XSLT stylesheet, I keep getting this error: > XML Parsing Error: undefined entity Essentially I want a non breaking space character in the XSLT Template.

20 Aug at 20:4

Python memory leaks

I have a long-running script which, if let to run long enough, will consume all the memory on my system. Without going into details about the script, I have two questions: 1. Are there any "Best Pr...