Questions

Equals(=) vs. LIKE

When using SQL, are there any benefits of using `=` in a `WHERE` clause instead of `LIKE`? Without any special operators, `LIKE` and `=` are the same, right?

1 Mar at 14:34

Bin size in Matplotlib (Histogram)

I'm using matplotlib to make a histogram. Is there any way to manually set the size of the bins as opposed to the number of bins?

15 Nov at 12:43

Setting global sql_mode in MySQL

I am trying to set `sql_mode` in MySQL but it throws an error. Command: ``` set global sql_mode='NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLE','NO_AUTO_CREATE_USER','NO_ENGINE_SUBSTITUTION' ``` - - - I...

7 Feb at 14:42

JWT authentication for ASP.NET Web API

I'm trying to support JWT bearer token (JSON Web Token) in my web API application and I'm getting lost. I see support for .NET Core and for OWIN applications. I'm currently hosting my application in ...

29 Jan at 09:57

Drop rows with all zeros in pandas data frame

I can use `pandas` `dropna()` functionality to remove rows with some or all columns set as `NA`'s. Is there an equivalent function for dropping rows with all columns having value 0? ``` P kt b t...

5 Aug at 15:19

Can you run GUI applications in a Linux Docker container?

How can you run GUI applications in a Linux [Docker](http://www.docker.io) container? Are there any images that set up `vncserver` or something so that you can - for example - add an extra speedbump s...

3 Jun at 18:16

How to unblock with mysqladmin flush hosts

I have gone through similar cases listed here but it doesn't seem to work. I was using MySQL Workbench to establish a connection with my database which is hosted on another server. Tried a few times ...

9 Mar at 19:45

Select records from NOW() -1 Day

Is there a way in a MySQL statement to order records (through a date stamp) by >= NOW() -1 so all records from the day before today to the future are selected?

2 Aug at 15:20

C pointer to array/array of pointers disambiguation

What is the difference between the following declarations: ``` int* arr1[8]; int (*arr2)[8]; int *(arr3[8]); ``` What is the general rule for understanding more complex declarations?

ValueError: Length of values does not match length of index | Pandas DataFrame.unique()

I am trying to get a new dataset, or change the value of the current dataset columns to their unique values. Here is an example of what I am trying to get : ``` A B ----- 0| 1 1 1| 2 5 2| 1 5 3| 7 9 ...

24 Nov at 07:25

How to directly execute SQL query in C#?

Ok, I have an old batch file that does exactly what I need. However, with out new administration we can't run the batch file anymore so I need to start up with C#. I'm using Visual Studio C# and alr...

18 Jan at 14:59

How to implement drop down list in flutter?

I have a list of locations that i want to implement as a dropdown list in Flutter. Im pretty new to the language. Here's what i have done. ``` new DropdownButton( value: _selectedLocation, onChan...

14 Mar at 08:46

Embed YouTube video - Refused to display in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'

I am trying to feed my Django page with some resource I am getting from somewhere else. Inside the feed, I have YouTube videos with URL like: `https://www.youtube.com/watch?v=A6XUVjK9W4o` Once I ad...

16 Mar at 02:6

How to get a random value from dictionary?

How can I get a random pair from a `dict`? I'm making a game where you need to guess a capital of a country and I need questions to appear randomly. The `dict` looks like `{'VENEZUELA':'CARACAS'}` H...

9 Feb at 16:36

How to get Current Directory?

I want to create a file in the current directory (where the executable is running). My code: ``` LPTSTR NPath = NULL; DWORD a = GetCurrentDirectory(MAX_PATH,NPath); HANDLE hNewFile = CreateFile(NPath,...

14 Mar at 17:55

How to get complete month name from DateTime

What is the proper way to get the complete name of month of a `DateTime` object? e.g. `January`, `December`. I am currently using: ``` DateTime.Now.ToString("MMMMMMMMMMMMM"); ``` I know it's not...

6 Sep at 10:31

How do I add a Maven dependency in Eclipse?

I don't know how to use Maven at all. I've been developing for a couple years with Eclipse and haven't yet needed to know about it. However, now I'm [looking at some docs](http://docs.jboss.org/rest...

Checking if jquery is loaded using Javascript

I am attempting to check if my Jquery Library is loaded onto my HTML page. I am checking to see if it works, but something is not right. Here is what I have: ``` <html xmlns="http://www.w3.org/1999...

27 Jun at 19:19

How do I remove a CLOSE_WAIT socket connection

I have written a small program that interacts with a server on a specific port. The program works fine, but: Once the program terminated unexpectedly, and ever since that socket connection is shown i...

6 Apr at 06:53

Set user variable from result of query

Is it possible to set a user variable based on the result of a query in MySQL? What I want to achieve is something like this (we can assume that both `USER` and `GROUP` are unique): ``` set @user = 12...

27 Dec at 00:24

Visual Studio Code cannot detect installed Git

Visual Studio Code reports "It look like git is not installed on your system." when I try to switch to the git view. I know I have git installed and used by other Git clients. I guess if I reinstall G...

17 Dec at 01:55

How to code a very simple login system with java

I need to create a system that checks a file for the username and password and if it is correct, it says whether or not in a label. So far I have been able to simply make one username and password equ...

18 May at 19:22

How to append text to a text file in C++?

How to append text to a text file in C++? And create a new text file if it does not already exist and append text to it if it does exist.

30 Dec at 23:8

why put $ with $self and $body? And is self the same as $self

I'm learning jQuery by trying to understand other people's code. I ran into this: ``` jQuery.fn.myFunc = function(options, callback) { //stuff jQuery(this)[settings.event](function(e) { var ...

6 Apr at 12:58

PostgreSQL function for last inserted ID

In PostgreSQL, how do I get the last id inserted into a table? In MS SQL there is SCOPE_IDENTITY(). Please do not advise me to use something like this: ``` select max(id) from table ```

4 Jul at 08:33