Search Results

Search found 2102 results on 85 pages for 'tom bell'.

Page 57/85 | < Previous Page | 53 54 55 56 57 58 59 60 61 62 63 64  | Next Page >

  • Symfony 1.4: Deleting a sfGuardUser

    - by Tom
    Hi, I'm having some trouble with the following... I have a sfGuardUser table set up normally, and it has a one-to-one relationship with a Profile table, which contains some additional user info. When a user wants to delete themselves from the site, I'd like to retain their info in the Profile table for various purposes BUT delete the sfGuardUser in order to keep that table cleaner/shorter (not just set it to inactive). I was under the impression that I could set the FK in the Profile table to NULL and then delete the sfGuardUser, but it seems the FK-constraint fails. Indeed, it seems I can't delete either and the queries fail: If I try to delete the sfGuardUser, the Profile table will have an invalid FK If I try to delete a Profile, the sfGuardUser will have an invalid FK Other than leaving outdated sfGuardUsers and Profiles in these tables, or having to use a cascaded delete to get rid of both, can anyone tell me if there's any other way around this? Thank you.

    Read the article

  • Using Selenium to Determining The Visibility of Elements for Print media

    - by Tom Howard
    I would like to determine if particular elements on a page are visible when printed as controlled by CSS @media rules. Is there a way to do this with Selenium? I know there is the isDisplayed method, which takes the CSS into account, but there is nothing I can find to tell Selenium which media type to apply. Is there a way to do this? Or is there another way to test web pages to make sure the elements you want are printed (and those you don't aren't)? Update: For clarity, there are no plans to have a javascript print button. The users will print using the normal print functionality of the browser (Chrome, FF and IE). @media css rules will be used to control what is shown and hidden. I would like Selenium to pretend it is a printer instead of a screen, so I can test if certain elements will be visible in what would be the printed version of the page.

    Read the article

  • WindowsFormsApplicationBase SplashScreen makes login form ignore keypresses until I click on it - how to debug?

    - by Tom Bushell
    My WinForms app has a simple modal login form, invoked at startup via ShowDialog(). When I run from inside Visual Studio, everything works fine. I can just type in my User ID, hit the Enter key, and get logged in. But when I run a release build directly, everything looks normal (the login form is active, there's a blinking cursor in the User ID MaskedEditBox), but all keypresses are ignored until I click somewhere on the login form. Very annoying if you are used to doing everything from the keyboard. I've tried to trace through the event handlers, and to set the focus directly with code, to no avail. Any suggestions how to debug this (outside of Visual Studio), or failing that - a possible workaround? Edit Here's the calling code, in my Main Form: private void OfeMainForm_Shown(object sender, EventArgs e) { OperatorLogon(); } private void OperatorLogon() { // Modal dialogs should be in a "using" block for proper disposal using (var logonForm = new C21CfrLogOnForm()) { var dr = logonForm.ShowDialog(this); if (dr == DialogResult.OK) SaveOperatorId(logonForm.OperatorId); else Application.Exit(); } } Edit 2 Didn't think this was relevant, but I'm using Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase for it's splash screen and SingleInstanceController support. I just commented out the splash screen code, and the problem has disappeared. So that's opened up a whole new line of inquiry... Edit 3 Changed title to reflect better understanding of the problem

    Read the article

  • Referencing control on one form from another form VB.NET

    - by Tom
    My gosh man, why is this so complicated in VB.NET? As you can guess, I'm kind of new to .NET and just want to reference a control on one form from another. Usually I would just do Form.Control.Property but that doesn't work and every example I've found through Google doesn't work for me. It just seems overly complicated with public classes, etc. Is there a more simpler way to do this? I'm ready to throw in the towel and just use a global variable at this point. I have the form containing the control I want to reference, frmGenerate which has a textbox called txtCustomerNo. From this form through a button's click event I want to show another form, frmCustomers, and have that form reference the value in txtCustomerNo. frmCustomers.ShowDialog() It has to be something simple that I'm just not grasping. Thanks.

    Read the article

  • Complicated .NET factory design

    - by Tom W
    Hello SO; I'm planning to ask a fairly elaborate question that is also something of a musing here, so bear with me... I'm trying to design a factory implementation for a simulation application. The simulation will consist of different sorts of entities i.e. it is not a homogenous simulation in any respect. As a result, there will be numerous very different concrete implementations and only the very general properties will be abstracted at the top level. What I'd like to be able to do is create new simulation entities by calling a method on the model with a series of named arguments representing the parameters of the entity, and have the model infer what type of object is being described by the inbound parameters (from the names of the parameters and potentially the sequence they occur in) and call a factory method on the appropriate derived class. For example, if I pass the model a pair of parameters (Param1=5000, Param2="Bacon") I would like it to infer that the names Param1 and Param2 'belong' to the class "Blob1" and call a shared function "getBlob1" with named parameters Param1:=5000, Param2:="Bacon" whereas if I pass the model (Param1=5000, Param3=50) it would call a similar factory method for Blob2; because Param1 and Param3 in that order 'belong' to Blob2. I foresee several issues to resolve: Whether or not I can reflect on the available types with string parameter names and how to do this if it's possible Whether or not there's a neat way of doing the appropriate constructor inference from the combinatoric properties of the argument list or whether I'm going to have to bodge something to do it 'by hand'. If possible I'd like the model class to be able to accept parameters as parameters rather than as some collection of keys and values, which would require the model to expose a large number of parametrised methods at runtime without me having to code them explicitly - presumably one for every factory method available in the relevant namespace. What I'm really asking is how you'd go about implementing such a system, rather than whether or not it's fundamentally possible. I don't have the foresight or experience with .NET reflection to be able to figure out a way by myself. Hopefully this will prove an informative discussion.

    Read the article

  • Access-Control-Request-Header: - x-requested-with

    - by Tom
    Hi Guys, I am building a widget for my users and trying to get it working however I keep running into a X-Domain issue with this header. httpfox gives me - NS_ERROR_DOM_BAD_URI - and on further investigation I find that its Access-Control-Request-Method: GET Access-Control-Request-Header: x-requested-with I am not sure why its not loading but I basically call a script and then I am trying to grab some html to load it but it gets blocked with the above headers. How can I get around this prob ?

    Read the article

  • Find which process accesses registry??

    - by Tom
    Ok if anyone can solve this they must be a genius because its nowhere on the web! http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx This program detects registry accesses and tells you which process did it. Does anyone know how i can do this? I can detect changes, but i cant get the process. Thanks in advance

    Read the article

  • Get a list of events owned by a facebook page

    - by Tom Wright
    Does anyone know how I can get a list of events owned (created) by a Facebook page? I seem to be able to use the "graph api" to generate a list of the events an entity is attending. I also looked at FQL, but it seems to require that the 'where' clause is an indexable field (and, naturally, the id is the only indexable field). For bonus points, we'd be able to do this without any authentication. (Though I'm resigned to the fact that I'm likely going to need at least a permanent access_token.) If anyone know how to do this I'd be eternally grateful.

    Read the article

  • Javascript memory leak/ performance issue?

    - by Tom
    I just cannot for the life of me figure out this memory leak in Internet Explorer. insertTags simple takes string str and places each word within start and end tags for HTML (usually anchor tags). transliterate is for arabic numbers, and replaces normal numbers 0-9 with a &#..n; XML identity for their arabic counterparts. fragment = document.createDocumentFragment(); for (i = 0, e = response.verses.length; i < e; i++) { fragment.appendChild((function(){ p = document.createElement('p'); p.setAttribute('lang', (response.unicode) ? 'ar' : 'en'); p.innerHTML = ((response.unicode) ? (response.surah + ':' + (i+1)).transliterate() : response.surah + ':' + (i+1)) + ' ' + insertTags(response.verses[i], '<a href="#" onclick="window.popup(this);return false;" class="match">', '</a>'); try { return p } finally { p = null; } })()); } params[0].appendChild( fragment ); fragment = null; I would love some links other than MSDN and about.com, because neither of them have sufficiently explained to me why my script leaks memory. I am sure this is the problem, because without it everything runs fast (but nothing displays). I've read that doing a lot of DOM manipulations can be dangerous, but the for loops a max of 286 times (# of verses in surah 2, the longest surah in the Qur'an).

    Read the article

  • Serialization java to c#

    - by tom
    Hi, I have manged to serialize an arraylist in java using xstream, send it to my c# application via http and then write that to file (just for now). The serialized data was an arraylist in java. I want to try and re form this arraylist in c# from the xml i have. I have been looking at http://code.google.com/p/xstream-dot-net/ to do this. Does anyone know if that is the right way to go or is there a better way of reforming the serialized data in c#?

    Read the article

  • Could someone explain gtk2hs drag and drop to me, the listDND.hs demo just isn't doing it for me?

    - by Tom Carstens
    As the title says, I just don't get DND (or rather I understand the concept and I understand the order of callbacks, I just don't understand how to setup DND for actual usage.) I'd like to say that I've done DND stuff before in C, but considering I never really got that working... So I'm trying (and mostly succeeding, save DND) to write a text editor (using gtksourceview, because it has built in code highlighting.) Reasons are below if you want them. Anyways, there's not really a good DND demo or tutorial available for gtk2hs (listDND.hs just doesn't translate well in my head.) So what I'm asking is for code that demonstrates simple DND on a window widget (for example.) Ideally, it should accept drops from other windows (such as Thunar) and print out the information in string form. I think I can take it from there... Reasons: I'm running a fairly light weight setup, dwm and a few gtk+2 programs. I really don't want to have to pull in gtk+3 to get the current gedit from the repos (Arch Linux.) Currently, I'm using geany for all of my text editing needs, however, geany is a bit heavy for editing config files. Further, geany doesn't care for my terminal of choice (st;) so I don't even get the benefit of using it as an IDE. Meaning I'd like a lightweight text editor with syntax highlighting. I could configure emacs or vim or something, but that seems to me to be more of a hack then a proper solution. Thus my project was born. It's mostly working (aside from DND, all that's left is proper multi-tab support.) Admittedly, I could probably work this out if I wrote it in C, but there isn't that much state in a text editor so Haskell's been working fine with almost no need for mutable variables.

    Read the article

  • How do I detect a click event on a google maps PolyLine overlay?

    - by Tom
    It seems to me that I should be able to do the following to detect a click event on a line on a google map: var line = new GPolyline( ... ); map.addOverlay(line); GEvent.addListener(line, "click", function(latlng){ alert("clicked"); }); The api reference says this is available in version 2.88, which was released in 2007(!?), so I'm assuming that's what I'm using, but I don't know how to confirm that. I also tried setting the {clickable:true} option explicitly (it's supposed to be the default.) I've tested in FireFox 3 and Opera 9.6 so doubt it's browser specific. I'm also using jQuery on the page. I have plenty of code detecting clicks on markers that works fine, clicking on lines would be really nice, can anyone enlighten me?

    Read the article

  • Doctrine: textarea line breaks & nl2br

    - by Tom
    Hi, I'm pulling my hair out with something that should be very simple: getting line breaks to show up properly in text that's returned from the database with Doctrine 1.2 I'm saving a message: $body = [text from a form textarea]; $m = new Message(); $m->setSubject($subject); $m->setBody($body); $m->save(); Querying the message: $q = Doctrine_Query::create() ->from('Message m') ->where('m.message_id = ?', $id) ->limit(1); $this->message = $q->execute(array(), Doctrine_Core::HYDRATE_ARRAY); In my template: echo $message[0]['body'] ... outputs the text without line breaks echo ln2br($message[0]['body']) ... no difference ... and I've tried every combination I could think of. Is Doctrine doing something to line breaks that's affecting this, or is there something that I'm just missing? Any help would be appreciated. Thanks.

    Read the article

  • Why SendMailMAPI renames file attachments to shorter ones?

    - by Tom
    I use the following emailing function with eudora, for some reason the attachment file name is renamed to be something else, how can I make sure the attachment file name remains intact? 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;

    Read the article

  • How to find memory leak from ASPX app having a DLL

    - by Tom
    Any tips How to figure out where is memory leak in my Facebook app, its ASPX using Facebook toolkit DLL and I am afraid the bug may be in that CS library. The problem is that after one week uptime, server is running out of memory and needs to be rebooted, there are quite many users and I cannot run debugger on this "production server", so I would need to simulate somehow use on my local PC.

    Read the article

  • Does my basic PHP Socket Server need optimization?

    - by Tom
    Like many people, I can do a lot of things with PHP. One problem I do face constantly is that other people can do it much cleaner, much more organized and much more structured. This also results in much faster execution times and much less bugs. I just finished writing a basic PHP Socket Server (the real core), and am asking you if you can tell me what I should do different before I start expanding the core. I'm not asking about improvements such as encrypted data, authentication or multi-threading. I'm more wondering about questions like "should I maybe do it in a more object oriented way (using PHP5)?", or "is the general structure of the way the script works good, or should some things be done different?". Basically, "is this how the core of a socket server should work?" In fact, I think that if I just show you the code here many of you will immediately see room for improvements. Please be so kind to tell me. Thanks! #!/usr/bin/php -q <? // config $timelimit = 180; // amount of seconds the server should run for, 0 = run indefintely $address = $_SERVER['SERVER_ADDR']; // the server's external IP $port = 9000; // the port to listen on $backlog = SOMAXCONN; // the maximum of backlog incoming connections that will be queued for processing // configure custom PHP settings error_reporting(1); // report all errors ini_set('display_errors', 1); // display all errors set_time_limit($timelimit); // timeout after x seconds ob_implicit_flush(); // results in a flush operation after every output call //create master IPv4 based TCP socket if (!($master = socket_create(AF_INET, SOCK_STREAM, SOL_TCP))) die("Could not create master socket, error: ".socket_strerror(socket_last_error())); // set socket options (local addresses can be reused) if (!socket_set_option($master, SOL_SOCKET, SO_REUSEADDR, 1)) die("Could not set socket options, error: ".socket_strerror(socket_last_error())); // bind to socket server if (!socket_bind($master, $address, $port)) die("Could not bind to socket server, error: ".socket_strerror(socket_last_error())); // start listening if (!socket_listen($master, $backlog)) die("Could not start listening to socket, error: ".socket_strerror(socket_last_error())); //display startup information echo "[".date('Y-m-d H:i:s')."] SERVER CREATED (MAXCONN: ".SOMAXCONN.").\n"; //max connections is a kernel variable and can be adjusted with sysctl echo "[".date('Y-m-d H:i:s')."] Listening on ".$address.":".$port.".\n"; $time = time(); //set startup timestamp // init read sockets array $read_sockets = array($master); // continuously handle incoming socket messages, or close if time limit has been reached while ((!$timelimit) or (time() - $time < $timelimit)) { $changed_sockets = $read_sockets; socket_select($changed_sockets, $write = null, $except = null, null); foreach($changed_sockets as $socket) { if ($socket == $master) { if (($client = socket_accept($master)) < 0) { echo "[".date('Y-m-d H:i:s')."] Socket_accept() failed, error: ".socket_strerror(socket_last_error())."\n"; continue; } else { array_push($read_sockets, $client); echo "[".date('Y-m-d H:i:s')."] Client #".count($read_sockets)." connected (connections: ".count($read_sockets)."/".SOMAXCONN.")\n"; } } else { $data = @socket_read($socket, 1024, PHP_NORMAL_READ); //read a maximum of 1024 bytes until a new line has been sent if ($data === false) { //the client disconnected $index = array_search($socket, $read_sockets); unset($read_sockets[$index]); socket_close($socket); echo "[".date('Y-m-d H:i:s')."] Client #".($index-1)." disconnected (connections: ".count($read_sockets)."/".SOMAXCONN.")\n"; } else { if ($data = trim($data)) { //remove whitespace and continue only if the message is not empty switch ($data) { case "exit": //close connection when exit command is given $index = array_search($socket, $read_sockets); unset($read_sockets[$index]); socket_close($socket); echo "[".date('Y-m-d H:i:s')."] Client #".($index-1)." disconnected (connections: ".count($read_sockets)."/".SOMAXCONN.")\n"; break; default: //for experimental purposes, write the given data back socket_write($socket, "\n you wrote: ".$data); } } } } } } socket_close($master); //close the socket echo "[".date('Y-m-d H:i:s')."] SERVER CLOSED.\n"; ?>

    Read the article

  • AJAX XMLHttpRequest POST X-Domain

    - by Tom
    Hi Guys, I am sending an AJAX request using POST over X-Domain for a widget we are producing for our website. The problem we are facing is that this is getting blocked. My question is - for "modern browsers" [Chrome, Safari, FF, IE8] - it is my understanding that setting "Access-Control" headers Access-Control-Allow-Origin: http://www.test.com Access-Control-Allow-Methods: POST, GET, OPTIONS Access-Control-Allow-Headers: * Access-Control-Max-Age: 1728000 Will allow these "POST" requests to work ? But for IE7 we need to implement some "custom" JSONP solution? Am I correct in this ?

    Read the article

  • Python Textwrap - forcing 'hard' breaks

    - by Tom Werner
    I am trying to use textwrap to format an import file that is quite particular in how it is formatted. Basically, it is as follows (line length shortened for simplicity): abcdef <- Ok line abcdef ghijk <- Note leading space to indicate wrapped line lm Now, I have got code to work as follows: wrapper = TextWrapper(width=80, subsequent_indent=' ', break_long_words=True, break_on_hyphens=False) for l in lines: wrapline=wrapper.wrap(l) This works nearly perfectly, however, the text wrapping code doesn't do a hard break at the 80 character mark, it tries to be smart and break on a space (at approx 20 chars in). I have got round this by replacing all spaces in the string list with a unique character (#), wrapping them and then removing the character, but surely there must be a cleaner way? N.B Any possible answers need to work on Python 2.4 - sorry!

    Read the article

  • Trigger function on deserialization

    - by Tom Savage
    I have a class with a number of fields which are normally calculated in the constructor from other data in the class. They are not serialized to XML because any changes to the rest of the data will likely require their recalculation. Is there a way I can set up a function call to be triggered on deserialization?

    Read the article

  • iPhone SDK: problem managing orientation with multiple view controllers.

    - by Tom
    I'm trying to build an iPhone application that has two subviews in the main window. Each view has its own UIViewController subclass associated with it. Also, within each controller's implementation, I've added the following method: -(BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation { return YES; } Thus, I would expect both of the views to respond to changes in orientation. However, this is not the case. Only the first view added to the app's main window responds to orientation. (If I swap the order the views are added, then only the other view responds. In other words, either will work--but only one at a time.) Why is this? Is it not possible to handle the orientation changes of more than one view? Thanks! EDIT: Someone else had this question, so I'm copying my solution here: I was able to address this issue by providing a root view and a root view controller with the method "shouldAutoRotate..." and adding my other views as subviews to the root view. The subviews inherit the auto-rotating behavior, and their associated view controllers shouldn't need to override "shouldAutoRotate..."

    Read the article

  • XMLEncoder in java for serialization

    - by tom
    Im just wondering how i use xmlencoder to serialize ArrayList where foo is my own made class. Do i have to do anything in particular, ie define my own xml structure first and then call toString on each value in my list and write it out? Can anyone point me to a good tutorial? http://java.sun.com/products/jfc/tsc/articles/persistence4/ Thats what i have been looking at but it doesnt seem to mention what to do with non library classes. Thanks

    Read the article

  • SVG Scaling Text to fit container

    - by Tom
    This is likely a very simple question, but how do I get text in SVG to stretch to fit its container? I don't care if it looks ugly from being stretched too long or high, but it needs to fits its container and be as big as possible. Thanks

    Read the article

< Previous Page | 53 54 55 56 57 58 59 60 61 62 63 64  | Next Page >