Is it possible to simulate key press events programmatically?
Is it possible to simulate key press events programmatically in JavaScript?
- Modified
- 19 Aug at 09:48
What's the best way to parse a JSON response from the requests library?
I'm using the python [requests module](https://requests.readthedocs.io/) to send a RESTful GET to a server, for which I get a response in JSON. The JSON response is basically just a list of lists. Wh...
- Modified
- 24 Mar at 12:31
Regex: match everything but a specific pattern
I need a regular expression able to match everything a string starting with a specific pattern (specifically `index.php` and what follows, like `index.php?id=2342343`).
- Modified
- 23 Feb at 22:19
Javascript checkbox onChange
I have a checkbox in a form and I'd like it to work according to following scenario: - `totalCost``10`- `calculate()``totalCost` So basically, I need the part where, when I check the checkbox I do ...
- Modified
- 24 Apr at 18:44
Is background-color:none valid CSS?
Can anyone tell me if the following CSS is valid? ``` .class { background-color:none; } ```
- Modified
- 20 Apr at 18:8
What is the difference between Integrated Security = True and Integrated Security = SSPI?
I have two apps that use Integrated Security. One assigns `Integrated Security = true` in the connection string, and the other sets `Integrated Security = SSPI`. What is the difference between `SSPI...
- Modified
- 8 Aug at 21:2
What is href="#" and why is it used?
On many websites I see links that have `href="#"`. What does it mean? What is it used for?
How to get a file's extension in PHP?
This is a question you can read everywhere on the web with various answers: ``` $ext = end(explode('.', $filename)); $ext = substr(strrchr($filename, '.'), 1); $ext = substr($filename, strrpos($filen...
- Modified
- 22 Feb at 18:28
Iterate all files in a directory using a 'for' loop
How can I iterate over each file in a directory using a `for` loop? And how could I tell if a certain entry is a directory or if it's just a file?
- Modified
- 23 Oct at 11:2
How to rebuild docker container in docker-compose.yml?
There are scope of services which are defined in docker-compose.yml. These services have been started. I need to rebuild only one of these and start it without up other services. I run the following c...
- Modified
- 18 Oct at 19:39
How can I loop through a List<T> and grab each item?
How can I loop through a List and grab each item? I want the output to look like this: ``` Console.WriteLine("amount is {0}, and type is {1}", myMoney.amount, myMoney.type); ``` Here is my code: ...
- Modified
- 25 Oct at 07:51
How do I run a Python program?
I used Komodo Edit 5 to write some .py files. My IDE window looks like this: ![](https://imgur.com/x8DJK.png) How do I actually run the .py file to test the program? I tried pressing F5 but it didn't ...
How can I trigger an onchange event manually?
I'm setting a date-time textfield value via a calendar widget. Obviously, the calendar widget does something like this : ``` document.getElementById('datetimetext').value = date_value; ``` What I wan...
- Modified
- 3 Feb at 11:52
PHP multidimensional array search by value
I have an array where I want to search the `uid` and get the key of the array. ## Examples Assume we have the following 2-dimensional array: ``` $userdb = array( array( 'uid' => '100...
- Modified
- 22 May at 07:56
How do I generate a stream from a string?
I need to write a unit test for a method that takes a stream which comes from a text file. I would like to do do something like this: ``` Stream s = GenerateStreamFromString("a,b \n c,d"); ```
- Modified
- 22 Oct at 22:4
pandas: filter rows of DataFrame with operator chaining
Most operations in `pandas` can be accomplished with operator chaining (`groupby`, `aggregate`, `apply`, etc), but the only way I've found to filter rows is via normal bracket indexing ``` df_filtere...
Fastest way to duplicate an array in JavaScript - slice vs. 'for' loop
In order to duplicate an array in JavaScript: Which of the following is faster to use? ### Slice method ``` var dup_array = original_array.slice(); ``` ### For loop ``` for(var i = 0, len = ori...
- Modified
- 26 Jun at 05:6
How do I do string replace in JavaScript to convert ‘9.61’ to ‘9:61’?
Given the code line ``` var value = $("#text").val(); ``` and `value = 9.61`, I need to convert `9.61` to `9:61`. How can I use the JavaScript replace function here?
- Modified
- 15 Dec at 03:17
How do I convert a String to an InputStream in Java?
Given a string: ``` String exampleString = "example"; ``` How do I convert it to an `InputStream`?
- Modified
- 29 Jul at 14:59
Find and extract a number from a string
I have a requirement to find and extract a number contained within a string. For example, from these strings: ``` string test = "1 test" string test1 = " 1 test" string test2 = "test 99" ``` How c...
Rename a file in C#
How do I rename a file using C#?
What's the best way to convert a number to a string in JavaScript?
What's the "best" way to convert a number to a string (in terms of speed advantage, clarity advantage, memory advantage, etc) ? Some examples: 1. String(n) 2. n.toString() 3. ""+n 4. n+""
- Modified
- 25 Feb at 01:16
Setting table column width
I've got a simple table that is used for an inbox as follows: ``` <table border="1"> <tr> <th>From</th> <th>Subject</th> <th>Date</th> </tr> </table> ``` How do I set...
- Modified
- 13 Mar at 12:8
How to generate a simple popup using jQuery
I am designing a web page. When we click the content of div named mail, how can I show a popup window containing a label email and text box?
- Modified
- 3 Aug at 23:23
findViewById in Fragment
I am trying to create an ImageView in a Fragment which will refer to the ImageView element which I have created in the XML for the Fragment. However, the `findViewById` method only works if I extend a...
- Modified
- 1 Dec at 09:41