Search Results

Search found 134 results on 6 pages for 'jorge vargas'.

Page 4/6 | < Previous Page | 1 2 3 4 5 6  | Next Page >

  • Is it possible to detect when the system is recording a sound and then perform some action on Python

    - by Jorge
    I began learning Python a few days ago, and i was wondering about a practical use for a program. Then i came up with the following: if my brother is in his room recording himself playing guitar, a led plugged to the usb and wired so it's outside his door lights up, and then i'll know he's recording and i'll take care not to make any noises. The main questions are: How Python can detect any recording going on in the system? How would i interface with the usb so i can actually turn the led on?

    Read the article

  • Best approach to show big amount of "grid" data

    - by Jorge Ramírez
    Hello all. I am building an application for Android (1.5) that, after quering a webservice, shows to the user a big amount of data that should be displayed in a "grid" or "table" style. I must show a result of about 7 columns and 50 rows (for example a customer list with names, adresses, telephone number, sales amount last year and so). Obviously, the 7 columns will not fix in the screen and I would like the user would be able to scroll up/down and LEFT/RIGHT (important because of the number of columns) to explore the grid results. cell selection level is NOT necessary, as much I would need row selection level. What is the best approach to get this interface element? Listview / GridView / TableLayout? Thanks

    Read the article

  • Memory leak while using emoticons on CRichEditCtrl

    - by Jorg B Jorge
    I'm developing a text editor class (for a chat application) based on CRichEditCtrl (MFC) with emoticon support. After i load the emoticon's bitmap, I use the function OleCreateStaticFromData to insert it into CRichEditCtrl. After that i just delete the bitmap object allocated by myself. I can verify (using a GDIView utility) that all resources i allocate have been properly released. This works perfectly: the bitmap (emoticon) is drawn on the CRichEditCtrl window and is handled just like a character. My problem is that I don't know how to deallocate the memory (internal) allocated by OleCreateStaticFromData to manage the bitmap (emoticon). The memory allocated for any emoticon used is never released, even if i delete the CRichEditCtrl object. I'd like to know how to fix that issue. Is that a MFC's issue or i'm doing something wrong ? Thx.

    Read the article

  • How do I patch a Windows API at runtime so that it to returns 0 in x64?

    - by Jorge Vasquez
    In x86, I get the function address using GetProcAddress() and write a simple XOR EAX,EAX; RET; in it. Simple and effective. How do I do the same in x64? bool DisableSetUnhandledExceptionFilter() { const BYTE PatchBytes[5] = { 0x33, 0xC0, 0xC2, 0x04, 0x00 }; // XOR EAX,EAX; RET; // Obtain the address of SetUnhandledExceptionFilter HMODULE hLib = GetModuleHandle( _T("kernel32.dll") ); if( hLib == NULL ) return false; BYTE* pTarget = (BYTE*)GetProcAddress( hLib, "SetUnhandledExceptionFilter" ); if( pTarget == 0 ) return false; // Patch SetUnhandledExceptionFilter if( !WriteMemory( pTarget, PatchBytes, sizeof(PatchBytes) ) ) return false; // Ensures out of cache FlushInstructionCache(GetCurrentProcess(), pTarget, sizeof(PatchBytes)); // Success return true; } static bool WriteMemory( BYTE* pTarget, const BYTE* pSource, DWORD Size ) { // Check parameters if( pTarget == 0 ) return false; if( pSource == 0 ) return false; if( Size == 0 ) return false; if( IsBadReadPtr( pSource, Size ) ) return false; // Modify protection attributes of the target memory page DWORD OldProtect = 0; if( !VirtualProtect( pTarget, Size, PAGE_EXECUTE_READWRITE, &OldProtect ) ) return false; // Write memory memcpy( pTarget, pSource, Size ); // Restore memory protection attributes of the target memory page DWORD Temp = 0; if( !VirtualProtect( pTarget, Size, OldProtect, &Temp ) ) return false; // Success return true; } This example is adapted from code found here: http://www.debuginfo.com/articles/debugfilters.html#overwrite .

    Read the article

  • SSH with Perl using file handles, not Net::SSH

    - by jorge
    Before I ask the question: I can not use cpan module Net::SSH, I want to but can not, no amount of begging will change this fact I need to be able to open an SSH connection, keep it open, and read from it's stdout and write to its stdin. My approach thus far has been to open it in a pipe, but I have not been able to advance past this, it dies straight away. That's what I have in mind, I understand this causes a fork to occur. I've written code accordingly for this fork (or so I think). Below is a skeleton of what I want, I just need the system to work. #!/usr/bin/perl use warnings; $| = 1; $pid = open (SSH,"| ssh user\@host"); if(defined($pid)){ if(!$pid){ #child while(<>){ print; } }else{ select SSH; $| = 1; select STDIN; #parent while(<>){ print SSH $_; while(<SSH>){ print; } } close(SSH); } } I know, from what it looks like, I'm trying to recreate "system('ssh user@host')," that is not my end goal, but knowing how to do that would bring me much closer to the end goal. Basically, I need a file handle to an open ssh connection where I can read from it the output and write to it input (not necessarily straight from my program's STDIN, anything I want, variables, yada yada) This includes password input. I know about key pairs, part of the end goal involves making key pairs, but the connection needs to happen regardless of their existence, and if they do not exist it's part of my plan to make them exist.

    Read the article

  • Issue on passing a checkbox set to an AppEngine script through jQuery Ajax/Json

    - by Jorge
    I have a set of checkboxes with multiple choice allowed. I parse the set this way: if ($("input[name='route_day']:checked").length > 0) { $("input[name='route_day']:checked").each(function(){ if(this.value != null) route_days_hook.push(this.value); }); dataTrap.route_days = $.JSON.encode(route_days_hook); } ...and pull the whole dataTrap to an AppEngine Python script via jQuery ajax. However, the Python script just bugs. If i change dataTrap.route_days value to a string instead of the JSON encoded object, everything works fine. My question is: how can i pass a checkbox set to the script using Ajax and still be able to iterate over it on the script?

    Read the article

  • DUMP in unhandled C++ exception

    - by Jorge Vasquez
    In MSVC, how can I make any unhandled C++ exception (std::runtime_error, for instance) crash my release-compiled program so that it generates a dump with the full stack from the exception throw location? I have installed NTSD in the AeDebug registry an can generate good dumps for things like memory access violation, so the matter here comes down to crashing the program correctly, I suppose. Thanks in advance.

    Read the article

  • Is code clearness killing application performance?

    - by Jorge Córdoba
    As today's code is getting more complex by the minute, code needs to be designed to be maintainable - meaning easy to read, and easy to understand. That being said, I can't help but remember the programs that ran a couple of years ago such as Winamp or some games in which you needed a high performance program because your 486 100 Mhz wouldn't play mp3s with that beautiful mp3 player which consumed all of your CPU cycles. Now I run Media Player (or whatever), start playing an mp3 and it eats up a 25-30% of one of my four cores. Come on!! If a 486 can do it, how can the playback take up so much processor to do the same? I'm a developer myself, and I always used to advise: keep your code simple, don't prematurely optimize for performance. It seems that we've gone from "trying to get it to use the least amount of CPU as possible" to "if it doesn't take too much CPU is all right". So, do you think we are killing performance by ignoring optimizations?

    Read the article

  • WCF with MANY database connections

    - by Jorge Dominguez
    I'm working in the development of an ERP type .Net WinForms application consuming a WCF service. It's to be used by many small companies (in the range of 100-200). Database is SQL Server 2008 and the service will be hosted as a Windows service. Even thought there will be a single DB Server, our customer insists in having separate databases for each company. That is because of stability/support concerns (like DB being damaged or took offline for some reason thus affecting all clients). Concerns coming from previous experiences (not necessarily with same platform). With a single database, connections to the DB would be opened at service start up and pooling used, but, I'm not sure how connections could be managed in a multiple DB scenario: Could a connection to the corresponding DB be opened and closed for each service request? would performance be acceptable? If a connection is opened and maintained for each company accessing the system, what's the practical limit of opened connections (to different databases)? It would be very interesting to hear your opinions and suggestions for this situation. Tanks

    Read the article

  • trouble in using flalign (LaTeX)

    - by Jorge
    I am trying to put 3 equations with "=" signs aligned but also left aligned. I tried the following: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{flalign*} RPC &= A+B\tilde{f} +C x &\ A &= a+\eta &\ E &= cte & \end{flalign*} \end{document} With this I get the stuff in the left and the "=" signs aligned. However, I also need A (in the second equation) and E (in the third equation) to be aligned to the R (in the first one) Does anyone know how to get it? thanks

    Read the article

  • Handling exceptions, is this a good way?

    - by Jorge Córdoba
    We're struggling with a policy to correctly handle exceptions in our application. Here's our goals for it (summarized): Handle only specific exceptions. Handle only exceptions that you can correct Log only once. We've come out with a solution that involves a generic Application Specific Exception and works like this in a piece of code: try { // Do whatever } catch(ArgumentNullException ane) { // Handle, optinally log and continue } catch(AppSpecificException) { // Rethrow, don't log, don't do anything else throw; } catch(Exception e) { // Log, encapsulate (so that it won't be logged again) and throw Logger.Log("Really bad thing", e.Message, e); throw new AppSpecificException(e) } All exception is logged and then turned to an AppSpecificException so that it won't be logged again. Eventually it will reach the last resort event handler that will deal with it if it has to. I don't have so much experience with exception handling patterns... Is this a good way to solve our goals? Has it any major drawbacks or big red warnings?

    Read the article

  • Attachment in webservice with Flex

    - by Jorge
    Does anybody know if it's possible to call a webservice with an attachment from Flex Webservices? I was looking around, and it seems that you can do that in Flash Player 10... any clue? Any documentation? Thanks in advance!

    Read the article

  • Jquery mobile spinner not loading in external links

    - by Jorge Zuverza
    I'm developing an application in which I have internal and external links. i noticed that Jquery mobile does not load the spinner when an external link is clicked: Example <a href = "/products">Spinner is shown </a> <a href = "othersite.com" rel = "external">Spinner is NOT shown </a> I have tried : $('a[href][rel=external]').click(function(){ //doesnt work $.mobile.showPageLoadingMsg(); } and: $('a[href][rel=external]').click(function(){ // shows the spinner but it gets stuck forever $.mobile.showPageLoadingMsg(); $('#loadingDiv').div("refresh"); } can someone help me show the spinner when the rel = external links are clicked? thanks!

    Read the article

  • C: Recursive function for inverting an int

    - by Jorge
    I had this problem on an exam yesterday. I couldn't resolve it so you can imagine the result... Make a recursive function: int invertint( int num) that will receive an integer and return it but inverted, example: 321 would return as 123 I wrote this: int invertint( int num ) { int rest = num % 10; int div = num / 10; if( div == 0 ) { return( rest ); } return( rest * 10 + invert( div ) ) } Worked for 2 digits numbers but not for 3 digits or more. Since 321 would return 1 * 10 + 23 in the last stage. Thanks a lot! PS: Is there a way to understand these kind of recursion problems in a faster manner or it's up to imagination of one self?

    Read the article

  • How to create a progress bar while downloading a file using the windows API?

    - by Jorge Chayan
    i'm working on an application in MS Visual C++ using Windows API that must download a file and place it in a folder. I have already implemented the download using URLDownloadToFile function, but i want to create a PROGRESS_CLASS progress bar with marquee style while the file is being downloaded, but it doesn't seems to get animated in the process. This is the function I use for downloading: BOOL SOXDownload() { HRESULT hRez = URLDownloadToFile(NULL, "url","C:\\sox.zip", 0, NULL); if (hRez == E_OUTOFMEMORY ) { MessageBox(hWnd, "Out of memory Error","", MB_OK); return FALSE; } if (hRez != S_OK) { MessageBox(hWnd, "Error downloading sox.", "Error!", MB_ICONERROR | MB_SYSTEMMODAL); return FALSE; } if (hRez == S_OK) { BSTR file = SysAllocString(L"C:\\sox.zip"); BSTR folder = SysAllocString(L"C:\\"); Unzip2Folder(file, folder); ::MessageBoxA(hWnd, "Sox Binaries downloaded succesfully", "Success", MB_OK); } return TRUE; } Later I call inside WM_CREATE (in my main window's message processor): if (!fileExists("C:\\SOX\\SOX.exe")) { components[7] = CreateWindowEx(0, PROGRESS_CLASS, NULL, WS_VISIBLE | PBS_MARQUEE, GetSystemMetrics(SM_CXSCREEN) / 2 - 80, GetSystemMetrics(SM_CYSCREEN) / 2 + 25, 200, 50, hWnd, NULL, NULL, NULL); SetWindowText(components[7], "Downloading SoX"); SendMessage(components[7], PBM_SETRANGE, 0, (LPARAM) MAKELPARAM(0, 50)); SendMessage(components[7], PBM_SETMARQUEE, TRUE, MAKELPARAM( 0, 50)); SOXDownload(); SendMessage(components[7], WM_CLOSE, NULL, NULL); } And as I want, I get a tiny progress bar... But it's not animated, and when I place the cursor over the bar, the cursor indicates that the program is busy downloading the file. When the download is complete, the window closes as i requested: SendMessage(components[7], WM_CLOSE, NULL, NULL); So the question is how can I make the bar move while downloading the file? Considering that i want it done with marquee style for simplicity. Thanks in advance.

    Read the article

  • Echo cancellation

    - by Jorg B Jorge
    Can any of you suggest a good and stable echo cancelation package (gnu or not) to be linked with my videoconference application (C/C++) (Windows / Linux / MacOSX) ? My application should be freeware, so i do not want to pay for each user who download the app.

    Read the article

  • Oracle: Finding Columns with only null values

    - by Jorge Valois
    I have a table with a lot of columns and a type column. Some columns seem to be always empty for a specific type. I want to create a view for each type and only show the relevant columns for each type. Working under the assumption that if a column has ONLY null values for a specific type, then that columns should not be part of the view, how can you find that out with queries? Is there a SELECT [columnName] FROM [table] WHERE [columnValues] ARE ALL [null] I know I COMPLETELY made it all up above... I'm just trying to get the idea across. Thanks in advance!

    Read the article

  • Send a double click to a listview (c++, not .net!)

    - by Jorge Branco
    Hello. I want to send a double click to a listview. From what I've read on msdn it seems I gotta send a WM_NOTIFY message and something with NM_DBLCLK. But I do not understand really well hwo to implement it. I've worked with SendMessage before but MSDN is not that clear on how to fill the structs and so: WM_NOTIFY http://msdn.microsoft.com/en-us/library/bb775583(VS.85).aspx NM_DBLCLK http://msdn.microsoft.com/en-us/library/bb774867(VS.85).aspx

    Read the article

< Previous Page | 1 2 3 4 5 6  | Next Page >