lazy

how do I query multiple SQL tables for a specific key-value pair?

Situation: A PHP application with multiple installable modules creates a new table in database for each, in the style of mod_A, mod_B, mod_C etc. Each has the column section_id. Now, I am looking for all entries for a specific section_id, and I'm hoping there's another way besides "Select * from mod_a, mod_b, mod_c ... mod_xyzzy where s...

hibernate: LazyInitializationException: could not initialize proxy

Hi all, Here's one that has me perplexed. I'm trying to implement a basic Hibernate DAO structure, but am having a problem. Here's the essential code: int startingCount = sfdao.count(); sfdao.create( sf ); SecurityFiling sf2 = sfdao.read( sf.getId() ); sfdao.delete( sf ); int endingCount = sfdao.count(); assertTrue( startin...

Ocaml List: Implement append and map functions

Hi! I'm currently trying to extend a friend's OCaml program. It's a huge collection of functions needed for some data analysis.. Since I'm not really an OCaml crack I'm currently stuck on a (for me) strange List implementation: type 'a cell = Nil | Cons of ('a * 'a llist) and 'a llist = (unit -> 'a cell);; I've figured out that t...

Lazy choices in Django form

I have a Django my_forms.py like this: class CarSearchForm(forms.Form): # lots of fields like this bodystyle = forms.ChoiceField(choices=bodystyle_choices()) Each choice is e.g. ("Saloon", "Saloon (15 cars)"). So the choices are computed by this function. def bodystyle_choices(): return [(bodystyle.bodystyle_name, '%s...

hibernate lazy solution. Is it right?

i am using the following approach to solve lazy initialization problem in hibernate. Please tell me whether it will work or not . I have to implement my transcation in my persistance layer compulsary due to some reasons. public class CourseDAO { Session session = null; public CourseDAO() { session = HibernateUtil.getSe...

set lazy as true during HQL execution time

In our application, we have various objects set to lazy false based on the application needs. However, in one of the use case we want to ignore all the lazy settings within the HBM files, and get ONLY the target object. So the question is: is there a way to specify in the HQL to fetch ONLY the target object irrespective of the HBM sett...

What is the difference between lazy="true" and lazy="proxy" in nhibernate?

What is the difference between lazy="true" and lazy="proxy" in nhibernate? ...

Comparing database structures: how to create an SQL patch?

I have two SQL Server (2000) databases. Both are used for the same project, but different versions. Basically, the old database is from our TEST environment. The new database is from the DEVELOPMENT environment. We also have an ACCEPTANCE, PRODUCTION and MAINTENANCE environment and they all contain the same project. (It's our development...

In functional list manipulation, what do we call "inserting something between each item"?

Occasionally I find I need to process a list by inserting a new item after each item, except the last one. Similar to how you might put a comma between each item of a list of strings. I got fed up of coding the special case for the last (or first) item every time, so I captured the pattern in a Linq-style extension: public static IEnum...

Force lazy entity to load real instance

I have a proxy for a lazy entity which has been created in the session by loading a child entity. A subsequent fetch on the parent entity only returns the NH proxy. I need the actual instance to check the type (the entity has joined subclasses). I must be missing something, but I can't find a way to do this. Session.Refresh(proxy) does n...

detect conflicts after git-svn rebase

I'm using so many git-svn repositories (at the same time) that it's becoming a chore to update them all. I'd like to write a script that automates this, so I can just run it every morning while I fetch a coffee. Basically my workflow is like this cd ~/module1 git svn fetch git checkout master git svn rebase git checkout topicbranch gi...

F#: Why is using a sequence so much slower than using a list in this example

Background: I have a sequence of contiguous, time-stamped data. The data-sequence has holes in it, some large, others just a single missing value. Whenever the hole is just a single missing value, I want to patch the holes using a dummy-value (larger holes will be ignored). I would like to use lazy generation of the patched sequence, an...

Django: AuditTrail & Lazy Relations

I've been trying to modify the AuditTrail code so that it does not copy ForeignKey fields, but rather copies the related field (ie I don't want a foreign key on my database table for the audit model). I've written a copy_field function that looks like so: def copy_field(field): while(isinstance(field, models.OneToOneField, models.F...

Is there a prefabricated magnifying glass cursor for SWT somewhere available?

I would like to use a "magnifying glass" (with + and -) cursor in my SWT application. I'm aware that it is pretty easy to create a cursor for oneself, I just don't want to invest the time right now. Has anyone a link, or a codesnippet with a "zoom in" and "zoom out" cursor which I could use? ...

Hibernate: Projection of a many-to-one in a Criteria

Hi all, I am playing around with the hibernate Criteria API for the first time recently. I was trying to do the equivalent of this HQL "select t.userTbl from Task t" userTbl property is a many-to-one from Task. The Task.userTbl relationship is lazy. So I came up with this Criteria criteria = session.createCriteria( Task.class, "t"...

Clojure- why doesn't this piece of code work in clojure, is there some lazy evaluation gotcha I am missing ?

Am new to clojure and learning it by working through SICP. I cannot get this piece of code from SCIP 1.3.1 to work. What am I missing ? (defn sum [term a next b] (if (> a b) 0 (+ (term a) (sum term (next a) next b)))) (defn sum-cubes-new [a b] ((sum cube a inc b))) HERE is the error message: java.lang.Integer can...

mysql query php

i am sending an email to 1000 people. i have a php send email. it works fine. i was wondering, in my query, how can i send it 100 at time. is it like this: select * from test limit 0, 100 select * from test limit 100, 100 select * from test limit 200, 100 select * from test limit 300, 100 etc... thanks. ...

Invoke delegates without params but using local params c#

I find myself doing the following a lot, and i don't know if there is any side effects or not but consider the following in a WinForms C# app. (please excuse any errors as i am typing the code in, not copy pasting anything) int a = 1; int b = 2; int c = 3; this.Invoke((MethodInvoker)delegate() { int lol = a + b + c; }); Is there ...

Updating JPA-Hibernate entity without selecting it from database

I have a hibernate entity called Execution. It is created in the beginning of my process and updated at end, indicating how it has finished. I would like to update a single property of this entity, without causing a select in my database. Execution execution = entityManager.getReference(Execution.class, executionId); execution.setSta...

jQuery plugin "lazy" fails to load two jQuery plugins with $.getJSON calls in each of them: too much recursion ONLY in Firefox

Plugin: jQuery lazy() I ask here because the project page itself seems to be dead. What steps will reproduce the problem? 1. embed two jQuery-Plugins that are both using the $.getJSON function results in a "too much recursion error" in firefox. If the same scripts are referenced with lazy it works fine. Problem only persits in firefox...