Once upon a time, I went for a bursary application interview. It did not go well.
I’m conducting a research survey thing. I made it easier for you to help. Go to this page to answer 3 questions (plus an email address of yours if you want a compiled summary of answers).
Hey you! Yeah, you. If you’ve been reading this blog for a while now, thanks! If you’re new, welcome!
In any case, I’m doing a research/questionnaire project, and I’d like your help. You just have to answer these questions:
- What are your biggest frustrations/problems right now?
- What do you want to learn about right now?
- What ebooks do you read (or would like to read) on the Amazon Kindle (or other ebook reading devices)?
Your answers don’t have to be specifically related to software development. Send your answers via email or use my contact form if you’re into that kinda thing. I’m not accepting comments because I don’t want everyone to see your answers. I’ll be compiling a summary and sending it to you if you help me answer, so commenting here won’t be useful.
My email address is
vincent (at) polymathprogrammer [dot] com
Lesson learnt on the Internet: Repetition. Send your answers to me via email or use my contact form. I’ll compile a summary and send it to you.
Much appreciation and gratitude to you. Have I mentioned I’ll be compiling a summary of other people’s answers and sending it to you? Thrice I’ve said it, and thus let it be done.
Public vlogging is like public speaking. Except it might be worse. At least with public speaking, you’re talking to people. With public vlogging, you’re talking to a camera. I’ll let you decide which is worse…
There was a time when talking into a mobile phone was weird because you don’t look like you’re talking to anyone. Now everyone and their grandmother is on a mobile phone. There might come a time when recording videos is commonplace, whether at home or in public.
Do we still have those guys with Bluetooth earpieces?
So the last time, I told you I came up with my own video format so I could load videos into my game engine. Today, I’m going to tell you what it is.
The concept isn’t revolutionary. Image compression is the art of expressing an image in as small a form as possible. There are 2 versions: lossy and lossless. Lossy compression means some data is lost, meaning the file size can be smaller, but overall you won’t notice the difference (much). The jpeg format uses this. Lossless compression doesn’t lose any data at all. The png format uses a lossless compression.
I don’t know much about video compression. However, a video is a series of images. So what I did was instead of focusing on image-by-image compression, I adopted time-based compression.
For each pixel position, I try to come up with an algorithm (or specifically a maths formula) that will represent all the pixels in that pixel position throughout the entire video.
Let’s say we use the top-left pixel of the video. And let’s say that pixel is pure white for half of the video, and black for the other half of the video. My aim is to represent this “pure white 1st half, pure black 2nd half” information in 1 formula.
With this in mind, let’s say I’ve got a maths formula somehow. Let’s say it’s a 640 by 480 pixel video (it was considered good resolution back then. I know we have HD now…). Let’s say there are 3 variables in that maths formula. This means, I have to store 3 * 640 * 480 variables in my movie format.
Yes, that’s the compression tactic.
Well, more specifically, I had to come up with 3 * 640 * 480 maths formulas that compresses itself as efficiently as possible. With some research, I found that the less the variables vary (hahahah…), the better the compression. This means the colour space I use is important. RGB values change too much.
And with some more research, I found the YUV colour space ideal for use. I think what I actually did was count the number of consecutive values and store that. The YUV space has a “lightness” component, which for most videos, doesn’t change very often.
This means in the ideal case, I store “N of X” for the “lightness” component, where N is the number of times the value X occurs for the “lightness” component of that pixel position. And in the ideal case, N would be approximately the frame rate multiplied by the number of seconds.
So for each pixel position, I store a series of counts of the Y component (could be 10, 50 or ideally just 1). Then I store a series of counts of the U component. And similarly for the V component.
Then I move on to the next pixel.
The idea is that the longer the video, the “better” the compression. It’s not that the compression tactic is better. It’s just that the tactic takes advantage of the fact that certain colour components don’t change much. If a pixel is always white, it doesn’t matter if the video is 1 second long or 1 hour long, we just store “30 white” and “3600 white” respectively (assuming 30 frames per second).
This works great for screencast videos because the screen typically doesn’t change much. It’s usually just the mouse moving around and clicking stuff and sometimes the screen changes. This means most of the screen stays the same. And if you’re like me, you’ve probably watched some screencast videos where nothing on the screen happens for minutes. It’s just the person talking.
Of course, I fudged the actual values a bit so they can compress better. Meaning it’s a lossy compression. But in the end, it was comparable to a moderately compressed QuickTime movie file, so I was ok with that.
But even if the compressed size is still larger than other movie file types, at least it’s not copyrighted. So I can use that. And if you want to try this compression method, go ahead and use it (you have my permission). Let me know how it works out for you.
In which I answer a question about starting a business while you’re studying. Here’s the blog post in question.
Back when I was in my making games mode years ago, I was interested in space. Specifically data storage.
Blitting images to the screen as quickly as possible to keep the frame rate consistent was a thing. Texture images are pre-created. Then there’s the concept of generating textures as the program was executed. This was how demos pack data into a small space.
I was studying fractals then, the iterated function system was a thing. I found it a pain to implement though…
And then I was interested in having moving images in my game engine. Packing movies was way harder than images.
Due to the copyrights of all the video formats, in my infinite wisdom, I decided to create my own. I mean, it’s a series of images, right?
The resulting customised movie file was just slightly larger in size than the QuickTime .mov format. I took that as an encouragement. I’ll tell you what I did next time.
Part 2 of my visit to the mini Maker Faire held in Singapore, August 4. We have robots that walk and do self-defence and play soccer. And musical instruments made out of unusual materials. And a fire tornado.
A few days ago, I went to a BlackBerry developer meetup session hosted by my friend. Being primarily a .NET developer, I thought I’d broaden my horizons and learn what the BlackBerry platform was about.
It was a little bit of a show-and-tell. It turns out that the next version of BlackBerry is going to be out soon, and the session was sort of a “getting developers to develop for the BlackBerry 10” thing.
I’m not really going to go into the details of the new BlackBerry nor its development platform. I am going to talk about apps, since it’s the in-thing currently. Here are the markets I know of:
- Apple’s app market on the iPhone and iPad
- Microsoft’s app market on Windows phones and the to-be-released Windows 8
- Google and its Android phone app market
- RIM (Research In Motion) and its BlackBerry app market
I’m using “app market” in the general sense. There are probably other app markets, but the ones listed should be in the top few in terms of audience size.
What I learnt at the session
I’m not a BlackBerry developer, so I mainly kept quiet and listened. However, as the presentations went on, and I asked questions, something hit me. I approached app development differently from the developers present, including the presenters.
Preemptive disclaimer: The developers are probably very good at their work. The following are my opinions after being self-employed for over a year and studying business and related materials for longer than that. I’m not putting those developers down.
Here we go. These developers were interested in the technical aspects of BlackBerry development, whether it be the hardware specs of the BlackBerry, or the tools used for BlackBerry development.
I asked my friend who’s a consultant for RIM about the BlackBerry, and he told me a bunch of specs on the new BlackBerry. Now I’m a programmer, but I don’t get real excited about stats.
Let me put it to you this way. Most consumers will have their eyes glazed over when you tell them some piece of hardware has X gigabytes of storage and so on. Apple, just said the iPod can hold 1000 songs.
Get the picture?
The developers were interested in what they could do on the new BlackBerry. I was interested in what consumers could do on the new BlackBerry. That difference is what makes you money. If you don’t like the idea of monetary gains, then think of the popularity of your app. Think of widespread acceptance and downloads of your apps.
One developer asked my friend (who’s presenting at that moment) to go to a particular website and click a button there. Nothing happened. I asked that developer what’s supposed to happen.
He said you’re supposed to have a pop-up to select files. The first thought I had was security. And even if file selection is allowed, and assuming the user knows what he’s doing, what kind of files were allowed and why would it even be useful?
Sure, you could select photos for upload, or business documents for transfer. But I believe the app should handle the file selection interface, which makes it seamless for the user.
Designing for the consumer
But that question is really the heart of what most (or all) of the developers there were concerned about. They want to know what’s the storage capacity, the screen size, what tools to use for development, how to debug your applications and so on.
These are all valid questions and concerns. And I understand that some people are really into the technical aspects.
So what kind of questions did I ask?
I asked if videos can be taken. How’s the quality of a video playback? How’s the quality of the audio? Is there a YouTube app?
On the train or buses, people plug in earphones and either watch videos or play games or text communicate (either messaging or Twitter or Facebook or whatnot) on their mobile devices. The technical aspects are useful. I just think coming up with an app that people would want to use is priority one. The app doesn’t have to be complicated. It just has to either be useful or entertaining.
So I basically asked questions that consumers are more concerned about. And the new BlackBerry from what I’m told, is targeting the consumer market. It makes sense that BlackBerry developers should also be concerned about similar topics.
There were questions on the price of licensing. It’s free to upload apps, but there’s a fee for certification. From some research I did, the revenue sharing scheme is the standard 30/70, with 70% of the revenue going to the developer.
Here’s the funny thing. No one asked about making money stuff. Not about how to do in-app purchases, or the kinds of prices used (although the developers are free to set their own price), or how to get paid. Maybe they already know, and I’m the only one in the dark (I’m not a BlackBerry developer).
I look at the apps from the perspective of both a business owner and a developer. Maybe that’s why I stopped fretting about technical difficulties. Because the instant a human user uses your software, you’ll find out the real and important difficulties.
I went to the mini Maker Faire at the Singapore Science Centre.
In the video, there’s a device that measures distances using ultrasonic waves, and based on that, turns a light on or off. It took me a while before I finally understood the concept. I thought it was directional, because she explained the device by pointing it up and down for light-on and light-off. Then I asked if it could be programmed to understand sideways directions…
Basically, if you block the emitting device (ultrasonic waves) within a certain distance, the light switches on. That’s why pointing to the ceiling switches it off, because the distance between the device and the ceiling exceeds the programmed distance limit.