Search Results

Search found 1676 results on 68 pages for 'andrew philpott'.

Page 49/68 | < Previous Page | 45 46 47 48 49 50 51 52 53 54 55 56  | Next Page >

  • Zend Framework: isValid() clears values from disabled form fields!

    - by Andrew
    When you submit a form, disabled form fields are not submitted in the request. So if your form has a disabled form field, it makes working with Zend_Form::isValid() a little frustrating. $form->populate($originalData); $form->my_text_field->disabled = 'disabled'; if (!$form->isValid($_POST)) { //form is not valid //since my_text_field is disabled, it doesn't get submitted in the request //isValid() will clear the disabled field value, so now we have to re-populate the field $form->my_text_field->value($originalData['my_text_field']); $this->view->form = $form; return; } // if the form is valid, and we call $form->getValues() to save the data, our disabled field value has been cleared! Without having to re-populate the form, and create duplicate lines of code, what is the best way to approach this problem?

    Read the article

  • anti-if campaign

    - by Andrew Siemer
    I recently ran against a very interesting site that expresses a very interesting idea - the anti-if campaign. You can see this here at www.antiifcampaign.com. I have to agree that complex nested IF statements are an absolute pain in the rear. I am currently on a project that up until very recently had some crazy nested IFs that scrolled to the right for quite a ways. We cured our issues in two ways - we used Windows Workflow Foundation to address routing (or workflow) concerns. And we are in the process of implementing all of our business rules utilizing ILOG Rules for .NET (recently purchased by IBM!!). This for the most part has cured our nested IF pains...but I find myself wondering how many people cure their pains in the manner that the good folks at the AntiIfCampaign suggest (see an example here) by creating numerous amounts of abstract classes to represent a given scenario that was originally covered by the nested IF. I wonder if another way to address the removal of this complexity might also be in using an IoC container such as StructureMap to move in and out of different bits of functionality. Either way... Question: Given a scenario where I have a nested complex IF or SWITCH statement that is used to evaluate a given type of thing (say evaluating an Enum) to determine how I want to handle the processing of that thing by enum type - what are some ways to do the same form of processing without using the IF or SWITCH hierarchical structure? public enum WidgetTypes { Type1, Type2, Type3, Type4 } ... WidgetTypes _myType = WidgetTypes.Type1; ... switch(_myType) { case WidgetTypes.Type1: //do something break; case WidgetTypes.Type2: //do something break; //etc... }

    Read the article

  • User Crontab + Python + Random wallpapers = Not working?

    - by Andrew Bolster
    I have a python script that correctly sets the desktop wallpaper via gconf to a random picture in a given folder. I then have the following entry in my crontab * * * * * python /home/bolster/bin/change-background.py And syslog correctly reports execution Apr 26 14:11:01 bolster-desktop CRON[9751]: (bolster) CMD (python /home/bolster/bin/change-background.py) Apr 26 14:12:01 bolster-desktop CRON[9836]: (bolster) CMD (python /home/bolster/bin/change-background.py) Apr 26 14:13:01 bolster-desktop CRON[9860]: (bolster) CMD (python /home/bolster/bin/change-background.py) Apr 26 14:14:01 bolster-desktop CRON[9905]: (bolster) CMD (python /home/bolster/bin/change-background.py) Apr 26 14:15:01 bolster-desktop CRON[9948]: (bolster) CMD (python /home/bolster/bin/change-background.py) Apr 26 14:16:01 bolster-desktop CRON[9983]: (bolster) CMD (python /home/bolster/bin/change-background.py) But no desktopy changey, Any ideas?

    Read the article

  • getting number of hours until the next event

    - by Andrew Heath
    I've got a table with this data: [ID] [event_name] [last_event] 1 stats 2011-01-01 01:47:32 last_event is a timestamp. The event occurs every 48 hours (it's a cron job). I'd like to show my users the number of hours until the event executes again. So far I've got: SELECT (lastFinish + INTERVAL 48 HOUR) FROM `cron_status` which gives me the exact time and date of the next occurence: 2011-01-03 01:47:32. So I figured if I subtracted the current datetime... SELECT ((lastFinish + INTERVAL 48 HOUR) - SYSDATE()) FROM `cron_status` which (I think?) gives me the difference in unix time: 1980015. But if I divide that by 3600 to convert the seconds to hours... SELECT (((lastFinish + INTERVAL 48 HOUR) - SYSDATE())/3600) FROM `cron_status` I get numbers an order of magnitude too high: 549.99. Where am I going wrong? The target is returning the number of hours until the next execution. Thank you!

    Read the article

  • Zend Framework: The form filter I am using is not filtering!

    - by Andrew
    So I have a form that is using the Zend_Filter_Null filter. When I call it directly, it works: $makeZeroNull = new Zend_Filter_Null(); $null = $makeZeroNull->filter('0'); //$null === null However, when I try to add it to an element in my form, it doesn't filter the value when I call getValue(). class My_Form extends Zend_Form { public function init() { $makeZeroNull = new Zend_Filter_Null(); $this->addElement('text', 'State_ID', array('filters' => array($makeZeroNull))); } } //in controller if ($form->isValid($_POST)) { $zero = $form->State_ID->getValue(); //getValue() should return null, but it is returning 0 } What is going on? What am I doing wrong?

    Read the article

  • How to make drupal known submitting custom content

    - by Andrew
    Hi, I know this is not a drupal forum but, as I’m not getting any response there, I decided to give it a shot here. I’m creating a web site that accepts custom content from users. So, for that matter, this site has a form and a custom module. Instead of using admin theme, this form is placed inside custom template which is created to have a uniform look with the rest of the pages. As a result, creating form elements through hook_form is out of question. Here’s where my problems lie. As this form uses custom theme, I’m not sure as to what can I do to make drupal know that user is submitting new content data when the form is submitted? Would I need to use same query string that of content submission page of admin page like - ?q=node/add/page for action attribute of the html form? (OR) the only way is to map the url to my custom function and invoke some sort of hook inside of it? Thanks

    Read the article

  • How to implement parent-child windows and pass values from child to parent?

    - by Andrew
    I am working on an ASP.NET MVC 2 application. In one of my data entry forms, I have an "employer" field which has a "search" link next to it. When a user clicks on this link, another window is opened with a search form. The user uses the search form to search for the correct employer. A list of employers is shown to the user. Currently, the user has to then copy and paste the correct employer from the child window into the original window. I want to implement it so that each employer search result in the child window is a hyperlink. The user would then click on the correct employer and then the correct employer value would be populated in the original parent window employer field. How would I go about implementing this in ASP.NET MVC 2?

    Read the article

  • Why do people develop emotional attachments for programming languages?

    - by Andrew Heath
    Aside from people who actually developed the languages, I really don't get how someone can develop passion/attachment/perhaps even obsession for a programming language... yet not a day goes by that I don't see a programmer exhibiting this behavior on the internet. I understand how people can feel this way regarding spoken languages - but there's a whole boatload of culture, history, etc that come attached with them. By comparison, the "Python Culture" (as an example) is so small as to be wholly insignificant. Does everyone have a language they love? Am I the odd one out? The dirty polygamist? Are these people rational or silly?

    Read the article

  • Make TBODY scrollable in Webkit browsers

    - by Andrew
    I'm aware of this question, but none of the answers work in Safari, Chrome, etc. The accepted strategy (as demonstrated here) is to set the tbody height and overflow properties like so: <table> <thead> <tr><th>This is the header and doesn't scroll</th></tr> </thead> <tbody style="height:100px; overflow:auto;"> <tr><td>content that scrolls</td></tr> <tr><td>content that scrolls</td></tr> <tr><td>content that scrolls</td></tr> <tr><td>content that scrolls</td></tr> <tr><td>content that scrolls</td></tr> <tr><td>content that scrolls</td></tr> <tr><td>content that scrolls</td></tr> </tbody> </table> Unfortunately, this does not work in any webkit browsers. There is a bug report about it that doesn't seem to be a high priority (reported June 05). So my question is: are there alternate strategies that do actually work? I've tried the two-table approach, but it's impossible to guarantee that the header will line up with the content. Do I just have to wait for Webkit to fix it?

    Read the article

  • Recommendations for Open Source Parallel programming IDE

    - by Andrew Bolster
    What are the best IDE's / IDE plugins / Tools, etc for programming with CUDA / MPI etc? I've been working in these frameworks for a short while but feel like the IDE could be doing more heavy lifting in terms of scaling and job processing interactions. (I usually use Eclipse or Netbeans, and usually in C/C++ with occasional Java, and its a vague question but I can't think of any more specific way to put it)

    Read the article

  • Where to place a query that should be included in all or most views

    - by Andrew
    In my application I have a sidebar which I want to include a list of pages. Cheating on the MVC setup, I can pretty easily display this as follows (in HAML): # layouts/_sidebar.html.haml %h4 Pages %ul.pages - for page in Page.all %li= link_to page.title, page Now, this works just fine, but clearly it's against the convention. The problem is, this shared layout partial is present in most (but not all) views, and therefore to serve the pages from the controller layer would mean needing to inject an instance variable into almost every controller action in the application. That isn't very clean or DRY. So, how would you handle this kind of situation? Is there a clean, DRY place to put this kind of a simple query that respects Rails MVC convention better?

    Read the article

  • Server-side application configuration security. Best practices

    - by Andrew Florko
    We publish server-side application to our customer workstation and customer's security guys are concerned about configuration connection strings safety. Connection strings are stored as plain text right now, but as configuration file is not in the public/shared folder we supposed that workstation security itself is enough. What are the ways to improve connection strings security further? It is a big step forward to encrypt password and keep a decryption key on the same workstation? What are the steps we can take to keep connection strings (and alike) information more and more securable? Thank you in advance!

    Read the article

  • MVC Html Layout C# code formatting

    - by Andrew Florko
    I insert into asp.net mvc views C# logic that manages layout like the following: <% if (Model.People.Count > 0 ) { %> <% foreach (var person in Model.People) { %> ... <% }} else { %> <span class="error">Sorry, no people</span> <%} %> I try to minimize <% % code placing "{" symbol on the same line as it's condition (java-style). Html layout looks more clear to me after that. Do you apply C# formatting rules to <% % html injections "}" should be on a new line or manage layout in different way? Thank you in advance!

    Read the article

  • Selenium: How to click buttons that use onclick window.location?

    - by Andrew
    I have a button (outside of a form) that redirects to another page using the onclick attribute that calls window.location to redirect the user to another page. This time I can't change the HTML. I am using Safari 4 for testing. How can I click a button that uses the onclick attribute and window.location to redirect using Safari 4 and Selenium RC PHPUnit Extension? Here's my HTML: <input type="button" onclick="window.location='/registrations/new'" value="Start a new registration" id="create">

    Read the article

  • Dynamic editor upload into web page. Need advice

    - by Andrew Florko
    Hello everybody, I am writing intranet site for tracking employees science activities in organization. There lots of editable information on each personal page (science degree, publications & so on) so I upload editor per request (user clicks "edit" and modal dialog with html editor: set of textboxes/comboboxes/autocomplete features & validation logic appears). Editor is html layout that is wrapped with jquery dialog plugin + some logic, written as javascript functions that should be invoked from the callee page (onsubmit, validate, afterLoad editor events). There are also attributes (editor preferrable with and height) that are passed to callee page also. Currently I send these functions & attribute as ... function onsubmit() { }; function validate() { } var width = 640; var height = 800 ... code that is embedded into the request page. Function calls and editor markup wrap with jquery plugin completed in the callee page. It works, but I have some try { call editor event handler } catch { } stuff in callee page (because not every editor provides these functions) and some attributes (editor width & height for instance) that are loaded as variables declared in javascript. Please, suggest, is there a better approach to build & use custom editors for my situation. Thank you in advance!

    Read the article

  • Why is url not registered?(Drupal 6.x)

    - by Andrew
    I'm using hook_menu to register new url so that accessing this url would return some data to ajax function. As title suggested, this url is not registered. How do I know that? I've tried typing this in address bar but, drupal, return main template only rather than the tests string that I created. I'm positive that my module is working for php issues error if I intentionally write wrong syntax. And, yes, I clear cache whenever I make changes. Here's the code - function test_menu() { $my_form['test'] = array( 'title' => 'Test address', 'page callback' => 'test', 'access arguments' => array('access content'), 'type' => MENU_CALLBACK, ); return $my_form; } function test(){ $a= "testing"; return $a; }

    Read the article

  • WPF custom user widgets. Will UI components be standardized?

    - by Andrew Florko
    There are lots of articles and video lessons that describe how to create your unique user widget (graphical control) with WPF. There are tons of technical details what is behind the scene and I feel people enthusiasm with ability to customize widgets as never before. I remember those days when VCL library (Delphi) appeared and there was the same enthusiasm in VCL widgets area. Ability to create VCL controls was nearly the must when you was applying for a job as Delphi developer. This situation continued for several years till professional sophisticated 3'd party UI libraries appeared. Hardly you'll have to create your own VCL widget nowadays. Will WPF widgets enthusiasm die as VCL one?

    Read the article

  • MySQL SELECT Statement not working when executed from PHP

    - by Andrew K
    Hello all, I have the following piece of code, executing a pretty simple MySQL query: $netnestquery = 'SELECT (`nested`+1) AS `nest` FROM `ipspace6` WHERE `id`<='.$adaddr.' AND `subnet`<='.$postmask.' AND `type`="net" AND `addr` NOT IN(SELECT `id` FROM `ipspace6` WHERE `addr`<'.$adaddr.' AND `type`="broadcast") ORDER BY `id`,`subnet` DESC LIMIT 1'; $netnestresults = mysql_query($netnestquery); $netnestrow = mysql_fetch_array($netnestresults); $nestlvl = $netnestrow['nest']; echo '<br> NESTQ: '.$netnestquery; Now, when I execute this in PHP, I get no results; an empty query. However, when I copy and paste the query echoed by my code (for debug purposes) into the mysql command line, I get a valid result: mysql> SELECT (`nested` + 1) AS `nest` FROM `ipspace6` WHERE `id`<=50552019054038629283648959286463168512 AND `subnet`<=36 AND `type`='net' AND `addr` NOT IN (SELECT `id` FROM `ipspace6` WHERE `addr`<50552019054038629283648959286463168512 AND `type`='broadcast') ORDER BY `id`,`subnet` DESC LIMIT 1; +------+ | nest | +------+ | 1 | +------+ 1 row in set (0.00 sec) Can anybody tell me what I'm doing wrong? I can't put quotes around my variables, as then MySQL will try to evaluate the variable as a string, when it is, in fact, a very large decimal. I think I might just be making a stupid mistake somewhere, but I can't tell where.

    Read the article

  • has anyone produced an in-memory GIT repository?

    - by Andrew Matthews
    I would like to be able to take advantage of the benefits of GIT (and its workflows), but without the cost of disk access - I just would like to leverage the distributed revision control capabilities of GIT to produce something like a hybrid of memcached and GIT. (preferably in .NET) Is there such a beast out there?

    Read the article

  • How do I compile on linux to share with all distributions?

    - by Andrew M
    I compiled a PHP extension on Fedora Core 12, but when I send it to someone using CentOS they get the error: "ELF file OS ABI invalid" I'm not sure what causes this running file provides the following info: ELF 64-bit LSB shared object, AMD x86-64, version 1 (GNU/Linux), not stripped An extension that loads fine provides the following from file: ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), not stripped So it seems I need to generate a SYSV type file for some distributions, instead of a GNU/LINUX file, no idea how though. Any pointers? Also should I be statically linking?

    Read the article

  • Is NAnt in the dead pool?

    - by Andrew Matthews
    I know NAnt sees frequent use (well, I always use it for my CI builds) but there has been no new official release since December 2007. Is the project receiving active development any more or is it dead-pooled? It worries me that if I carry on using it, and it stops tracking the latest version of .NET, I'll eventually be left with a massive job when it comes to upgrading systems to a version of the framework that it can't build. Has everyone else gone over to some other tool like MSBuild these days?

    Read the article

  • MySQL join headaches, please help!

    - by Andrew Heath
    Ok, I've hit the wall here and need some help. Sample tables are as follows: SCENARIO_NATIONS [scenID] [side] [nation] scen001 1 Germany scen001 2 Britain scen001 2 Canada SCENARIO_NEEDUNITS [scenID] [unitID] scen001 0001 scen001 0003 scen001 0107 scen001 0258 scen001 0759 UNIT_BASIC_DATA [unitID] [nation] [name] 0001 Germany Mortars 0003 Germany Infantry 0107 Britain Lt 0258 Britain Infantry 0759 Canada Kilted Yaksmen Goal: given a scenID, pull a list of units from the database sorted by side, nation, name. I can do everything except for the side inclusion with: SELECT scenario_needunits.scenID, unit_basic_data.nation, unit_basic_data.name FROM scenario_needunits LEFT OUTER JOIN unit_basic_data ON scenario_needunits.unitID=unit_basic_data.unitID WHERE scenario_needunits.scenID='scen001' ORDER BY unit_basic_data.nation ASC, unit_basic_data.name ASC I've tried just dropping the SCENARIO_NATIONS table in as a LEFT OUTER JOIN on scenID but what ends up happening is that ALL units come back with a side of 1 because that's always the first side listed for the scenID in the SCENARIO_NATIONS table. Conceptually, what I think needs to happen is SCENARIO_NATIONS must be joined to both the scenID (to restrict it to just that scenario) and to each unit's nation but I don't have any idea how to do that and my Google-fu is inadequate. :-/

    Read the article

  • removing contents of div using Jquery "empty" doesn't work

    - by Andrew
    I'm trying to remove contents of particular div which are basically list items and a heading by using jquery empty so that I could replace with new contents. What happens when I run the code is, the whole div element blinked and flash the replaced content and then the old one reappear. Can anyone tell me what am I doing wrong? Here's an excerpt of my code - <pre> $("#msg_tab").bind("click",function(){ $("#sidebar1").remove(); var html="<ul><li><h2>test</h2><ul><li><a href='#'>Compose New Message</a></li><li><a href='#'>Inbox</a></li><li><a href='#'>Outbox</a></li><li><a href='#'>Unread</a></li><li><a href='#'>Archive</a></li></ul></li></ul>"; $("#sidebar1").append(html); }); <div id="sidebar1" class="sidebar"> <ul> <li> <h2>Messages</h2> <ul> <li><a href="#">Compose New Message</a></li> <li><a href="#">Inbox</a></li> <li><a href="#">Outbox</a></li> <li><a href="#">Unread</a></li> <li><a href="#">Archive</a></li> </ul> </li> </ul> </div> Another question is, how do I write multiple line html code string in javascript so that java would recognize as a string value? Placing forward slash at the end is ok when the string is not a html code but, in html code, I can't figure out how to escape forward slash from ending tags.I've tried escaping it with backward slash but doesn't work. I would be appreciated if anyone could shed a light on this matter as well.

    Read the article

  • In an Android application, should I have one content provider per table or only one for the entire a

    - by Andrew Dyer
    I have years of experience with Microsoft .NET development (primarily C#) and have been working to come up to speed on Android and Java. So far, I've built a small application with a couple screens and a working content provider. All of the examples I've seen for developing content providers typically work with a single table, so I got the impression that this was the convention. I built a couple more content providers for other tables and ran into the "Unknown URI" IllegalArgumentException when I tried to test them. The exception is being thrown by one of my content providers, but not the one I was intending to call. It appears that my application is using the first content provider in the AndroidManifest.xml file, which now has me wondering if I should only have a single content provider for the entire application. Are there any best practices and/or examples for working with multiple tables in an Android application? Should I have one content provider per table or only one for the entire application? If the former, how do I resolve URIs to the proper provider? If the latter, how do I keep my content provider code from being polluted with switch statements?

    Read the article

< Previous Page | 45 46 47 48 49 50 51 52 53 54 55 56  | Next Page >