Search Results

Search found 1497 results on 60 pages for 'martin gordon'.

Page 7/60 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Loading the target of a link in a <DIV> via jQuery's .live event into the same <DIV>??

    - by Martin Pescador
    Hello together I call a certain div from another page with jquery to be loaded into a div on my main page like this: <script type="text/javascript"> $("#scotland").load("http://www.example.com/scotland .gallery"); </script> <div id="scotland"></div> The div I call is a piece of code which is automatically generated by a CMS made simple module, by the way. Now it comes to my problem: The .gallery div I call, looks, a little simplified, like this: <div class="gallery"> <span><img src="http://www.example.com/scotlandimage1.jpg"></span> <span class="imgnavi"><a href="link_to_next_page_with_one_image">Next image</href></span> </div> I want the "next image"-link to load the next page into the .gallery div (it is always a page with one image on it). But what it does, is, it opens the new page http://www.example.com/scotland only. I tried to use jquerys .live event to load the linked page (that would be "scotlandimage2" and the navigation, as you can see in the upper part - not only the image!), but I must have done something wrong. I tried different ways, but never got it to work. This was my last try: $(".imgnavi a").click(function() { var myUrl = $(this).attr("href"); $(".gallery").load(myUrl); return false; }); I have to admit that I am very new to jquery... But does someone know what I did wrong (do I even follow the right handlers?)? Thanks very much in advance! Martin

    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

  • How to visualize a list of lists of lists of ... in R?

    - by Martin
    Hi there, I have a very deep list of lists in R. Now I want to print this list to the standard output to get a better overview of the elements. It should look like the way the StatET plugin for eclipse shows a list. Example list: l6 = list() l6[["h"]] = "one entry" l6[["g"]] = "nice" l5 = list() l5[["e"]] = l6 l4 = list() l4[["f"]] = "test" l4[["d"]] = l5 l3 = list() l3[["c"]] = l4 l2 = list() l2[["b"]] = l3 l1 = list() l1[["a"]] = l2 This should print like: List of 1 $ a:List of 1 ..$ b:List of 1 .. ..$ c:List of 2 .. .. ..$ f: chr "test" .. .. ..$ d:List of 1 .. .. .. ..$ e:List of 2 .. .. .. .. ..$ h: chr "one entry" .. .. .. .. ..$ g: chr "nice" I know this is possible with recursion and the deepness. But is there a way to do this with the help of rapply or something like that? Thanx in advance, Martin

    Read the article

  • Copy an entity in Google App Engine datastore in Python without knowing property names at 'compile'

    - by Gordon Worley
    In a Python Google App Engine app I'm writing, I have an entity stored in the datastore that I need to retrieve, make an exact copy of it (with the exception of the key), and then put this entity back in. How should I do this? In particular, are there any caveats or tricks I need to be aware of when doing this so that I get a copy of the sort I expect and not something else. ETA: Well, I tried it out and I did run into problems. I would like to make my copy in such a way that I don't have to know the names of the properties when I write the code. My thinking was to do this: #theThing = a particular entity we pull from the datastore with model Thing copyThing = Thing(user = user) for thingProperty in theThing.properties(): copyThing.__setattr__(thingProperty[0], thingProperty[1]) This executes without any errors... until I try to pull copyThing from the datastore, at which point I discover that all of the properties are set to None (with the exception of the user and key, obviously). So clearly this code is doing something, since it's replacing the defaults with None (all of the properties have a default value set), but not at all what I want. Suggestions?

    Read the article

  • Managing several hundred occurrences of NSLocalizedString

    - by Gordon Hughes
    My application has several hundred points of localisation, some of which can be reused many times. To prevent from hunting and pecking through code to find occurrences of a particular NSLocalizedString, I create a macro for each in a header file using the #define preprocessor directive. For example: #define kLocFirstString NSLocalizedString(@"Default Text", @"Comment") #define kLocSecondString NSLocalizedString(@"More Text", @"Another comment") ... When I want to refer to a particular string, I do so by its macro name. This method has been working nicely for me, but I'm concerned that such blatant abuse of #define is frowned upon. From the standpoint of "correctness", should I just inline each NSLocalizedString with the code, or is there another method (extern NSString *aString; perhaps?) that I can use to collect the declarations in one place?

    Read the article

  • Auto-generating toString Method

    - by Gordon
    Is it good or bad practice auto-generating toString methods for some simple classes? I was thinking of generating something like bellow where it takes the variable names and produces a toString method that prints the name followed by it's value. private String name; private int age; private double height; public String toString(){ Formatter formatter = new Formatter(); return formatter.format("Name: %s, Age: %d, Height %f", name, age, height).toString(); }

    Read the article

  • Creating a Cerificate for Bouncy Castle Encryption

    - by Gordon
    I am trying to create a self-signed certificate to use for encrypting an email using bouncycaste. What would be the best way to generate a certificate? I have tried using openssl but I have had problems with certificate. Here is the code I am using to encrypt, I am using 3des. SMIMEEnvelopedGenerator gen = new SMIMEEnvelopedGenerator(); gen.addKeyTransRecipient(x509Cert); // adds an X509Certificate MimeBodyPart encData = gen.generate(mimeBodyPart, SMIMEEnvelopedGenerator.DES_EDE3_CBC, "BC");

    Read the article

  • How do I reset a form in an ajax callback?

    - by B.Gordon
    I am sending a form using simple ajax and returning the results in a div above the form. The problem is that after the form is submitted and validated, I display a thank you and want to reset the form so they don't just press the submit button again... Can't seem to find the right code to do this... <form id="myForm" target="sendemail.php" method="post"> <div id="results"></div> <input type="text" name="value1"> <input type="text" name="value2"> <input type="submit" name="submit"> </form> So, my sendemail.php validation errors and success messages appear in #results without problems. But... when I try to send back a javascript form reset command, it does not work. Naturally I cannot see it in the source code since it is an AJAX callback so I don't know if that is the issue or if I am just using the wrong syntax. echo "<p>Thank you. Your message has been accepted for delivery.</p>"; echo "<script type=\"text/javascript\">setTimeout('document.getElementById('myForm').reset();',1000);</script>"; Any ideas gurus?

    Read the article

  • Using trace and dbg in Erlang

    - by Gordon Guthrie
    I am trying to start using erlang:trace/3 and the dbg module to trace the behaviour of a live production system without taking the server down. The documentation is opaque (to put it mildly) and there don't appear to be any useful tutorials online. What I spent all day trying to do was capture what was happening in a particular function by trying to apply a trace to module:function using dbg:c and dbg:p but with no success at all... Does anyone have a succinct explanation of how to use trace in a live Erlang system?

    Read the article

  • Why does ANTLR not parse the entire input?

    - by Martin Wiboe
    Hello, I am quite new to ANTLR, so this is likely a simple question. I have defined a simple grammar which is supposed to include arithmetic expressions with numbers and identifiers (strings that start with a letter and continue with one or more letters or numbers.) The grammar looks as follows: grammar while; @lexer::header { package ConFreeG; } @header { package ConFreeG; import ConFreeG.IR.*; } @parser::members { } arith: term | '(' arith ( '-' | '+' | '*' ) arith ')' ; term returns [AExpr a]: NUM { int n = Integer.parseInt($NUM.text); a = new Num(n); } | IDENT { a = new Var($IDENT.text); } ; fragment LOWER : ('a'..'z'); fragment UPPER : ('A'..'Z'); fragment NONNULL : ('1'..'9'); fragment NUMBER : ('0' | NONNULL); IDENT : ( LOWER | UPPER ) ( LOWER | UPPER | NUMBER )*; NUM : '0' | NONNULL NUMBER*; fragment NEWLINE:'\r'? '\n'; WHITESPACE : ( ' ' | '\t' | NEWLINE )+ { $channel=HIDDEN; }; I am using ANTLR v3 with the ANTLR IDE Eclipse plugin. When I parse the expression (8 + a45) using the interpreter, only part of the parse tree is generated: http://imgur.com/iBaEC.png Why does the second term (a45) not get parsed? The same happens if both terms are numbers. Thank you, Martin Wiboe

    Read the article

  • Code Access Security and Sharepoint WebParts

    - by Gordon Carpenter-Thompson
    I've got a vague handle on how Code Access Security works in Sharepoint. I have developed a custom webpart and setup a CAS policy in my Manifest <CodeAccessSecurity> <PolicyItem> <PermissionSet class="NamedPermissionSet" version="1" Description="Permission set for Okana"> <IPermission class="Microsoft.SharePoint.Security.SharePointPermission, Microsoft.SharePoint.Security, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" version="1" ObjectModel="True" Impersonate="True" /> <IPermission class="SecurityPermission" version="1" Flags="Assertion, Execution, ControlThread, ControlPrincipal, RemotingConfiguration" /> <IPermission class="AspNetHostingPermission" version="1" Level="Medium" /> <IPermission class="DnsPermission" version="1" Unrestricted="true" /> <IPermission class="EventLogPermission" version="1" Unrestricted="true"> <Machine name="localhost" access="Administer" /> </IPermission> <IPermission class="EnvironmentPermission" version="1" Unrestricted="true" /> <IPermission class="System.Configuration.ConfigurationPermission, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" version="1" Unrestricted="true"/> <IPermission class="System.Net.WebPermission, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" /> <IPermission class="System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Unrestricted="true" /> <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" PathDiscovery="*AllFiles*" /> <IPermission class="IsolatedStorageFilePermission" version="1" Allowed="AssemblyIsolationByUser" UserQuota="9223372036854775807" /> <IPermission class="PrintingPermission" version="1" Level="DefaultPrinting" /> <IPermission class="PerformanceCounterPermission" version="1"> <Machine name="localhost"> <Category name="Enterprise Library Caching Counters" access="Write"/> <Category name="Enterprise Library Cryptography Counters" access="Write"/> <Category name="Enterprise Library Data Counters" access="Write"/> <Category name="Enterprise Library Exception Handling Counters" access="Write"/> <Category name="Enterprise Library Logging Counters" access="Write"/> <Category name="Enterprise Library Security Counters" access="Write"/> </Machine> </IPermission> <IPermission class="ReflectionPermission" version="1" Unrestricted="true"/> <IPermission class="SecurityPermission" version="1" Flags="SerializationFormatter, UnmanagedCode, Infrastructure, Assertion, Execution, ControlThread, ControlPrincipal, RemotingConfiguration, ControlAppDomain,ControlDomainPolicy" /> <IPermission class="SharePointPermission" version="1" ObjectModel="True" /> <IPermission class="SmtpPermission" version="1" Access="Connect" /> <IPermission class="SqlClientPermission" version="1" Unrestricted="true"/> <IPermission class="WebPartPermission" version="1" Connections="True" /> <IPermission class="WebPermission" version="1"> <ConnectAccess> <URI uri="$OriginHost$"/> </ConnectAccess> </IPermission> </PermissionSet> <Assemblies> .... </Assemblies> This is correctly converted into a wss_custom_wss_minimaltrust.config when it is deployed onto the Sharepoint server and mostly works. To get the WebPart working fully, however I find that I need to modify the wss_custom_wss_minimaltrust.config by hand after deployment and set Unrestricted="true" on the permissions set <PermissionSet class="NamedPermissionSet" version="1" Description="Permission set for MyApp" Name="mywebparts.wsp-86d8cae1-7db2-4057-8c17-dc551adb17a2-1"> to <PermissionSet class="NamedPermissionSet" version="1" Description="Permission set for MyApp" Name="mywebparts.wsp-86d8cae1-7db2-4057-8c17-dc551adb17a2-1" Unrestricted="true"> It's all because I'm loading a User Control from the webpart. I don't believe there is a way to enable that using CAS but am willing to be proven wrong. Is there a way to set something in the manifest so I don't need to make this fix by hand? Thanks

    Read the article

  • Java OutOfMemoryError message changes when trying to create Arrays of different sizes

    - by Gordon
    In the question by DKSRathore How to simulate the Out Of memory : Requested array size exceeds VM limit some odd behavior was noted when creating an arrays. When creating an array of size Integer.MAX_VALUE an exception with the error java.lang.OutOfMemoryError Requested array size exceeds VM limit was thrown. However when an array was created with a size less than the max but still above the virtual machine memory limit the error message read java.lang.OutOfMemoryError: Java heap space. Testing further I managed to narrow down where the error messages changes. long[] l = new long[2147483645]; exceptions message reads - Requested array size exceeds VM limit long[] l = new long[2147483644]; exceptions message reads - Java heap space errors I increased my virtual machine memory and still produced the same result. Has anyone any idea why this happens? Some extra info: Integer.MAX_VALUE = 2147483647. Edit: Here's the code I used to find the value, might be helpful. int max = Integer.MAX_VALUE; boolean done = false; while (!done) { try { max--; // Throws an error long[] l = new long[max]; // Exit if an error is no longer thrown done = true; } catch (OutOfMemoryError e) { if (!e.getMessage().contains("Requested array size exceeds VM limit")) { System.out.println("Message changes at " + max); done = true; } } }

    Read the article

  • Oracle syntax - should we have to choose between the old and the new?

    - by Martin Milan
    Hi, I work on a code base in the region of about 1'000'000 lines of source, in a team of around eight developers. Our code is basically an application using an Oracle database, but the code has evolved over time (we have plenty of source code from the mid nineties in there!). A dispute has arisen amongst the team over the syntax that we are using for querying the Oracle database. At the moment, the overwhelming majority of our queries use the "old" Oracle Syntax for joins, meaning we have code that looks like this... Example of Inner Join select customers.*, orders.date, orders.value from customers, orders where customers.custid = orders.custid Example of Outer Join select customers.custid, contacts.ContactName, contacts.ContactTelNo from customers, contacts where customers.custid = contacts.custid(+) As new developers have joined the team, we have noticed that some of them seem to prefer using SQL-92 queries, like this: Example of Inner Join select customers.*, orders.date, orders.value from customers inner join orders on (customers.custid = orders.custid) Example of Outer Join select customers.custid, contacts.ContactName, contacts.ContactTelNo from customers left join contacts on (customers.custid = contacts.custid) Group A say that everyone should be using the the "old" syntax - we have lots of code in this format, and we ought to value consistency. We don't have time to go all the way through the code now rewriting database queries, and it wouldn't pay us if we had. They also point out that "this is the way we've always done it, and we're comfortable with it..." Group B however say that they agree that we don't have the time to go back and change existing queries, we really ought to be adopting the "new" syntax on code that we write from here on in. They say that developers only really look at a single query at a time, and that so long as developers know both syntax there is nothing to be gained from rigidly sticking to the old syntax, which might be deprecated at some point in the future. Without declaring with which group my loyalties lie, I am interested in hearing the opinions of impartial observers - so let the games commence! Martin. Ps. I've made this a community wiki so as not to be seen as just blatantly chasing after question points...

    Read the article

  • Correct way of setting a custom FileInfo class to an Iterator

    - by Gordon
    I am trying to set a custom class to an Iterator through the setInfoClass method: Use this method to set a custom class which will be used when getFileInfo and getPathInfo are called. The class name passed to this method must be derived from SplFileInfo. My class is like this (simplified example): class MyFileInfo extends SplFileInfo { public $props = array( 'foo' => '1', 'bar' => '2' ); } The iterator code is this: $rit = new RecursiveIteratorIterator( new RecursiveDirectoryIterator('/some/file/path/'), RecursiveIteratorIterator::SELF_FIRST); Since RecursiveDirectoryIterator is by inheritance through DirectoryIterator also an SplFileInfo object, it provides the setInfoClass method (it's not listed in the manual, but reflection shows it's there). Thus I can do: $rit->getInnerIterator()->setInfoClass('MyFileInfo'); All good up to here, but when iterating over the directory with foreach($rit as $file) { var_dump( $file ); } I get the following weird result object(MyFileInfo)#4 (3) { ["props"]=>UNKNOWN:0 ["pathName":"SplFileInfo":private]=>string(49) "/some/file/path/someFile.txt" ["fileName":"SplFileInfo":private]=>string(25) "someFile.txt" } So while MyFileInfo is picked up, I cannot access it's properties. If I add custom methods, I can invoke them fine, but any properties are UNKNOWN. If I don't set the info class to the iterator, but to the SplFileInfo object (like shown in the example in the manual), it will give the same UNKNOWN result: foreach($rit as $file) { // $file is a SplFileInfo instance $file->setInfoClass('MyFileInfo'); var_dump( $file->getFileInfo() ); } However, it will work when I do foreach($rit as $file) { $file = new MyFileInfo($file); var_dump( $file ); } Unfortunately, the code I a want to use this in is somewhat more complicated and stacks some more iterators. Creating the MyFileInfo class like this is not an option. So, does anyone know how to get this working or why PHP behaves this weird? Thanks.

    Read the article

  • UML Modelling in C++Builder 2010 Professional

    - by Gordon Brandly
    I'd like to do some basic class diagram UML models in the Pro version of C++Builder 2010. Embarcadero has a C++Builder Features Matrix document, one line of which says "UML Code Visualization – at any time, get a UML model view of your source code" and has a check in the "Professional" column of that table -- I assume this means it should be available to me. Yet, when I open an existing project and do a View | Model View, there's nothing in the Model View window. The only diagram I can find is on the Graph tab of the C++ Class Explorer. I wouldn't call that a UML diagram myself -- is that what Embarcadero is referring to? Embarcadero's table shows that many UML diagrams are not available in Pro, but it looks to me like Class Diagrams should be available. Other lines in that same table indicate that both "Full two-way class diagrams with synchronization between code and diagrams" and "Diagram hyper-linking and annotations" are also supposed to be available in Pro. The Class Explorer graph is one-way only as far as I can tell, so I hope they're referring to something else I haven't been able to find so far. Thanks for any insight into this.

    Read the article

  • Running an executable on network share with CustomAction with wix?

    - by martin
    Hello, i have created a msi-package which compresses some xml-files to a zip-file during installation. I have created a CustomAction for this purposes: <CustomAction Id="CompressMy" BinaryKey="zipEXE" ExeCommand="a -tzip &quot;[TEMPLATE_DIR]my.zip&quot; &quot;[TempSourceFolder]data.xml&quot;" Return="check" HideTarget="no" Impersonate="no" Execute="deferred" /> The installation works fine, if i try to install to a local drive, but recently a customer wanted to install [TEMPLATE_DIR] to a network drive on Windows Vista. The CustomAction fails, because of the elevated install-user hasn't mapped the network drive, even if the installer-calling user has mapped the drive. This happens also, if I try to install to an unc-path. I use 7zip for compressing. I have added it to my msi-package. I have tried to set Impersonate="yes", but then the Installations fails, if my TEMPLATE_DIR is f.e. the ProgramData-dir. Do you have any idea what i can do? I thinked about checking if TEMPLATE_DIR is a network path, but I didn't know how i can check this. Or do you have any other Ideas how I can provide a local and a network installation while using this custom action. Would be great if there are any advices, greetings, Martin

    Read the article

  • Fetching Core Data for Tableview on iPhone - Tutorial leaves me with crashes when adding items to a

    - by Gordon Fontenot
    Been following the Core Data tutorial on Apple's developer site, and all is good until I have to add something to the fetched store. I am getting this error after a successful build and load when I try to add a new item to the list: Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of rows in section 0. The number of rows contained in an existing section after the update (0) must be equal to the number of rows contained in that section before the update (0), plus or minus the number of rows inserted or deleted from that section (1 inserted, 0 deleted). Due to the fact that the fetch goes through fine, and that if I replace the fetching with eventList = [[NSMutableArray alloc] init] it works as expected (without persistance, of course), I am led to believe that the problem comes from not creating the Mutable Array correctly. Here's the problematic part of the code: NSFetchRequest *request = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"Event" inManagedObjectContext:managedObjectContext]; [request setEntity:entity]; NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"creationDate" ascending:NO]; NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil]; [request setSortDescriptors:sortDescriptors]; [sortDescriptors release]; [sortDescriptor release]; NSError *error; NSMutableArray *mutableFetchResults = [[managedObjectContext executeFetchRequest:request error:&error] mutableCopy]; if (mutableFetchResults = nil) { //Handle the error } [self setEventList:mutableFetchResults]; [mutableFetchResults release]; [request release]; I have tried switching the NSArrays in the second chunk out with NSMutableArrays, but I still get the same error. For reference, the section of code that is throwing the error when I try adding an entry is here: [eventList insertObject:event atIndex:0]; NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0]; [self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; [self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:YES]; it errors out at the insertRowsAtIndexPaths call. Thanks in advance for any help

    Read the article

  • How does a programmer think?

    - by Gordon Potter
    This may be a hopelessly vague question. But I am interested to hear whatever logical thought processes people go through when learning a new concept or trying to get their brain around code they might not have ever seen before. Basically, what general steps does one take to to break down problems and what does it take to "get it"? If you were to diagram a flowchart of how your mental process works when you look at code or try to solve a problem what might it look like? What common references, tips, and mental assumptions do you find useful in problem solving? How is this different between different domains? For example in what ways is a web programmer's thought process similar or different from a traditional desktop app developer's process?

    Read the article

  • How to access elements in a complex list?

    - by Martin
    Hi, it's me and the lists again. I have a nice list, which looks like this: tmp = NULL t = NULL tmp$resultitem$count = "1057230" tmp$resultitem$status = "Ok" tmp$resultitem$menu = "PubMed" tmp$resultitem$dbname = "pubmed" t$resultitem$count = "305215" t$resultitem$status = "Ok" t$resultitem$menu = "PMC" t$resultitem$dbname = "pmc" tmp = c(tmp, t) t = NULL t$resultitem$count = "1" t$resultitem$status = "Ok" t$resultitem$menu = "Journals" t$resultitem$dbname = "journals" tmp = c(tmp, t) Which produces: str(tmp) List of 3 $ resultitem:List of 4 ..$ count : chr "1057230" ..$ status: chr "Ok" ..$ menu : chr "PubMed" ..$ dbname: chr "pubmed" $ resultitem:List of 4 ..$ count : chr "305215" ..$ status: chr "Ok" ..$ menu : chr "PMC" ..$ dbname: chr "pmc" $ resultitem:List of 4 ..$ count : chr "1" ..$ status: chr "Ok" ..$ menu : chr "Journals" ..$ dbname: chr "journals" Now I want to search through the elements of each "resultitem". I want to know the "dbname" for every database, that has less then 10 "count" (example). In this case it is very easy, as this list only has 3 elements, but the real list is a little bit longer. This could be simply done with a for loop. But is there a way to do this with some other function of R (like rapply)? My problem with those apply functions is, that they only look at one element. If I do a grep to get all "dbname" elements, I can not get the count of each element. rapply(tmp, function(x) paste("Content: ", x))[grep("dbname", names(rapply(tmp, c)))] Does someone has a better idea than a for loop? Thanx, Martin

    Read the article

  • start-stop-daemon quoted arguments misinterpreted

    - by Martin Westin
    Hi, I have been trying to make an init script using start-stop-daemon. I am stuck on the arguments to the daemon. I want to keep these in a variable at the top of the script but I can't get the quotations to filter down correctly. I'll use ls here so we don't have to look at binaries and arguments that most people wont know or care about. The end result I am looking for is for start-stop... to run ls -la "/folder with space/" DAEMON=/usr/bin/ls DAEMON_OPTS='-la "/folder with space/"' start-stop-daemon --start --make-pidfile --pidfile $PID --exec $DAEMON -- $DAEMON_OPTS Double escaping the options and trying innumerable variations of quotations do not help... Then they end up at the daemon they are always messed up. Enclosing $DAEMON_OPTS in quotes changes things... then they are seen as one since quote... never the right number though :) Echoing the command-line (start-stop...) prints exactly the right stuff to screen. But the daemon (the real one, not ls) complains about the wrong number of arguments. How do I specify a variable so that quotes inside it are brought along to the daemon correctly? Thanks, Martin

    Read the article

  • This is a great job opportunity!!! [closed]

    - by Stuart Gordon
    ASP.NET MVC Web Developer / London / £450pd / £25-£50,000pa / Interested contact [email protected] ! As a web developer within the engineering department, you will work with a team of enthusiastic developers building a new ASP.NET MVC platform for online products utilising exciting cutting edge technologies and methodologies (elements of Agile, Scrum, Lean, Kanban and XP) as well as developing new stand-alone web products that conform to W3C standards. Key Responsibilities and Objectives: Develop ASP.NET MVC websites utilising Frameworks and enterprise search technology. Develop and expand content management and delivery solutions. Help maintain and extend existing products. Formulate ideas and visions for new products and services. Be a proactive part of the development team and provide support and assistance to others when required. Qualification/Experience Required: The ideal candidate will have a web development background and be educated to degree level in a Computer Science/IT related course plus ASP.NET MVC experience. The successful candidate needs to be able to demonstrate commercial experience in all or most of the following skills: Essential: ASP.NET MVC with C# (Visual Studio), Castle, nHibernate, XHTML and JavaScript. Experience of Test Driven Development (TDD) using tools such as NUnit. Preferable: Experience of Continuous Integration (TeamCity and MSBuild), SQL Server (T-SQL), experience of source control such as Subversion (plus TortioseSVN), JQuery. Learn: Fluent NHibernate, S#arp Architecture, Spark (View engine), Behaviour Driven Design (BDD) using MSpec. Furthermore, you will possess good working knowledge of W3C web standards, web usability, web accessibility and understand the basics of search engine optimisation (SEO). You will also be a quick learner, have good communication skills and be a self-motivated and organised individual.

    Read the article

  • FastCGI for C++

    - by Gordon
    I've found only two FastCGI libraries for C++. There's the "official" one, and fastcgi++. How is either one better than the other? Do any others exist?

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >