I want to reproduce the behavior of the command CHOICE in DOS batch but with python.
raw_input requires the user to type whatever then press the ENTER/RETURN key. What I really want is for the user to press a single key and the script to continue from there.
Is it possible to execute a Java program in the background so the user can execute other commands in front of it?
For instance, here is how the console might look for said program:
$ myProgram (executes program)
Program Started! (output from myProgram)
$ (the user can enter another UNIX command while myProgram is still running)
Thanks in advance!
I have been playing with creating little windows forms apps without visual studio.
I create my source in Notepad++ and compile with a NAnt build file.
When I run the application a command window is also displayed as well as the application window. How can I prevent the command window showing up?
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Media;
using System.IO;
namespace mynamespace
{
class MyForm : Form
{
public Button btnPlay;
MyForm()
{
this.SuspendLayout();
this.Text = "My Application";
InitialiseForm();
this.ResumeLayout(false);
}
private void InitialiseForm()
{
btnPlay = new Button();
btnPlay.Location = new System.Drawing.Point(30,40);
btnPlay.Text = "Play";
btnPlay.Click += new System.EventHandler(btnPlay_Click);
this.Controls.Add(btnPlay);
}
protected void btnPlay_Click(object sender, EventArgs e)
{
string wav = "testing123.wav";
Stream resourceStream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(wav);
SoundPlayer player = new SoundPlayer(resourceStream);
player.Play();
}
public static void Main()
{
Application.Run(new MyForm());
}
}
}
Build file
<?xml version="1.0"?>
<project name="myform" default="build" basedir=".">
<description>My Form app</description>
<property name="debug" value="true" overwrite="false"/>
<target name="clean" description="Remove all generated files">
<delete dir="build"/>
</target>
<target name="build" description="Compile the source" depends="clean">
<mkdir dir="build"/>
<csc target="exe" output="build\MyForm.exe" debug="${debug}" verbose="true">
<resources>
<include name="app\resources\*.wav" />
</resources>
<sources>
<include name="app\MyForm.cs"/>
</sources>
</csc>
</target>
</project>
Scala includes the continuations plugin now (yay), but must be enabled by passing "-P:continuations:enable" to the scala compiler. Is there a way to pass arbitrary arguments to scalac for the eclipse scala plugin?
From: http://permalink.gmane.org/gmane.comp.lang.scala/19439
the plugin is loaded by default, but
it must be enabled by the command line
argument -P:continuations:enable
Is there a way to automate code signing a VBA project in a Word 2003 and/or Word 2007 document?
By automate I mean via a command line utility or via Word VBA automation?
Motivation: I would like to code sign several Word templates as part of an automated daily build and distribution cycle. Right now we have to do this manually by opening each document in Word and resigning.
Thank you,
Malcolm
I would like to change the formatting on my BASH prompt from this:
[email protected]:~/some/very/annoying/long/path$
to something like this:
[email protected]:~/some/very/annoying/long/path
$
The idea is that I would be able to type a reasonably long command on one line without it wrapping to the next line so quickly.
I am new to MS ADO and trying to understand how to set the size on command parameters as created by the
command.CreateParameter (Name, Type, Direction, Size, Value)
The documentation says the following:
Size Optional. A Long value that
specifies the maximum length for the
parameter value in characters or
bytes.
...
If you specify a variable-length data
type in the Type argument, you must
either pass a Size argument or set the
Size property of the Parameter object
before appending it to the Parameters
collection; otherwise, an error
occurs.
1.) What should one pass for fixed-size parameters? Is it a "don't care"?
I was a bit confused by the example found here, in which they set size to 3 for an adInteger parameter with Value set to a variant of type VT_I2
pPrmByRoyalty->Type = adInteger;
pPrmByRoyalty->Size = 3;
pPrmByRoyalty->Direction = adParamInput;
pPrmByRoyalty->Value = vtroyal;
VT_I2 implies two bytes. A tagVARIANT struct is 16 bytes. How did they land on three? I see that the enum value for adInteger happens to be three, but I suspect that is just a coincidence.
So it's a bit confusing what to pass for fixed-size parameters. The team I'm working with has always passed sizeof(int) for adInteger, and it seems to work. Is that correct?
Now, for "variable-length" parameters: we are instructed by the documentation to pass "the maximum length .. in characters or bytes".
2.) For adVarChar, is it sufficient to pass the max width as defined in the database?
3.) What about the Wide types (e.g. adVarWChar)? Is it characters or bytes?
4.) How about adVariant, which could contain fixed- or variable-length data?
5.) Do arrays ever come into play here? (we don't pass them as parameters, just curious)
Any references or personal insights are welcome.
My MSBuild command line is as follows:
msbuild e:\code\myProject.csproj /p:Configuration=Debug /p:OutputPath=bin/Debug /p:Platform=x86 /p:PlatformTarget=x86
The project builds fine on my development machine in VS2010 but not with the command above. I am running Win 7 64 - Bit. I'm getting an error that says I don't have the Silverlight 4 SDK installed but I do. I"ve read some posts that you have to set the Platform=x86 but to no avail. Here is the error message in full:
Microsoft (R) Build Engine Version 4.0.30319.1
[Microsoft .NET Framework, Version 4.0.30319.1]
Copyright (C) Microsoft Corporation 2007. All rights reserved.
Build started 6/8/2010 4:03:38 PM.
Project "E:\code\dashboards\MyProject2010\MyProject2010.Web\MyProject2010
.web.csproj" on node 1 (default targets).
GenerateTargetFrameworkMonikerAttribute:
Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output fi
les are up-to-date with respect to the input files.
CoreCompile:
Skipping target "CoreCompile" because all output files are up-to-date with resp
ect to the input files.
CopyFilesToOutputDirectory:
Copying file from "obj\Debug\MyProject.Web.dll" to "bin\Debug\MyProject.Web
.dll".
MyProject2010.web - E:\code\dashboards\MyProject2010\MyProject2010.Web
\bin\Debug\MyProject.Web.dll
Copying file from "obj\Debug\MyProject.Web.pdb" to "bin\Debug\MyProject.Web
.pdb".
Project "E:\code\dashboards\MyProject2010\MyProject2010.Web\MyProject2010
.web.csproj" (1) is building "E:\code\dashboards\MyProject2010\MyProject20
10.Client\MyProject2010.Client.csproj" (2) on node 1 (GetXapOutputFile target(
s)).
C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Silverlight
.Common.targets(104,9): error : The Silverlight 4 SDK is not installed. [E:\cod
e\dashboards\MyProject2010\MyProject2010.Client\MyProject2010.Client.cspr
oj]
Done Building Project "E:\code\dashboards\MyProject2010\MyProject2010.Clie
nt\MyProject2010.Client.csproj" (GetXapOutputFile target(s)) -- FAILED.
Done Building Project "E:\code\dashboards\MyProject2010\MyProject2010.Web\
MyProject2010.web.csproj" (default targets) -- FAILED.
Build FAILED.
"E:\code\dashboards\MyProject2010\MyProject2010.Web\MyProject2010.web.csp
roj" (default target) (1) -
"E:\code\dashboards\MyProject2010\MyProject2010.Client\MyProject2010.Clie
nt.csproj" (GetXapOutputFile target) (2) -
(GetFrameworkPaths target) -
C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Silverlig
ht.Common.targets(104,9): error : The Silverlight 4 SDK is not installed. [E:\c
ode\dashboards\MyProject2010\MyProject2010.Client\MyProject2010.Client.cs
proj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.39
I appreciate anyone's help. Thanks.
I have written an O/R database wrapper that generates some wrapper methods for stored procs it reads from the database.
Now I need to produce some custom wrapper code if an input parameter of a stored proc is defaulted to NULL. The problem is - I get stored proc parameters using:
SqlCommandBuilder.DeriveParameters(command)
and it doesn't bring parameter defaults. Is there any way to look up those defaults? Are they stored anywhere in the database?
BTW, I'm using SQL Server 2008
Does anyone know of a sip softphone that can be controller by an API. Xlite can launch a call through command line interface, but thats pretty much it, preferably looking for something cheap, the voip SDKs iv seen are pretty expensive and i wouldn't have any knowledge of sip protocol or development.
Is there to way write a T-SQL command to just make it sleep for a period of time? I am writing a web service asynchronously and I want to be able to run some tests to see if the asynchronous pattern is really going to make it more scalable. In order to "mock" an external service that is slow, I want to be able to call a SQL server with a script that runs slowly, but isn't actually processing a ton of stuff.
I'm porting UT3 code to UDK, and I am getting the following compile error with the UDK compiler:
C:\UDK\UDK-2010-03\Development\Src\FixIt\Classes\ZPawn.uc(25) : Error, 'DefaultMesh': Bad command or expression
The ZPawn class extends UTPawn.
Line 25 is the following:
DefaultMesh = SkeletalMesh(DynamicLoadObject(ZBotOwner(Owner).MeshToUse, class'SkeletalMesh'));
Where did DefaultMesh go in UDK?
Hi all,
When running tests in Ruby's unit::test framework, is there a really easy way to specify, from the command-line, that only one test should be run (that is, specify the test class and test member variable)? If not, is there another framework that has this feature?
Hi,
on my silverlight 4 app I am trying to link up the drop event on a list box to my viewmodel. I am using expression blend 4's event trigger and invokecommandaction to hook up the drop event. Setting break points on my viewmodel, I can see the relevant function is fired when I drag a file onto the list box, however I cant seem to get access to the drageventArgs. I tried sending the entire listbox as a command parameter, and that doesn't work.
Any ideas?
Thanks
To enter a bit of dialogue using the screenplay package, I have to use
\begin{dialogue}{Johnny} Some dialogue. \end{dialogue}
\begin{dialogue}{Jane} I see. \end{dialogue}
It gets a bit tedious after a while. Is it possible to specify a custom command so that I can use something like
\dialogue{Johnny} Some dialogue.
\dialogue{Jane} I see.
instead?
I was just about to test my app on a device when I ran into this problem, I'm getting this Linker Error.
I've already checked all my compile sources and Build Phases, but there's no sign of my importing things twice.
ld: duplicate symbol _calculateNextSearchPage in /Users/wouter/Sites/test/FastPdfKit.embeddedframework/FastPdfKit.framework/FastPdfKit(FastPdfKit) and /Users/wouter/Sites/test/FastPdfKit.embeddedframework/FastPdfKit.framework/FastPdfKit(FastPdfKit) for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This only happens when testing on a device, not in the simulator.
I'm trying to install rails on Ubuntu 9.10.
gem list --local
*** LOCAL GEMS ***
actionmailer (2.3.4, 2.3.2)
actionpack (2.3.4, 2.3.2)
activerecord (2.3.4, 2.3.2)
activeresource (2.3.4, 2.3.2)
activesupport (2.3.4, 2.3.2)
rack (1.0.1)
rails (2.3.4, 2.3.2)
rake (0.8.7)
sqlite3-ruby (1.2.5)
rake
The program 'rake' is currently not installed. You can install it by typing:
sudo apt-get install rake
rake: command not found
How do I solve this?
Hi,
I'm using IIS 6.0 and looking for a way to stop/start the app pool. I know there is a stop-appPool for powershell in 7.0 but using 6.0. :-( So does anyone have a powershell script or another command line exe that will stop/start the app pool?
Thanks.
Hi All,
I would like to do a 'GET' (From the command line, ss.exe) of files that has been added/changed since a label, and place them in say C:\temp\db
I have files a.cs, b.cs, c.cs currently
If I label my project version1.0
then add files 10.cs,11.cs,12.cs and 13.cs
I would like my GET to get 10, 11, 12 and 13...
Let me know if this is possible!
I have tried:
ss GET "$/xyz/parentproject/project" -GLc:\temp\db\ -Vl~"proj 3.2.27" -I-N
Regards,
Albert
The Manual for Clang seems to be work in progress, so could you help me formulate the definitive command line options for compiling ANSI-C (AKA C89, C90) with maximum strictness and relevant/helpful warnings?
Clang is a compiler front end for the
C, C++, and Objective-C programming
languages. It uses the Low Level
Virtual Machine (LLVM) as its back
end. It is still under development.
Its goal is to offer a replacement to
the GNU Compiler Collection (GCC)
Does anyone know an AT command that will allow me to query how many retries of entering PIN on a SIM card before it locks me out?
I've tried AT+CPIN? but that does not give me how many times I can enter the PIN before I need a PUK.
How do normal phones do it?
Thanks in advance.
Hi I am trying to find all js & css files in one find command. I tried all of the below but in vain:
find WebContent -name "*.[jc]ss?"
find WebContent -name "*.[jc]ss{0,1}"
find WebContent -name "*.[jc][s]{1,2}$"
find WebContent -name "*.[jc]s{1,2}"
find WebContent -name "*.[jc]s[s]?"
Now what??