Questions

What is object serialization?

What is meant by "object serialization"? Can you please explain it with some examples?

How to use componentWillMount() in React Hooks?

In the official docs of React it mentions - > If you’re familiar with React class lifecycle methods, you can think of useEffect Hook as componentDidMount, componentDidUpdate, and componentWillU...

25 Nov at 04:13

What are all the possible values for HTTP "Content-Type" header?

I have to validate the `Content-Type` header value before passing it to an HTTP request. Is there a specific list for all the possible values of `Content-Type`? Otherwise, is there a way to validate...

What is the (best) way to manage permissions for Docker shared volumes?

I've been playing around with Docker for a while and keep on finding the same issue when dealing with persistent data. I create my `Dockerfile` and [expose a volume](http://docs.docker.io/reference/b...

25 Jul at 04:55

Rebase feature branch onto another feature branch

I have two (private) feature branches that I'm working on. ``` a -- b -- c <-- Master \ \ \ d -- e <-- Branch1 \ f -- g <-- ...

21 Aug at 14:10

What is the "__v" field in Mongoose

I'm using `Mongoose` version 3 with `MongoDB` version 2.2. I've noticed a `__v` field has started appearing in my `MongoDB` documents. Is it something to do with versioning? How is it used?

2 Jun at 15:6

Find a commit on GitHub given the commit hash

I am fairly new to Github and have come across an amateur-ish problem. I have been asked to do a code review and have been provided with a commit hash, however I have tried looking in Git if I can se...

13 Aug at 05:53

How can I run dos2unix on an entire directory?

I have to convert an entire directory using `dos2unix`. I am not able to figure out how to do this.

2 Feb at 14:23

Shell script - remove first and last quote (") from a variable

Below is the snippet of a shell script from a larger script. It removes the quotes from the string that is held by a variable. I am doing it using sed, but is it efficient? If not, then what is the ef...

20 Jan at 20:53

How to get "their" changes in the middle of conflicting Git rebase?

I have conflicting branches, `feature_x` branched from `main`. Let's say when rebasing `feature_x` on current `main`, while resolving conflicts, I decide to take (not all) of "their" (i.e. `main`) fi...

2 Sep at 20:18

How do I get the picture size with PIL?

How do I get a size of a pictures sides with PIL or any other Python library?

The entity cannot be constructed in a LINQ to Entities query

There is an entity type called `Product` that is generated by entity framework. I have written this query ``` public IQueryable<Product> GetProducts(int categoryID) { return from p in db.Products ...

3 Jul at 13:39

Redirect stdout to a file in Python?

How do I redirect stdout to an arbitrary file in Python? When a long-running Python script (e.g, web application) is started from within the ssh session and backgounded, and the ssh session is closed...

5 Oct at 15:17

NullPointerException in Java with no StackTrace

I've had instances of our Java code catch a `NullPointerException`, but when I try to log the StackTrace (which basically ends up calling `Throwable.printStackTrace()` ), all I get is: ``` java.lang....

6 Feb at 12:48

When do items in HTML5 local storage expire?

For how long is data stored in `localStorage` (as part of DOM Storage in HTML5) available? Can I set an expiration time for the data which I put into local storage?

1 Jul at 15:41

How to get the Android device's primary e-mail address

How do you get the Android's primary e-mail address (or a list of e-mail addresses)? It's my understanding that on OS 2.0+ there's support for multiple e-mail addresses, but below 2.0 you can only ha...

22 Dec at 16:54

How do I run a program with a different working directory from current, from Linux shell?

Using a , how do I start a program with a different working directory from the current working directory? For example, I have a binary file `helloworld` that creates the file `hello-world.txt` in the...

26 Mar at 02:4

How to get a user's client IP address in ASP.NET?

We have `Request.UserHostAddress` to get the IP address in ASP.NET, but this is usually the user's ISP's IP address, not exactly the user's machine IP address who for example clicked a link. How can I...

1 May at 09:52

Is there an advantage to use a Synchronized Method instead of a Synchronized Block?

Can any one tell me the advantage of synchronized method over synchronized block with an example?

SQL Server Profiler - How to filter trace to only display events from one database?

How do I limit a SQL Server Profiler trace to a specific database? I can't see how to filter the trace to not see events for all databases on the instance I connect to.

What does `set -x` do?

I have a shell script with the following line in it: ``` [ "$DEBUG" == 'true' ] && set -x ```

16 Aug at 15:19

How to write a Python module/package?

I've been making Python scripts for simple tasks at work and never really bothered packaging them for others to use. Now I have been assigned to make a Python wrapper for a REST API. I have absolutely...

24 Mar at 12:29

Get an object's class name at runtime

Is it possible to get an object's class/type name at runtime using TypeScript? ``` class MyClass{} var instance = new MyClass(); console.log(instance.????); // Should output "MyClass" ```

6 Jun at 22:28

How to convert URL parameters to a JavaScript object?

I have a string like this: ``` abc=foo&def=%5Basf%5D&xyz=5 ``` How can I convert it into a JavaScript object like this? ``` { abc: 'foo', def: '[asf]', xyz: 5 } ```

How to get start and end of day in Javascript?

How to get start ( 00:00:00 ) and end ( 23:59:59 ) of today in timestamp ( GMT )? Computer use a local time.

26 Dec at 14:28