jwenting 1,905 duckman Team Colleague

www.springsource.org comes to mind. Why go further than the source for samples when they have a lot of them?

jwenting 1,905 duckman Team Colleague

if this kind of threads is what they need to 'advertize' their product, .... , might tell us something about the quality of said product.

quality of sad products you mean? :)

happygeek commented: hehe +0
jwenting 1,905 duckman Team Colleague

At the time development of Win8 started, market research showed that by 2012 there would be such a demand. And an even greater demand for laptops with touch screens which were projected to have almost replaced desktops and traditional laptops by now.
That was 5-6 years ago.
If their marketing firm misread the market, you can't blame Steve Balmer for it, not the Win8 dev team who just built what they were told to build based on long term market projections that turned out to be wrong.

jwenting 1,905 duckman Team Colleague

hmm, the perfect smartphone?
Lightweight (no more than 100 grams), small (no more than fits easily into a front pocket of a dress shirt), big screen (10"+, thus directly conflicting with the first two requirements), full size qwerty keyboard (which is about 10 times larger than the maximum size of the device), 2-3 month battery life on standby (the maximum size and weight of the device make that impossible), 2-3 weeks actual use (ditto).
And oh, an old fashioned rotary dial to dial numbers would be nice :)

Ergo, the perfect smartphone does not and cannot exist as it is a series of contradictory requirements.
As is, my 2 year old Samsung XCover is serving me reasonably well, and I hope it will last at least another 2 years though the way the battery is degrading I might have to replace it (or maybe find a replacement battery) within a year.

jwenting 1,905 duckman Team Colleague

too late anyway, if it were really urgent he's dead by now and the computers exploded into clouds of silicon and metal dust.

ddanbe commented: Kwak! +14
jwenting 1,905 duckman Team Colleague

uh, no. If I take a picture of someone, copyright does not rest with that person.
It rests with me, the photographer.

The person(s) in the photo might have some rights, depending on jurisdiction, to place restrictions on how I can use that photo, but that's it.

jwenting 1,905 duckman Team Colleague

One of the founding fathers said: he who gives the government a bit of his liberty to get a bit of security will end up having neither.

Which is exactly what has happened. You let it happen, you asked for it, now you have to live with it. Do not expect the government to ever let go of the power you handed them on a golden platter, in fact expect them to do whatever they can to increase the power they have over you to the point where you have no say in your own life whatsoever.
That's the nature of government, ANY government.

jwenting 1,905 duckman Team Colleague

technically, only 1 class instance is created for any class per classloader.
After that, any number of instance of that class can also be created, as needed, discarded, reused, serialised, deserialised, etc. etc.

jwenting 1,905 duckman Team Colleague

in other words KFC used a 3rd party API that came to them loaded with a worm that targets a different operating system than the one for which the API was created?

Brilliant, worthy of the dailyWTF. The creator of the API that is, and likely the one of the worm as well.

jwenting 1,905 duckman Team Colleague

there are browser specific CSS bits that only work in specific browsers.
There are also bits of the standard that aren't implemented in all browsers.

IE8 doesn't implement all of CSS3, neither do old versions of Chrome and Firefox.
So either work around the problem by not using things that aren't supported in the browser versions you're targeting or change the browser versions you target to include only those that support what you're using.

jwenting 1,905 duckman Team Colleague

no, it doesn't.

The "most powerful" tool is the one that gets the current job done on time, on budget, and on spec with the least future expense (maintenance, runtime environments, etc).
And that's hardly ever just a programming language, but an entire infrastructure.
If all you have to use is nails, a screwdriver is useless despite being arguably 'more powerful' as you can screw screws with greater precision using less energy than driving nails.
If I tell you to create something that has to run on a 20 year old IBM mainframe, you may scream that "Java is the most powerful so I want to use it" but you're never going to get that application written because you can't run Java on that machine.
It's going to be PL/1, like it or not. So PL/1 is the most powerful as it's the only tool in town.
CSS3 is very powerful for rendering websites, but if your website has to be accessed by people using netbooks over a satellite hookup in the African bush, it's again useless as those netbooks won't render that CSS3, leaving the site useless to its target audience. All those graphical niceties also of course cause a lot of extra bandwidth use, which you don't want over that satcom connection as bandwidth is very slow and expensive there.
And yes, I've written web apps for situations like that. Not netbooks the African bush, but PDAs over a dialup connection charged …

ddanbe commented: Nice! +14
jwenting 1,905 duckman Team Colleague

People, this is a signature spam post, look at the OP's signature.

Makes it all the more ironic that he's quite right in saying that there's a lot of underqualified people "graduating" in India.

And yes, we've all encountered them. And yes, they exist elsewhere as well, just (at least in my experience) elsewhere they tend to be a smaller percentage of those you encounter.

I've seen very good people from India, and very bad ones.
Same with everywhere else, though again the balance trends towards larger differences between top and bottom as well as a higher percentage towards the bottom with people from India (and especially with people from India who are in India and got their education there, many of the best of them leave the country and/or get an education in the US or Europe and stay there after (this is in part a result of their caste system which more of less closes the top universities in India to those of higher castes, who tend to thus send their children abroad to get an education instead at places like Harvard and Oxford)).

It's overall cultural as well, unwillingness to admit lack of knowledge to foreigners leading to misinterpreted specs, bugs that could have been avoided by asking a few questions, etc..

jwenting 1,905 duckman Team Colleague

And don't think you know anything, don't assume that just because you had Java classes in school you're a Java expert and/or only suitable for Java jobs.
Apply to entry level jobs in your general field of interest, and don't cherry pick the companies to be only the top brand names because those companies aren't going to hire snot nosed kids whose sole experience is writing out some homework assignments and maybe making a small flash game during a vacation.
So apply to JoeSmoe DataServices Inc. of SmallTown, Nebraska instead of Amazon.

jwenting 1,905 duckman Team Colleague

To recap the audience problem/issue:

You have some good people here, but they're so annoyed with the flood of homework kiddos they're discouraged from posting anything of value.
And that leads to a situation where quality questions, when asked, don't get answered either.
Which is a death spiral.
You might be able to revert that, but it will mean less traffic at least initially as you're going to have to very actively work to dissuade the homework kiddos from coming here and dumping their assignments, then never returning except to look if they got a ready made answer a few days later (and maybe make a nasty comment when they got snark instead of the ready to turn in solution they were asking for).

Of course that puts you right in competition with SO unless you can find a niche besides it (maybe the serious hobbyist, rather than the die hard professional), which is so well established you're small fry.

jwenting 1,905 duckman Team Colleague

Indeed. I've had rejections for being "too nervous" which apparently according to the rejection notice made me seem "desperate".
Next day I got a rejections for being "not nervous enough" which made me apparently "disinterested".

I was feeling the same in both interviews, acting the same. It's a lottery, more or less, with your career at stake as the grand prize and very little you can do to influence where the ball will drop apart from knowing your stuff and not trying to bluff.

nitin1 commented: damn true!! yes. it happens. it's a lottery! +0
jwenting 1,905 duckman Team Colleague

show us what you've done, and tell us where you're stuck, and who knows, someone might enlighten you.

But we're NOT here to do your homework for you (and yes, we can tell that this is a homework assignment, you didn't even bother reformatting it before you pasted it here verbatim).

jwenting 1,905 duckman Team Colleague

I've just visited SO and I don't like it. They seem to be too hung up on conventions and standards, or where such standards are necessary they castigate the inexperienced user without taking into consideration their inexperience. It's a breeding ground for anal retentives.

SO is for and by professionals, and doesn't like (rightly so) kids coming in and dumping their homework questions. Those get ridiculed to the point they never return. Harsh, but deliberate.
If you put in some effort, overall people are more than willing to help there.

Daniweb looks and feels more amateurish, for the hobbyist. Few times I posted a serious question here, answered it myself because after 2 weeks nobody'd even bothered to try to respond to it.
Yet homework kiddos get a flood of solutions to their assignments, despite an official policy to not help them in that way and if you try to dissuade them you get downvotes and in cases even banned here.
Caused me to stop posting here for a long time btw, and I guess others as well who'd been here for years I no longer see.

Choose your target audience, professionals or homework kiddos. But choose wisely. The one group has you compete with SO, the other with roseindia.
Choose which you'd rather be known as, a place with quality people helping each other or a place where you get crap in response to questions that are equally crap.

~s.o.s~ commented: Well put +0
jwenting 1,905 duckman Team Colleague

a major annoyance is that the ad banner on top of the page blacks out the entire site and blocks navigation whenever you hover over it with your mouse.
This doesn't happen in all forums, or maybe with all banners, but it's something needs to be looked at.

jwenting 1,905 duckman Team Colleague

You shouldn't ask what they are looking for, as an interviewee you should know about the company and what they want and that you fulfill those things otherwise you shouldn't have applied.

right in theory, in practice I've been called in blind into job interviews through recruitment agencies and headhunters where I didn't know until a few hours before the interview that there was to be an interview, and didn't know what position or even company I was interviewing with until the person I was to talk with introduced themselves (and in several cases not even then, as that person was was a recruiter who was not permitted to tell me the name of his client).

jwenting 1,905 duckman Team Colleague

There is no "best". In fact there's never any universal "best" of any broad category.

Just think: IF there were a universally "best" programming language, why are there still others out there that are used at all, or at least by more than a few diehard survivors with a religious adherence to something suboptimal?

Same with everything else.

Therefore any question asking for "the best" without a very strictly delimited problem domain is unanswerable (and even then, there are often multiple equally applicable choices).

jwenting 1,905 duckman Team Colleague

please don't revive old threads, and certainly not by posting such utter nonsense.

jwenting 1,905 duckman Team Colleague

AD, there are differences between what private parties are allowed to do under the law and what government agencies are allowed to do under the law.
Links between license plate numbers and personal data are NOT open knowledge AFAIK, you could place a camera in your front yard and film every car passing by and you'd be none the wiser about who's in them.
But the gov does have that data, and does link it, so they know who is driving where at what time, so they can track individual people with reasonable accuracy (of course there could be someone else in the car, but mostly at least the registered owner would be in it).

They're now starting to do the same with public transport tickets, at least in several European countries. Government run, public transport systems now work only with personalised smart cards (or if you can get anonymous and/or single tickets those cost more, sufficiently enough more to seriously discourage their use for the regular traveler...).
Combined with tracking cars, the government can now have a pretty accurate picture (within walking distance from the nearest bus stop) where most everyone in the country is, in near real time.
And that doesn't worry you?

GrimJack commented: JW - I never thought that you and I would agree on anything but you said what I wanted to say better than I could have +0
jwenting 1,905 duckman Team Colleague

I have sympathy for the student whose teacher doesn't know fundamentals of the language like this...

pbj.codez commented: I agree sir +2
TokamakFusion commented: Not constructive +0
jwenting 1,905 duckman Team Colleague

I'd just buy a system from a schoolkid who had to build it as his homework assignment, no need to create something like that from scratch unless you have a big hotel chain with unique requirements, and then you'd best hire a team of experienced programmers.

yusking commented: Yes i do this is what i have but can't proceeed from here. " import java.sql.*; import java.text.DateFormat; import java.text.SimpleDateFormat; public static void main(String[] args) throws ClassNotFoundException{ Class.forName("org.sqlite.JDBC"); +0
jwenting 1,905 duckman Team Colleague

Sometimes I do, usually I don't have to because some other kid has already done it for me in the mistaken impression he was handing an actual solution.

jwenting 1,905 duckman Team Colleague

what should you do? You should not use 30 year old (yes, you read it right there) compilers.

jwenting 1,905 duckman Team Colleague

or learn something new rather than mindlessly rehashing the few tricks you already know...

jwenting 1,905 duckman Team Colleague

uh, no. You're wrong on all counts there...

ORIGINALLY the javax packages were eXtensions (or some people say eXperimental) to the language which were distributed separately.
Rather than cause all the code that was already using them to break when they were integrated into the core distribution, the package names were kept.

It's a lesson in careful design of your public interfaces, what not to do when designing a naming system :)

jwenting 1,905 duckman Team Colleague

the JRE does not even contain a compiler...
It is rather contained itself within the JDK which also contains a compiler.

AS to the "problem", try learning a bit of Java. Start with a basic tutorial and work your way up from there.

stultuske commented: thanks for correcting me +14
jwenting 1,905 duckman Team Colleague

Dropbox works for me, and doesn't have the problems some people are having with Skydrive where trying to load a file into their applications that's hosted on Skydrive causes their computers to crash (which is probably due to those applications, not Skydrive).

jwenting 1,905 duckman Team Colleague

you might well be able to send email directly from your database from a trigger on the table that you're monitoring.

bibiki commented: I did not know that +4
jwenting 1,905 duckman Team Colleague

you're going to have to learn Java if you're going to use it, there's no way around it.
Trying to push an entirely different development model into the language isn't going to get you very far.
With your attitude you're setting yourself up for a very rapid failure.

Follow some Swing and applet tutorials, and you'll see instantly that what you're trying to do isn't going to work.

jwenting 1,905 duckman Team Colleague

the question makes no sense, the answers therefore are unrelated to the question :)

Java is not intrinsically "more secure" than anything, at most it has been designed to make it easier to program applications to not suffer from things like memory leaks, but that's not security (though it might be part of a secure application).

jwenting 1,905 duckman Team Colleague

Partial solution, sadly more a workaround than a complete solution. We not create the EMF by feeding it a DataSource class that on construction gets its configuration from environment settings.

    <bean id="entityManagerFactory"
        class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
        p:packagesToScan="foo.bar.model.entities">
        <property name="dataSource" ref="dataSource"/>   
        <property name="jpaVendorAdapter" ref="jpaVendorAdapter"/>
        <property name="loadTimeWeaver">
            <bean
                class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver" />
        </property>
        <property name="jpaProperties">
            <props>
                <prop key="hibernate.hbm2ddl.auto">validate</prop>
            </props>
        </property>
    </bean>

    <bean id="dataSource" class="foo.bar.DataSource" init-method="init" />
    <bean id="jpaVendorAdapter" class="foo.bar.HibernateJpaVendorAdapter" init-method="init" />
jwenting 1,905 duckman Team Colleague

if you claim to give people an answer to their question and it's the wrong one, someone will downvote it to indicate as such.
Get used to it.

At least it's better than getting downvoted because someone doesn't share your opinion on something, without any factual data to counter your argument.

jwenting 1,905 duckman Team Colleague

and another miracle cure from some bozos who no doubt will start selling it to gullible fools who have been talked into believing that real medicine is out to kill them.

jwenting 1,905 duckman Team Colleague

I have been told that when entering the US, customs officials can insist that you reveal the password for an engrypted file or partition. I am not aware if anyone has successfully challenged the legality of this, for example, by claiming that the encrypted information contains priviledged lawyer-client communications.

you'd just be detained even longer and probably end up with a terrorism charge just to get you to cooperate.

best way to avoid trouble is to have nothing to hide, so no pirated stuff, no pr0n, and no bomb making plans.

jwenting 1,905 duckman Team Colleague
private static class AccountID implements Comparable<AccountID>, HasClone<AccountID> {
    public AccountID(int iID) {
        ID = iID;
    }

    public int compareTo(AccountID N) {
        return ID-N.ID;
    }

    public AccountID Clone() {
        return new AccountID(this);
    }

    public int ID;
};

That's your code, cleaned up a bit for readability.
Your "return new AccountID(this)" will fail, as you no doubt experienced.
The reason is that you did not supply a copy constructor "public AccountID(AccountID a)".
You also have a rather weird construct here with that "HasClone<>" interface. Why not use the perfectly good "Cloneable" interface from the standard library instead?

Your code would then change to something like

private static class AccountID implements Comparable<AccountID>, Cloneable {
    public int ID;

    public AccountID(int iID) {
        ID = iID;
    }


    public int compareTo(AccountID N) {
        return ID-N.ID;
    }

    public clone(Object o) {
        if (!(o instanceof AccountID) {
        }
        return new AccountID(((AccountID)o).ID);        
    }
};

Similarly, your Customer class has no constructor taking an argument of type Customer, hence that too fails. Either make such a constructor, or change the calling code to use the existing constructor instead.

Your method to retrieve the customer name tries to return the Customer, not his name.

And the balance method will return the balance just fine, but you're running into the inherent problem with floating point numbers on computers, which is rounding errors.
These are the reason that no real program will use floating point numbers like this. Instead you'd either use integers for dollars …

jwenting 1,905 duckman Team Colleague

The programming language you should know is the one you need for your current job at hand...
I'm sick and tired of people telling me what I "should do", that I "am not a real programmer" because I don't use Scala, Smalltalk, or whatever.

jwenting 1,905 duckman Team Colleague

You can easily create a String instance from an array of char, but not using the toString method (which exists on the array, but won't have the expected result unless you know what to expect which most people don't).

Search the API documentation, it's right there in the page relating to the String class.
If you don't have it yet, you can download it from http://www.oracle.com/technetwork/java/index.html just like the JDK itself (or browse it online, but you really want a local copy).
The documentation downloads are near the bottom of the page.

jwenting 1,905 duckman Team Colleague

you can not connect from an applet to any resource hosted on a different host from the applet itself, that's for security reasons.
Best practice is to have the applet talk to a serverside resource (say a servlet or web service) and have that perform the database access.
That way the database username and password are also not downloaded to the client, reducing security risks greatly.

jwenting 1,905 duckman Team Colleague
    <bean id="entityManagerFactory"
          class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
          p:packagesToScan="jpatest.engine">
        <property name="dataSource">
            <bean class="org.springframework.jdbc.datasource.DriverManagerDataSource">
                <property name="driverClassName" value="org.firebirdsql.jdbc.FBDriver" />
                <property name="url"
                          value="jdbc:firebirdsql://localhost:3050/testdb" />
                <property name="username" value="xxxxxxxx" />
                <property name="password" value="yyyyyy" />
            </bean>
        </property>
        <property name="jpaVendorAdapter">
            <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
                <property name="database" value="DEFAULT" />
                <property name="showSql" value="true" />
                <property name="databasePlatform" value="org.hibernate.dialect.FirebirdDialect" />
            </bean>
        </property>
        <property name="loadTimeWeaver">
            <bean
                    class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver" />
        </property>
        <property name="jpaProperties">
            <props>
                <prop key="hibernate.hbm2ddl.auto">update</prop>
            </props>
        </property>
    </bean>

I have the following bean definition in my Spring application context, this gets loaded nicely and runs well.
Now, I may have the requirement to rewire this on the fly to point to a different database.
Is there any way to achieve this without stopping the application, modifying the application context xml, and starting it all up again?
I know you can inject properties from the runtime environment into the application context at startup, but this doesn't seem to work at changing the bean at runtime.

        HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
        vendorAdapter.setDatabase(Database.DEFAULT);
        vendorAdapter.setShowSql(false);
        vendorAdapter.setDatabasePlatform("org.hibernate.dialect.FirebirdDialect");
        DriverManagerDataSource dataSource = new DriverManagerDataSource();
        dataSource.setDriverClassName("org.firebirdsql.jdbc.FBDriver");
        dataSource.setUsername("aaaaaaa");
        dataSource.setPassword("bbbbbbb");
        dataSource.setUrl("jdbc:firebirdsql://localhost:3050/testdb");
        Properties jpaProperties = new Properties();
        jpaProperties.put("hibernate.hbm2ddl.auto", "update");
        LocalContainerEntityManagerFactoryBean e = new LocalContainerEntityManagerFactoryBean();
        e.setPackagesToScan("jpatest.engine");
        e.setDataSource(dataSource);
        e.setJpaVendorAdapter(vendorAdapter);
        e.setLoadTimeWeaver(new InstrumentationLoadTimeWeaver());
        e.setJpaProperties(jpaProperties);
        context.getAutowireCapableBeanFactory().configureBean(eb, "entityManagerFactory");
        context.getAutowireCapableBeanFactory().initializeBean(b, "entityManagerFactory");
        context.getAutowireCapableBeanFactory().applyBeanPropertyValues(eb, "entityManagerFactory");

does not have the desired effect. After this the application still writes to the initially configured database when requesting the EntityManagerFactory again from the application context (I would have expected Spring to replace the bean with the new one, but apparently it doesn't).

jwenting 1,905 duckman Team Colleague

Linux shot itself in the foot by declaring being "anti-Microsoft" to be a religious dictat, and deliberately doing everything different from the way it's done in Windows for no other reason than to do things differently from Windows.
They also shot themselves in the foot (in part because of that) by not standardising on a lot of things, from mouse and keyboard handling to copy-paste features to look and feel, effectively causing every single application to be incapable of communicating with every other application at a level that's required for end users, and presenting an utter mess of different user experiences between them as well.
And let's not even get started on the configuration nightmares. When I was running a Linux desktop I spent at least 2-3 hours digging through configuration files for every hour of productive work I got done.
The operating system should sit quietly in the background most of the time, not require the user to fiddle with it constantly to even start his applications...

jwenting 1,905 duckman Team Colleague

there is no "best" operating system, at most there might be one that's best suited to specific requirements.

Reverend Jim commented: Of course. +0
stultuske commented: as about always :) +0
jwenting 1,905 duckman Team Colleague

hmm, 2 days suspension for hitting a bully in the face once, leaving him with a bloody nose, who was beating up a friend.
The bully of course wasn't punished at all, but afterwards did leave both of us alone...

Ketsuekiame commented: Best way to beat them! I'm sure the teachers would have been sdympathetic and given you a relaxed punishment :) +0
jwenting 1,905 duckman Team Colleague

if you've not written that, you've not programmed it so you've not started to program in Java, have you?
Do your own homework, don't expect to ever learn anything just sitting back and hoping that others will do it all for you.

Pobunjenik commented: Most people at in my semestre need this advice. +2
jwenting 1,905 duckman Team Colleague

something tells me you wear clothes ... why? didn't God create you naked? aren't you shaped in his image? it's called common sense to try and improve yourself, and help others doing so.

Always have to laught at that one. Man was created in God's image, but he has to cover himself because he is supposed to be ashamed of his naked body.
So Man is to be ashamed to look like God? That doesn't bode well for God, does it?

ddanbe commented: Good point! +0
jwenting 1,905 duckman Team Colleague

God is the only cure to all illness and i'll be happy to DIE fighting for the
things i believe and how god really affected my life

so you refuse all medical care when you get sick? I seriously doubt you'll have that strength of faith when you're screaming out in pain after an accident that leaves you with a broken bone sticking out through your skin. or a potentially terminal infection eating away at your intestines.

We'll see how deep your faith in being miraculously healed by a god you deny gave us science and medicine is when something like that happens to you.

jwenting 1,905 duckman Team Colleague

But What im trying to say is Science has Both Good AND Bad effect.

Science is neither good nor bad. What people do with the knowledge science provides may have good and bad effects, but even that usually depends on the impact those effects have (e.g. a nuclear explosion is neither good nor bad in itself, it's what it's used for that can have positive or negative consequences (or a combination of both).

jwenting 1,905 duckman Team Colleague

my best friend with whom I'd spent on average about 10 hours a day for the last year, who pulled me out of depression with starting ideas about suicide a year ago, died last friday.
She will be sorely missed, I will never forget her nor the good times we had together.