current session cache. Or that's how I understand this article.
http://gmarwaha.blogspot.com/2007/01/hibernate-difference-between-sessions.html
http://gmarwaha.blogspot.com/2007/01/hibernate-difference-between-sessions.html
When we get errors like:
java.lang.IllegalStateException: 2 matchers expected, 1 recorded.
at org.easymock.internal.ExpectedInvocation.createMissingMatchers(ExpectedInvocation.java:42)
at org.easymock.internal.ExpectedInvocation.<init>(ExpectedInvocation.java:34)
It means we are missing a matcher for our mocked classes.
Take this code, for example:
Map<String, Object> params = new HashMap<String, Object>();
List<Integer> groupIds = Arrays.asList(1,2,3);
params.put("groupIds", groupIds);
expect(mockSimpleJdbcTemplate
.queryForList((String)anyObject(), params))
.andReturn(results);
Replace the last line with:
expect(mockSimpleJdbcTemplate
.queryForList((String)anyObject(), eq(params)))
.andReturn(results);
"If you would like to use matchers in a call, you have to specify matchers for all arguments of the method call."
Otherwise, it should only be known values.
If you are mixing known values with matchers, you will have to use the eq() ("equals) static method
See: http://www.easymock.org/EasyMock2_2_Documentation.html
2. when mocking classes that are not an interface, like
SimpleJdbcTemplate, we need to use the createMock, replay, and verify
methods FROM org.easymock.classextension.EasyMock NOT FROM
org.easymock.EasyMock
otherwise, we get this error when running the test:
java.lang.IllegalArgumentException: not a proxy instance
at java.lang.reflect.Proxy.getInvocationHandler(Proxy.java:637)
at org.easymock.EasyMock.getControl(EasyMock.java:1440)
at org.easymock.EasyMock.reset(EasyMock.java:1397)
Update 11 November 2010:
You no longer need to do the easymock.classextension package in (2) if you are using EasyMock 3. The package and classes still exist in EasyMock 3 only for backward compatibility. See the documentation.
<username removed of course>@optus.com.au
Technical details of permanent failure:
Google tried to deliver your message, but it was rejected by the
recipient domain. We recommend contacting the other email provider for
further information about the cause of this error. The error that the
other server returned was: 550 550 5.7.1 Inappropriate language
used:SHIT (state 18)."
Unfuckingbelievable.
I wonder if Telstra do the same to their work emails.
NoClassDefFoundError: org/pache/ommons/bcp/asicDataSource
I don't really know what's going on, but somehow each of the package
groups has the 1st character missing. Bizarre.
I'll clean out the IDEA cache using "File --> Invalidate Caches" and
see if that fixes it.
Nope, didn't.
Further down the stacktrace it shows the right name:
Caused by: java.lang.ClassNotFoundException:
org.apache.commons.dbcp.BasicDataSource
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
http://www.christoph-sommer.de/loxodo/
But first, I had to install wxWidgets, which was easy enough:
sudo yum install wxWidgets
then another 9.5Mb installation later, created a launcher for the app,
pointed to the loxomo.py file, then voila.
The interface seems a bit limited, and you don't have options like
changing the encryption method or the rules it uses for password
generation but it's functional enough. I'll see how it goes in the
next few days.
1. Failed after install attempt. Missing dependencies.
Do you accept and agree to be bound by the license terms? (yes/no): yes
Running package installer...
error: Failed dependencies:
libfuse2 is needed by truecrypt-6.3-0.i586
xorg-x11-libSM is needed by true
2. Hmmm.. okay, try and get dependencies:
sudo yum install libfuse2
Loaded plugins: refresh-packagekit
Setting up Install Process
No package libfuse2 available.
Nothing to do
3. SHIT! I give up.
Anyway, I looked for something more lightweight, and came across a
blog post for tcpdump.
http://mdzyuba.blogspot.com/2008/02/how-to-debug-soap-on-mac-with-tcpdump.html
So to monitor the Axis2 webapp running on Tomcat at port 8080, I type
in this as root (or use sudo! i know i know..)
/usr/sbin/tcpdump -i lo -A -s 8080 -l 'dst host localhost and port
8080' | tee dump.log
this creates a file called dump.log which contains the packets going
over the loopback interface on port 8080
I wouldn't want to do it very often, but in a pinch, it works, and
doesnt take over my machine.
Of course, you'd only want to do it on a machine where *you* control
what requests come in. On a production box the best you can do is
create a log and process it later to find what you want. No humanly
way of eyeballing the logs in real-time in that scenario. =)
For one reason or another, you find yourself having to restart Safari.
Maybe AdBlock has updated its adserver list, or you find that Safari's
consuming too much memory and needs a kick in the bum. Whatever. The
nasty nasty thing about this is that you'll now have to work at making
sure all the tabs in all the windows you currently have open are
saved. The usual thing I've done in Safari is to create a bookmark for
each window containing all the tabs I have. Or if I only have one
window open, I just close it and then select "History" then "Reopen
All Windows From Last Session".
So fine, you reopen Safari, but then find yourself going at a
particular tab, "I'd like to go back to the page I was looking at
before I got to this one." But no, you can't! The Back button is
greyed out. I suppose you could look at the History menu and try to
find it there, but the problem is that in History, they are all just
grouped according to the time the site was opened, without any regard
for the particular tab you were on. When you restart Safari, you are
unable to trace the "route" you took to get to a particular page in a
tab.
This is not the case with Firefox and Opera. Now given that they *all*
use internal databases to retain info about the pages they've gone
through, I'd have thought Safari should be able to work similarly to
the other browsers. The question is: does Apple really give a shit?
For some unknown reason, I've actually started using Safari as my
default browser, despite the appeal of having umpteen zillion plugins
available in Firefox. It turns out that that having just the AdBlock
plugin is quite good enough for my normal usage patterns.
I've started bringing the work laptop home and trying to do - uh -
stuff in it. Its a Hewlett Packard HP NC6400, with CoreDuo CPU, 2Gb
RAM, 80Gb hard drive.
A few comments about it:
* The keyboard's not too awful, though I find the keys a bit slippery,
as if coated with Teflon. And yes, it does what it should, but it
still feels and looks cheap.
* It's got a blue "nipple" pointer controller between the G, H and B
keys. It's there, it's weird, and it's staying unused. Never liked it,
and never will.
* The button to turn of the wireless card had me stumped for a few
days, since I had turned it off and forgot what the button was for.
Then I spent an entire weekend trying to figure out why the Windows
system tray icon for the Wireless Network Connection wasn't detecting
any Wi-Fi networks! I didn't get it - this was a new laptop that I
took home the week before, and it detected mine and my neighbours'
networks. It was only when I got back to work that I realised what was
going on: no blue light on the button, no WiFi. A shame that they
didn't have small labels in addition to the button icon, just to make
things clearer.
Having had a Powerbook as my first laptop, I was used to having the
Airport icon in OS X as my main interface to WiFi. Apple laptops don't
have a button for Wi Fi. Actually, they don't have *any* buttons,
aside from the Power button. Okay, there's the Eject CD/DVD button on
the top right, but that's integrated into the keyboard layout.
<#include: usual fanboi rave about how Apple design is elegant,
uncluttered and all that.>
<#include: While mostly true for the hardware design (except that
Super Mouse.."oh, it's got 2 buttons, but we don't actually show it to
you. we like to unclutter it and keep you guessing". fktards.)>
<#digress-heavily: as for OS X... boy, the Finder is such a pitiful
excuse for a file manager. And why the hell is it so difficult to move
a bloody file? Why do I have to copy and *then* delete?>
* The screen is too dim. fn+F9 and fn+10 *look* like they're meant to
control screen brightness but don't have any effect. And coming from a
17" Powerbook, the 14" screen is taking some getting used to. No way
can you have more than one app displayed at a time.
* And then there's the trackpad. By default, two taps in close
succession are treated as a double click. This behaviour has caused me
no small amount of grief.
Today, did an interview with a recruiter for a contract role with my old company, but in another division. The project, which is just in
the initial stages, post-design, is to build a workflow system to handle news reports so they go to the website and to the print systems at the same time. Funny enough, another part of the organisation already has something like this in place, so why they don't just build on it, I don't know. Possibly a NIH (not invented here) attitude? Anyway, as long as I get paid. LOL. Interview went well, and recruiter said he'll contact the manager and check if they want my resume sent forward. The other funny thing about this is that a friend just rang me last week and said he's already working there! Fun times if I get in, though it'll be such a bitch having to walk 20 minutes from the train station. Apparently there are buses but they are infrequent.
Around lunchtime, got a call from a recruiter I've been dealing with for about 2 months now, but still no interviews from her. She finally tells me the name of the company she sent my resume to, and it's quite a big one. Makes annoying software that I really haven't installed or used in about 10 years. Antivirus crap that fucks up your system, causes unknown or untraceable problems, resource f*ing hog.
They used to make really cool system utilities back in the DOS days, but their main product now is seen by a lot of people as a total pain in the ass, and one to avoid. But, they've got market share, and people still pay for their stuff. They must be doing something right. Anyway, the recruiter says she'll send me a set of questions to work on during the weekend. Insists that I get it in by Monday, even though earlier in the conversation she says I can work on it at my own pace. Then why the fuck does she say I must hand it in by 4pm Monday, even though I asked if I could just hand it in on Tuesday. What part of "at your own pace" don't you understand, you saucy minx/btch? (she looks fit, reminds me of Riot Becki when her glasses are on, so I still keep in touch)
Then in the afternoon, it was with a more recent former employer. This time, the role is to work on the ad-serving system for the entire media network, which comprised of quite a number of sites. Back to working with my old friend SQL Server! (much nicer than MySQL, at least) It's a humongous task, and I was a bit shocked that at the moment, there are only two developers working on this system. For a system that is used by more than a dozen websites, you'd think it would have a bit more resources devoted to it. Anyway, interesting work, looks painful, exciting, not really that sexy (and everyone hates you so they just AdBlock what you create), but it's a definite money-spinner, so it's on the radar of people who matter, like that old guy who used to be Australian but is now American. Couldn't help noticing that the interviewer kinda gave of vibes of the under-appreciated. Twice he mentioned that "this is the part of the company that never gets mentioned in emails sent to the staff".
Opened my Gmail. Oooh, that really shit hot software house that makes "developer tools that you actually use" have sent me a problem assignment to work on. Yay, my resume didn't get knocked back! I was starting to get worried. I'll have to ace this because this company is pretty much #1 on my wishlist. I've so drunk their kool-aid already.
Then in another email I see the set of questions mentioned by the recruiter. Hmm... can I read .docx files? Oh, good, TextEdit can open them. I start reading and it's nearly as vile as their software. Some of it is bullshit - "name all the Software Methodologies you've worked with." WTF? - some are more reflective of the stuff I might end up working on - "how can you implement a licensing system that does bla bla bla..." and "Provide a high-level system architecture that protects against piracy and misuse." WTF? This is a developer role, right? I'm having my doubts about this company already. I don't really want to work for a company that I can't be proud of. And it's in North Sydney! But then, the company is a big one, and might send me in another direction, career-wise. But all software should be free, right? Hahahhaha...
On Monday, I have a 2nd interview with world-famous software consulting firm. Mainly world-famous because of their chief scientist who wrote a great book about 10 (?) years ago, but I'm not really sure what he does now. This company is #2 on my wishlist, but I'm not really sure if they're as fun as #1. I guess that's why they're #2, hahah. Anyway, it's got these super geeky, quite top notch people, allegedly, and friend of a friend who works there always raves about the company. Maybe it's good. I've invested quite a bit of time already with them - first the phone interview (which was really casual and fun), then stage 2 was the programming problem (killed me for a few days, but got it in, though they didn't get back to me til a month
later), and now stage 3 is a battery of tests and an interview (3 hours in total). I'll have to do some studying on the weekend, just so I don't embarrass myself and look like a dill. Good thing is that it's casually attired.. not a lot of interviews in jeans so far; this'll be my first.
Something's gotta come out of all this!!
I got a new LG 500Gb portable drive, and now have to format it for use
with my WD TV HD Media Player. It's formatted NTFS by default, but I
have a Mac, so I can't write to the damn thin without installing
something like NTFS-3G, which *should* be stable enough these days,
but I've no experience with it, so I'll do more research before going
NTFS on my external drives. I'll just keep my virtual machines on my
local drive for now. (they're going to be faster that way anyway)
For large drives, previously I've had to go through crap like creating
a small partition because Windows format command only supports drives
up to 32Gb for FAT32, formatting in FAT32, and then expanding the
partition using PartitionMagic.
Someone has written a free utility to format a large drive quickly in
FAT32. Incredible speed - formatted my 500Gb drive in seconds!
What have we bought?
1. Media Player and
2. 2.5" HDD - Bought this online on Tuesday from mwave.com.au. They
had a sale on the Western Digital WD TV HD Media Player, at around
$175. And I also got an LG 500Gb 2.5" portable hard drive, at $140.
Went to the Mwave offices in Lidcombe (it's local!) to pick it up. The
place is pretty much a warehouse, with a small room for a "public
shopfront". It's not really a retail outlet, since there's no items
there to look at and buy directly. Finally I'll be able to watch the
backlog of DivX files I've had over the past 2 years, and clear out
space on my main computer (only 4Gb available!).
3. Netbook - OMG, the perils of getting a redundancy, having $$$ in
the bank, and being at home browsing those "one bargain a day" sites.
At catchoftheday.com.au on Thursday they had a sale on the ASUS EEE
1000HE laptop, which is a new model with Atom N280 1.6Ghz, 1Gb RAM,
160Gb HDD, Wireless-N, Bluetooth, 10" screen, 92% size keyboard. Very
very nice. Couldn't resist a bargain at $619 (after $40 discount if
you used Paypal)! Current retail is around (according to Shopbot)
"Price range: $669.00 to $934.95 at 55 stores". So I got it, thinking
if it doesn't work out between us - I fear the small screen could be a
problem when working with an IDE - I can always sell it *and make a
profit*, but still way below retail prices!
4. Lanwmower - our GMC lawnmower carked it about a month ago, so got
ourselves to Bunnings on Friday and bought a Flymo lawnmower. I think
it's by Husqvarna, since that's the name on one of the stickers on the
box. Or maybe they're the importers? Anyway, it looks quite
"Scandinavian".. my son said "Big Red Car" when I carried the box
inside. My brother says it looks like a race car. It's the kind of
lawn mower that'd fit in at IKEA, if they sold em there. Was thinking
of getting this other, much smaller lawnmower also from Flymo, but
this was different because it was like *a hovercraft lawn mower*! It
floated on a bed of air, and cut the grass, but didn't have a
container for storing the clippings. I guess the clippings just stayed
on the ground and you had to rake it. Which means I'd have to get a
rake, and do more work? No thanks. Someday, I *will* get a
hovercraft-something. Hovercraft food processor? Hovercraft vegetable
slicing julienne tool. Yeah, someday, my hovacraft will come, boiee..
5. Steam Iron - Also on Friday, we got the Philips GC4420 steam iron
from Good Guys for $95, to replace our steam iron which I stupidly
dunked in a pail of water. People - *never* iron your clothes in the
bathroom. Stupid ironing board had a board cover that was oversize,
and covered that metal tray on the right side where you place the
iron. Anyway, I placed it there, but on its rear, so it was unstable
and fell in the bucket of water. And - this is what I moron you get
when you're sleep-deprived - I almost put my hand in the water to
retrieve the iron! All while it was plugged in to the outlet. Good
thing I stopped and thought, "Yeah, I should probably turn off the
power outlet first!" By which time the safety switch kicked in anyway
and all the electricity in the house turned off. So got on the forums
- thanks whirlpool.net.au forums - and word on the street is that
Tefal and Philips are the brands to go for. Also learned about this
extremely expensive - but allegedly excellent - brand called
LauraStar. Holy shit, their "systems" can cost up to $1400!! The irons
themselves are selling for $500+, after heavy discounting already. I
don't wanna know the "normal" price. Anyway, another brand name I can
fake and claim that I own, just like Lexus, Miele, Dyson and Apple.
Oh, I do have the latter two. Anyway, it has auto-stop (so it turns
off if you accidentally forget it lying around) and anti-calc system
(so you don't get that yucky particulate flakes coming out of the
steamer when you iron, thereby fucking up your just ironed clothes),
which are the most important features for me. Also had to be light,
since my mother-in-law does an unfair majority of the ironing around
here, so that kicked the GC 4630 out of the running (that had the
Ionic Steam feature). And this model also has Steam boost, so giving
out 100g instead of 40g of steam. Awesome.
6. Running shoes - Friday too, wife and I bought new running shoes at
Paul's Warehouse, Homebush. The bargains are not that extreme as the
ads make it out to be. Tons of stuff were selling for $100+ anyway.
How the fuck can they justify these prices for running shoes? It's not
like they now have cpus and memory foam and teflon. My old ones are 4
yrs old anyway, and looking ratty, so was a good time to get. Total
cost - $170.
All through the week I've been checking out deals on the iPhone
(unlimited broadband for $50 on Optus... please please) and the Nokia
E63 on 3 ($29/mo for 12 mos.. wow). Must forget all this and realise
I've survived this far without this anyway.
Okay, economy, get better!! I just paid you to do so. =)
And I found this bit of shell scripting would work on OSX (currently
on 10.5.7) after moving to the top of the directory tree where i
wanted to delete .svn:
find . -name .svn -exec rm -rf {} \;
Source: http://codesnippets.joyent.com/posts/show/104
most of the time.
Except when I would get "Operation not permitted" with some directory
trees. Turns out these files under .svn had the immutable flag set on
them, and we have to use the 'chflags' command with the 'nouchg' to
remove the immutable flag.
chflags -R nouchg [name of directory containing .svn directories]
eg: chflags -R nouchg MyProject/
Source: http://www.osxfaq.com/tutorials/learningcenter/AdvancedUnix/ugp2/page2.ws
Yay!