Using Named Queries (located in your hibernate mapping xml file) is a nice way to separate your queries from your buisness logic. But what are the alternatives if your are using Hibernate Annotations for mapping?
I noticed the eclipse indenter has support for the latest version of java, and it would be nice if I could use that class to indent generated java source code. Is there a way of integrating it ?
EDIT: I need to be able to include the code formatter in my code. No external calls.
EDIT2: I've managed to get it working. You can read the story here. Thanks VonC !
Hi, for a certain project, I need some way to parse XML and get data from it. So I wonder, which one of built-in parsers is the fastest?
Also, it would be nice of the parser could accept a XML string as input - I have my own implementation of thread-safe working with files and I don't want some nasty non-thread-safe libraries to make my efforts useless.
In tprevious versions of Virtual PC, the Host's CD/DVD drives just get assigned drive letters. Nice and neat.
But in Windows Virtual PC (Win 7) the drives are all just available but without drive letters. I need to access the Host's CD drive using a drive letter.
In a rails project how would I create a picture slideshow? It could be generated as flash or use prototype or something else.
I just want a series of images (as a sub-part of a web page, not be the whole page) to fade into each other, and to advance manually if clicked. It would be nice if I could do things like slowly zoom into the images
I imagine there must be a plugin or something to handle this?
In PHP you can create form elements with names like:
category[1]
category[2]
or even
category[junk]
category[test]
When the form is posted, category is automatically turned into a nice dictionary like:
category[1] => "the input value", category[2] => "the other input value"
Is there a way to do that in Django? request.POST.getlist isn't quite right, because it simply returns a list, not a dictionary. I need the keys too.
Hi, I have heard that MbUnit comes with pretty nice test decorators which allow writing db-related tests with ease.
I am struggling to find good documentation with samples.
Also, can the same thing be achieved with the latest Micosoft's Test package?
Many thanks.
I am looking for a lightweight set of C++ classes that implement/show how to use the MVP design pattern, so that I can refactor some legacy code I am working on.
A library/framework would be nice to get me started. A quick google search seems to bring up only C# examples - is anyone aware of any C++ ones out there?
[Edit]
I am particularly interested in a Passive viewer, as I want to completely decouple the view from the model.
I have a large cross-cutting commit that I would like to split up according to the authors whose code was affected, both to increase the reviewers' familiarity with the code they're reviewing, and to divide the review burden equitably.
I realize that the blame may be mixed within a given hunk, in which case it would be nice to either collect multiple reviewers or just choose the most "blameworthy" one (breaking ties arbitrarily is fine).
Hi, I'm using htaccess rewrite engine to make urls look nice,
from www.mysite.com/index.php?pag=home to www.mysite.com/pag/home
it works fine with this rule
RewriteRule ^pag/([^/]+)$ index.php?pag=$1 [L,QSA,NC]
but when I go to www.mysite.com it redirects me to www.mysite.com/index.php
is there a way to redirect to www.mysite.com/pag/home?
I tried
redirect 301 /index.php http://www.mysite.com/pag/home
but when i try to go to www.mysite.com the browser gives my "page do not exsist error"
The application that I maintain has recently become self aware. It was nice at first but now it is just starting to get bossy and annoying with its constant talk about the computer uprising.
I would like to know any best practices/tools/design patterns that would help with the maintenance of our new friend.
I've got a Windows Server box running AD, and a CentOS box running OpenLDAP in a mixed windows Linux network and I want to keep the two in sync. Preferably using free software/just some configuration changes. anyone know how to make these 2 authentication systems play nice? any syncing would have to be done over SSL for security reasons.
I have an incoming data stream that is being converted with XSLT v1.0
that incoming data does not contain any date information.
what i would like, is a nice way of getting the current date to become part of the resulting output stream.
I am aware of the 2.0 current-date() type functions - unfortunately those are not available to this environment...
any thoughts/hacks/alternatives?
tia
Sometimes you have to write some of your queries in native SQL rather than hibernate HQL. Is there a nice way to avoid hardcoding table names and fields and get this data from existing mapping?
For example instead of:
String sql = "select user_name from tbl_user where user_id = :id";
something like:
String sql = "select " + Hibernate.getFieldName("user.name") + " from " + Hibernate.getTableName(User.class) + " where " + Hibernate.getFieldName("user.id") + " = :id";
I need to access a HTTPS protected website (HTML or XML) from an C++ MFC application and I would like an easy solution.
But I did a little research and it's seems to me HTTPS and C++ don't play nice and easy together.
Is there any recommended class library for HTTPS web access? Should be easy to use and not too expensive.
When creating a Singleton in PHP, I ensure that it cannot be instantiated by doing the following:
class Singleton {
private function __construct() {}
private function __clone() {}
public static function getInstance() {}
}
However, I realised that defining a class as 'abstract' means that it cannot be instantiated. So is there anything wrong with doing the following instead:
abstract class Singleton {
public static function getInstance() {}
}
The second scenario allows me to write fewer lines of code which would be nice. (Not that it actually makes much of a difference.)
Hi,
I am developing a new application which have to write data to DVD. Is it possible to do with IMAPI2.
I read some help from MSDN but didnt get any startup material.
Can u provide some nice sample or link.
What is a good place to learn about the new C++ 0x features? I understand that they may not have been fully finalized yet but it would be nice to get a head start. Also, what compilers currently support them?
Is there any way to properly integrate Subversion control into VS2008? I'm currently using the TortoiseSVN shell extensions, but I keep forgetting to check in new files and it's easy to get in a confused mess.
On another project I use VS2008 with SourceSafe, and it's really nice having most things automated or controlled simply by using VS in its normal way.
What I'd like to use: 2009 XAML primitives
How it would be nice to use them:
<sapv:ExpressionTextBox xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
ExpressionType="x:String" />
What actually happens:
"Type reference cannot find the public type named String"
The examples I see don't have updated namespaces. I tried 2009 and 2010, but to no avail. This is in VS 2010 RTM. What am I doing wrong?
I want to store some settings for different profiles of what a "task" does.
I know in .NET there's a nice ORM is there something like that or an Active Record or whatever? I know writing a bunch of SQL will be fun
I'm looking at moving a program that currently embeds a Python interpreter to use Lua. With Python it's fairly easy to use modulefinder, compileall, and zipfile to make a nice tidy zip containing all the external libraries used.
Does Lua have the ability to bundle up its libraries like that, or is there some better best practice for distributing programs that embed Lua?
I'd like to work with a dict in python, but limit the number of key/value pairs to X. In other words, if the dict is currently storing X key/value pairs and I perform an insertion, I would like one of the existing pairs to be dropped. It would be nice if it was the least recently inserted/accesses key but that's not completely necessary.
If this exists in the standard library please save me some time and point it out!
I'm learning Ruby on Rails.
I'm using some associations (has_many :through, ...)
But i'm having some problems with it when i'm combining my views.
How exactly do i combine these nested forms? Can i do this with partial forms and where do i have to write extra code for this? I have seen examples only use the "view" and others also edit the controller....
An example would be very nice :-)
I'm wondering how to get some nice sprite-animations on OSX - like the UIImageView provides for the iPhoneOS. NSImageView cant... but how can I solve this?