Questions

jQuery how to bind onclick event to dynamically added HTML element

I want to bind an onclick event to an element I insert dynamically with jQuery But It never runs the binded function. I'd be happy if you can point out why this example is not working and how I can g...

23 May at 05:41

How to request Administrator access inside a batch file

I am trying to write a batch file for my users to run from their Vista machines with UAC. The file is re-writing their hosts file, so it needs to be run with Administrator permissions. I need to be ...

Starting ssh-agent on Windows 10 fails: "unable to start ssh-agent service, error :1058"

When I try to start the ssh-agent on Windows 10 via PowerShell (with elevated right or without) by entering `Start-Service ssh-agent` I get the error > unable to start ssh-agent service, error :1058 ...

31 Aug at 10:44

Inserting a string into a list without getting split into characters

I'm new to Python and can't find a way to insert a string into a list without it getting split into individual characters: ``` >>> list=['hello','world'] >>> list ['hello', 'world'] >>> list[:0]='foo...

23 Nov at 13:42

Vim and Ctags tips and tricks

I have just installed [Ctags](http://en.wikipedia.org/wiki/Ctags) (to help with C++ development) with my Vim (or rather gVim), and would like to find out your favorite commands, macros, shortcuts, tip...

2 Feb at 12:53

Changing MongoDB data store directory

Until now I have not been specifying a MongoDB data directory and have had only one 30 GB primary partition. I just ran out of space and added a new hard disk. How can I transfer my data (that is app...

27 Jul at 16:15

mysql delete under safe mode

I have a table instructor and I want to delete the records that have salary in a range An intuitive way is like this: ``` delete from instructor where salary between 13000 and 15000; ``` However, ...

17 Feb at 23:25

How to check if iframe is loaded or it has a content?

I have an iframe with id = "myIframe" and here my code to load it's content : ``` $('#myIframe').attr("src", "my_url"); ``` The problem is sometimes it take too long for loading and sometimes it l...

15 Dec at 11:44

Binding a list in @RequestParam

I'm sending some parameters from a form in this way: ``` myparam[0] : 'myValue1' myparam[1] : 'myValue2' myparam[2] : 'myValue3' otherParam : 'otherValue' anotherParam : 'anotherVal...

Maximum number of records in a MySQL database table

What is the upper limit of records for MySQL database table. I'm wondering about autoincrement field. What would happen if I add milions of records? How to handle this kind of situations? Thx!

16 Apr at 10:59

C++ floating point to integer type conversions

What are the different techniques used to convert float type of data to integer in C++? ``` #include <iostream> using namespace std; struct database { int id, age; float salary; }; int main() {...

There isn't anything to compare. Nothing to compare, branches are entirely different commit histories

I have a CMS theme installed on my machine. I'm tracking changes to it via git and decided to back it up on GitHub so I could share those changes. The theme as provided is also available on GitHub. O...

28 Apr at 20:55

Convert binary to ASCII and vice versa

Using this code to take a string and convert it to binary: ``` bin(reduce(lambda x, y: 256*x+y, (ord(c) for c in 'hello'), 0)) ``` this outputs: ``` 0b110100001100101011011000110110001101111 ``` ...

23 May at 15:0

adb not finding my device / phone (MacOS X)

Doing Android development on a Mac and this phone I have doesn't show up in the devices list in . Lots of other phones and devices work fine for me so I know my setup is good. I have debugging enabl...

8 Nov at 02:32

Return 0 if field is null in MySQL

In MySQL, is there a way to set the "total" fields to zero if they are NULL? Here is what I have: ``` SELECT uo.order_id, uo.order_total, uo.order_status, (SELECT SUM(uop.price * uop.qty...

18 Dec at 04:37

default value for struct member in C

Is it possible to set default values for some struct member? I tried the following but, it'd cause syntax error: ``` typedef struct { int flag = 3; } MyStruct; ``` Errors: ``` $ gcc -o testIt te...

5 Dec at 05:32

document.createElement("script") synchronously

Is it possible to call in a `.js` file synchronously and then use it immediately afterward? ``` <script type="text/javascript"> var head = document.getElementsByTagName('head').item(0); var s...

14 Jul at 20:39

What should I set JAVA_HOME environment variable on macOS X 10.6?

Many Java applications that use shell scripts to configure their environment use the `JAVA_HOME` environment variable to start the correct version of Java, locate JRE JARs, and so on. In macOS X 10.6...

14 Apr at 09:49

How to redirect a URL path in IIS?

In IIS 6.0, is there an easy way to re-direct requests to a folder to another folder, while preserving the rest of the path. e.g. If I have moved the content from: mysite.org.uk/stuff to stuff.mysit...

6 Jun at 15:54

Shell script to delete directories older than n days

I have directories named as: ``` 2012-12-12 2012-10-12 2012-08-08 ``` How would I delete the directories that are older than 10 days with a bash shell script?

4 Jan at 01:9

Send JSON via POST in C# and Receive the JSON returned?

This is my first time ever using JSON as well as `System.Net` and the `WebRequest` in any of my applications. My application is supposed to send a JSON payload, similar to the one below to an authenti...

8 Jun at 07:33

Create a list from two object lists with linq

I have the following situation ``` class Person { string Name; int Value; int Change; } List<Person> list1; List<Person> list2; ``` I need to combine the 2 lists into a new `List<Perso...

7 Apr at 15:29

SQL Query - Change date format in query to DD/MM/YYYY

What I'm trying to achieve is fairly straight forward, to get one date format to another; From This: `Jan 30 2013 12:00:00:000AM` To This: `DD/MM/YYYY` or in this case `30/01/2013` However, when it'...

10 Jul at 09:5

Use and meaning of "in" in an if statement?

In an example from Zed Shaw's , one of the exercises displays the following code: ``` next = raw_input("> ") if "0" in next or "1" in next: how_much = int(next) ``` I'm having a hard time under...

27 Jun at 18:40

C# generics syntax for multiple type parameter constraints

> [Generic methods and multiple constraints](https://stackoverflow.com/questions/588643/generic-methods-and-multiple-constraints) I need a generic function that has two type constraints, each ...

23 May at 11:55