Search Results

Search found 2097 results on 84 pages for 'paul gordon'.

Page 10/84 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Using Phing's dbdeploy task with transactions

    - by Gordon
    I am using Phing's dbdeploy task to manage my database schema. This is working fine, as long as there is no errors in my delta file. However, if there is an error, dbdeploy will just run the delta files up to the query with the error and then abort. This causes me some frustration, because I have to manually rollback the entry in the changelog table then. If I don't, dbdeploy will assume the migration was successful on a subsequent try. So the question is, there any way to get dbdeploy use transactions?

    Read the article

  • Creating a multi-step process with mysql and php

    - by Paul Atkins
    Hi, I am working on a script which allows users to create a stepped process. The steps will consist of sending visitors to urls where they will fill out a form then be directed to the next step the user has created. Each user can create as many steps as they wish and the url for each step will be unique. I am not sure if I am doing this in the correct/most efficient way so I have a few questions about this. Before I begin here is a simple version of my table structure: step_id user_id step_url step_order 1 1 example.com?step=1 1 2 2 test.com?step=1 1 3 1 example.com?step=3 2 A visitor will be directed to step_url: example.com?step=1 by user_id: 1 On this page there will be a form which contains a hidden field with the value of the step_id like this: <input type="hidden" name="step_id" value="1"> Once the visitor has filled out this form it will be processed by my script at a url similar to: http://mysite.com/form-process.php Once the form has been submitted I then need to direct the visitor to the next step my user has created. I would currently do this using code similar to this: SELECT step_url FROM table WHERE step_order='$current_step_order'+1 Here are my questions about this: Is this the best most efficient way to accomplish this? Or is there a better way? As the step_id column is auto increment...how would I increment the order column by 1 each time a user inserts a new step? Thanks for taking the time to read this. Paul

    Read the article

  • Resolving ambiguous this pointer in C++

    - by Paul Tevis
    I'm trying to derive a new class from an old one. The base class declaration looks like this: class Driver : public Plugin, public CmdObject { protected: Driver(); public: static Driver* GetInstance(); virtual Engine& GetEngine(); public: // Plugin methods... virtual bool InitPlugin (Mgr* pMgr); virtual bool Open(); virtual bool Close(); // CmdObject virtual bool ExecObjCmd(uint16 cmdID, uint16 nbParams, CommandParam *pParams, CmdChannelError& error); Mgr *m_pMgr; protected: Services *m_pServices; Engine m_Engine; }; Its constructor looks like this: Driver::Driver() : YCmdObject("Driver", (CmdObjectType)100, true), m_Engine("MyEngine") { Services *m_pServices = NULL; Mgr *m_pMgr = NULL; } So when I created my derived class, I first tried to simply inherit from the base class: class NewDriver : public Driver and copy the constructor: NewDriver::NewDriver() : CmdObject("NewDriver", (EYCmdObjectType)100, true), m_Engine("MyNewEngine") { Services *m_pServices = NULL; Mgr *m_pMgr = NULL; } The compiler (VisualDSP++ 5.0 from Analog Devices) didn't like this: ".\NewDriver.cpp", line 10: cc0293: error: indirect nonvirtual base class is not allowed CmdObject("NewDriver", (EYCmdObjectType)100, true), That made sense, so I decided to directly inherit from Plugin and CmdObject. To avoid multiple inheritance ambiguity problems (so I thought), I used virtual inheritance: class NewDriver : public Driver, public virtual Plugin, public virtual CmdObject But then, in the implementation of a virtual method in NewDriver, I tried to call the Mgr::RegisterPlugin method that takes a Plugin*, and I got this: ".\NewDriver.cpp", line 89: cc0286: error: base class "Plugin" is ambiguous if (!m_pMgr->RegisterPlugin(this)) How is the this pointer ambiguous, and how do I resolve it? Thanks, --Paul

    Read the article

  • how to display image in repeater after AJAX AsyncFileUpload ?

    - by Gordon Shamway
    Hello i am using the AsyncFileUpload from the ajaxtoolkit, upter the upload is complete , i want to display all the images that were uploaded (and their URL is inserted into the DB) with my repeater and binding method. but its not working! the images are uploaded, the DB insert works file, but i cant see the images after the repeater is dinded. (i have to mention that if i go step by step, i do see that the ITEMBOUND is being binded and executed) <ajax:TabContainer runat="server" ID="testTab"> <ajax:TabPanel runat="server" ID="testTabContainer"> <ContentTemplate> <ajax:AsyncFileUpload ID="uploadAsyncImage" runat="server" OnUploadedComplete="InsertToTemp" ThrobberID="Throbber"/> <asp:Label ID="Throbber" runat="server" Style="display: none"> <img src="Images/indicator.gif" align="absmiddle" alt="loading" /> </asp:Label> <br /> <asp:UpdatePanel runat="server" ID="pnlImages" UpdateMode="Conditional" ChildrenAsTriggers="true"> <ContentTemplate> <asp:Repeater runat="server" ID="rptImages" > <ItemTemplate> <a href="<%# DataBinder.Eval(Container.DataItem, "PicURL")%>" rel="lightbox"> <asp:Image ImageUrl='<%# DataBinder.Eval(Container.DataItem, "PicURL")%>' Width="50" Height="50" runat="server" ID="testPic" /> </a> </ItemTemplate> </asp:Repeater> </ContentTemplate> </asp:UpdatePanel> </ContentTemplate> </ajax:TabPanel> </ajax:TabContainer> </form> also adding my Code Behind, since it might be important or will help you get an idea of what i am trying to do.private void BindRepater() { ProjDataContext db = DbContext.DbContextProvider(); var pic = from p in db.TempProdCats where p.SessionID == Session.SessionID.ToString() select new { PicURL = p.PicURL }; rptImages.DataSource = pic; rptImages.DataBind(); pnlImages.Update(); } protected void rptImages_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { Image lblCat = (Image)e.Item.FindControl("testPic"); lblCat.ImageUrl = (string)DataBinder.Eval(e.Item.DataItem, "PicURL"); pnlImages.Update(); } } your help will be highly appreciated , if any of you got any idea how to make it work...

    Read the article

  • Merge items in nanoc

    - by Gordon Potter
    I have been trying to use nanoc for generating a static website. I need to organize a complex arrangement pages I want to keep my content DRY. How does the concept of includes or merges work within the nanoc system? I have read the docs but I can't seem to find what I want. For example: how can I take two partial content items and merge them together into a new content item. In staticmatic you can do some like the following inside your page. = partial('partials/shared/navigation') How would a similar convention work within nanoc?

    Read the article

  • Getting Phing's dbdeploy task to automatically rollback on delta error

    - by Gordon
    I am using Phing's dbdeploy task to manage my database schema. This is working fine, as long as there is no errors in the queries of my delta files. However, if there is an error, dbdeploy will just run the delta files up to the query with the error and then abort. This causes me some frustration, because I have to manually rollback the entry in the changelog table then. If I don't, dbdeploy will assume the migration was successful on a subsequent try. So the question is, is there any way to get dbdeploy use transactions or can you suggest any other way to have phing rollback automatically when an error occurs? Note: I'm not that proficient with Phing, so if this involves writing a custom task, any example code or a url with further information is highly appreciated. Thanks

    Read the article

  • Correctly assigning value to a Core Data attribute with an integer data-type

    - by Gordon Fontenot
    I'm missing something here, and feeling like an idiot about it. I'm using a UIPickerView in my app, and I need to assign the row number to a 32-bit integer attribute for a Core Data object. To do this, I am using this method: -(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { object.integerValue = row; } This is giving me a warning: warning: passing argument 1 of 'setIntegerValue:' makes pointer from integer without a cast What am I mixing up here? --Edit 1-- Ok, so I can get rid of the warning by changing the method to do the following: NSNumber *number = [NSNumber numberWithInteger:row]; object.integerValue = rating; However, I still get a value of 0 for object.integerValue if I use NSLog to print it out. object.integerValue has a max value of 5, so I print out number instead, and then I'm getting a number above 62,000,000. Which doesn't seem right to me, since there are 5 rows. If I NSLog the row variable, I get a number between 0 and 5. So why do I end up with a completely different number after casting the number to NSNumber? --Edit 2-- Ok, so I'm realizing that there is some fundamental idea that I don't understand. I now understand that the 60 million + number can be cast back to the correct 0-5 number by using integerValue. So, it seems my question is how can I save an integer between 0-5 to the attribute if the NSNumber that is returned is over 60 million? Do I need to be using a different data type?

    Read the article

  • Properly using subprocess.PIPE in python?

    - by Gordon Fontenot
    I'm trying to use subprocess.Popen to construct a sequence to grab the duration of a video file. I've been searching for 3 days, and can't find any reason online as to why this code isn't working, but it keeps giving me a blank result: import sys import os import subprocess def main(): the_file = "/Volumes/Footage/Acura/MDX/2001/Crash Test/01 Acura MDX Front Crash.mov" ffmpeg = subprocess.Popen(['/opt/local/bin/ffmpeg', '-i', the_file], stdout = subprocess.PIPE, ) grep = subprocess.Popen(['grep', 'Duration'], stdin = subprocess.PIPE, stdout = subprocess.PIPE, ) cut = subprocess.Popen(['cut', '-d', ' ', '-f', '4'], stdin = subprocess.PIPE, stdout = subprocess.PIPE, ) sed = subprocess.Popen(['sed', 's/,//'], stdin = subprocess.PIPE, stdout = subprocess.PIPE, ) duration = sed.communicate() print duration if __name__ == '__main__': main()

    Read the article

  • ISO-8859-1 to UTF8 in ASP.NET 2

    - by Gordon Carpenter-Thompson
    We've got a page which posts data to our ASP.NET app in ISO-8859-1 <head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <title>`Sample Search Invoker`</title> </head> <body> <form name="advancedform" method="post" action="SearchResults.aspx"> <input class="field" name="SearchTextBox" type="text" /> <input class="button" name="search" type="submit" value="Search &gt;" /> </form> and in the code behind (SearchResults.aspx.cs) System.Collections.Specialized.NameValueCollection postedValues = Request.Form; String nextKey; for (int i = 0; i < postedValues.AllKeys.Length; i++) { nextKey = postedValues.AllKeys[i]; if (nextKey.Substring(0, 2) != "__") { // Get basic search text if (nextKey.EndsWith(XAEConstants.CONTROL_SearchTextBox)) { // Get search text value String sSentSearchText = postedValues[i]; System.Text.Encoding iso88591 = System.Text.Encoding.GetEncoding("iso-8859-1"); System.Text.Encoding utf8 = System.Text.Encoding.UTF8; byte[] abInput = iso88591.GetBytes(sSentSearchText); sSentSearchText = utf8.GetString(System.Text.Encoding.Convert(iso88591, utf8, abInput)); this.SearchText = sSentSearchText.Replace('<', ' ').Replace('>',' '); this.PreviousSearchText.Value = this.SearchText; } } } When we pass through Merkblätter it gets pulled out of postedValues[i] as Merkbl?tter The raw string string is Merkbl%ufffdtter Any ideas?

    Read the article

  • Selecting Users For A/B (Champion/Challenger) Testing

    - by Gordon Guthrie
    We have a framework that offers A/B split testing. You have a 'champion' version of a page and you develop a 'challenger' version of it. Then you run the website and allocate some of your users the champion and some the challenger and measure their different responses. If the challenger is better than the champion at achieving your metrics then you dethrone the champion and develop a new challenger... My question is what mechanisms should I consider to allocate the versions? A number of options spring to mind: odd or even IP address (or sub-segments) ****.****.****.123 gets champion but .124 gets challenger cookie push - check for a champion/challenger cookie, if it doesn't exist randomly allocate the user to one and push the cookie Best practice? suggestions? comments? experience?

    Read the article

  • Saving UIImagePickerController images to Core Data without crashing

    - by Gordon Fontenot
    I have been trying to minimize my memory footprint with UIImagePickerController, but I'm starting to think that the memory problems I am having are resulting from poor memory management, instead of a particular way to handle the UIImagePickerController object. My workflow is this: The "Edit Image" button is clicked, which presents a UIActionSheet. This action sheet allows you to delete, take a picture, choose from the library, or cancel. If you select Choose from the library or Take Picture, I alloc an instance of UIImagePickerController and present it, followed by a release of UIImagePickerController: -(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { if (actionSheet.tag != 999) { UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; imagePicker.delegate = self; BOOL pickImage = nil; if (actionSheet.tag == iPhoneWithDelete) { switch (buttonIndex) { case 0: object.objectImage = nil; pickImage = NO; break; case 1: imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; pickImage = YES; break; case 2: imagePicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum; pickImage = YES; break; default: pickImage = NO; break; } } else if (actionSheet.tag == iPhoneNoDelete) { switch (buttonIndex) { case 0: imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; pickImage = YES; break; case 1: imagePicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum; pickImage = YES; break; default: pickImage = NO; break; } } else if (actionSheet.tag == iPodWithDelete) { switch (buttonIndex) { case 0: object.objectImage = nil; pickImage = NO; break; case 1: imagePicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum; pickImage = YES; break; default: pickImage = NO; break; } } else if (actionSheet.tag == iPodNoDelete) { switch (buttonIndex) { case 0: imagePicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum; pickImage = YES; break; default: pickImage = NO; break; } } if (pickImage) { imagePicker.allowsEditing = YES; [self presentModalViewController:imagePicker animated:YES]; } else { [self setupImageButton]; [self setupChooseImageButton]; } [imagePicker release]; } } Once I get a selection back from the UIImagePickerController, I save 2 images, a resized version of the edited image to use for a thumbnail, and a 800x600 version of the original unedited image into a relationship attribute (Transformational, using the same UIImage to PNG transformations found in the Recipes demo code) for display use: (the resize methods are based on the one demoed in this SO post.) - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { [self dismissModalViewControllerAnimated:YES]; NSManagedObject *oldImage = object.imageFull; if (oldImage != nil) { [object.managedObjectContext deleteObject:oldImage]; } NSManagedObject *image = [NSEntityDescription insertNewObjectForEntityForName:@"Image" inManagedObjectContext:object.managedObjectContext]; object.imageFull = image; UIImage *rawImage = [info objectForKey:@"UIImagePickerControllerOriginalImage"]; CGSize size = CGSizeMake(800, 600); UIImage *fullImage = [UIImageManipulator scaleImage:rawImage toSize:size]; [image setValue:fullImage forKey:@"imageFull"]; UIImage *processedImage = [UIImageManipulator scaleImage:[info objectForKey:@"UIImagePickerControllerEditedImage"] toSize:CGSizeMake(75, 75)]; object.objectImage = processedImage; [self setupImageButton]; [self setupChooseImageButton]; rawImage = nil; fullImage = nil; processedImage = nil; } When I go through viewDidUnload I am setting self.object = nil, and [object release] during dealloc, but I'm still getting memory warnings after about 10 image changes, with a crash at around 20. It leads me to believe that I am not getting that full image out of memory the correct way. What am I missing here? And on a second note, does the Camera source use significantly more memory than the Photo Albums source? I tend to get more crashes when using the camera.

    Read the article

  • [Django] Automatically Update Field when a Different Field is Changed

    - by Gordon
    I have a model with a bunch of different fields like first_name, last_name, etc. I also have fields first_name_ud, last_name_ud, etc. that correspond to the last updated date for the related fields (i.e. when first_name is modified, then first_name_ud is set to the current date). Is there a way to make this happen automatically or do I need to check what fields have changed each time I save an object and then update the related "_ud" fields. Thanks a lot!

    Read the article

  • Properly setting up willSelectRowAtIndexPath and didSelectRowAtIndexPath to send cell selections

    - by Gordon Fontenot
    Feel like I'm going a bit nutty here. I have a detail view with a few stand-alone UITextFields, a few UITextFields in UITAbleViewCells, and one single UITableViewCell that will be used to hold notes, if there are any. I only want this cell selectable when I am in edit mode. When I am not in edit mode, I do not want to be able to select it. Selecting the cell (while in edit mode) will fire a method that will init a new view. I know this is very easy, but I am missing something somewhere. Here are the current selection methods I am using: -(NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath { if (!self.editing) { NSLog(@"Returning nil, not in edit mode"); return nil; } NSLog(@"Cell will be selected, not in edit mode"); if (indexPath.section == 0) { NSLog(@"Comments cell will be selected"); return indexPath; } return nil; } -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if (!self.editing) { NSLog(@"Not in edit mode. Should not have made it this far."); return; } if (indexPath.section == 0) [self pushCommentsView]; else return; } My problem is really 2 fold; 1) Even when I'm not in edit mode, and I know I am returning nil (due to the NSLog message), I can still select the row (it flashes blue). From my understanding of the willSelectRowAtIndexPath method, this shouldn't be happening. Maybe I am wrong about this? 2) When I enter edit mode, I can't select anything at all. the willSelectRowAtIndexPath method never fires, and neither does the didSelectRowAtIndexPath. The only thing I am doing in the setEditing method, is hiding the back button while editing, and assigning firstResponder to the top textField to get the keyboard to pop up. I thought maybe the first responder was getting in the way of the click (which would be dumb), but even with that commented out, I cannot perform the cell selection during editing.

    Read the article

  • Windows Service Conundrum

    - by Paul Johnson
    All, I have a Custom object which I have written using VB.NET (.net 2.0). The object instantiates its own threading.timer object and carries out a number of background process including periodic interrogation of an oracle database and delivery of emails via smtp according to data detected in the database. The following is the code implemented in the windows service class Public Class IncidentManagerService 'Fakes Private _fakeRepoFactory As IRepoFactory Private _incidentRepo As FakeIncidentRepo Private _incidentDefinitionRepo As FakeIncidentDefinitionRepo Private _incManager As IncidentManager.Session 'Real Private _started As Boolean = False Private _repoFactory As New NHibernateRepoFactory Private _psalertsEventRepo As IPsalertsEventRepo = _repoFactory.GetPsalertsEventRepo() Protected Overrides Sub OnStart(ByVal args() As String) ' Add code here to start your service. This method should set things ' in motion so your service can do its work. If Not _started Then Startup() _started = True End If End Sub Protected Overrides Sub OnStop() 'Tear down class variables in order to ensure the service stops cleanly _incManager.Dispose() _incidentDefinitionRepo = Nothing _incidentRepo = Nothing _fakeRepoFactory = Nothing _repoFactory = Nothing End Sub Private Sub Startup() Dim incidents As IList(Of Incident) = Nothing Dim incidentFactory As New IncidentFactory incidents = IncidentFactory.GetTwoFakeIncidents _repoFactory = New NHibernateRepoFactory _fakeRepoFactory = New FakeRepoFactory(incidents) _incidentRepo = _fakeRepoFactory.GetIncidentRepo _incidentDefinitionRepo = _fakeRepoFactory.GetIncidentDefinitionRepo 'Start an incident manager session _incManager = New IncidentManager.Session(_incidentRepo, _incidentDefinitionRepo, _psalertsEventRepo) _incManager.Start() End Sub End Class After a little bit of experimentation I arrived at the above code in the OnStart method. All functionality passed testing when deployed from VS2005 on my development PC, however when deployed on a true target machine, the service would not start and responds with the following message: "The service on local computer started and then stopped..." Am I going about this the correct way? If not how can I best implement my incident manager within the confines of the Windows Service class. It seems pointless to implement a timer for the incidentmanager because this already implements its own timer... Any assistance much appreciated. Kind Regards Paul J.

    Read the article

  • NSZombieEnabled breaking working code?

    - by Gordon Fontenot
    I have the following method in UIImageManipulation.m: +(UIImage *)scaleImage:(UIImage *)source toSize:(CGSize)size { UIImage *scaledImage = nil; if (source != nil) { UIGraphicsBeginImageContext(size); [source drawInRect:CGRectMake(0, 0, size.width, size.height)]; scaledImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); } return scaledImage; } I am calling it in a different view with: imageFromFile = [UIImageManipulator scaleImage:imageFromFile toSize:imageView.frame.size]; (imageView is a UIImageView allocated earlier) This is working great in my code. I resizes the image perfectly, and throws zero errors. I also don't have anything pop up under build - analyze. But the second I turn on NSZombieEnabled to debug a different EXC_BAD_ACCESS issue, the code breaks. Every single time. I can turn NSZombieEnabled off, code runs great. I turn it on, and boom. Broken. I comment out the call, and it works again. Every single time, it gives me an error in the console: -[UIImage release]: message sent to deallocated instance 0x3b1d600. This error doesn't appear if `NSZombieEnabled is turned off. Any ideas? --EDIT-- Ok, This is killing me. I have stuck breakpoints everywhere I can, and I still cannot get a hold of this thing. Here is the full code when I call the scaleImage method: -(void)setupImageButton { UIImage *imageFromFile; if (object.imageAttribute == nil) { imageFromFile = [UIImage imageNamed:@"no-image.png"]; } else { imageFromFile = object.imageAttribute; } UIImage *scaledImage = [UIImageManipulator scaleImage:imageFromFile toSize:imageButton.frame.size]; UIImage *roundedImage = [UIImageManipulator makeRoundCornerImage:scaledImage :10 :10 withBorder:YES]; [imageButton setBackgroundImage:roundedImage forState:UIControlStateNormal]; } The other UIImageManipulator method (makeRoundCornerImage) shouldn't be causing the error, but just in case I'm overlooking something, I threw the entire file up on github here. It's something about this method though. Has to be. If I comment it out, it works great. If I leave it in, Error. But it doesn't throw errors with NSZombieEnabled turned off ever.

    Read the article

  • how to insert multiple rows using cakephp

    - by Paul
    In the cakePHP project I'm building, I want to insert a defined number of identical records. These will serve as placeholders records that will have additional data added later. Each record will insert the IDs taken from two belongs_to relationships as well as two other string values. What I want to do is be able to enter a value for the number of records I want created, which would equate to how many times the data is looped during save. What I don't know is: 1) how to setup a loop to handle a set number of inserts 2) how to define a form field in cakePHP that only sets the number of records to create. What I've tried is the following: function massAdd() { $inserts_required = 1; while ($inserts_required <= 10) { $this->Match->create(); $this->Match->save($this->data); echo $inserts_required++; } $brackets = $this->Match->Bracket->find('list'); $this->set(compact('brackets')); } What happens is: 1) at the top of the screen, above the doc type, the string 12345678910 is displayed, this is displayed on screen 2) a total of 11 records are created, and only the last record has the values passed in the form. I don't know why 11 records as opposed to 10 are created, and why only the last records has the entered form data? As always, your help and direction is appreciated. -Paul

    Read the article

  • Help with MySQL query - Product orders report without duplicate shipping charges

    - by Paul
    Hello, I have an issue creating a custom report for an e-commerce store running on osCommerce. The client wants the report to have the following columns: Date, Order ID, Product Class, Product Price, Product Tax, Shipping, Order Total The criteria for generating the report are Date Range and Product Class (Textbooks for example) The client wants the report to list each Textbook purchased on its own line. Orders with multiple textbooks would display a separate line for each Textbook in the order. I have it all working except for one part: the shipping amount is order-specific (based on the order total), not product-specific, and is displaying for each product. I need it to display only for the first product of each order, so it is not counted more than once. My current query is: SELECT op.date_funds_captured as 'Date', op.orders_id as 'Order ID', pc.class as 'Product Class', round(op.products_price,2) as 'Product Price', round(op.products_tax*op.products_price/100,2) as 'Product Tax', round(otship.value,2) as 'Shipping', round(ot.value,2) as 'Order Total' from orders_products op, orders_total ot, orders_total otship, productclasses pc, products p where ot.orders_id = op.orders_id and ot.class='ot_total' and op.orders_id = otship.orders_id and otship.class = 'ot_shipping' and p.products_class_id = pc.id and op.products_id = p.products_id and pc.id = 1 pc.id = 1 -- Product class = Textbook Here is an example of the current report output. You can see the problem with order 2256 showing the shipping value three times instead of once: Date Order Product Class Price Tax Shipping Total 2010-01-04 2253 Textbook 24.95 2.43 10.03 37.41 2010-01-04 2256 Textbook 34.95 0.00 18.09 240.37 2010-01-04 2256 Textbook 55.50 0.00 18.09 240.37 2010-01-04 2256 Textbook 36.95 0.00 18.09 240.37 2010-01-04 2258 Textbook 55.50 5.41 12.17 124.24 Please help!!! Thanks, Paul

    Read the article

  • iPhone: Having trouble figuring out how to scroll a UITableView with custom UITextField cells automa

    - by Gordon Fontenot
    Ok, I know this seems like a duplicate question, but don't think it is. I actually have this implemented already (thanks to this SO question), but it seems sluggish. I am willing to tweak it a bit, but I ran across a demo app by AboutObjects that seems to have exactly the right functionality with absolutely no code doing it. I have looked through their demo code dozens of times, and I can't figure out what they are doing that I am not. The code to look at is in their iPhone Development Tutorials section, and is called "Editable TableView" (2nd from the bottom). There are a couple of questions on the forums on that site asking how they got the functionality, but there is no answer (other than "It's a built in function"). Does anyone have any clue as to why their UITableView would implement the input scrolling by default (including being able to scroll the view manually when the keyboard pops up, which I cannot get to work)?

    Read the article

  • bash bcmath functions

    - by Gordon
    I have two functions for GNU bc in a Bash script. BC_CEIL="define ceil(x) { if (x>0) { if (x%1>0) return x+(1-(x%1)) else return x } else return -1*floor(-1*x) }\n" BC_FLOOR="define floor(x) { if (x>0) return x-(x%1) else return -1*ceil(-1*x) }\n" echo -e "scale=2"$BC_CEIL$BC_FLOOR"ceil(2.5)" | bc Both functions work fine in interactive bc. bc does not seem to allow multiple functions on one line separated by ; though, so I have to echo -n | bc with newlines at the end of each function. The above output is 2.5, not the expected 3.0 that I get if I type it into bc -i myself. It seems that bash calls bc for each line of echo output, rather than echo'ing it all to a single instance. Is there any workaround for this?

    Read the article

  • Dealing with UIImagePickerController to minimize memory useage

    - by Gordon Fontenot
    So, I have read the SO post on UIImagePickerController, UIImage, Memory and More, and I read the post on Memory Leak Problems with UIImagePickerController in iPhone. I have VASTLY increased my memory efficiency between these 2 posts, and I thank the OPs and the people that provided the answers. I just had a question on the answer provided in the Memory Leak question, which was (essentially): only have one instance of the controller throughout the programs runtime What would be the best way to go about this without causing memory leaks? Right now I am initiating it and releasing it on every use from within the view, and I am seeing exactly what the answer describes (Memory warnings and a crash after about 20 uses). Should I initiate the UIImagePickerController when I need it, but use a seperate class unrelated to the view to control it? How should I deal with releasing the controller if I do it this way?

    Read the article

  • extjs how to make a nested child using xTemplate when we don't know how deep is it?

    - by Ebo the gordon
    first, sorry if my english bad,.... in my script, variable tplData below is dynamic,... (lets say it generates from database) so, every chid, can have another child. and so on,.... now, i'm stack how to iteration it,.. var tplData = [{ name : 'Naomi White' },{ name : 'Yoko Ono' },{ name : 'John Smith', child : [{ name:'Michael (John\'s son)', child: [{ name : 'Brad (Michael\'s son,John\'s grand son)' },{ name : 'Brid (Michael\'s son,John\'s grand son)', child: [{ name:'Buddy (Brid\'s son,Michael\'s grand son)' }] },{ name : 'Brud (Michael\'s son,John\'s grand son)' }] }] }]; var myTpl = new Ext.XTemplate( '<tpl for=".">', '<div style="background-color: {color}; margin: 10px;">', '<b> Name :</b> {name}<br />', // how to make this over and over every child (while it has ) '<tpl if="typeof child !=\'undefined\'">', '<b> Child : </b>', '<tpl for="child">', '{name} <br />', '</tpl>', '</tpl>', /////////////////////////////////////// '</div>', '</tpl>' ); myTpl.compile(); myTpl.overwrite(document.body, tplData);

    Read the article

  • Properly declare delegation in Objective C (iPhone)

    - by Gordon Fontenot
    Ok, This has been explained a few times (I got most of the way there using this post on SO), but I am missing something. I am able to compile cleanly, and able to set the delegate as well as call methods from the delegate, but I'm getting a warning on build: No definition of protocol 'DetailViewControllerDelegate' is found I have a DetailViewController and a RootViewController only. I am calling a method in RootViewController from DetailViewController. I have the delegate set up as so: In RootViewController.h: #import "DetailViewController.h" @interface RootViewController : UITableViewController <NSFetchedResultsControllerDelegate, DetailViewControllerDelegate> //Error shows up here { //Some Stuff Here } //Some other stuff here @end In RootViewController.m I define the delegate when I create the view using detailViewController.delegate = self In DetailViewController.h: @protocol DetailViewControllerDelegate; #import "RootViewController.h" @interface DetailViewController : UITableViewController <UITextFieldDelegate> { id <DetailViewControllerDelegate> delegate; } @property (nonatomic, assign) id <DetailViewControllerDelegate> delegate; @end @protocol DetailViewControllerDelegate //some methods that reside in RootViewController.m @end I feel weird about declaring the protocol above the import in DetailViewController.h, but if I don't it doesn't build. Like I said, the methods are called fine, and there are no other errors going on. What am I missing here?

    Read the article

  • Straw Poll - K&R vs BSD

    - by Gordon Mackie JoanMiro
    No holy wars please - (ultimately a standardised and consistently-observed house-style on a project always wins out whatever is chosen), but I am genuinely interested in the preferences of people for K&R style formatting: public bool CompareObjects(object first, object second) { if (first == second) { return true; } else { return false; } } over BSD style: public bool CompareObjects(object first, object second) { if (first == second) { return true; } else { return false; } } K&R seems to be making a bit of a comeback recently (I'm an old programmer, so I've seen these things fluctuate); do people think K&R looks more professional, more cool, more readable, is compactness when viewing more important than extending the structure down the screen? Please use the 2 community wiki answers below to vote for K&R vs. BSD. Polls shouldn't earn rep for the first person that manages to type "BSD FTW!" My God! This question is nearly 2 years old and people are still down-voting it; ENOUGH!

    Read the article

  • Passing row from UIPickerView to integer CoreData attribute

    - by Gordon Fontenot
    I'm missing something here, and feeling like an idiot about it. I'm using a UIPickerView in my app, and I need to assign the row number to a 32-bit integer attribute for a Core Data object. To do this, I am using this method: -(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { object.integerValue = row; } This is giving me a warning: warning: passing argument 1 of 'setIntegerValue:' makes pointer from integer without a cast What am I mixing up here? --EDIT 1-- Ok, so I can get rid of the errors by changing the method to do the following: NSNumber *number = [NSNumber numberWithInteger:row]; object.integerValue = rating; However, I still get a value of 0 for object.integerValue if I use NSLog to print it out. object.integerValue has a max value of 5, so I print out number instead, and then I'm getting a number above 62,000,000. Which doesn't seem right to me, since there are 5 rows. If I NSLog the row variable, I get a number between 0 and 5. So why do I end up with a completely different number after casting the number to NSNumber?

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >