Rory Craig-Barnes

Cooking. Baking. Whippets. Coding. Photography.

November 30, 2012
by rory
Comments Off

User Password Encryption with Oracle

All I wanted to do was SHA1 some passwords + salts in Oracle and then compare them when a user logs in. Is it really this difficult to do this comparison?

select USERNAME, USERPASSWORD, SALT
from USERS
where USERNAME = :U_NAME
and upper(PASS_HASH) in (select to_char(to_clob(dbms_crypto.hash(utl_raw.cast_to_raw(concat(:U_PASS, to_clob(SALT))), 3))) from dual)
and ACTIVE = 1

That works but how messed up is that?

For comparison in MySQL I believe it would be:

select USERNAME, USERPASSWORD, SALT
from USERS
where USERNAME = :U_NAME
and PASS_HASH =  sha1(concat(:U_PASS, SALT))
and ACTIVE = 1

Am I just going about this the hard way?

May 25, 2012
by rory
Comments Off

BlackBerry WebWorks Deploy Bash Scripts

Things you should know: I am inherently a lazy coder and forgetful to make things worse.

This means every time I needed to build and deploy an app for debug or submission I have to remember what the heck I needed to do again. On top of that I had to figure out what the last buildID I used was.

That often led to a lot of annoyance on my part. To solve this problem I used my very basic Bash scripting knowledge from my day job to automate building (debug, signing and signing with debug) and versioning.

I hadn’t thought these scripts would be of interest to anyone but me, but it seems as though they might be.

You can modify either of those to do Smartphone builds, I just haven’t updated mine yet with the automatic buildID when signing so I am not including it yet (might add that over the weekend.)

Once you have these scripts just run:

./build_pb.sh <appname> <buildtype>
or
./build_bb10.sh <appname> <buildtype>

<appname> is the directory name where the app src is store
<buildtype> can be debug, sign or sign_debug

What the script does:

  • deletes the current build src
  • deletes current zip file
  • deletes current bar file (make a copy of the versions you want)
  • copies your new src to the build directory
  • strips .DS_store files (you can add other files/folders if you want)
  • creates a zip file
  • compiles with the proper SDK  and flags
  • deploys it to your specified device.

The finer points:
To make these work you need to have a fairly specific directory setup so they script properly does things for you (although you could customize this for yourself)

Source location (in my case: /Users/rory/Sites/<appname>/pb)
The important part here is ‘<appname>/pb’ you can tell the script the first bit, but all your app source needs to be structured like this or the script will fail.

Build location (in my case: /Users/rory/Sites/builds/<appname>/pb
Again the important part is ‘<appname>/pb’ you can tell it where to look for this but it will always be built in the same place. This directory needs to exist before the script is run.

That is it.

If you have any questions or feedback on these (or if you make improvements to them) I would love to hear about it. I am still learning the ropes of Bash scripting and would love to improve my skills.

July 29, 2011
by rory
Comments Off

BBM Hackathon – the sequel

Apparently my last entry worked!!!! I am one of the 10 (maybe 20) winners in the contest. I will be jetting off to NYC for 3 days in the middle of August for an intensive couple days of application development and instruction.

Now I must get all my ducks in a row, better map out the flow & feel of the BBM features I can add to my app. I have been doing more reading about the actual capability of BBM6 within an app, it has a lot of potential and really will fill out the more social aspects of my app that I was going to leave until v2. The more I read the more excited I get and the more possibilities that come to mind.

Let the plotting begin…

July 22, 2011
by rory
Comments Off

BBM Apps Hackathon (+why social matters)

This a shameless self-promotion post. Blackberry is running a contest to win a trip to their BBM Apps Hackathon, and this is me throwing my hat in the ring. For the curious, this is the event. That being said, it will also be insightful about me as a developer in some ways.

Where does this story begin?

I have been getting more and more interested in developing apps for Blackberry. I already have one app that does kitchen unit conversion in Blackberry App World (Kitchen Converter). It gets decent reviews, but needs polishing in my eyes. My few reviews don’t mention the things I see that need polishing, and I think that surprises me most.

I think the most important learning I took from that app was that developing a solid base product is the smartest thing you can do. Put something out there that you are proud of, something that works. While developing an app, keep a list of all the features you think it should have and add those in after you get the base released. Nothing is worse than downloading an app (or worse paying for an app) that has all the features you want, but does none of them right. It is hard to recover from bad reviews.

How does social work into all of this? My one app doesn’t even have social, my professional work doesn’t involve social. But that is ok, some apps are perfectly fine without a social aspect to them. But these days, with so many people having smart phones, tablets, and other kinds of mobile devices, adding social to some apps takes them to the next level. No longer do you have to remember the name of the wine you are drinking, or where you put that guys business card. There are apps to do this for you. Those same apps then allow you share things with your friends. Had a great wine last night that you want your friend to try out? Send it to them with your app. Imagine sharing wine notes with your friends, all over the world for remote tastings. So much fun, wish there was an app for that. (Maybe there is?)

Another great use of social apps is networking. How trying can networking be? You know it is. At FITC Toronto 2011 they had a fist-bump type app so you could keep track of people you met. Two (or more) people went to the booth, bumped their tags and it sent them contact details of everyone you bumped with afterwards. (Check it out). While I didn’t participate in it, the idea was amazing! Such a great way to use social to improve a sometimes old school process.

There are so many other innovative ways that sharing/social can be used. I would give more examples, but the two left in my head are for apps I am currently or planning to develop. Nothing else seems to be able to push those ideas out for me to talk about.

But Rory, why should you of all people attend?

I could be glib and tell you that I should attend because I am a rockstar and all that. But here is the honest truth:

I have just started developing apps for BB. I probably don’t have the experience of some seasoned BB developers. And that is precisely why I should attend. Think about what I can get out of this experience. I have so much to learn, but also many years of transferable skills to learn with.

I have tried out Adobe Air development for the Playbook, even developed an app for it. That was a a bit of a learning curve. I wasn’t sure I would be able to keep developing apps if they all took that long. I had so many ideas but they were all out of my comfort zone, each feature required time to research the proper syntax to make it happen. And I made it happen, no matter how frustrating it might have been, I grew a little bit because of it.

Then I discovered the WebWorks platform, which was more my speed. After spending the last 18 years doing HTML, JS, CSS, XML and many other acronyms of development for the web, I felt right at home. I could conceptualize a feature and code it within minutes or hours depending on the complexity (rather than hours or days). WebWorks also makes my code portable. I can push it to many different BB devices. Once those are released, with minor changes it can be made into a web app and used on multiple platforms!! How awesome is that?

I would consider this a great learning experience, and it would allow me to learn as much as I can from the best of the best. I have so many ideas for apps, my only limit for pumping them out is time in the day. Having 2 days of expert help would definitely help me pump at least one of my apps out!

It also helps that I have one app on the go that I had already planned on adding a social aspect to, and I have an idea simmering in the back of my head that would be even better with BBM integration (actually until writing this post I hadn’t actually considered how BBM could fit into it, but now that I have it is being added to the feature list because it would be a kick-butt feature.)

Some other pluses in my corner:  am quick on my feet and I learn by doing. This sort of event is exactly what I need to take my BB development to the next level.

Given this is a BBM based hackathon this entry wouldn’t be complete without telling the world why I love BBM. There are so many reasons, but my top are:

1. It makes it super easy to share things with friends and family. It is built right in, no loading another app, no hoping the person has said app.

2. It allows me to know the status of things. I know right away when it is delivered/read. This is creepy sometimes, but when trying to plan a meet-up with my wife or pass along important information it is nice to have that confirmation.

3. I can write more than I would in a text message. Nothing like checking text message 2 of 2 before 1 of 2. Auto-send on signal in the proper order is also pretty cool!

4. I love that iOS basically stole the BBM idea and made their own, Imitation is the sincerest form of flattery.

5. Last, but certainly not least ,without BBM there would be no hackathon, and with no hackathon I would be stuck in the basement writing my code alone, relying only on myself to learn the right way to do things. I also wouldn’t get to spend a couple days in wonderful NYC!

There you have it my entry, almost feels like a job interview/cover letter.

To make things a little less stuffy, I will leave you with a quote from an over-quoted but long time personal favourite kids book:

“You won’t lag behind, because you’ll have the speed. You’ll pass the whole gang and you’ll soon take the lead. Wherever you fly, you’ll be best of the best. Wherever you go, you will top all the rest. Except when you don’t. Because, sometimes, you won’t”

Dr. Seuss – Oh, the Places You’ll Go!

No matter what happens with my entry, I put myself out there. Thanks for reading, and of course pick me, pick me! :)

February 19, 2009
by rory
Comments Off

Memory Lane

Started spending time cleaning up duplicate images and files. What a trip down memory lane. Found all kinds of pictures I forgot about!

August 20, 2008
by rory
Comments Off

The Queen of Hearts, Loved her Tarts!!

Hot out of the ovenSomething in the air got to me, it was a perfectly delightful crisp morning doing my Pranayama breathing exercises, and the day continued to be just as gorgeous. It didn’t get to hot, I was productive at work, what more could a boy ask for? A tart of course.

A couple weeks ago, and old high school friend posted pictures of a scrumptious looking tart he made. This got me thinking about all my tart fiascoes. I am decent at pastry related things. Even had a chef telling me I should think about going to school for pastry, back when I was still in the business. I have never had good luck with tarts, I fear the crust, which knows when you fear it.

I also have an obsession with lemon filling. I would eat it by the bowl full if I was allowed to. Again I have a fear of lemon filling, I seem to over/under cook it. I just can’t seem to get it right.

I decided that the best idea for this glorious day was to combine my two fears into one lovely

Nicely carmelized

dessert, to surprise Hayley when she got home. That sounds like a smart idea doesn’t it? In this case it actually was, the tart turned out good, not great, it needs a little tweaking and I did over cook it just a smidgen. BUT it tasted yummy, and the crust is very tasty. This recipe will live to see another round, I am thinking it will be at the family Christmas dinner I am currently planning for the family gathering in Winnipeg, MB this year.

On to the recipe. I grabbed this from Food & Drink, which has a good track record in my books for successful recipes.I actually didn’t change anything on this recipe the first time, because of the aforementioned fear.

Lemon Tart – From the Holiday 1999 Food & Drink magazine

To finish this one off, Hayley made a fresh blackberry sauce, it just added to the yumminess of this one!

What would I change?

  1. Use a little less lemon zest
  2. Add a tiny bit more sugar
  3. Watch the tart a little more closely when it is almost done to make sure I don’t over cook it.

Not many changes, and a successful tart. What cooking fear should I tackle next?

July 9, 2008
by rory
Comments Off

How the Cake Rolls!

Several weeks have passed since it was Hayley’s birthday. To continue with our tradition she dug through the baking recipe books and picked out the cake she wanted. The rule is: she picks the cake, I have to make it, doesn’t matter if I have made it before, or if i am even confident that I can make the cake, I have to make the cake of her choice.

mmmm sponge cake!

This is great for two reasons, one, she gets a fantastic homemade birthday cake, two, I push the limits on my baking skills.

Fluffy batter!

So what was this years choice? It comes from a lovely Williams and Sonoma Cake cookbook, that I wouldn’t normally have picked up, but it was $9 at Costco :) It was a Strawberry Roulade. Which is a fancy way of saying, sponge cake layered with whipped cream and strawberries, then rolled up and iced :)

That is neither here nor there, this years choice was much easier in the end than last years choice of Angel Food cake, which tasted good, but was a minor disaster because it fell, that is a whole different post.

Now that I am done rambling about past disasters, I can happily say the only glitch with this cake was that I didn’t roll it tight enough (apparently I haven’t been making Sushi enough at home these days.)

The Final product!

This cake was made extra special as this weekend was the first weekend on the year that fresh Ontario strawberries were available at a reasonable price. So this cake was packed full with delicious local strawberries.

On to the cake. There are two different sets of ingredients/directions, one for the cake, and one for the filling and icing. I recommend being uber prepared and having *all* the ingredients for both measured and read to go as the filling is prepared while the cake is cooling, and you need to fill and roll the cake completely cools.

Sponge Cake recipe (http://wegottaeat.com/discover/recipe/44797)
Strawberry Roulade Recipe (http://wegottaeat.com/discover/recipe/44801)

So, I will definitely try my luck with a roll style cake again, maybe I will make a nice chocolate log for the big family Christmas gathering this year :)

And some for you?

July 5, 2008
by rory
Comments Off

For anyone setting up a kitchen :)

ok, so this blog is not mine at all. I read Trents blog (the simple dollar) on a regular basis, I find it very interesting, well researched, and most of all I find a lot of his post very refreshing.

A couple days ago he wrote a piece that I found very interesting, it was about setting up a Minimalist kitchen. I found this interesting because I have never thought about how much in a kitchen is unnecessary toys, or at least not too seriously.

While I do like the idea of a minimal kitchen, I also enjoy having a variety of tools at my disposal (ie my ice cream maker :) ). But for those people who are intimidated by the kitchen, or those who are just moving out for the first time this is a great piece about what you really need to get going.

I promise I have lovely food to write about this week, even Hayley is bugging me to post about her birthday cake :)

R

June 9, 2008
by rory
Comments Off

Adventures in Ice Cream

So we are going through a ‘heat wave’ in Southern Ontario, in honour of this I am posting a nice cool you down recipe. There is nothing fancy about what I am planning on making, plain old vanilla ice cream. But I am trying one of the recipes I found for Philadelphia, or American Vanilla ice cream.

A lot of ice creams are delicious and rich, but they are a pain to make because it requires a custard, I hate making custard, takes too much time out of my day when all I want is some ice cream to sandwich between two delightful homemade chocolate chip cookies. In warm weather custards are also a pain because they require the stove on for an extended period, not what you want when you are already overheating.

What I found in the back of my ice cream book, which I some how missed over the last two years, was a recipe for Philadelphia no cook ice cream. The no-cook is a misnomer, as it does involve cooking, it requires that you heat the milk and the vanilla bean in order to infuse the flavour of the vanilla bean into the milk. But this requires minimal heat and time so I will let it slide.

Your can make this without an ice cream maker, it just requires you to stir the ice cream every now and then while it is freezing. It won’t be as smooth as a machine made ice cream, but if you like your counter space it is better than storing an ice cream maker.

The freezing device

Ingredients
(makes ~1L)

1 Vanilla Bean
375mL Milk
50g Caster sugar (I’ll be honest I use regular sugar :) )
125mL Sweetened condensed milk (chilled)
250mL Whipping cream (chilled)
pinch of Salt

Tools
Ice cream maker
Pot
Paring Knife
Wooden spoon

Directions

  1. Split the vanilla bean lengthwise and heat with the milk and sugar, stirring occasionally, to just below boiling point, allow to cool, then chill.
  2. Remove the bean and scrape out the seeds, adding them to the chilled milk. Cover and chill in the fridge
  3. Add the chilled condensed milk, cream and salt. Mix together, then still-freeze or start the ice cream machine and pour in the liquid.
  4. Leave to churn for 20 minutes or until the ice cream has the consistency of very soft whipped cream.
  5. Quickly scrape into plastic freezer boxes and cover with wax paper and lid
  6. Freeze until firm, ~1 hour.

There you have yummy vanilla ice cream. While this wasn’t my favourite vanilla ice cream, it was definitely good. I found this one to be a little sweet for my taste, but I blame that on the condensed milk. The next time I am going to try to modify this recipe and leave out some of the sugar. Or I might get really brave and replace the condensed milk with something else :)

The final Product