Questions

How to get visitor's location (i.e. country) using geolocation?

I'm trying to extend the native geolocation function ``` if(navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position) { var latitude = position.coords.latitude;...

31 Oct at 14:33

Count number of rows matching a criteria

I am looking for a command in R which is equivalent of this SQL statement. I want this to be a very simple basic solution without using complex functions OR dplyr type of packages. ``` Select count(*...

28 Jan at 16:23

Dynamically generating a QR code with PHP

I'm trying to generate QR codes on my website. All they have to do is have a URL in them, which a variable on my site will provide. What would be the easiest way to do this?

16 Mar at 22:9

How to get file creation date/time in Bash/Debian?

I'm using Bash on Debian GNU/Linux 6.0. Is it possible to get the file creation date/time? Not the modification date/time. `ls -lh a.txt` and `stat -c %y a.txt` both only give the modification time.

12 Feb at 21:30

What are forward declarations in C++?

At [this](http://www.learncpp.com/cpp-tutorial/19-header-files/) link, the following was mentioned: add.cpp: ``` int add(int x, int y) { return x + y; } ``` main.cpp: ``` #include <iostream> in...

31 Jul at 23:24

‘ld: warning: directory not found for option’

When I'm building my Xcode 4 apps I'm getting this warning: ``` ld: warning: directory not found for option '-L/Users/frenck/Downloads/apz/../../../Downloads/Google Analytics SDK/Library' ld: warnin...

15 Oct at 14:46

How to change the background color of a UIButton while it's highlighted?

At some point in my app I have a highlighted `UIButton` (for example when a user has his finger on the button) and I need to change the background color while the button is highlighted (so while the f...

10 Feb at 09:17

How can I clear previous output in Terminal in Mac OS X?

I know the `clear` command that 'clears' the current screen, but it does this just by printing lots of newlines - the cleared contents just get scrolled up. Is there a way to completely wipe all previ...

28 Aug at 11:57

yum error "Cannot retrieve metalink for repository: epel. Please verify its path and try again" updating ContextBroker

I'm trying to update Orion ContextBroker using the command yum install contextBroker. Unfortunatelly I get the following error: > Loaded plugins: fastestmirror, refresh-packagekit, security Loadingm...

4 Nov at 12:8

How to get file_get_contents() to work with HTTPS?

I'm working on setting up credit card processing and needed to use a workaround for CURL. The following code worked fine when I was using the test server (which wasn't calling an SSL URL), but now whe...

17 Feb at 11:48

What is time_t ultimately a typedef to?

I searched my Linux box and saw this typedef: ``` typedef __time_t time_t; ``` But I could not find the `__time_t` definition.

6 Apr at 19:49

Convert date field into text in Excel

I have an Excel file which has a column formatted as date in the format `dd-mm-YYYY`. I need to convert that field to text. If I change the field type excel converts it to a strange value (like `4060...

Resizing an iframe based on content

I am working on an iGoogle-like application. Content from other applications (on other domains) is shown using iframes. How do I resize the iframes to fit the height of the iframes' content? I've t...

30 Mar at 12:10

How do you force Visual Studio to regenerate the .designer files for aspx/ascx files?

Sometimes when I'm editing page or control the .designer files stop being updated with the new controls I'm putting on the page. I'm not sure what's causing this to happen, but I'm wondering if there...

How does Facebook Sharer select Images and other metadata when sharing my URL?

When using Facebook Sharer, Facebook will offer the user the option of using 1 of a few images pulled from the source as a preview for their link. How are these images selected, and how can I ensure t...

Sorting a set of values

I have values like this: ``` set(['0.000000000', '0.009518000', '10.277200999', '0.030810999', '0.018384000', '4.918560000']) set(['4.918859000', '0.060758000', '4.917336999', '0.003949999', '0.01394...

3 Jul at 21:9

Can I use break to exit multiple nested 'for' loops?

Is it possible to use the `break` function to exit several nested `for` loops? If so, how would you go about doing this? Can you also control how many loops the `break` exits?

13 Jan at 18:33

How do I align spans or divs horizontally?

My only problem is making them line up three-across and have equal spacing. Apparently, spans can not have width and divs (and spans with display:block) don't appear horizontally next to each other. S...

22 Oct at 14:33

PHP If Statement with Multiple Conditions

I have a variable`$var`. I want echo `"true"` if `$var` is equal to any of the following values `abc`, `def`, `hij`, `klm`, or `nop`. Is there a way to do this with a single statement like `&&`??

8 Jul at 19:4

How do you truncate all tables in a database using TSQL?

I have a test environment for a database that I want to reload with new data at the start of a testing cycle. I am not interested in rebuilding the entire database- just simply "re-setting" the data. ...

19 Oct at 10:55

Generating a random & unique 8 character string using MySQL

I'm working on a game which involves vehicles at some point. I have a MySQL table named "vehicles" containing the data about the vehicles, including the column "plate" which stores the License Plates ...

24 May at 14:55

Sqlite primary key on multiple columns

What is the syntax for specifying a primary key on more than 1 column in SQLITE ?

Code for a simple JavaScript countdown timer?

I want to use a simple countdown timer starting at 30 seconds from when the function is run and ending at 0. No milliseconds. How can it be coded?

Convert JSON to DataTable

I have JSON in the following format: ``` [ {"id":"10","name":"User","add":false,"edit":true,"authorize":true,"view":true}, {"id":"11","name":"Group","add":true,"edit":false,"authorize":false,...

4 Jun at 04:52

Async/Await Class Constructor

At the moment, I'm attempting to use `async/await` within a class constructor function. This is so that I can get a custom `e-mail` tag for an Electron project I'm working on. ``` customElements.def...

15 Apr at 21:41