w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Issues with System.Diagnostics.Process OutputDataReceived and wkhtmltopdf
If anyone had the same issue as I did, they might want to try the solution here. Worked flawlessly for me.

Categories : C#

Executed piped commands via System.Diagnostics.Process on Mono
bash is interpreting your command as a file name followed by arguments, meaning it invokes echo and passes all the rest (including the pipe |) to it for printing so you will get test | sudo -S shutdown -r +1 echoed and sudo won't be executed. You should use the -c option to execute a command. Furthermore, you should quote the command itself so that it gets passed as a single argument. Something like this should work: var processStartInfo = new ProcessStartInfo { FileName = "/bin/bash", Arguments = "-c "echo test | sudo -S shutdown -r +1"" };

Categories : C#

System.Diagnostics.Process.StandardOutput returning bad string that have accentuation
It is code page 850, the MS-Dos code page for Portuguese. ç = 0x87, ã = 0xc6. Your program is currently incorrectly using code page 1252, 0x87 = ‡, 0xc6 = Æ.

Categories : C#

VS2012 link.exe runs from command line, but not from C#'s System.Diagnostics.Process?
I'd imagine this is down to the working directory, when you call the process from your applicaton, the working directory used is derived from wherever the application was started from, i.e bin/debug. The commandline will most likely be opening it from its native location where the dll also lives. Therefore your application will be looking in bin/debug for the dll instead of the correct directory You can set the working directory to the correct directory through ProcessStartInfo... var linkerPath = Path.Combine( Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "\Microsoft Visual Studio 11.0\VC\bin\link.exe"); ProcessStartInfo startInfo = new ProcessStartInfo { FileName = linkerPath, WorkingDirectory = Path.GetDirectoryName(linkerPath)}; Proc

Categories : C#

System.Diagnostics.Process unable to launch file from Mapped Drive in Windows Form App
I tested your code and it runs properly for me. The only way I could reproduce your error is by running it with an unmapped drive (Changed to z: ext.txt which is not mapped). Make sure that the computer RUNNING the program has the specified mapped drive on their computer. Just because the program may reside on a server and the server has the required mapped drives, doesn't mean that the clients running the program have the same mapped drives.

Categories : Dotnet

The process cannot access the file because it is being used by another process - using static class
In your MakeThumbnail methods, make sure you're calling Dispose() on the Image types. That or use the using syntax: using (Image img = Image.FromFile(ImgIn)) { // Your code }

Categories : C#

Activity class being called before the asynctask finishes background process in application class
It's not good practice to start an activity and try to hold the onCreate event until data has been processed or received. Instead override the onPostExecute method in the AsyncTask which will be executed after doInBackground finish. protected void onPostExecute(Void v) { // Add your code here !!! } The reason you get a main thread exception on ICS is because you are running some network API (YouTubeParser) on the main UI thread. Try this instead. Thread t = new Thread(new Runnable() { public void run() { parser = new YouTubeParser( "http://powergroupbd.com/youtube/getyoutubejson.php"); new ParserLoader().execute(); } } t.start();

Categories : Android

How do I get useful diagnostics from boto?
You can configure the boto.cfg file to be more verbose: debug = 2 0 - no debug messages are printed 1 - basic debug messages from boto are printed 2 - all boto debugging messages plus request/response messages from httplib

Categories : Amazon

Where to get ServiceRuntime and Diagnostics v2.0.0.0?
Do you have version 2.0 of SDK installed? To check, you should see the following folder C:Program FilesMicrosoft SDKsWindows Azure.NET SDKv2.0. If you have that, then you can find the necessary DLLs in ref folder.

Categories : Azure

Azure ServiceRuntime and Diagnostics v2.0.0.0?
I had to uninstall the SDK and reinstall it using the Web Platform installer. I would have expected it to prompt for an upgrade or that there is a newer SDK out. This was further confusing because I was using NuGet for the v2 of the Storage Libraries.

Categories : Azure

How do you disable specific clang diagnostics via an .xcconfig?
Xcode allows you to copy entries from the Build Settings pane using ⌘-C; the result when pasting is the text that corresponds to that setting for use in an .xcconfig file. When I entered -Wno-objc-noncopy-retain-block-property into the "Other Warning Flags" row, and copy-pasted that into a new .xcconfig file, I ended up with this: //:configuration = Debug WARNING_CFLAGS = -Wno-objc-noncopy-retain-block-property //:configuration = Release WARNING_CFLAGS = -Wno-objc-noncopy-retain-block-property and that does indeed seem to supress the warning about a retain Block property.

Categories : Objective C

Missing Microsoft.WindowsAzure.Diagnostics assembly
Try find in your .csproj file the following: <Reference Include="Microsoft.WindowsAzure.Diagnostics, Version=2.0.0.0 /> and replace it with <Reference Include="Microsoft.WindowsAzure.Diagnostics, Version=2.1.0.0 />

Categories : C#

Cant find reference to System.Diagnostics.Stopwatch
You'll need: Stopwatch stopWatch = new Stopwatch(); You just have (public stopWatch = new StopWatch) which is not how C# objects are created. stopWatch is the instance, StopWatch is the class definition.

Categories : C#

Why would I turn System.Diagnostics trace autoflush off?
From the docs: Trace.AutoFlush Property Gets or sets whether Flush should be called on the Listeners after every write. For performance reasons, you might prefer flushing less frequently (less IO). The downside of this is, lines that are not flushed will be lost in case of a crash. Edit: The impact will be proportional to how frequent the trace is written to. If you aren't making a heavy use of it, the performance gain will possibly be ignorable. However, it is generally used in the whole codebase. Measuring is always better.

Categories : Dotnet

Azure instances from 0 to 3 not writing diagnostics data in WadPerformanceCountersTable
Seeing how your first instances are not transferring data to diagnostics while the later instances do, one possible reason is as follows: The local diagnostic store on your servers is filled up with diagnostic data and Azure can no longer transfer data out of your local store to storage. Be sure that that space allocated to DiagnosticStore in Role configuration (under Local Storage) is bigger than the amount of buffer quota allocated in diagnostics.wadcfg Detailed explanation: I've experienced this first-hand with a number of customers, so the following is my own interpretation based on comments from Microsoft support. Azure Diagnostics API does not clean up local storage according to the BufferQuota until that quota is exceeded. DiagnosticStore in cloud project defaults to the same

Categories : C#

Using System.Diagnostics.EventLog in a C# daemon and mono-service
It's not 100% clear from your question - are you expecting the event log code to be working on Linux? If so, perhaps this answer will help you.

Categories : Linux

Force compilation and diagnostics on save with YouCompleteMe plugin
You need to trigger that command on the event of saving using an autocmd: autocmd BufWritePost * YcmForceCompileAndDiagnostics Or mabye just for certain file extensions: autocmd BufWritePost *.c YcmForceCompileAndDiagnostics See :help autocommand and :help BufWritePost. HTH

Categories : Vim

Nlog: How to output Nested Diagnostics Context value to a log file?
Just figured it out. Found an exmaple for MDC. Just tweaked it a bit for NDC. Here's the updated config: <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <variable name="mycontext" value="${ndc:item=mycontext} - ${longdate} - ${message} "/> <targets> <target name="logfile" xsi:type="File" fileName="somepath\logfile.txt" layout="${mycontext}"/> </targets> <rules> <logger name="*" minlevel="Debug" writeTo="logfile" /> </rules> </nlog>

Categories : C#

Microsoft.Diagnostics.Runtime: how to read crash dump?
Missing mscordacwks.dll is a pain that I have run into from time to time using WinDbg to look into crash dump files (I notice that you are attempting to use ClrMD to accomplish the same end goal). Normally the microsoft symbol server is pretty comprehensive, but in the case of mscordacwks.dll not all versions exist on the public symbol server (as is described here). The best way to get the matching mscordacwks.dll version is to pull it from the machine (and the appropriate .net framework folder) where the crash dump was created if the public symbol server should fail. Honestly I am more of a WinDbg user so I am more used to dealing with mscordacwks there, but from looking around on google I did find a couple of interesting articles. The first mentioned that you can do this: // DataTarget

Categories : C#

Diagnostics to find out why Azure Web Role doesn't start
First, debug on your dev machine. Make sure you deployed the right .cscfg file, you don't have any broken connection strings, you're referencing the right version of the DLLs (the same as Azure's VMs) or are copying newer versions to Azure. If those fail, read this topic on WindowsAzure.com and the topics in this node on MSDN. The Hello World code sample also has a basic demonstration of diagnostics that should be helpful. The basics of diagnostics in Windows Azure: Must be manually enabled for each role by importing the Diagnostics module in your ServiceDefinition.csdef file A storage location needs to be configured for the resulting logs in your ServiceConfiguration.cscfg file, such as the storage emulator, or a Windows Azure Storage account. Depending on the types of logs, they are

Categories : Azure

how to catch a System.Diagnostics.Eventing.Reader error in powershell
It's probably happening when PowerShell is trying to convert $commandString into an XmlDocument (the type of the -FilterXml parameter). I don't think you'll be able to capture the error in your error variable since it is happening before the call into Get-WinEvent. Your best bet is to validate $commandString before trying to pass it to Get-WinEvent. try { $xmlDoc = New-Object 'Xml.XmlDocument' $xmlDoc.LoadXml( $commandString ) } catch { # Or do some other kind of error handling. You're the driver! Write-Error ('Oh no! Bad XML! What are you thinking?!') } $lbx_workstationg.SelectedItems | ForEach-Object { Get-WinEvent -ComputerName $_ -FilterXml $commandString -ErrorAction SilentlyContinue -ErrorAction eventerr } | Select-Object MachineName, TimeCreated, Level

Categories : Powershell

How to wait async process from other class?
This is accomplished by using the Task Parallel Library You can change your Parse method to: Task<string> ParseAsync() { return client.DownloadStringTaskAsync(new Uri(uri)); } Then your Main method: var p = new Parser(); var parseTask = p.Parse(); //This will block the current thread until Result is available someMethod(parseTask.Result); or if you don't want to block current thread, you can use continuation: var p = new Parser(); var parseTask = p.Parse(); parseTask.ContinueWith(task => someMethod(task.Result)); All this is assuming .Net 4.5.

Categories : C#

Using Python's multiprocessing.Process class
I often wondered why Python's doc page on multiprocessing only shows the "functional" approach (using target parameter). Probably because terse, succinct code snippets are best for illustration purposes. For small tasks that fit in one function, I can see how that is the preferred way, ala: from multiprocessing import Process def f(): print('hello') p = Process(target=f) p.start() p.join() But when you need greater code organization (for complex tasks), making your own class is the way to go: from multiprocessing import Process class P(Process): def __init__(self): super(P, self).__init__() def run(self): print('hello') p = P() p.start() p.join() Bear in mind that each spawned process gets a copy of the master process' stack. And that the constructor c

Categories : Python

Kill a process created in a different class
Assuming your run the process in a separate thread, you can call processThread.interrupt() from your GUI class. You then simply need to modify the try/catch to: try { p1.waitFor(); } catch (InterruptedException e) { Sys.err(e.toString()); //don't ignore the exception: p1.destroy(); Thread.currentThread.interrupt(); //reset interrupted flag }

Categories : Java

Fragment class for doing some background process
Background or long running operations of an activity must be carried out in AsyncTask or using a service. A fragment is basically a portion of user interface in an Activity. Code samples and more detailed explanations for Asynctask and Services can be found here and here

Categories : Android

The type initializer for 'System.Transactions.Diagnostics.DiagnosticTrace' threw an exception
Changed the database to sqlite and everything is working very smoothly... I think that in Access db there are some problems with the transactions.It got resolved by changing the database. Still I am not sure what was causing that weird error.

Categories : C#

The type initializer for 'System.ServiceModel.Diagnostics.TraceUtility' threw an exception
The issue has been overcome. Probably I was having two app.config files. One is from the service reference and another one from my application. Both were having the same code. I just removed the below code from my appl.config which is placed in my application. Now it is not throwing the above exception. <commonBehaviors> <serviceBehaviors> <serviceTimeouts transactionTimeout="01:55:00"/> </serviceBehaviors> </commonBehaviors>

Categories : Api

Read file, and process words with Word class, method
The problem is that scan.next() returns a String not a Word object you can not assign it like that. Try this: while (scan.hasNext()) { Word word = new Word(scan.next()); //... } To do this, you need a constructor like that: public Word(String s){ //... }

Categories : Java

Get textfield string input from html file to process/use in java class
You are using a doGet method, but your form is using POST. Use a doPost method. See also Servlets: doGet and doPost

Categories : Java

Why does Serialization process require access to a no argument constructor of the first non serializable super class?
What is the premise behind the third point above? So that the non-Serializable base classes can be initialized to a known state that can be controlled to some extent by the programmer. It's just a design decision.

Categories : Java

Fatal error: Class 'PHPMailer' not found in .../contact/mailtest/process.php on line 8
If you have included all of PHPMailer's source files in the same directory, and you're using the latest version... I recommend using require_once('PHPMailerAutoload.php'); $mail = new PHPMailer(); The Autoload file is a great resource which saves a lot of effort when setting it up.

Categories : PHP

java.io.IOException: Can't process class when running ProGuard in Maven build of Android project
The issue is that your re-packaged jar contains *.class files which do not start with the correct magic bytes such a file is expected to start with, i.e. 0xCAFEBABE, cf. this wikipedia article. It also names the file in question: __MACOSX/spongycastleseriouslyreduced/org/spongycastle/crypto/._BlockCipher.class The naming scheme indicates that this indeed is not a *.class file at all but instead a metafile added by some Mac zip program. Proguard does not know such Mac specific stuff and, therefore, falls. Thus, when you rezip the file, you have to take care that you do not add such Mac specific stuff. This can be done by e.g. using the Java SDK jar utility or a non-Mac zip utility.

Categories : Android

Using the ion_auth login process and using a templated process to render the login process
There is no need to use ion_auth views or controllers. they are just for reference. we have to use their function as they have define in model for login/logout/register etc... just simply put his model,library and config file to the respective folder of codeigniter in your project and just use their function as they have shown in demo

Categories : Codeigniter

cross memory attach. How do I get the remote address from a child process to a parent process
The system calls process_vm_readv and process_vm_writev are meant for fast data transfer between processes. They are supposed to be used in addition to some traditional way of interprocess communication. For example, you may use a regular pipe or fifo to transfer the required addresses between your processes. Then you may use those addresses to establish faster process_vm_ communication. The simpliest way to transfer something between forked processes should be the pipe() function (man 2 pipe has a good example of its usage). There are many other ways to do so of course, like using sockets or messages. You can even write an address to a file and let the other process read it.

Categories : C

How do I deal with cases when Process.Kill() yields "access denied" because the process is terminating?
Use the command line C# to kill the task, for example Taskkill /F /IM ExeName.exe. If you do not have a persmission to kill the task than also force kill will not help. More info Please check http://www.c-sharpcorner.com/UploadFile/8ea152/kill-process-from-the-command-prompt-in-windows-8/ here an example how to run command line in C# Run Command Prompt Commands Greetings

Categories : C#

How to create a new process with command line arguments and give the PID to the parent process?
You can use createprocess() function in windows. Its signature is below BOOL WINAPI CreateProcess( _In_opt_ LPCTSTR lpApplicationName, _Inout_opt_ LPTSTR lpCommandLine, _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes, _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes, _In_ BOOL bInheritHandles, _In_ DWORD dwCreationFlags, _In_opt_ LPVOID lpEnvironment, _In_opt_ LPCTSTR lpCurrentDirectory, _In_ LPSTARTUPINFO lpStartupInfo, _Out_ LPPROCESS_INFORMATION lpProcessInformation ); Example: STARTUPINFO si; PROCESS_INFORMATION pi; //This structure has process id ZeroMemory( &si, sizeof(si) ); si.cb = sizeof(si); ZeroMemory( &pi, sizeof(pi) ); if( argc != 2 ) { printf("Usage: %s [

Categories : C++

multiprocess in python: cross process to process watch-kill-restart
I've enabled Debug functions, and tried to kill and restart child processes from the parent. I've turned A and B in classes and added a shutdown method that kill the failing process, after this, if I try A.start() or A.run() this error appear 'cannot start a process twice'.What this means? the process is dead, there aren't others running. If I call multiprocessing.active_childre() the process aren't restarted but got this output: <Process(SyncManager-2, started)>, <Process(SyncManager-1, started)>, <Process(SyncManager-3, started)>] [INFO/MainProcess] process shutting down [DEBUG/MainProcess] running all "atexit" finalizers with priority >= 0 [SUBDEBUG/MainProcess] calling <Finalize object, callback=_decref, args=(Token(typeid='Value', address='/tmp/pymp-2ObnP1

Categories : Python

In Java What is the exit value of a process which is killed in the background through Linux shell using process id
This is not a Java specific question. The return code will be the same for all Unix systems here (at least I have never seen a Unix system not behaving this way): 128 + the number of the signal which caused the process to terminate. No idea for Windows... Therefore, 130 in your case. In C, you'd check (after a call to waitpid() for instance) whether a process has been terminated by a signal using WIFSIGNALED(status).

Categories : Java

Node.js Detached child process is invoked as interactive foreground process
I think this may be a problem with node on windows. I tried both your code and the sample code on the node documentation you are for sure referencing yourself at http://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options on my Ubuntu virtual machine and it works just fine. Process is detached and keeps running and there is no output anywhere but to out.log because it is running successfully in the background. I ran both a simple ping command and also ran a node instance on a javascript file like you are trying to do and both worked just fine. I would recommend you do the same with a ping command in windows. . . var child = child_process.spawn('ping', ['-n','25','localhost'],. . . If that works like you would expect, there may be something insi

Categories : Javascript

FileMode and FileAccess and IOException: The process cannot access the file 'filename' because it is being used by another process
You need to release control of the file from Program A. Try closing or disposing the streamwriter when you finish. Or you might attempt using as is described in the answer to this question: Releasing access to files

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.