Search Results

Search found 1127 results on 46 pages for 'cli'.

Page 12/46 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • How do you distinguish your EC2 instances?

    - by Erik
    The ec2-describe-instances command is not very helpful in distinguishing the instances. Are there command line tools that give a better overview? Perhaps somewhat like http://github.com/newbamboo/manec2 but with support for different regions etc.

    Read the article

  • Java library for parsing command-line parameters?

    - by Mnementh
    I write a little command-line-application in Java. This application should work with a mix of parameters and commands, similar to svn. Examples app url command1 app url command2 --parameter2 -x app url command1 --param-with-argument argument app --parameter url command1 app --no-url command2 app --help Wanted Exists an easy-to-use library for Java Supports parsing of such command-lines (Bonus) Automatically creates an appropriate help

    Read the article

  • Loop doesn't update listboxes until it is done iterating

    - by Justen
    I have a loop that takes file name from a listbox, performs a system() call, then moves that filename to another listbox. Problem is, it doesn't move the filenames over one at a time, but waits until the entire loop is finished and moves them all at once. What would I do to get it to perform how I want it to? the loop: for each( String^% file in filename ) { int x = convert( file ); lbComplete->Items->Add( lbFiles->Items[0] ); // place the completed file lbFiles->Items->Remove( lbFiles->Items[0] ); // in the other listbox } The function convert() that contains the system call: int convert( String^ file ) { std::stringstream ss; std::string dir, fileAddress, fileName, outputDir; ... return system( ss.str().c_str() ); }

    Read the article

  • PHP execute command as subcommand

    - by Thomaschaaf
    I have the following 2 files and am executing them on linux (debian). File1.php <?php exec("php -f file2.php > /dev/null 2>&1 &"); sleep(100); File2.php <?php exec("sleep 30 > /dev/null 2>&1 &"); exec("sleep 30 > /dev/null 2>&1 &"); sleep(100); The way it currently is it first starts file1.php and fires up file2.php and immediatly begins the sleep commands. It does not wait for the first sleep to finish to continue. The problem is that the file2.php and sleep commands are not subcommands of file1.php and I can't simply kill it to kill all subcommands. My htop looks like this: http://dl.getdropbox.com/u/5910/Jing/2011-01-13_1611.png I am searching for a way to have the commands be subcommands of file1.php so that I can easily kill them all :) what I have: '- php -f file2.php '-sleep 30 '-sleep 30 '- php -f file1.php basically I want this: '- php -f file1.php '- php -f file2.php '-sleep 30 '-sleep 30

    Read the article

  • MoveFileEx Problem

    - by rajivpradeep
    int i ; DWORD dw ; String^ Source = "c:\\ProtectedFlash\\Program\\test.exe" ; String^ Destination = "c:\\Program Files" ; // move to program Files Folder //pin_ptr<const wchar_t> WSource = PtrToStringChars(Source); // pin_ptr<const wchar_t> WDestination = PtrToStringChars(Destination); i = MoveFileEx(L"c:\\ProtectedFlash\\Program\\ProtectedFlash.exe",L"c:\\Program Files",MOVEFILE_REPLACE_EXISTING) ; dw = GetLastError() ; return 0; The status dw is valued as 5 , when i run the program. Whats the error

    Read the article

  • Converting String^ and Collection of String^ to const char*

    - by Jim Jones
    Using VS2008 Managed C++ to wrap a dll. The native method takes a series of single const char* values and a collection of char* values. Going to make an example function: Function1(char * value1, TF_StringList& catList); TF_StringList is a dll class with 3 insert methods, the one I want to use is: TF_StringList::insert(const char* str); So I set up a wrapper method of: WrapperClass::callFunction(String^ mvalue1, ArrayList mcatList); mvalue1 is converted to const char* using: const char* value1 = (char*)(Marshal::StringToHGlobalAnsi(mvalue1)).ToPointer(); However, when a get to the collection of strings, I iterate over it getting each string using the index: String^ mstr = mcatList[i]; Have tried every way of converting String^ to const char* and in every case the TF_StringList::insert(const char* str) method throws a C2663 error which has to do with the const-ness of the value. What is the problem?

    Read the article

  • C# SendMessage to C++ WinProc

    - by jws
    I need to send a string from C# to a C++ WindowProc. There are a number of related questions on SO related to this, but none of the answers have worked for me. Here's the situation: PInvoke: [DllImport("user32", CharSet = CharSet.Auto)] public extern static int SendMessage(IntPtr hWnd, uint wMsg, IntPtr wParam, string lParam); C#: string lparam = "abc"; NativeMethods.User32.SendMessage(handle, ConnectMsg, IntPtr.Zero, lparam); C++: API LRESULT CALLBACK HookProc (int code, WPARAM wParam, LPARAM lParam) { if (code >= 0) { CWPSTRUCT* cwp = (CWPSTRUCT*)lParam; ... (LPWSTR)cwp->lParam <-- BadPtr ... } return ::CallNextHookEx(0, code, wParam, lParam); } I've tried a number of different things, Marshalling the string as LPStr, LPWStr, also tried creating an IntPtr from unmanaged memory, and writing to it with Marshal.WriteByte. The pointer is the correct memory location on the C++ side, but the data isn't there. What am I missing?

    Read the article

  • Zend Framework command line see errors

    - by sims
    I'm using a method outline by gregor (http://stackoverflow.com/questions/143320/create-cronjob-with-zend-framework) to create command line execution for parts of my application such as cron jobs, admin tasks, and the like. It works, however, no errors get reported when I create a new object that has not been defined (misspelling) and other such mistakes. I would have thought that php would report an error, but it fails silently. What is the reason for this? Is there a better way to achieve my goal? Or how can I implement this so that I can see errors? Many thanks! Here is the code: in public/index.php if(!defined('RUN_APP') || RUN_APP == true) { $application->bootstrap()->run(); } application/cron.php define("RUN_APP",false); require(realpath('/var/www/domain/public/index.php')); $application->bootstrap(); //the rest

    Read the article

  • Creating a handle to a class' property

    - by shadeMe
    Would it be possible to create a handle ( or a tracking handle ) to a class' property ? For instance, System::Windows::Forms::CheckBox^ Box = gcnew System::Windows::Forms::CheckBox() I'd like to create a handle to its Checked property and use it to access and modify the same.

    Read the article

  • Hiding the console window in a system() call

    - by Justen
    Continuing from this question With each system call, the function constructs a set of parameters and sends them off to another program that is just console-based. Is there a way I can make it so that no console window pops up for each call? I've done a search but the ones that aren't a linker issue just aren't working for me. For instance, I tried the _execl call and System::Diagnostics::Process^ myProcess = gcnew System::Diagnostics::Process; but they aren't working. The _execl will bring a console window up, scroll a bunch of stuff (from the program I called I guess), then close the my app and not even do what it was supposed to do. The System::Diagnostics::Process^ myProcess = gcnew System::Diagnostics::Process; doesn't seem to execute what I want either because the output folder that should contain files, contains nothing. So I'm open for ideas.

    Read the article

  • Replacement for Azure SDK Powershell commandlets for deployments

    - by Frank Rosario
    Hi, We've run into an issue with the New-Deployment Azure Powershell commandlet timing out; we've put in a bug report with MS. While they gave us an explanation for it (the path and timeout threshold used to upload through commandlets is different then what's used by the web portal); they don't have a fix for us. We need to get this running so we can automate our build deployments, so we're looking into developing a custom commandlet to replace New-Deployment using the Azure SDK; hoping this path will not have the timeout issues the commandlet did. But before we go down that route; are there any other scriptable tools I can use to replace the New-Deployment functionality? I looked at Cloudberry for Windows Azure; but that doesn't have a scriptable interface yet. Any constructive input is greatly appreciated.

    Read the article

  • Having trouble creating vectors of System::String^

    - by Justen
    So I have a regex expression to parse certain parts of a file name. I'm trying to store each part in its own vector until I use it later, but it won't let me. One error I get when I try making a vector of System::String^ is that error C3698: 'System::String ^' : cannot use this type as argument of 'new' Then, when I try just making a vector of std::string, it can't implicitly convert to type System::String^, and casting won't work either. void parseData() { System::String^ pattern = "(\\D+)(\\d+)(\\w{1})(\\d+)\\.(\\D{3})"; std::vector < System::String^ > x, y, filename, separator; Regex re( pattern ); for ( int i = 0; i < openFileDialog1->FileNames->Length; i++ ) { Match^ m = re.Match( openFileDialog1->FileNames[i] ); filename.push_back( m->Groups[0]->Value );/* x.push_back( m->Groups[1]->Value ); separator.push_back( m->Groups[2]->Value ); y.push_back( m->Groups[3]->Value );*/ } }

    Read the article

  • linux piping ( convert -> pdf2ps -> lp)

    - by Bor
    Ok, so I can print a pdf doing: pdf2ps file.pdf - | lp -s But now I want to use convert to merge several pdf files, I can do this with: convert file1.pdf file2.pdf merged.pdf which merges file1.pdf and file2.pdf into merged.pdf, target can be replaced with '-'. Question How could I pipe convert into pdf2ps and then into lp though?

    Read the article

  • proc_open() path problem

    - by fadib
    Hi, i'm using linux and php 5.2.12 i have problem with executing proc_open if i use proc_open('php script.php', $descriptorspec, $pipes); it will show me error sh: /php: No such file or directory if i use proc_open('/usr/bin/php script.php', $descriptorspec, $pipes); or proc_open('php script.php', $descriptorspec, $pipes, '/usr/bin/'); it still show me same error. i have no idea why it always append slash in front of command. any help please? thanks!

    Read the article

  • How to create an array of buttons in C++

    - by mangoman13
    Hi, I'm using C++ in VS2005 and have an 8x8 grid of buttons on a form. I want to have these buttons in an array, so when I click on any of them it will open the same event handler (I think that is what they are called), but I will know the index of which one was clicked on. I know how to do this in VB and C#, but I can't seem to figure it out with C++ Right now I have all my buttons labelled by their location, i.e. b00, b10, b21, etc. So I think what I am looking for is a way to do something like this: Button b[8][8]; //this causes me errors (error C2728: 'System::Windows::Forms::Button' : a native array cannot contain this managed type) and (error C2227: left of '->{ctor}' must point to class/struct/union/generic type) void Assignment(){ b[0][0] = b00; b[1][0] = b10; ... } and then in form1.h: private: System::Void b_Click(System::Object^ sender, System::EventArgs^ e) { //somehow read the coordinates into variables x and y //do something based on these values } Any help would be appreciated. Also let me know if I am going in the complete wrong direction with this. Thanks!

    Read the article

  • How do Ruby and Python implement their interactive consoles?

    - by sxa
    When implementing the interpreter for my programming language I first thought of a simple console window which allows the user to enter some code which is then executed as a standalone program as a shell. But there are severe problems: If every line of code the user enters is handled as a standalone program, it has to go through the tokenizer and parser and is then just executed by the interpreter - what about functions then? How can the Python/Ruby interactive consoles (IDLE, irb) "share" the code? How is the code entered handled? Example: >> def x: >> print("Blah") >> >> x() Where is the function stored so it can be called at any time again? How can the interactive console take everything entered as obviously one program without executing everything over and over again?

    Read the article

  • File using .net sockets, transferring problem

    - by Sergei
    I have a client and server, client sending file to server. When i transfer files on my computer(in local) everything is ok(try to sen file over 700mb). When i try to sent file use Internet to my friend in the end of sending appears error on server "Input string is not in correct format".This error appears in this expression fSize = Convert::ToUInt64(tokenes[0]); - and i don't mind wht it's appear. File should be transfered and wait other transferring ps: sorry for too much code, but i want to find solution private: void CreateServer() { try{ IPAddress ^ipAddres = IPAddress::Parse(ipAdress); listener = gcnew System::Net::Sockets::TcpListener(ipAddres, port); listener->Start(); clientsocket =listener->AcceptSocket(); bool keepalive = true; array<wchar_t,1> ^split = gcnew array<wchar_t>(1){ '\0' }; array<wchar_t,1> ^split2 = gcnew array<wchar_t>(1){ '|' }; statusBar1->Text = "Connected" ; // while (keepalive) { array<Byte>^ size1 = gcnew array<Byte>(1024); clientsocket->Receive(size1); System::String ^notSplited = System::Text::Encoding::GetEncoding(1251)->GetString(size1); array<String^> ^ tokenes = notSplited->Split(split2); System::String ^fileName = tokenes[1]->ToString(); statusBar1->Text = "Receiving file" ; unsigned long fSize = 0; //IN THIS EXPRESSIN APPEARS ERROR fSize = Convert::ToUInt64(tokenes[0]); if (!Directory::Exists("Received")) Directory::CreateDirectory("Received"); System::String ^path = "Received\\"+ fileName; while (File::Exists(path)) { int dotPos = path->LastIndexOf('.'); if (dotPos == -1) { path += "[1]"; } else { path = path->Insert(dotPos, "[1]"); } } FileStream ^fs = gcnew FileStream(path, FileMode::CreateNew, FileAccess::Write); BinaryWriter ^f = gcnew BinaryWriter(fs); //bytes received unsigned long processed = 0; pBarFilesTr->Visible = true; pBarFilesTr->Minimum = 0; pBarFilesTr->Maximum = (int)fSize; // Set the initial value of the ProgressBar. pBarFilesTr->Value = 0; pBarFilesTr->Step = 1024; //loop for receive file array<Byte>^ buffer = gcnew array<Byte>(1024); while (processed < fSize) { if ((fSize - processed) < 1024) { int bytes ; array<Byte>^ buf = gcnew array<Byte>(1024); bytes = clientsocket->Receive(buf); if (bytes != 0) { f->Write(buf, 0, bytes); processed = processed + (unsigned long)bytes; pBarFilesTr->PerformStep(); } break; } else { int bytes = clientsocket->Receive(buffer); if (bytes != 0) { f->Write(buffer, 0, 1024); processed = processed + 1024; pBarFilesTr->PerformStep(); } else break; } } statusBar1->Text = "File was received" ; array<Byte>^ buf = gcnew array<Byte>(1); clientsocket->Send(buf,buf->Length,SocketFlags::None); f->Close(); fs->Close(); SystemSounds::Beep->Play(); } }catch(System::Net::Sockets::SocketException ^es) { MessageBox::Show(es->ToString()); } catch(System::Exception ^es) { MessageBox::Show(es->ToString()); } } private: void CreateClient() { clientsock = gcnew System::Net::Sockets::TcpClient(ipAdress, port); ns = clientsock->GetStream(); sr = gcnew StreamReader(ns); statusBar1->Text = "Connected" ; } private:void Send() { try{ OpenFileDialog ^openFileDialog1 = gcnew OpenFileDialog(); System::String ^filePath = ""; System::String ^fileName = ""; //file choose dialog if (openFileDialog1->ShowDialog() == System::Windows::Forms::DialogResult::OK) { filePath = openFileDialog1->FileName; fileName = openFileDialog1->SafeFileName; } else { MessageBox::Show("You must select a file", "Error", MessageBoxButtons::OK, MessageBoxIcon::Exclamation); return; } statusBar1->Text = "Sending file" ; NetworkStream ^writerStream = clientsock->GetStream(); System::Runtime::Serialization::Formatters::Binary::BinaryFormatter ^format = gcnew System::Runtime::Serialization::Formatters::Binary::BinaryFormatter(); array<Byte>^ buffer = gcnew array<Byte>(1024); FileStream ^fs = gcnew FileStream(filePath, FileMode::Open); BinaryReader ^br = gcnew BinaryReader(fs); //file size unsigned long fSize = (unsigned long)fs->Length; //transfer file size + name bFSize = Encoding::GetEncoding(1251)->GetBytes(Convert::ToString(fs->Length+"|"+fileName+"|")); writerStream->Write(bFSize, 0, bFSize->Length); //status bar pBarFilesTr->Visible = true; pBarFilesTr->Minimum = 0; pBarFilesTr->Maximum = (int)fSize; pBarFilesTr->Value = 0; // Set the initial value of the ProgressBar. pBarFilesTr->Step = 1024; //bytes transfered unsigned long processed = 0; int bytes = 1024; //loop for transfer while (processed < fSize) { if ((fSize - processed) < 1024) { bytes = (int)(fSize - processed); array<Byte>^ buf = gcnew array<Byte>(bytes); br->Read(buf, 0, bytes); writerStream->Write(buf, 0, buf->Length); pBarFilesTr->PerformStep(); processed = processed + (unsigned long)bytes; break; } else { br->Read(buffer, 0, 1024); writerStream->Write(buffer, 0, buffer->Length); pBarFilesTr->PerformStep(); processed = processed + 1024; } } array<Byte>^ bufsss = gcnew array<Byte>(100); writerStream->Read(bufsss,0,bufsss->Length); statusBar1->Text = "File was sent" ; btnSend->Enabled = true; fs->Close(); br->Close(); SystemSounds::Beep->Play(); newThread->Abort(); } catch(System::Net::Sockets::SocketException ^es) { MessageBox::Show(es->ToString()); } } UPDATE: ok, i can add checking if clientsocket->Receive(size1); equal zero, but why he begin receiving data again , in the ending of receiving. UPDATE:After adding this checking problem remains. AND WIN RAR SAY TO OPENING ARCHIVE - unexpected end of file! UPDATE:http://img153.imageshack.us/img153/3760/erorr.gif I think it continue receiving some bytes from client(that remains in the stream), but why existes cicle while (processed < fSize)

    Read the article

  • How can I make sure a ListView item always resizes to show all rows?

    - by Jon Cage
    I have a panel which contains a TableLayoutPanel which itself contains a number of ListViews and Labels. What I'd like is for each list view to resize to fit all of it's contents in vertically (i.e. so that every row is visible). The TableLayoutPanel should handle any vertical scrolling but I can't work out how to get the ListView to resize itself depending on the number of rows. Do I need to handle OnResize and manually resize or is there already something to handle this?

    Read the article

  • File using sockets .net, tranfering problem

    - by Sergei
    I have a client and server, client sending file to server. When i transfer files on my computer(in local) everything is ok(try to sen file over 700mb). When i try to sent file use Internet to my friend in the end of sending appears error on server "Input string is not in correct format".This error appears in this expression fSize = Convert::ToUInt64(tokenes[0]); - and i don't mind wht it's appear. File should be transfered and wait other transferring ps: sorry for too much code, but i want to find solution private: void CreateServer() { try{ IPAddress ^ipAddres = IPAddress::Parse(ipAdress); listener = gcnew System::Net::Sockets::TcpListener(ipAddres, port); listener->Start(); clientsocket =listener->AcceptSocket(); bool keepalive = true; array<wchar_t,1> ^split = gcnew array<wchar_t>(1){ '\0' }; array<wchar_t,1> ^split2 = gcnew array<wchar_t>(1){ '|' }; statusBar1->Text = "Connected" ; // while (keepalive) { array<Byte>^ size1 = gcnew array<Byte>(1024); clientsocket->Receive(size1); System::String ^notSplited = System::Text::Encoding::GetEncoding(1251)->GetString(size1); array<String^> ^ tokenes = notSplited->Split(split2); System::String ^fileName = tokenes[1]->ToString(); statusBar1->Text = "Receiving file" ; unsigned long fSize = 0; //IN THIS EXPRESSIN APPEARS ERROR fSize = Convert::ToUInt64(tokenes[0]); if (!Directory::Exists("Received")) Directory::CreateDirectory("Received"); System::String ^path = "Received\\"+ fileName; while (File::Exists(path)) { int dotPos = path->LastIndexOf('.'); if (dotPos == -1) { path += "[1]"; } else { path = path->Insert(dotPos, "[1]"); } } FileStream ^fs = gcnew FileStream(path, FileMode::CreateNew, FileAccess::Write); BinaryWriter ^f = gcnew BinaryWriter(fs); //bytes received unsigned long processed = 0; pBarFilesTr->Visible = true; pBarFilesTr->Minimum = 0; pBarFilesTr->Maximum = (int)fSize; // Set the initial value of the ProgressBar. pBarFilesTr->Value = 0; pBarFilesTr->Step = 1024; //loop for receive file array<Byte>^ buffer = gcnew array<Byte>(1024); while (processed < fSize) { if ((fSize - processed) < 1024) { int bytes ; array<Byte>^ buf = gcnew array<Byte>(1024); bytes = clientsocket->Receive(buf); if (bytes != 0) { f->Write(buf, 0, bytes); processed = processed + (unsigned long)bytes; pBarFilesTr->PerformStep(); } break; } else { int bytes = clientsocket->Receive(buffer); if (bytes != 0) { f->Write(buffer, 0, 1024); processed = processed + 1024; pBarFilesTr->PerformStep(); } else break; } } statusBar1->Text = "File was received" ; array<Byte>^ buf = gcnew array<Byte>(1); clientsocket->Send(buf,buf->Length,SocketFlags::None); f->Close(); fs->Close(); SystemSounds::Beep->Play(); } }catch(System::Net::Sockets::SocketException ^es) { MessageBox::Show(es->ToString()); } catch(System::Exception ^es) { MessageBox::Show(es->ToString()); } } private: void CreateClient() { clientsock = gcnew System::Net::Sockets::TcpClient(ipAdress, port); ns = clientsock->GetStream(); sr = gcnew StreamReader(ns); statusBar1->Text = "Connected" ; } private:void Send() { try{ OpenFileDialog ^openFileDialog1 = gcnew OpenFileDialog(); System::String ^filePath = ""; System::String ^fileName = ""; //file choose dialog if (openFileDialog1->ShowDialog() == System::Windows::Forms::DialogResult::OK) { filePath = openFileDialog1->FileName; fileName = openFileDialog1->SafeFileName; } else { MessageBox::Show("You must select a file", "Error", MessageBoxButtons::OK, MessageBoxIcon::Exclamation); return; } statusBar1->Text = "Sending file" ; NetworkStream ^writerStream = clientsock->GetStream(); System::Runtime::Serialization::Formatters::Binary::BinaryFormatter ^format = gcnew System::Runtime::Serialization::Formatters::Binary::BinaryFormatter(); array<Byte>^ buffer = gcnew array<Byte>(1024); FileStream ^fs = gcnew FileStream(filePath, FileMode::Open); BinaryReader ^br = gcnew BinaryReader(fs); //file size unsigned long fSize = (unsigned long)fs->Length; //transfer file size + name bFSize = Encoding::GetEncoding(1251)->GetBytes(Convert::ToString(fs->Length+"|"+fileName+"|")); writerStream->Write(bFSize, 0, bFSize->Length); //status bar pBarFilesTr->Visible = true; pBarFilesTr->Minimum = 0; pBarFilesTr->Maximum = (int)fSize; pBarFilesTr->Value = 0; // Set the initial value of the ProgressBar. pBarFilesTr->Step = 1024; //bytes transfered unsigned long processed = 0; int bytes = 1024; //loop for transfer while (processed < fSize) { if ((fSize - processed) < 1024) { bytes = (int)(fSize - processed); array<Byte>^ buf = gcnew array<Byte>(bytes); br->Read(buf, 0, bytes); writerStream->Write(buf, 0, buf->Length); pBarFilesTr->PerformStep(); processed = processed + (unsigned long)bytes; break; } else { br->Read(buffer, 0, 1024); writerStream->Write(buffer, 0, buffer->Length); pBarFilesTr->PerformStep(); processed = processed + 1024; } } array<Byte>^ bufsss = gcnew array<Byte>(100); writerStream->Read(bufsss,0,bufsss->Length); statusBar1->Text = "File was sent" ; btnSend->Enabled = true; fs->Close(); br->Close(); SystemSounds::Beep->Play(); newThread->Abort(); } catch(System::Net::Sockets::SocketException ^es) { MessageBox::Show(es->ToString()); } }

    Read the article

  • Remove value from array?

    - by Rajesh45
    Hello friend, How can I take out one line of this array array< array< int^ >^ >^ sample = gcnew array< array< int^ >^ >{ gcnew array<int>{0, 0, 0, 0, 0}, gcnew array<int>{1, 1, 1, 1, 1}, gcnew array<int>{2, 2, 2, 2, 2}, }; So it would be :- array< array< int^ >^ >^ sample = gcnew array< array< int^ >^ >{ gcnew array<int>{0, 0, 0, 0, 0}, gcnew array<int>{2, 2, 2, 2, 2}, }; Rajesh.

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >