Questions

Add Auto-Increment ID to existing table?

I have a pre-existing table, containing 'fname', 'lname', 'email', 'password' and 'ip'. But now I want an auto-increment column. However, when I enter: ``` ALTER TABLE users ADD id int NOT NULL AUTO_...

7 Feb at 14:21

Convert Pandas column containing NaNs to dtype `int`

I read data from a .csv file to a Pandas dataframe as below. For one of the columns, namely `id`, I want to specify the column type as `int`. The problem is the `id` series has missing/empty values. ...

25 Aug at 14:23

Update data on a page without refreshing

I have a website where I need to update a status. Like for a flight, you are departing, cruise or landed. I want to be able to refresh the status without having my viewers to have and reload the whole...

26 Jan at 05:0

Check string for palindrome

A [palindrome](http://en.wikipedia.org/wiki/Palindrome) is a word, phrase, number or other sequence of units that can be read the same way in either direction. To check whether a word is a palindrome...

18 May at 23:7

Convert String to Uri

How can I convert a String to a Uri in Java (Android)? i.e.: ``` String myUrl = "http://stackoverflow.com"; ```

30 Jul at 12:41

Resize image with javascript canvas (smoothly)

I'm trying to resize some images with canvas but I'm clueless on how to smoothen them. On photoshop, browsers etc.. there are a few algorithms they use (e.g. bicubic, bilinear) but I don't know if the...

ImportError: No module named 'encodings'

I recently reinstalled ubuntu and did upgrade to 16.04 and cannot use python: ``` $ python manage.py runserver Could not find platform independent libraries <prefix> Could not find platform dependent ...

Using Notepad++ to validate XML against an XSD

Can someone explain how to use Notepad++ to validate an xml file against an xsd. There are no options in the "XML Tools" plugin dropdown that provides for specifying an XSD file. The XML plugin is ...

16 Jun at 13:18

Error:Execution failed for task ':app:compileDebugKotlin'. > Compilation error. See log for more details

``` Error:Execution failed for task ':app:compileDebugKotlin'. > Compilation error. See log for more details ``` build:gradle(Module:app) ``` buildscript { repositories { maven { ...

Best way to convert list to comma separated string in java

I have `Set<String> result` & would like to convert it to comma separated string. My approach would be as shown below, but looking for other opinion as well. ``` List<String> slist = new ArrayList<St...

4 Apr at 15:44

How to align footer (div) to the bottom of the page?

Can anyone explain how to align a footer div to the bottom of the page. From the examples I've seen, they all show how to make the div stay visible at the bottom, no matter where you've scrolled the p...

19 Aug at 19:39

How to get folder path from file path with CMD

I need path to the folder that contains cmd file. With `%0` I can get the file name. But how to get the folder name? ``` c:\temp\test.cmd >> test.cmd ``` P.S. My current directory != folder of the sc...

21 Dec at 19:47

Invoke-WebRequest, POST with parameters

I'm attempting to POST to a uri, and send the parameter `username=me` ``` Invoke-WebRequest -Uri http://example.com/foobar -Method POST ``` How do I pass the parameters using the method POST?

19 Dec at 21:35

Error - Unable to access the IIS metabase

After installing and opening my solution I get a series of errors in this form: > The Web Application Project Foo is configured to use . Unable to access the . You do not have sufficient privilege...

17 Apr at 18:21

TypeError: Cannot read property 'then' of undefined

``` loginService.islogged() ``` Above function return a string like "failed". However, when I try to run then function on it, it will return error of ``` TypeError: Cannot read property 'then' of u...

12 Apr at 12:59

C# int to byte[]

I need to convert an `int` to a `byte[]` one way of doing it is to use `BitConverter.GetBytes()`. But im unsure if that matches the following specification: > An XDR signed integer is a 32-bit datum...

20 Feb at 13:53

How to write to a file, using the logging Python module?

How can I use the [logging](https://docs.python.org/3.7/library/logging.html#module-logging) module in Python to write to a file? Every time I try to use it, it just prints out the message.

11 Apr at 04:18

Understanding "VOLUME" instruction in DockerFile

Below is the content of my "Dockerfile" ``` FROM node:boron # Create app directory RUN mkdir -p /usr/src/app # Change working dir to /usr/src/app WORKDIR /usr/src/app VOLUME . /usr/src/app RUN npm...

16 Sep at 20:23

Get yesterday's date using Date

The following function produces today's date; how can I make it produce only yesterday's date? ``` private String toDate() { DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"...

21 Oct at 07:37

Auto Generate Database Diagram MySQL

I'm tired of opening Dia and creating a database diagram at the beginning of every project. Is there a tool out there that will let me select specific tables and then create a database diagram for me ...

Insert data using Entity Framework model

I'm trying to insert some data in my database using Entity Framework model, but for some unknown reasons to me, it does nothing. Am I missing something here? ``` using (var context = new DatabaseEnt...

15 May at 11:36

Python Pandas merge only certain columns

Is it possible to only merge some columns? I have a DataFrame df1 with columns x, y, z, and df2 with columns x, a ,b, c, d, e, f, etc. I want to merge the two DataFrames on x, but I only want to merg...

22 Dec at 01:8

Owl Carousel, making custom navigation

So i have an Owl Carousel that contains three images. I also added custom navigation arrows (.png images) on left and right sides. However, those arrows are currently useless, because I can't find a w...

4 Jul at 18:59

How does one convert a grayscale image to RGB in OpenCV (Python)?

I'm learning image processing using OpenCV for a realtime application. I did some thresholding on an image and want to label the contours in green, but they aren't showing up in green because my image...

Run cmd commands through Java

I found several code snippets for running cmd commands through a Java class, but I wasn't able to understand it. This is code for opening the cmd ``` public void excCommand(String new_dir){ Run...

31 Oct at 16:19