Questions

Show diff between commits

I am using Git on [Ubuntu 10.04](https://en.wikipedia.org/wiki/Ubuntu_version_history#Ubuntu_10.04_LTS_.28Lucid_Lynx.29) (Lucid Lynx). I have made some commits to my master. However, I want to get t...

28 Jan at 21:24

Using awk to print all columns from the nth to the last

This line worked until I had whitespace in the second field. ``` svn status | grep '\!' | gawk '{print $2;}' > removedProjs ``` is there a way to have awk print everything in $2 or greater? ($3, $...

19 Jul at 06:1

How to recursively delete an entire directory with PowerShell 2.0?

What is the simplest way to forcefully delete a directory and all its subdirectories in PowerShell? I am using PowerShell V2 in Windows 7. I have learned from several sources that the most obvious co...

Delete directories recursively in Java

Is there a way to delete entire directories recursively in Java? In the normal case it is possible to delete an empty directory. However when it comes to deleting entire directories with contents, it...

Plain Old CLR Object vs Data Transfer Object

POCO = Plain Old CLR (or better: Class) Object DTO = Data Transfer Object In this [post](http://rlacovara.blogspot.com/2009/03/what-is-difference-between-dto-and-poco.html) there is a difference, bu...

27 May at 11:22

Is there a valid way to disable autocomplete in a HTML form?

When using the `xhtml1-transitional.dtd` doctype, collecting a credit card number with the following HTML ``` <input type="text" id="cardNumber" name="cardNumber" autocomplete='off'/> ``` will flag a...

31 Dec at 19:53

How do I create an empty array and then append to it in NumPy?

I want to create an empty array and append items to it, one at a time. ``` xs = [] for item in data: xs.append(item) ``` Can I use this list-style notation with [NumPy](http://en.wikipedia.org/w...

20 Jun at 01:58

"UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure." when plotting figure with pyplot on Pycharm

I am trying to plot a simple graph using pyplot, e.g.: ``` import matplotlib.pyplot as plt plt.plot([1,2,3],[5,7,4]) plt.show() ``` but the figure does not appear and I get the following message: ...

18 Jun at 20:43

Overriding interface property type defined in Typescript d.ts file

Is there a way to change the type of interface property defined in a `*.d.ts` in typescript? for example: An interface in `x.d.ts` is defined as ``` interface A { property: number; } ``` I wan...

Creating object with dynamic keys

First off, I'm using [Cheerio](https://github.com/MatthewMueller/cheerio) for some DOM access and parsing with Node.js. Good times. Heres the situation: I have a function that I need to create an o...

7 Sep at 19:49

Is there a way to use SVG as content in a pseudo element ::before or ::after

I would like to use `::before` to place SVG images before some selected elements: ``` #mydiv::before { content: '<svg ... code here</svg>'; display: block; width: 22px; height: 10px; margin:...

9 May at 12:45

Which is the preferred way to concatenate a string in Python?

Since Python's `string` can't be changed, I was wondering how to concatenate a string more efficiently? I can write like it: ``` s += stringfromelsewhere ``` or like this: ``` s = [] s.append(somest...

Difference between Node object and Element object?

I am totally confused between [Node](https://developer.mozilla.org/en-US/docs/Web/API/Node) object and [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) object. `document.getElementB...

13 Jul at 14:0

Reading CSV file and storing values into an array

I am trying to read a `*.csv`-file. The `*.csv`-file consist of two columns separated by semicolon (""). I am able to read the `*.csv`-file using StreamReader and able to separate each line by usin...

18 Sep at 15:45

How to tell if a string contains a certain character in JavaScript?

I have a page with a textbox where a user is supposed to enter a 24 character (letters and numbers, case insensitive) registration code. I used `maxlength` to limit the user to entering 24 characters...

26 Dec at 11:26

Select statement to find duplicates on certain fields

Can you help me with SQL statements to find duplicates on multiple fields? For example, in pseudo code: ``` select count(field1,field2,field3) from table where the combination of field1, field2, f...

3 Sep at 09:40

What is the difference between task and thread?

In C# 4.0, we have `Task` in the namespace. What is the true difference between `Thread` and `Task`. I did some sample program(help taken from MSDN) for my own sake of learning with ``` Parallel.I...

Trusting all certificates using HttpClient over HTTPS

Recently posted a question regarding the `HttpClient` over Https ([found here](https://stackoverflow.com/questions/2603691/android-httpclient-and-https)). I've made some headway, but I've run into ne...

How to create an object property from a variable value in JavaScript?

I want to add a new property to 'myObj', name it 'string1' and give it a value of 'string2', but when I do it it returns 'undefined: ``` var myObj = new Object; var a = 'string1'; var b = 'string2'; ...

28 Feb at 06:25

How to get height of entire document with JavaScript?

Some documents I can't get the height of the document (to position something absolutely at the very bottom). Additionally, a padding-bottom on seems to do nothing on these pages, but do on the pages ...

15 Apr at 20:31

How do I get the name of a Ruby class?

How can I get the class name from an ActiveRecord object? I have: ``` result = User.find(1) ``` I tried: ``` result.class # => User(id: integer, name: string ...) result.to_s # => #<User:0x3d07cd...

How do I find the absolute position of an element using jQuery?

Is there a way of finding the absolute position of an element, i.e. relative to the start of the window, using jQuery?

26 Mar at 01:30

How do you convert a jQuery object into a string?

How do you convert a jQuery object into a string?

21 Feb at 21:47

Using OpenSSL what does "unable to write 'random state'" mean?

I'm generating a self-signed SSL certificate to protect my server's admin section, and I keep getting this message from OpenSSL: > unable to write 'random state' What does this mean? This is on an ...

16 Feb at 17:59

How to search on GitHub to get exact string matches, including special characters

I can search exact matches from Google by using quotes like `"system <<-"`. How can I do the same thing for GitHub?

21 Apr at 19:52