Running a cron every 30 seconds
Ok so I have a cron that I need to run every 30 seconds. Here is what I have: ``` */30 * * * * /bin/bash -l -c 'cd /srv/last_song/releases/20120308133159 && script/rails runner -e production '\''Son...
- Modified
- 19 Dec at 07:25
Insert multiple rows WITHOUT repeating the "INSERT INTO ..." part of the statement?
I know I've done this before years ago, but I can't remember the syntax, and I can't find it anywhere due to pulling up tons of help docs and articles about "bulk imports". Here's what I want to do, ...
- Modified
- 19 Feb at 17:17
How to stop tracking and ignore changes to a file in Git?
I have cloned a project that includes some `.csproj` files. I don't need/like my local `csproj` files being tracked by Git (or being brought up when creating a patch), but clearly they are needed in t...
- Modified
- 19 Nov at 13:42
How to parse float with two decimal places in javascript?
I have the following code. I would like to have it such that if price_result equals an integer, let's say 10, then I would like to add two decimal places. So 10 would be 10.00. Or if it equals 10.6 wo...
- Modified
- 6 Jun at 06:39
How can I pass an argument to a PowerShell script?
There's a PowerShell script named `itunesForward.ps1` that makes iTunes fast forward 30 seconds: ``` $iTunes = New-Object -ComObject iTunes.Application if ($iTunes.playerstate -eq 1) { $iTunes.Play...
- Modified
- 11 Jul at 22:23
Sending email with PHP from an SMTP server
``` $from = "someonelse@example.com"; $headers = "From:" . $from; echo mail ("borutflis1@gmail.com" ,"testmailfunction" , "Oj",$headers); ``` I have trouble sending email in PHP. I get an error: `SM...
How should I resolve --secure-file-priv in MySQL?
I am learning MySQL and tried using a `LOAD DATA` clause. When I used it as below: ``` LOAD DATA INFILE "text.txt" INTO table mytable; ``` I got the following error: > The MySQL server is running ...
Determine if variable is defined in Python
How do you know whether a variable has been set at a particular place in the code at runtime? This is not always obvious because (1) the variable could be conditionally set, and (2) the variable could...
How to pause for specific amount of time? (Excel/VBA)
I have an Excel worksheet that has the following macro. I'd like to loop it every second but danged if I can find the function to do that. Isn't it possible? ``` Sub Macro1() ' ' Macro1 Macro ' Do ...
Using cURL to upload POST data with files
I would like to use cURL to not only send data parameters in HTTP POST but to also upload files with specific form name. How should I go about doing that ? HTTP Post parameters: userid = 12345 filec...
- Modified
- 1 Apr at 16:59
List the queries running on SQL Server
Is there a way to list the queries that are currently running on MS SQL Server (either through the Enterprise Manager or SQL) and/or who's connected? I think I've got a very long running query is bei...
- Modified
- 2 Jun at 20:35
How to make a HTML Page in A4 paper size page(s)?
Is it possible to make a HTML page behave, for example, like a A4-sized page in MS Word? Essentially, I want to be able to show the HTML page in the browser, and outline the content in the dimensions...
Can I concatenate multiple MySQL rows into one field?
Using `MySQL`, I can do something like: ``` SELECT hobbies FROM peoples_hobbies WHERE person_id = 5; ``` ``` shopping fishing coding ``` but instead I just want 1 row, 1 col: ``` shopping, f...
- Modified
- 19 Apr at 11:22
Cannot connect to Database server (mysql workbench)
Could you help me solve this problem ? When I try to click "query database" under database menu in Mysql workbench. it gives me an error: > Cannot Connect to Database ServerYour connection attempt fai...
- Modified
- 20 Apr at 05:48
How can I make an AJAX call without jQuery?
How can I make an AJAX call using JavaScript, without using jQuery?
- Modified
- 20 Oct at 03:18
UnicodeDecodeError when reading CSV file in Pandas with Python
I'm running a program which is processing 30,000 similar files. A random number of them are stopping and producing this error... ``` File "C:\Importer\src\dfman\importer.py", line 26, in import_chr ...
How to handle command-line arguments in PowerShell
What is the "best" way to handle command-line arguments? It seems like there are several answers on what the "best" way is and as a result I am stuck on how to handle something as simple as: ``` scr...
- Modified
- 29 Jun at 19:15
Error message "DevTools failed to load SourceMap: Could not load content for chrome-extension://..."
I'm trying to display an image selected from the local machine and I need the location of that image for a JavaScript function. But I'm unable to get the location. To get the image location, I tried u...
- Modified
- 31 Jan at 04:57
Creating a new dictionary in Python
I want to build a dictionary in Python. However, all the examples that I see are instantiating a dictionary from a list, etc . .. How do I create a new empty dictionary in Python?
- Modified
- 4 Feb at 17:3
MySQL combine two columns into one column
I'm trying to find a way to combine two columns into one, but keep getting the value '0' in the column instead to the combination of the words. These are what I've tried as well as others: ``` SELEC...
ORA-12560: TNS:protocol adaptor error
![enter image description here](https://i.stack.imgur.com/JLGWa.png) I Google[d] for this error but not able to find the actual reason and how to solve this error ? Can anyone tell me a perfect sol...
How to `git pull` while ignoring local changes?
Is there a way to do a `git pull` that ignores any local file changes without blowing the directory away and having to perform a `git clone`?
Writing to output window of Visual Studio
I am trying to write a message to the output window for debugging purposes. I searched for a function like Java's `system.out.println("")`. I tried `Debug.Write`, `Console.Write`, and `Trace.Write`. I...
- Modified
- 21 Jul at 22:33
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings
I was trying to download a GUI, but the terminal kept giving me this error: > Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > ...
- Modified
- 28 Aug at 19:33
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured
I am working on a example with MongoDB and I have already started the `mongod` server. When I launch my application, I am getting the error below. Any pointers for this issue? ``` ****************...
- Modified
- 30 Sep at 15:44