Questions

NuGet Packages are missing

I searched this problem but none of the solutions worked. I have Visual Studio Professional 2015 installed and I am using TFS. My NuGet version is 3.1.6. This problem is happening only in my C# Web AP...

Difference between os.getenv and os.environ.get

Is there any difference at all between both approaches? ``` >>> os.getenv('TERM') 'xterm' >>> os.environ.get('TERM') 'xterm' >>> os.getenv('FOOBAR', "not found") == "not found" True >>> os.environ.g...

How to loop through an array containing objects and access their properties

I want to cycle through the objects contained in an array and change the properties of each one. If I do this: ``` for (var j = 0; j < myArray.length; j++){ console.log(myArray[j]); } ``` The con...

2 May at 08:19

"unary operator expected" error in Bash if condition

This script is getting an error: ``` elif [ $operation = "man" ]; then if [ $aug1 = "add" ]; then # <- Line 75 echo "Man Page for: add" echo "" echo "Syntax: add [number 1] [nu...

14 May at 16:52

How to pass an ArrayList to a varargs method parameter?

Basically I have an ArrayList of locations: ``` ArrayList<WorldLocation> locations = new ArrayList<WorldLocation>(); ``` below this I call the following method: ``` .getMap(); ``` the parameters...

23 Jan at 17:10

Replace words in a string - Ruby

I have a string in Ruby: ``` sentence = "My name is Robert" ``` How can I replace any one word in this sentence easily without using complex code or a loop?

7 Jul at 11:31

How to implement custom JsonConverter in JSON.NET?

I am trying to extend the JSON.net example given here [http://james.newtonking.com/projects/json/help/CustomCreationConverter.html](http://james.newtonking.com/projects/json/help/CustomCreationConver...

3 Sep at 11:0

REST response code for invalid data

What response code should be passed to client in case of following scenarios? 1. Invalid data passed while user registration like wrong email format 2. User name/ Email is already exists I chose ...

5 Mar at 23:51

How do I remove blank elements from an array?

I have the following array ``` cities = ["Kathmandu", "Pokhara", "", "Dharan", "Butwal"] ``` I want to remove blank elements from the array and want the following result: ``` cities = ["Kathmandu...

4 May at 04:55

How can I create a copy of an object in Python?

I would like to create a copy of an object. I want the new object to possess all properties of the old object (values of the fields). But I want to have independent objects. So, if I change values of ...

25 Jan at 13:48

What is the difference between git pull and git fetch + git rebase?

[Another question](https://stackoverflow.com/questions/292357/whats-the-difference-between-git-pull-and-git-fetch) says that `git pull` is like a `git fetch` + `git merge`. But what is the difference ...

10 Oct at 10:50

Round double in two decimal places in C#?

I want to round up double value in two decimal places in c# how can i do that? ``` double inputValue = 48.485; ``` after round up ``` inputValue = 48.49; ``` ### Related: c# - How do I round a ...

23 May at 10:31

What is a bus error? Is it different from a segmentation fault?

What does the "bus error" message mean, and how does it differ from a [segmentation fault](https://en.wikipedia.org/wiki/Segmentation_fault)?

22 Aug at 09:4

What should my Objective-C singleton look like?

My singleton accessor method is usually some variant of: ``` static MyClass *gInstance = NULL; + (MyClass *)instance { @synchronized(self) { if (gInstance == NULL) gInsta...

Factory Pattern. When to use factory methods?

When is it a good idea to use factory methods within an object instead of a Factory class?

Split / Explode a column of dictionaries into separate columns with pandas

I have data saved in a `postgreSQL` database. I am querying this data using Python2.7 and turning it into a Pandas DataFrame. However, the last column of this dataframe has a dictionary of values insi...

Scroll to the top of the page after render in react.js

I have a problem, which I have no ideas, how to solve. In my react component I display a long list of data and few links at the bottom. After clicking on any of this links I fill in the list with new ...

17 Oct at 16:37

'str' object has no attribute 'decode'. Python 3 error?

Here is my code: ``` import imaplib from email.parser import HeaderParser conn = imaplib.IMAP4_SSL('imap.gmail.com') conn.login('example@gmail.com', 'password') conn.select() conn.search(None, 'ALL')...

29 Dec at 22:28

Postman Chrome: What is the difference between form-data, x-www-form-urlencoded and raw

I am using the Postman Chrome extension for testing a web service. There are three options available for data input. I guess the `raw` is for sending JSON. What is the difference between the other ...

18 May at 00:22

How to reload the current state?

I'm using Angular UI Router and would like to reload the current state and refresh all data / re-run the controllers for the current state and it's parent. I have 3 state levels: contains a table ...

Why is vertical-align: middle not working on my span or div?

I'm trying to vertically center a `span` or `div` element within another `div` element. However when I put `vertical-align: middle`, nothing happens. I've tried changing the `display` properties of bo...

10 Sep at 16:21

Can I change the color of Font Awesome's cog icon?

I have to wrap my icon within an `<a>` tag for some reason. Is there any possible way to change the color of a font-awesome icon to black? or is it impossible as long as it wrapped within an `<a>` tag...

3 Aug at 20:37

PyCharm shows unresolved references error for valid code

I am using PyCharm to work on a project. The project is opened and configured with an interpreter, and can run successfully. The remote interpreter paths are mapped properly. This seems to be the c...

12 Aug at 06:15

List of Timezone IDs for use with FindTimeZoneById() in C#?

Can someone please point me to a complete list of all the timezones referenced by the id expected in `TimeZoneInfo.FindTimeZoneById()`? I can't find a list anywhere and I've looked through the .NET do...

15 Jan at 04:39

How do I check if a given Python string is a substring of another one?

I have two strings and I would like to check whether the first is a substring of the other. Does Python have such a built-in functionality?

28 Feb at 15:13