Search Results

Search found 822 results on 33 pages for 'mr calm'.

Page 3/33 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • What is the best option for reading Java property files?

    - by Mr Morgan
    Hello I have an application which uses a servlet to read an intialization parameter from web.xml for the location of a property file. The serlvet then creates an instance of a class which stores the location of the file for other programs to read as required. This class has appropriate get and set methods. But my question concerns access to the properties: should the physical property file be read by each program as at runtime or should the properties be stored in memory instead? The properties are not currently altered at runtime but this could change? I've seen various alternative approaches but am not sure which is best. Thanks Mr Morgan

    Read the article

  • Getting the count of rows in a Java resultset

    - by Mr Morgan
    Hello Does anyone know a better way of getting the number of rows in a Java resultset returned from a MySQL database? I'm currently using this: public static int getResultSetRowCount(ResultSet resultSet) { int size = 0; try { resultSet.last(); size = resultSet.getRow(); resultSet.beforeFirst(); } catch(Exception ex) { return 0; } return size; } But am open to alternatives. The resultset returned is not going to be the total number of rows read from the database so I don;t think I can use SQL COUNT. Thanks Mr Morgan.

    Read the article

  • Use of Java constructors in persistent entities

    - by Mr Morgan
    Hello I'm new to JPA and using persistence in Java anyway and I have two questions I can't quite work out: I have generated tags as: @JoinColumn(name = "UserName", referencedColumnName = "UserName") @ManyToOne(optional = false) private User userName; @JoinColumn(name = "DatasetNo", referencedColumnName = "DatasetNo") @ManyToOne(optional = false) private Dataset datasetNo; But in one of the constructors for the class, no reference is made to columns UserName or DatasetNo whereas all other columns in the class are referenced in the constructor. Can anyone tell me why this is? Both columns UserName and DatasetNo are 'foreign keys' on the entity Visualisation which corresponds to a database table of the same name. I can't quite work out the ORM. And when using entity classes, or POJO, is it better to have class variables like: private User userName; Where an instance of a class is specified or simply the key of that class instance like: private String userName; Thanks Mr Morgan.

    Read the article

  • How to upgrade all dependencies to a specific version

    - by Calm Storm
    Hi, I tried doing a mvn dependency:tree and I get a tree of dependencies. My question is, My project depends on many modules which internally depends on many spring artifacts. There are a few version clashes. I want to upgrade all spring related libraries to say the latest one (2.6.x or above). What is the preferred way to do this? Should I declare all the deps spring-context, spring-support (and 10 other artifacts) in my pom.xml and point them to 2.6.x ? Is there any other better method ? [INFO] +- com.xxxx:yyy-jar:jar:1.0-SNAPSHOT:compile [INFO] | +- com.xxxx:zzz-commons:jar:1.0-SNAPSHOT:compile [INFO] | | +- org.springframework:spring-dao:jar:2.0.7:compile [INFO] | | +- org.springframework:spring-jdbc:jar:2.0.7:compile [INFO] | | +- org.springframework:spring-web:jar:2.0.7:compile [INFO] | | +- org.springframework:spring-support:jar:2.0.7:compile [INFO] | | +- net.sf.ehcache:ehcache:jar:1.2:compile [INFO] | | +- commons-collections:commons-collections:jar:3.2:compile [INFO] | | +- aspectj:aspectjweaver:jar:1.5.3:compile [INFO] | | +- betex-commons:betex-commons:jar:5.5.1-2:compile [INFO] | | \- javax.servlet:servlet-api:jar:2.4:compile [INFO] | +- org.springframework:spring-beans:jar:2.0.7:compile [INFO] | +- org.springframework:spring-jmx:jar:2.0.7:compile [INFO] | +- org.springframework:spring-remoting:jar:2.0.7:compile [INFO] | +- org.apache.cxf:cxf-rt-core:jar:2.0.2-incubator:compile [INFO] | | +- org.apache.cxf:cxf-api:jar:2.0.2-incubator:compile [INFO] | | | +- org.apache.geronimo.specs:geronimo-activation_1.1_spec:jar:1.0-M1:compile [INFO] | | | +- org.codehaus.woodstox:wstx-asl:jar:3.2.1:compile [INFO] | | | +- org.apache.neethi:neethi:jar:2.0.2:compile [INFO] | | | \- org.apache.cxf:cxf-common-schemas:jar:2.0.2-incubator:compile UPDATE : I have removed the extra question about "\-" so my question is now what the subject asks for :)

    Read the article

  • How to ask BeanUtils to ignore null values

    - by Calm Storm
    Using Commons beanUtils I would like to know how to ask any converter say the Dateconverter to ignore null values and use null as default. As an example consider a public class, public class X { private Date date1; private String string1; //add public getters and setters } and my convertertest as, public class Apache { @Test public void testSimple() throws Exception { X x1 = new X(), x2 = new X(); x1.setString1("X"); x1.setDate1(null); org.apache.commons.beanutils.BeanUtils.copyProperties(x2, x1); //throws ConversionException System.out.println(x2.getString1()); System.out.println(x2.getDate1()); } } The above throws a NPE since the date happens to be null. This looks a very primitive scenario to me which should be handled by default (as in, I would expect x2 to have null value for date1). The doco tells me that I can ask the converter to do this. Can someone point me as to the best way for doing this ? I dont want to get hold of the Converter and isUseDefault() to be true because then I have to do it for all Date, Enum and many other converters !

    Read the article

  • What does the \- mean in the mvn dependency tree output

    - by Calm Storm
    Hi, I tried doing a mvn dependency:tree and I get a tree of dependencies. The output looks like below. I want to know what is the "-" symbol that is shown at times and the "+-" symbol for other dependencies (it doesnt seem to be the scope) My actual question is, My project depends on many modules which internally depends on many spring artifacts. There are a few version clashes. I want to upgrade all spring related libraries to say the latest one (2.6.x or above). What is the preferred way to do this? Should I declare all the deps spring-context, spring-support (and 10 other artifacts) in my pom.xml and point them to 2.6.x ? Is there any other better method ? [INFO] +- com.xxxx:yyy-jar:jar:1.0-SNAPSHOT:compile [INFO] | +- com.xxxx:zzz-commons:jar:1.0-SNAPSHOT:compile [INFO] | | +- org.springframework:spring-dao:jar:2.0.7:compile [INFO] | | +- org.springframework:spring-jdbc:jar:2.0.7:compile [INFO] | | +- org.springframework:spring-web:jar:2.0.7:compile [INFO] | | +- org.springframework:spring-support:jar:2.0.7:compile [INFO] | | +- net.sf.ehcache:ehcache:jar:1.2:compile [INFO] | | +- commons-collections:commons-collections:jar:3.2:compile [INFO] | | +- aspectj:aspectjweaver:jar:1.5.3:compile [INFO] | | +- betex-commons:betex-commons:jar:5.5.1-2:compile [INFO] | | \- javax.servlet:servlet-api:jar:2.4:compile [INFO] | +- org.springframework:spring-beans:jar:2.0.7:compile [INFO] | +- org.springframework:spring-jmx:jar:2.0.7:compile [INFO] | +- org.springframework:spring-remoting:jar:2.0.7:compile [INFO] | +- org.apache.cxf:cxf-rt-core:jar:2.0.2-incubator:compile [INFO] | | +- org.apache.cxf:cxf-api:jar:2.0.2-incubator:compile [INFO] | | | +- org.apache.geronimo.specs:geronimo-activation_1.1_spec:jar:1.0-M1:compile [INFO] | | | +- org.codehaus.woodstox:wstx-asl:jar:3.2.1:compile [INFO] | | | +- org.apache.neethi:neethi:jar:2.0.2:compile [INFO] | | | \- org.apache.cxf:cxf-common-schemas:jar:2.0.2-incubator:compile

    Read the article

  • Spring maven libraries

    - by Calm Storm
    I would like to know why some of the libraries are not released during a normal release cycle. For example, from http://repo2.maven.org/maven2/org/springframework/ while spring-core have 3.0.3-RELEASE, spring-remoting and spring-jmx were released only in 2.0.8. Can someone tell me what this would mean? I agree that if there are no changes in the component say spring-jmx then they don't have to release it, but since 90% of the world uses Maven for dependency management can they not just re-release the same libs (of spring-remoting and spring-jmx?) I ask this because I declare my deps like, <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-remoting</artifactId> <version>${spring.version}</version> </dependency> and I would prefer supplying one spring.version instead of keeping version numbers upto date for all components? The four libraries of interest to me are spring-dao, spring-support, spring-jmx, spring-remoting

    Read the article

  • JConsole does not connect when a program (running in eclipse) is waiting for a console input

    - by Calm Storm
    Hi, I have a problem similar to the one mentioned here. I have a program which launches a selenium browser and refreshes it every 2 seconds. My idea here was to monitor the memory usage of my application as the page is being hit. This console program does a "System.in.read" and when a user presses enter key, this stops the browser refresh thread. I run the program and it runs as I would expect it to. But when I fire jconsole and attach it to the process, it looks like jconsole waits forever to attach. This is because of the "System.in.read", apparently as shown in the JConsole source. In my code it makes perfect sense for me to terminte the browser when user presses something so is there any alternative available at all ? (Posted code sample below) package com.ekanathk; import java.util.ArrayList; import java.util.List; import org.junit.Test; public class MultiThread { @Test public void testSimple() throws Exception { List<Integer> x = new ArrayList<Integer>(); for(int i = 0; i < 1000; i++) { x.add(i); } System.out.print("Press Enter to stop (try attach a jconsole now...."); System.in.read(); } } The problem here seems to be that any System.in.read (either in Main thread or any threads) seems to completely block jconsole. I guess the problem essentially boils down to multiple threads requesting system inputs at the same time? Is there a solution ? UPDATE 1: It seems this works fine when launching the class from a command line, however when I run from eclipse, jconsole cant connect. Any reasons ?

    Read the article

  • JConsole does not connect when a program is waiting for a console input

    - by Calm Storm
    Hi, I have a problem similar to the one mentioned here. I have a program which launches a selenium browser and refreshes it every 2 seconds. My idea here was to monitor the memory usage of my application as the page is being hit. This console program does a "System.in.read" and when a user presses enter key, this stops the browser refresh thread. I run the program and it runs as I would expect it to. But when I fire jconsole and attach it to the process, it looks like jconsole waits forever to attach. This is because of the "System.in.read", apparently as shown in the JConsole source. In my code it makes perfect sense for me to terminte the browser when user presses something so is there any alternative available at all ? (Posted code sample below) package com.ekanathk; import java.util.ArrayList; import java.util.List; import org.junit.Test; public class MultiThread { @Test public void testSimple() throws Exception { List<Integer> x = new ArrayList<Integer>(); for(int i = 0; i < 1000; i++) { x.add(i); } System.out.print("Press Enter to stop (try attach a jconsole now...."); System.in.read(); } } The problem here seems to be that any System.in.read (either in Main thread or any threads) seems to completely block jconsole. I guess the problem essentially boils down to multiple threads requesting system inputs at the same time? Is there a solution ?

    Read the article

  • Maven eclipse does not add a dependency

    - by Calm Storm
    I have the following snippet in my pom.xml <dependency> <groupId>aspectj</groupId> <artifactId>aspectjrt</artifactId> <version>1.5.3</version> </dependency> and in one of my Java files I refer a class org.aspectj.lang.ProceedingJoinPoint. When I do a "mvn clean install" it compiles and builds fine but when I do an eclipse:eclipse, and import the project in eclipse it gives me an error The import org.aspectj cannot be resolved. I checked the .classpath file that was generated and it does not have an entry to this file. I tried a "mvn dependency:tree" and it lists this fine. Can someone tell me what is going wrong here?

    Read the article

  • Give me a practical use-case of Multi-set

    - by Calm Storm
    I would like to know a few practical use-cases (if they are not related/tied to any programming language it will be better).I can associate Sets, Lists and Maps to practical use cases. For example if you wanted a glossary of a book where terms that you want are listed alphabetically and a location/page number is the value, you would use the collection TreeMap(OrderedMap which is a Map) Somehow, I can't associate MultiSets with any "practical" usecase. Does someone know of any uses? http://en.wikipedia.org/wiki/Multiset does not tell me enough :) PS: If you guys think this should be community-wiki'ed it is okay. The only reason I did not do it was "There is a clear objective way to answer this question".

    Read the article

  • Why do most Database developers hate Agile

    - by Calm Storm
    To me "Agile" methodology is a common-sense oriented approach and one that should likely be adopted for most software projects. I find that while a lot of Middle Tier Developers and Front End developers find it a very sensible project delivery model, plenty of Database developers (and good ones) seem to be totally against it. They are very keen on knowing the biggest picture and designing a database solution that will cater to that. They do not seem to like "Vertical striping" of a functionality. They would rather see the complete design document/feature document instead of concentrating on small user stories. Sarcasm aside, can someone realistically provide some insight as to why this mentality is prevalent? Especially DB devs? What would be a convincing argument against that?

    Read the article

  • Job queueing and execute Mechanism

    - by Calm Storm
    In my webservice all method calls submits jobs to a queue. Basically these operations take long time to execute, so all these operations submit a Job to a queue and return a status saying "Submitted". Then the client keeps polling using another service method to check for the status of the job. Presently, what I do is create my own Queue, Job classes that are Serializable and persist these jobs (i.e, their serialized byte stream format) into the database. So an UpdateLogistics operation just queues up a "UpdateLogisticsJob" to the queue and returns. I have written my own JobExecutor which wakes up every N seconds, scans the database table for any existing jobs, and executes them. Note the jobs have to persisted because these jobs have to survive app-server crashes. This was done a long time ago, and I used bespoke classes for my Queues, Jobs, Executors etc. But now, I would like to know has someone done something similar before? In particular, Are there frameworks available for this ? Something in Spring/Apache etc Any framework that is easy to adapt/debug and plays well along with libraries like Spring will be great.

    Read the article

  • Intellij UML diagram does not show one to many relationships

    - by Calm Storm
    I am trying to follow http://www.jetbrains.com/idea/features/uml_class_diagram.html I have a few classes so when I do Ctrl + Alt + U I only see all classes and just Extends relationships. Please note that I have set the "Diagrams" options in my settings to show one to many etc. I do not see One to One, One to Many relationships at all ? I have used JPA OneToOne Annotations and they dont turn up at all? Pressing Ctrl Shift F12 does not do anything? Can someone please explain?

    Read the article

  • Google App Engine/Simple HTML, how to write input boxes with google autocomplete

    - by Calm Storm
    I am writing a GAE application and I would like to have an input box with google auto-suggest. Specifically, when a user types "Shawshank" I would like to see google's suggestions in my drop down. Can someone tell me what are the different ways of doing this? I understand I may have to use some javascript libraries so any code samples etc will help immensely. (Pure javascript/jquery kinda solutions will be more preferable)

    Read the article

  • Ruby getting the diagonal elements in a 2d Array

    - by Calm Storm
    Hi, I was trying some problems with my 2D ruby array and my LOC reduces a lot when I do array slicing. So for example, require "test/unit" class LibraryTest < Test::Unit::TestCase def test_box array = [[1,2,3,4],[3,4,5,6], [5,6,7,8], [2,3,4,5]] puts array[1][2..3] # 5, 6 puts array[1..2][1] # 5, 6, 7, 8 end end I want to know if there is a way to get a diagonal slice? Lets say I want to start at [0,0] and want a diagonal slice of 3. Then I would get elements from [0,0], [1,1], [2,2] and I will get an array like [1,4,7] for example above. Is there any magic one-liner ruby code that can achieve this? 3.times do {some magic stuff?}

    Read the article

  • Putting a variable name = value format in Ruby

    - by Calm Storm
    Hi, I would like to add some debugs for my simple ruby functions and I wrote a function as below, def debug(&block) varname = block.call.to_s puts "#{varname} = #{eval(varname,block)}" end debug {:x} #prints x = 5 debug {:y} #prints y = 5 I understand that eval is evil. So I have two questions. Is there any way to write that debug method without using eval? If NO is there a preferred way to do this? Is there any way to pass a list of arguments to this method? I would ideally prefer debug {:x, :y. :anynumOfvariables}. I could not quite figure out how to factor that into the debug method (i.e, to take a list of arguments)

    Read the article

  • Filter Calendar view SharePoint WWS 3.0

    - by lerac
    Hi all, I have a SP site with a calendarview and would like to filter this on the basis of the current user. Don't be afraid I already figured out how do to this with a list customizing some excisting jScripts and working with Content Editor WebPart. Yet this jScript does not work in a Calendar. To paint a picture I have columns like: Judge1 Lawyer Clerk (example). Underneath these columns there are names ofcourse. However these are not shown in Calendar view, so it is hard to filter on something that is not displayed only the casenumbers. Now I've been thinking (not always wise) perhaps I can adjust the aspx page of calendar/list by adjusting a filter I applied in SharePoint. This would also solve the issue of displaying all the content before it filters with Java, since it should not be possible for users to see the entire listcontent (security). I went to Modify list view and created a filter where judge1 = Mr. J. Jenkins. Then I went to SharePoint Designer and opend the Calendar aspx page. To my expectation I found Mr. J. Jenkins with the following code: Since I can't display image because i'm new, not very handy discrimination I have to give you a url. Code can't be pasted either is completely messes it up even with codemode on. Hyperlink CODE IMAGE Keep in mind I just posted a very tiny part of the code (only the part I want to change). Now I have no idea what kind of code this is above this text (SP wss 3.0 uses for aspx pages), but I would like to change Mr. J. Jenkins into a jScript var/val. Since I already managed to get the current user that is logged in content. var user = jP.getUserProfile(); var userinfspvalue = user.Department; There is more code around that one 2 ofcourse, yet to give you a picture. The var userinfspvalue is what I would like to replace the text Mr. J. Jenkins into. This would mean the calendar would be dynamically filtered based upon the current user that is logged on. Have no idea what is possible, perhaps there is a better solution who knows... Do you know? Thank you so much ahead!

    Read the article

  • Run time error in vb.net

    - by Muhammed Yoosuf
    I get the following error message in vb.net when I try to run the program Any help is greatly appreciated. Thanks Error 1 Unable to copy file "C:\Users\Mr. M Yoosuf Hassan\Desktop\CD\Software (full version)\Airline Reservation System - Copy\Airline Reservation System\Airline2.mdb" to "bin\Debug\Airline2.mdb". Could not find file 'C:\Users\Mr. M Yoosuf Hassan\Desktop\CD\Software (full version)\Airline Reservation System - Copy\Airline Reservation System\Airline2.mdb'. Airline Reservation System

    Read the article

  • Align the values of the cells in JTable?

    - by Venkats
    I'm not aware of how to align the values of cells in JTable. For Ex,The Jtable shows, Name Salary Mr.X 100000.50 XXXX 234.34 YYYy 1205.50 I want to align the "Salaries" in the following format. Name Salary Mr.X 100000.50 XXXX 234.34 YYYy 1205.50 How to align as above the JTable

    Read the article

  • SQL help on a name dilemma

    - by Ardman
    I have a column which has surname and firstname plus salutation in. e.g. Bloggs,Joe,Mr I need to break this out into Bloggs Joe Mr as 3 seperate columns. Any ideas appreciated. How, the other thing is I won't know how many commas are in the initial column.

    Read the article

  • Tuple conversion to a string

    - by David542
    I have the following list: [('Steve Buscemi', 'Mr. Pink'), ('Chris Penn', 'Nice Guy Eddie'), ...] I need to convert it to a string in the following format: "(Steve Buscemi, Mr. Pink), (Chris Penn, Nice Guy Eddit), ..." I tried doing str = ', '.join(item for item in items) but run into the following error: TypeError: sequence item 0: expected string, tuple found How would I do the above formatting?

    Read the article

  • Confused about ASP.NET AJAX, AJAX, jQUERY and javascript

    - by Mr.Y
    Yesterday, I read couple of chapters on ASP.NET Ajax,and jQuery from my ASP.NET 4.0 book and I found those frameworks pretty interesting and decide to learn more about it. Today, I borrow some books from library on AJAX and Javascript. It seems ASP.NET ajax is different from Ajax and jQuery seems like the "new" javascript. Is that means I can skip javascript and learn jQUERY directly? On the other hand, the Ajax(non asp.net) book I borrow from library seems apply to the client side web programming only and looks quite difference from what I learned from ASP.NET AJAX. If I'm a ASP.NET developer I guess I should stick with ASP.NET AJAX instead of client side AJAX right? What about PHP? Is there a "PHP AJAX" similar to ASP.NET AJAX? It's not that I'm "lazy" to learn other tools, but I just want to focus on the right ones. Thx. The more I going deep

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >