Changing Gears, Changing Venues, Changing Jobs

Posted June 20th, 2009 in General by ryan

So I haven’t written in a while and it’s mostly due to a move 3,000 miles to take a new job in North Carolina.  The job is with a government contractor doing work very similar to a job I had worked in the past – although I’m not required to do it in a tent any more.

The job is a big change for me.  Leaving Ventyx, where I wrote mostly Windows client software using WPF, WCF and working with a large group of very experienced developers has now changed to a smaller, younger shop writing ASP.Net applications in a restrictive environment.  My new role has me working more on integrating coding standards, testing practices, security practices & pen testing, etc.  The new role should bring some new thoughts and subsequently new content here.

So as things settle down over here, the plan is to continue to spend some more time writing out some of my ideas here.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Spring Is Here In Sacramento

Posted March 13th, 2009 in General by ryan

Yesterday I decided to go to lunch.  Alone.  On Purpose.  It’s not that I’m anti-social.  I’m probably less anti-social than the majority of developers I have worked with.  I have been working in my cubicle during lunch trying to complete some tasks I’ve been assigned, but I’ve started feeling like I never leave my desk.  I had already worked through most of lunch when I had decided to go, so I was about an hour after the lunch rush.

So I took a break.  I walked to a deli hidden away in the middle of a few office buildings down the street.  The “Secret Deli” as we refer to it at work.  I ordered a roast beef and cheddar sandwich on a garlic roll with every vegetable on the menu and a Snapple raspberry tea.  I grabbed a Sacramento News & Review, a local newspaper-ish publication and took a seat outside.  The newspaper grabbed my attention with an article on the front page “Why Twitter Sucks”, but that’s a topic for another post.

I picked a seat outside underneath a tree, next to a water fountain that resembles a small waterfall.  The sun was bright enough to keep me warm and so I sat there eating and reading, oblivious to the world around me.  It was awesome for me to feel like I could focus on enjoying lunch.

After I finished eating, I sat underneath the tree watching the pear blossoms fall in the wind into the fountain.  The foliage around the fountain is a vibrant green, like #234F32.  It made me think about the time we spend in cubicles, surrounded by dim walls.  The weight we assume onto our shoulders when we step into this small square of solitary confinement is too great if we isolate ourselves from brain stimulation you may find in the environment around you.

I’m going to start forcing myself out of the cube more and focus on “thinking out of the box”, literally.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Microsoft Virtual PC 2007: FAIL!

Posted February 18th, 2009 in General, Microsoft by ryan

Yesterday I had a need to create a virtual image of Windows XP Pro to do some testing against a USB device.  I downloaded and installed Virtual PC 2007 and created a guest running XP Pro.  I plugged in the USB device and nothing happened.  After a quick web search I was able to confirm that Virtual PC has no USB support.

I then downloaded the trial of VMWare Workstation.  Installing XP Pro was a much easier, simple and faster experience than installing it in Virtual PC.  USB support is built in and very intuitive.

Does anyone know if Microsoft is still working to innovate with Virtual PC or have they conceeded to VMWare?  I know which one I’m using from now on….

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Learning About Django Templates

Posted January 21st, 2009 in Django, General by ryan

I was working on a template last night to handle a generic view. I started by going into the console (managey.py shell) to poke around at the model I wanted to use. From that session, I copied the following snippet to use in the template.

project.projectimage_set.all()[0].image.url

I added this to the template and it looked like this.

{% for project in object_list %}
<div class="project">
   <div class="project-image">
      <img src="{{ project.projectimage_set.all()[0].image.url }}" alt="" />
   </div>
   <div class="project-info">
      {{ project.name }}
      {{ project.link|urlize }}
      {{ project.description }}
   </div>
</div>
{% endfor %}

When running the template I received the error: “Could not parse the remainder: (0)”. I hadn’t seen this before and searched Google to get the answer. It didn’t look good on the first search. The answer was repeated in different results, originating from a Google group. The answer given (and I’m paraphrasing) was “Django templates don’t use Python code. You’re doing it wrong. Go write a template tag or custom method.” I read through the link a few times and couldn’t find the answer I wanted to hear. I figured this was common, and I thought a web framework for people with deadlines would not require me to write too much code to get to a property.

I went back to the documentation and looked around and still didn’t find anything that showed me how to access the properties further down on the related model so I went back to Google. This time I found an answer!

I’m not going to put on like I know what’s going on here. I can think about how somewhere underneath in the template language there’s an implementation of __getattr__, but I didn’t go and research it. It’s almost 0200 and sleep is calling. Because it was difficult for me to find, I thought I would just post this and maybe it would help the next guy stumble upon removing the () and [ ].

Here is the working code:

{% for project in object_list %}
<div class="project">
   <div class="project-image">
      <img src="{{ project.projectimage_set.all.0.image.url }}" alt="" />
   </div>
   <div class="project-info">
      {{ project.name }}
      {{ project.link|urlize }}
      {{ project.description }}
   </div>
</div>
{% endfor %}
[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Sample Project Ideas

Posted January 8th, 2009 in General by ryan

A few years ago I found a list on the internet of 10 things to do when learning a new programming language.   I thought it was interesting and shared it with my coworkers at the time.  A couple of weeks ago, one of my former coworkers contacted me and asked me for the list.  The site has since disappeared and I could not find the same information, but by coincidence I saw a link in an RSS feed recently for a similar idea.  The list is titled Martyr2′S Mega Project Ideas List! and it contains 150 different project ideas organized into 10 categories. 

A sample of the ideas includes:

  • Find PI to the Nth Digit
  • Fibonacci Sequence
  • Distance Between Two Cities
  • Dijkstra’s Algorithm
  • Pig Latin
  • Post it Notes Program
  • CD Key Generator
  • FTP Program 
  • Packet Sniffer
  • Small Web Server
  • Web Bot
  • Bank Account Manager
  • Vending Machine
  • Family Tree Creator 
  • Quiz Maker
  • Image Map Generator
  • Traffic Light Application
  • Hangman
  • Magic 8 Ball
  • BlackJack (and several other card games)
There are many more great ideas and maybe these will give you something to use next time you want to explore a new language.
[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Debugging IronPython In Visual Studio

Posted December 30th, 2008 in .Net, General, Microsoft, Python by ryan

I’ve been getting to know IronPython a little lately and one of the first things I wanted to know was how to debug IronPython in an IDE.  Since I use Visual Studio 2008 at work, I thought it would be a good start.  I searched Google and found a text representation of the steps involved over at Harry Pierson’s blog.

I found it pretty simple to do and somewhat useful for longer scripts.  It will be nice in the future to have first class support for IronPython in Visual Studio 2010.

You should have IronPython 2.0 Final and Visual Studio 2008 Professional or Better* installed to complete this demo.

Create a python file to debug:

1
2
3
4
5
6
7
8
#debug.py
class Foo:
def __init__(self, name=None):
    self.name = name
 
if __name__ == "__main__":
    f = Foo("LVS")
    print f.name

From Visual Studio, open the IronPython executable (ipy.exe). If it doesn’t do so for you, add the ipy.exe as an existing project.

From the Solution Explorer, right-click on Properties and set the Command Arguments property.  Use “-D” to tell ipy.exe to create debugging output, “-i” to start an interactive session at the end of debugging and add the full path to the script you made before.

Properties Dialog

Properties Dialog

Click Ok.

Open the script you created earlier in Visual Studio and place breakpoints as desired.

Adding a Breakpoint

Adding a Breakpoint

Run the script in debug mode (F5).

If you added the “-i” argument in step 3, after the last breakpoint is released it will launch an interactive session for you.  You will be able to inspect your script at this point, much like the immediate window in Visual Studio.

Interactive Console

Interactive Console

* I tried this in the Visual Studio 2008 Team Developer Edition and the Visual Studio Express Edition.  The Express Editions do not work as they don’t allow you to open the ipy.exe as a solution item. Sorry “hobbyists”, we’ll see if the Express sku’s of Visual Studio 2010 will target IronPython / IronRuby.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

CodeWeaver Cross Over Pro ~ Free Today Only

Posted October 28th, 2008 in Blogs I Read, General, Linux by ryan

I caught this scoop from Nolan’s blog this morning…

The company that makes the commercial version of WINE that allows you to install windows apps natively on mac or linux is giving their product away for free for 24 hours.  Here’s an article explaining it at length:

And here is the site to get the serial # and product.


[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Blogging From DjangoCon

Posted September 6th, 2008 in Django, General, Python by ryan

I’m here at the GooglePlex sitting a row away from the stage and enjoying the atmosphere.  It’s a great vibe here.  This does feel different than the Microsoft conferences I have been to.  Some observations so far is that the crowd seems a little younger for the most part and there is a comfortable atmosphere.  Of course there’s free food and drinks, free wifi, a great stage and screen for the presentations and the audio is flawless.  The only complaint I have thus far is the uncomfortable plastic daycare chairs.

Earlier I attended Guido’s App Engine keynote (blog post to follow later), and I’m now attending the High Performance Django talk.  I will try to make a post for each talk I attend.

Custom Ice Cream
Custom Ice Cream

Check back soon…

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

End Of July Update

Posted July 31st, 2008 in General by ryan

I’m going to DjangoCon 2008!

Am I still writing a blog – yes!  See, what had happened was…  I was moving right along until I saw these basic-apps.  I love reading source code so I grabbed the source and started reading through them.  I switched gears and decided to try implementing a few of them into working blog.  So far it’s still coming along nice and I’m learning a lot.  It’s very addicting to learn and make progress.

I also recently launched PaiWaterOasis.com, a water delivery business in Okinawa, Japan.  This site is built on Django and MySql and is deployed at SliceHost.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Building A New Blog

Posted May 22nd, 2008 in Django, General, Python, Web Design by ryan

Because I can. Because I should. Because cool developers do it. I’m really doing it because I agree with an article from Geoffrey Grossenbach of the Nuby On Rails and PeepCode (actually, the guy does tons of stuff – go check his site out) fame. In it he says,

“I’ll add to this and say that every beginning Rails developer should write their own blog software. It’s a great learning experience and you can try things that aren’t possible with just an app running on localhost. It’s also a great environment for learning without the pressure of a mission-critical app. When you’re working for a client and deploying an important application, you’ll have made all the beginner mistakes on your own time (hopefully).”

It’s somewhat of a personal pride thing, as I want readers that come to my site to know that I took the time to build my own blog engine. It was a great introduction to Django and provided me a means to applying the knowledge I have gained from the tutorial and other reading.

So far I’ve done three 45 minute sessions during lunch and I have the Articles, Categories, Links, and Announcements working.  I’ve been keeping track of the time and once I’m done I’ll provide the stats on time and effort along with the source.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
FireStats icon Powered by FireStats