Daily Archives

Articles indexed Sunday May 30 2010

Page 10/72 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Retrieve property from classpath inside POM

    - by Jeroen
    For my current project I want to integrate a maven plug-in for database migrations. For this plug-in to work, however, I have to obtain the database settings inside my POM. My database settings are currently placed inside a hibernate.properties file, positioned in a directory that is marked as maven resource. For a variety of reasons I do not want to duplicate my database configurations in both the pom and hibernate.properties. I'm aware that maven offers a "filtering" ability which makes it possible to specify the database settings as property inside my POM, and reference them inside my hibernate.properties as ${property_name}. But as I'm using multiple maven profiles, with different property resources, this is not a suitable solution. Instead I'd like my database configurations to be loaded from a property file inside my classpath (e.g. classpath:hibernate.properties), and use these properties in my migration plug-in configuration. I have already tried the org.codehaus.mojo » properties-maven-plugin, but this plug-in only accepts absolute locations. Is there a plug-in which can scan all my maven resources for a certain property?

    Read the article

  • 2 questions. IDO mode not caching properly / forcing buffers to named windows.

    - by user112043
    1 My ido mode does not properly cache filenames / folders. It will list files inside a folder, but from a while ago without any of the newer files showing. Any suggestions ? 2 In jde, when I have multiple windows open, compiling on one window will create a corresponding "* name of the class *" that will open on the next window in order. This is fine if I only have one window open but can I get some help writing a function that I could use to : Name a window Force all buffers of JDE compile server to only ever open in that window if it exists Force all run windows from jde in the form of * name of the class * to open in the same window if it exists. Jde automatically names the buffer " * name of the class * ", I will probably dig around the codes to find an easy fix for that... so if the code could just force all windows using a regexp containing * jde run - filename * or something along the lines would also work. Thanks for your help, first post here as well. I really would like just some ideas on what may be going wrong with 1, 2 if anyone is feeling kind.

    Read the article

  • C++ struct containing unsigned char and int bug

    - by powerfear
    Ok i have a struct in my C++ program that is like this: struct thestruct { unsigned char var1; unsigned char var2; unsigned char var3[2]; unsigned char var4; unsigned char var5[8]; int var6; unsigned char var7[4]; }; When i use this struct, 3 random bytes get added before the "var6", if i delete "var5" it's still before "var6" so i know it's always before the "var6". But if i remove the "var6" then the 3 extra bytes are gone. If i only use a struct with a int in it, there is no extra bytes. So there seem to be a conflict between the unsigned char and the int, how can i fix that?

    Read the article

  • Convert Justified Paragraph To Image

    - by rsrobbins
    I need to convert a paragraph of text into an image. Converting the text into an image is no problem. I have the code to do that. But the text must be shown as a paragraph with each line centered. That is a problem! Currently I can convert the text into a left justified paragraph because there are carriage returns in the text string. I suppose it could be center justified with spaces in the string but it would be hard to calculate the required spaces. There must be an easier way. What I need is some way to format the text into a paragraph and then convert it back into a string, preserving spaces. This needs to be done in VB.NET for an ASP.NET web application. Any ideas? I could get the paragraph justified in Rich Text Format but I don't know if it can be converted back into a string, preserving spaces. Creating a PDF is another possibility. The image created from the text needs to be 300 DPI with a transparent background. I'm using the DrawString method of a Graphics object to create the image.

    Read the article

  • new line in java

    - by user225269
    Java newbie here, I'm having trouble setting a new line in this code: String FnameTextboxText = FnameTextbox.getText(); String LastnameTextboxText = LastnameTextbox.getText(); String CourseTextboxText = CourseTextbox.getText(); Summary.setText("Firstname:" + " " + FnameTextboxText + "\nLastname:" + " " + LastnameTextboxText + "\nCourse:" + " " + CourseTextboxText); Also tried something like: "\n" + "Lastname" But its no good. Do you have any idea on how to make new lines. So that it'll look like this; Firstname: x Lastname: y Course: Z Using netbeans 6.8. On windows.

    Read the article

  • How come module-level validation errors only display when property-level validators are Valid?

    - by jonathanconway
    I'm using the module-level validator: 'PropertiesMustMatch' on my view-model, like so: [PropertiesMustMatch("Password", "PasswordConfirm")] public class HomeIndex { [Required] public string Name { get; set; } public string Password { get; set; } public string PasswordConfirm { get; set; } } I'm noticing that if I submit the form without Name filled in, the ValidationSummary() helper returns only the following error: The Name field is required. However, if I fill in Name, then ValidationSummary() will return a PropertiesMustMatch error: 'Password' and 'PasswordConfirm' do not match. So it looks like the property-level validators are being evaluated first, then the model-level validators. I would much prefer if they were all validated at once, and ValidationSummary would return: The Name field is required. 'Password' and 'PasswordConfirm' do not match. Any ideas what I can do to fix this? I'm studying the MVC 2 source-code to try to determine why this happens.

    Read the article

  • Variable collation with MySQL stored procedure?

    - by Chad Johnson
    I want to do something like this in a stored procedure: IF case_sensitive = FALSE THEN SET search_collation = "utf8_unicode_ci"; ELSE SET search_collation = "utf8_bin"; END IF; INSERT INTO TABLE1 (field1, field2) SELECT * FROM TABLE 2 WHERE some_field LIKE '%rarf%' collate search_collation; However, when I do this, I get ERROR 1273 (HY000): Unknown collation: 'search_collation' How can I use a dynamic collation without having two copies of the same query?

    Read the article

  • Intel Core 2 Duo E6600 versus AMD Athlon II X2 3GHZ

    - by Billy ONeal
    Hello :) I have an Intel Core 2 Duo E6600 (2.4GHZ) in my current desktop, and I have a newer machine with an AMD Athlon II X2 3.0GHZ. I'm wondering how the systems will perform in comparison to one another. I'd like to use the AMD because it's 45nm and uses less power, but I don't want to do so at a loss in perforamnce. Which should perform better? Billy3

    Read the article

  • C# LINQ: How to remove element from IQueryable<T>

    - by aximili
    How do you loop through IQueryable and remove some elements I don't need. I am looking for something like this var items = MyDataContext.Items.Where(x => x.Container.ID == myContainerId); foreach(Item item in items) { if(IsNotWhatINeed(item)) items.Remove(item); } Is it possible? Thanks in advance

    Read the article

  • Rails 2.3: How to create this SQL into a named_scope

    - by randombits
    Having a bit of difficulty figuring out how to create a named_scope from this SQL query: select * from foo where id NOT IN (select foo_id from bar) AND foo.category = ? ORDER BY RAND() LIMIT 1; Category should be variable to change. What's the most efficient way the named_scope can be written for the problem above?

    Read the article

  • Variable collation with MySQL stored function?

    - by Chad Johnson
    I want to do something like this in a stored procedure: IF case_sensitive = FALSE THEN SET search_collation = "utf8_unicode_ci"; ELSE SET search_collation = "utf8_bin"; END IF; INSERT INTO TABLE1 (field1, field2) SELECT * FROM TABLE 2 WHERE some_field LIKE '%rarf%' collate search_collation; However, when I do this, I get ERROR 1273 (HY000): Unknown collation: 'search_collation' Also, if I do what's suggested at http://stackoverflow.com/questions/1680850/mysql-stored-procedures-use-a-variable-as-the-database-name-in-a-cursor-declara/2070021#2070021 I get Dynamic SQL is not allowed in stored function or trigger How can I use a dynamic collation?

    Read the article

  • Modifying association arrays on cloned ActiveRecord objects

    - by Craig Walker
    I have an ActiveRecord model class Foo that has_many Bar. I want to clone a Foo (to get duplicates of most of its attributes) and then modify its Bar instances. This is a problem because cloned ActiveRecord instances share the same associated array; changes to one affect the other. f1 = Foo.new b = Bar.new f1.bars << b f2 = f1.clone f2.bars.includes? b # true f1.bars.clear f2.bars.includes? b # now false The real problem is that I can't detach the bars arrays from either Foo: f1.bars << b f2.bars.includes? b # true f2.bars = [] f2.bars.includes? b # now false f1.bars.includes? b # now also false If I could do that, then I could replace the Bars as I wanted to. However, any change to one Foo seems to affect the other.

    Read the article

  • Should I worry about DDMS console log messages "Can't bind to local nnnn for debugger"?

    - by Chris
    I'm new to Android programming (and Eclipse IDE and Android emulator). I've got Hello World and some of Notepad working, but I'm still constantly getting quite a few DDMS console log messages (shown below) about not being able to bind locals for debugger. Is this a problem? Can I get rid of these messages somehow? [2010-05-29 21:03:16 - ddms]Can't bind to local 8601 for debugger [2010-05-29 21:05:26 - Device]Failed to delete temporary package: device (emulator-5556) request rejected: device not found [2010-05-29 21:06:47 - ddms]Can't bind to local 8600 for debugger [2010-05-29 21:07:05 - ddms]Can't bind to local 8601 for debugger [2010-05-29 21:07:05 - ddms]Can't bind to local 8602 for debugger [2010-05-29 21:07:06 - ddms]Can't bind to local 8604 for debugger [2010-05-29 21:07:07 - ddms]Can't bind to local 8609 for debugger [2010-05-29 21:07:17 - ddms]Can't bind to local 8610 for debugger [2010-05-29 21:07:20 - ddms]Can't bind to local 8613 for debugger [2010-05-29 21:08:20 - ddms]Can't bind to local 8616 for debugger [2010-05-29 21:08:20 - ddms]Can't bind to local 8618 for debugger [2010-05-29 21:08:20 - ddms]Can't bind to local 8620 for debugger [2010-05-29 21:08:20 - ddms]Can't bind to local 8627 for debugger [2010-05-29 21:08:21 - ddms]Can't bind to local 8632 for debugger [2010-05-29 21:08:23 - ddms]Can't bind to local 8636 for debugger [2010-05-29 21:08:23 - ddms]Can't bind to local 8640 for debugger [2010-05-29 21:08:23 - ddms]Can't bind to local 8643 for debugger

    Read the article

  • How come module-level validators are evaluated only after property-level validators?

    - by jonathanconway
    I'm using the module-level validator: 'PropertiesMustMatch' on my view-model, like so: [PropertiesMustMatch("Password", "PasswordConfirm")] public class HomeIndex { [Required] public string Name { get; set; } public string Password { get; set; } public string PasswordConfirm { get; set; } } I'm noticing that if I submit the form without Name filled in, the ValidationSummary() helper returns only the following error: The Name field is required. However, if I fill in Name, then ValidationSummary() will return a PropertiesMustMatch error: 'Password' and 'PasswordConfirm' do not match. So it looks like the property-level validators are being evaluated first, then the model-level validators. I would much prefer if they were all validated at once, and ValidationSummary would return: The Name field is required. 'Password' and 'PasswordConfirm' do not match. Any ideas what I can do to fix this? I'm studying the MVC 2 source-code to try to determine why this happens.

    Read the article

  • Can't append space at end of UITextView

    - by Sam V
    I have a UITextView in which I want the initial value to be "@username " (notice the space after the username). This way the user can start typing right away without having to tap space. So I do: textView.text = [NSString stringWithFormat:@"@%@ ", username]; But it seems like it's impossible to have the UITextView text property ending with a space (it always gets stripped out). Am I correct? Is there any workaround for this? I tried using the \s char and no success.

    Read the article

  • Check request type in Django

    - by Art
    While it is recommended to use the following construct to check whether request is POST, if request.method == 'POST': pass It is likely that people will find if request.POST: pass to be more elegant and concise. Are there any reasons not to use it, apart from personal preference?

    Read the article

  • SVN : how to change hostname?

    - by elon
    I'd like to sep up SVN repo on local machine. But we already have apache running under localhost. When I use instalator form subversion site with apache option it installs another apache and when I type "localhost" in browser I see this new apache (not the old one). Question is how to run this new apache under other host name. When installing it asks about it, so I set different name, but it still works under localhost (nothing happens). I'd like to have access to svn via URL e.g. "svnrepo" not "localhost". What can I do about it? Which lines of config should be changed (and/or what's more should be changed?) Another way I'm thinking of to solve this problem is to integrate this svn-apache module with mine apache. But still I don't really know how to do it (my apache is 2.2.6)

    Read the article

  • jQuery Tabs - Following External Links

    - by Ricky
    I have jQuery Tabs setup, but am trying to get a Tab to follow an external link. I have tried to use the code from jQuery, but the URL still loads via Ajax instead of redirecting the browser to the url: http://jqueryui.com/demos/tabs/#...follow_a_tab.27s_URL_instead_of_loading_its_content_via_ajax Current code: $(function() { $('#rotate > ul').tabs({ select: function(event, ui) { var url = $.data(ui.tab, 'load.tabs'); if( url ) { location.href = url; return false; } return true; } }); });

    Read the article

  • Handling Model Inheritance in ASP.NET MVC2 & NHibernate

    - by enth
    I've gotten myself stuck on how to handle inheritance in my model when it comes to my controllers/views. Basic Model: public class Procedure : Entity { public Procedure() { } public int Id { get; set; } public DateTime ProcedureDate { get; set; } public ProcedureType Type { get; set; } } public ProcedureA : Procedure { public double VariableA { get; set; } public int VariableB { get; set; } public int Total { get; set; } } public ProcedureB : Procedure { public int Score { get; set; } } etc... many of different procedures eventually. So, I do things like list all the procedures: public class ProcedureController : Controller { public virtual ActionResult List() { IEnumerable<Procedure> procedures = _repository.GetAll(); return View(procedures); } } but now I'm kinda stuck. Basically, from the list page, I need to link to pages where the specific subclass details can be viewed/edited and I'm not sure what the best strategy is. I thought I could add an action on the ProcedureController that would conjure up the right subclass by dynamically figuring out what repository to use and loading the subclass to pass to the view. I had to store the class in the ProcedureType object. I had to create/implement a non-generic IRepository since I can't dynamically cast to a generic one. public virtual ActionResult Details(int procedureID) { Procedure procedure = _repository.GetById(procedureID, false); string className = procedure.Type.Class; Type type = Type.GetType(className, true); Type repositoryType = typeof (IRepository<>).MakeGenericType(type); var repository = (IRepository)DependencyRegistrar.Resolve(repositoryType); Entity procedure = repository.GetById(procedureID, false); return View(procedure); } I haven't even started sorting out how the view is going to determine which partial to load to display the subclass details. I'm wondering if this is a good approach? This makes determining the URL easy. It makes reusing the Procedure display code easy. Another approach is specific controllers for each subclass. It simplifies the controller code, but also means many simple controllers for the many procedure subclasses. Can work out the shared Procedure details with a partial view. How to get to construct the URL to get to the controller/action in the first place? Time to not think about it. Hopefully someone can show me the light. Thanks in advance.

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >