Questions

How to implement sleep function in TypeScript?

I'm developing a website in Angular 2 using TypeScript and I was wondering if there was a way to implement `thread.sleep(ms)` functionality. My use case is to redirect the users after submitting a for...

13 Jan at 12:47

Where IN clause in LINQ

How to make a where in clause similar to one in SQL Server? I made one by myself but can anyone please improve this? ``` public List<State> Wherein(string listofcountrycodes) { string[] ...

6 Jun at 14:47

HTML Entity Decode

How do I encode and decode HTML entities using JavaScript or JQuery? ``` var varTitle = "Chris&apos; corner"; ``` I want it to be: ``` var varTitle = "Chris' corner"; ```

11 Dec at 17:31

Get integer value of the current year in Java

I need to determine the current year in Java as an integer. I could just use `java.util.Date()`, but it is deprecated.

19 Dec at 14:58

Getting value from appsettings.json in .net core

Not sure what am I missing here but I am not able to get the values from my appsettings.json in my .net core application. I have my appsettings.json as: ``` { "AppSettings": { "Version": ...

Wait for page load in Selenium

How do you make [Selenium](http://en.wikipedia.org/wiki/Selenium_%28software%29) 2.0 wait for the page to load?

How to portably print a int64_t type in C

C99 standard has integer types with bytes size like int64_t. I am using Windows's `%I64d` format currently (or unsigned `%I64u`), like: ``` #include <stdio.h> #include <stdint.h> int64_t my_int = 9999...

18 Oct at 16:16

Can I set background image and opacity in the same property?

I can see in CSS references [how to set image transparency](http://www.w3schools.com/css/css_image_transparency.asp) and [how to set a background image](http://www.w3schools.com/css/css_background.asp...

3 Jan at 20:11

How to display div after click the button in Javascript?

I have following DIV . I want to display the DIV after button click .Now it is display none ``` <div style="display:none;" class="answer_list" > WELCOME</div> <input type="button" name="answer" > `...

23 May at 12:18

How to sort strings in JavaScript

I have a list of objects I wish to sort based on a field `attr` of type string. I tried using `-` ``` list.sort(function (a, b) { return a.attr - b.attr }) ``` but found that `-` doesn't appear...

22 Jul at 00:17

jQuery Event : Detect changes to the html/text of a div

I have a div which has its content changing all the time , be it `ajax requests`, `jquery functions`, `blur` etc etc. Is there a way I can detect any changes on my div at any point in time ? I dont ...

12 Jan at 11:28

Submitting a form by pressing enter without a submit button

Well I am trying to submit a form by pressing enter but not displaying a submit button. I don't want to get into JavaScript if possible since I want everything to work on all browsers (the only JS way...

14 Jun at 20:5

What does this format mean T00:00:00.000Z?

Can someone, please, explain this type of format in javascript ``` T00:00:00.000Z ``` And how to parse it?

Reading an integer from user input

What I am looking for is how to read an integer that was given by the user from the command line (console project). I primarily know C++ and have started down the C# path. I know that Console.ReadLine...

1 Sep at 12:50

How can I check if character in a string is a letter? (Python)

I know about `islower` and `isupper`, but can you check whether or not that character is a letter? For Example: ``` >>> s = 'abcdefg' >>> s2 = '123abcd' >>> s3 = 'abcDEFG' >>> s[0].islower() True >>...

5 Mar at 19:57

Where can I find the Java SDK in Linux after installing it?

I installed JDK using apt-get install but I don't know where my jdk folder is. I need to set the path for that. Does any one have a clue on the location?

2 Oct at 07:30

Convert from ASCII string encoded in Hex to plain ASCII?

How can I convert from hex to plain ASCII in Python? Note that, for example, I want to convert "0x7061756c" to "paul".

9 Mar at 22:2

Check if a row exists, otherwise insert

I need to write a T-SQL stored procedure that updates a row in a table. If the row doesn't exist, insert it. All this steps wrapped by a transaction. This is for a booking system, so it must be . It m...

29 Dec at 01:2

Controlling mouse with Python

How does one control the mouse cursor in Python, i.e. move it to certain position and click, under Windows?

24 Dec at 08:19

Key existence check in HashMap

Is checking for key existence in HashMap always necessary? I have a HashMap with say a 1000 entries and I am looking at improving the efficiency. If the HashMap is being accessed very frequently, the...

2 Sep at 11:53

How do I get out of 'screen' without typing 'exit'?

I `screen -r`'d into a Django server that's running and I can't simply + and `exit` out of it. Are there any alternative ways to get out of `screen`? Currently, I manually close the tab on my local ...

17 Dec at 16:38

How do I set environment variables from Java?

How do I set environment variables from Java? I see that I can do this for subprocesses using [ProcessBuilder](http://docs.oracle.com/javase/7/docs/api/java/lang/ProcessBuilder.html). I have several ...

27 Dec at 17:37

How to use `@ts-ignore` for a block?

The `// @ts-ignore` comment enables the TypeScript compiler to ignore the line below it. How can one ignore a whole block of code with TypeScript?

4 Oct at 16:24

Test if remote TCP port is open from a shell script

I'm looking for a quick and simple method for properly testing if a given TCP port is open on a remote server, from inside a Shell script. I've managed to do it with the telnet command, and it works ...

21 Mar at 08:41

Error: unable to verify the first certificate in nodejs

I'm trying to download a file from jira server using an URL but I'm getting an error. how to include certificate in the code to verify? ``` Error: unable to verify the first certificate in nodejs at...

6 Apr at 09:20