Search Results

Search found 2495 results on 100 pages for 'tom rom'.

Page 54/100 | < Previous Page | 50 51 52 53 54 55 56 57 58 59 60 61  | Next Page >

  • Checking if an object has been released before sending a message to it

    - by Tom Irving
    I've only recently noticed a crash in one of my apps when an object tried to message its delegate and the delegate had already been released. At the moment, just before calling any delegate methods, I run this check: if (delegate && [delegate respondsToSelector:...]){ [delegate ...]; } But obviously this doesn't account for if the delegate isn't nil, but has been deallocated. Besides setting the object's delegate to nil in the delegate's dealloc method, is there a way to check if the delegate has already been released just incase I no longer have a reference to the object.

    Read the article

  • How to convert an Info.plist file from mac os project to iphone project?

    - by Tom Pace
    I am developing an app for the iPhone OS devices, and am using a third-party engine which is not well documented but I've made great progress with it anyway. The problem: The engine's developer strongly urges extending from the existing template projects bundled with the engine, but the engine's Info.plist files are Mac OSX project Info.plist files. This is an iPhone engine, and so I cannot understand why the Info.plist file is structured to take keys for Mac OS apps, but that's how it is. I did a FileMerge comparison to ensure there was nothing within the file itself that defined its use for one OS or the other, so I guess it's defined somewhere in the project settings. Edit - Opening the plist file in Xcode or Property List Editor and then trying to add a key such as "Icon already includes gloss and bevel effects" will not work in this iPhone project because it is not in the list. However, "Cocoa Java Application" and others are available!

    Read the article

  • PHP: Over-writing session variables

    - by Tom
    Hi, Question related to PHP memory-handling from someone not yet very experienced in PHP: If I set a PHP session variable of a particular name, and then set a session variable of the exact same name elsewhere (during the same session), is the original variable over-written, or does junk accumulate in the session? In other words, should I be destroying a previous session variable before creating a new one of the same name? Thank you.

    Read the article

  • Detect a USB drive being inserted - Windows Service

    - by Tom Bell
    I am trying to detect a USB disk drive being inserted within a Windows Service, I have done this as a normal Windows application. The problem is the following code doesn't work for volumes. Registering the device notification: DEV_BROADCAST_DEVICEINTERFACE notificationFilter; HDEVNOTIFY hDeviceNotify = NULL; ::ZeroMemory(&notificationFilter, sizeof(notificationFilter)); notificationFilter.dbcc_size = sizeof(DEV_BROADCAST_DEVICEINTERFACE); notificationFilter.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE; notificationFilter.dbcc_classguid = ::GUID_DEVINTERFACE_VOLUME; hDeviceNotify = ::RegisterDeviceNotification(g_serviceStatusHandle, &notificationFilter, DEVICE_NOTIFY_SERVICE_HANDLE); The code from the ServiceControlHandlerEx function: case SERVICE_CONTROL_DEVICEEVENT: PDEV_BROADCAST_HDR pBroadcastHdr = (PDEV_BROADCAST_HDR)lpEventData; switch (dwEventType) { case DBT_DEVICEARRIVAL: ::MessageBox(NULL, "A Device has been plugged in.", "Pounce", MB_OK | MB_ICONINFORMATION); switch (pBroadcastHdr->dbch_devicetype) { case DBT_DEVTYP_DEVICEINTERFACE: PDEV_BROADCAST_DEVICEINTERFACE pDevInt = (PDEV_BROADCAST_DEVICEINTERFACE)pBroadcastHdr; if (::IsEqualGUID(pDevInt->dbcc_classguid, GUID_DEVINTERFACE_VOLUME)) { PDEV_BROADCAST_VOLUME pVol = (PDEV_BROADCAST_VOLUME)pDevInt; char szMsg[80]; char cDriveLetter = ::GetDriveLetter(pVol->dbcv_unitmask); ::wsprintfA(szMsg, "USB disk drive with the drive letter '%c:' has been inserted.", cDriveLetter); ::MessageBoxA(NULL, szMsg, "Pounce", MB_OK | MB_ICONINFORMATION); } } return NO_ERROR; } In a Windows application I am able to get the DBT_DEVTYP_VOLUME in dbch_devicetype, however this isn't present in a Windows Service implementation. Has anyone seen or heard of a solution to this problem, without the obvious, rewrite as a Windows application?

    Read the article

  • iFrames and Cookies

    - by Tom
    I have a site on A.com and an iframe on B.com which reads info from A.com. I realize that there is some problems with third party cookies, iframes and P3P - particularly in Safari [my problem] Is it possible to instead, use AJAX or a hidden iFrame to pass the cookie information from A.com to B.com which will then "recreate" another cookie with the same information on the iframe in B.com. I am trying to do this for authenication - i.e. a user is logged in on A.com and then goes to b.com and the iframe is also logged in ? I was hoping to perhaps pass the data in a hidden iframe and "recreate" the cookie in the iframe on B.com using JavaScript? Is this possible ? Security issues ? What about HTTPS?

    Read the article

  • Java Double entry table

    - by Tom
    Hi, Does anyone know a double entry table implementation in java I can download ? I need to do something like this 1 2 3 _______ a| x y z b| h l m c| o a k table.get(a,1) would return x Of course, it should use any Object as key, value, etc Thanks in advance

    Read the article

  • Given a typical Rails 3 environment, why am I unable to execute any tests?

    - by Tom
    I'm working on writing simple unit tests for a Rails 3 project, but I'm unable to actually execute any tests. Case in point, attempting to run the test auto-generated by Rails fails: require 'test_helper' class UserTest < ActiveSupport::TestCase # Replace this with your real tests. test "the truth" do assert true end end Results in the following error: <internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- test_helper (LoadError) from <internal:lib/rubygems/custom_require>:29:in `require' from user_test.rb:1:in `<main>' Commenting out the require 'test_helper' line and attempting to run the test results in this error: user_test.rb:3:in `<main>': uninitialized constant Object::ActiveSupport (NameError) The action pack gems appear to be properly installed and up to date: actionmailer (3.0.3, 2.3.5) actionpack (3.0.3, 2.3.5) activemodel (3.0.3) activerecord (3.0.3, 2.3.5) activeresource (3.0.3, 2.3.5) activesupport (3.0.3, 2.3.5) Ruby is at 1.9.2p0 and Rails is at 3.0.3. The sample dump of my test directory is as follows: /fixtures /functional /integration /performance /unit -- /helpers -- user_helper_test.rb -- user_test.rb test_helper.rb I've never seen this problem before - I've run the typical rake tasks for preparing the test environment. I have nothing out of the ordinary in my application or environment configuration files, nor have I installed any unusual gems that would interfere with the test environment. Edit Xavier Holt's suggestion, explicitly specifying the path to the test_helper worked; however, this revealed an issue with ActiveSupport. Now when I attempt to run the test, I receive the following error message (as also listed above): user_test.rb:3:in `<main>': uninitialized constant Object::ActiveSupport (NameError) But as you can see above, Action Pack is all installed and update to date.

    Read the article

  • Using regular expressions

    - by Tom
    What is wrong with this regexp? I need it to make $name to be letter-number only. Now it doens't seem to work at all. if (!preg_match("/^[A-Za-z0-9]$/",$name)) { $e[]="name must contain only letters or numbers"; }

    Read the article

  • Doctrine: Update Join?

    - by Tom
    Hi, Anyone know how to do an update with a join (i.e. update on two tables in one query) in Doctrine 1.2? I spotted something obscure on a forum that hinted that this is not supported in 1.x but it was about as vague as it comes. Thank you.

    Read the article

  • Web GUI for editing INI files

    - by Tom
    I am looking for a Unix based application or framework that would allow me to view/edit ini files on a remote system in a Html GUI via Apache (or similar). Searching for ini/config/GUI solutions via search engines returns a lot a false positives. Any recommendations?

    Read the article

  • Update an Android market app to lower sdk?

    - by Tom Richards
    I have an app on the market that requires sdk 2.0 I want to rewrite and publish it using 1.6 to find a wider audience. The question is: if I update my already published app with an sdk downgrade to 1.6 will it then show up to users with phones at 1.6? I know currently the market search shows my app only to those that have 2.0 phones.

    Read the article

  • How phpmyadmin, php and everything else works?

    - by Tom
    Ok, I guess I got crazy, but really. How phpmyadmin works? Does it have his own phpmyadmin or what? And how php works? Why writing echo 'hello'; it returns hello in the browser? I am really interested on how these things really works, maybe you know any books or smth to figure it out? Thank you.

    Read the article

  • Approach for altering Primary Key from GUID to BigInt in SQL Server related tables

    - by Tom
    I have two tables with 10-20 million rows that have GUID primary keys and at leat 12 tables related via foreign key. The base tables have 10-20 indexes each. We are moving from GUID to BigInt primary keys. I'm wondering if anyone has any suggestions on an approach. Right now this is the approach I'm pondering: Drop all indexes and fkeys on all the tables involved. Add 'NewPrimaryKey' column to each table Make the key identity on the two base tables Script the data change "update table x, set NewPrimaryKey = y where OldPrimaryKey = z Rename the original primarykey to 'oldprimarykey' Rename the 'NewPrimaryKey' column 'PrimaryKey' Script back all the indexes and fkeys Does this seem like a good approach? Does anyone know of a tool or script that would help with this? TD: Edited per additional information. See this blog post that addresses an approach when the GUID is the Primary: http://www.sqlmag.com/blogs/sql-server-questions-answered/sql-server-questions-answered/tabid/1977/entryid/12749/Default.aspx

    Read the article

  • Powerpoint 2003, change picture

    - by Tom Gullen
    I have a picture in Powerpoint 2003, how do I change the picture without having to delete it and re-add it? I need to save all the animations and it's going to take about 5 hours to re add them, but only like 20 mins if I change the pictures. Or if there is anyway to copy a custom animation set to another picture that would also be ace

    Read the article

  • how SendMailMAPI is adjusted to support multiple file attachments

    - by Tom
    I have this code that sends just one attachment by time, how can I adjust this code to send 1-2 attachments? function SendMailMAPI(const Subject, Body, FileName, SenderName, SenderEMail, RecepientName, RecepientEMail: String) : Integer; var message: TMapiMessage; lpSender, lpRecepient: TMapiRecipDesc; FileAttach: TMapiFileDesc; SM: TFNMapiSendMail; MAPIModule: HModule; begin FillChar(message, SizeOf(message), 0); with message do begin if (Subject<>'') then begin lpszSubject := PChar(Subject) end; if (Body<>'') then begin lpszNoteText := PChar(Body) end; if (SenderEMail<>'') then begin lpSender.ulRecipClass := MAPI_ORIG; if (SenderName='') then begin lpSender.lpszName := PChar(SenderEMail) end else begin lpSender.lpszName := PChar(SenderName) end; lpSender.lpszAddress := PChar('SMTP:'+SenderEMail); lpSender.ulReserved := 0; lpSender.ulEIDSize := 0; lpSender.lpEntryID := nil; lpOriginator := @lpSender; end; if (RecepientEMail<>'') then begin lpRecepient.ulRecipClass := MAPI_TO; if (RecepientName='') then begin lpRecepient.lpszName := PChar(RecepientEMail) end else begin lpRecepient.lpszName := PChar(RecepientName) end; lpRecepient.lpszAddress := PChar('SMTP:'+RecepientEMail); lpRecepient.ulReserved := 0; lpRecepient.ulEIDSize := 0; lpRecepient.lpEntryID := nil; nRecipCount := 1; lpRecips := @lpRecepient; end else begin lpRecips := nil end; if (FileName='') then begin nFileCount := 0; lpFiles := nil; end else begin FillChar(FileAttach, SizeOf(FileAttach), 0); FileAttach.nPosition := Cardinal($FFFFFFFF); FileAttach.lpszPathName := PChar(FileName); nFileCount := 1; lpFiles := @FileAttach; end; end; MAPIModule := LoadLibrary(PChar(MAPIDLL)); if MAPIModule=0 then begin Result := -1 end else begin try @SM := GetProcAddress(MAPIModule, 'MAPISendMail'); if @SM<>nil then begin Result := SM(0, Application.Handle, message, MAPI_DIALOG or MAPI_LOGON_UI, 0); end else begin Result := 1 end; finally FreeLibrary(MAPIModule); end; end; if Result<>0 then begin MessageDlg('Error sending mail ('+IntToStr(Result)+').', mtError, [mbOk], 0) end; end;

    Read the article

  • How can I selectively override a django .count() method

    - by Tom Viner
    I'm using postGresSQL and my main table has about 20,000 rows. Sometimes count() methods can take ages or even timeout. Mod.manager.filter(...).count() I need to selectively override the count() method depending on what filter has been applied. Just having a cache of results would be a great gain but I'd like to be able to say: if filter query is just {'enabled'=True} then return 20,000 without touching the db. Note: I can't prevent the call to .count() as it's inside django's pagination, which always does a count.

    Read the article

  • Get service's own handle in Delphi

    - by Tom
    I'm building a service in Delphi that is intended to run on Windows XP-7 and as part of it, I need to get a handle for the service to use for some windows messages to pass between it and a client app. Using the ServiceThread.Handle doesn't work, so I need to get the handle in another way. Can anyone tell me how to get a usable handle for passing Windows messages around? thanks.

    Read the article

  • How can I tell if a closed path contains a given point?

    - by Tom Seago
    In Android, I have a Path object which I happen to know defines a closed path, and I need to figure out if a given point is contained within the path. What I was hoping for was something along the lines of path.contains(int x, int y) but that doesn't seem to exist. The specific reason I'm looking for this is because I have a collection of shapes on screen defined as paths, and I want to figure out which one the user clicked on. If there is a better way to be approaching this such as using different UI elements rather than doing it "the hard way" myself, I'm open to suggestions. I'm open to writing an algorithm myself if I have to, but that means different research I guess.

    Read the article

  • Prroblem with ObjectDelete() in Entity Framework 4

    - by Tom
    I got two entities: public class User : Entity { public virtual string Username { get; set; } public virtual string Email { get; set; } public virtual string PasswordHash { get; set; } public virtual List<Photo> Photos { get; set; } } and public class Photo : Entity { public virtual string FileName { get; set; } public virtual string Thumbnail { get; set; } public virtual string Description { get; set; } public virtual int UserId { get; set; } public virtual User User { get; set; } } When I try to delete the photo it works fine for the DB (record gets romoved from the table) but it doesnt for the Photos collection in the User entity (I can still see that photo in user.Photos). This is my code. What I'm doing wrong here? Changing entity properties works fine. When I change photo FileName for example it gets updated in DB and in user.Photos. var photo = SelectById(id); Context.DeleteObject(photo); Context.SaveChanges(); var user = GetUser(userName); // the photo I have just deleted is still in user.Photos also tried this but getting same results: var photo = user.Photos.First(); Context.DeleteObject(photo); Context.SaveChanges();

    Read the article

< Previous Page | 50 51 52 53 54 55 56 57 58 59 60 61  | Next Page >