jwenting 1,905 duckman Team Colleague

static is the equivalent of a global variable in Java.
You usually want to avoid it, as it violates object oriented principles.

Mostly you'll see it used for constants, and sometimes utility functions that effectively exist outside of the context of any class instance.

jwenting 1,905 duckman Team Colleague

if you know what DDL and DML stand for you know the difference between them :)

jwenting 1,905 duckman Team Colleague

it also helps greatly to learn to write correct English (both syntax AND grammar).

jwenting 1,905 duckman Team Colleague

simply put: your trigger performs an operation on your table which triggers your trigger which performs an operation on your table which...
And in the end your database engine crashes with a stack overflow error.

diafol commented: Succinctly put +15
jwenting 1,905 duckman Team Colleague

160k items is way too many for a dropdown. Indeed use an autocomplete or find some other means to reduce the size of the list before you try to fill it.
Something like a master-detail chain, where you select categories, subcategories, etc. etc., all the while building a reduction clause for your table.
Eventually you should end up with a small set that people can sensibly scroll through to find the final value they want. For that, even a hundred is really too much, a dozen is more like it.

Also, make sure you have properly indexed your table(s), that makes selecting records from them a lot faster.

As you're using Java, a good thing to do would be to use JSF and Primefaces, which contains a very nice autocomplete component which will work with your POJOs.
Here's an example from code I am working on for a customer:

<p:autoComplete id="naamTweedeInspecteur" value="#{waarnemingBean.waarneming.tweedeInspecteur}" 
                rendered="#{waarnemingBean.waarneming.soortWaarneming eq strings.SoortWaarnemingFysiek}"
                completeMethod="#{waarnemingBean.zoekInspecteurs}" readonly="#{waarnemingBean.waarneming.id != null}"
                var="insp" itemLabel="#{insp.displayName}" disabled="#{waarnemingBean.waarneming.id != null}"
                itemValue="#{insp}" forceSelection="true" converter="#{nvwaInspecteurConverter}">
  <p:ajax event="itemSelect" listener="#{waarnemingBean.onInspecteurSelect}" update="messages"/>  
  <p:column>#{insp.displayName}</p:column>
</p:autoComplete>                                    

Use EJBs and JPA to get the data, rather than write raw JDBC code.

IOW bring your application development into the 21st century...

jwenting 1,905 duckman Team Colleague

start your own thread, show some effort, and explain your problem in enough detail that others can make sense of it.

jwenting 1,905 duckman Team Colleague

Microsoft can't give you a new license key as they don't know what key was shipped to you in the first place. Samsung might know what key was shipped with the hardware but they can't give you a new one as they have no way of knowing if you have the PC (and are entitled to it).
If they gave you those keys, and you'd stolen the PC or scribbled down the key from a machine you found on a desk somewhere, the real owner would now have trouble if he wanted to reactivate/reinstall his computer because you've just used his license...

Lesson to be learned: keep notes of your license keys, and don't rely on those stickers to last forever.
And another lesson to be learned: don't scream how evil Microsoft (and Samsung or whomever) are for not giving you things for free.

jwenting 1,905 duckman Team Colleague

Anyone remember PL/1?

never used it, was using Cobol and C on Tandem at the time, but do remember the frustrated PL/1 zombies prowling the halls at night :)

I found a bug in the PL/1 compiler (verified by my professor) that caused me to had in an incomplete project.

Once found a bug in an exam that would have caused half the students to fail. Prof acknowledged it, question wasn't counted if people got the answer wrong.

jwenting 1,905 duckman Team Colleague

looks good, but without a menu it's going to be a nightmare to navigate.

dtpp commented: agree. Menu (at least something alike) is must-have for site of this size +0
jwenting 1,905 duckman Team Colleague

they no doubt get similar stories from a lot of people who ran up the bills themselves and now demand their money back.
If I were them I'd not instantly pay back but first thoroughly investigate what's going on, go through logs to see where that traffic was coming from to see if there are patterns that are recognisable.
That can take a few days.

jwenting 1,905 duckman Team Colleague

it happens. Just as your code isn't immune from bugs on release, neither is any other code.
Last month I ran into a major problem writing some JPA code, whatever we tried we couldn't get it to work properly.
Some research into the extremely obscure error messages we got (when catching runtime exceptions that would otherwise be hidden by the application server) pointed me towards a bug in Eclipselink that had been known about and reported 7 years ago and never yet fixed.

Years ago I ran into a bug in a Borland Pascal compiler, which caused a system call to reproducibly fail.
Even weirder, this bug was present in one specific version, but neither in the previous nor in the next version.

jwenting 1,905 duckman Team Colleague

the timestamp is stored in UTC, which is normal, especially if the server is running on Unix.
It's up to you to do the conversion if needed.

jwenting 1,905 duckman Team Colleague

Amazon will send you warnings when billing limits are exceeded (or approaching) but you do have to enable those to be sent to you and set the trigger amounts.
What's excessive after all? I worked for a company using AWS services extensively. We'd rack up gigabytes of traffic a day. If they shut us down, or sent us warnings, every say 50MB we'd have to contact them to unblock those keys every few minutes.
For someone else that 50MB might be more than they generate in a month...

There's nothing wrong with AWS. Every account I've heard of people being hit like this is when those people have through oversight of their own exposed access keys to the world through insecure channels (most by uploading them to some public git repository) and not having those keys properly limited beforehand.
Which just goes to show you should be careful uploading anything to a public repository. And that you should be especially careful uploading something to a public repository when you're not totally confident that you know exactly what the consequences can be of people getting access to it.

jwenting 1,905 duckman Team Colleague

the marvels of open source...
Microsft should have tested this better of course, but ultimately the flaw is in the open source plugin provided by a third party (who no doubt had to provide detailed test reports before MS would even consider integrating it into their product).

And of course the author isn't without blame either, should not have published what amounts to username+password data to a cloud based service. Even if there'd been no bug that exposed it to the world he'd have been at risk of a security breach at the service where his data is now stored on a drive, unencrypted, readable for anyone with shell or physical access to the machine.

jwenting 1,905 duckman Team Colleague

and it's done exactly what you told it to: generate a field that's capable of holding an SQL DATE. Which means a field without a time.
The correct way of indicating a timestamp using JPA is as follows:

   /**
     * Time/date of creation of an entity.
     */
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "CREATION_DATE")
    protected Date creationDate;
jwenting 1,905 duckman Team Colleague

of course, if you do that it's no longer random...

jwenting 1,905 duckman Team Colleague

and I'd change that into "without an explicit import statement" to be fully correct.

jwenting 1,905 duckman Team Colleague

more people is a double edged sword. The quality of the average posts in many forums is already at rock bottom (90%+ dumped homework requests in the Java forum for example, with the few actual questions rarely receiving an answer), with very few people contributing anything of value.
Seeing the average "mobile" user elsewhere, I fear that if there's a massive influx of them that will only get worse.

jwenting 1,905 duckman Team Colleague

no, as such conditions change over time, and sometimes rapidly.
For example the "guilty" manager leaves for elsewhere, company culture changes. Or the person responsible is an outside consultant and complaints from staff after you leave cause a shift in attitude from management, the consultant's contract is cancelled, etc. etc..
I've seen it happen. Company had a great culture, fantastic place to work. CEO retires, financial results go sour (this was around the time of the market collapse), an "interim manager" is brought in whose idea of a healthy company is one where everybody is constantly on edge because there's always the threat of being fired for the least mistake. Company culture goes south, from a place where people solve problems together to one where everyone is constantly looking for scapegoats in the blink of an eye. Several years later, after I leave, that guy leaves and from people still working there I've learned that now that climate is gone and it's once again a pleasant place. But people rarely state on such shame and name lists that things have shifted, that things are now no longer as bad as mentioned, so they tend to fill up with bad reports that by the time you read them are no longer accurate.

Also, the legal fallout of such a system could be severe, companies and individuals listed on it could successfully sue whomever is running or hosting the system for defamation and character destruction.

jwenting 1,905 duckman Team Colleague

ah yes, or the manager who NEVER gives praise to the tech people when something goes right (when things work well, a job's completed under budget, delivered on schedule for example) it's marketing and management who get the praise.
When however something goes wrong, even if it's caused by external factors to the tech team, the techies get blamed.

Prime example I've of that is a project where we had given off a realistic estimate of 500 man hours to get the job done. The board and sales had signed off on that, and we had those signatures on paper.
Sales markets the project to the customer for 250 hours to get the contract.
We complete the job in 400 hours, 20% below our own original estimate (and thus well within the budget we'd calculated we'd need). Because the project was now delivered 150 man hours over the budget as sold by sales, there was of course no profit left. Our team of course gets blamed for going way over the planning, even though we were well below the planning the board and sales had signed off on and that we'd agreed to do the work in.

In another instance a customer called that "the system isn't working". This was instantly elevated and by the service desk logged as a software bug without any supporting evidence (this was standard, all incoming support requests were logged as software bugs).
When we analysed the very sparse data provided …

jwenting 1,905 duckman Team Colleague

uh, no.
For Android Java is great. For Windows C# is better. For iOS Objective C or whatever else Apple forces people to use now.

Hybrid solutions work but are rarely the ideal option as they have to by force compromise on things like hardware integration.

And oh, OMAF isn't the only solution for cross platform mobile development. There are others, but I can't remember the names right now.

jwenting 1,905 duckman Team Colleague

A good book is an excellent source of information. Of course you don't want to invest heavily into books for rapidly developing technology, the latest hype, etc. etc. but for stable things and general information they're far better than unedited (often flawed) blogs.

jwenting 1,905 duckman Team Colleague

documentwhat?

Management have some rose-tinted idea that they can replace it in 2,5,8 years or whatever, but once it's in place it's always cheaper to do a "small" fix or upgrade than a complete re-write.

or worse. I've had to work many times on systems that would have been far cheaper to replace 10-20-30 years after being written but were maintained because for political reasons it was impossible to get budget for replacement but getting a higher budget for maintenance was no problem.
Worst case of that was literally a 30 year old system running on hardware that was no longer in production, including spare parts, due to the manufacturer having years ago gone out of business. Replacing it would have cost a hefty 10 million or so Euro over a 3-4 year period. Maintaining it cost 5 million a year, plus several hundred thousand more just to train new staff to do the work.
The department had literally bought up ALL hardware for the system it could find when the manufacturer went out of business, and had people near fulltime browsing eBay and similar places looking for more, just so they could stave off the inevitable day they'd run out of spare parts.
New staff had to go through a 3-4 month training program just to become proficient on maintaining the hardware and software, for which they had several people employed near full time just to provide that training.
The system was (and …

jwenting 1,905 duckman Team Colleague

yes, you can. Sorta.
http://www.oracle.com/technetwork/developer-tools/maf/overview/index.html Oracle Mobile Application Framework can create native runtimes for both Android and iOS from the same source. It's based on Java and Oracle's ADF framework, plus HTML5.
It doesn't support Windows Mobile, but AFAIK there are other options to run Java on that.

jwenting 1,905 duckman Team Colleague

that's why people have insurance for legal aid :)
And of course here an employer needs to apply for a permit to fire you, which they won't get unless they have a strong case (and "I don't like that guy" isn't enough).

Sure, unions used to do good, but that was in the 1930s-50s, from the 1970s on they've devolved into corrupt, useless, political pressure groups.
Several years ago here there was a case where a union decided to lay off 500 of its workers, and thought they could get away with not giving them any of the compensation and stuff that that same union always demands companies provide their workers in mass layoffs...
Workers went to court (union of course, of which they were mandated to be members, which here is illegal, refused to cover the legal cost the workers were entitled to under their union membership, not that they'd have trusted a union appointed lawyer in a lawsuit against the union) and won, giving that union a major bloody nose.

jwenting 1,905 duckman Team Colleague

People have called out Amazon for its high stress environment in the past, those claims have regularly been proven to be (largely) incorrect.
And where they were shown correct it was very specific periods. For example black friday weekend or just before Christmas when sales are at an insanely high level while at the same time a lot of employees are on leave. While Amazon hires temp workers to help out during those periods those can't replace the more experienced ones who're on leave AND cover the increased workload fully.

As to IT jobs, I've never had one completely free from stress, and I doubt they exist.
However the levels vary greatly between jobs, companies, and projects.
If you see a requirement like "no 5-9 mentality, must be flexible", it's an indication that they're used to overloading people, forcing them into high levels of overtime (usually without pay), impossible deadlines, etc..
While not universally true (it's now so common to see those lines it's got to where it's pretty much meaningless) it's something to keep in mind during a job interview. And that especially if the people you're meeting seem rushed, uncomfortable to be away from their desks where the work is piling up while they're secluded with you.

jwenting 1,905 duckman Team Colleague

don't know about where you are, but here unions are utterly useless. The ONLY thing they care about is their own power as a union as a political entity (they're all tightly bound to certain political parties).

Anything they touch the work environment gets highly politicised, productivity plummets, stress increases (as a result, because deadlines and targets of course remain the same out of economic necessity), insane demands for huge pay increases irrespective of the financial results of companies lead to a high number of bankrupcies and layoffs.
The only people benefiting from this all are the union bosses and their friends in those political parties, screaming how "evil companies don't care about workers".

jwenting 1,905 duckman Team Colleague

Did he say that he is passing Map<String, LinkedList>?

he is either passing a Map<String, LinkedList> or something more generic like an unspecified Map implementation. Either would require him telling the compiler to ignore the type safety checks.

jwenting 1,905 duckman Team Colleague

yes, a call to that method with a Map<String, LinkedList> shouldn't even compile unless maybe you're doing some very nasty things like adding annotations to circumvent type checking.

jwenting 1,905 duckman Team Colleague

An extra thought: if that combination of arguments is common (and especially if they logically make up something) it's often a good idea to make a class to represent the combination.

jwenting 1,905 duckman Team Colleague

if you have so many exceptions that need logging that it affects performance there's more wrong with the system than just logging performance...

Exceptions should be rare, exceptions that need logging a stacktrace of because you don't know how to handle them should be even more rare.

jwenting 1,905 duckman Team Colleague

yes, knew someone similar. Always did poorly on written tests, was brilliant when it came to face to face interviews. Nobody recognised for years that she was severely dyslexic...
Had something similar myself. Did poorly on tests where the questions were written on the blackboard in the front of the classroom. When the test was printed and distributed on my desk I did very well on the same test.
Wasn't until 2 years later that a teacher had the bright idea to move me to the front of the room, closer to the blackboard. Turned out I wasn't stupid at all, I just needed glasses...

jwenting 1,905 duckman Team Colleague

I didn't mean you are trolling, OP is. He's clearly not interested in providing any information at all. Wouldn't be surprised if there is no system...

jwenting 1,905 duckman Team Colleague

you're clearly trolling here. He already said what type of information he wants quite clearly.

jwenting 1,905 duckman Team Colleague

@Agilemind intelligence is real, but those "tests" don't test for it. They test for test taking ability.
I've found end reported errors in the tests, verifiable errors, but as the companies using them rely blindly on the numerical score reported by some grading algorithm you fail anyway.

And of course a single universal "test" can't reliably work for people with different thinking patterns. Yet all those "tests" use the exact same type of questions and only those and then decides whether someone is "suitable" for the job based on the number of "correct responses" (and with the exact same tests being admitted for every conceivable job out there, you're either "suitable" for all jobs or none at all.
Rather unlike a real IQ test which uses a variety of different techniques, which are then analysed by trained professional psychologists, and are admitted face to face rather than through some computer screen.

jwenting 1,905 duckman Team Colleague

1) no, it automatically detects and verifies your Windows 7 or 8 key and converts it to a Windows 10 key (or maybe it's the same key).
2) no, as long as you upgrade to the same language version Windows as your old version (so English->English, or German->German, if you go German->English it keeps your data but you'll have to reinstall your applications).

that "NSAKEY" thing was a hoax, an attempt (spread about by the "fancy" "I hatez Micro$soft" crowd to discredit Microsoft.
So was pretty much everything else people hold against them.

"It doesn't help when certain settings (except for Windows 10 Enterprise) can be set to "disabled" and still send information back to Microsoft."
More nonsense. If you're using a Microsoft account it synchs that of course. If you use Cortana to search the internet it sends your queries of course. Etc. etc. etc.
People expect to be able to use internet based services without sending information over the internet, THAT's the real problem.
Yet for whatever reason they don't complain when it's not Microsoft but Google or Apple...

jwenting 1,905 duckman Team Colleague

yup. Unless you're planning on making a system that allows plugging in new types of actions to handle on the fly, or an application framework like Spring, it's almost certainly overkill.
But you wanted alternatives to hardcoding stuff, and that's what you'd end up with.

jwenting 1,905 duckman Team Colleague

ah. You could create a class with an interface with a single method, then have for each case a class implementing that interface.
In your approveRequest method you'd create an instance of the required class based on the incoming request using reflection, the name of the class being somehow inferred from the parameters to the request (maybe a mapping in a properties file or database table).

Tricky to get right, not usually something you'd do unless the actual mappings and implementations of methods to be executed aren't known at the time the application is written, but it can and has been done.

jwenting 1,905 duckman Team Colleague

I wouldn't be at all surprised if they were actually sending each other skype messages or sms instead of talking despite sitting next to each other. Wouldn't be the first time, I've seen it before up to 20 years ago where people in the same office would arrange their lunch time using email rather than just talking to each other.

jwenting 1,905 duckman Team Colleague

sadly many companies still use them (and 'iq tests') to determine whether candidates are "suitable for the field", iow whether the guy/gal has the right personality and iq to work in that line of business at all.
Which leads to many programmers being highly surprised that despite 15-20 years of working successfully and professionally for a variety of IT companies they're suddenly deemed as being utterly incapable of programming by some shrink who decides that based on how they respond to some tests.

jwenting 1,905 duckman Team Colleague

a switch would be appropriate here. And what makes you think chained if statements like that aren't "professional"?
Whether something's appropriate to use or not depends entirely on the scenario you're coding, and in this case it's entirely appropriate.

p.s. check your conditions. "=" in Java is an assignment, "==" is a reference comparison. You don't want either when comparing strings, you want .equals().

jwenting 1,905 duckman Team Colleague

though I do wonder what he's done that makes his eclipse project's compiling dependent on the order of dependencies in the project settings window :)

jwenting 1,905 duckman Team Colleague

actually, storing the images inside the database is a very good idea as it prevents your data from getting corrupted if the location on the filesystem where the images exist changes.
Of course there's some added cost in time needed for retrieval and possibly higher storage requirements, but for real world applications those are of miniscule concern as compared to data integrity.

jwenting 1,905 duckman Team Colleague

you do need to THINK about what you do inside that while...

jwenting 1,905 duckman Team Colleague

if you have multiple results, the ResultSet will have multiple rows in it. Iterate over those rows, rather than just picking the first one and discarding the rest.
so something like

while (rs.next()) {
//whatever
}
jwenting 1,905 duckman Team Colleague

and did you actually package it in your webapplication? LEARN YOUR TOOLS.

jwenting 1,905 duckman Team Colleague

Banking & the finance industry would be a mess, I have to admit I don't know if bank branches have local copies of customer databases or are connected to local networks or if everything is done via the internet.

yes and no.
Used to work on those systems years and years ago. Back then (and probably still to a large degree) banks would have their own networks connecting their offices, consisting of leased lines between each of them and their own private datacenters.
Today those lines may in part be replaced with highly encrypted internet connections (not your standard 128 bit encrypted SSL for sure), don't know.
Some systems had local databases that were synched regularly with the central servers (usuallyy after office hours), others made direct connections to the central mainframes.

Back when even at the IT department at corporate HQ we had no internet (that was late 1990s...). Internet was available in the company but highly compartmentalised. To gain access you had to put in a request that had to be authorised by several people at very high level in the corporation, then the validity of the request was vetted by the security department to determine whether you really, really, really needed the access.
Only then were you given an account to use one of the few computers with internet access in the building (one per floor maybe), computers that had no way to get data from and to them (no floppy …

jwenting 1,905 duckman Team Colleague

good luck.
And oh, what you call a "current account" is more generally known as a checking account.

jwenting 1,905 duckman Team Colleague

A class which is far from meaningless.
It's used heavily when you use reflection.

jwenting 1,905 duckman Team Colleague

"why I am not worthy of getting a passing grade" is an excellent one for you.
With as content: "because I can't be bothered to think and study".

ddanbe commented: Good one! +0
Reverend Jim commented: Right on. +0