entities

Core data: can NSFetchedResultsController fetch two different entities?

六月ゝ 毕业季﹏ 提交于 2019-11-30 11:54:37
问题 I am working on an iPhone app, and in a particular view I need to load two different entities: One that will populate a UITableView , and another that will populate a UITextView . Is it possible to fetch both properties using a single NSFetchedResultsController ? Or do I need to use two different NSFetchedResultsController s? Any ideas on how to best approach this problem? 回答1: Each fetch request has only one entity and each fetched results controller has only one fetch. Therefore, you need

HTML entities and charset in IE

眉间皱痕 提交于 2019-11-30 07:45:09
I am displaying html entity ✓ (a check mark: ✓) in an html document that uses iso-8859-1 for the character set. In Firefox, it displays as a check mark. In IE, it displays as a square box. Switching to UTF-8 doesn't seem to make a difference. Is there a reliable way to display these entities in IE 6 & 7 without using images? Square means that the font used does not have the glyph for that character. Unfortunately, there are not many fonts containing that character, and none of them is present by default on all Windows machines (and even less on non-Windows ones) The most likely fonts to be

Use JavaScript regex to replace numerical HTML entities with their actual characters

*爱你&永不变心* 提交于 2019-11-30 05:22:20
I'm trying to use JavaScript & regex to replace numerical HTML entities with their actual Unicode characters, e.g. foo's bar → foo's bar This is what I got so far: "foo's bar".replace(/&#([^\s]*);/g, "$1"); // "foo39s bar" All that's left to do is to replace the number with String.fromCharCode($1) , but I can't seem to get it to work. How can I do this? "foo's bar".replace(/&#(\d+);/g, function(match, match2) {return String.fromCharCode(+match2);}) "foo's bar".replace(/&#([^\s]*);/g, function(x, y) { return String.fromCharCode(y) }) First argument (x) is a "'" in current example. y is 39. As

Java - convert named html entities to numbered xml entities

。_饼干妹妹 提交于 2019-11-30 04:27:54
问题 I'm looking to convert an html block that contains html named entities to an xml compliant block that uses numbered xml entities while leaving all html tag elements in place. This is the basic idea illustrated via test: @Test public void testEvalHtmlEntitiesToXmlEntities() { String input = "<a href=\"test.html\">link </a>"; String expected = "<a href=\"test.html\">link </a>"; String actual = SomeUtil.eval(input); Assert.assertEquals(expected, actual); } Is anyone aware of a Class that

SqlResultSetMapping columns as and entities

陌路散爱 提交于 2019-11-30 04:24:57
问题 I am really confused, how does column resultset mapping work? What am I mapping when I use columns instead of entities? Look at this example... Query q = em.createNativeQuery( "SELECT o.id AS order_id, " + "o.quantity AS order_quantity, " + "o.item AS order_item, " + "i.name AS item_name, " + "FROM Order o, Item i " + "WHERE (order_quantity > 25) AND (order_item = i.id)", "OrderResults"); @SqlResultSetMapping(name="OrderResults", entities={ @EntityResult(entityClass=com.acme.Order.class,

How to parse badly formed XML in Java?

百般思念 提交于 2019-11-30 02:40:10
问题 I have XML that I need to parse but have no control over the creation of. Unfortunately it's not very strict XML and contains things like: <mytag>This won't parse & contains an ampersand.</mytag> The javax.xml.stream classes don't like this at all, and rightly error with: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[149,50] Message: The entity name must immediately follow the '&' in the entity reference. How can I work around this? I can't change the XML, so I guess I need an

UserInfo Dictionaries on CoreData

穿精又带淫゛_ 提交于 2019-11-30 02:37:43
问题 What does this part of Apple core data documentation means? User Info Dictionaries Many of the elements in a managed object model—entities, attributes, and relationships—have an associated user info dictionary. You can put whatever information you want into a user info dictionary, as key-value pairs. Common information to put into the user info dictionary includes version details for an entity, and values used by the predicate for a fetched property. I understand that by default entities have

How to merge 2 form in Symfony2

℡╲_俬逩灬. 提交于 2019-11-29 21:20:38
问题 I'm trying to create a very simple forum with Symfony2. My entities are: ForumCategory (name, description...) ForumTopic (category_id, title) ForumPost (isFirstPost, body, topic_id, author_id...) When a user try to create a Topic, I want to display only one form in the same page to create a Topic and the first post message. Like: Insert topic title: ... Insert topic body (related Post Body): ... [...] How can I do that? It's possible merge two form in this case? 回答1: Make a form type that

The type or namespace name 'Objects' does not exist in the namespace 'System.Data'

北城以北 提交于 2019-11-29 20:54:58
I am using entities, C# and SQL Server to create an n-tier app. I am creating some base classes common to all my DAL components. In this base class, i want to handle the connection state of the ObjectContext base class inherited by entities object. Compiling throws the following error: The type or namespace name 'Objects' does not exist in the namespace 'System.Data' (are you missing an assembly reference?) Also, the using statement System.Data.Objects doesn't resolve for the same reason. I tried adding the assembly as reference, but couldn't find it in the .NET tab of assembly references. Any

HTML entities and charset in IE

血红的双手。 提交于 2019-11-29 09:36:24
问题 I am displaying html entity ✓ (a check mark: ✓) in an html document that uses iso-8859-1 for the character set. In Firefox, it displays as a check mark. In IE, it displays as a square box. Switching to UTF-8 doesn't seem to make a difference. Is there a reliable way to display these entities in IE 6 & 7 without using images? 回答1: Square means that the font used does not have the glyph for that character. Unfortunately, there are not many fonts containing that character, and none of them is