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...
- Modified
- 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[] ...
HTML Entity Decode
How do I encode and decode HTML entities using JavaScript or JQuery? ``` var varTitle = "Chris' corner"; ``` I want it to be: ``` var varTitle = "Chris' corner"; ```
- Modified
- 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.
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": ...
- Modified
- 8 Jun at 11:55
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?
- Modified
- 10 Oct at 10:43
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...
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...
- Modified
- 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" > `...
- Modified
- 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...
- Modified
- 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 ...
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...
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?
- Modified
- 26 Aug at 18:26
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...
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 >>...
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?
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".
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...
- Modified
- 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?
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...
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 ...
- Modified
- 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 ...
- Modified
- 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?
- Modified
- 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 ...
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...
- Modified
- 6 Apr at 09:20