Ruby on Rails with bluehost shared server

I always like learning new things and I have had a project in mind for a while.  Rather than developing it using PHP, which I am very familiar with, I have decided to use it as an excuse to learn Ruby on Rails.  I use bluehost for my web hosting and to be honest I have had an overall good experience with them.  Although I don’t contact their support often they are usually very helpful.  While searching for instructions on how to get Ruby on Rails up and running and a shared server I found these instructions https://my.bluehost.com/cgi/help/rails  My belief was that because it is in bluehost’s help documentation that this would be the best way to get started.  I didn’t read the whole article before starting because it appears that it is a step by step process.  Well I was wrong so I thought I would document here for anyone else that runs into the same issue.  It is a very simple change that needs to happen but as of today it has not.  Basically you just need to go to the last section of the help article first.  So the order should be

Again this isn’t a big issue but since I didn’t read the full article first I missed the .bashrc setup which means that the environment wasn’t setup correctly.  Another important thing that you will want to do is reload the .bashrc after the changes.  You can do this in a couple of ways

  1. Close your SSH connection and log in again
  2. Run the command
    source ~/.bashrc
  3. Run the command
    . ~/.bashrc

This really isn’t that big a deal but the response from their support was frustrating.  First I was told that I was doing it wrong and that I needed to follow the exact same support article that I had already written them about.  So I responded letting them know for a second time that was what I was doing.  Then the second response, which pointed out the need to edit the .bashrc file to update the paths told me that this wasn’t a tutorial but just a “help file” to reference when using other tutorials.  So one person tells me to follow the “tutorial” and the second person says its not a tutorial.

 

In the end, I got it all setup and now it is time to learn something new.  Hopefully I will have some posts in the future about this project.


Review of Think Stats by Allen B. Downey published by O’Reilly Media

Think Stats Cover
So to be completely honest I picked up this book for review a couple of years ago. It has taken me a long time to getting it finished and get a review written up. Hopefully, you don’t interpret that as being a bad thing against the book. Actually the reason it took me so long because I really felt the need to sit down at a computer, go through the book and write out the examples. Generally I learn best by typing out the code rather than just downloading and running it. So that is why it took so long.

Now, as far as a review. This is an excellent book if you are a programmer that is looking to learn more about statistics. I have taken statistics classes, read statistics books, and tried online tutorials and there are some concepts that I have found to be difficult to understand. However, I have been programming for many years now and this was a nice easy transition into these statistical concepts using programming techniques. The author does a good job of highlighting some of the different techniques and providing helper classes for some of the functions.

Overall I enjoyed reading and completing the code in this book. I am not a statistics guru but I do feel a little more comfortable with the statistical concepts. And in the end, I have a reference I can go back to in the future.

You can find more information on this book over at O’Reilly’s catalog http://shop.oreilly.com/product/0636920020745.do


Flash Builder Performance Issues

I currently use FlashBuilder 4.6 Premium Standalone for Flex and AIR development. I find that many of the features built into the IDE are helpful and I find it to be very useful. However, the biggest problem I run into is that I constantly run out of memory. I have already adjust the memory and heap space according to many of the recommendations online. My main development computer is has 4 GB of RAM which in my opinion should be more than necessary. I rarely use Design View, especially since I found out it will not be available in future releases. The problem seems to be related to the size of the project. The project I work on is separated into multiple libraries and applications. Normally I work only in one application project but most of the projects have two or more libraries that they access. One option is to compile the libraries separately and use the SWC and I haven’t tried that route yet. I wanted to see if anyone had any suggestions on how to improve Flash Builder memory performance?


Daddy/Daughter Programming

My daughter, like many children, loves video games.  Moreover, she loves the idea of being able to create something on her own.  At the ripe old age of 7 she decided she is tired of not having access to something in her online games because her dad is to cheap to pay.  So she has very grandiose plans to create her own system that will be free to play.

I had previously played with Kodu Game Lab (http://fuse.microsoft.com/page/kodu) developed at Microsoft Fuse Labs.  She had a lot of fun with it but eventually got bored.  The biggest problem I had with it is that the tutorials went from simple to fairly complicated and she was having a hard time doing it on her own.  In addition, it covertly taught programming concepts and unless someone stopped to point them out you wouldn’t catch on.  Now maybe I didn’t give Kodu enough of a chance but after she lost interest I didn’t really continue playing with it.

Recently I received a recommendation for a different book to try.  Hello World! Computer Programming for Kids and Other Beginners  is a book designed for beginning programmers.  It starts off with the traditional Hello World! program and goes from there.  So far, my daughter is being a little impatient as she wants to start building her games but she finished the first chapter in one night.

The book uses Python 2.5 as the base for all of the code and the examples.  I think this is a great choice even though Python 2.5 is a little outdated.  My Python experience has been limited to data processing scripts so I am even excited to get to some of the GUI and Game examples in the book.  After the first chapter I can say that she definitely needs some help along the way but she can do most of it on her own.  I will make more posts as we get further into the book.


Mobile Scrolling Components

One of the issues you can run into with AIR Mobile Development is scrolling data.  If you use a Spark List (s:List) the component has built-in scrolling.  In fact, you can even have other components around the list that do not scroll and the list that does scroll.  However, a list is not optimal for editing data.  You need a form to do that.  A form, whether it is a Spark Form or a collection of s:HGroup components with labels, does not scroll.  However, if you embed the form components inside a Spark Scroller the  form will scroll without a problem.

I have put together a sample application that demonstrates a form that has no scrolling, scrolling, and a view with a scrollable list. Below is a screenshot of each of the three lists with some sample code.

This is an example of the form that is unable to scroll. Doesn't mean much until you see the next form which is the same but is scrolled part of the way down.

</p>
<p><s:VGroup width="100%" height="100%"<br />
paddingBottom="10" paddingLeft="10"<br />
paddingRight="10" paddingTop="10"><br />
<s:TextArea text="Below is a form but this is not in a scroller so it will not scroll."<br />
editable="false" borderVisible="false" width="100%"/><br />
<s:HGroup width="100%"><br />
<s:Label width="150" text="First Name"/><br />
<s:TextInput width="100%"/><br />
</s:HGroup><br />
<s:HGroup width="100%"><br />
<s:Label width="150" text="Last Name"/><br />
<s:TextInput width="100%"/><br />
</s:HGroup><br />
<s:HGroup width="100%"><br />
<s:Label width="150" text="Street Address"/><br />
<s:TextInput width="100%"/><br />
</s:HGroup><br />
<s:HGroup width="100%"><br />
<s:Label width="150" text="City"/><br />
<s:TextInput width="100%"/><br />
</s:HGroup><br />
......<br />
<s:HGroup width="100%"><br />
<s:Label width="150" text="Work Phone"/><br />
<s:TextInput width="100%"/><br />
</s:HGroup><br />
</s:VGroup></p>
<p>

This is the exact same form as the No Scroll option. However, as you can see it is partially scrolled through the form. This is because the form is embedded in the s:Scroller component.

</p>
<p><s:Scroller width="100%" height="100%"><br />
<s:VGroup width="100%" height="100%"<br />
paddingBottom="10" paddingLeft="10"<br />
paddingRight="10" paddingTop="10"><br />
<s:TextArea text="Below is a form that inside a s:Scroller component and should scroll without a problem."<br />
editable="false" borderVisible="false" width="100%"/><br />
<s:HGroup width="100%"><br />
<s:Label width="150" text="First Name"/><br />
<s:TextInput width="100%"/><br />
</s:HGroup><br />
<s:HGroup width="100%"><br />
<s:Label width="150" text="Last Name"/><br />
<s:TextInput width="100%"/><br />
</s:HGroup><br />
<s:HGroup width="100%"><br />
<s:Label width="150" text="Street Address"/><br />
<s:TextInput width="100%"/><br />
</s:HGroup><br />
<s:HGroup width="100%"><br />
<s:Label width="150" text="City"/><br />
<s:TextInput width="100%"/><br />
</s:HGroup><br />
....</p>
<p><s:HGroup width="100%"><br />
<s:Label width="150" text="Work Phone"/><br />
<s:TextInput width="100%"/><br />
</s:HGroup><br />
</s:VGroup><br />
</s:Scroller></p>
<p>

This is a simple form with a label and a s:List component. The List component has built in scrolling functionality.

</p>
<p><s:VGroup width="100%" height="100%"<br />
paddingBottom="10" paddingLeft="10"<br />
paddingRight="10" paddingTop="10"><br />
<s:TextArea text="Below is a list which are always able to scroll.  Unfortunately a list is not usable for editable forms."<br />
editable="false" borderVisible="false" width="100%"/><br />
<s:List width="100%" height="100%" dataProvider="{bindableData}" labelFunction="list_labelFunction"/><br />
</s:VGroup></p>
<p>

So that is a quick explanation of scrolling within a View for AIR Mobile.  This is all in response to a Cookbook Request.  The source code can be found here.


Pages:12345