command-line

Command prompt convert png to swf

Hi, I want to let a user upload a PNG-file with alpha transparency and have it compiled by the server to a swf-file with jpeg compression on the embedded PNG-file. How can I make this happen? I thought first I'd just construct a class and compile it with Flex Framework, but Flex does not compress the embedded PNG-files. You who have...

Command-Line App Read from File in C#

I am writing a small command-line tool for my own daily tasks, and having problems reading from a XML file I have used for configuration. As per the examples, I use this code to load the XML file for Linq-to-XML. XDocument doc = XDocument.Load("SearchSources.xml"); What I'm having problems with is when I "deploy" my app and XML t...

Minimal, good-citizen, C# console application boilerplate

What would be the minimal boilerplate code for a C# console application entry-point that would make it a well-behaved citizen? When anyone goes out to create a Console Application project using Visual Studio (up to 2008 at the time of writing), you are presented with a boilerplate Program.cs that looks like this: class Program { st...

F-N Shortcuts in the Windows' Command Prompt

Hi, Where can I get some explanations on what F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11 and F12 do in the Windows' Command Prompt? Are there some other useful shortcuts for Windows' Command Prompt? Thanks, Afriza N. Arief ...

Eclipse Command Line Plugin

I need an Eclipse Plugin run Shell Scripts under Linux. I have a beautiful Rsync Script and i want a Button in Eclipse to activate it. The best Solution would be if the rsync Shell Script was also activated when i was saving Stuff, so maybe i can add a Script Builder or something like that. Anyone has a clue for both of the Solutions? ...

Dynamic output updation on a command line interface

Hi I am eager to know how to print the output on a terminal screen similar to the one that of the 'top' command. What I mean to say is .. dynamic updation of the existing output on terminal window. A small c program or reference to appropriate resources is expected .... ...

Invoke a CakePHP console shell on server without command line access

Is there way to invoke a CakePHP console shell on server without shell access? I have written a shell for performing some once off (and hence not a cron task) post DB upgrade tasks. I could always just copy the logic into a temporary controller, call its actions via http and then delete it, but was wondering if there was a better way to...

Closing all connections to a particular database without downing the whole service

We have some databases in a single SQL Server 2000 instance, one of them being a sandbox. My boss needs to be able to restore fresh data over the sandbox using a utility I don't have the source to. Such restores fail if anyone is connected to the sandbox. Another app I have accessing it uses connection pooling, and also there might be...

Is there a way to get gcc to output raw binary?

Forgive me—newbie gcc question. Is there a set of command-line options that will convince gcc to produce a flat binary file from a self-contained source file? For example, suppose the contents of foo.c are static int f(int x) { int y = x*x; return y+2; } No external references, nothing to export to the linker. I'd like to get a s...

JUnit: How to simulate System.in testing?

I have a Java command-line program. I would like to create Junit test case to be able to simulate System.in. Because when my program runs it will get into the while loop and waits for input from users. How do I simulate that in JUnit? Thanks ...

Java passing command line arguments to methods

I'm writing a program, which takes two words as command line arguments, does something to them, and prints out the result. I'm writing a class to handle this, and my question is: what is the best way to pass two words given as command line arguments between methods in a class? Why can't I use the usual "this.variable = " in the construct...

Print execution time of a shell command

Is is possible to print the execution time of a shell command with following combination? root@hostname:~# "command to execute" && echo "execution time" ...

debugging c# in the command line

Hello. Just for fun, how close can we get to debug an application in C# using only the command-line out-of-the-box? No other software, just the command-line. That is, for instance, is there a way to peek at the values of variables, interact with output, etc. like the VS debugger does? EDIT: And just for completeness' sake, here is the m...

Is there a way to get text as soon as possible without waiting for a newline?

I'm using C. I wrote a very simpe program which prints back the input, using getchar() and putchar() or printf(). Is there any way to make it so as soon as the user types one key, the program registers it, without waiting for an Enter? Let me show: Currently, if the user types "abc" and then presses Enter, the program prints "abc" and a...

command-line grep for a string with '$' in it?

I'm trying to find where two variables are being concatenated in a directory of scripts, but when I try the following: grep -lire "$DATA_PATH . $AWARDS_YEAR" * I get "undefined variable" errors... I thought I could escape the $s by using: grep -lire "\$DATA_PATH . \$AWARDS_YEAR" * But I get the same error - so, how do you grep for...

Running a JAR file without directly calling `java`

I am deploying a command-line tool that is written in Java that accepts command-line arguments. I have it packaged as a JAR file because it is convenient to have a single file. The problem is that to run it you must first call java -jar (filename) (args) and that is quite annoying. The current way I have it is to have a simple bash sc...

TextTransform.exe seems to only accept an older version of C#

When I expand T4 templates inside Visual Studio, I can use the full C# 3.0 syntax, including LINQ expressions, etc. When I expand it outside Visual Studio using TextTransform.exe it complains about LINQ expressions and other new features of C# 3.0. Is there a newer version of TextTransform.exe? The one I'm running is in: C:\Program F...

How to sleep for 5 seconds in Windows's Command Prompt? (or DOS)

Windows's Snipping tool can capture the screen, but sometimes I want to capture the screen after 5 seconds, such as taking an image being displayed by the webcam. (run the script and smile at the camera, for example). So in Ruby, I could do something like sleep 3 system('c:/windows/system32/SnippingTool.exe') but not all computer ha...

linux like behavior in windows shell - running ruby without "ruby" appended to the command?

This is probably a really silly question bu tI can't seem to find an answer since I'm apparently failing on keywords. You know how you can run commands from the commandline in linux if you put a line on the top of your .rb file so you don't have to type ruby myfile.rb all the time and can just do ./myfile.rb ? Is it possible to have the...

Using nntool [MATLAB] from command line.

I have this code: in = [5 columns of data-points]; out = [1 column of data-points]; net = newfit(in,out,5); net = train(net,in,out); now I want to access the error variable that is generated (so that I can calculate the mean error etc.) run this in a loop, so I want to re-initialize weights between loops. access the variable that s...