Just uploaded it...
Sunday, 24 July 2011
Monday, 18 July 2011
New scala video
Just finished my next video for the scala series.
- Learn how can you create executable scala scripts.
- Learn how to use the print function
Converting ogv to avi on Linux
Looking for a way to turn your good old .ogv videos to .avi?
Install mmencode (http://www.freshports.org/converters/mmencode/).
How to use?
mencoder goodold.ogv -ovc xvid -oac mp3lame -xvidencopts pass=1 -o cool.avi
Install mmencode (http://www.freshports.org/converters/mmencode/).
How to use?
mencoder goodold.ogv -ovc xvid -oac mp3lame -xvidencopts pass=1 -o cool.avi
Saturday, 16 July 2011
Scala tutorial takes off...
Hi all,
New tutorial is starting today. Check out the first part to learn how to setup your Eclipse IDE to run Scala.
New tutorial is starting today. Check out the first part to learn how to setup your Eclipse IDE to run Scala.
Wednesday, 13 July 2011
Software development can be hard... Specially on Mondays
Oh, another post today? Yes, i made a cartoon. Check it out and like it if you liked it :D
Eclipse Series - IDE Hot-key Part II.
I'm happy to announce my new video. This vid is part 2 of my most viewed video. Click to see.
Like it if you like it :)
Like it if you like it :)
Tuesday, 12 July 2011
PowerMock static method replace
I learned something new PowerMock today. Of course I only had to since I did not read the API properly...
So the situation is where you are using a PowerMock to mock a static method from a class. Let's have an example.
I have a class called ProductDAO which has a getInstance() method. And this method is creating a new instance using some database resources which you don't wanna do in your unit test. What you can do is you replace that method with a 'clone' in your unit test class.
And of course you've added: @PrepareForTest(MyTest.class)
Ok. So now when you do the replace? Possibly in a setUp() method annotated with @Before. Which of course mean it will be done for each and every test (performance...).
What i wanted to do is to replace it an a setUpClass annotated with a @BeforeClass. Grr. Wrong.
You can't do that. Here i learned this is not working:
http://stackoverflow.com/questions/4874992/mocking-both-static-and-dynamic-methods-with-powermock
The replace is only working in a dynamic context.
Happy coding!
So the situation is where you are using a PowerMock to mock a static method from a class. Let's have an example.
I have a class called ProductDAO which has a getInstance() method. And this method is creating a new instance using some database resources which you don't wanna do in your unit test. What you can do is you replace that method with a 'clone' in your unit test class.
replace(method(ProductDAO.class, "getInstance"))
.with(method(MyTest.class, "getMockInstance"));And of course you've added: @PrepareForTest(MyTest.class)
Ok. So now when you do the replace? Possibly in a setUp() method annotated with @Before. Which of course mean it will be done for each and every test (performance...).
What i wanted to do is to replace it an a setUpClass annotated with a @BeforeClass. Grr. Wrong.
You can't do that. Here i learned this is not working:
http://stackoverflow.com/questions/4874992/mocking-both-static-and-dynamic-methods-with-powermock
The replace is only working in a dynamic context.
Happy coding!
Monday, 11 July 2011
How to convert ogv to flv on Linux (Ubuntu)
When i started the youtube thing i faced a problem because sometimes youtube is not able to process the .ogv properly.
I installed a tool called ffmpeg to help me convert the vids to flv.
Link to ffmpeg website
How to use it? Easy.
ffmpeg -i problematic.ogv cool.flv
Of course there are a few hundred (if not more) switch you can use. But this was enough for me to start with.
Happy coding!
I installed a tool called ffmpeg to help me convert the vids to flv.
Link to ffmpeg website
How to use it? Easy.
ffmpeg -i problematic.ogv cool.flv
Of course there are a few hundred (if not more) switch you can use. But this was enough for me to start with.
Happy coding!
NetBeans Series - IDE Hot-key Part I.
Another video. Now dealing with some hot-keys for the NetBeans IDE...
Linux basic commands part 2.
Hi again,
Next vid for the linux series...
Linux basic commands part 1.
Hi,
This is my first entry for this site. And the only thing i do is promoting my own video. Sorry :D
Click the link...