Search Results

Search found 3484 results on 140 pages for 'chris dubois'.

Page 118/140 | < Previous Page | 114 115 116 117 118 119 120 121 122 123 124 125  | Next Page >

  • NoSQL vs Relational Coding Styles

    - by Chris Henry
    When building objects that make use of data stored in a RDBMS, it's normally pretty clear what you're getting back, as dictated by the tables and columns being queried. However, when dealing with NoSQL, document-based systems, it's less clear what is being retrieved. What are common methods of keeping track of structure in which data is stored?

    Read the article

  • PHP download page: file_exists() returns true, but browser returns 'page not found'

    - by Chris
    I'm using PHP for a file download page. Here's a snippet of the problem code: if (file_exists($attachment_location)) { header($_SERVER["SERVER_PROTOCOL"] . " 200 OK"); header("Cache-Control: public"); // needed for i.e. header("Content-Type: application/zip"); header("Content-Transfer-Encoding: Binary"); header("Content-Length:".filesize($attachment_location)); header("Content-Disposition: attachment; filename=file.zip"); readfile($attachment_location); die("Hooray"); } else { die("Error: File not found."); } This code works absolutely fine when testing locally, but after deploying to the live server the browser returns a 'Page not found' error. I thought it might be an .htaccess issue, but all .htaccess files on the live server are identical to their local counterparts. My next guess would be the live server's PHP configuration, but I have no idea what PHP setting might cause this behaviour. The file_exists() function always returns true - I've checked this on the live server and it's always correctly picking up the file, its size etc., so it does have a handle on the file. It just won't perform the download! The main site is a Wordpress site, but this code isn't part of a Wordpress page - it's in a standalone directory within the site root. UPDATE: is_file() and is_readable() are both returning true for the file, so that's not the problem. The specific line that is causing the problem is: readfile($attachment_location) Everything up until that point is super happy.

    Read the article

  • Converting a string into a CheckBox

    - by Chris
    I have a string which is ultimately the id of a CheckBox. What I need to be able to do is to access the CheckBox's properties from the string var myCheckBox:Object; var myString:String; myString = "checkbox_1" myCheckBox = Object(myString); ?!?! ... and then I'd need to get to myCheckBox.selected, and myCheckBox.label etc

    Read the article

  • How do I test the speed of a mySQL query?

    - by Chris
    I have a select and query like below... $sql = "SELECT * FROM notifications WHERE to_id='".$userid."' AND (alert_read != '1' OR user_read != '1') ORDER BY alert_time DESC"; $result = mysql_query($sql); how do I test how long the query took to run?

    Read the article

  • Scala: Simple webservice

    - by Chris
    I'd like to create a simple webservice in scala similar to: http://www.artima.com/lejava/articles/threeminutes.html Is there an easy way to do this? EDIT: I found a tutorial for lift http://wiki.liftweb.net/index.php/HowTo_do_Web_Services. However this seems to be way too complicated for what I'm looking for.

    Read the article

  • MacPorts / Terminal: `Unrecognized action "sudo"`

    - by Chris
    I'm trying to install Image Magick on MAMP. And I'm seriously out of my depth. I've installed MacPorts, and opened the terminal. I've typed in sudo port -v selfupdate per the instructions on http://www.macports.org/install.php#pkg But the response I get from the Terminal is Unrecognized action "sudo" I've googled and googled, but can't find anything that makes a slab of sense. Any clever people feeling generous?

    Read the article

  • LINQ Query based on user preferences

    - by Chris Phelps
    How can I do this better (so it actually works : ) I have a LINQ Query that includes an order by that is based on a user preference. The user can decide if they would like the results ordered asc or desc. If fuserclass.SortOrder = "Ascending" Then Dim mydat = (From c In dc.ITRS Order By c.Date Ascending Select c) Else Dim mydat = (From c In dc.ITRS Order By c.Date Descending Select c) End If For each mydata in mydat ***<<<error "mydat is not declared"*** I know I could put my For Each loop inside the If and Else, but that seems silly to have the same code twice. I know you know of a better way : )

    Read the article

  • What's the easiest way to create an extensible custom container in Flex?

    - by Chris R
    I want to create an MXML container component that has some of its own chrome -- a standard query display, et al -- and that supports the addition of child components to it. Something a lot like the existing mx:Panel class, which includes a title label, but acts like a plain mx:Box with regards to adding children. What's the easiest way to do this? Edit: To be clear, I want to be able to extend the container using MXML, so the "Multiple visual children" problem is relevant.

    Read the article

  • Show/Hide GridView Header in ListView

    - by Chris
    I have a ListView in WPF, and I want to hide the headers for the ListView when the List the ItemsSource is bound to is null, and display the headers when the ItemsSource is not null and has at least 1 item in the collection. I have found the code online to hide the ListView headers like this: <Window.Resources> <Style x:Key="HideListViewHeaders" TargetType="{x:Type GridViewColumnHeader}"> <Setter Property="Visibility" Value="Collapsed" /> </Style> </Window.Resources> Thanks for any help!

    Read the article

  • If you could remove one feature of php ti help newbies what would it be?

    - by Chris
    If you could remove one feature from PHP so as to discourage, prevent or otherwise help stop newer programmers develop bad habits or practices, or, to stop them falling into traps that might hinder their development skills what would it be and why? Now, before the votes to close it's not as open-ended as you might think. I'm not asking purely what is the worst feature or what feature would you really like to remove purely arbitrarily. Yes, there may not be one correct answer but I suspect there will be many similar answers which will provide me with a good idea of things I might be doing wrong, even inadvertently.

    Read the article

  • Can I have Sinatra / Rack not read the entire request body into memory?

    - by Chris Markle
    Say I have a Sinatra route ala: put '/data' do request.body.read # ... end It appears that the entire request.body is read into memory. Is there a way to consume the body as it comes into the system, rather than having it all buffered in Rack/Sinatra beforehand? I see I can do this to read the body in parts, but the entire body still seems to be read into memory beforehand. put '/data' do while request.body.read(1024) != nil # ... end # ... end

    Read the article

  • Proper mechanism for sending PHP errors to the client

    - by Chris
    Greetings, I was trying to discover a proper way to send captured errors or business logic exceptions to the client in an Ajax-PHP system. In my case, the browser needs to react differently depending on whether a request was successful or not. However in all the examples I've found, only a simple string is reported back to the browser in both cases. Eg: if (something worked) echo "Success!"; else echo "ERROR: that failed"; So when the browser gets back the Ajax response, the only way to know if an error occurred would be to parse the string (looking for 'error' perhaps). This seems clunky. Is there a better/proper way to send back the Ajax response & notify the browser of an error? Thank you.

    Read the article

  • Obtaining XML from U.S. Postal Service (USPS) rate calculator API with PHP

    - by Chris F
    hoping somebody here can help me. I'm attempting to pull an XML page from the U.S. Postal Service (USPS) rate calculator, using PHP. Here is the code I am using (with my API login and password replaced of course): <? $api = "http://production.shippingapis.com/ShippingAPI.dll?API=RateV4&XML=<RateV4Request ". "USERID=\"MYUSERID\" PASSWORD=\"MYPASSWORD\"><Revision/><Package ID=\"1ST\">". "<Service>FIRST CLASS</Service><FirstClassMailType>PARCEL</FirstClassMailType>". "<ZipOrigination>12345</ZipOrigination><ZipDestination>54321</ZipDestination>". "<Pounds>0</Pounds><Ounces>9</Ounces><Container/><Size>REGULAR</Size></Package></RateV4Request>"; $xml_string = file_get_contents($api); $xml = simplexml_load_string($xml_string); ?> Pretty straightforward. However it never returns anything. I can paste the URL directly into my browser's address bar: http://production.shippingapis.com/ShippingAPI.dll?API=RateV4&XML=<RateV4RequestUSERID="MYUSERID" PASSWORD="MYPASSWORD"><Revision/><Package ID="1ST"><Service>FIRST CLASS</Service><FirstClassMailType>PARCEL</FirstClassMailType><ZipOrigination>12345</ZipOrigination><ZipDestination>54321</ZipDestination><Pounds>0</Pounds><Ounces>9</Ounces><Container/><Size>REGULAR</Size></Package></RateV4Request> And it returns the XML I need, so I know the URL is valid. But I cannot seem to capture it using PHP. Any help would be tremendously appreciated. Thanks in advance.

    Read the article

  • Placing and removing element on array trough object

    - by Chris
    Hello, Lets assume i have 2 methods 1 that places a element on the array and one that removes it. const int Max = 10; int[] table= new int[Max]; I would like to call it up like this: s1.Place(5); // 5 0 0 0 0 0 0 0 0 0 0 s1.Place(9); // 5 9 0 0 0 0 0 0 0 0 0 s1.Remove(9); // 5 0 0 0 0 0 0 0 0 0 0 I would only like to use : using system for this. The result i get right now when i run the program is s1 = "nameofprogram" "name of class object" Normally i should get 0 0 0 0 0 0 0 0 0 0 to begin with. Any ideas how i can exactly add or remove those elements on the array? public void Place(int g) { if (top == Max) { throw new Exception("Stack overflow..."); } else { table[top] = g; top++; } .... Best Regards.

    Read the article

  • Switch role after connecting to database

    - by Chris Gow
    Is it possible to change the postgresql role a user is using when interacting with postgres after the initial connection? The database(s) will be used in a web application and I'd like to employ database level rules on tables and schemas with connection pooling. From reading the postgresql documentation it appears I can switch roles if I originally connect as a user with the superuser role, but I would prefer to initially connect as a user with minimal permissions and switch as necessary. Having to specify the user's password when switching would be fine (in fact I'd prefer it). What am I missing?

    Read the article

  • Best Books for Learning to Test Software

    - by Chris
    I have read a lot of programming books, many mention testing of various kinds. I have never really gotten into the topic of testing, but I realize how extremely important it is. Anyone know of some good books that provide a thorough exploration of this topic?

    Read the article

  • Sql Server Development Server and Live

    - by Chris
    I have a database project that goes through iterations (only one so far) and I need to deploy a testing version to a live server. I'm not sure how to go about this. I can make all the changes in a copy and then remake those changes in the live version. That doesn't make sense. Is there a way to change a server name to an existing server? What's the best practice for this scenario?

    Read the article

  • Keeping object in memory (iPhone SDK)

    - by Chris
    I am trying to create a UIImageView called theImageView in the touchesBegan method that I can then then move to a new location in touchesMoved. Currently I am receiving an "undeclared" error in touchesMoved where I set the new location for theImageView. What can I do to keep theImageView in memory between these two methods? - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { ... UIImageView *theImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"image.png"]]; theImageView.frame = CGRectMake(263, 228, 193, 300); [theImageView retain]; ... } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { ... theImageView.frame = CGRectMake(300, 300, 193, 300); ... }

    Read the article

  • Fast compiler error messages in Eclipse

    - by Chris Conway
    As a new Eclipse user, I am constantly annoyed by how long it takes compiler error messages to display. This is mostly only a problem for long errors that don't fit in the status bar or the "Problems" tab. But I get enough long errors in Java—especially with generics—that this is a nagging issue. (Note: The correct answer to this question is not "get better at using generics." ;-) The ways I have found to display an error are: Press Ctrl+. or execute the command "Next Annotation". The next error is highlighted and its associated message appears in the status bar (if it is short enough). The error is also highlighted in the "Problems" tab, if it is open, but the tab is not automatically brought to the top. Hover the mouse over the error. After a noticeable lag, the error message appears as a "tool tip", along with any associated "Quick Fixes." Hover the mouse over the error icon on the left side of the editing pane. After a noticeable lag, all of the error messages for that line appear as a "tool tip." Clicking on the icon brings up "Quick Fixes." What I would like is for Ctrl+. to automatically and instantly bring up the complete error message (I don't care where). Is this a configurable option? [UPDATE] @asterite's "Ctrl+. F2" is almost it. How do I make "Next Annotation, then Show Tooltip Description" a macro bound to a single keystroke?

    Read the article

  • LINQ to Entites: Doing a count over one-to-many relationships

    - by chris
    I have a couple of tables where there are one to many relationships. Let's say I have a Country table, a State table with a FK to Country, and a City table with a FK to State. I'd like to be able to create a count of all Cities for a given country, and also a count of cities based on a filter - something like: foreach( var country in Model.Country ) { total = country.State.All().City.All().Count() ; filtered = country.State.All().City.Any(c=>c.field == value).Count(); } Obviously, this doesn't work - is there any way to do this?

    Read the article

  • Why do I need the isset() function in php?

    - by Chris
    I am trying to understand the difference between this: if (isset($_POST['Submit'])) { //do something } and if ($_POST['Submit']) { //do something } It seems to me that if the $_POST['Submit'] variable is true, then it is set. Why would I need the isset() function in this case?

    Read the article

  • FLV Player Skin Custom URL

    - by Chris
    I have a flash banner ad (AS3) which uses a FLV Player component for a remove video. The Skin exports it's own SWF file for user with the video controls as I'm sure anyone familiar with Flash knows. Is there anyway to specify where this file is remotely? I have to provide 1 file to my advertiser, and do not want to have to create custom video controls for this. Is it possible to upload this swf file to a remote location and tell Flash to pull it from there? Any help would be greatly appreciated.

    Read the article

  • WHERE condition accross multiple rows

    - by Chris G
    I have this table... -------------------------------------- | user_id | status | status_date | -------------------------------------- | 1 | Current | 2012-08-01 | | 1 | Referral | 2012-03-14 | | 2 | Referral | 2012-04-23 | | | | | -------------------------------------- How would I query to find a distinct user_id who has a referral date before 2012-06-30 AND either a current date of after 2012-06-30 or no current status record at all? Database is MySQL.

    Read the article

< Previous Page | 114 115 116 117 118 119 120 121 122 123 124 125  | Next Page >