Questions

What is the difference between == and Equals() for primitives in C#?

Consider this code: ``` int age = 25; short newAge = 25; Console.WriteLine(age == newAge);  //true Console.WriteLine(newAge.Equals(age)); //false Console.ReadLine(); ``` Both `int` and `short` are ...

28 Jan at 21:18

Can I run multiple programs in a Docker container?

I'm trying to wrap my head around Docker from the point of deploying an application which is intended to run on the users on desktop. My application is simply a flask web application and mongo databas...

30 Dec at 16:9

Changing Jenkins build number

Is there a way to change the build number that is sent via email after a job completes? The problem is that are product builds are NOT being done by Jenkins, so we want to be able to get the build nu...

28 Oct at 21:49

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

remove objects from array by object property

``` var listToDelete = ['abc', 'efg']; var arrayOfObjects = [{id:'abc',name:'oh'}, // delete me {id:'efg',name:'em'}, // delete me {id:'hij',name:'ge'}] //...

10 May at 23:46

Common CSS Media Queries Break Points

I am working on a Responsive Web Site with CSS Media Queries. Is the following a good organization for devices? Phone, Ipad (Landscape & Portrait), Desktop and Laptop, Large Screen What are the comm...

EF LINQ include multiple and nested entities

Ok, I have tri-leveled entities with the following hierarchy: Course -> Module -> Chapter Here was the original EF LINQ statement: ``` Course course = db.Courses .Include(i => i.Modu...

boolean in an if statement

Today I've gotten a remark about code considering the way I check whether a variable is true or false in a school assignment. The code which I had written was something like this: ``` var booleanVal...

13 Mar at 19:28

How to find and replace text in a file

My code so far ``` StreamReader reading = File.OpenText("test.txt"); string str; while ((str = reading.ReadLine())!=null) { if (str.Contains("some text")) { StreamWriter write =...

7 Dec at 08:31

htaccess Access-Control-Allow-Origin

I'm creating a script that loads externally on other sites. It loads CSS and HTML and works fine on my own servers. However, when I try it on another website it displays this awful error: ``` Access...

2 Feb at 09:25

FirstOrDefault: Default value other than null

As I understand it, in Linq the method `FirstOrDefault()` can return a `Default` value of something other than null. What I haven't worked out is what kind of things other than null can be returned b...

19 Oct at 10:33

Removing numbers from string

How can I remove digits from a string?

10 Oct at 04:16

Create a .txt file if doesn't exist, and if it does append a new line

I would like to create a .txt file and write to it, and if the file already exists I just want to append some more lines: ``` string path = @"E:\AppServ\Example.txt"; if (!File.Exists(path)) { Fi...

31 Oct at 13:40

Positioning <div> element at center of screen

I want to position a `<div>` (or a `<table>`) element at the center of the screen irrespective of screen size. In other words, the space left on 'top' and 'bottom' should be equal and space left on 'r...

21 Aug at 00:57

Why is my locally-created script not allowed to run under the RemoteSigned execution policy?

> Since this question continues to attract responses that are either refuted by the question body or don't address the actual problem, of what you need to know:- - - `RemoteSigned`- `RemoteSigned...

Getting rid of all the rounded corners in Twitter Bootstrap

I love Twitter Bootstrap 2.0 - I love how it's such a complete library... but I want to make a global modification for a very boxy-not-round site, which is to get rid of all the rounded corners in Boo...

Count number of days between two dates

How do I count the number of days between these two dates? ``` start_date = Date.parse "2012-03-02 14:46:21 +0100" end_date = Date.parse "2012-04-02 14:46:21 +0200" ```

27 Jun at 13:50

Read a text file using Node.js?

I need to pass in a text file in the terminal and then read the data from it, how can I do this? ``` node server.js file.txt ``` How do I pass in the path from the terminal, how do I read that on t...

27 Mar at 01:6

How can I run a function from a script in command line?

I have a script that has some functions. Can I run one of the function directly from command line? Something like this? ``` myScript.sh func() ```

14 Feb at 23:36

Force re-download of release dependency using Maven

I'm working on a project with dependency X. X, in turn, depends on Y. I used to explicitly include Y in my project's pom. However, it was not used and to make things cleaner, I instead added it to X'...

How do I auto-submit an upload form when a file is selected?

I have a simple file upload form. How do I make it submit automatically when a file has been selected? I don't want the user to have to click the Submit button.

6 Sep at 14:52

TextView - setting the text size programmatically doesn't seem to work

I am using Eclipse Indigo, testing on 2 emulators(2.2 and 3.0). the code below shows what I am testing now, however setting the text size reveals nothing on the screen when trying to run the emulator...

27 Mar at 14:50

Python set to list

How can I convert a set to a list in Python? Using ``` a = set(["Blah", "Hello"]) a = list(a) ``` doesn't work. It gives me: ``` TypeError: 'set' object is not callable ```

26 Jul at 10:35

How to get std::vector pointer to the raw data?

I'm trying to use `std::vector` as a `char` array. My function takes in a void pointer: ``` void process_data(const void *data); ``` Before I simply just used this code: ``` char something[] = "m...

19 Apr at 04:15

CSS styling in Django forms

I would like to style the following: ``` from django import forms class ContactForm(forms.Form): subject = forms.CharField(max_length=100) email = forms.EmailField(required=False) mess...

23 Apr at 21:28