entities

Issue with Updating Changes in LINQ

I'm having an issue with updating the database. The app shows the updated value, but the database does not. No errors returned. My table has a PK. Using DotConnect for Oracle, but the LINQ syntax is the same. namespace ConsoleApplication1 { class Program { static void Main(string[] args) { DataCon...

Is this a ddd anti-pattern?

Is it a violation of the Persistance igorance to inject a repository interface into a Entity object Like this. By not using a interface I clearly see a problem but when using a interface is there really a problem? Is the code below a good or bad pattern and why? public class Contact { private readonly IAddressRepository _addressRepo...

Object, entities, pocos, models etc

I have seen these terms used interchangebly on the web for objects (.Net). Could someone explain the difference between them. POCO Entity Model Domain Object Active Record Are Entities and POCO the same/similar? I normally think as Model objects as being part of the UI layer of an N-Tier architecture, is this correct? Are there ...

jQuery Escaping HTML from a Textarea

I want to escape HTML tags to entity names, taking text from a textarea and putting the result in a second textarea such that: <mytag> becomes &lt;mytag&gt; I'm using .html() and .text() going back and forth OK. My problem is dealing with the textarea element, which acts a little different.... It works fine if I first place the text ...

send html text with ajax, problem on '&'?

i use jquery.ajax to save a rich text area . corr=some.innerHTML(); /* corr='&lt; some text &lt;' */ $.ajax({ type:"POST", url:"flatplan/save_corr.php", data:"corr="+corr+"&IDFS="+IDFILES, success: function(msg){ }, error:function(x,e){ ajax_errors(x,e); } }); The problem is that the corr variable can...

OOP Value Objects and Entities in the same class

I am refactoring an old procedural PHP website into a tasty OOP application with a light sprinkling of Domain Driven Design for added flavour. I keep stumbling upon cases where I have a need for classes that can have subclasses which are either entities or value objects. An url object, for example. There are a zillion urls out there an...

.NET XML unhelpfully resolves entities on Save

I have a simple XML file like so: <?xml version="1.0" encoding="UTF-8"?> <foo attr="blah &#176; blah"/> When I load it into the .NET XmlDocument and issue a Save, i.e.: xmlDoc = New XmlDocument() xmlDoc.Load("c:\temp\bar.xml") xmlDoc.Save("c:\temp\bad.xml") the new XML file contains the resolved amp 176 (a degree sign). This then b...

XPath choking on entities in Firefox / GreaseMonkey

Hi there. I am writing a fairly basic GreaseMonkey script that locates text in a specific element and then uses that text to do things later. The relevant bits of code are as follows: In the HTML there is a span with the class 'someclass', which contains a small string of text: <span class="someclass">some text</span> Then in the Jav...

Entity versioning in JPA + Hibernate

I have a problem with entity versioning. Here's what I want to archive: Let's say that I have entity class A (POJO with javax.persistance.* annotations). It's in relations with other entities. Then I need to insert new version of A. All rows should still reffer to old one, but it should be marked as archived and new version should be in...

LINQ to Entities Join on DateTime.DayOfWeek

Imagine two tables: Shifts, RANK_S_DAY. Shifts contains a ShiftDate column which is DateTime and RANK_S_DAY has a DayOfWeek column. I need to join (int)ShiftDate.DayOfWeek equals DayOfWeek. I understand why it won't work, but I'm not quite sure how I can change it. The Exception is: The specified type member 'DayOfWeek' is not su...

How to compare unicode strings with entity ref to non-unicode string

I am evaluating hundreds of thousands of html files. I am looking for particular parts of the files. There can be small variations in the way the files were created For example, in one file I can have a section heading (after I converted it to upper and split then joined the text to get rid of possibly inconsistent white space: u'KEY...

do crawlers decode html entities?

i was wondering if the crawlers and robots can decode html entities for example in my html i have something like: salari&eacute;s do they read it like that? or something like: salariés which option is better for SEO? ...

Is there a reference for EF4 Fluent API syntax?

I keep searching the web for examples of the new fluent API syntax in Microsoft's Entity Framework technology previews ... I come up with bits and pieces here and there. Is there any reliable place to go to find ALL the possibilities? And maybe something that explains them a bit ("HasRequired", "WithMany", etc.)? FYI, I am specifically...

codeigniter: where do entities go?

Hey, I was wondering what should I do with my entities? For example, a class named Articles, with a few datamembers (name/title/date) and getters & setters. I could add these to my Articles datamember, but it's better practice to seperate those. So what do you think? Thanks! ...

Download a web page without character replacement

I'm tryng to download a web page in java with the following: URL url = new URL("www.jksfljasdlfas.com"); FIle to = new File("/home/test/test.html"); Reader in = new InputStreamReader(url.openStream(), "UTF-8"); Writer out = new OutputStreamWriter(new FileOutputStream(to), "UTF-8"); int c; while((c = in.read()) != -1){ out.write(c)...

Is there a way to keep entities intact while parsing html with DomDocument?

I have this function to ensure every img tag has absolute URL: function absoluteSrc($html, $encoding = 'utf-8') { $dom = new DOMDocument(); // Workaround to use proper encoding $prehtml = "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset={$encoding}\"></head><body>"; $posthtml = "</body></html>...

How to filter Child entities in LINQ Include query?

I'm working with ASP.NET 3.5 SP1 and I have a question that I've been stuck on. I have an ASPX page on which I have 2 repeater controls, 1 nested inside the other. From the code behind I have a simple LINQ To Entities query which retrieves the data and I then bind this data to the repeater controls. The ASPX page is shown below: <asp:Re...

Starting out with Core Data and relationships.

What I'm trying to build is an application that allows users to add a category to the first entity (CategoryItem) and then add feeds to that via a second entity (FeedItem). So far, the CategoryItem entity has *action attribute which is used as the naming of the category (String). The FeedItem entity has two attributes, *feedName and *f...

Odd entities in generated text (chrome is weird)

Hello! I am working on a school-project with two classmates. Our task is to make a dynamic gallery for web. So we got the whole gallery up and running perfect, except chrome is acting mighty weird about it. We have our pictures uploaded in blob, as well as our thumbnails. We load them from the database through php. <div id="content_righ...

How to use html entities in CSS content property ?

Good day, I'm stuck with a problem this morning. I found out that content property which is nice but I can't use HTML entities in it. More specifically, I would like to use the &eacute; This is what I tried: content: 'test with eacute \233'; but the result is test with eacute ÿ I've also tried \0233, \0233c, \233c I don't want to ch...