Questions

Return list using select new in LINQ

This is my method which gives me error. ``` public List<Project> GetProjectForCombo() { using (MyDataContext db = new MyDataContext (DBHelper.GetConnectionString())) { var query = from...

14 Jul at 14:50

Change one value based on another value in pandas

I'm trying to reproduce my Stata code in Python, and I was pointed in the direction of Pandas. I am, however, having a hard time wrapping my head around how to process the data. Let's say I want to i...

6 May at 13:48

Block Comments in a Shell Script

Is there a simple way to comment out a block of code in a shell script?

11 Apr at 16:13

How can I install a .ipa file to my iPhone simulator

I have an iphone simulator running on my Mac. I have a .ipa file, can you please tell me how can I install it on the simulator?

17 Sep at 10:10

Controlling Maven final name of jar artifact

I'm trying to define a property in our super pom which will be used by all child projects as the destination of the generated artifact. For this I was thinking about using `project/build/finalName` y...

23 Feb at 13:50

How can I use querySelector on to pick an input element by name?

I recently received help on this site towards using `querySelector` on a form input such as `select` but as soon as I took `<select>` out it completely changed what had to be done in the function. HT...

31 Jul at 09:10

How can I wait for a thread to finish with .NET?

I've never really used threading before in C# where I need to have two threads, as well as the main UI thread. Basically, I have the following. ``` public void StartTheActions() { // Starting thread...

14 Aug at 01:23

How do I make an attributed string using Swift?

I am trying to make a simple Coffee Calculator. I need to display the amount of coffee in grams. The "g" symbol for grams needs to be attached to my UILabel that I am using to display the amount. The ...

Unable to merge dex

I have Android Studio Beta. I created a new project with compile my old modules but when I tried launching the app it did not launch with the message: ``` Error:Execution failed for task ':app:transf...

13 Nov at 22:36

How can I specify the required Node.js version in package.json?

I have a Node.js project that requires Node version 12 or higher. Is there a way to specify this in the `packages.json` file, so that the installer will automatically check and inform the users if the...

21 Jul at 10:50

How do write IF ELSE statement in a MySQL query

How do I write an IF ELSE statement in a MySQL query? Something like this: ``` mysql_query("...(irrelevant code).. IF(action==2&&state==0){state=1}"); ``` Then down in my array I should be able t...

7 Dec at 06:23

What's the difference between a temp table and table variable in SQL Server?

In SQL Server 2005, we can create temp tables one of two ways: ``` declare @tmp table (Col1 int, Col2 int); ``` or ``` create table #tmp (Col1 int, Col2 int); ``` What are the differences betwee...

What does the ^M character mean in Vim?

I keep getting the `^M` character in my `.vimrc` and it breaks my configuration.

Accessing MVC's model property from Javascript

I have the following model which is wrapped in my view model ``` public class FloorPlanSettingsModel { public int Id { get; set; } public int? MainFloorPlanId { get; set; } public string ...

Regex lookahead, lookbehind and atomic groups

I found these things in my regex body but I haven't got a clue what I can use them for. Does somebody have examples so I can try to understand how they work? ``` (?!) - negative lookahead (?=) - posi...

5 Oct at 17:14

How to keep keys/values in same order as declared?

I have a dictionary that I declared in a particular order and want to keep it in that order all the time. The keys/values can't really be kept in order based on their value, I just want it in the orde...

7 Dec at 19:50

CSS3 Spin Animation

I have reviewed quite a few demos and have no idea why I can't get the CSS3 spin to function. I am using the latest stable release of Chrome. The fiddle: [http://jsfiddle.net/9Ryvs/1/](http://jsfiddl...

3 Sep at 08:52

Print an integer in binary format in Java

I have a number and I want to print it in binary. I don't want to do it by writing an algorithm. Is there any built-in function for that in Java?

8 Oct at 14:31

System.Net.Http: missing from namespace? (using .net 4.5)

TL; DR: I'm new to this language and have no idea what I'm doing here is my class so far: ``` using System; using System.Collections.Generic; using System.Net.Http; using System.Web; using System.Ne...

11 Mar at 15:3

Printing chars and their ASCII-code in C

How do I print a char and its equivalent ASCII value in C?

24 Sep at 16:7

Find a file in python

I have a file that may be in a different place on each user's machine. Is there a way to implement a search for the file? A way that I can pass the file's name and the directory tree to search in?

12 Nov at 19:21

How to use Session attributes in Spring-mvc

Could you help me write spring mvc style analog of this code? ``` session.setAttribute("name","value"); ``` And how to add an element that is annotated by `@ModelAttribute` annotation to session an...

3 Jan at 17:52

Adding headers when using httpClient.GetAsync

I'm implementing an API made by other colleagues with Apiary.io, in a Windows Store app project. They show this example of a method I have to implement: ``` var baseAddress = new Uri("https://privat...

Hibernate - Batch update returned unexpected row count from update: 0 actual row count: 0 expected: 1

I get following hibernate error. I am able to identify the function which causes the issue. Unfortunately there are several DB calls in the function. I am unable to find the line which causes the issu...

11 Sep at 08:23

How do I print all POST results when a form is submitted?

I need to see all of the `POST` results that are submitted to the server for testing. What would be an example of how I can create a new file to submit to that will echo out all of the fields which w...

25 Nov at 10:16