Showing posts from 2011

Turning On Debugging on Kindle Fire Device

Having recently purchased a Kindle Fire and also because I recently started learning how to program games for Android I decided to see if my play projects would run on the Kindle Fire.Much to my dismay there was no “Allow Debugging” setting on the Kindle Fire like there is with my DroidX phone.  Also my Kindle Fire was not recognized by my Eclipse IDE as a device.After hunting for an answer I found how to do just that from information on the following links

In the first link you will find a post by AdmiralUD that outlines the entry you must make for the Android drivers.
Because I had to piece meal the solution on my own and because it was somewhat confusing at first, I decided to share a more comprehensive solution to the problem.
I will caution you that before you start developing on the Android you will need to download the Android SDK as well as the Eclipse I…

Turning On Debugging on the DroidX for Android Development

I started playing around with Android development yesterday.  I was able to follow all the setup instructions to run my initial program from the emulator.  However, when I tried to run my program from the actual device (I have a DroidX by Motorola) I ran into some issues because it was not being recognized.  That's when I colleague pointed me to a setting in the phone itself. 

It turns out I had to allow debugging.  To allow debugging on your DroidX just navigate to Settings/Applications/Development. Once there turn on USB Debugging.
Once I turned it on I was able to run my Hello World app on my device.

If you are interested in the book I am learning from you can get it at Amazon Or if you have a Safari account you can read it online like me.

Simple Example of Using Pipes with C#

So I decided to dig into understanding how works under the hood, out of curiosity.  In the articles that I found the authors described the architecture in lower level details.  One of the things that caught my eyes was the use of named Pipes as a means of inter-process communications by the architecture.   So I decided to dig into that portion a little bit deeper.  I discovered that the .Net framework has a namespace for named pipes and it's quite easy to use. 

I intend to demonstrate a small example that I cooked up rather quickly by setting up a named pipe server and then connecting a pipe client to it.  Before I do that, I want to say as a disclaimer that I don't know that this example demonstrates the best way to use pipes.  What it does do is show the most straightforward way to use them.  Also, before you use pipes you should consider using something else like WCF instead if you need well defined interfaces, as using pipes is pretty raw.   Being the type of perso…

DirectoryWiz an Open Source Framework for Cleaning Folders

I have started work on something that has been brewing in my mind for some time.  I have created a framework to enable me to clean folders of undesired folders and files.  For example say I want to remove all the .svn folders from my solution to save space and archive somewhere.  Or maybe I want to remove the bin and debug folders so that I can zip and mail out the solution.

I primarily wrote it as a tool for myself.  The primary purpose of this framework is to clean folders of undesired files and folders, such as cleaning the bin and obj folders from your solution.  It is also to aid in copying folders and folder trees.  This is in effort to get around the faulty windows copy system that chokes on the first error.

Anyway, I'd be interested in hearing your thoughts.  If you have some time please visit the git link below and read ReadMe file on the site.  If you have more time than than that, go ahead and download the source code.   Then please provide me with your feedback - do y…

Evaluating Mercurial as a posibble DVCS as opposed to Git

As some of you might know, lately I've been searching for a new tool to use as a version control system.  Currently for my job we still use Subversion.   In many ways we have outgrown it or at least we realize that we can take advantage of some of the capabilities of a distributed version control system (DVCS) - like disconnected operations, redundant backup repositories, better performance.

 To allow us to meet our team's needs we need keep a workflow similar to what we have with subversion - many clients and one master host or central repository.  I have not gone through the the process of setting up a git repository on the server - but it looks like a real headache.  It seems that even setting up a normal local file repository is a challenge.   A local file repository would be insufficient because we cannot control security with that anyway.   However to go through the whole process of setting up Git with SSH, it feels like I'm trying to fit a square peg into a round ho…

Learned about the :hidden filter today

It seems that the more I dig into jQuery the more I realize how vast a library it is.   Also noticed that much of the CSS3 stuff is bleeding off into jQuery territory, but that is a topic for a different day.

I am currently reading the book jQuery in Action.  I am only in Chapter 2 and I've been reading it for about two weeks... sigh.  That should give you an idea of how long it's taking me to tackle the jQuery topic.

The topic of this post is to demonstrate how with my new knowledge of the ':hidden' filter I was able to reduce some code.

I basically went from multiple methods and dynamically adding a CSS class to the latter example marked 'TO simply this' below.

//From this
var checkIfIsExpanded = function(){

                                if(  $(this)

Identifying Problems that Already Have A Historical Lessons Learned

Recently I ran into a problem that I had I had solved before.   This time the solution was being implemented by another developer. As it turns out, he ran into the same traps that I fell into when I solved that problem.  The only problem is that I was not able to identify all the pitfalls before hand.   

How did I fail to identify the traps and pitfalls?  I had been there before, but I failed to pass along these lessons learned.  My danger antenna never went up.

What lead me to buy into the his solution and eat a big piece of the gullible cake was  three things:

 Being under extreme pressure to a meet deadline Believing in the confidence of this very capable programmer "Oh it's easy, I got it, I will have in a couple of hours" The alternative solution was many times harder so this seemed to be a silver bullet
In the end then solution worked but it was many times more effort than the programmer assured me.  And much of that has to do with being my fault.

I am dissapointe…

Understanding the 'this' keyword in javaScript and JQuery - $(this)

This in C#, Java, C++

The keyword thisis something that has special meaning for most developers that have worked with the C family of object-oriented languages (i.e. Java, C++, C#).  In those languages the keyword this is used by the containing class's instance to refer to itself.  Depending on the conventions and standards used, many of us do not use the keyword even though we know it's there.  That is because, as an example, in C# many developers use naming conventions that eliminate any need for it.  In a popular C# convention, for example, a property always starts with an uppercase character, a non-public field starts with an underscore and  local variables start with lower case characters.

Therefore according to that convention the following statements hold true:

_age is a fieldage is a local variableAge is a property
In those languages thisis only necessary to express the scope and that is usually only when you have other variables that might obscure a field or property b…

Forget the Domain, the Model and MVC; Let's Talk About Layered Applications

In my job, as technical lead, I am frequently asked general programming questions by the junior developers.  I love the questions because it gives me an opportunity to share the knowledge I've been fortunate to acquire over the years.  Also, it helps me find out or to ponder on things that I don't know.

A couple of days ago I presented a class titled "On Clean Code", based on the philosophy presented by Robert C. Martin in his book Clean Code. The class consisted of several exercises, one of which consisted of a challenge to clean up a function that was poorly written.  The function contained many violations of clean code that Martin outlines, such as abbreviated variable names, non-descriptive variables, etc, but the biggest fallacy in this function was that it had too many responsibilities. 

The function's responsibilities included

Authenticating a login (username and password) by returning a boolean value to indicate if the login was valid Alerting the user wh…

Had a Great Time at Austin Code Camp 2011

Every year there is one event that I look forward to attending and that is Austin Code Camp. This year I had a great time once again at this event.  I've learned that one of the greatest benefits of attending the event is being introduced to some many valuable gems of information. Usually the classes are great and just deep enough to spark my curiosity. I think the one hour duration for those talks is perfect for a few reasons:

The talk covers enough ground to allow me to decide if I want to delve deeper into the topic on my own.  I usually do (eventually).The talk introduces me to tools, concepts, events or resources I've never heard of before (and that's exactly the reason I love attending these events).  It gives me a chance to attend more classes throughout the day than if they were two hours or longer. Here is a list of the things that I learned about that made the day worthwhile


Orchard is an open source(Web) Content Management System (CMS) framework by Micr…

App Harbor and Microsoft Web Matrix

I recently committed a project to AppHarbor that was not an MVC Solution but instead was a web matrix project.  Notice the commit log below that was created by AppHarbor.  There is a line that says "No Solution file found, cannot build. Using repository as-is".  That means that AppHarbor will host websites as is.   The only thing that I did different was add a web config file with the following contents:

***************Web.config file****************** <configuration > <system.web > <compilation debug="false" targetframework="4.0" > </compilation > </system.web > <system.webserver > <modules runallmanagedmodulesforallrequests="true"> </system.webserver> </configuration>

Harbor Commit Log*********************
Build 7af6182

Back to hairbankofcorona…

Creating a Central Git Repository

In my previous post I discussed the steps necessary to create a Git repository.   As it turns out, today I found the other piece of information that I was missing. That is, that when you create a central repository it must be bare.

If you really want to share code (collaborate with others) in a repository, your "master" or central repository should be an empty one.  That means that the only thing that it should contain is the repository but no source files (or any other files under version control). 

If you will recall, I ran into some hair-pulling problems because I couldn't push to the master repository. That was because the master branch had a working directory that had the master branch checked out.  As a result, Git refused to push changes made in the slave to the master.  By creating a bare repository you are insuring that this repository will not be worked on directly (i.e. it does not have a working directory).  Therefore by creating a bare repository you will n…

How to Create a Repository wih Git and Start Using It

About three weeks ago or so I decided to get started with Git.  After all, it seems that everyone else is using it and I felt that at the very least I should investigate it and play around with it a little.  I didn't know what the best approach was to for my research.  Little did I know that it was going to be a difficult journey, especially since I am doing all of this research on my own time instead of during work hours.  Also because Git is so robust and has so many different ways of doing the most basic things.

At first I took advantage of my Safari Books Online account to read Scott Chacon's Pro Git.  I found it to be a difficult read as a beginner.  It became easier to digest once I'd gone a couple of rounds with Git.  I also found out that the book is available for free online at the Pro Git Website.  Recently I also received some hints to other resources such as the CoDe Magazine article, Git for SubVersion Users, by Derick Bailey and also to the Alamo Coders Video