Call to undefined function curl_init()?
When i am going to implement Authorize.net payment gateway. However, I got this error: > Call to undefined function curl_init() Please let me know what is wrong in it.
How to convert float to int with Java
I used the following line to convert float to int, but it's not as accurate as I'd like: ``` float a=8.61f; int b; b=(int)a; ``` The result is : `8` (It should be `9`) When `a = -7.65f`, the re...
- Modified
- 14 Jun at 03:14
Comparing two dictionaries and checking how many (key, value) pairs are equal
I have two dictionaries, but for simplification, I will take these two: ``` >>> x = dict(a=1, b=2) >>> y = dict(a=2, b=2) ``` Now, I want to compare whether each `key, value` pair in `x` has the sa...
- Modified
- 29 Jul at 15:15
Make a Bash alias that takes a parameter?
I used to use CShell ([csh](/questions/tagged/csh)), which lets you make an alias that takes a parameter. The notation was something like ``` alias junk="mv \\!* ~/.Trash" ``` In Bash, this does no...
How to float 3 divs side by side using CSS?
I know how to make 2 divs float side by side, simply float one to the left and the other to the right. But how to do this with 3 divs or should I just use tables for this purpose?
How to download source in ZIP format from GitHub?
I see something strange like: [http://github.com/zoul/Finch.git](http://github.com/zoul/Finch.git) Now I'm not that CVS, SVN, etc. dude. When I open that in the browser it tells me that I did somet...
How can you use optional parameters in C#?
We're building a web API that's programmatically generated from a C# class. The class has method `GetFooBar(int a, int b)` and the API has a method `GetFooBar` taking query params like `&a=foo &b=ba...
- Modified
- 20 Mar at 17:38
How to copy to clipboard in Vim?
Is it possible to copy to clipboard directly from Vim? `yy` only copies stuff to Vim's internal buffer. I want to copy to the OS's clipboard. Is there any such command in Vim or you can only yank stuf...
How to update the value stored in Dictionary in C#?
How to update value for a specific key in a dictionary `Dictionary<string, int>`?
- Modified
- 1 Feb at 07:0
How to see the changes between two commits without commits in-between?
How do you make `git diff` only show the difference between two commits, excluding the other commits in-between?
URL Encoding using C#
I have an application which sends a POST request to the VB forum software and logs someone in (without setting cookies or anything). Once the user is logged in I create a variable that creates a path...
How to display HTML in TextView?
I have simple : ``` <h2>Title</h2><br> <p>description here</p> ``` I want to display HTML styled text it in `TextView`. How to do this?
- Modified
- 29 Aug at 22:7
Struct Constructor in C++?
Can a `struct` have a constructor in C++? I have been trying to solve this problem but I am not getting the syntax.
- Modified
- 10 Sep at 07:36
What is a plain English explanation of "Big O" notation?
I'd prefer as little formal definition as possible and simple mathematics.
- Modified
- 22 Jul at 15:40
How do you round a number to two decimal places in C#?
I want to do this using the `Math.Round` function
- Modified
- 26 Jun at 04:58
How to get names of enum entries?
I would like to iterate a TypeScript enum object and get each enumerated symbol name, for example: enum myEnum { entry1, entry2 } ``` for (var entry in myEnum) { // use entry's name here, e.g., "...
- Modified
- 5 Oct at 01:58
How to test if string exists in file with Bash?
I have a file that contains directory names: `my_list.txt` : ``` /tmp /var/tmp ``` I'd like to check in Bash before I'll add a directory name if that name already exists in the file.
jQuery get textarea text
Recently I have started playing with jQuery, and have been following a couple of tutorials. Now I feel slightly competent with using it (it's pretty easy), and I thought it would be cool if I were abl...
- Modified
- 31 May at 17:30
How to download a file with Node.js (without using third-party libraries)?
How do I download a file with Node.js ? I don't need anything special. I only want to download a file from a given URL, and then save it to a given directory.
- Modified
- 29 Jan at 14:27
MySQL string replace
I have a column containing urls (id, url): ``` http://www.example.com/articles/updates/43 http://www.example.com/articles/updates/866 http://www.example.com/articles/updates/323 http://www.example.co...
How do I convert a numpy array to (and display) an image?
I have created an array thusly: ``` import numpy as np data = np.zeros( (512,512,3), dtype=np.uint8) data[256,256] = [255,0,0] ``` What I want this to do is display a single red dot in the center o...
- Modified
- 27 Apr at 22:27
How to retrieve an element from a set without removing it?
Suppose the following: ``` >>> s = set([1, 2, 3]) ``` How do I get a value (any value) out of `s` without doing `s.pop()`? I want to leave the item in the set until I am sure I can remove it - some...
How to set Python's default version to 3.x on OS X?
I'm running Mountain Lion and the basic default Python version is 2.7. I downloaded Python 3.3 and want to set it as default. Currently: ``` $ python version 2.7.5 $ python3.3 version 3.3 ``...
- Modified
- 31 Aug at 14:57
How do I get the latest version of my code?
I'm using Git 1.7.4.1. I want to get the latest version of my code from the repository, but I'm getting errors: ``` $ git pull …. M selenium/ant/build.properties …. M selenium/scripts/linux/get_la...
- Modified
- 18 Feb at 09:32
How to add dividers and spaces between items in RecyclerView
This is an example of how it could have been done previously in the `ListView` class, using the and parameters: ``` <ListView android:id="@+id/activity_home_list_view" android:layout_width="...
- Modified
- 7 Jul at 21:17