I recently got this error in a crash report from the android market for my app.
The problem was that I was trying to load many bitmaps into a gridview (thus causing the app to run out of memory). The problem became quite noticeable at around 20 bitmaps and over.
I was trying to fix the problem with all kinds of silly band-aid solutions (eg calling the garbage collector in getView of the adapter, yikes!)
I managed to identify the root cause of the problem: I wasn't scaling the images in the BitmapFactory.
I was doing this:
BitmapFactory factory = new BitmapFactory();
Bitmap img = factory.decodeFile(path);
when I should have been doing this:
BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 4;
options.outHeight = HEIGHT;
options.outWidth = WIDTH;
BitmapFactory factory = new BitmapFactory();
Bitmap img = factory.decodeFile(path,options);
After 30 seconds of vigorous scrolling of the gridview, I think I have solved it. Or maybe not, feel free to try out my app and let me know if it crashes again:
https://market.android.com/details?id=remember.me
I hope that helps.
Saturday, September 24, 2011
Tuesday, August 30, 2011
I finally did it!
Today I published my first Android app!
Check it out and send me bug reports!
https://market.android.com/details?id=remember.me
supports version 2.1+
Tested on HTC Magic with Sense UI
Check it out and send me bug reports!
https://market.android.com/details?id=remember.me
supports version 2.1+
Tested on HTC Magic with Sense UI
Monday, May 2, 2011
War Profiteering 101
War Profiteering 101:
Step 1: Find shady Middle Eastern dude
Step 2: Give shady Middle Eastern dude weapons
Step 3: Use shady Middle Eastern dude as scapegoat
Step 4: Bomb Middle East
Step 5: Profit!
Step 6: Declare victory
Step 7: Kill shady Middle Eastern dude. He is no longer needed.
Step 8: Repeat step 1
Step 1: Find shady Middle Eastern dude
Step 2: Give shady Middle Eastern dude weapons
Step 3: Use shady Middle Eastern dude as scapegoat
Step 4: Bomb Middle East
Step 5: Profit!
Step 6: Declare victory
Step 7: Kill shady Middle Eastern dude. He is no longer needed.
Step 8: Repeat step 1
Saturday, April 9, 2011
The end of the new theme
This will be my last post for cmpt 376 and I want to reflect on the last 25 posts in this blog. Initially I had hoped to write some intelligent and worthwhile posts, but my laziness got the better of me. I'm not saying that I didn't put any thought into it, but the well thought out posts were not as frequent as I had hoped. even so, I'm still happy that this blog actually had a legitimate purpose for once (5%). I guess it's now time to go back to our irregularly scheduled programming of profanity, Bible verses and anti-Americanism.
Thursday, March 31, 2011
11 days left and Ubuntu stuff
Next week is the last week of class, and there is one assignment due for each class. At this point, I'm honestly just looking to get it over with.
On a completely unrelated not, Ubuntu 11.04 Beta 1 was released today. Once I stop being lazy, I will read up about it and maybe post my opinion here. I am looking forward to this version of Ubuntu because it will be running on the 2.6.38 kernel and from what I've read, it will result in a noticeable leap in performance. I'm still not a fan of Unity, and after running the Macbuntu theme since Christmas, I don't want to go back to standard Gnome. I'm hoping the Macbuntu developers release an 11.04 version soon after the OS gets released.
On a completely unrelated not, Ubuntu 11.04 Beta 1 was released today. Once I stop being lazy, I will read up about it and maybe post my opinion here. I am looking forward to this version of Ubuntu because it will be running on the 2.6.38 kernel and from what I've read, it will result in a noticeable leap in performance. I'm still not a fan of Unity, and after running the Macbuntu theme since Christmas, I don't want to go back to standard Gnome. I'm hoping the Macbuntu developers release an 11.04 version soon after the OS gets released.
Sunday, March 20, 2011
Shaw bandwidth caps
With this whole UBB debate still raging on (not in the news), you may be curious to find out how much bandwidth you are using. If you are a Shaw customer, head over to secure.shaw.ca and sign up for an account. From there, you can see your monthly bill as well as a nice bar graph of your monthly usage. I am currently at 59.xxGB for March, with 12 days until April 1st. Let's hope I don't get any angry emails.
Saturday, March 12, 2011
30 days left
There are 30 days left in the spring 2011 semester and I seriously need to stop slacking. This week I have three assignments due. I really should start doing them, but the force of procrastination is strong. I also need to look into doing more job applications for summer co-op, but I feel quite lazy. I think I might have burned myself out last semester. It will e a shame if my GPA drops after this semester.
On the up side, I'm almost done with this blogging business...
On the up side, I'm almost done with this blogging business...
Thursday, March 10, 2011
R.I.P Mike Starr
The original bassist of Alice In Chains was found dead on March 8. He was 44. I'm guessing people who aren't fans of the band don't know who he was. Starr played bass on AIC's first two studio records. He contributed to the most "well known" Alice In Chains songs. His work can be heard on the song "Would?", "Man In The Box" and all the other songs from Facelift and Dirt. It's a shame that he could not overcome his addictions.
Tuesday, March 8, 2011
TIL: I am allergic to alder, birch and oak
Today I had an allergy test done. As I suspected, I am allergic to grass. I guess I'm just the typical hay fever sufferer, and that's fine by me, but it turn out I am also allergic to alder, birch and oak. That was totally new to me. There goes a career in trail building and forestry...
Sunday, March 6, 2011
Canucks win two in a row!
For the first time in about a month, the Vancouver Canucks managed to win two games in a row. For the last month, they have been a .500 team. Imagine that, a .500 team was #1 in the NHL for the previous month! Of course, this was seen as a problem by the sports writers in Vancouver, but consider how many teams in the NHL would love for their .500 play to be a serious problem. Think of Edmonton, Columbus, NYI and Ottawa. Maybe the Canucks have had problems with consistency, but they are still the best team right now.
Also, Cory Schneider got his first career shut out tonight.
Also, Cory Schneider got his first career shut out tonight.
Thursday, March 3, 2011
Ubuntu 11.04 Alpha 3
I just watched a couple of video reviews for Ubuntu 11.04 Alpha 3, and I am impressed! When Alpha 2 was released, it was very unstable and of low quality in general. I thought for sure Canonical would ship a buggy OS in April, but wow, it turned out better than expected. I am still not a fan of Unity (Gnome Panel guy here), but it looks better than before. I also like how Firefox 4 looks. I have said that I would wait until 12.04, but I am beginning to change my mind. I think I will update to 11.04, but I will wait until the 11.04 Macbuntu theme gets released.
If you have the time and hard drive space, check out Ubuntu 11.04 Alpha 3 for yourself.
If you have the time and hard drive space, check out Ubuntu 11.04 Alpha 3 for yourself.
Tuesday, March 1, 2011
Canucks after the trade deadline
I am impressed by what mike Gillis managed to do this year at the trade deadline. He made the #1 team even more complete. for many years now, Canucks GMs past and present have been criticised for doing nothing (or not doing enough) at the trade deadline. Most years this was a fair criticism, as Canucks teams of seasons past have needed a lot of improvement at the deadline.
This year was different. The Canucks are currently #1 in the NHL, so if ever there was a year when doing nothing was a good thing, this was it. Instead, Mike Gillis acquired Chris Higgins and Maxim Lapierre without giving up much all around. Now the team is even deeper and tougher to play against than before. Congratulations Mr. Gillis, you have built a true Stanley Cup contender.
This year was different. The Canucks are currently #1 in the NHL, so if ever there was a year when doing nothing was a good thing, this was it. Instead, Mike Gillis acquired Chris Higgins and Maxim Lapierre without giving up much all around. Now the team is even deeper and tougher to play against than before. Congratulations Mr. Gillis, you have built a true Stanley Cup contender.
Saturday, February 26, 2011
44 days left
Just posting to point out that there are 44 days left in the semester. personally, I still feel like the semester just started. I've been slacking off way too much. I probably should get back on the horse, but I do feel good just slacking off. I have two more midterms coming up, so I should start studying. Judging by the course content, the algorithms midterm will be quite hard.
This blog post counts as school work, right?
This blog post counts as school work, right?
Friday, February 18, 2011
Every programmer should know at least one scripting language
I came to this realisation after a recent interview I had. The interview involved some programming questions in the language of my choice. Now, this job would involve Objective-C and Java, so clearly they didn't care how well I knew the syntax of those languages. They wanted to test my knowledge of core CS principles as well as my problem solving skills. I didn't get the job, by the way.
What I realised afterwards was that doing the test in PHP made it somewhat easier to focus on the logic of the problem at hand. So even you hardcore C/C++/Java/C# types need to learn a weak typed scripting language because even if you're a hardcore C guy, you might not get the hardcore C job because you failed to answer a programming question in C.
My suggestions would be Perl, PHP and/or Python.
What I realised afterwards was that doing the test in PHP made it somewhat easier to focus on the logic of the problem at hand. So even you hardcore C/C++/Java/C# types need to learn a weak typed scripting language because even if you're a hardcore C guy, you might not get the hardcore C job because you failed to answer a programming question in C.
My suggestions would be Perl, PHP and/or Python.
Wednesday, February 16, 2011
Technical interviews
I had a very technical interview at a local startup today. I can't say that I completely bombed it, but I did far from well. The lesson here is that if you are a software engineer, prepare for an interview as if it were a final exam.
I did try to study for this interview, but I made the mistake of focusing too much on learning a language instead of the computing science fundamentals (see previous post). Bottom line is: they don't care what your favourite language is. You must be able to come up with a correct and efficient solution on the spot. You must also be able to analyse and explain why your solution is correct and efficient. Study your Big O notation, kids!
I did try to study for this interview, but I made the mistake of focusing too much on learning a language instead of the computing science fundamentals (see previous post). Bottom line is: they don't care what your favourite language is. You must be able to come up with a correct and efficient solution on the spot. You must also be able to analyse and explain why your solution is correct and efficient. Study your Big O notation, kids!
Tuesday, February 15, 2011
Python
As I'm sitting here preparing for my interview tomorrow, it hit me: I'm starting to like Python. The job I'll be interviewing for tomorrow will involve some Python, and I haven't done any in almost two years, so I decided to implement merge sort, quick sort and a few other things for practice. Man, the syntax is so straightforward, and it reads like pseudocode! Obviously Python isn't ideal for everything, but if you are designing algorithms or something like that, this is the way to go.
Sunday, February 13, 2011
Reading break
This is SFU's first ever reading break. In general, it is pretty cool to get a week off to sleep in, but I don't really feel like I need it this semester. For me, this semester has been so slack, that week 6 felt like week 2. It will probably pick up though, I still have to do 5 papers, 1 project and 3 midterms. On top of that, I have my co-op stuff to do. Perhaps its not that slack, maybe I'm just lazy.
Foggy Dew Nachos: Nutritional disaster
I was at the Foggy Dew tonight and before leaving, I decided to split a plate of nachos with a friend. Why, oh why? Now, we all know that pub food is cheap and greasy, but come on. There actually weren't that many chips in there, it was just a pile of cheese, grease and jalapenos. If we assume that pubs pile on more of the cheap ingredients than the expensive ones, from tonight I can conclude that jalapenos and cheese are much, much more expensive than chips. Hello heartburn.
TL;DR Ate too many jalapenos, not enough nachos, feel ripped off.
TL;DR Ate too many jalapenos, not enough nachos, feel ripped off.
Friday, February 11, 2011
Interview cancelled
I was scheduled for an interview at a certain multinational software company for Monday. I get home today, check my email and see that my interview has been cancelled. I don't know why, but I'm guessing that my interviewer has some more urgent issues to deal with. If this is the case, then I hope those issues get resolved ASAP and that everything works out. It could also be that they found their ideal candidate today. In this case, I'm happy for whoever got the job. I'm not upset by the cancellation, I'm just very confused.
Monday, February 7, 2011
Turning down the safe choice
Today I turned down an offer to come back to my old job at a certain well known video game company. Why? The people were nice, the office was nice, I did well last time. So why not come back? Because I decided to risk the safe option for a possibly better opportunity. At a different job, I might end up working with total dicks, but I want to try something new. Hopefully it won't bite me in the ass.
Thursday, February 3, 2011
UBB
Usage Based Billing is the talk of the internet nowadays (sorry Egypt) so I might as well put my two cents in. Here it is: the idea is absurd! Doing some reading online, I found out that bandwidth costs at most a dime or two to provide a gigabyte of bandwidth but Bell and Shaw want to charge around $2 per gigabyte over a 25GB cap. Does that sound fair?
I see many problems with this whole thing. While I do agree that there should be a bandwidth cap, 25GB is way too low. Set it at 60 and I think most Canadians will be fine with it. Second, why does UBB have to be mandatory for all ISPs? The CRTC should let free markets control prices. IF we do have to have UBB, then the charges should be more in the area of 25 cents/GB. That would be ok by most. Third this whole thing smells of corruption and corporate interests, just sayin'....
As for efforts to reverse the decision there are four groups who want to protect UBB: the greedy, the apathetic, the ignorant and the technologically impaired.
Note: The Canadian government has taken the first steps needed to reverse the decision. I realize that I'm late in jumping on the moral outrage bandwagon, but I just wanted summarise my thoughts on the issue.
TL;DR: moral outrage over UBB
I see many problems with this whole thing. While I do agree that there should be a bandwidth cap, 25GB is way too low. Set it at 60 and I think most Canadians will be fine with it. Second, why does UBB have to be mandatory for all ISPs? The CRTC should let free markets control prices. IF we do have to have UBB, then the charges should be more in the area of 25 cents/GB. That would be ok by most. Third this whole thing smells of corruption and corporate interests, just sayin'....
As for efforts to reverse the decision there are four groups who want to protect UBB: the greedy, the apathetic, the ignorant and the technologically impaired.
Note: The Canadian government has taken the first steps needed to reverse the decision. I realize that I'm late in jumping on the moral outrage bandwagon, but I just wanted summarise my thoughts on the issue.
TL;DR: moral outrage over UBB
Tuesday, February 1, 2011
Out of shape...for writing
I'm almost done the second page of my 3 page (minimum) paper which is due on Wednesday. As I was struggling to put the concepts into prose, I came up with a really interesting analogy. When I'm writing a paper, I'm like the fat kid doing the 400m sprint. Its slow and very, very painful. One more page to go. Run, fatty, run.
Sunday, January 30, 2011
Writer's block?
I have to write a three page (single spaced) paper on a CS subject of my choice. I am having problems filling up the pages. I chose heapsort as my topic. I understand the algorithm, an know some basic facts about it, but I'm still having trouble filling up the pages. I guess this doesn't qualify as writer's block, there is plenty to write about, it is more a lack of motivation and will. This does not feel like a 10% assignment.
TL;DR: writing is painful.
TL;DR: writing is painful.
Tuesday, January 25, 2011
The firing of Keith Olbermann is a blow to my procrastination
Last Friday was the last episode of MSNBC's Countdown with Keith Olbemann. Word on the Internet is that he was released (read: fired) from his contract. I see two problems with this. First, there is now one less voice in the American news (HA!) media to speak out against the nutjobs at Fox news. Second, although I do not agree with all of his views, Olbermann was a good host hosting a good show. Most importantly, I lost my 6 o'clock time waster.
Saturday, January 22, 2011
Too much writing
I have way too much reading and writing to do this semester. Maybe it isn't too much, but it sure feels like it. Being a computing science student, I'm used to writing code, not prose. This semester I will have eight (I think) writing assignments in one course plus another two reports (at least) in another. Fortunately, the Algorithms and Data Structures course is keeping things interesting for me.
I'm sure this is good for me somehow. I could probably use some practice writing papers.
TL;DR: Too much writing, frustrated.
I'm sure this is good for me somehow. I could probably use some practice writing papers.
TL;DR: Too much writing, frustrated.
Wednesday, January 19, 2011
Well F (Mail) Me...
I'm not sure whether they've already done it or not, but word on the interweb is that Facebook wants to offer an email service a la Gmail.
Allegedly this service will unite your Facebook messages, IMs, SMSs and emails all into one service. I like this idea, this is a very good idea for sure. It will probably have a slick implementation, too.
The problem I have with it is that Facebook is doing it. To understand why, please read "Dear Facebook."
They have their hands on my name, age, location, employment history, and relationship status and now they want my emails. Yes, I know I gave them this information voluntarily, but why do they have to give it away like a cheap hooker in Las Vegas? And yes, I know Google does the same thing, but at least they aren't so blatant about it and they offer some pretty cool products and services.
I just hope that people will see the implications of a Facebook email service and will not use it as a result. Either that, or everybody should sign their Facebook email addresses up for some very questionable mailing lists just to troll Facebook. May I suggest Domestic Terrorist Weekly, Kinky Porn Monthly and Al-Qaeda Quarterly.*
*Mailing list titles are fictional.
Allegedly this service will unite your Facebook messages, IMs, SMSs and emails all into one service. I like this idea, this is a very good idea for sure. It will probably have a slick implementation, too.
The problem I have with it is that Facebook is doing it. To understand why, please read "Dear Facebook."
They have their hands on my name, age, location, employment history, and relationship status and now they want my emails. Yes, I know I gave them this information voluntarily, but why do they have to give it away like a cheap hooker in Las Vegas? And yes, I know Google does the same thing, but at least they aren't so blatant about it and they offer some pretty cool products and services.
I just hope that people will see the implications of a Facebook email service and will not use it as a result. Either that, or everybody should sign their Facebook email addresses up for some very questionable mailing lists just to troll Facebook. May I suggest Domestic Terrorist Weekly, Kinky Porn Monthly and Al-Qaeda Quarterly.*
*Mailing list titles are fictional.
Monday, January 17, 2011
Facebook, what the hell?
So it looks like today was the global roll out day for yet another Facebook profile layout. After having it for 5 hours, I already want the old one back. Personally, I don't like (ha!) The top section of the profile. I don't want photos of me showing across the top. Not because of privacy concerns, but because I really don't have any photos of me up there that are worthy of being at the top of my profile. I will investigate ways of turning that feature off.
Now, for the little "timeline" thing above those photos. I know that my personal information is already up there, but I can't help but get an "information stockpiling" vibe from it. I really do feel that they are putting less and less effort into hiding their true motives.
Now, for the little "timeline" thing above those photos. I know that my personal information is already up there, but I can't help but get an "information stockpiling" vibe from it. I really do feel that they are putting less and less effort into hiding their true motives.
Thursday, January 13, 2011
Birthday Post
So I'm 22 now, time to start thinking about graduation. The last few years have been so great, that I really don't wish to fundamentally change anything. I just wish for a "more of the same, but better" kind of year. By this time next year, I hope to have completed another two Co-op terms and maybe 15 credits. That would get me to within 21 credits of the 120 required to graduate.
Cheers to another trip around the sun!
Yeah, yeah, yeah, another filler post. I promise to get to the interesting stuff soon.
Cheers to another trip around the sun!
Yeah, yeah, yeah, another filler post. I promise to get to the interesting stuff soon.
Monday, January 10, 2011
A new theme
This semester I'm taking a writing course. Five percent of the total grade will be based on 26 blog posts (this counts as one). The requirements are pretty slack, but I do intend to put a bit of thought into it. I'll also try to not make it "tl;dr." As before, I'll be sticking to the Rules of this blog, no matter how desperate I get for content. One down, twenty five to go.
Subscribe to:
Posts (Atom)