Questions

How do I fix certificate errors when running wget on an HTTPS URL in Cygwin?

For example, running `wget https://www.dropbox.com` results in the following errors: ``` ERROR: The certificate of `www.dropbox.com' is not trusted. ERROR: The certificate of `www.dropbox.com' hasn't...

10 Feb at 07:35

Origin null is not allowed by Access-Control-Allow-Origin

I have made a small xslt file to create an html output called weather.xsl with code as follows: ``` <!-- DWXMLSource="http://weather.yahooapis.com/forecastrss?w=38325&u=c" --> <xsl:stylesheet version...

Is there a Sleep/Pause/Wait function in JavaScript?

Is there a JavaScript function that simulates the operation of the `sleep` function in PHP — a function that pauses code execution for x milliseconds, and then resumes where it left off? I found some...

5 Sep at 12:44

Choice between vector::resize() and vector::reserve()

I am pre-allocating some memory to my a `vector` member variable. Below code is minimal part ``` class A { vector<string> t_Names; public: A () : t_Names(1000) {} }; ``` Now at some point of t...

13 Sep at 08:36

How can I round up the time to the nearest X minutes?

Is there a simple function for rounding a `DateTime` to the nearest 15 minutes? E.g. `2011-08-11 16:59` becomes `2011-08-11 17:00` `2011-08-11 17:00` stays as `2011-08-11 17:00` `2011-08-11 17:01...

25 Apr at 16:58

jQuery: Performing synchronous AJAX requests

I've done some jQuery in the past, but I am completely stuck on this. I know about the pros and cons of using synchronous ajax calls, but here it will be required. The remote page is loaded (contro...

13 Jul at 20:31

How to customize <input type="file">?

Is it possible to change the appearance of `<input type="file">`?

10 May at 11:56

TextView bold via XML file?

Is there a way to bold the text in a TextView via XML? ``` <TextView android:textSize="12dip" android:textAppearance="bold" -> ?? </TextView> ``` Thanks

1 Apr at 19:54

How to check if IEnumerable is null or empty?

I love `string.IsNullOrEmpty` method. I'd love to have something that would allow the same functionality for IEnumerable. Is there such? Maybe some collection helper class? The reason I am asking is t...

23 May at 12:18

How to combine multiple conditions to subset a data-frame using "OR"?

I have a data.frame in R. I want to try two different conditions on two different columns, but I want these conditions to be inclusive. Therefore, I would like to use "OR" to combine the conditions. ...

8 Apr at 20:19

ActiveRecord OR query

How do you do an OR query in Rails 3 ActiveRecord. All the examples I find just have AND queries. > Edit: method is available since Rails 5. See [ActiveRecord::QueryMethods](http://api.rubyonrails.o...

Case insensitive 'in'

I love using the expression ``` if 'MICHAEL89' in USERNAMES: ... ``` where `USERNAMES` is a list. --- Is there any way to match items with case insensitivity or do I need to use a custom m...

9 Mar at 09:56

Assert equals between 2 Lists in Junit

How can I make an equality assertion between lists in a test case? Equality should be between the content of the list. For example: ``` List<String> numbers = Arrays.asList("one", "two", "three"); ...

2 Dec at 16:19

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

How can a Linux/Unix Bash script get its own PID?

I have a script in Bash called `Script.sh` that needs to know its own PID. In other words, I need to get PID inside `Script.sh`. Any idea how to do this?

5 Aug at 21:54

Bash: Syntax error: redirection unexpected

I do this in a script: ``` read direc <<< $(basename `pwd`) ``` and I get: ``` Syntax error: redirection unexpected ``` in an ubuntu machine ``` /bin/bash --version GNU bash, version 4.0.33(1)-...

17 Jan at 01:12

How to Test Facebook Connect Locally

I use ASP .NET and Facebook Connect APIs. but when I run the app and press Connect button it's return to the Website not to the test local server which is ([http://localhost:xxxx/test.aspx](http://loc...

17 Mar at 03:26

How to loop through an associative array and get the key?

My associative array: ``` $arr = array( 1 => "Value1", 2 => "Value2", 10 => "Value10" ); ``` Using the following code, `$v` is filled with `$arr`'s values ``` foreach ($arr as $v){ echo ...

5 Nov at 13:56

Change old commit message using `git rebase`

I was trying to edit an old commit message as explained [here](http://schacon.github.io/history.html). The thing is that now, when I try to run `rebase -i HEAD~5` it says `interactive rebase already s...

29 Oct at 10:29

How to get the first item from an associative PHP array?

If I had an array like: ``` $array['foo'] = 400; $array['bar'] = 'xyz'; ``` And I wanted to get the first item out of that array without knowing the key for it, how would I do that? Is there a func...

24 Oct at 06:21

List all sequences in a Postgres db 8.1 with SQL

I'm converting a db from postgres to mysql. Since i cannot find a tool that does the trick itself, i'm going to convert all postgres sequences to autoincrement ids in mysql with autoincrement value....

Is there a Pattern Matching Utility like GREP in Windows?

Is there a similar utility to `grep` available from the Windows Command Prompt, or is there a third party tool for it?

19 Mar at 10:31

How to stop event bubbling on checkbox click

I have a checkbox that I want to perform some Ajax action on the click event, however the checkbox is also inside a container with its own click behaviour that I don't want to run when the checkbox is...

26 Feb at 13:54

PHP/MySQL insert row then get 'id'

The 'id' field of my table auto increases when I insert a row. I want to insert a row and then get that ID. I would do it just as I said it, but is there a way I can do it without worrying about the ...

9 May at 12:21

Visual Studio Copy Project

I would like to make a copy of my project. I would rather not start doing it from scratch by adding files and references, etc. Please note that I don't mean copy for deployment. Just plain copy. Is t...

17 Jan at 08:33