Questions

sed edit file in place

I am trying to find out if it is possible to edit a file in a single sed command without streaming the edited content into a new file and then renaming the new file to the original file name. I tried...

18 Aug at 16:56

ERROR:'keytool' is not recognized as an internal or external command, operable program or batch file

When I use the command: ``` C:\>keytool -list -alias androiddebugkey -keystore .android\debug.keystore -storepass android -keypass android ``` I get this error: > 'keytool' ...

22 Mar at 01:36

Using CSS in Laravel views?

I've just began learning Laravel, and can do the basics of a controller and routing. My OS is Mac OS X Lion, and it's on a MAMP server. My code from routes.php: ``` Route::get('/', function() { ...

7 Nov at 10:58

How to execute an oracle stored procedure?

I am using oracle 10g express edition. It has a nice ui for db developers. But i am facing some problems executing stored procedures. Procedure: ``` create or replace procedure temp_proc is begin ...

11 Jan at 12:12

Logical XOR operator in C++?

Is there such a thing? It is the first time I encountered a practical need for it, but I don't see one listed [in Stroustrup](https://en.wikipedia.org/wiki/The_C%2B%2B_Programming_Language). I intend ...

12 May at 15:22

Xampp MySQL not starting - "Attempting to start MySQL service..."

I've just installed XAMPP for Windows - should be the newest version (XAMPP Control Panel v3.2.1). Apache is running just fine on port 80 and 443, but MySQL is not starting. When I press the start b...

Func vs. Action vs. Predicate

With real examples and their use, can someone please help me understand: 1. When do we need a Func<T, ..> delegate? 2. When do we need an Action<T> delegate? 3. When do we need a Predicate<T> delegat...

9 Sep at 18:33

How to open a file for both reading and writing?

Is there a way to open a file for both reading and writing? As a workaround, I open the file for writing, close it, then open it again for reading. But is there a way to open a file for reading and ...

26 Oct at 20:39

How to use the command update-alternatives --config java

I am installing Apache Solr on Linux Debian (Squeeze). I have been instructed to install sun-java jdk 1st. Then am told that I should use the command `sudo update-alternatives --config java` to make s...

21 Jun at 13:59

Enabling error display in PHP via htaccess only

I am testing a website online. Right now, the errors are not being displayed (but I know they exist). I have access to only the `.htaccess` file. How do I make all errors to display using my `.htac...

24 Nov at 05:10

Read and write to binary files in C?

Does anyone have an example of code that can write to a binary file. And also code that can read a binary file and output to screen. Looking at examples I can write to a file ok But when I try to rea...

22 Nov at 06:31

Free space in a CMD shell

Is there a way to get the amount of free diskspace of a disk or a folder in a CMD without having to install some thirdparty applications? I have a CMD that copies a big file to a given directory and ...

16 Nov at 12:44

Count all occurrences of a string in lots of files with grep

I have a bunch of log files. I need to find out how many times a string occurs in all files. ``` grep -c string * ``` returns ``` ... file1:1 file2:0 file3:0 ... ``` Using a pipe I was able to g...

18 Jun at 08:25

Write to file, but overwrite it if it exists

``` echo "text" >> 'Users/Name/Desktop/TheAccount.txt' ``` How do I make it so it creates the file if it doesn't exist, but overwrites it if it already exists. Right now this script just appends.

25 Feb at 03:1

How to write console output to a txt file

I have tried to write the console output to a txt file using this code suggestion ([http://www.daniweb.com/forums/thread23883.html#](http://www.daniweb.com/forums/thread23883.html#)) however I was not...

29 May at 18:17

Start/Stop and Restart Jenkins service on Windows

I have downloaded "jenkins-1.501.zip" from [http://jenkins-ci.org/content/thank-you-downloading-windows-installer](http://jenkins-ci.org/content/thank-you-downloading-windows-installer) . I have ext...

Error handling in Bash

What is your favorite method to handle errors in Bash? The best example of handling errors I have found on the web was written by William Shotts, Jr at [http://www.linuxcommand.org](http://www.linuxc...

Select rows with same id but different value in another column

I tried for hours and read many posts but I still can't figure out how to handle this request: I have a table like this: ``` +------+------+ |ARIDNR|LIEFNR| +------+------+ |1 |A | +------+-...

5 May at 16:15

What are the special dollar sign shell variables?

In Bash, there appear to be several variables which hold special, consistently-meaning values. For instance, ``` ./myprogram &; echo $! ``` will return the [PID](https://en.wikipedia.org/wiki/Process...

LAST_INSERT_ID() MySQL

I have a MySQL question that I think must be quite easy. I need to return the LAST INSERTED ID from table1 when I run the following MySql query: ``` INSERT INTO table1 (title,userid) VALUES ('test',1...

21 Mar at 14:13

Invalid character in identifier

I am working on the letter distribution problem from HP code wars 2012. I keep getting an error message that says "invalid character in identifier". What does this mean and how can it be fixed? [Here]...

31 Dec at 22:22

Regex pattern inside SQL Replace function?

``` SELECT REPLACE('<strong>100</strong><b>.00 GB', '%^(^-?\d*\.{0,1}\d+$)%', ''); ``` I want to replace any markup between two parts of the number with above regex, but it does not seem to work. I'm...

6 Oct at 19:10

MySQL INSERT INTO table VALUES.. vs INSERT INTO table SET

What is main difference between `INSERT INTO table VALUES ..` and `INSERT INTO table SET`? Example: ``` INSERT INTO table (a, b, c) VALUES (1,2,3) INSERT INTO table SET a=1, b=2, c=3 ``` And wha...

9 Feb at 18:57

Force browser to download image files on click

I need the browser to download the image files just as it does while clicking on an Excel sheet. Is there a way to do this using client-side programming only? ``` <html xmlns="http://www.w3.org/1999...

28 Mar at 20:32

Find column whose name contains a specific string

I have a dataframe with column names, and I want to find the one that contains a certain string, but does not exactly match it. I'm searching for `'spike'` in column names like `'spike-2'`, `'hey spik...