Questions

Task vs Thread differences

There are two classes available in .NET: `Task` and `Thread`. - - `Thread``Task`

29 Dec at 00:38

How to create dictionary and add key value pairs dynamically in Javascript

From post: [Sending a JSON array to be received as a Dictionary<string,string>](https://stackoverflow.com/questions/2494294/sending-a-json-array-to-be-received-as-a-dictionarystring-string/7196027#719...

2 Sep at 14:4

Hibernate show real SQL

if I set ``` <property name="show_sql">true</property> ``` in my configuration file in the console I can see the SQL. But it's not SQL... Can I see the SQL code that will be passed directly to d...

4 Mar at 22:8

Method has the same erasure as another method in type

Why is it not legal to have the following two methods in the same class? ``` class Test{ void add(Set<Integer> ii){} void add(Set<String> ss){} } ``` I get the `compilation error` > Method ...

31 Dec at 20:36

How to restart Activity in Android

How do I restart an Android `Activity`? I tried the following, but the `Activity` simply quits. ``` public static void restartActivity(Activity act){ Intent intent=new Intent(); int...

27 Nov at 11:16

How to remove all event handlers from an event

To create a new event handler on a control you can do this ``` c.Click += new EventHandler(mainFormButton_Click); ``` or this ``` c.Click += mainFormButton_Click; ``` and to remove an event hand...

2 Mar at 20:45

How can I dismiss the on screen keyboard?

I am collecting user input with a `TextFormField` and when the user presses a `FloatingActionButton` indicating they are done, I want to dismiss the on screen keyboard. How do I make the keyboard go ...

26 Dec at 09:26

Expression ___ has changed after it was checked

Why is the component in this simple [plunk](http://plnkr.co/edit/VhEGJXE439dohJXNRbPc?p=preview) ``` @Component({ selector: 'my-app', template: `<div>I'm {{message}} </div>`, }) export class App...

7 Feb at 21:38

Android:java.lang.OutOfMemoryError: Failed to allocate a 23970828 byte allocation with 2097152 free bytes and 2MB until OOM

I want to show the image in from sd card which is stored already. After run my application is crash and getting error of: > (java.lang.OutOfMemoryError: Failed to allocate a 23970828 byte allocati...

3 Jul at 13:20

Responsive font size in CSS

I've created a site using the grid. Each page has a large `h1`: ``` body { font-size: 100% } /* Headers */ h1 { font-size: 6.2em; font-weight: 500; } ``` ``` <div class="row"> <div class="...

How to use "pass" statement?

I am in the process of learning Python and I have reached the section about the `pass` statement. The guide I'm using defines it as being a null statement that is commonly used as a placeholder. I sti...

21 Dec at 14:24

How do I specify new lines in a string in order to write multiple lines to a file?

How can I indicate a newline in a string in Python, so that I can write multiple lines to a text file?

28 Aug at 21:20

How to remove origin from git repository

Basic question: How do I disassociate a git repo from the origin from which it was cloned? `git branch -a` shows: ``` * master remotes/origin/HEAD -> origin/master ``` and I want to remove all k...

10 Feb at 08:49

Handling InterruptedException in Java

What is the difference between the following ways of handling `InterruptedException`? What is the best way to do it? ``` try{ //... } catch(InterruptedException e) { Thread.currentThread().inter...

What is @ModelAttribute in Spring MVC?

What is the purpose and usage of `@ModelAttribute` in Spring MVC?

18 Oct at 04:30

Get names of all files from a folder with Ruby

I want to get all file names from a folder using Ruby.

18 Nov at 12:33

How to SELECT FROM stored procedure

I have a stored procedure that returns rows: ``` CREATE PROCEDURE MyProc AS BEGIN SELECT * FROM MyTable END ``` My actual procedure is a little more complicated, which is why a stored procedure i...

Intellij reformat on file save

I remember seeing in either IntelliJ or Eclipse the setting to reformat (cleanup) files whenever they are saved. How do I find it (didn't find it in the settings)

3 Jun at 20:22

How to get a path to the desktop for current user in C#?

How do I get a path to the desktop for current user in C#? The only thing I could find was the VB.NET-only class [SpecialDirectories](http://msdn.microsoft.com/en-us/library/e0be29hd.aspx), which has...

12 Aug at 12:56

throwing an exception in objective-c/cocoa

What's the best way to throw an exception in objective-c/cocoa?

31 May at 07:49

How to get rid of `deprecated conversion from string constant to ‘char*’` warnings in GCC

I'm working on an exceedingly large codebase, and recently upgraded to GCC 4.3, which now triggers this warning: > warning: deprecated conversion from string constant to ‘char*’ Obviously, the correct...

24 Oct at 22:22

What is the difference between static func and class func in Swift?

I can see these definitions in the Swift library: ``` extension Bool : BooleanLiteralConvertible { static func convertFromBooleanLiteral(value: Bool) -> Bool } protocol BooleanLiteralConvertible...

3 Feb at 08:11

Is there a standardized method to swap two variables in Python?

In Python, I've seen two variable values swapped using this syntax: ``` left, right = right, left ``` Is this considered the standard way to swap two variable values or is there some other means by...

19 Sep at 12:14

Simple Digit Recognition OCR in OpenCV-Python

I am trying to implement a "Digit Recognition OCR" in OpenCV-Python (cv2). It is just for learning purposes. I would like to learn both KNearest and SVM features in OpenCV. I have 100 samples (i.e. ...

How to search a string in multiple files and return the names of files in Powershell?

I have started learning powershell a couple of days ago, and I couldn't find anything on google that does what I need so please bear with my question. I have been asked to replace some text strings i...