Search Results

Search found 3479 results on 140 pages for 'chris hiester'.

Page 103/140 | < Previous Page | 99 100 101 102 103 104 105 106 107 108 109 110  | Next Page >

  • What is the '^' in Objective-C

    - by Chris Paterson
    What does the '^' mean in the code below? @implementation AppController - (IBAction) loadComposition:(id)sender { void (^handler)(NSInteger); NSOpenPanel *panel = [NSOpenPanel openPanel]; [panel setAllowedFileTypes:[NSArray arrayWithObjects: @"qtz", nil]]; handler = ^(NSInteger result) { if (result == NSFileHandlingPanelOKButton) { NSString *filePath = [[[panel URLs] objectAtIndex:0] path]; if (![qcView loadCompositionFromFile:filePath]) { NSLog(@"Could not load composition"); } } }; [panel beginSheetModalForWindow:qcWindow completionHandler:handler]; } @end === I've searched and searched - is it some sort of particular reference to memory?

    Read the article

  • If free() knows the length of my array, why can't I ask for it in my own code?

    - by Chris Cooper
    I know that it's a common convention to pass the length of dynamically allocated arrays to functions that manipulate them: void initializeAndFree(int* anArray, int length); int main(){ int arrayLength = 0; scanf("%d", &arrayLength); int* myArray = (int*)malloc(sizeof(int)*arrayLength); initializeAndFree(myArray, arrayLength); } void initializeAndFree(int* anArray, int length){ int i = 0; for (i = 0; i < length; i++) { anArray[i] = 0; } free(anArray); } but if there's no way for me to get the length of the allocated memory from a pointer, how does free() "automagically" know what to deallocate? Why can't I get in on the magic, as a C programmer? Where does free() get its free (har-har) knowledge from?

    Read the article

  • Changing output of Forms with Struts+Freemarker

    - by Chris
    I'm working on a Website with Struts2 and Freemarker. Whenever I add form tags such as: <@s.form action="foo" <@s.combobox (...)/ It generates a bunch of html/css/javascript that I don't need. Is there any way I can specify that no extra elements should be generated or do I really need to go into Freemarker.jar and edit the templates to my liking?

    Read the article

  • where can I find a good ruby excel parser that also had good documentation?

    - by Chris Drappier
    Hi All, I've spent some time today looking for a pure ruby library that will parse an excel workbook. I could find the parseexcel gem in the repos, but the problem is that I can't find any documentation on it. and the rdoc is pitiful. so, my question is 1) is there good documentation out there for this gem? 2) if not, is there another gem that does the same thing that has good documentation? thx :) -C

    Read the article

  • CoreData is saving model without the save: method being called

    - by chris
    I have a list of items with a plus button in the navigation bar that opens up a modal window containing a table of the models attributes, that displays a form when the table items are clicked (pretty standard form style). For some reason if I click the plus button to open the form to create a new model, then immediately click the done button, the person model is saved. The action linked to the done button does nothing but call on a delegate method notifying the personListViewController to close the window. The apple docs do state that the model is not saved after calling the insertNewObjectForEntityName: ... Simply creating a managed object does not cause it to be saved to a persistent store. The managed object context acts as a scratchpad. I am at a lost to why this is happening, but every time I click the done button I have a new blank item in the original tableView. I am using SDK v3.1.3 // PersonListViewController - open modal window - (void)addPerson { // Load the new form PersonNewViewController *newController = [[PersonNewViewController alloc] init]; newController.modalFormDelegate = self; [self presentModalViewController:newController animated:YES]; [newController release]; } // PersonFormViewController - (void)viewDidLoad { [super viewDidLoad]; if ( person == nil ) { MyAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate]; self.person = [NSEntityDescription insertNewObjectForEntityForName:@"Person" inManagedObjectContext:appDelegate.managedObjectContext]; } ... UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(done)]; self.navigationItem.rightBarButtonItem = doneButton; [doneButton release]; } - (IBAction) done { [self.modalFormDelegate didCancel]; } // delegate method in the original listViewController - (void) didCancel { [self dismissModalViewControllerAnimated:YES]; }

    Read the article

  • Open an Emacs buffer when a command tries to open an editor in shell-mode

    - by Chris Conway
    I like to use Emacs' shell mode, but it has a few deficiencies. One of those is that it's not smart enough to open a new buffer when a shell command tries to invoke an editor. For example with the environment variable VISUAL set to vim I get the following from svn propedit: $ svn propedit svn:externals . "svn-prop.tmp" 2L, 149C[1;1H ~ [4;1H~ [5;1H~ [6;1H~ [7;1H~ ... (It may be hard to tell from the representation, but it's a horrible, ugly mess.) With VISUAL set to "emacs -nw", I get $ svn propedit svn:externals . emacs: Terminal type "dumb" is not powerful enough to run Emacs. It lacks the ability to position the cursor. If that is not the actual type of terminal you have, use the Bourne shell command `TERM=... export TERM' (C-shell: `setenv TERM ...') to specify the correct type. It may be necessary to do `unset TERMINFO' (C-shell: `unsetenv TERMINFO') as well.svn: system('emacs -nw svn-prop.tmp') returned 256 (It works with VISUAL set to just emacs, but only from inside an Emacs X window, not inside a terminal session.) Is there a way to get shell mode to do the right thing here and open up a new buffer on behalf of the command line process?

    Read the article

  • How can I copy an XmlNode from one XmlDocument to another?

    - by Chris Wenham
    I'm building a tool that authors/edits XML files, and I want to be able to populate it with template fragments defined in another XML file. For example, the tool has an "Add FooBarBaz Element" button that adds a element to the new document being created, and I want to add FooBarBaz by copying it from a template. Or let's say this is my template file: <Templates> <FooBarBaz Attribute="Value"> <ChildElement/> </FooBarBaz> </Templates> I can then grab a template fragment with .GetElementsByTagName("FooBarBaz"), and I'd like to be able to inject it into the new document with something like .AppendChild(templateNode). But the problem is that an XmlNode cannot be copied from one XmlDocument to another, even if you use .Clone() or .CloneNode(), because AppendChild() throws an exception saying that the template element belongs to another context. Is there an easy way to copy a System.Xml.XmlNode between System.Xml.XmlDocuments?

    Read the article

  • Interview Question: .Any() vs if (.Length > 0) for testing if a collection has elements

    - by Chris
    In a recent interview I was asked what the difference between .Any() and .Length > 0 was and why I would use either when testing to see if a collection had elements. This threw me a little as it seems a little obvious but feel I may be missing something. I suggested that you use .Length when you simply need to know that a collection has elements and .Any() when you wish to filter the results. Presumably .Any() takes a performance hit too as it has to do a loop / query internally.

    Read the article

  • Rails: translate ActiveRecord error template headers for a single model

    - by Chris
    Hi, I'm trying to rename the authlogic error messages in a Rails 3 app. The general format I found out working in Rails 3: de: errors: template: header: one: "Konnte {{model}} nicht speichern: ein Fehler." other: "Konnte {{model}} nicht speichern: {{count}} Fehler." body: "Bitte überprüfen Sie die folgenden Felder: But I want to change this for the authlogic user session model (and only for this one) because when the Login fails, the message "Could not save user session" does not make very much sense. How can I do that?

    Read the article

  • PHP Using session variables in array(s)

    - by Chris
    Hello, My question is how do i put these session variables into a array? I have tried countless ways but none of them work. Not really sure what to put in a array and what no and how to adress them. Currently when i fill in the form the data gets displayed in a table. Next when i press the hyperlink that takes me back to the same form, i wish to enter data again. This data should be added in a new row in the same display table. Best Regards. The code below (pardon me that it is not english). <?php session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-Strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>ExpoFormulier</title> <body> <?php if (!empty($_POST)) { $standnaam = $_POST["standnaam"]; $oppervlakte = $_POST["oppervlakte"]; //value in the form van checkboxes op 1 zetten! $verdieping = isset($_POST["verdieping"]) ? $_POST["verdieping"] : 0; $telefoon = isset($_POST["telefoon"]) ? $_POST["telefoon"] : 0; $netwerk = isset($_POST["netwerk"]) ? $_POST["netwerk"] : 0; if (is_numeric($oppervlakte)) { $_SESSION["standnaam"]=$standnaam; $_SESSION["oppervlakte"]=$oppervlakte; $_SESSION["verdieping"]=$verdieping; $_SESSION["telefoon"]=$telefoon; $_SESSION["netwerk"]=$netwerk; header("Location:ExpoOverzicht.php"); } else { echo "<h1>Foute gegevens, Opnieuw invullen a.u.b</h1>"; } } ?> <form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post" id="form1"> <h1>Vul de gegevens in</h1> <table> <tr> <td>Standnaam:</td> <td><input type="text" name="standnaam" size="18"/></td> </tr> <tr> <td>Oppervlakte (in m^2):</td> <td><input type="text" name="oppervlakte" size="6"/></td> </tr> <tr> <td>Verdieping:</td> <td><input type="checkbox" name="verdieping" value="1"/></td> </tr> <tr> <td>Telefoon:</td> <td><input type="checkbox" name="telefoon" value="1"/></td> </tr> <tr> <td>Netwerk:</td> <td><input type="checkbox" name="netwerk" value="1"/></td> </tr> <tr> <td><input type="submit" name="verzenden" value="Verzenden"/></td> </tr> </table> </form> Second File: <?php session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-Strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>ExpoOverzicht</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link href="StyleSheetExpo.css" rel="stylesheet" type="text/css" /> </head> <body> <h1>Overzicht van de ingegeven standen in deze sessie</h1> <?php $standnaam = $_SESSION["standnaam"]; $oppervlakte = $_SESSION["oppervlakte"]; $verdieping = $_SESSION["verdieping"]; $telefoon = $_SESSION["telefoon"]; $netwerk = $_SESSION["netwerk"]; $result1 = 0; $result2 = 0; $result3 = 0; $prijsCom = 0; $prijsVerdieping = 0; for ($i=1; $i <= $oppervlakte; $i++) { if($i <= 10) { $tarief1 = 1 * 100; $result1 += $tarief1; } if($i > 10 && $i <= 30) { $tarief2 = 1 * 90; $result2 += $tarief2; } if($i > 30) { $tarief3 = 1 * 80; $result3 += $tarief3; } } $prijsOpp = $result1 + $result2 + $result3; if($verdieping == 1) { $prijsVerdieping = $oppervlakte * 120; } if(($telefoon == 1) || ($netwerk == 1)) { $prijsCom = 20; } if(($telefoon == 1) && ($netwerk == 1)) { $prijsCom = 30; } $totalePrijs = $prijsOpp + $prijsVerdieping + $prijsCom; echo "<table class=\"tableExpo\">"; echo "<th>Standnaam</th>"; echo "<th>Oppervlakte</th>"; echo "<th>Verdieping</th>"; echo "<th>Telefoon</th>"; echo "<th>Netwerk</th>"; echo "<th>Totale prijs</th>"; echo "<tr>"; echo "<td>".$standnaam."</td>"; echo "<td>".$oppervlakte."</td>"; echo "<td>".$verdieping."</td>"; echo "<td>".$telefoon."</td>"; echo "<td>".$netwerk."</td>"; echo "<td>".$totalePrijs."</td>"; echo "</tr>"; echo "</table>"; ?> <a href="ExpoFormulier.php">Terug naar het formulier</a> </body> </html> </body> </html>

    Read the article

  • Why is image_hash empty for some ad_creatives? Is it because it is expired?

    - by Chris Conner
    I ran _"https://graph.facebook.com/act_47121778/adcreatives?access_token=_ and got the following results. Why are some creatives returning empty image hash? { "view_tag": "", "alt_view_tags": [ ], "creative_id": "6002716206572", "type": 1, "title": "Grow your fans!", "body": "Fan Page Owners! Grow your fanbase. Create quizzes for your page. Win $100 Weekly. Make money with our revenue share program.", "image_hash": "6ac30e43f21c8580361de92d3288ed68", "link_url": "http://www.facebook.com/quizwriter?sk=app_81434956828", "name": "Grow your fans!", "run_status": 1, "preview_url": "http://www.facebook.com/ads/api/creative_preview.php?cid=6002716206572", "count_current_adgroups": 1, "id": "6002716206572", "image_url": "http://creative.ak.fbcdn.net/v41818/flyers/109/44/1296329249810543669_1_31eb15ed.jpg" }, { "view_tag": "", "alt_view_tags": [ ], "creative_id": "6002444043572", "type": 1, "title": "Tennis Champs Social Game", "body": "Tennis Champ! Start with 5,000 dollars , beat out other players with your mad tennis skills and become the tennis champ! Socialize!", "image_hash": "", "link_url": "334886511760", "name": "Tennis Champs Social Game", "run_status": 1, "preview_url": "http://www.facebook.com/ads/api/creative_preview.php?cid=6002444043572", "count_current_adgroups": 2, "id": "6002444043572" },

    Read the article

  • Using UNC path as paths location in Mecurial IIS6 Server2003

    - by Chris M
    I'm running the latest Mercurial and Python 2.6; IIS6 is using the wildcard ISAPI method to attach the site to the Mecurial hgwebdir_wsgi [paths] \ = \\COMP3254\TestRepo\* [web] baseurl = / allow_push = * push_ssl = false style = monoblue The setup works perfectly if I reference the local drive E:\repo* but doesnt work if I specify the network as above; I've given the server (MERCDEV01$) full permissions on the shared folder on COMP3254, I can't think of any other reason it wouldn't work. Any ideas?

    Read the article

  • C# Recursion SumOfOnlyNeg Elements

    - by Chris
    Hello, A array gets filled up with random elements (negative and positive). Now i want to calculate the sum of ONLY the postive elements. Iterative there is no problem, but in the recursion version i can only get the sum of both negative and postive. How can i "check" in the recursive version that it only sums up the Postive elements? Best Regards. Iterative version: public int IterSomPosElem(int[] tabel, int n) { n = 0; for (int i = 0; i < tabel.Length; i++) { if (tabel[i] >= 0) { n += tabel[i]; } } return n; } Recursive version atm (sums up all the elements insteed, of only the positive) public int RecuSomPosElem(int[] tabel, int n) { if(n == 1) return tabel[0]; //stopCriterium else { return (tabel[n - 1] + RecuSomPosElem(tabel, n - 1)); // how to check, so it only sums up the postive elements and "ignores" the negative elements. } }

    Read the article

  • Merge Primary Keys - Cascade Update

    - by Chris Jackson
    Is there a way to merge two primary keys into one and then cascade update all affected relationships? Here's the scenario: Customers (idCustomer int PK, Company varchar(50), etc) CustomerContacts (idCustomerContact int PK, idCustomer int FK, Name varchar(50), etc) CustomerNotes (idCustomerNote int PK, idCustomer int FK, Note Text, etc) Sometimes customers need to be merged into one. For example, you have a customer with the id of 1 and another with the id of 2. You want to merge both, so that everything that was 2 is now 1. I know I could write a script that updates all affected tables one by one, but I'd like to make it more future proof by using the cascade rules, so I don't have to update the script every time there is a new relationship added. Any ideas?

    Read the article

  • Avoiding configSections in .NET app.config files

    - by Chris Clark
    I'm looking for a way to avoid declaring my configuration section in the configSections inside the App.config file. Basically, I want to specify my configuration information just like I do for built-in .NET systems. For instance, when configuring WCF, I just put stuff in the <system.serviceModel>, I don't have to declare a section in the configSections up top. The same thing applies for <system.diagnostics> and many other namespaces. I know I could just load it up as an XML file and parse through it, but I'd prefer to stick with the pattern if possible. Moreover, looking at the WCF configuration with Reflector, I notice that it uses the same configuration subsystem (defined in System.Configuration). If you're wondering why this is important, it's because it's confusing our IT people. If it were self contained in one place, it would be much easier on them. I also realize I'll lose the ability to have multiple of the same section type, but that's not important in our case.

    Read the article

  • The remote server returned an error: (407) Proxy Authentication Required

    - by chris
    I'm getting this error when I call a web service: "The remote server returned an error: (407) Proxy Authentication Required". I get the general idea and I can get the code to work by adding myProxy.Credentials= NetworkCredential("user", "password", "domain"); or by using DefaultCredentials in code. My problem is that the call to the web service works in production without this. It seems like there is a non code solution involving Machine.config, but what is it? At the moment I can't get to the production boxes machine.config file to see what that looks like. I tried updating my machine.config as follows, but I still get the 407 error.

    Read the article

  • PHP include doesn't work

    - by Chris
    I'm not sure how simple is this to solve, but I assume I'm doing something wrong. I'm new to PHP, so bear with me, please. When I started learning PHP, I always placed all my project files into the same folder along with index.php and thus included everything like this: <?php include('./translation.php'); ?> Later on in the process of learning as I gained experience and my skill increased, I had to start using folders and place my files into sub folders. I ended up successfully including my files with the following: <?php include('../translation.php'); ?> My trouble-free coding took an unexpected turn when I decided to start using sub-sub folders. After placing all the files even deeper into the file structure I was shocked to find out that I cannot include them anymore, using: <?php include('.../translation.php'); ?> Now I'm lost. What did I do wrong? Am I to understand that I cannot include files deeper than 2 directories in the project? Should I start using a different file system?

    Read the article

  • C# Finding 2 positions 1-dimArray

    - by Chris
    Hello, In a method i am calculating the longest row of elements. The 1-dim array is filled up with random values (0 or 1). The method looks up the longest row (being 0 or 1, whatever is the longest). Meaning in for example: 1110100 --> the longest row would be 3 (3 * 1) 0110000 --> the longest row would be 4 (4 * 0) My problem is i am trying to perform some type of linear search to show the position of the row in the array. The first example has the longest row of 3 elements (3 times 1). For 1110100 the position in the array would be 0 - 2 (index) For 0110000 the position in the array would be 3 - 6 (index) I have been trying with foreaches, for loops etc..but i cannot seem to get the proper indexes of both. Cannot seem to display both positions properly. For the first example the correct output wouldbe: The largest row of same elements of the array consists of 3 elements on the position 0 - 2. The longest row of elements gets of same elements get calculated as the following: public int BerekenDeelrij (int [] table) ( int count = 0; final int value = 0; int largest = 0; foreach (int value in table) ( if (value == last value) counter + +; else ( largest = Math.Max largest (largest, counter); final value = value count = 1; ) ) Math.Max return (largest, counter); ) Best Regards.

    Read the article

  • CakePHP model useTable with SQL Views

    - by Chris
    I'm in the process converting our CakePHP-built website from Pervasive to SQL Server 2005. After a lot of hassle the setup I've gotten to work is using the ADODB driver with 'connect' as odbc_mssql. This connects to our database and builds the SQL queries just fine. However, here's the rub: one of our Models was associated with an SQL view in Pervasive. I ported over the view, but it appears using the set up that I have that CakePHP can't find the View in SQL Server. Couldn't find much after some Google searches - has anyone else run into a problem like this? Is there a solution/workaround, or is there some redesign in my future?

    Read the article

  • Modules vs. Classes and their influence on descendants of ActiveRecord::Base

    - by Chris
    Here's a Ruby OO head scratcher for ya, brought about by this Rails scenario: class Product < ActiveRecord::Base has_many(:prices) # define private helper methods end module PrintProduct attr_accessor(:isbn) # override methods in ActiveRecord::Base end class Book < Product include PrintProduct end Product is the base class of all products. Books are kept in the products table via STI. The PrintProduct module brings some common behavior and state to descendants of Product. Book is used inside fields_for blocks in views. This works for me, but I found some odd behavior: After form submission, inside my controller, if I call a method on a book that is defined in PrintProduct, and that method calls a helper method defined in Product, which in turn calls the prices method defined by has_many, I'll get an error complaining that Book#prices is not found. Why is that? Book is a direct descendant of Product! More interesting is the following.. As I developed this hierarchy PrintProduct started to become more of an abstract ActiveRecord::Base, so I thought it prudent to redefine everything as such: class Product < ActiveRecord::Base end class PrintProduct < Product end class Book < PrintProduct end All method definitions, etc. are the same. In this case, however, my web form won't load because the attributes defined by attr_accessor (which are "virtual attributes" referenced by the form but not persisted in the DB) aren't found. I'll get an error saying that there is no method Book#isbn. Why is that?? I can't see a reason why the attr_accessor attributes are not found inside my form's fields_for block when PrintProduct is a class, but they are found when PrintProduct is a Module. Any insight would be appreciated. I'm dying to know why these errors are occurring!

    Read the article

< Previous Page | 99 100 101 102 103 104 105 106 107 108 109 110  | Next Page >