Daily Archives

Articles indexed Monday March 15 2010

Page 16/125 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • C# wrapper for array of three pointers

    - by fergs
    I'm currently working on a C# wrapper to work with Dallmeier Common API light. See previous posting: http://stackoverflow.com/questions/2430089/c-wrapper-and-callbacks I've got pretty much everything 'wrapped' but I'm stuck on wrapping a callback which contains an array of three pointers & an array integers: dlm_setYUVDataCllback int(int SessionHandle, void (*callback) (long IPlayerID, unsigned char** yuvData, int* pitch, int width, int height, int64_t ts, char* extData)) Function Set callback, to receive current YUV image. Arguments SessionHandle: handle to current session. Return PlayerID (see callback). Callback - IPlayerId: id to the Player object - yuvData: array of three pointers to Y, U and V part of image The YUV format used is YUV420 planar (not packed). char *y = yuvData[0]; char *u = yuvData[1]; char *v = yuvData[2]; - pitch: array of integers for pitches for Y, U and V part of image - width: intrinsic width of image. - height - ts : timestamp of current frame - extData: additional data to frame How do I go about wrapping this in c#? Any help is much appreciated.

    Read the article

  • multi-thread access MySQL error

    - by user188916
    I have written a simple multi-threaded C program to access MySQL,it works fine except when i add usleep() or sleep() function in each thread function. i created two pthreads in the main method, int main(){ mysql_library_init(0,NULL,NULL); printf("Hello world!\n"); init_pool(&p,100); pthread_t producer; pthread_t consumer_1; pthread_t consumer_2; pthread_create(&producer,NULL,produce_fun,NULL); pthread_create(&consumer_1,NULL,consume_fun,NULL); pthread_create(&consumer_2,NULL,consume_fun,NULL); mysql_library_end(); } void * produce_fun(void *arg){ pthread_detach(pthread_self()); //procedure while(1){ usleep(500000); printf("producer...\n"); produce(&p,cnt++); } pthread_exit(NULL); } void * consume_fun(void *arg){ pthread_detach(pthread_self()); MYSQL db; MYSQL *ptr_db=mysql_init(&db); mysql_real_connect(); //procedure while(1){ usleep(1000000); printf("consumer..."); int item=consume(&p); addRecord_d(ptr_db,"test",item); } mysql_thread_end(); pthread_exit(NULL); } void addRecord_d(MYSQL *ptr_db,const char *t_name,int item){ char query_buffer[100]; sprintf(query_buffer,"insert into %s values(0,%d)",t_name,item); //pthread_mutex_lock(&db_t_lock); int ret=mysql_query(ptr_db,query_buffer); if(ret){ fprintf(stderr,"%s%s\n","cannot add record to ",t_name); return; } unsigned long long update_id=mysql_insert_id(ptr_db); // pthread_mutex_unlock(&db_t_lock); printf("add record (%llu,%d) ok.",update_id,item); } the program output errors like: [Thread debugging using libthread_db enabled] [New Thread 0xb7ae3b70 (LWP 7712)] Hello world! [New Thread 0xb72d6b70 (LWP 7713)] [New Thread 0xb6ad5b70 (LWP 7714)] [New Thread 0xb62d4b70 (LWP 7715)] [Thread 0xb7ae3b70 (LWP 7712) exited] producer... producer... consumer...consumer...add record (31441,0) ok.add record (31442,1) ok.producer... producer... consumer...consumer...add record (31443,2) ok.add record (31444,3) ok.producer... producer... consumer...consumer...add record (31445,4) ok.add record (31446,5) ok.producer... producer... consumer...consumer...add record (31447,6) ok.add record (31448,7) ok.producer... Error in my_thread_global_end(): 2 threads didn't exit [Thread 0xb72d6b70 (LWP 7713) exited] [Thread 0xb6ad5b70 (LWP 7714) exited] [Thread 0xb62d4b70 (LWP 7715) exited] Program exited normally. and when i add pthread_mutex_lock in function addRecord_d,the error still exists. So what exactly the problem is?

    Read the article

  • system error 58 while accessing shares on win 7 from xp

    - by nysingh
    I am getting a weird one. I am getting error following error message while accessing win 7 shares from xp. " system error 58 has occurred. the specified server cannot perform the requested operation." both machines are in same domain. windows xp machine can view and access all other share except windows 7. both machines do not have any firewall.

    Read the article

  • What is the Best Free Linux Gateway

    - by rockinthesixstring
    I'm looking at moving away from using my DIR-825 as a gateway and moving into a Linux box to do it all for me. I've found IPCop, but I'm looking for something with a little more power. My main goal is basically to be able to point different external domain names to different internal servers. backup.example.com - 192.168.0.5 home.example.com - 192.168.0.1 I host my DNS on my own dedicated server (windows), so I don't know much about doing the gateway thing in my home (my hosting provider does it all for me). Do any of you know of any free Linux Distros that can accomplish what I'm looking for?

    Read the article

  • Setting up a copy of a site with IIS 7?

    - by SJaguar13
    I have a site running on IIS with a dyndns.org domain that points to the IP of the Windows 2008 machine hosting it. I need a copy of that site for development purposes. I set up another folder with all the files, and create a new site in IIS. I don't really have a domain for it, so I was just going to use the IP address. When I go to localhost, 127.0.0.1, or the internal IP, I get bad hostname. If I use the IP address on port 80 (the same as the real version of the site), I get 404 not found. If I use a different port so I don't have them both on the same IP with the same port, I get connection timed out. How do I go about setting this up?

    Read the article

  • Windows XP: Consequences of setting a password for an account

    - by sleske
    I do not quite understand how Windows (specifically Windows XP) handles accounts with/without passwords. As far as I can see, on a fresh Windows XP install I have one default account which has admin rights does not have a password will auto-login (without password prompt) when the computer boots What happens if I set a password for this account? Will it still auto-login? Or will it always prompt for the PW? And generally, what consequences does it have if I set a password? I noted that Scheduled Tasks apparently cannot run under an account w/o password (creating a scheduled task will prompt for the account PW). Is there anything that will not work with a password set? Why is it even possible to have accounts without a password? I have some Unix/Linux background, but the concepts appear a little different under Windows.

    Read the article

  • How to make password reset disk windows

    - by Mirage
    I don't have floppy drive on my computer. Is there any way that i can make the password reset disk in a folders so that when i lose my passowrd then i can choose that folder to work as password reset disk. Is there any other option available beside Floppy drive

    Read the article

  • asyncronous call doesn't return json

    - by Rebecca
    I am running wamp on an xp box. I am fairly new to web programming, this is for a student project, and have run out of avenues to try to solve this problem. Problem We have client side JavaScript code that uses GDownloadUrl- from the Google api- to wrap xmlHttpRequest calls to a php server side program that is accessing our database. In my callback program, the result of this call is always " ". However, if I use an alert to display the http:// call, with the arguments, and cut and paste that into my browser, the json I expected is displayed. I zipped my dir containing all the files, and tried it out on another team member's computer, and they were able to get the json in the callback function. Note this is exactly the same code and structure I was using, he just unzipped and ran. So now I'm thinking this is something about Firefox or Wamp? Would this be a config problem? I'm running wamp server 2.0, and Firefox 3.5.8. I have no problems with syncronous php, or reading in files asyncronously. Any help would be greatly appreciated. Rebecca

    Read the article

  • create a text table with php using fixed width font

    - by Hintswen
    I want to write a PHP script to output some data as a plain-text table using spaces to get the data into columns (just like the Linux top command). I can't use a HTML table as the script output will be saved to disk and viewed in a plain-text editor. Is there anything available that can do this automatically (format the data into columns)?

    Read the article

  • Help renaming svn repository

    - by rascher
    Here is the deal: I created an SVN repository, say, foo. It is at http://www.example.com/foo. Then I did an svn checkout. I made some updates and changes to my local copy of the code over the week. I haven't committed yet. I realized that I wanted to rename the repository. So I did this: svn copy http://example.com/foo http://example.com/bar svn delete http://example.com/foo I finish my changes (and local svn still thinks I'm working under "foo".) svn commit fails because the repo has been renamed. I try to use svn switch --relocate but it yells at me because svn is awful. I try using the script here to replace "foo" with "bar" in my billion .svn/ folders. This replace is taking a long time. I wonder if something hung? Or maybe sshfs failed? I kill it. Ctrl-C. I look and see that half my files have "foo" and the others have "bar" in the URLs in the sundry .svn/ folders. All I want to do is commit my files with the new name. I could re-checkout the branch, but then I have no way to remember which files I changed, which is why I was using version control in the first place, and svn is so godawful at moving and renaming things. What do I need to do to: Have a "clean" copy of my "bar" svn branch? and, most importantly: Commit the changes I made?

    Read the article

  • Getting a Jabber status via Python

    - by Teegijee
    I'm developing a website using the Django framework, and I need to retrieve Jabber (okay, Google Talk) statuses for a user. Most of the Jabber python libraries seem like an incredible amount of overkill (and overhead) for a simple task. Is there any simple way to do this? I know very little about XMPP/Jabber, though of course I'm willing to learn. Do you need to be an authenticated and "friended" user to retrieve another user's status?

    Read the article

  • Passing GLatLng from array to Google

    - by E. Rose
    Hello All, To preface this, I am a complete programming amateur so this may be quite easily solved. As is though, it is frustrating me to no end. Basically, I have a database of Venue Names with GLat and GLng (other stuff too) that I am pulling down to my website based on a geolocated search. The javascript that I have pulls in a formatted subset of the database, dumps the glat and glng into an array and is supposed to take those points and plot out several markers each with an info window containing the details behind each marker. For some reason, the marker geodata is not being populated and/or is not being passed. The array is declared using [] and will not work when normally declared using (). It only brings up a map with the first value in the array and goes blank if i try to manually input later entries. There is a large block of commented out code relating to directions generation. That code worked for some reason. If anyone can tell me what I am doing wrong in rewriting it to map the markers and not give directions, please tell me. Any help would be much appreciated. var letters = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']; google.load("maps", "2", {"other_params":"sensor=true"}); var map function initialize(){ window.map = new google.maps.Map2(document.getElementById("map")); map.addControl(new GLargeMapControl()); } google.setOnLoadCallback(initialize); function getVenueResults(_zip, _num, _remove){ var rFlag = ''; if(_remove != null){ rFlag = "&removeId=" + _remove; } var url = 'ajax/getVenues.php?zip=' + _zip + "&num=" + _num + rFlag; new Ajax.Updater('resultsContainer', url, { onComplete: processResults }); } function processResults(){ window.map.clearOverlays(); var waypoints = []; var resultsList = $$('.resultWrapper'); var stepList = $$('.resultDirections'); for(i=0; i for(i=0; i<resultsList.length; i++){ var resultsElem = resultsList[i]; resultsElem.removeClassName('firstResult'); resultsElem.removeClassName('lastResult'); if(i == 0){ resultsElem.addClassName('firstResult'); } if(i == resultsList.length - 1){ resultsElem.addClassName('lastResult'); } var insertContent = '<div class="resultDirections" id="resultDirections' + i + '"></div>'; Element.insert(resultsElem, { bottom : insertContent }) var num = resultsElem.getElementsByClassName('numHolder'); num[0].innerHTML = '<b>' + letters[i] + ".</b> "; var geolat = resultsElem.getElementsByClassName('geolat')[0].value; var geolong = resultsElem.getElementsByClassName('geolong')[0].value; var point = new GLatLng(geolat, geolong); waypoints[i] = point; } if(waypoints.length == 1){ map.setCenter(waypoints[0], 16); map.addOverlay(new GMarker(waypoints[0])); resultsElem.getElementsByClassName('numHolder')[0].innerHTML = ''; }else{ map.setCenter(waypoints[0], 16); for(j=0; j< waypoints.length; j++) { var vLoc = waypoints[j]; var vInfo = resultsElem.getElementByClassName('resultBox[j]]').innerHTML; //unfinished function to mine name out of div and make it the marker title //x = resultsElem.getElementsByTagName("b"); // for (i=0;i<x.length;i++) // //marker.value = resultsElem.getElementBy('numHolder').innerHTML var marker = createMarker(vLoc, vInfo); map.addOverlay(marker); } } function createMarker(vLoc, vInfo) { var marker = (new GMarker(vLoc)); var cont = vInfo; GEvent.addListener(marker, 'click', function() { marker.openInfoWindowHtml(cont); }); return marker; } //var directions = new GDirections(window.map, document.getElementById('directionsPanel')); //directions.loadFromWaypoints(waypoints, { travelMode: G_TRAVEL_MODE_WALKING }); //GEvent.addListener(directions, "load" , function() { // var numRoutes = directions.getNumRoutes(); // for(j=0; j< numRoutes; j++){ // var thisRoute = directions.getRoute(j); // var routeText = ''; // for(k=0; k < thisRoute.getNumSteps(); k++){ // var thisStep = thisRoute.getStep(k); // if(k != 0){ routeText += " &nbsp;||&nbsp; "; } // routeText += thisStep.getDescriptionHtml(); // } // $('resultDirections' + j).innerHTML = routeText; // } // $('resultDirections' + numRoutes).hide(); //}); } function moveUp(_obj){ var parentObj = $(_obj).up().up(); var prevSib = parentObj.previous(); prevSib.insert({before: parentObj}); processResults(); } function moveDown(_obj){ var parentObj = $(_obj).up().up(); var nextSib = parentObj.next(); nextSib.insert({after: parentObj}); processResults(); }

    Read the article

  • Trace not working in a .NET DLL loaded from VB6 EXE

    - by Luis
    Hello I have a .NET DLL that writes to the Trace. But seems that when I call my DLL from a VB6 EXE the trace is not working. I have created an myApp.config file in the EXE folder with the trace configuration, but this does not solves the issue. I've also tried creating the Trace objects in code,but doesn't work: Dim _traceSrc as TraceSource= New TraceSource("myTraceSorce") Dim flListener As FileLogTraceListener = New FileLogTraceListener("myFileLogTraceListener") Dim tSwitch As SourceSwitch = New SourceSwitch("mySwitch") tSwitch.Level = _logLevel If I call my DLL from a .NET EXE it works, even if I dont have the app.config in the EXE folder, becusase I set it in code if the config is not found. Thanks

    Read the article

  • Sorting MySQL table by next due date

    - by Zagga
    Hi folks, I have a MySQL table that stores (amongst other things) a persons date of birth. Is there any way to sort the table so the next due birthday is at the top? I have the date stored in standard yyyy-mm-dd DATE format and seperate year, month and day fields so I can sort it by the first birthday of the year (ORDER BY month, day) but I can't seem to get any further. Any help would be greatly appreciated. Zagga

    Read the article

  • nearest neighbor - k-d tree - wikipedia proof.

    - by user123930
    On the wikipedia entry for k-d trees, an algorithm is presented for doing a nearest neighbor search on a k-d tree. What I don't understand is the explanation of step 3.2. How do you know there isn't a closer point just because the difference between the splitting coordinate of the search point and the current node is greater than the difference between the splitting coordinate of the search point and the current best?

    Read the article

  • What is your list of programs to install to Windows after a fresh install?

    - by marked
    I am looking for others' list of program that absolutely must be installed to a fresh install of Windows before going any further. I hope to compile a list here to use as reference for all new Windows installs/restores. Automating this list of programs installation is the next step. Some great lists so far! I will continue to monitor this and then make a list of everything I use. Another thought, has anyone come up with a way to automate this? Possibly going to each programs download page, downloading the most recent version, and installing? I may way on this as well, any ideas would be appreciated! As far as the type of machine, most of mine are hybrids i.e- server, workstation, development machine. So all of the above!

    Read the article

  • Customizing user privileges for an account in Windows (xp/vista/7)?

    - by claws
    Hello, I'm a .NET developer and recently learning WINDOWS API. When ever a program starts, my Kaspersky anti-virus says "application belonging to trusted group is trying to set debug previleges". I started wondering what are debug privileges? When ever application tries to open a file (using OpenFileDialog) it gives this message about debug privileges. It sometimes also says the so & so application is trying to read desktop.ini I'm not sure about what exactly it is either. Any way, my concern is about user previlages. When creating user account. We can only set the account to be either Administrative or Limited user. I read in MSDN that there are so many privileges for a user account. http://msdn.microsoft.com/en-us/library/bb530716(VS.85).aspx SE_ASSIGNPRIMARYTOKEN_NAME SE_AUDIT_NAME SE_BACKUP_NAME SE_CHANGE_NOTIFY_NAME SE_CREATE_GLOBAL_NAME SE_CREATE_PAGEFILE_NAME SE_CREATE_PERMANENT_NAME SE_CREATE_SYMBOLIC_LINK_NAME SE_CREATE_TOKEN_NAME SE_DEBUG_NAME SE_ENABLE_DELEGATION_NAME SE_IMPERSONATE_NAME SE_INC_BASE_PRIORITY_NAME SE_INCREASE_QUOTA_NAME SE_INC_WORKING_SET_NAME SE_LOAD_DRIVER_NAME SE_LOCK_MEMORY_NAME SE_MACHINE_ACCOUNT_NAME SE_MANAGE_VOLUME_NAME SE_PROF_SINGLE_PROCESS_NAME SE_RELABEL_NAME SE_REMOTE_SHUTDOWN_NAME SE_RESTORE_NAME SE_SECURITY_NAME SE_SHUTDOWN_NAME SE_SYNC_AGENT_NAME SE_SYSTEM_ENVIRONMENT_NAME SE_SYSTEM_PROFILE_NAME SE_SYSTEMTIME_NAME SE_TAKE_OWNERSHIP_NAME SE_TCB_NAME SE_TIME_ZONE_NAME SE_TRUSTED_CREDMAN_ACCESS_NAME SE_UNDOCK_NAME SE_UNSOLICITED_INPUT_NAME Well, my question is How can I manually (not programatically) set/customize these privileges for a user account? Surprisingly I'm unable to find a PRIVILEGE CONST for registry access. On my lab computer admin has disabled the registry access to my account. Where can I know more information about these information? I use all 3 operating systems (XP, VISTA, 7) :)

    Read the article

  • WPF Two Commands handlers, One Command

    - by Aran Mulholland
    Im deriving from a third party control. It is implementing ApplicationCommands.SelectAll. However the behaviour i want is slightly different. there is no virtual method i can override, and when i register a class handler, like so CommandManager.RegisterClassCommandBinding(typeof(MyDerivedControl), new CommandBinding(ApplicationCommands.SelectAll, new ExecutedRoutedEventHandler(OnExecutedSelectAll), new CanExecuteRoutedEventHandler(OnCanExecuteSelectAll))); My methods do not get called. The third party control i am deriving from is marking e.Handled=true; in its command handlers ( i know this cause i have seen the source, but i cant modify it ) What can i do?

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >