Search Results

Search found 43847 results on 1754 pages for 'command line arguments'.

Page 5/1754 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How to create a stand alone command line application with Node.js

    - by Fab
    I'm trying to find a way to use a command line nodejs application that I created on a computer without node.js installed. In other words how to package my application with node.js inside, in order to avoid the users to have node.js already installed. The tipical use case is: I run the application and the application works using the node core that is provide with the application (or the application checks if there is node.js installed, and if not it donwload and install it automatically). Do you have any idea?

    Read the article

  • Hiding Command Prompt with CodeDomProvider

    - by j-t-s
    Hi All I've just got my own little custom c# compiler made, using the article from MSDN. But, when I create a new Windows Forms application using my sample compiler, the MSDOS window also appears, and if I close the DOS window, my WinForms app closes too. How can I tell the Compiler? not to show the MSDOS window at all? Thank you :) Here's my code: using System; namespace JTS { public class CSCompiler { protected string ot, rt, ss, es; protected bool rg, cg; public string Compile(String se, String fe, String[] rdas, String[] fs, Boolean rn) { System.CodeDom.Compiler.CodeDomProvider CODEPROV = System.CodeDom.Compiler.CodeDomProvider.CreateProvider("CSharp"); ot = fe; System.CodeDom.Compiler.CompilerParameters PARAMS = new System.CodeDom.Compiler.CompilerParameters(); // Ensure the compiler generates an EXE file, not a DLL. PARAMS.GenerateExecutable = true; PARAMS.OutputAssembly = ot; PARAMS.CompilerOptions = "/target:winexe"; PARAMS.ReferencedAssemblies.Add(typeof(System.Xml.Linq.Extensions).Assembly.Location); PARAMS.LinkedResources.Add("this.ico"); foreach (String ay in rdas) { if (ay.Contains(".dll")) PARAMS.ReferencedAssemblies.Add(ay); else { string refd = ay; refd = refd + ".dll"; PARAMS.ReferencedAssemblies.Add(refd); } } System.CodeDom.Compiler.CompilerResults rs = CODEPROV.CompileAssemblyFromFile(PARAMS, fs); if (rs.Errors.Count > 0) { foreach (System.CodeDom.Compiler.CompilerError COMERR in rs.Errors) { es = es + "Line number: " + COMERR.Line + ", Error number: " + COMERR.ErrorNumber + ", '" + COMERR.ErrorText + ";" + Environment.NewLine + Environment.NewLine; } } else { // Compilation succeeded. es = "Compilation Succeeded."; if (rn) System.Diagnostics.Process.Start(ot); } return es; } } }

    Read the article

  • Read Text File line by line using Command Prompt/Batch

    - by user353305
    Hello All, First of all I am very thankful to the owner of this website. I have learned and implement various technologies with the help of solutions provided by the readers. I know the question I asked is posted many time in this forum. And I have tired all of the solutions available, but no luck I may case I am trying to read a dat file which is basically a msg/feed file having more than 22000 Characters. Every line may or may not be of same length. My requirement is to convert the file to fixed line length character file. I have a logic that work well using vb script, however its pretty slow. I have checked with For f/ but no luck. The only delimiter I have is EOT, which i can see in Textpad but not in notepad. I have tried with \n, token=. Please help me in resolving the issue. Regards, Rajiv [email protected]

    Read the article

  • printing dynamically string in one line in python

    - by EngHamoud
    I'm trying to print strings in one line. I've found solutions but they don't works with windows correctly. I have text file contains names and I want to print them like this name=john then change john to next name and keep name=, I've made this code but didn't work correctly with windows: op = open('names.txt','r') print 'name=', for i in op.readlines(): print '\r'+i.strip('\n') thank you for your time

    Read the article

  • Using ssh for remote command

    - by user1663479
    I need to use ssh to execute a remote command such as: ssh -l jsilva xman /vol/2011/linux_x64/exe/mx201111.exe When I execute ssh I receive error message: /cmg/2011.11/linux_x64/exe/mx201111.exe: error while loading shared libraries: libmkl_intel_lp64.so: cannot open shared object file: No such file or directory This application uses the variable LD_LIBRARY_PATH. I inserted this variable into /etc/profiles in localhost and remote host. The filesystem /cmg is mounted by autofs for both hosts (local and remote). Anybody have idea how to resolve this problem? Thanks!

    Read the article

  • C# 4.0: Named And Optional Arguments

    - by Paulo Morgado
    As part of the co-evolution effort of C# and Visual Basic, C# 4.0 introduces Named and Optional Arguments. First of all, let’s clarify what are arguments and parameters: Method definition parameters are the input variables of the method. Method call arguments are the values provided to the method parameters. In fact, the C# Language Specification states the following on §7.5: The argument list (§7.5.1) of a function member invocation provides actual values or variable references for the parameters of the function member. Given the above definitions, we can state that: Parameters have always been named and still are. Parameters have never been optional and still aren’t. Named Arguments Until now, the way the C# compiler matched method call definition arguments with method parameters was by position. The first argument provides the value for the first parameter, the second argument provides the value for the second parameter, and so on and so on, regardless of the name of the parameters. If a parameter was missing a corresponding argument to provide its value, the compiler would emit a compilation error. For this call: Greeting("Mr.", "Morgado", 42); this method: public void Greeting(string title, string name, int age) will receive as parameters: title: “Mr.” name: “Morgado” age: 42 What this new feature allows is to use the names of the parameters to identify the corresponding arguments in the form: name:value Not all arguments in the argument list must be named. However, all named arguments must be at the end of the argument list. The matching between arguments (and the evaluation of its value) and parameters will be done first by name for the named arguments and than by position for the unnamed arguments. This means that, for this method definition: public static void Method(int first, int second, int third) this call declaration: int i = 0; Method(i, third: i++, second: ++i); will have this code generated by the compiler: int i = 0; int CS$0$0000 = i++; int CS$0$0001 = ++i; Method(i, CS$0$0001, CS$0$0000); which will give the method the following parameter values: first: 2 second: 2 third: 0 Notice the variable names. Although invalid being invalid C# identifiers, they are valid .NET identifiers and thus avoiding collision between user written and compiler generated code. Besides allowing to re-order of the argument list, this feature is very useful for auto-documenting the code, for example, when the argument list is very long or not clear, from the call site, what the arguments are. Optional Arguments Parameters can now have default values: public static void Method(int first, int second = 2, int third = 3) Parameters with default values must be the last in the parameter list and its value is used as the value of the parameter if the corresponding argument is missing from the method call declaration. For this call declaration: int i = 0; Method(i, third: ++i); will have this code generated by the compiler: int i = 0; int CS$0$0000 = ++i; Method(i, 2, CS$0$0000); which will give the method the following parameter values: first: 1 second: 2 third: 1 Because, when method parameters have default values, arguments can be omitted from the call declaration, this might seem like method overloading or a good replacement for it, but it isn’t. Although methods like this: public static StreamReader OpenTextFile( string path, Encoding encoding = null, bool detectEncoding = true, int bufferSize = 1024) allow to have its calls written like this: OpenTextFile("foo.txt", Encoding.UTF8); OpenTextFile("foo.txt", Encoding.UTF8, bufferSize: 4096); OpenTextFile( bufferSize: 4096, path: "foo.txt", detectEncoding: false); The complier handles default values like constant fields taking the value and useing it instead of a reference to the value. So, like with constant fields, methods with parameters with default values are exposed publicly (and remember that internal members might be publicly accessible – InternalsVisibleToAttribute). If such methods are publicly accessible and used by another assembly, those values will be hard coded in the calling code and, if the called assembly has its default values changed, they won’t be assumed by already compiled code. At the first glance, I though that using optional arguments for “bad” written code was great, but the ability to write code like that was just pure evil. But than I realized that, since I use private constant fields, it’s OK to use default parameter values on privately accessed methods.

    Read the article

  • Accessibility bus warning when opening files in Eclipse from command line (Ubuntu 13.10)

    - by Reese
    Similar to closed issue Gnome Menu Broken? When opening a file from the command line for edits in Eclipse , I get this warning: ** (eclipse:nnnn): WARNING **: Couldn't register with accessibility bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken. The 4-digit number at (eclipse:nnnn) changes each time I issue an 'eclipse some/file.ext' command. The file opens but the warning is an annoyance that shouldn't be happening, it may be indicative of some other problem. Updated Ubuntu 13.10 64-bit, updated Eclipse Luna.

    Read the article

  • Create USB installer from the command line?

    - by j-g-faustus
    I'm trying to create a bootable USB image to install Ubuntu on a new computer. I have done this before following the "create USB drive" instructions for Ubuntu desktop, but I don't have an Ubuntu desktop available. How can I do the same using only the command line? Things I've tried: Create bootable USB on Mac OS X following the ubuntu.com "create USB drive" instructions for Mac: Doesn't boot. usb-creator: According to apt-cache search usb-creator and Wikipedia usb-creator only exists as a graphical tool. "Create manually" instructions at help.ubuntu.com: None of the files and directories described (e.g. casper, filesystem.manifest, menu.lst) exist in the ISO image, and I don't know what has replaced them. unetbootin scripting: Requires X server (graphics support) to run, even when fully scripted. (The command sudo unetbootin lang=en method=diskimage isofile=~/ubuntu-10.10-server-amd64.iso installtype=USB targetdrive=/dev/sdg1 autoinstall=yes gives an error message unetbootin: cannot connect to X server.) Update Also tried GRUB fiddling: Merging information from pendrivelinux.com a related question on the Linux Stackexchange and a grub configuration example I was able to get halfway there - it booted from USB, displayed the grub menu and started the installation, but installation did not complete. For reference, this is the closest I got: sudo su # mount USB pen mount /dev/sd[X]1 /media/usb # install GRUB grub-install --force --no-floppy --root-directory=/media/usb /dev/sd[X] # copy ISO image to USB cp ~/ubuntu-10.10-server-amd64.iso /media/usb # mount ISO image, copy existing grub.cfg mount ~/ubuntu-10.10-server-amd64.iso /media/iso/ -o loop cp /media/iso/boot/grub/grub.cfg /media/usb/boot/grub/ I then edited /media/usb/boot/grub.cfg to add an .iso loopback, example grub entry: menuentry "Install Ubuntu Server" { set gfxpayload=keep loopback loop /ubuntu-10.10-server-amd64.iso linux (loop)/install/vmlinuz file=(loop)/preseed/ubuntu-server.seed iso-scan/filename=/ubuntu-10.10-server-amd64.iso quiet -- initrd (loop)/install/initrd.gz } When booting from USB, this would give me the Grub boot menu and start the installer, but the installer gave up after a couple of screens complaining that it couldn't find the CD-ROM drive. (Naturally, as the box I'm installing on doesn't have an optical drive.) I resolved this particular issue by giving up and doing the "create USB drive" routine using the Ubuntu Live desktop CD (on a computer that does have an optical drive), then the USB install works. But I expect that there is some way to do this from the command line of an Ubuntu system without X server and without an optical drive, so the question still stands. Does anyone know how?

    Read the article

  • Pass potentially infinite number of arguments to array except a single numeric variable in a PHP com

    - by tehalive
    I'm trying to make a PHP script that will take a potentially infinite number of URLs from the command line as arguments. I also need to pass an argument that only has a single numeric value possible (to specify timeout), e.g.: ./urltest.php 60 url1.com url2.com url3.com I'm not exactly sure how to specify argv[1] to be a single numeric variable while at the same time the rest of the arguments (i.e. the list of urls) go into an array. Maybe something like: $timeout = $argv[1]; $args = func_get_args(); function numfilter($num) { return !is_numeric($num); } $urls = array_filters($args, 'numfilter'); ? Thanks in advance!

    Read the article

  • How to edit pdf metadata from command line?

    - by bdr529
    I need a command line tool for editing metadata of pdf-files. I'm using a Aiptek MyNote Premium tablet for writing my notes and minutes on this device, import them later and convert them to pdf automatically with a simple script using inkscape and ghostscript. Is there any command line tool to add some categories to the pdf's metadata, so i can find the pdf later (e.g. with gnome-do) by categories? Update: I tried the solution with pdftk and it works, but it seems that gnome-do doesn't take care of pdf-metadata. Is there a way to get gnome-do to do that?

    Read the article

  • cd command not working anymore

    - by dystroy
    I just did two things : install scm_breeze and mercurial : git clone git://github.com/ndbroadbent/scm_breeze.git ~/.scm_breeze ~/.scm_breeze/install.sh sudo apt-get install mercurial And now my cd command seems to be gone : dys@dys-tour:~/prog> cd ~ bash: /home/dys : is a folder dys@dys-tour:~/prog> cd .. .. : command not found The terminals I opened before installing scm_breeze and mercurial are fine. The terminals I open now have the problem. I uninstalled scm_breeze, with no result. What can I do to diagnose the problem and fix it ?

    Read the article

  • Bluetooth from the command line in 12.04?

    - by azzid
    I've been trying to pair up my bluetooth keyboard with my computer after reinstalling from a standard ubuntu 12.04 to a minimal install. In the minimal install I have no gui, so I've been trying to use the various command line tools available, but I can't figure out how the pairing is supposed to go. Pairing when I had a gui worked flawlessly. I've asked for help here: http://ubuntuforums.org/showthread.php?p=12234695 No one has replied but a lot of details of my situation is available there. How is one supposed to pair bluetooth devices from the command line?

    Read the article

  • Changing in pavucontrols tab "Recording" via command line

    - by Mojo
    I'm using pavucontrol to make changes in the "Recording". I'm changing the source (??) of a Loopback to Null-Output from "Internes Audio Analog Stereo" to "Monitor of Internes Audio Analog Stereo" see the screenshot http://picpaste.de/Bildschirmfoto_vom_2013-10-26_11_32_03-z0KwnFDE.png I'm now looking for a possibility to do this via command line. So far I've done the following: pactl load-module module-null-sink ? creates a new sink pactl load-module module-loopback ? creates a new sink input pactl load-module module-loopback ? creates another sink input pacmd move-sink-input 0 1 ? changes the sink of the sink-input (to Null-Output); this is like changing manually in the pacucontrol tab "Playback". It's just the last part (making the change like shown in the screenshot) via command line that I'm not able to do. I'd be very happy for any advice or suggestions. Thanks already!

    Read the article

  • "find" command and piping its output through another program

    - by Charbel
    this is not an Ubuntu specific quesion, it applies to all unix/linux. how can I run a command like this: find . -maxdepth 1 -type d -print -exec svn info "{}" | grep URL \; the command above doesn't do what I want, I can't seem to pipe the output of the svn info to grep. This works, but the output contains much more than I need: find . -maxdepth 1 -type d -print -exec svn info "{}" \; Any ideas?

    Read the article

  • Arguments passed on by shell to command in Unix

    - by Ryan Brown
    I've been going over this question and I can't for the life of me figure out why the answer is what it is. How many arguments are passed to the command by the shell on this command line:<pig pig -x " " -z -r" " >pig pig pig a. 8 b. 6 c. 5 d. 7 e. 9 The first symbol is supposed to be the symbol for redirected input but the site isn't letting me use it. [Fixed.] I looked at this question and said ok...arguments...not options so 2nd pig, then " ", then -r" ", 4th pig and 5th pig...-z and -x are options, so I count 5. The answer is b. 6. Where is the 6th argument that's being passed on?

    Read the article

  • Execute local script requiring arguments on Linux via plink

    - by c_maker
    Is it possible to execute (from windows) a local script with arguments on a remote linux system? Here's what I got: plink 1.2.3.4 -l root -pw mypassword -m hello.sh Is there a way to do this same thing, but able to give input parameters to hello.sh? I've tried many things, including: plink 1.2.3.4 -l root -pw mypassword -m hello.sh input1 input2 In this case it seems that plink thinks that input1 and input2 are its arguments.. which makes sense. What are my options?

    Read the article

  • Can I use a wildcard to denote subdirectories as opposed to just files in the Windows Command Prompt

    - by Dinosaurus
    I know I can use a wildcard to list the files in a single directory: dir *.java However, does anyone know if it is possible to denote a subdirectory with a wildcard as well? I would like to do something like dir classes/*/*.java Where, it will list all the java files in every subdirectory beneath the classes directory. So, if there is: classes/cs1100/ classes/cs1200/ classes/cs1500/ It will list all the java files within these. Note, I'm not using this specifically for the "Dir" command, but instead another command line tool that accepts a list of files. But, if it works for Dir, it shoudl work in my other program as well.

    Read the article

  • Function arguments VBA

    - by user1068249
    I have these three functions: When I run the first 2 functions, There's no problem, but when I run the last function (LMTD), It says 'Division by zero' yet when I debug some of the arguments have values, some don't. I know what I have to do, but I want to know why I have to do it, because it makes no sense to me. Tinn-function doesn't have Tut's arguments, so I have to add them to Tinn-function's arguments. Same goes for Tut, that doesn't know all of Tinn's arguments, and LMTD has to have both of Tinn and Tut's arguments. If I do that, it all runs smoothly. Why do I have to do this? Public Function Tinn(Tw, Qw, Qp, Q, deltaT) Tinn = (((Tw * Qw) + (Tut(Q, fd, mix) * Q)) / Qp) + deltaT End Function Public Function Tut(Q, fd, mix) Tut = Tinn(Tw, Qw, Qp, Q, deltaT) - (avgittEffektAiUiLMTD() / ((Q * fd * mix) / 3600)) End Function Public Function LMTD(Tsjo) LMTD = ((Tinn(Tw, Qw, Qp, Q, deltaT) - Tsjo) - (Tut(Q, fd, mix) - Tsjo)) / (WorksheetFunction.Ln ((Tinn(Tw, Qw, Qp, Q, deltaT) - Tsjo) / (Tut(Q, fd, mix) - Tsjo))) End Function

    Read the article

  • How can I uniqely record every new command I use, and possibly timestamp it?

    - by Nirmik
    I've been on Linux for more than 6 months now but never went too much into the CLI (command-line interface or terminal or shell) Now as I ask questions here, get answers, or help from other sites, I learn new commands... How can I can store every new command in a text file? Only new/*unique* commands, not repetitions of the same command. Here's an example: In the terminal, I enter the commands like this- ubuntu@ubuntu:~$ *command1* ubuntu@ubuntu:~$ *command2* ubuntu@ubuntu:~$ *command3* ubuntu@ubuntu:~$ *command4* ubuntu@ubuntu:~$ *command1* Now, these commands should get saved in a text file say commandrec like this- *command1* *command2* *command3* *command4* NOTE:The last command in the terminal which was again command1 is not recorded/saved again in the text file. And the next time I open the terminal, and enter a new command command 5, it should get appended to the list in commandrec (but if the command was used earlier on some other date, it should still be ignored. For example, command 1 entered again along with command 5 on a new day/time but command1 not recorded as already used) The commandrec file looking something like this- 31/05/12 12:00:00 *command1* *command2* *command3* *command4* 01/06/12 13:00:00 *command 5* (the time and date thing would be great if possible, but okay even if that isn't there) This way, I can have a record of all commands used by me to date. How can this be done?

    Read the article

  • XNA 2D line-of-sight check

    - by bionicOnion
    I'm working on a top-down shooter in XNA, and I need to implement line-of-sight checking. I've come up with a solution that seems to work, but I get the nagging feeling that it won't be efficient enough to do every frame for multiple calls (the game already hiccups slightly at about 10 calls per frame). The code is below, but my general plan was to create a series of rectangles with a width and height of zero to act as points along the sight line, and then check to see if any of these rectangles intersects a ClutterObject (an interface I defined for things like walls or other obstacles) after first screening for any that can't possibly be in the line of sight (i.e. behind the viewer) or are too far away (a concession I made for efficiency). public static bool LOSCheck(Vector2 pos1, Vector2 pos2) { Vector2 currentPos = pos1; Vector2 perMove = (pos2 - pos1); perMove.Normalize(); HashSet<ClutterObject> clutter = new HashSet<ClutterObject>(); foreach (Room r in map.GetRooms()) { if (r != null) { foreach (ClutterObject c in r.GetClutter()) { if (c != null &&!(c.GetRectangle().X * perMove.X < 0) && !(c.GetRectangle().Y * perMove.Y < 0)) { Vector2 cVector = new Vector2(c.GetRectangle().X, c.GetRectangle().Y); if ((cVector - pos1).Length() < 1500) clutter.Add(c); } } } } while (currentPos != pos2 && ((currentPos - pos1).Length() < 1500)) { Rectangle position = new Rectangle((int)currentPos.X, (int)currentPos.Y, 0, 0); foreach (ClutterObject c in clutter) { if (position.Intersects(c.GetRectangle())) return false; } currentPos += perMove; } return true; } I'm sure that there's a better way to do this (or at least a way to make this method more efficient), but I'm not too used to XNA yet, so I figured it couldn't hurt to bring it here. At the very least, is there an efficient to determine which objects may be in front of the viewer with greater precision than the rather broad 90 degree window I've given myself?

    Read the article

  • Use Network-Manager to Connect to a wifi Access Point on the command-line

    - by Stefano Palazzo
    I'd like to connect to a wireless access point from the command-line. ideally, I'd only need the name of the AP. But the hardware-address would work as well. I know I can use nmcli to connect to a managed network connection, but in my case, the access point may not be configured for Network-Manager yet (See the difference between the output of nm-tool and nmcli con). Example output of nmcli: Auto pwln 3a3d62b1-bbdf-4f76-b4d2-c211fd5cfb03 802-11-wireless [...] Wired Network aa586921-accf-4932-98c4-c873c310f08e 802-3-ethernet [...] Cisco-UDP Uni 7f94847b-04dc-40b7-9955-5246fb77cc65 vpn [...] T-mobile (D1) 867f345a-cbbf-4bd4-b883-a5e5ae0932f0 gsm [...] Example output of nm-tool: State: connected - Device: eth1 [Auto pwln] ---------------------------------------------------- [...] Wireless Access Points (* = current AP) *pwln: Infra, [...], Freq 2472 MHz, Rate 54 Mb/s, Strength 80 WPA WPA2 WLAN: Infra, [...], Freq 2422 MHz, Rate 54 Mb/s, Strength 20 WPA WPA2 [...] How do I connect to an access point that may or may not be known to NM? Extra: Finding out if the connection needs a pass-phrase, and submitting it on the command-line as well would be great too (that is to say It'd be nice if network-manager wouldn't pop open any keyring dialogues or errors on the gui)

    Read the article

  • Wubi 12.04 installation error executing command command

    - by Erik Lau
    I have tried to install wubi but have not had luck because there is an error executing command: command=C:\Users\Me\AppData\Local\Temp\pyl4266.tmp\bin\resize2fs.exe-f C:\ubuntu\disks\root.disk 17744M retval=1 stderr= stdout=resize2fs1.40.6 (09-Feb-2008) Usage: /cygdrive/c/Users/Eriks/AppData/Local/Temp/pyl4266.tmp/bin/resize2fs.exe-f C:/unbuntu/disks.root.disk17744M [-d debug_flags][-f][-F][-p] device[new_size] I do not understand what is the problem. Here is my log file. https://skydrive.live.com/redir?resid=B4F19CA027FFAD89!324 Please let me know what can be done to fix this error.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >