w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
reading a file which is locked by other process
If you want to update the file at the same time it is being read, it is better to do it atomically (write a new version under different name, then merge its contents or rename it later on). However, you need to make sure that there is only one process which is updating it at any given point of time (the perl script, in this case), or there could be a race condition. You may also want to read up on unix file-locking in general.

Categories : Java

Can an android process run while screen is locked without WAKE_LOCK?
Without a wake lock, the device usually goes to sleep a few seconds (30-60, usually) after the screen is locked. During this period, only the radios are kept on low power to receive calls, SMS and push notifications. Everything else, like your app, will be paused. If you want to continue working with the screen off, you should obtain a wakelock.

Categories : Android

Interogate which process has locked a file in Windows C ++
I am just googling for you, but I found this "Various C language run-time systems use the IOCTLs for purposes unrelated to Windows Sockets. As a consequence, the ioctlsocket function and the WSAIoctl function were defined to handle socket functions that were performed by IOCTL and fcntl in the Berkeley Software Distribution." There is also a brief discussion here - it is python based but has some clues.

Categories : C++

System.IO.IOException: The process cannot access the file because it is being used by another process
Short answer: Try Thread.Sleep(100) before you read and then read as fast as you can. I thought that by setting the FileAccess.Read I should be able to always read the file? By setting FileAccess.Read you are just saying that you need to read from the file. By setting FileShare.ReadWrite you are saying you are comfortable with the 3rd party reading and writing to the file while you read it. The exception means that the 3rd party is not comfortable with you reading while they are writing. Your first bet is to check if you can configure the 3rd party process to allow other processes to read while they write, but be aware that reading from a file that is being written to can be troublesome. How can I make sure that this doesn't cause an exception, or do I need to just loop around un

Categories : C#

sql server 2012 locked and wont function well
This sounds like blocking. When you experience this, look in the status bar of Management Studio for the query window where the query is hanging. It will be in parentheses after your username, e.g.: DOMAINUsername (spid) -----------------^^^^ this will be a number Now, take that number, from within those parentheses, and open another window. In that second window, run the following: SELECT blocking_session_id, wait_type FROM sys.dm_exec_requests WHERE session_id = <SPID from above>; If a session shows up in blocking_session_id, find out who they are and what they're doing. SELECT * FROM sys.dm_exec_requests WHERE session_id = <blocking_session_id from above>; DBCC INPUTBUFFER(<that blocking_session_id>); You can also check if the database has any old

Categories : Sql Server

"The bundle currently has sqlite3 locked" when running Passenger server
Ended up solving the issue by first executing sudo bundle update sqlite3. I would then get the message: Could not find colorize-0.5.8 in any of the sources. To solve this I executed: bundle --deployment. After this I ended up with the error message: Specified 'mysql2' for database adapter, but the gem is not loaded. Addgem 'mysql2'to your Gemfile. which was a strange error to get because I do have mysql2 in my gem file. To solve this issue I removed the Gemfile.lock file, executed bundle --no-deployment then executed bundle --deployment. After all that, passenger finally works.

Categories : Ruby On Rails

weblogic domain server.out log file manually modified locked
First question: Generally speaking the .out file is created during server start and not updated once the server reaches the RUNNING state. The .log file should be updated continually however. It is safe to delete both of these files and once the server is restarted they should be regenerated. If for some reason they are not, go to server name -> Logging tab -> Log file name and specify the full path and name for a new log file. Second question: If you chose nostage for your deployment, it will not be copied to your server and will live wherever the file originally was. stage mode should copy the file to tmp/_WL_user after starting out under a stage directory. You can remove your deployment from the weblogic admin console and also delete the tmp and cache folders and try the deplo

Categories : File

using python os.system for 2 process
Try os.chdir(path) to change the directory. Or you could use the folder as a prefix in your second command. This explains, why cd won't work. I would prefer to use subprocess.Popen(..) instead of os.system. It allows to specify a current working directory for the command you execute.

Categories : Python

Can I specify a working dir when launching process with std::system?
I don't believe there's a portable way to achieve what you want, at least it is not mandated by the C++ standard from what I can tell. Generally speaking, if you need more functionality than system() provides, you should look elsewhere. On Linux and Unix systems, this would be the fork(2) and exec(3) functions. On Windows CreateProcess(). Untested code for a Linux way to achieve this would be: #include <cstdio> #include <unistd.h> int main() { const pid_t pid( fork() ); if ( !pid ) { // child process if ( chdir("/tmp") ) { perror( "chdir" ); } execl( "/binary", "binary", (char*)0 ); perror( "execl("/binary")" ); _exit( 1 ); } }

Categories : C++

Wordpress blog hitting several CPU process on hostgator server than the limit, causing 500 server error
Your problem is most likely related to the underpowered or over-provisioned HostGator shared servers. Since their purchase by EIG last year, they've migrated customers to new hardware, and from my experience (I host 40+ WP blogs with them) this new hardware or provisioning rules has created poor performance for any site that relies on MySQL such as WordPress. Shared hosting is always a gamble as you rely on the hosting provider to manage the number of accounts, and the performance as a whole. I've hosted with HG for years and they've been great, but since late 2013 the performance has been atrocious. Caching is only a band-aid, as the core problem is MySQL performance and the over-crowding of the server. Find another (non EIG) shared web host, or upgrade to a VPS to give you more cont

Categories : Wordpress

How to know the reason why the process was killed by system(linux)
The exact log file varies dependingon distribution and configuration, but if you do ls -ldrat /var/log/* it will show the most recently edited logfiles at the bottom. The files messages,dmesg and daemon are all likely sources of information. Possible reasons are: memory exception (i.e. segfault) process limits breach (to many File descriptors or processes being opened) - check /etc/security/limits.conf and surrounding files SElinux (if enabled) - that should have been logged to messages.

Categories : Linux

Is there a system call for obtaining the uid/gid of a running process?
At the moment, the only viable solution I can come up with is something along the lines of this. Obviously, not gone to the effort to see if this actually works as I would expect it to yet...: int len, pid, n, fd = open("/proc/12345/status", O_RDONLY | O_NOATIME); char buf[4096], whitespace[50]; if (0 < (len = read(fd, buf, 4096))) { n = sscanf(buf, "Uid:%s%d ", whitespace, &pid); }

Categories : C

Regex Matching Date from Windows System Process
I am a user of python 2.7, so I don't know if there might be a difference in regular expressions there, but I don't know what the "-" means in them. For me, what works is: loginRex = "(d?d?d+:d+:d+)" That will match 1981:05:17 and 81:05:17 both. If the latter is not necessary, just erase the "?". Can you try this? Cheers!

Categories : Python

Is file object local to every process or System wide?
Each process does have its own file descriptor table, and each time a file is open()ed yields a separate file description. So there is sanity there! The exception is when a file descriptor is duplicated, either within a process (via dup()) or across processes (by one process fork()ing a copy with all the same FDs, or by passing a file descriptor through a UNIX domain socket). When this happens, the two descriptors end up sharing some properties with each other, including the offset. This is not necessarily a bad thing. It means, for instance, that two processes that are both writing to a shared file descriptor will not end up overwriting each other's output. It can sometimes have unexpected results, though. But it's not usually something that you'd end up with without knowing about it.

Categories : Linux

How does fork and pipe work in a unix process system?
pid_t cp; int fi[2],st; int n; if(pipe(fi)==-1) {perror("pipe error");exit(0);} if((cp=fork())==-1) {perror("fork"); exit(0);} else if(cp==0) { sleep(2); close(fi[1]); read(fi[0],&n,2); n*=2; close(fi[0]); exit(n); } else { close(fi[0]); write(fi[1],n,2); close(fi[1]); waitpid(cp,&st,0); printf("%d",st); exit(0); }} The working of pipes is very simple. A PIPE contains two ends, 1 for reading and another for writing. You have to close the appropriate end while reading or writing. After that you use it as a regular file with read() and write() functions. Forgive me for my formatting, I'm typing on a mobile.

Categories : Unix

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#

Does the system kill a backgrounded/in-memory app during the update process on iOS?
It will be killed. Whether it is terminated before, during or after the update is irrelevant - you should have saved state when the received the applicationDidEnterBackground:. There is no way that an app could continue executing once it's underlying code has changed - structures may have changed, you could have rewritten the threading model so that it does everything completely differently. You will have to save state and attempt to restore it if it is compatible; otherwise you should start from scratch. You should save the state in the applicationDidEnterBackground: call - you will probably not get an opportunity in the applicationWillTerminate: call, as it will probably not be called.

Categories : Iphone

Persistant effects of modifying process environment via system
That is how system works: it creates a subshell to execute your command, and when the command is complete, the subshell exits leaving your perl process unaffected. Section 8 of the Perl FAQ also answers this question. I {changed directory, modified my environment} in a perl script. How come the change disappeared when I exited the script? How do I get my changes to be visible? Unix In the strictest sense, it can't be done—the script executes as a different process from the shell it was started from. Changes to a process are not reflected in its parent—only in any children created after the change. There is shell magic that may allow you to fake it by eval()ing the script's output in your shell; check out the comp.unix.questions FAQ for details. You want code alon

Categories : Perl

How does a system call know what process a file descriptor belong to?
The operating system simply has to maintain a mapping of the combination of process ID and file descriptor to identify a particular file. It might do so by maintaining a list of file descriptors with a given process's task control block, or by whatever other means the implementer decided to use.

Categories : Linux

Using pinvoke to get access to system objects and query about a process
Last time I worked with P/Invoke, it was much easier to accomplish in a managed C++ library, and then import that into my c# app. If you know C++, you will save yourself a lot of trouble when it comes to those kinds of operations.

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#

Monitoring Windows system Read/Write operations by process?
You could try to find the Filemon tools from SysInternals. They offered the source for download back then, but it was removed. Might be that you can still find it via google. Basically this was done with a driver, so you would have to implement this as a device driver and use a filter driver on top of the file system. It was for NT/XP, but the basic idea should still work. It's not exactly trivial though, so I don't know if this is really what you want to do. I don't see a way to do this from user space, as this would be a big security risk if this can be easily done.

Categories : C#

How to install mysql server and xampp server both in same operating system
You must need to change the port. In xampp server there has a mysql and use port 3307. If you want to install mysql server on that machine then need to change the port of mysql of xampp server. As a result conflict booth mysql server and xampp server.

Categories : Mysql

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

Forever stop server.js returns "server.js is not a valid index for a forever process."
No idea why this worked, but for some reason it solved my problem. Well not entirely, but partially. When I su root and then run the forever commands, I am able to start and stopall without a hitch. Still getting the same error for forever stop server.js, so for whatever reason I'm unable to stop the server that way, but I got around it by being able to run forever stopall as su root.

Categories : Node Js

Cannot get my php to process sqlsrv_connect on my GoDaddy Server
Check if the Native SQL Driver (Microsoft Drivers 3.0 for PHP for SQL Server) is installed . Have you asked the Godaddy Team about this ?

Categories : PHP

UDP Server child process can't send
The problem is most likely in the client: while(1){ if(recv(sockfd,rmesg,sizeof(rmesg),0) > 0 ){ printf("From Server: %s", rmesg); } } You are calling recv on an unconnected socket. You're likely getting an error (probably ENOTCONN) which you are ignoring. And I believe you're also seeing high CPU usage on the clients, since it is continuously looping, failing each system call. The solution is to use recvfrom instead. Alternatively you can call connect on the socket, even if it is SOCK_DGRAM, but this is not normally done.

Categories : C

Executing daemon process on server
Use daemon(), it does exactly what you want. If this function is not available on your system, take a look at this tutorial which explains you how to rewrite the function.

Categories : C++

Out parameters deallocation in an out of process COM server
STDMETHODIMP CMyCom::process(/*[out]*/BSTR* pResponse); It must be attributed with [out, retval] to be COM Automation compatible. The Automation contract demands that the caller deallocates it after using the string. Any automation client gets this right.

Categories : Windows

Developing C# Winforms software using SQL Server 2012 in Visual Studio 2012 and running it on other system without installing SQL Server 2012
If you develop an application that use Sql Server 2012 as storage for your data then you need to install it in a way or another. There are numerous versions of Sql Server, like Sql Server Express and LocalDB. In every case you need the bits that supports your coding calls. This magazine article summarizes relevant infos on the various version of Sql Server I suppose that the right product for you is Sql Server LocalDB. A version of Sql Server that could be distributed easily with your application setup and doesn't require a complex installation procedure. However, if you don't foresee the need to escalate you application to a full Client-Server model and you need only a local storage for a single user, you could choose a single file database like Sql Server Compact Edition or SQLite or

Categories : C#

How many concurrent connections can MarkLogic server process?
Given a large enough budget there is no practical limit on the number of concurrent connections. The basic limit is the application server thread count, although excess requests will also pile up in the backlog queue. According to groups.xsd each application server is limited to at most 256 threads. The backlog seems to have no maximum, but most operating systems will silently limit it to something between 256-4096. So depending on whether or not you count the backlog, a single app server on a single host could have 256-4352 concurrent connections. After that you can use multiple app servers, and add hosts to the cluster. Use a load balancer if necessary. Most operating systems will impose a limit of around 32,000 - 64,000 open sockets per host, but there is no hard limit on the number o

Categories : Performance

Is it a security flaw to start new process in server?
It's vulnerable to people swamping your server and DOSsing it. You could place requests in a message queue, and then have a service processing items off the queue. This means you can guarantee that you have at most N processes running. And the worst case, you have a long queue, which you can cancel. If you use a message queue, you can move the queue consumer onto another server (or servers). This helps spread server load if you have a lot of demand for your service. Running on another service also means limited access to data, which would be good for security, meaning the executable can't access files and memory it doesn't need to. The downside is that this is asynchronous, and you need to notify that the file is ready for download. You also need to store it somewhere whilst it is waitin

Categories : C#

Defunct child process in perl TCP server
To avoid zombie processes (shown as "defunct" in listings) you have to acknowledge that they have stopped using the wait function. If you're not interested in their exit status on most Unix platforms it's enough to set the handler for SIGCHLD to IGNORE at the start of the program: $SIG{CHLD}='IGNORE'; For a more detailed discussion see the signal handling part here: http://perldoc.perl.org/perlipc.html

Categories : Perl

App Engine dev server: bad runtime process port ['']
Ok, found the error. I should read the error message more closly. It states module has no attribute. And thats beacuse of name collision. I had a file called stat. Somehow even if I reverted the project the file was still around, don't know why. Just renamed the file and everything works now again.

Categories : Python

Has server opened socket for each client process?
Usually, on the server side, after the socket is created and bound to a particular port/address combination, a function called Listen (or similar) will be called. This makes this bound socket a listening socket - it's just waiting for connection attempts to start. After this, there will be a call to a function called something like Accept on the listening socket. This call will take a pending connection request from the listening socket, create a new socket, and return that. All further communication between the client and the server will be via this new socket (at the server end), for the duration of the connection. Different techniques may be used to achieve scalability if the server needs to be handling multiple client connections simultaneously. One simple technique (which doesn't s

Categories : Sockets

WebSphere Process Server sends empty body
This appears to have been a dependency that we had included, but did not use. When we removed the dependency and republished it started working again. We think that the contents in this dependency generated a namespace conflict, but this only shows up when some other part of the system has loaded these files.

Categories : Misc

Unable to process a cube via a job that calls SSIS on another server
May be a double hop issue (Kerberos Delegation). Essentially, the job passes the SQL Server Agent credentials on [Server with Job] to [Server with Job Step] which then passes the credentials to [Server with Cube]. [Server with Job] - First Hop - [Server with Job Step] - Second Hop - [Server with Cube] If this is the case and Kerberos Delegation isn't properly configured, the trace on the cube or tabular model should reveal an Anonymous NTUsername.

Categories : Sql Server

Progress Bar for AJAX based on server-side process
For those wondering how I ended up doing this, I ended up doing several AJAX requests. My first AJAX request determined how many requests were going to need to be made (I had 700,000 DB records, I did 30,000 at a time) and setup the loading bar. Once the loading bar was setup, I hit the same ASPX file "X" amount of times, for each call that's made, I update the progress bar (Requires a bit of math). Once the progress bar reaches 100 percent, I do another AJAX request to grab the result from the server side processing that I did. My initial code that calls comparison.aspx, and appends it to a div. $.ajax({ url: "comparisons.aspx", type: "GET", success: getComparison, error: showErrors }); //On Success, show results function getComparison(result) {

Categories : C#



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