Search Results

Search found 8286 results on 332 pages for 'defined'.

Page 156/332 | < Previous Page | 152 153 154 155 156 157 158 159 160 161 162 163  | Next Page >

  • setIncludesSubentities: in an NSFetchRequest is broken for entities across multiple persistent store

    - by SG
    Prior art which doesn't quite address this: http://stackoverflow.com/questions/1774359/core-data-migration-error-message-model-does-not-contain-configuration-xyz I have narrowed this down to a specific issue. It takes a minute to set up, though; please bear with me. The gist of the issue is that a persistentStoreCoordinator (apparently) cannot preserve the part of an object graph where a managedObject is marked as a subentity of another when they are stored in different files. Here goes... 1) I have 2 xcdatamodel files, each containing a single entity. In runtime, when the managed object model is constructed, I manually define one entity as subentity of another using setSubentities:. This is because defining subentities across multiple files in the editor is not supported yet. I then return the complete model with modelByMergingModels. //Works! [mainEntity setSubentities:canvasEntities]; NSLog(@"confirm %@ is super for %@", [[[canvasEntities lastObject] superentity] name], [[canvasEntities lastObject] name]); //Output: "confirm Note is super for Browser" 2) I have modified the persistentStoreCoordinator method so that it sets a different store for each entity. Technically, it uses configurations, and each entity has one and only one configuration defined. //Also works! for ( NSString *configName in [[HACanvasPluginManager shared].registeredCanvasTypes valueForKey:@"viewControllerClassName"] ) { storeUrl = [NSURL fileURLWithPath:[[self applicationDocumentsDirectory] stringByAppendingPathComponent:[configName stringByAppendingPathExtension:@"sqlite"]]]; //NSLog(@"entities for configuration '%@': %@", configName, [[[self managedObjectModel] entitiesForConfiguration:configName] valueForKey:@"name"]); //Output: "entities for configuration 'HATextCanvasController': (Note)" //Output: "entities for configuration 'HAWebCanvasController': (Browser)" if (![persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:configName URL:storeUrl options:options error:&error]) //etc 3) I have a fetchRequest set for the parent entity, with setIncludesSubentities: and setAffectedStores: just to be sure we get both 1) and 2) covered. When inserting objects of either entity, they both are added to the context and they both are fetched by the fetchedResultsController and displayed in the tableView as expected. // Create the fetch request for the entity. NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; [fetchRequest setEntity:entity]; [fetchRequest setIncludesSubentities:YES]; //NECESSARY to fetch all canvas types [fetchRequest setSortDescriptors:sortDescriptors]; [fetchRequest setFetchBatchSize:20]; // Set the batch size to a suitable number. [fetchRequest setAffectedStores:[[managedObjectContext persistentStoreCoordinator] persistentStores]]; [fetchRequest setReturnsObjectsAsFaults:NO]; Here is where it starts misbehaving: after closing and relaunching the app, ONLY THE PARENT ENTITY is fetched. If I change the entity of the request using setEntity: to the entity for 'Note', all notes are fetched. If I change it to the entity for 'Browser', all the browsers are fetched. Let me reiterate that during the run in which an object is first inserted into the context, it will appear in the list. It is only after save and relaunch that a fetch request fails to traverse the hierarchy. Therefore, I can only conclude that it is the storage of the inheritance that is the problem. Let's recap why: - Both entities can be created, inserted into the context, and viewed, so the model is working - Both entities can be fetched with a single request, so the inheritance is working - I can confirm that the files are being stored separately and objects are going into their appropriate stores, so saving is working - Launching the app with either entity set for the request works, so retrieval from the store is working - This also means that traversing different stores with the request is working - By using a single store instead of multiple, the problem goes away completely, so creating, storing, fetching, viewing etc is working correctly. This leaves only one culprit (to my mind): the inheritance I'm setting with setSubentities: is effective only for objects creating during the session. Either objects/entities are being stored stripped of the inheritance info, or entity inheritance as defined programmatically only applies to new instances, or both. Either of these is unacceptable. Either it's a bug or I am way, way off course. I have been at this every which way for two days; any insight is greatly appreciated. The current workaround - just using a single store - works completely, except it won't be future-proof in the event that I remove one of the models from the app etc. It also boggles the mind because I can't see why you would have all this infrastructure for storing across multiple stores and for setting affected stores in fetch requests if it by core definition (of setSubentities:) doesn't work.

    Read the article

  • Nagios - Custom Report Generation

    - by Naveen
    Hi, I want to generate a custom report in "Nagios-3.2.0". I have defined the work-hours in "timeperiods.cfg" as follows: 'workhours' timeperiod definition define timeperiod { timeperiod_name 0800-2000 alias full time monday 08:00-20:00 tuesday 08:00-20:00 wednesday 08:00-20:00 thursday 08:00-20:00 friday 08:00-20:00 saturday 08:00-20:00 } Now, if I replace "saturday" with "2010-03-27" or "march 27" as shown below: 'workhours' timeperiod definition define timeperiod { timeperiod_name 0800-2000 alias full time monday 08:00-20:00 tuesday 08:00-20:00 wednesday 08:00-20:00 thursday 08:00-20:00 friday 08:00-20:00 2010-03-27 08:00-20:00 } Nagios is not generating report for the given date (2010-03-27). How can I modify "timeperiods.cfg" so that I can generate reports for the given dates ?

    Read the article

  • Casting a non-generic type to a generic one

    - by John Sheehan
    I've got this class: class Foo { public string Name { get; set; } } And this class class Foo<T> : Foo { public T Data { get; set; } } Here's what I want to do: public Foo<T> GetSome() { Foo foo = GetFoo(); Foo<T> foot = (Foo<T>)foo; foot.Data = GetData<T>(); return foot; } What's the easiest way to convert Foo to Foo<T>? I can't cast directly InvalidCastException) and I don't want to copy each property manually (in my actual use case, there's more than one property) if I don't have to. Is a user-defined type conversion the way to go?

    Read the article

  • How can I keep a WPF Image from blocking if the ImageSource references an unreachable Url?

    - by Corey O'Brien
    I'm writing a WPF application and trying to bind an image to my view model with the following XAML: <Image Source="{Binding Author.IconUrl, IsAsync=True}" /> The problem is that the image URLs are defined by users and can often refer to images hosted on intranet web servers. When the WPF application is run remotely, it locks up while trying to resolve the images that are now unreachable. I thought the "IsAsync" binding property would cause the load to happen in the background, but it appears that the DNS resolution may still happen in the main thread? What can I do to keep my app from locking, even if the images are unreachable? Thanks, Corey

    Read the article

  • Including non-standard C headers in C++

    - by Swaroop S
    I needed to include a few c headers ( non standard header files ) in my C++ code to be compiled by gcc. The C header (foo.h) has support for : #ifdef __cplusplus extern "C" { #endif and similarly at the end for }. The c++ code has the include "foo.h" I believe I should be able to just include the header (foo.h) and create instances of structs defined in the .h file. I am not able to compile the source code. It seems like the compiler looks at the c code as if it were c++ code. I see error such as error: expected constructor, destructor or type conversion before "(" Did I do something wrong ? I took advise from : http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html What else do i need to do, to tell the c++ compiler "expect and compile as c code" ?

    Read the article

  • UISearchBar animation hidding button

    - by David Carvalho
    Hello I currently have a UISearchBar (attached to a UISearchDisplayController), but I reduced the width of the search bar so I could display a custom button to its right when the search bar is not selected. The button is used to access other views. However, when I select the search bar and then press cancel (or even perform a search) and return to the normal view, where the search bar should be displayed with my custom button, the search bar animates and takes up all the room for the button and the is not displayed. Essentially, the search bar takes up all the width of the screen when I only want it to take up a part of it. Is there any way to prevent the search bar from animating to the whole width of the screen? This is how I defined the CGRect of the search bar: self = [[UISearchBar alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 250.0f, 45.0f)] Any help would be great. Regards

    Read the article

  • Copy Structure To Another Program

    - by Steven
    Long story, long: I am adding a web interface (ASPX.NET: VB) to a data acquisition system developed with LabVIEW which outputs raw data files. These raw data files are the binary representation of a LabVIEW cluster (essentially a structure). LabVIEW provides functions to instantiate a class or structure or call a method defined in a .NET DLL file. I plan to create a DLL file containing a structure definition and a class with methods to transfer the structure. When the webpage requests data, it would call a LabVIEW executable with a filename parameter. The LabVIEW code would instantiate the structure, populate the structure from the data file, then call the method to transfer the data back to the website. Long story, short: How do you recommend I transfer (copy) an instance of a structure from one .NET program to a VB.NET program? Ideas considered: sockets, temp file, xml file, config file, web services, CSV, some type of serialization, shared memory

    Read the article

  • Spreadsheet ML Text Color (Colour) Rendering

    - by Chris Roberts
    Hi All, I am writing a tool which generates some Spreadsheet ML (XML) to create an Excel spreadsheet for my users. I have defined a style as follows: <Style ss:ID="GreenText"> <Font ss:FontName="Arial" ss:Size="9" ss:Color="#8CBE50" /> </Style> This works to an extent, but when I open it in Excel the colour rendered for the text isn't the one I specified - it's a brighter version. I can use the same colour reference for a cell border and the colour is rendered correctly. Can anyone shed any light on why the text colour isn't rendered correctly? Thanks!

    Read the article

  • UnauthorizedAccessException cannot resolve Directory.GetFiles failure

    - by Ric Coles
    Hi all, Directory.GetFiles method fails on the first encounter with a folder it has no access rights to. The method throws an UnauthorizedAccessException (which can be caught) but by the time this is done, the method has already failed/terminated. The code I am using is listed below: try { // looks in stated directory and returns the path of all files found getFiles = Directory.GetFiles(@directoryToSearch, filetype, SearchOption.AllDirectories); } catch (UnauthorizedAccessException) { } As far as I am aware, there is no way to check beforehand whether a certain folder has access rights defined. In my example, I'm searching on a disk across a network and when I come across a root access only folder, my program fails. I have searched for a few days now for any sort of resolve, but this problem doesn't seem to be very prevalent on here or Google. I look forward to any suggestions you may have, Regards

    Read the article

  • JavaScript Intellisene Problem?

    - by James Wiseman
    I've got an issue with JavaScript intellisense in Visual Web Developer 2008, which I'm starting to believe is "just one of those things", but thought I'd ask here just to check. I have a file MyOtherFile.js with a function GetRandomNumber() defined like so: function GetRandomNumber() { /// <summary> /// Summary description for GetRandomNumber /// </summary> return Math.random(); } When I reference this from another file, screen.js (/// <reference path="MyOtherFile.js" />) I get the intellisense as expected with the summary text as above. If, however, I call the function GetRandomNumber from within its own file (MyOtherFile.js) then I don't get the sumamry description. Any thoughts? Thanks.

    Read the article

  • HTTP Cache Control max-age, must-revalidate

    - by nyb
    I have a couple of queries related to Cache-Control. If I specify Cache-Control "max-age=3600, must-revalidate" for a static html/js/images/css file, with Last Modified Header defined in HTTP header, a. Does browser/proxy cache(liek Squid/Akamai) go all the way to orgin server to validate before max-age expires? Or will it serve content from cache till max-age expires? b. After max-age expiry(that is expiry from cache), is there a IMS check or is content re-downloaded from origin server w/o IMS check?

    Read the article

  • macro returning length of arguments in C

    - by anon
    Is it possible to write a C macro that returns the length of its arguments? I want something that does: foo(1) -> 1 foo(cat, dog) -> 2 foo(red, green, blue) -> 3 Even better if this macro can be defined in such a way that it works with ## so that foo(1) -> bar1(1) foo(cat, dog) -> bar2(cat, dog) foo(red, green, blue) -> car3(red, green, blue) Thanks! EDIT: I really want a macro, not a function. Suggestions to use functions will be downvoted.

    Read the article

  • router connect configuration in cakephp 1.3

    - by Gaurav Sharma
    Hello everyone, I have defined the following rule in the router.php file of my cakephp 1.3 based application Router::connect('/tags/*',array('plugin' => 'tags', 'controller' => 'Tags', 'action' => 'index', 'admin' => false)); I have used the tags plugin. When I display the tags related to a topic then the URL on the tags appears something like this http://localhost/testapp/tags/Tags/view/{tag_key_name} I want to make this url for any action to tags plugin like this http://localhost/testapp/Tags/{action}/{tag_key_name} for (view, admin_view and admin_edit) and http://localhost/testapp/Tags/{action} for (index, admin_index and any other action that does not require an id or keyname for execution)

    Read the article

  • C# -Closure -Clarification

    - by nettguy
    I am learning C#.Can I mean closure as a construct that can adopt the changes in the environment in which it is defined. Example : List<Person> gurus = new List<Person>() { new Person{id=1,Name="Jon Skeet"}, new Person{id=2,Name="Marc Gravell"}, new Person{id=3,Name="Lasse"} }; void FindPersonByID(int id) { gurus.FindAll(delegate(Person x) { return x.id == id; }); } The variable id is declared in the scope of FindPersonByID() but t we still can access the local variable id inside the anonymous function (i.e) delegate(Person x) { return x.id == id; } (1) Is my understanding of closure is correct ? (2) What are the aditional advantages can we get from closures?

    Read the article

  • Possible typos in ECMAScript 5 specification?

    - by Andy West
    Does anybody know why, at the end of section 7.6 of the ECMA-262, 5th Edition specification, the nonterminals UnicodeLetter, UnicodeCombiningMark, UnicodeDigit, UnicodeconnectorPunctuation, and UnicodeEscapeSequence are not followed by two colons? From section 5.1.6: Nonterminal symbols are shown in italic type. The definition of a nonterminal is introduced by the name of the nonterminal being defined followed by one or more colons. (The number of colons indicates to which grammar the production belongs.) Since lexical productions are distinguished by having two colons, and this is under "Lexical Conventions", I'm assuming that they meant to put the colons in. Does that sound right? Just making sure that these really are nonterminals and they really are part of the lexical grammar. EDIT: I noticed there have been votes to close this. Just to make my case about why this is programming-related, it is relevant to anyone wanting to implement an ECMAScript interpreter.

    Read the article

  • struct assignment operator on arrays

    - by Django fan
    Suppose I defined a structure like this: struct person { char name [10]; int age; }; and declared two person variables: person Bob; person John; where Bob.name = "Bob", Bob.age = 30 and John.name = "John",John.age = 25. and I called Bob = John; struct person would do a Memberwise assignment and assign Johns's member values to Bob's. But arrays can't assign to arrays, so how does the assignment of the "name" array work?

    Read the article

  • Allocated memory address clash

    - by Louis
    Hi, i don't understand how this happen. This is portion of my code.. int isGoal(Node *node, int startNode){ int i; . . } When i debug this using gdb i found out that 'i' was allocated at the memory address that have been previously allocated. (gdb)print &node->path->next $26 = (struct intNode **) 0xffbff2f0 (gdb) print &i $22 = (int *) 0xffbff2f0 node-path-next has been already defined outside this function. But as u can see they share the same address which at some point make the pointer point to another place when the i counter is changed. I compiled it using gcc on solaris platform Any helps would be really appreciated..

    Read the article

  • Why is UIControlTouchUpInside UNDEFINED?

    - by munchine
    I've got a simple question but it has got me confounded. The code below gets an UNDEFINED error for UIControlTouchUpInside. What do I need to include or import? If I comment out the line, it works. So that means forState:UIControlStateNormal is defined. I'm new so hope you can help. UIButton * button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [button setTitle:@"Accept?" forState:UIControlStateNormal]; [button addTarget:self action:@selector(acceptTapped) forControlEvents:UIControlTouchUpInside];

    Read the article

  • How can I force Doxygen to show full include path?

    - by Artyom
    How can I force Doxygen to show full include path? What do I mean: I have a class foo::bar::bee defined in bee.hpp in following directory structure: foo foo/bar foo/bar/bee.hpp Doxygen, when it documents foo::bar::bee class tells that you need to include <bee.hpp>, but for my software I need <foo/bar/bee.hpp> How can I cause Doxygen to do this? Notes: FULL_PATH_NAMES is already set to default YES I do not want to provide include header explicitly for each class, because there too many of them. I want Doxygen to do this automatically. Thanks.

    Read the article

  • Do I always have to provide Tkx's -command argument an anonymous subroutine?

    - by Zaid
    I find it a bit weird that I have to wrap defined subroutines anonymously when specifying the -command argument for Tkx widgets. An excerpt from a TkDocs tutorial demonstrates this: my $cb = $frm->new_ttk__button ( -text => "Calculate", -command => sub {calculate();} ); sub calculate { $meters = int(0.3048*$feet*10000.0+.5)/10000.0 || ''; } Why doesn't it work when I write -command => &calculate() or -command => \&calculate()?

    Read the article

  • javascript to jquery

    - by Angeline Aarthi
    How do I write the following line which is in javascript in jQuery? var variablename = new functionname('some variable'); This is my js code: var rt = new ResizeableTextbox('myRT'); I need to use this in the following code segment: if($(this).text() =='String') { $("<label id=labelstr"+stringinc+" >"+label+"</label>").appendTo(".menu li"); $("<input id=inputstr"+stringinc+" type= 'text' ></input>").appendTo(".menu li"); //in place of this I need that javascript code. } How do I do that? The function Resizeable is defined in a separate js file. Please help me out.

    Read the article

  • Flex Button CSS skinning

    - by dta
    I have a CSS file containing the following definition : .Tab{ up-skin:Embed(skinClass='XUpSkin'); over-skin:Embed(skinClass='XOverSkin'); disabled-skin:Embed(skinClass='XDisabledSkin'); } And a Flex file : <mx:Button id="b1" style="Tab"/> Now, I want to use the disabled-skin defined in the CSS, as the upSkin of b1. So something like b1.setStyle("upSkin","Tab.disabled-skin"); But I am struggling with the exact syntax of the second argument for setStyle. What should I use for the second argument for setStyle method?

    Read the article

  • Java: define terms initialization, declaration and assignment

    - by HH
    I find the defs circular statements, the subjects are defined by their verbs but the verbs are undefined! So how do you define them? The question is central to understand the term final, related. The Circular Definitions itialization: to initilise a variable. It can be can be done at the time of declaration. assignment: to assign value to a variable. It can be done anywhere. declaration: to declare value to a variable.

    Read the article

  • Decimal Value is Zero when it should be 0.0x

    - by Mike Wills
    If this was previously talked about, I'm sorry, I had a hard time searching on this. I am calculating a depreciation rate. One portion of our calculation is 1/life in months. My table stores this data in a decimal field. I tried test = 1 / estimatedLife; but the result of the calculation of test (which is defined as a decimal) is 0. Say the estimated life is 36 months. So 1/36 should equal 0.02777778. Any thoughts of what I am doing wrong? BTW, I changed the test to a double and had the same result.

    Read the article

  • What is the bit size of long on 64-bit Windows?

    - by acidzombie24
    Not to long ago someone told me that long are not 64 bits on 64 bit machines and i should always use int. This did not make sense to me. I seen docs (such as the one on apples official site) say that long are indeed 64 bits when compiling for a 64bit CPU. I looked up what it was on windows and found Windows: long and int remain 32-bit in length, and special new data types are defined for 64-bit integers. from http://www.intel.com/cd/ids/developer/asmo-na/eng/197664.htm?page=2 What should i use? should i define something like uw, sw ((un)signed width) as a long if not on windows. Otherwise do a check on the target CPU bitsize?

    Read the article

< Previous Page | 152 153 154 155 156 157 158 159 160 161 162 163  | Next Page >