Questions

In Bash, how can I check if a string begins with some value?

I would like to check if a string begins with "node" e.g. "node001". Something like ``` if [ $HOST == user* ] then echo yes fi ``` How can I do it correctly? --- I further need to combine ...

1 Jan at 12:59

Vertical Align Center in Bootstrap 4

I am trying to center my Container in the middle of the page using Bootstrap 4. I have been unsuccessful thus far. Any help would be appreciated. I have built it at [Codepen.io](http://codepen.io/cms...

GitHub relative link in Markdown file

Is there a way to create a URL anchor, `<a>`, link from within a Markdown file, to another file within the same repository and branch (aka a link relative to the current branch)? For example, in the ...

Print <div id="printarea"></div> only?

How do I print the indicated div (without manually disabling all other content on the page)? I want to avoid a new preview dialog, so creating a new window with this content is not useful. The page ...

22 Aug at 21:56

Writing data into CSV file in C#

I am trying to write into a `csv` file row by row using C# language. Here is my function ``` string first = reader[0].ToString(); string second=image.ToString(); string csv = string.Format("{0},{1}\n...

18 Jan at 08:33

When should I use CROSS APPLY over INNER JOIN?

What is the main purpose of using [CROSS APPLY](http://technet.microsoft.com/en-us/library/ms175156.aspx)? I have read (vaguely, through posts on the Internet) that `cross apply` can be more efficien...

Setting Environment Variables for Node to retrieve

I'm trying to follow a tutorial and it says: > There are a few ways to load credentials. 1. Loaded from environment variables, 2. Loaded from a JSON file on disk, The keys need to be as follows:``` ...

28 Oct at 08:51

Normalize columns of a dataframe

I have a dataframe in pandas where each column has different value range. For example: df: ``` A B C 1000 10 0.5 765 5 0.35 800 7 0.09 ``` Any idea how I can normalize the columns ...

1 Aug at 16:14

How to read and write excel file

I want to read and write an Excel file from Java with 3 columns and N rows, printing one string in each cell. Can anyone give me simple code snippet for this? Do I need to use any external lib or doe...

31 Aug at 07:1

WAMP error: Forbidden You don't have permission to access /phpmyadmin/ on this server

I am new to [WAMP](http://en.wikipedia.org/wiki/WAMP) and I have just installed it today. The setup went well and localhost seems to work, but when I try to access [phpMyAdmin](http://en.wikipedia.or...

24 Apr at 14:55

Add primary key to existing table

I have an existing table called `Persion`. In this table I have 5 columns: - - - - - When I created this table, I set `PersionId` and `Pname` as the . I now want to include one more column in the...

How can I create a keystore?

What are the steps to create a keystore for android? I need to use google maps in my app and I don't know what steps I missed. Please provide me with the specific detailed steps (I didn't understand ...

13 Nov at 16:4

How do I find the time difference between two datetime objects in python?

How do I tell the time difference in minutes between two `datetime` objects?

20 Dec at 20:47

Test if a vector contains a given element

How to check if a vector contains a given value?

9 May at 09:33

Excel VBA - exit for loop

I would like to exit my `for` loop when a condition inside is met. How could I exit my `for` loop when the `if` condition has been met? I think some kind of exit at the end of my `if` statement, but d...

19 Jun at 05:10

How do I query between two dates using MySQL?

The following query: ``` SELECT * FROM `objects` WHERE (date_field BETWEEN '2010-09-29 10:15:55' AND '2010-01-30 14:15:55') ``` returns nothing. I should have more than enough data to for the que...

21 Aug at 16:21

In a Bash script, how can I exit the entire script if a certain condition occurs?

I'm writing a script in Bash to test some code. However, it seems silly to run the tests if compiling the code fails in the first place, in which case I'll just abort the tests. Is there a way I can ...

11 Apr at 23:42

Relative imports - ModuleNotFoundError: No module named x

This is the first time I've really sat down and tried python 3, and seem to be failing miserably. I have the following two files: 1. test.py 2. config.py config.py has a few functions defined in it...

Telegram Bot - how to get a group chat id?

I've been using [telegram_bot](https://github.com/eljojo/telegram_bot), and trying to get groupChat id to send notifications to group chat, but don't know which methods I have to use for it. For gett...

21 Oct at 13:37

How to make vim paste from (and copy to) system's clipboard?

Unlike other editors, vim stores copied text in its own clipboard. So, it's very hard for me to copy some text from a webpage and paste it into the current working file. It so happens I have to either...

28 Feb at 17:24

Initialising an array of fixed size in Python

I would like to know how i can initialize an array(or list), yet to be populated with values, to have a defined size. For example in C: ``` int x[5]; /* declared without adding elements*/ ``` How do ...

21 Apr at 23:5

Resetting remote to a certain commit

I want to discard all changes done after commit `<commit-hash>` . So I did: ``` git reset --hard <commit-hash> ``` Now I want to do the same with my remote. How can I do this? I have done some comm...

11 Nov at 11:49

Getting an element from a Set

Why doesn't `Set` provide an operation to get an element that equals another element? ``` Set<Foo> set = ...; ... Foo foo = new Foo(1, 2, 3); Foo bar = set.get(foo); // get the Foo element from the...

24 Feb at 19:46

How to loop through array in jQuery?

I am trying to loop through an array. I have the following code: ``` var currnt_image_list= '21,32,234,223'; var substr = currnt_image_list.split(','); // array here ``` Am trying to get all the d...

Pass Method as Parameter using C#

I have several methods all with the same parameter types and return values but different names and blocks. I want to pass the name of the method to run to another method that will invoke the passed me...

24 Aug at 03:5