Questions

CSS3 Rotate Animation

``` <img class="image" src="" alt="" width="120" height="120"> ``` Cannot get this animated image to work, it is supposed to do a 360 degrees rotation. I guess something's wrong with the CSS below,...

3 Dec at 23:4

Passing a 2D array to a C++ function

I have a function which I want to take, as a parameter, a 2D array of variable size. So far I have this: ``` void myFunction(double** myArray){ myArray[x][y] = 5; etc... } ``` And I ha...

How do I save a stream to a file in C#?

I have a `StreamReader` object that I initialized with a stream, now I want to save this stream to disk (the stream may be a `.gif` or `.jpg` or `.pdf`). Existing Code: ``` StreamReader sr = new Str...

12 Oct at 10:21

Check if an array contains any element of another array in JavaScript

I have a target array `["apple","banana","orange"]`, and I want to check if other arrays contain any one of the target array elements. For example: ``` ["apple","grape"] //returns true; ["apple",...

21 Jul at 06:29

How do I restrict a float value to only two places after the decimal point in C?

How can I round a float value (such as 37.777779) to two decimal places (37.78) in C?

6 Mar at 13:51

Update statement with inner join on Oracle

I have a query which works fine in MySQL, but when I run it on Oracle I get the following error: > SQL Error: ORA-00933: SQL command not properly ended 00933. 00000 - "SQL command not properly end...

20 Nov at 09:39

Delete first character of string if it is 0

I want to delete the first character of a string, if the first character is a 0. The 0 can be there more than once. Is there a simple function that checks the first character and deletes it if it is...

9 Apr at 14:44

How to install Boost on Ubuntu

I'm on Ubuntu, and I want to install Boost. I tried with ``` sudo apt-get install boost ``` But there was no such package. What is the best way to install Boost on Ubuntu?

3 Sep at 14:42

Find objects between two dates MongoDB

I've been playing around storing tweets inside mongodb, each object looks like this: ``` { "_id" : ObjectId("4c02c58de500fe1be1000005"), "contributors" : null, "text" : "Hello world", "user" : { ...

Generate a Hash from string in Javascript

I need to convert strings to some form of hash. Is this possible in JavaScript? I'm not utilizing a server-side language so I can't do it that way.

24 Jul at 09:6

Adding a parameter to the URL with JavaScript

In a web application that makes use of AJAX calls, I need to submit a request but add a parameter to the end of the URL, for example: Original URL: > [http://server/myapp.php?id=10](http://server/m...

How can I remove a package from Laravel using PHP Composer?

What is the correct way to remove a package from Laravel using PHP Composer? So far I've tried: 1. Remove declaration from file composer.json (in the "require" section) 2. Remove any class aliases fr...

Proper way to return JSON using node or Express

So, one can attempt to fetch the following JSON object: ``` $ curl -i -X GET http://echo.jsontest.com/key/value/anotherKey/anotherValue HTTP/1.1 200 OK Access-Control-Allow-Origin: * Content-Type: ap...

31 Oct at 00:16

How do you get the current time of day?

How do you get the current time (not date AND time)? Example: 5:42:12 PM

3 Feb at 09:24

Moment.js transform to date object

Using Moment.js I can't transform a correct moment object to a date object with timezones. I can't get the correct date. ``` var oldDate = new Date(), momentObj = moment(oldDate).tz("MST7MDT"),...

10 Sep at 02:2

Why do I get the syntax error "SyntaxError: invalid syntax" in a line with perfectly valid syntax?

I have this code: ``` def Psat(self, T): pop= self.getPborder(T) boolean=int(pop[0]) P1=pop[1] P2=pop[2] if boolean: Pmin = float(min([P1, P2])) Pmax = float(ma...

5 Nov at 20:44

How to get first character of string?

I have a string, and I need to get its first character. ``` var x = 'somestring'; alert(x[0]); //in ie7 returns undefined ``` How can I fix my code?

20 Mar at 07:12

Proper way to declare custom exceptions in modern Python?

What's the proper way to declare custom exception classes in modern Python? My primary goal is to follow whatever standard other exception classes have, so that (for instance) any extra string I inclu...

9 Feb at 10:34

ORA-12505, TNS:listener does not currently know of SID given in connect descriptor

I have installed Oracle 11g Express Edition Release 2 in my windows 7 64 bit OS and tried to execute JDBC program, then I got the following error: ``` java.sql.SQLException: Listener refused the conn...

23 May at 07:6

What does "SyntaxError: Missing parentheses in call to 'print'" mean in Python?

When I try to use a `print` statement in Python, it gives me this error: ``` >>> print "Hello, World!" File "<stdin>", line 1 print "Hello, World!" ^ SyntaxError: Missin...

5 Jun at 16:27

How to apply a function to two columns of Pandas dataframe

Suppose I have a `df` which has columns of `'ID', 'col_1', 'col_2'`. And I define a function : `f = lambda x, y : my_function_expression`. Now I want to apply the `f` to `df`'s two columns `'col_1',...

20 Jan at 11:2

How to declare a variable in MySQL?

How to declare a variable in mysql, so that my second query can use it? I would like to write something like: ``` SET start = 1; SET finish = 10; SELECT * FROM places WHERE place BETWEEN start AND ...

22 Nov at 03:42

How can I revert multiple Git commits?

I have a Git repository that looks like this: ``` A <- B <- C <- D <- HEAD ``` I want the head of the branch to point to A, i.e., I want B, C, D, and HEAD to disappear and I want head to be synonymou...

14 May at 19:47

Using String Format to show decimal up to 2 places or simple integer

I have got a price field to display which sometimes can be either 100 or 100.99 or 100.9, What I want is to display the price in 2 decimal places only if the decimals are entered for that price , for ...

Import error: No module name urllib2

Here's my code: ``` import urllib2.request response = urllib2.urlopen("http://www.google.com") html = response.read() print(html) ``` Any help?

17 Jan at 06:5