Search Results

Search found 4565 results on 183 pages for 'nhibernate mapping'.

Page 142/183 | < Previous Page | 138 139 140 141 142 143 144 145 146 147 148 149  | Next Page >

  • java.util.Date.toString() is printing out wrong format

    - by pacoverflow
    The following code prints out "vmtDataOrig.creationdate=2012-11-03" VmtData vmtDataOrig = VmtDataDao.getInstance().loadVmt(1); System.out.println("vmtDataOrig.creationdate=" + vmtDataOrig.getCreationDate().toString()); Here is the definition of the creationDate field in the VmtData class: private Date creationDate = null; Here is the hibernate mapping of the creationDate field to the database table column: <property name="creationDate" column="CREATIONDATE" type="date"/> The CREATIONDATE column in the MySQL database table is of type "date", and for the record retrieved it has the value "2012-11-03". The Javadoc for the java.util.Date.toString() method says it is supposed to print the Date object in the form "dow mon dd hh:mm:ss zzz yyyy". Anyone know why it is printing it out in the form "yyyy-MM-dd"?

    Read the article

  • IIS 7.5 fails to open database after computer machine on that database server is working restarts.

    - by Jenea
    Hi. I decided to post this question also here in case the issues we have is related to sql server. There is a problem that bother me for some time. I have an asp.net mvc that uses NHibernate for modeling the database. The infrastructure is the following: Windows 2008 R2 for all virtual machines. IIS 7.5 is working on one virtual machine. Sql Server 2008 is working on another virtual machine. We have couple of databases, two that stores application data and one that registers all unhandled exceptions. Sometimes virtual machine that hosts database server restarts (in the middle of the night, not quite sure about the reason) after that connection to the databases that stores application data is not working and as result there are thousands of unhandled exceptions that get registered in the third database. Important to mention that databases are accessible from Management Studio. The problem is solved by resetting IIS. Connetion are handled via NHibernateUtil class which opens and closes session at each request.

    Read the article

  • Is it OK to put link to SO questions in a program comments?

    - by WizardOfOdds
    In quite some codebase you can see comments stating things like: // Workaround for defect 'xxx', (See bug 1434594 on Sun's bugparade) So I've got a few questions, but they're all related. Is it OK to put link to SO questions in a program's comments: // We're now mapping from the "sorted-on column" to original indices. // // There's apparently no easy way to do this in Java, so we're // re-inventing a wheel. // // (see why here, in SO question: http://stackoverflow.com/questions/951848) Do you do it? And what are the drawbacks in doing so? (see my first comment for a terrible drawback)

    Read the article

  • How do I register multiple paths for a HttpHandler in IIS7?

    - by Daniel T.
    I have a HttpHandler that resizes images based on the querystring, so requesting something like: http://server/image.jpg?width=320&height=240 will give you a resized image that's 320x240. In the IIS Manager, under Handler Mappings, I mapped my handler's path as *.jpg,*.gif,*.bmp,*.png. However, this doesn't activate the handler. If I change it to just *.jpg, then it works. My question is, do I have to create 4 separate mapping entries, one for each image type, or is there some way to combine multiple extensions in one path?

    Read the article

  • A galaxy with stars, milkyway and other stuffs (WPF)

    - by boj
    What is a "realistic" way to build a galaxy in 2D with wpf? I'm not interessed in the physical modelling but the graphical aspect. At least the stars (position, size, color, pulsing etc.) should be generated from code. Generating milkyways would be nice. Main questions are: Stars: lens flare? texturing? Milkyway: bump mapping? "Far" stars: textures? generated? Pulsing? other elements, any effects are welcome! Some examples (taken from the web, I want to build similar pictures (animations) with wpf): Thank you.

    Read the article

  • Microsoft sublanguage string to locale identifier

    - by Jacob
    I can't seem to find a way to convert, or find, a local identifier from a sublanguage string. This site shows the mappings: http://msdn.microsoft.com/en-us/library/dd318693(v=VS.85).aspx I want the user to enter a sublanguage string, such as "France (FR)" and to get the local identifier from this, which in this case would be 0x0484. Or the other way around, if a user enters 0x0480 then to return French (FR). Has anyone encountered this problem before and can point me in the right direction? Otherwise I'm going to be writing a few mapping statements to hard code it and maintain future releases if anything changes. BTW, I'm coding in C++ for Windows platform. Cheers

    Read the article

  • Calling unmanaged c++ code in C# Mixed with STL

    - by Turtle
    Hey, I want to call unmanaged c++ code in C# The function interface is like following(I simplified it to make it easy to understand) Face genMesh(int param1, int param2); Face is a struct defined as: struct Face{ vector<float> nodes; vector<int> indexs; } I googled and read the MSDN docs found ways to call simple c/c++ unmanged code in C#, also know how to hand the struct as return value. And My question is how to handle "vector". I did not find rules about mapping between vector and some types in C# Thanks!

    Read the article

  • Is there a Java method that encodes a collection of parameters as a URL query component?

    - by Steven Huwig
    Is there a widely-used Java library that does something like what dojo.objectToQuery() does? E.g. (assuming the use of HttpCore's HttpParams object, but any key-value mapping will do): HttpParams params = new BasicHttpParams() .setParameter("foo", "bar") .setParameter("thud", "grunt"); UnknownLibrary.toQueryString(params); should yield "foo=bar&thud=grunt". I know it's not hard to write but it seems like it should have already been written. I just can't find it.

    Read the article

  • Porting a GUI from a pc to a wince device - issue is with the size of the screen

    - by ame
    I have to port a GUI that is currently running on a pc, to a wince device. I have already compiled the code on a win CE platform, the problem is now with the size of the screen of the device which is smaller than some of the dialog boxes of the GUI. I could resize some them in resource view of visual studio 2005. I am unable to proceed further as a lot of screens have bitmaps mapped to them and i cannot just resize the dialog boxes without changing the corresponding bitmaps. What is the best way to proceed- my last resort would be to disable the bitmaps and redraw them at a later stage. is there some method of automatically mapping the size of the screen to all the dialog boxes so that they would automatically resize (alongwith the assocaiated buttons etc)

    Read the article

  • Stripes for Java Web Dev, is it worth learning ? Is it easier ? how it compared to Struts ?

    - by cfontes
    I am tired of Java web, and started to learn Ruby on Rails because of that, but I just found this Framework and it looks promessing... But I am not in the mood to study more Java, so I would like to know if this one is worth my time ( that would mean, less configuration and action mapping and so on) Is it better then Struts 2(WebWorks) ??? because those are way better then Struts 1 but still not a RoR. Spring MVC ? I would like a Hands On Opnion, not a specs compare. Thanks !

    Read the article

  • Word 2010 for writing invoices, starting with XML

    - by TomTom
    Hello, we are doing quite some invoice generation, and so far it is based on some pretty awful word automation that is now in for a review with Word 2010. I would love to move to a XML based format for storing / presenting invoices, only going to a word document in the last stage. This means I can use easily othermeans to present an invoice internally from the XML. We use Word as "last stage" because Word is a lot better than anything else ever discovered for formatting - our invoices have quite some text sometimes, in the invoice item table, and word is smartest with handling page breaks in the "correct" way. Now, here my question: is there any proper way by now to do this with XML easily? I remember Word having (had) in 2007 some XML field mapping mechanism, but it did not handle tables in the XML. Was anything changed? What would be the proposed approach for generating an .docx document (starting with a .dotx templace) for an invoice, if the relevant data is available in XML form?

    Read the article

  • ASP.NET MVC Routing

    - by creativeincode
    My website uses categories and sub-categories. I'd like the follow mapping: /Category/Fruit /Category/Fruit/Apples But if I use the below: routes.MapRoute( "Category", // Route name "Category/{category}/{subcategory}", // URL with parameters new { controller = "Entity", action = "Category" } // Parameter defaults ); I get a 404 for /Category/Fruit however /Category/Fruit/Apples works ok. I'd like /Category/Fruit to work as well but I can't add another route with the same name. How do I get around this? Thanks in advance.

    Read the article

  • Clean install of IIS 6 on Windows Server 2003 ignoring 'web.config'?

    - by Vario
    Hi, Any help with this would be really appreciated! As the title suggests, I'm running a brand new install of Windows Server 2003 and IIS 6 and I'm basically attempting to mirror a live web server onto a new internal development server, which runs the same setup. It's an ASP.NET site that relies heavily on URL rewriting (using Intelligencia). ASP.NET is set to run on v2.0.50727 on both servers. I've tried intentionally introduce syntax errors into the web.config and it just appears to be ignoring them completely, so given IIS 6 doesn't read the web.config, the rest of the site doesn't work at all (I get a 404 error, as a 'Default.aspx' doesn't exist since the web.config handles the default page rewriting). Having looked at the Application Mapping, '.config' files are set to use the default 'c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll' which exists. Is there anything else I may be missing? Thanks in advance.

    Read the article

  • Exclude some parameters with POST request on RestKit

    - by Mike Meyers
    I've just integrated RestKit with a Mac application for communicating with a web service. After much confusion, I have successfully got requests and responses working using it. The problem I am now finding is that when I want to make a POST request. I have created a RKRequestDescriptor with a mapping for a whole number of properties and all of the properties are being sent as parameters for the query. I want a way of dynamically changing the parameters that are sent, for example not sending some parameters where the property is nil. Is this possible as part of the built-in functionality of RestKit? And if so, how?

    Read the article

  • Is it bad practice to use python's getattr extensively?

    - by Wilduck
    I'm creating a shell-like environment. My original method of handleing user input was to use a dictionary mapping commands (strings) to methods of various classes, making use of the fact that functions are first class objects in python. For flexibility's sake (mostly for parsing commands), I'm thinking of changing my setup such that I'm using getattr(command), to grab the method I need and then passing arguments to it at the end of my parser. Another advantage of this approach is not having to update my (currently statically implemented) command dictionary every time I add a new method/command. My question is, will I be taking a hit to the efficiency of my shell? Does it matter how many methods/commands I have? I'm currently looking at 30 some commands, which could eventually double.

    Read the article

  • Bypass using Alter Access Mappings for to Open Web from SPItemEventProperties

    - by Greg Ogle
    In the following code, // class overrides SPItemEventreceiver public override void ItemAdding(SPItemEventProperties properties) { using (var site = new SPSite(properties.SiteId)) //SiteId is integer { ... } } The following exception is thrown: System.IO.FileNotFoundException: The Web application at http://URL could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application. One way to work around this is to hard-code (or configure) the URL specified in Alternate Access Mappings. Putting the correct URL in Alternate Access Mappings is ultimately the correct solution, but if possible, I need a work-around that doesn't require configuration.

    Read the article

  • How to dynamically order many-to-many relationship in JPA or HQl?

    - by Indrek
    I have a mapping like this: @ManyToMany(cascade = CascadeType.PERSIST) @JoinTable( name="product_product_catalog", joinColumns={@JoinColumn(name="product_catalog", referencedColumnName="product_catalog")}, inverseJoinColumns={@JoinColumn(name="product", referencedColumnName="product")}) public List<Product> products = new ArrayList<Product>(); I can fetch the products for the catalog nicely, but I can't (dynamically) order the products. How could I order them? I probably have to write a many-to-many HQL query with the order-by clause? I though of passing the orderBy field name string to the query, or is there a better solution? Tables are: products, product_catalog, product_product_catalog (associative table) P.S. Using Play! Framework JPASupport for my entities.

    Read the article

  • Decoupling into DAL and BLL - my concerns.

    - by novice_man
    Hi, In many posts concerning this topic I come across very simple examples that do not answer my question. Let's say a have a document table and user table. In DAL written in ADO.NET i have a method to retries all documents for some criteria. Now I the UI I have a case where I need to show this list along with the names of the creator. Up to know I have it done with one method in DAL containig JOIN statement. However eveytime I have such a complex method i have to do custom mapping to some object that doesn't mark 1:1 to DB. Should it be put into another layer ? If so then I will have to resing from join query for iteration through results and querying each document author. . . which doen't make sense... (performance) what is the best approach for such scenarios ?

    Read the article

  • Getting pixel averages of a vector sitting atop a bitmap...

    - by user346511
    I'm currently involved in a hardware project where I am mapping triangular shaped LED to traditional bitmap images. I'd like to overlay a triangle vector onto an image and get the average pixel data within the bounds of that vector. However, I'm unfamiliar with the math needed to calculate this. Does anyone have an algorithm or a link that could send me in the right direction? (I tagged this as Python, which is preferred, but I'd be happy with the general algorithm!) I've created a basic image of what I'm trying to capture here: http://imgur.com/Isjip.gif

    Read the article

  • Efficient persistent storage for simple id to table of values map for java

    - by wds
    I need to store some data that follows the simple pattern of mapping an "id" to a full table (with multiple rows) of several columns (i.e. some integer values [u, v, w]). The size of one of these tables would be a couple of KB. Basically what I need is to store a persistent cache of some intermediary results. This could quite easily be implemented as simple sql, but there's a couple of problems, namely I need to compress the size of this structure on disk as much as possible. (because of amount of values I'm storing) Also, it's not transactional, I just need to write once and simply read the contents of the entire table, so a relational DB isn't actually a very good fit. I was wondering if anyone had any good suggestions? For some reason I can't seem to come up with something decent atm. Especially something with an API in java would be nice.

    Read the article

  • Automating site interaction

    - by Leocer
    I'm working with a CMS and need to import data to it using typical html forms. The data itself is in csv files with one page per row. Such is the CMS that importing directly to db isn't possible due to the complexity of the design. It's pretty important that i "fake" usual user interaction because the CMS does a lot of background work that's crucial for the import. Basically, for each row in the csv file, I need to copy a csv column to a html textfield, or select a checkbox, or click a certain button. One major issue is mapping the data in the csv to actions in the CMS. So if one column contains the string 'foobar' is really means "set the firstName dropdown widget to 'foobar'". Is there a tool to automate this? I´ve been looking at AutoHotKey, Selendium, Web-Harvester and many other tools but I'm not convinced they are the correct tools. The main problem is being able to interact with the html pages in a easy way.

    Read the article

  • Struts Tiles application

    - by rav83
    Am trying a tiles application.Below is my code tiles-defs.xml </tiles-definitions> <definition name="${YOUR_DEFINITION_HERE}"> </definition> <definition name="commonPage" path="/jsps/template.jsp"> <put name="header" value="/jsps/header.jsp" /> <put name="menu" value="/jsps/menu.jsp" /> <put name="body" value="/jsps/homebody.jsp" /> <put name="footer" value="/jsps/footer.jsp" /> </definition> <definition name="aboutUsPage" extends="commonPage"> <put name="body" value="/jsps/aboutUsBody.jsp" /> </definition> </tiles-definitions> struts-config.xml <action path="/aboutus" type="java.com.mbest.core.action.AboutUsAction" parameter="method"> <forward name="success" path="aboutUsPage"/> <forward name="failure" path="aboutUsPage"/> </action> </action-mappings> template.jsp <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %> <html> <head><title></title></head> <body> <table border="1" cellspacing="0" cellpadding="0" style="width: 98%; height: 100%"> <tr> <td colspan="2"> <tiles:insert attribute="header"/> </td> </tr> <tr style="height: 500px"> <td valign="top" style="width: 200px"> <tiles:insert attribute="menu"/> </td> <td valign="baseline" align="left"> <tiles:insert attribute="body"/> </tr> <tr> <td colspan="2"> <tiles:insert attribute="footer"/> </td> </tr> </table> </body> </html> homebody.jsp <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> <%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> <%@taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %> <html> <head> <title></title> <style type="text/css"> <%@include file="../css/helper.css"%> <%@include file="../css/dropdown.css" %> <%@include file="../css/default.ultimate.css" %> </style> </head> <body> <div id="header"> <ul id="nav" class="dropdown dropdown-horizontal"> <li><span class="dir"><html:link page="/aboutus.do?method=aboutUsPage" >About Us</html:link></span></li> <li><span class="dir"><a href="./">Products</a></span></li> <li><span class="dir"><a href="./">Infrastructure</a></span></li> <li><span class="dir"><a href="./">Pharmaceutical Formulations</a></span></li> <li><span class="dir"><a href="./">Contact Us</a></span></li> </ul> </div> </body> </html> AboutUsAction.java package java.com.mindbest.core.action; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.actions.DispatchAction; public class AboutUsAction extends DispatchAction { public ActionForward aboutUsPage(ActionMapping mapping,ActionForm form, HttpServletRequest request,HttpServletResponse response)throws Exception { return mapping.findForward("success"); } } aboutUsBody.jsp hello In my above code if i try to access the app using (domainname)/example/aboutus.do its giving 500 error.Can anyone help me figure this out?

    Read the article

  • hibernate versioning parent entity

    - by Priit
    Consider two entities Parent and Child. Child is part of Parent's transient collection Child has a ManyToOne mapping to parent with FetchType.LAZY Both are displayed on the same form to a user. When user saves the data we first update Parent instance and then Child collection (both using merge). Now comes the tricky part. When user modifies only Child property on the form then hibernate dirty checking does not update Parent instance and thus does not increase optimistic locking version number for that entity. I would like to see situation where only Parent is versioned and every time I call merge for Parent then version is always updated even if actual update is not executed in db.

    Read the article

  • Vim open file under cursor

    - by ereOn
    Hi, Let's say I have the following file tree: / include/ library/ a.hpp b.hpp src/ a.cpp b.cpp And the following /src/a.cpp file: #include "a.hpp" #include "b.hpp" I always open Vim at the root directory. So when I want to load a.hpp I do : :tabnew include/library/a.hpp or: :tabnew **/a.hpp I'd like to map <F4> to open the file under the cursor in a new tab, using a recursive search. I tried the following mapping command: :map <F4> :tabnew **/expand("<cfile>")<cr> But obviously, this can't work, as it tries to open the file "/expand(" instead. Any clue on how I could do that ? Thanks.

    Read the article

  • rails g migration error

    - by user1506183
    I don't know what to do. Try to use command $ rails g migration vacancy but this command give me error: invoke active_record /home/proger/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych.rb:203:in `parse': (<unknown>): mapping values are not allowed in this context at line 21 column 11 (Psych::SyntaxError) from /home/proger/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych.rb:203:in `parse_stream' from /home/proger/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych.rb:151:in `parse' ... There are many rows in error code I don't know how to fix that Thanks

    Read the article

< Previous Page | 138 139 140 141 142 143 144 145 146 147 148 149  | Next Page >