Search Results

Search found 14 results on 1 pages for 'javamonkey79'.

Page 1/1 | 1 

  • Why is 2^16 a "special" number?

    - by javamonkey79
    OK, I feel stupid asking this - but in Jeff's article: Getting the Interview Phone Screen Right and originally stated in the 5 essential phone screen questions: They shouldn't stare blankly at you when you ask with 2^16 is. It's a special number. They should know it. I've been a developer\software engineer\code monkey\whatever for a little while now, and I don't think I've ever come across this. I mean, I can certainly count binary values do basic operations on them, etc, etc. But I don't see what is "special" about this value.

    Read the article

  • General List of Common Programming Errors

    - by javamonkey79
    As one journey's from apprentice to journeyman to master I've noticed that one accumulates a list of best practices for things they've been bitten by. Personally, I write most of my stuff in java & SQL so my list tends to be slated towards them. I've accumulated the following: When doing list removal, always reverse iterate Avoid adding items to a list you are currently iterating on Watch out for NullPointerExceptions Now, I know there are language specific "common errors" links out there like this one. And I'm also aware of the pragmatic programmer tips, Martin Fowler's "code smells". Does anyone know of any good lists out there of things like I've listed above (re: list removal, adding items, etc). My guess is that there are some good QA folks out there that can probably throw me a bone here. I'm not looking for things the compiler can catch - I'm looking for common things that cause bugs. In the event that there isn't a list out there already then I welcome posting your own findings here. Thanks in advance!

    Read the article

  • Enforce user time restrictions to log out or off from Windows 7

    - by javamonkey79
    How can I limit the time spent on the computer or force a log out from a Windows 7 machine? I used to use Windows Steady State to limit users (kids) from being on too long but SteadyState does not work with Windows 7 Home Premium and is discontinued. Is there a way to set this up in Windows 7 where it will kick off a user after a set time? Or perhaps there's an alternative program that can help limit the time one user is at the computer.

    Read the article

  • Affordable Wireless Speakers For the Whole House?

    - by javamonkey79
    Does anyone know of any affordable speakers that you can hook up to a HTPC\Media Center and then take the speakers anywhere around the house to listen to them? Basically, what I've found has either been headphones that do this or wireless speakers that site on the desktop. Affordable to me would be $50-100. I think I've seen some options for hundreds of dollars - but I'm looking for something simple that I can use around the house. TIA.

    Read the article

  • @webservice inheritance java

    - by javamonkey79
    I am trying to build a java ee webservice that has a common base class, but the child classes are the actual @webservice classes (and expose the parent class methods as @webmethod's) Like this: public abstract class Parent { @WebMethod public void doSomething(){//...does stuff} } @WebService public class Child extends Parent {} I've tried (and have failed): - annotating the parent class as a webservice as well - making sure all parent methods are annotated with @WebMethod Is this possible, if so, how?

    Read the article

  • How to use a Spring config file in a Maven dependency

    - by javamonkey79
    In dependency A I have the following: <beans> <bean id="simplePersonBase" class="com.paml.test.SimplePerson" abstract="true"> <property name="firstName" value="Joe" /> <property name="lastName" value="Smith" /> </bean> </beans> And then in project B, I add A as a dependency and have the following config: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> <bean id="simplePersonAddress01" parent="simplePersonBase"> <property name="firstName" value="BillyBob" /> <property name="address" value="1060 W. Addison St" /> <property name="city" value="Chicago" /> <property name="state" value="IL" /> <property name="zip" value="60613" /> </bean> </beans> When I use ClassPathXmlApplicationContext like so: BeanFactory beanFactory = new ClassPathXmlApplicationContext( new String[] { "./*.xml" } ); SimplePerson person = (SimplePerson)beanFactory.getBean( "simplePersonAddress01" ); System.out.println( person.getFirstName() ); Spring complains as it can not resolve the parent xml. Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'simplePersonBase' is defined I am sure there is a way to do this, however, I have not found it. Does anyone know how?

    Read the article

  • External log4j.xml file

    - by javamonkey79
    I am trying to run a jar with the log4j.xml file on the file system outside the jar like so: java -jar MyJarName.jar -cp=/opt/companyName/pathToJar/ log4j.configuration=log4j.xml argToJar1 argToJar2 I have also tried: java -jar MyJarName.jar -cp=/opt/companyName/pathToJar/ log4j.configuration=/opt/companyName/pathToJar/log4j.xml argToJar1 argToJar2 The log4j.xml is file is in the same directory as the jar (/opt/companyName/pathToJar/), yet I still get the standard warning message: log4j:WARN No appenders could be found for logger (org.apache.axis.i18n.ProjectResourceBundle). log4j:WARN Please initialize the log4j system properly. Is it possible to have the config file outside the jar, or do I have to package it with the jar? TIA

    Read the article

  • java xml pretty printing - preserve empty elements and white pace

    - by javamonkey79
    Basically, I am looking for a java library that will take this: <foo><bar> </bar><baz>yadda</baz></foo> And pretty print it to this: <?xml version="1.0" encoding="UTF-8"?> <foo> <bar> </bar> <baz>yadda</baz> </foo> e.g. preserving whitespace AND blank elements The closest I have got was with dom4j like so: OutputFormat format = OutputFormat.createPrettyPrint(); format.setTrimText( false ); However, this does not honor the whitespace unless the element contains other character data. I'm not opposed to writing something on my own, but I would think this has already been done, why reinvent the wheel?

    Read the article

  • How to use java ee 6 @Resource annotation

    - by javamonkey79
    The java ee 6 api has an annotation @Resource with an attribute 'lookup', however, so does the java se 6 api (here). However, since java ee 6 is dependent on java se 6, it seems you can not get at the ee version of the annotation and the 'lookup' attribute. Is this a bug or is there some other way to use this annotation that I am missing. TIA

    Read the article

  • Changing a limited user account in XP fails

    - by javamonkey79
    I have the following: using System; using System.DirectoryServices.AccountManagement; public class ChangePassword { public static void Main() { PrincipalContext context = new PrincipalContext(ContextType.Machine); UserPrincipal user = UserPrincipal.FindByIdentity(context, "someLimitedAccount"); user.ChangePassword( "xxx", "zzz" ); } } This works just fine with administrator accounts, but seems to crash like so when I try to change limited accounts in XP: Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. at ChangePassword.Main() Is what I am trying to do possible? If so, how? EDIT #1: I added the following: Console.WriteLine( "user: " + user ); Below this line: UserPrincipal user = UserPrincipal.FindByIdentity(context, "someLimitedAccount"); And I get this: user: It doesn't look like user is null when I print it, but then again I'm not really a .Net guy - I seem to remember this being expected behavior.

    Read the article

  • Good way to "wrap" jars for OSGi with Maven

    - by javamonkey79
    I was looking at the PAX tools on OPS4J for example: this one and I thought I'd found a nice way to: Specify an artifact Create an assembled jar (jar that contains all dependencies) from that jar and it's transitive dependencies Wrap it with BND to create an OSGi bundle It turns out, that I was wrong - it doesn't appear that the PAX stuff does this. (RTFM, right? :) ) But this got me wondering: is there something out there that does what I'm asking? I've thought maybe I could do this by creating a simple POM and using the maven-bundle-plugin but this seems like it might be a bit cumbersome for what I'm asking. NOTE: I get that embedding and assembling jar's is not really "the OSGi way" - so I wouldn't do this unless I really felt it useful. For example - Spring. Thanks in advance.

    Read the article

  • Programatically Start OSGi (Equinox)?

    - by javamonkey79
    I'd like to be able to easily start an OSGi framework (preferably Equinox) and load up any bundles listed in my pom from a java main. Is this possible? If so, how? It seems like the pax tools would do this, but I can't seem to find any documentation indicating such. I know I can start up Equinox like so: BundleContext context = EclipseStarter.startup( ( new String[] { "-console" } ), null ); But I'd like to do more - like I said: load more bundles in, maybe start some services, etc.

    Read the article

  • What is the Rule of Thumb on Exposing Encapsulated Class Methods

    - by javamonkey79
    Consider the following analogy: If we have a class: "Car" we might expect it to have an instance of "Engine" in it. As in: "The car HAS-A engine". Similarly, in the "Engine" class we would expect an instance of "Starting System" or "Cooling System" which each have their appropriate sub-components. By the nature of encapsulation, is it not true that the car "HAS-A" "radiator hose" in it as well as the engine? Therefore, is it appropriate OO to do something like this: public class Car { private Engine _engine; public Engine getEngine() { return _engine; } // is it ok to use 'convenience' methods of inner classes? // are the following 2 methods "wrong" from an OO point of view? public RadiatorHose getRadiatorHose() { return getCoolingSystem().getRadiatorHose(); } public CoolingSystem getCoolingSystem() { return _engine.getCoolingSystem(); } } public class Engine { private CoolingSystem _coolingSystem; public CoolingSystem getCoolingSystem() { return _coolingSystem; } } public class CoolingSystem { private RadiatorHose _radiatorHose; public RadiatorHose getRadiatorHose() { return _radiatorHose; } } public class RadiatorHose {//... }

    Read the article

1