Today I noticed an annoying bug in the Android Market application: it showed only 3 applications under the "my apps" section in the market, even though I have over a couple of dozen installed.
Rebooting the device or removing the SD card didn't help.
Being rather new to Android, I was tempted to remove the market application, and reinstall it. But Android is much like Linux, and much less like Windows, so reinstalling an application would probably retain the old settings.
And then it hit me - the settings. Why not reset those?
Simply go to: settings -> applications -> manage applications -> market -> clear data
That's it. The next time the market app launches, it will rescan the installed applications, and everything will be fine again.
That's pretty robust, even though it's in a geeky way, since I don't expect most people to do that.
Wednesday, October 26, 2011
Friday, October 21, 2011
Best Windows Development Environment
I know, this one is going to sound a bit crazy, but hear me out. IMHO, the best Windows development environment is Linux.
First, let me start with a less surprising statement: the best way to run a Windows installation is on a VM. This should make perfect sense to anyone who runs Windows on a daily basis, and knows that as time goes by, it simply gets slower.
No registry or other cleaning utilities can return it to run as fast as it was the day you installed it.
Moreover, when one wants to test a new piece of software, the VM's snapshot feature really shines.
So, every once in a while, one can revert to the a stored snapshot, and get an almost fresh Windows installation, almost instantly.
When it comes to development environments, where one rarely install tools, and the code is managed in source-control, reverting to a snapshot is even easier.
My second point is: use the host environment that you feel most comfortable with. In my case, it's Linux. Specifically Ubuntu. If you prefer running a Mac or a different Windows as the VM guest, it's OK as well. But I can assure you that after giving Linux a trial period as the host OS, you'll find it the most pleasant one.
Moreover, if cross platform compatibility is an issue for you, having Linux *and* Windows running simultaneously, is a great advantage and a real time saver.
First, let me start with a less surprising statement: the best way to run a Windows installation is on a VM. This should make perfect sense to anyone who runs Windows on a daily basis, and knows that as time goes by, it simply gets slower.
No registry or other cleaning utilities can return it to run as fast as it was the day you installed it.
Moreover, when one wants to test a new piece of software, the VM's snapshot feature really shines.
So, every once in a while, one can revert to the a stored snapshot, and get an almost fresh Windows installation, almost instantly.
When it comes to development environments, where one rarely install tools, and the code is managed in source-control, reverting to a snapshot is even easier.
My second point is: use the host environment that you feel most comfortable with. In my case, it's Linux. Specifically Ubuntu. If you prefer running a Mac or a different Windows as the VM guest, it's OK as well. But I can assure you that after giving Linux a trial period as the host OS, you'll find it the most pleasant one.
Moreover, if cross platform compatibility is an issue for you, having Linux *and* Windows running simultaneously, is a great advantage and a real time saver.
Sunday, September 25, 2011
C# Extension Methods
One of my favorite features in C# is Extension Methods. Let me explain why.
Did it ever happen to you that you needed to add a method to a class you cannot edit, and inheritance couldn't help as well?
This can happen in various opportunities, especially when working with libraries and SDKs that uses a certain class for its internal operations, and exposes this class to the user as well.
In such cases, in languages that doesn't support extension methods, the only way to add functionality to that class, is to write a "helper" class or method, and use it.
C# Provides a better way.
Let's say you have a blogging system, and you have a blog summary page, that displays only the first 100 characters of each post, as a teaser. There could be many ways to get the shortened text, but image you could have your own String class, that provides a method that displays the entire post if it's less than 100 characters long, and displays only the first 100 characters and "..." if it is longer.
Have a look at the following extension method:
Simple. This code needs very little explanation. All it does is create a new extension method for the String class that implements the logic described above. Here's a sample usage for this new method:
The output of this would be "12345...", as you'd expect.
The possibilities of extending built-in classes provided by C# and the various libraries, such as ASP.NET MVC, are endless. Just make sure you don't abuse it.
The full source code of the sample given above is available on my bitbucket samples repository. It compiles on Mono as well as on MS C# compiler.
Did it ever happen to you that you needed to add a method to a class you cannot edit, and inheritance couldn't help as well?
This can happen in various opportunities, especially when working with libraries and SDKs that uses a certain class for its internal operations, and exposes this class to the user as well.
In such cases, in languages that doesn't support extension methods, the only way to add functionality to that class, is to write a "helper" class or method, and use it.
C# Provides a better way.
Let's say you have a blogging system, and you have a blog summary page, that displays only the first 100 characters of each post, as a teaser. There could be many ways to get the shortened text, but image you could have your own String class, that provides a method that displays the entire post if it's less than 100 characters long, and displays only the first 100 characters and "..." if it is longer.
Have a look at the following extension method:
public static class StringExtension { public static String ShortenText(this String str, int length) { if (str.Length > length) { return str.Substring(0, length) + "..."; } return str; } }
Simple. This code needs very little explanation. All it does is create a new extension method for the String class that implements the logic described above. Here's a sample usage for this new method:
Console.WriteLine("12345678".ShortenText(5));
The output of this would be "12345...", as you'd expect.
The possibilities of extending built-in classes provided by C# and the various libraries, such as ASP.NET MVC, are endless. Just make sure you don't abuse it.
The full source code of the sample given above is available on my bitbucket samples repository. It compiles on Mono as well as on MS C# compiler.
Friday, September 23, 2011
Ubuntu 11.04 and Unity
For a long time I've been a 10.10 user. Probably too long. To tell you the truth, I couldn't care less. Everything was so customized to my own needs, and everything worked perfectly.
Moreover, since most of my development nowadays is done on a Windows box, I didn't feel the urge to try something new on Linux.
Finally, there were so many bad reviews about Unity, and "thanks" to those I had second thoughts about replacing the desktop environment.
Last week I took the "risk", and you know what? I love it!
I had 11.04 installed both on my workstation and my laptop, and I can easily say it's one of the best Ubuntu versions I used.
On my laptop, I rarely connect a mouse, and I hate touchpads. This means I use the keyboard almost exclusively. Unity seems to be adapted to this, so it provides great keyboard shortcuts. Now I need the mouse even less.
On the workstation, even though I have a big screen with a "big resolution", I always try to find the best utilization for the screen space real-estate. If you ever seen a those 30" mac wide monitors that have the mac dock dragged to the left edge, you know what I'm talking about.
Unity also knows what I'm talking about.
Also, performance is great, as ever. Far better than using Windows. Ubuntu never misses this one.
I wish I didn't wait so long to try Ubuntu 11.04 and Unity. On the other hand, since this version is quite mature, there's a chance I saved myself some of the glitches and bugs it had 5 months ago.
Moreover, since most of my development nowadays is done on a Windows box, I didn't feel the urge to try something new on Linux.
Finally, there were so many bad reviews about Unity, and "thanks" to those I had second thoughts about replacing the desktop environment.
Last week I took the "risk", and you know what? I love it!
I had 11.04 installed both on my workstation and my laptop, and I can easily say it's one of the best Ubuntu versions I used.
On my laptop, I rarely connect a mouse, and I hate touchpads. This means I use the keyboard almost exclusively. Unity seems to be adapted to this, so it provides great keyboard shortcuts. Now I need the mouse even less.
On the workstation, even though I have a big screen with a "big resolution", I always try to find the best utilization for the screen space real-estate. If you ever seen a those 30" mac wide monitors that have the mac dock dragged to the left edge, you know what I'm talking about.
Unity also knows what I'm talking about.
Also, performance is great, as ever. Far better than using Windows. Ubuntu never misses this one.
I wish I didn't wait so long to try Ubuntu 11.04 and Unity. On the other hand, since this version is quite mature, there's a chance I saved myself some of the glitches and bugs it had 5 months ago.
Sunday, September 18, 2011
Trello and Blogging
If you're following TechCrunch Disrupt, or have been reading the recent news from Joel Spolsky, you've probably heard by now about Trello.
If you haven't, let me bring you up to date. Trello is a note taking application aimed to replace ordinary to-do lists and sticky notes used in project management. Every note taken, dubbed "Card", can be much more than a sticky note, as it can contain background text, votes, embedded objects and even someone "assigned" to the card. Cards are organized in lists which are organized in boards.
If you've ever seen agile project management techniques, such as Scrum, you'll be familiar with the board filled with columns of sticky notes, and sticky notes being able to "move" between columns. That's exactly like that.
So far, in order to see what Trello is worth, I've been using it to manage ideas for this blog.
Up until now, ideas for posts where mostly in my head, with some starred items in my inbox that contains the research I did. Now, I have a board with "Ideas", "Collecting information", "Writing", "Follow comments" and "Done" columns. Finally, my ideas are organized and I have a place save the information and even order/rank the ideas before writing posts.
I can see now that I have two ideas I should be working on. If you have more ideas for stuff you want me to blog about, leave a comment, and I'll treat it when this post will reach the "Follow comments" phase.
If you haven't, let me bring you up to date. Trello is a note taking application aimed to replace ordinary to-do lists and sticky notes used in project management. Every note taken, dubbed "Card", can be much more than a sticky note, as it can contain background text, votes, embedded objects and even someone "assigned" to the card. Cards are organized in lists which are organized in boards.
If you've ever seen agile project management techniques, such as Scrum, you'll be familiar with the board filled with columns of sticky notes, and sticky notes being able to "move" between columns. That's exactly like that.
So far, in order to see what Trello is worth, I've been using it to manage ideas for this blog.
Up until now, ideas for posts where mostly in my head, with some starred items in my inbox that contains the research I did. Now, I have a board with "Ideas", "Collecting information", "Writing", "Follow comments" and "Done" columns. Finally, my ideas are organized and I have a place save the information and even order/rank the ideas before writing posts.
I can see now that I have two ideas I should be working on. If you have more ideas for stuff you want me to blog about, leave a comment, and I'll treat it when this post will reach the "Follow comments" phase.
Monday, August 22, 2011
Home Mercurial Server
I hope I'm not the only one who had this problem:
I've been working on some code demos and web designs and wanted to having it under source control, so I could keep track on changes, work from multiple computers and generally have a backup for everything.
For normal projects, I guess this should be done as an open-source project on bitbucket or github, but in some cases it's simply more convenient to have the repository at home.
So, I installed a Mercurial server. Want to know how?
The only thing you'll need is the Mercurial installation for your favorite OS (yes, Windows included). After installing it, run
For the next part, I'll assume the server is accessible only inside the home network, and there's no need to configure extra security measures. So, create a script that servers this repository inside the the repository directory:
Now, from any machine on the network you can use commands such as:
That's it.
Having a "development server" can be very handy, as it could also hold other documents (NAS functionality), personal wiki, local deployment server, etc.
I've been working on some code demos and web designs and wanted to having it under source control, so I could keep track on changes, work from multiple computers and generally have a backup for everything.
For normal projects, I guess this should be done as an open-source project on bitbucket or github, but in some cases it's simply more convenient to have the repository at home.
So, I installed a Mercurial server. Want to know how?
The only thing you'll need is the Mercurial installation for your favorite OS (yes, Windows included). After installing it, run
hg init RepoNamethis will create a repository called RepoName under the current directory.
For the next part, I'll assume the server is accessible only inside the home network, and there's no need to configure extra security measures. So, create a script that servers this repository inside the the repository directory:
hg serve --config web.push_ssl=No --config "web.allow_push=*"All you have to do now is to schedule this script to run on boot time.
Now, from any machine on the network you can use commands such as:
hg clone http://ServerName:[probably_8000]to work with your new Mercurial repository.
That's it.
Having a "development server" can be very handy, as it could also hold other documents (NAS functionality), personal wiki, local deployment server, etc.
Saturday, August 20, 2011
People Skills
I've just read this great post which I found on Hacker News, and felt sympathetic.
For too many times in my short career I was forced to work with people that has no people skills. Those people held a programming, admin or other technical roles, which means they weren't "customer facing", so for the employer, there was no need to require people skills when hiring them.
But that's a wrong call in my opinion. Even if the people in question were among the top 5% of the most professional people I met, I'd rather not work with them at all, than suffer their presence. Even if that means spending a few more days on solving some technical issues.
Many things bother me with such people:
When it's time for me to hire employees, be sure that having decent people skills will be a criteria.
For too many times in my short career I was forced to work with people that has no people skills. Those people held a programming, admin or other technical roles, which means they weren't "customer facing", so for the employer, there was no need to require people skills when hiring them.
But that's a wrong call in my opinion. Even if the people in question were among the top 5% of the most professional people I met, I'd rather not work with them at all, than suffer their presence. Even if that means spending a few more days on solving some technical issues.
Many things bother me with such people:
- Some of them know they're so good at what their doing, and leverage their bad people skills in a way that no one would be able to learn from them. This gives them job security.
- Some of them use the fact no one wants to communicate with them in order to get this quiet room "in the basement".
- If there's a "dirty job" that involves communicating with customers, obviously they aren't tasked with handling it. That's an ugly way to get only the "nice" tasks.
- They get away with ugly code, since no one wants to communicate with them and get them to beautify it or write documentation.
When it's time for me to hire employees, be sure that having decent people skills will be a criteria.
Subscribe to:
Posts (Atom)