I have seen this type of effect on a visual thesaurus. Is there any open source code for this.
I don't care about the algorithm to match similar objects. I only am wondering about the effects.
Using Hibernate + annotations, I'm trying to do the following:
Two entities, Entity1 and Entity2.
Entity1 contains a simple generated value primary key.
Entity2 primary key is composed by a simple generated value + the id of entity one (with a many to one relationship)
Unfortunately, I can't make it work.
Here is an excerpt of the code:
@Entity
public class Entity1 {
@Id @GeneratedValue
private Long id;
private String name;
...
}
@Entity
public class Entity2 {
@EmbeddedId
private Entity2PK pk = new Entity2PK();
private String miscData;
...
}
@Embeddable
public class Entity2PK implements Serializable {
@GeneratedValue
private Long id;
@ManyToOne
private Entity1 entity;
}
void test() {
Entity1 e1 = new Entity1();
e1.setName("nameE1");
Entity2 e2 = new Entity2();
e2.setEntity1(e1);
e2.setMiscData("test");
Transaction transaction = session.getTransaction();
try {
transaction.begin();
session.save(e1);
session.save(e2);
transaction.commit();
} catch (Exception e) {
transaction.rollback();
} finally {
session.close();
}
}
When I run the test method I get the following errors:
Hibernate: insert into Entity1 (id, name) values (null, ?)
Hibernate: call identity()
Hibernate: insert into Entity2 (miscData, entity_id, id) values (?, ?, ?)
07-Jun-2010 10:51:11 org.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: 0, SQLState: null
07-Jun-2010 10:51:11 org.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: failed batch
07-Jun-2010 10:51:11 org.hibernate.event.def.AbstractFlushingEventListener performExecutions
SEVERE: Could not synchronize database state with session
org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:254)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1001)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:339)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at test.App.main(App.java:32)
Caused by: java.sql.BatchUpdateException: failed batch
at org.hsqldb.jdbc.jdbcStatement.executeBatch(Unknown Source)
at org.hsqldb.jdbc.jdbcPreparedStatement.executeBatch(Unknown Source)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:247)
... 8 more
Note that I use HSQLDB.
Any ideas about what is wrong ?
Apparently Youtube used a HTML frame to display the 'related videos' section on a normal video page.
Having looked at the page source, I don't see any mention of frames.
Am I missing something?
I want to build a regex that matches PHP-style error messages in HTML source code.
Does anybody know of one that exists or how I can create a list of possible PHP error outputs?
I am trying to develop an android application that could store whatever the user writes on screen as an image.
For example, if the user writes "Co" followed by "ol" and presses OK, the text is stored as "Cool" as an image in a field on the form displayed on the phone. (No handwriting recognition or OCR required)
I have seen the Canvas class in Android, but how would you concatenate all the letters/set of characeters and convert them to image ? Is there any open source project that does something similar ?
I need to find the Name and speed of the processor on my machine. I'm building an open source help desk suite and finding this really entertaining!
Thanks for the help guys!
I have downloaded and install a python library, via setup.py , python2.5 setup.py install ...
now the version is changed at the source . a newer library is available. originally , i have clone it via mercurial, and install it. right now , i have updated repository.
how do i use the newer version ? overwrite the installation ?
by simply doing setup.py install again ?
Hi
I want to write a video editing software, and the "logical" conclusion is that the language I must to use is C++... But I don't like it (sorry c++ fans)
I would like to write it with something cool, like Lisp or Haskell or Erlang... But I don't know if the open source implementation of those languages (I don't have money to buy licenses) let me made a competitive software (in the performance area)
What do you think? what do you recommend?
I am playing sound with OpenAL, and it seems to increase memory footprint dramatically for every little sound I play. It seems that OpenAL never frees memory itself and that playing a Source causes memory footprint to grow.
I couldn't find any good resources about OpenAL memory management, but I bet I must do a lot of stuff myself. Maybe someone knows a ressource for that?
Can you recommend any good open source editor/display templates (mostly editor), preferrably utilising jQuery.
Like AutoComplete, datePicker, color picker, multi-select, grids, trees etc.
Thanks in advance
When I start VLC from cmd how\is it possible to select a camera for directshow source by index (for example i have camera "A" and camera "B" so i would say 0 for "A" and 1 for "B")
i do not know device name and i do not know camera name - only its index (0, 1...)?
While, compiling a package, written in C++ on RHEL 5.0. I am getting the following error.
error: nocreate is not a member of std::ios
The source-code corresponds to:
ifstream tempStr(argv[4],ios::in|ios::nocreate);
I have tried
#g++ -O -Wno-deprecated <file.cpp> -o <file>
as well as:
#g++ -O -o <file>
Please suggest a solution.
We have a few liberal programmers on our team who don't use source control, don't manage time effectively and always want to use our budget on useless tools/components that are expensive and things we can build ourselves. They are also loud and disrespectful. Our group of conservatives always have to clean up after them and show them the correct way of doing things. How do we address this discrepancy? Please advise.
I travel a bit and I'm looking for a hosted vcs with good support for Visual Studio. My projects aren't open source so I need security as well. Any recommendations or suggestions? Thanks
I'm using the post-receive-email script included with git. (Source is here.) It works just fine, but I want each email to be sent from the author of the commits pushed. How do I do it?
My post-receive file currently looks like this, and I want to customize the from-email-address.
#!/bin/sh
export [email protected]
$(dirname $0)/post-receive-email
Quoted from here:
If your program uses Win32 specific functions of WinPcap, remember to include WPCAP among the preprocessor definitions.
If your program uses the remote capture capabilities of WinPcap, add HAVE_REMOTE among the preprocessor definitions. Do not include remote-ext.h directly in your source files.
Has anyone managed to use winpcap with cmake?
Hi... I'm looking for an application developed in C# with following qualities, which is available as source code...
Based on OO Architecture
Must connect to DB.
Must handle atleast a "one to many master child" relationship (eg: Order and items ordered)
Should display the data using Datagrid or other similar controls.
Reports (either with report buider or otherwise)
I want to understand the layering of objects better... Do you have any links...
Thanks.
Sorry if this is a little off-topic, but I never know what word to use when I am searching the internet for articles or tutorials. What I mean is, say I wanted to search for information regarding making a notepad clone, would I search for:
"Creating A Notepad Clone"
"Building A Notepad Clone"
"Making A Notepad Clone"
So what I'm asking is basically, is there a definitive term to use, or does it vary depending on the source?
Now that i have learned the theory of OOPS in good number of books , and practised a little.
Still i am not comfortable when i look into OOPS being applied in some of the Open Source projs.
Can someone suggest any problem / solution kind of book , or any resources , that covers OOPS end - end. (C# , Java preferably)
I have existing Linux shared object file (shared library) which has been stripped. I want to produce a new version of the library with some additional functions included. I had hoped that something like the following would work, but does not:
ld -o newlib.so newfuncs.o --whole-archive existinglib.so
I do not have the source to the existing library. I could get it but getting a full build environment with the necessary dependencies in place would be a lot of effort for what seems like a simple problem.
If I do --strip-debug or --strip-unneeded, I have the .ko that lists all function names with nm, if I do just strip foo.ko I have a kernel module that refuses to load.
Does anyone know a quick shortcut how to remove all symbols that are not needed for module loading so that people cannot reverse engineer the API:s as easily?
PS: For all you open source bigots; this is something that general public will never be using in any case so no need to turn the question into a GPL flame war.
I recently installed PHP on IIS/Windows 7, but it isn't working. I am getting the entire source file in the browser window.
FastCGI Settings shows c:\Program Files (x86)\PHP\php-cgi.exe
Handler Mappings has
Request Path: *.php
Modue: FastCgiModule
Executable: C:\Program Files (x86)\PHP\php-cgi.exe
Request Restrictions: File or Folder, All verbs, Script Access
I use a subclass of CRichEditCtrl to provide a CEdit+ type control. One thing I want is to disable drag-drop functionality, which the base class provided by default.
Disabling dropping is easy: ::RevokeDragDrop(m_hWnd);
But I can't see a simple way to disable the control being a drag-source. Is there an easy way?
So far the only tutorials I've been able to find are on directx11tutorials.com, which are essentially inferred from the existing samples. Does anyone know where to find other tutorials, or better yet open source projects using DirectX 11? (Extra points for project code using DirectX 11 :) )
Hi all,I am trying to build a UDP application(P2P) of Large file transfer in Flex. My back end is C++. How can I transfer my client's files to server without any middle server. If I use stratus services..how to connect that to C++. Please help me, if possible with source code. Thank you.