The Art of Threading and TDD

I’m really “enjoying” my time without internet, having to use the library as a solution is as dreadful as having to deal with threads, specifically a Java Thread–since PHP does not provide a way to create multithreading apps.

Well, this past week and present week it’s all been about Java. I started creating a Video Encoder using FFMPEG, true I haven’t done much since FFMPEG do everything for me, but I learned a few things, JProgressBar needs a damned monitoring class, if I run the “encode()” method without creating a thread my GUI will freeze to death due to FFMPEG encoding the video. Literally my application is a GUI for FFMPEG, and I know there are hundreds out there, no need to point it out. Its been nice though, I’ve learned tons, like being slapped for not designing my classes and having a mess of  in the “view” class.

The thing is, it was exciting to see it working :) I encoded a video with a duration of 10 minutes and took around 7 mins to finish, regardless of “how long did it take” I was more proud of the fact that all my hard work is paying off, except for the designing part(not gui related). I should have put more emphasis on how classes will relate, but being a Java newbie well, there is still a long road. I’m happy though, I’ve been reading that C# (C-Sharp) shouldn’t be hard to learn once I get the hang of Java. To be honest, it was about time to get my hands dirty with a real language.

All that time didn’t go to waste, but it sure didn’t look like I was 99% near otthreads project. When I came back to reality and sat today with otthreads current code it felt like “variables are not objects…”… my designing skill is still rough… although I’m reading a book of UML and designing my classes feels like I have a lot to learn. Not backing down anyway, I’ve been reading more about Test Driven Development, something I’ve been wanting to do.

I’ve been introducing myself to PHPUnit, heck, it’s easy to set up, although a bit tedious if your classes depends a lot on other classes, but that’s sort of the idea, be able to see and test with data fixtures, correct the errors and test again. Oh well, we’ll see how it goes.

One more thing, now in my little project written in Java I want to try out implementing the Queue interface and allow queuing up videos.

Peace out!

Posted in Java, PHP | Leave a comment

Objects, Java and otThreads

Writing “OpenType Threads” has become a bit tiring, so I’ll be reducing it to otThreads from now on.

I’ve become fascinated with Java, Android and the Play! Framework. I admit, playing with Android with my current knowledge it’s quite frustrating. Moreover, it seems I’ve become obsessed with Java syntax, well, libraries. After seeing the power of Annotations in Java, I dared to check it out in PHP (Reflections) and did come up with a few helpful ideas that will help me and extensions developers (especially in this area).

Anyway, I created a guestbook which I’m hoping to deploy soon and make it available to the web. There were too many temptations while I created that guestbook, it was like a guestbook + video site + image uploads kind of guestbook, which doesn’t apply to the guestbook stereotype because it transcend what it should be… but begin new to Java I was tempted to try out so many things, some do-able (like video processing and image processing) and some quite hard to grasp (background processing, queue system, system tray icon, etc)

That’s it for my random posts :)

Posted in Java, PHP, Programming | Leave a comment