Posts

Showing posts with the label windows

How can I create a RAM disk programmatically?

How can I create a RAM disk programmatically? I am not looking for a code that invokes a command line utility, which does the trick. I am actually interested to know the API used to create a RAM disk. EDIT Motivation: I have a third party library which expects a directory name in order to process the files in that directory in a certain way. I have these files zipped in an archive. I wish to extract the archive into a RAM disk and pass the third party the path to the respective directory on that RAM disk. As you can see, memory mapped files are of no use to me . If you really consider RAM disk , there is no such CreateRAMDisk function in Windows. I think you need to look at how to create a driver for a disk, but the disk is redirected to RAM. However, if you want to simply redirect files to memory, then using memory-mapped file will do the task. – minjang Jan 1 '12 at 9:36 ...

windows application that overlapes other application all time with close and minimise buttons

windows application that overlapes other application all time with close and minimise buttons Hi i wanted to create a windows app that holds any other application in the side of the screen and no other app should be overlapped it, and the controls should be given to that app any time. and it can be moved around the screen but it should overlap all other apps screen By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Choregraphe - Define local method

Choregraphe - Define local method Is it possible to define a local method in Choregraphe which I can use not only in the box / script editor where I defined that method and instaed using it in different boxes. So far I created a python box with that one special method in it and everytime I used the function of the box I inserted it in my Flow Diagram. But I don't think this is the best way. Thank you for your help. 1 Answer 1 No, that isn't the best way indeed. Two possibilities: By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Is there any better way to capture the screen than PIL.ImageGrab.grab()?

Is there any better way to capture the screen than PIL.ImageGrab.grab()? I am making a screen capture program with python. My current problem is PIL.ImageGrab.grab() gives me the same output as 2 seconds later. For instance, for I think I am not being clear, in the following program, almost all the images are the same, have the same Image.tostring() value, even though I was moving my screen during the time the PIL.ImageGrab.grab loop was executing. >>> from PIL.ImageGrab import grab >>> l = >>> import time >>> for a in l: l.append(grab()) time.sleep(0.01) >>> for a in range(0, 30): l.append(grab()) time.sleep(0.01) >>> b = >>> for a in l: b.append(a.tostring()) >>> len(b) 30 >>> del l >>> last = >>> a = 0 >>> a = -1 >>> last = "" >>> same = -1 >>> for pic in b: if b == last: same ...

GetTempPathA returning incorrect user folder

GetTempPathA returning incorrect user folder I need to access the user specific temp folder on windows, which is supposed to be doable with the GetTempPathA() I have something along the lines of: char buff[512]; GetTempPath(500,buff); strcat(buff,"specific_folder_in_temp\file.txt"); FILE f*; f = fopen(buff,"w"); However, instead of returning the expected C:Usersuser.nameAppDataLocalTemp... I'm getting C:UsersUSER~1.NAMAppDataLocalTemp... This results in my code failing. Any tips as to what I might be doing wrong? What does GetTempPathW return? And what is the values of your TMP, TEMP, and USERPROFILE environment variables? (Type set at command prompt to see your env) – selbie Jul 2 at 5:47 set As the environment variables TMP or TEMP may use short path, you cou...

run .sh file from python spyder in windows

Image
run .sh file from python spyder in windows Please help me to run .sh file (bash file) from Python Spyder IDE in windows. I am using the below code. .sh import subprocess subprocess.call(['./test.sh']) I am facing the error: FileNotFoundError: [WinError 2] The system cannot find the file specified I do not know where I have to keep test.sh file in windows. test.sh I'm not sure there is going to be any easy way to run a shell script file on Windows (from Python or otherwise), since you probably don't have a Unix shell program available to run it. – Blckknght Jul 1 at 17:18 How about just rewriting the shell script into Python? – cricket_007 Jul 2 at 5:43 ...

Parity syncing pauses for long periods

Parity syncing pauses for long periods I've been having issues with my parity instance freezing up while syncing. Given enough time it'll generally pick up again but sometimes it will stay where it is for hours. Restarting the instance temporarily solves the problem and it will immediately start syncing like normal. For example, it might sync to the latest block at 15:00:00 and then not pick up anything until 15:30:00 (or a few hours later) and then start syncing until it catches back up to the top. Peers are generally 20+ and absolutely nothing new will show up in the console until parity decides to resume (or I restart) Running off of a windows server instance. Off of an HDD (Not ideal I know but except for these pauses it has been sufficient and the fact that restarting parity fixes the issue makes me believe it is unrelated to the hard drive performance) Running parity 1.10.8 with the cmd: parity.exe --jsonrpc-apis all --cache-size 1024 --db-compaction hdd --tracing off -...

How to destroy the First Window?

How to destroy the First Window? I am making the GUI Chat Program using the following Steps as following: After the Login is successful, the First Window has not been destroyed. (OS : window 7, Python 2.7) Please, help me to destroy the First Window successfully!! chat_login.py: from socket import * import thread, time import msvcrt as m from tkinter import * from tkinter import scrolledtext import os import sys login_w = Tk() login_w.title("The SCH Chat-Client V0.1") login_w.geometry('400x100') s = socket(AF_INET, SOCK_STREAM) id_label = Label(login_w,text=" I D : " ) id_label.grid(column=0, row=0) id_txt = Entry(login_w) id_txt.grid(row=0, column=1) pass_label = Label(login_w,text="Password : " ) pass_label.grid(column=0, row=1) pass_txt = Entry(login_w) pass_txt.grid(row=1, column=1) def recvMsg(sock): while True: recvmsg = sock.recv(1024) def Con_Clicked(): host = "127.0.0.1" port = 8008 print host try:...

Compile windows via c++ code error

Image
Compile windows via c++ code error When I compiled windows via c++ code of book(5th), meet this error Error C2373 '__pfnDliNotifyHook2': redefinition; different type modifiers 20-DelayLoadApp c:usersdtdownloadswindows-via-c-code-january-29-200820-delayloadappdelayloadapp.cpp and debug option setting: I can't understand why. Something error I set? It's not something you did wrong. The latter versions of the SDK declare the notify hook globals as const. There is a macro you can define to remove the const from the PfnDllHook type alias so you can do... what you're doing. I can't for the life of me recall it, and I'm not at my Windows box right now, but if you hop to the definition of PfnDllHook I bet you'll find out what it is. It's probably close by. – WhozCraig Jul 2 at 3:39 ...

Reading pipe asynchronously using ReadFile

Reading pipe asynchronously using ReadFile I think I need some clarification on how to read from a named pipe and have it return immediately, data or not. What I am seeing is ReadFile fails, as expected, but GetLastError returns either ERROR_IO_PENDING or ERROR_PIPE_NOT_CONNECTED, and it does this until my surrounding code times out. I get these errors EVEN THOUGH THE DATA HAS IN FACT ARRIVED. I know this by checking my read buffer and seeing what I expect. And the pipe keeps working. I suspect I am not using the overlapped structure correctly, I'm just setting all fields to zero. My code looks like this: gPipe = CreateFile(gPipename, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL); pMode = PIPE_READMODE_MESSAGE; bret = SetNamedPipeHandleState(gPipe, &pMode, NULL, NULL); OVERLAPPED ol; memset(&ol, 0, sizeof(OVERLAPPED)); // the following inside a loop that times out after a period bret = ReadFile(gPipe, &tmostat, sizeof(TMO64STAT), N...

Is it possible to install swoole in windows machine?

Is it possible to install swoole in windows machine? I have installed Laravel 5 with php7 and which is working perfectly on my Windows machine. Recently I came to know that SWOOLE is a promising tool for PHP developers! Unfortunately, I couldn't found any swoole installers for windows. Isn't it possible to install swoole in a Windows machine, if so how? Thanks in advance . Not.it is supported only for linux os – Salman Zafar Jul 1 at 11:40 @SalmanZafar if it is an answer don't comment just add a new answer – Franck Gamess Jul 1 at 12:46 1 Answer 1 No.For now swoole is only supported for linux and ...

cpp - SDL_JOYHATMOTION different when using Windows?

cpp - SDL_JOYHATMOTION different when using Windows? I'm using SDL2 in my programm. The Gamepad is initialised using: SDL_Joystick* Pad1 = NULL; Pad1 = SDL_JoystickOpen( 0 ); In my Event-Handling function, i included this thing: switch( event.type ){ //Button-Event, as an example: case SDL_JOYBUTTONDOWN: //printf("Button: %d", event.jbutton.button, " "); if(event.jbutton.button==ControllP1.MoveLeftButton) MoveLeft=true; //lot of other cases case SDL_JOYHATMOTION: if(event.jhat.value==SDL_HAT_UP){MoveUp=true;MoveLeft=false; MoveRight=false; MoveDown=false;} if(event.jhat.value==SDL_HAT_DOWN){MoveDown=true;MoveUp=false; MoveLeft=false; MoveRight=false;} if(event.jhat.value==SDL_HAT_LEFT){MoveLeft=true; MoveDown=false; MoveUp=false; MoveRight=false;} if(event.jhat.value==SDL_HAT_RIGHT){MoveRight=true;MoveDown=false; MoveUp=false; MoveLeft=false; } if(event.jhat.va...