Difference between sh and Bash
When writing shell programs, we often use `/bin/sh` and `/bin/bash`. I usually use `bash`, but I don't know what's the difference between them. What's main difference between Bash and `sh`? What do we...
How do I update an entity using spring-data-jpa?
Well the question pretty much says everything. Using JPARepository how do I update an entity? JPARepository has only a method, which does not tell me if it's create or update actually. For example, ...
- Modified
- 25 Sep at 06:58
Deserialize JSON with C#
I'm trying to deserialize a Facebook friend's [Graph API](http://en.wikipedia.org/wiki/Facebook_Platform#Graph_API) call into a list of objects. The JSON object looks like: ``` {"data":[{"id":"51852...
Hidden Features of C#?
This came to my mind after I learned the following from [this question](http://www.stackoverflow.com/questions/8941/generic-type-checking): ``` where T : struct ``` We, C# developers, all know the ...
- Modified
- 25 Sep at 20:53
Is there a command to refresh environment variables from the command prompt in Windows?
If I modify or add an environment variable I have to restart the command prompt. Is there a command I could execute that would do this without restarting CMD?
- Modified
- 25 Oct at 14:29
How can I sort Map values by key in Java?
I have a Map that has strings for both keys and values. The data is like the following: > "question1", "1" "question9", "1" "question2", "4" "question5", "2" I want to sort the map based on its keys. ...
- Modified
- 15 Aug at 14:52
Git for beginners: The definitive practical guide
Ok, after seeing [this post by PJ Hyett](https://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide/2678236#2678236), I have decided to skip to the end and go with [Gi...
- Modified
- 23 May at 12:34
What's the difference between VARCHAR and CHAR?
What's the difference between VARCHAR and CHAR in MySQL? I am trying to store MD5 hashes.
denied: requested access to the resource is denied: docker
I am following [this link](https://docs.docker.com/engine/getstarted/step_four/) to create my first docker Image and it went successfully and now I am trying to push this Image into my docker reposito...
- Modified
- 22 Jun at 23:40
How to make an HTML back link?
What is the simplest way to create an `<a>` tag that links to the previous web page? Basically a simulated back button, but an actual hyperlink. Client-side technologies only, please. Looking for so...
- Modified
- 8 Apr at 15:46
How do I properly exit a C# application?
I have a published application in C#. Whenever I close the main form by clicking on the red exit button, the form closes but not the whole application. I found this out when I tried shutting down the ...
How to get a list of images on docker registry v2
I'm using docker registry v1 and I'm interested in migrating to the newer version, v2. But I need some way to get a list of images present on registry; for example with registry v1 I can execute a GET...
- Modified
- 27 Jun at 06:28
How to find all occurrences of an element in a list
[index()](https://docs.python.org/3/tutorial/datastructures.html) will give the first occurrence of an item in a list. Is there a neat trick which returns all indices in a list for an element?
Get the index of the object inside an array, matching a condition
I have an array like this: ``` [{prop1:"abc",prop2:"qwe"},{prop1:"bnmb",prop2:"yutu"},{prop1:"zxvz",prop2:"qwrq"},...] ``` How can I get the index of the object that matches a condition, without it...
- Modified
- 29 Jan at 01:50
How to determine whether a Pandas Column contains a particular value
I am trying to determine whether there is an entry in a Pandas column that has a particular value. I tried to do this with `if x in df['id']`. I thought this was working, except when I fed it a value ...
Check if a user has scrolled to the bottom (not just the window, but any element)
I'm making a pagination system (sort of like Facebook) where the content loads when the user scrolls to the bottom. I imagine the best way to do that is to find when the user is at the bottom of the p...
- Modified
- 11 Feb at 07:7
How to show an alert box in PHP?
I want to display an alert box showing a message with PHP. Here is my PHP code: ``` <?php header("Location:form.php"); echo '<script language="javascript">'; echo 'alert(message successfull...
- Modified
- 2 Feb at 21:50
Should I size a textarea with CSS width / height or HTML cols / rows attributes?
Every time I develop a new form that includes a `textarea` I have the following dilemma when I need to specify its dimensions: Use or use the `textarea`'s attributes `cols` and `rows`? What are the...
How can I get the scrollbar position with JavaScript?
I'm trying to detect the position of the browser's scrollbar with JavaScript to decide where in the page the current view is. My guess is that I have to detect where the thumb on the track is, and the...
- Modified
- 7 May at 20:19
The difference between sys.stdout.write and print?
Are there situations in which `sys.stdout.write()` is preferable to `print`? ( better performance; code that makes more sense)
What is the format for the PostgreSQL connection string / URL?
What is the format for the PostgreSQL connection string (URL `postgres://...`) when the host is not the localhost?
- Modified
- 7 Feb at 01:59
C# Linq Group By on multiple columns
``` public class ConsolidatedChild { public string School { get; set; } public string Friend { get; set; } public string FavoriteColor { get; set; } public List<Child> Children { get; ...
Reverse / invert a dictionary mapping
Given a dictionary like so: ``` my_map = {'a': 1, 'b': 2} ``` How can one invert this map to get: ``` inv_map = {1: 'a', 2: 'b'} ```
- Modified
- 6 Oct at 03:59
Clear variable in python
Is there a way to clear the value of a variable in python? For example if I was implementing a binary tree: ``` class Node: self.left = somenode1 self.right = somenode2 ``` If I wanted to rem...
- Modified
- 2 Jan at 06:6