tag:blogger.com,1999:blog-3904649774860592172024-03-18T22:07:07.868-07:00Karmen Blake | The Intersection of Art and TechnologyUnknownnoreply@blogger.comBlogger60125tag:blogger.com,1999:blog-390464977486059217.post-43391722326870407142020-10-26T09:29:00.001-07:002020-10-26T09:29:26.260-07:00PHP and Laravel Development: A 17-part video series<p> Enjoy!</p><p><br /></p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLLbtlywIjqwxa4j4t42oWVxzyQ9HSEZ35" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-390464977486059217.post-75398613385942072732019-01-26T08:44:00.003-08:002019-01-26T08:50:15.505-08:00Introduction to Rails: An eleven-part series<h2>
<a href="https://www.youtube.com/playlist?list=PLLbtlywIjqwyXQsu9s0J6s1RNy9-R6tDE" target="_blank"><b>View FULL YouTube playlist</b></a></h2>
<div>
<br /></div>
<div>
First of 11 videos:</div>
<div>
<br /></div>
<iframe allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/m48sc3fnVRQ" width="560"></iframe><br />
<br />
Enjoy!Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-390464977486059217.post-71788148369988687352017-12-29T11:41:00.000-08:002017-12-29T11:47:43.518-08:00Elixir: Pattern Matching - A Taste of Functional Programming<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>
<b><code>=</code> is a match operator</b><br />
After an initial assignment it then becomes a match assertion.<br />
<pre class="prettyprint"><code class="language-rb">num = 1</code></pre>
<br />
To check the match assertion you can try this and it will be valid<br />
<pre class="prettyprint"><code class="language-rb">1 = num</code></pre>
<br />
Furthermore, these are also valid:<br />
<pre class="prettyprint"><code class="language-rb">[1] = [1]
[num] = [num]</code></pre>
<b><br /></b>
<b>Destructuring</b><br />
<pre class="prettyprint"><code class="language-rb">[score1, score2, score3] = [89, 93, 87]
IO.puts score1 # 89
IO.puts score2 # 93
IO.puts score3 # 87</code></pre>
<div>
<div>
<br /></div>
<pre class="prettyprint"><code class="language-rb">{:ok, value} = {:ok, 1000}
IO.puts value # 1000
{:error, message} = {:error, "Uh oh"}
IO.puts message # "Uh oh"
</code></pre>
<br />
Error when matching:
<br />
<pre class="prettyprint"><code class="language-rb">{:foo, value} = {:bar, "nope"}
** (MatchError) no match of right hand side value: {:bar, "nope"}</code></pre>
</div>
<br />
<b>Matching function arguments</b><br />
Various function definitions and subsequent calls:
<br />
<pre class="prettyprint"><code class="language-rb">def sum_two_nums(num1, num2) do
num1 + num2
end
sum_two_nums(2,5)
def sum_two_nums(%{num1: num1, num2: num2}) do
num1 + num2
end
sum_two_nums(%{num1: 2, num2: 5})
def sum_two_nums([num1, num2]) do
num1 + num2
end
sum_two_nums([2,5])
</code></pre>
<br />
There's so much more you can do with pattern matching. It is one of the most powerful features you will learn and use when programming in Elixir.
<br />
<br />
<hr />
Other posts in this series:
<br />
<ul>
<li><a href="http://blog.dudeblake.com/2017/12/a-taste-of-functional-programming.html">A Taste of Functional Programming</a></li>
<li><a href="http://blog.dudeblake.com/2017/12/elixir-anonymous-functions-taste-of.html">Anonymous functions</a></li>
<li><b>Pattern matching</b></li>
<li>Multi-bodied functions</li>
<li>Higher order functions</li>
<li>Side effects and state</li>
<li>Composition</li>
<li>Enumerables</li>
<li>Partial function applications</li>
<li>Recursion</li>
<li>Concurrency</li>
<li>Transitioning from OOP to functional</li>
</ul>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-390464977486059217.post-56182690329794790102017-12-08T18:43:00.001-08:002017-12-29T11:45:10.437-08:00Elixir: Anonymous Functions - A Taste of Functional Programming<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>
An anonymous function is composed of an optional parameter list, a body enclosed by <b>fn -></b> and <b>end</b>. It returns a function definition and the potential for the function to be executed. Quite simply the anonymous function can be assigned to a variable which then can be subsequently called.<br />
<br />
Define an anonymous function:,<br />
<pre class="prettyprint"><code class="language-rb">greet = fn ->
IO.puts "Hello World"
end
</code></pre>
Of course that does nothing unless we call it! We can do that by using this dot notation - <br />
<pre><i>[function name].([optional parameters])</i></pre>
Like this:
<br />
<pre class="prettyprint"><code class="language-rb">greet.()</code></pre>
Where the output is:
<code>Hello World</code><br />
<br />
<h3>
Anonymous functions with parameters</h3>
<pre class="prettyprint"><code class="language-rb">add = fn(num1, num2) ->
num1 + num2
end
IO.puts add.(10, 15)
IO.puts add.(12, 15)
IO.puts add.(14, 19)
subtract = fn num1, num2 -> num1 - num2 end
IO.puts subtract.(15, 10)
</code></pre>
Output:<br />
<pre><code>25
27
33
5</code></pre>
<br />
I hope these examples ignite an interest for you to further learn functional programming using Elixir. Cheers!
<br />
<br />
<hr />
Other posts in this series:
<br />
<ul>
<li><a href="http://blog.dudeblake.com/2017/12/a-taste-of-functional-programming.html">A Taste of Functional Programming</a></li>
<li><b>Anonymous functions</b></li>
<li><a href="http://blog.dudeblake.com/2017/12/elixir-pattern-matching-taste-of.html">Pattern matching</a></li>
<li>Multi-bodied functions</li>
<li>Higher order functions</li>
<li>Side effects and state</li>
<li>Composition</li>
<li>Enumerables</li>
<li>Partial function applications</li>
<li>Recursion</li>
<li>Concurrency</li>
<li>Transitioning from OOP to functional</li>
</ul>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-390464977486059217.post-245079047081516682017-12-05T19:48:00.000-08:002017-12-29T11:46:21.345-08:00A Taste of Functional Programming<h3>
Objectives</h3>
<ul>
<li>Ignite an interest in those who have never explored functional programming before</li>
<li>Exposure to functional concepts</li>
<li>Use functional parts of your existing language of choice you've never used before </li>
<li>Lead you to pursue a functional language more in-depth</li>
</ul>
<div>
<br /></div>
<div>
<h3>
Paradigm Evolution</h3>
</div>
<div>
<ul>
<li>Mathematics</li>
<li>Computer Science</li>
<li>Spawn of languages</li>
<ul>
<li>functional</li>
<li>procedural</li>
<li>imperative</li>
<li>declarative</li>
<li>object-oriented programming</li>
</ul>
</ul>
<div>
<br /></div>
</div>
<div>
<h3>
OOP Limitations</h3>
</div>
<blockquote class="tr_bq">
"<i>We’re going to be living in a multicore, distributed, concurrent — all the buzz words — world. The conventional models we’ve been doing, the OO stuff… is not going to survive in that kind of environment.</i>" - Dave Thomas</blockquote>
<blockquote class="tr_bq">
"<i>OOP promised a cure for the scourge of software complexity. …its weaknesses have become increasingly apparent. Spreading state all over the place leads to concurrency issues and unpredictable side effects.</i>" - Dave Thomas</blockquote>
<br />
<h3>
Thinking in Functions</h3>
<ul>
<li><b>Functions</b></li>
<ul>
<li>Easy to reason about</li>
<li>Reliable</li>
<li>Pure</li>
<ul>
<li>Don't modify variables outside of scope</li>
<li>No side effects</li>
<li>Deterministic (reproducible results)</li>
</ul>
</ul>
<li><b>Data transformation</b></li>
<ul>
<li>ie. Unix pipes - <code>cat foo.log | grep bar | wc -l</code></li>
</ul>
<li><b>No side-effects</b></li>
<ul>
<li>Side effects are:</li>
<ul>
<li>modifying state</li>
<li>has observable interaction with external functions</li>
</ul>
</ul>
<li><b>Immutability</b></li>
<ul>
<li>Immutable data is known data</li>
<li>Data that is created is not changed</li>
<li>Copy and alter</li>
<ul>
<li>compilers can perform optimizations because of this</li>
<li>garbage collectors are smart about this</li>
</ul>
</ul>
<li><b>Higher-order Functions</b></li>
<ul>
<li>Functions can receive functions as arguments and return functions</li>
</ul>
<li><b>Where is my for loop?</b></li>
<ul>
<li>recursion</li>
<li>map, reduce, filter, reject, take, etc.</li>
</ul>
</ul>
<h3>
</h3>
<h3>
Some (impure and pure) functional languages</h3>
<ul><ul>
</ul>
<ul>
</ul>
</ul>
<div>
<ul>
<li>LISP</li>
<li>Scheme</li>
<li>Clojure</li>
<li>Erlang</li>
<li>Scala</li>
<li>Ocaml</li>
<li>Haskell</li>
<li>F#</li>
<li>Elm</li>
<li>Elixir</li>
</ul>
<h3>
</h3>
<h3>
</h3>
<h3>
</h3>
<h3>
</h3>
<h3>
</h3>
<h3>
Elixir</h3>
</div>
<div>
<blockquote class="tr_bq">
"<i>Elixir is a dynamic, functional language designed for building scalable and<br />maintainable applications. Elixir leverages the Erlang VM, known for running low-latency, distributed and fault-tolerant systems, while also being successfully used in web development and the embedded software domain.</i>" - <a href="http://elixir-lang.org/">http://elixir-lang.org</a></blockquote>
<br />
Here is an out line of topics to come:<br />
<br />
<ul>
<li><a href="http://blog.dudeblake.com/2017/12/elixir-anonymous-functions-taste-of.html">Anonymous functions</a></li>
<li><a href="http://blog.dudeblake.com/2017/12/elixir-pattern-matching-taste-of.html">Pattern matching</a></li>
<li>Multi-bodied functions</li>
<li>Higher order functions</li>
<li>Side effects and state</li>
<li>Composition</li>
<li>Enumerables</li>
<li>Partial function applications</li>
<li>Recursion</li>
<li>Concurrency</li>
<li>Transitioning from OOP to functional</li>
</ul>
<div>
<br /></div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-390464977486059217.post-31022207610678992722016-03-16T15:07:00.002-07:002016-03-16T15:08:08.268-07:00Learn Elixir: Building a Neural Network from Scratch (Video)Video of my <a href="http://www.elixirdaze.com/" target="_blank">ElixirDaze</a> Talk<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/YE0h9DURSOo" width="560"></iframe>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-390464977486059217.post-86011527055297747062016-03-07T14:12:00.005-08:002016-03-16T15:07:55.139-07:00Learn Elixir: Building a Neural Network from Scratch<br />
Given at <a href="http://www.elixirdaze.com/" target="_blank">ElixirDaze</a>. March 4th, 2016.<br />
<div>
<br /></div>
<div>
<script async="" class="speakerdeck-embed" data-id="f3ad46817dfd45c9acff5fe773fcb3de" data-ratio="1.77777777777778" src="//speakerdeck.com/assets/embed.js"></script></div>
Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-390464977486059217.post-64649724740172264472016-01-19T09:09:00.000-08:002016-02-02T12:53:34.797-08:00The Actor Model: The Object AwakensUserTesting Conference January 2016<br />
<div>
<br /></div>
<div>
<a href="https://speakerdeck.com/kblake/the-actor-model-the-object-awakens">https://speakerdeck.com/kblake/the-actor-model-the-object-awakens</a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<script async="" class="speakerdeck-embed" data-id="f4db2593f6f340bfab2e9988ae65f373" data-ratio="1.77777777777778" src="//speakerdeck.com/assets/embed.js"></script><br />
<div>
<br /></div>
<div>
<br /></div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-390464977486059217.post-3051467753455142562014-08-06T10:36:00.001-07:002015-12-07T16:04:13.220-08:00AngularJS 101: A Beginner's Tutorial<br />
Below is the PDF article I submitted to <a href="http://sdjournal.org/" target="_blank">Software Developer's Journal</a> for their series they did on AngularJS. It was published in two of their issues: Nov. 15th 2013 - <a href="http://sdjournal.org/download/2012-pentest-auditing-standard-issues/" target="_blank">AngularJS, Java and Drupal Tips & Tricks</a> and Nov. 7th 2013 - <a href="http://sdjournal.org/download/angularjs-101-a-beginners-tutorial/" target="_blank">AngularJS Starter Kit</a>. It's behind a paywall and thus hidden from most of the world. That sucks... which is why I'm posting my article here for all to see.<br />
<br />
Enjoy!<br />
<br />
<b><span style="font-size: large;"><a href="https://www.dropbox.com/s/55zgy4riw3fklrd/BeginningAngularJS-SDJ-KarmenBlake.pdf" target="_blank">AngularJS 101: A Beginner's Tutorial</a></span></b><br />
<b><br /></b>
<a href="https://github.com/kblake/team-roster-app" target="_blank">Github code for application built in the tutorial</a>Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-390464977486059217.post-79449052382770481932011-03-08T21:38:00.000-08:002012-05-04T14:21:17.960-07:00Screencasts on Engine Yard<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.engineyard.com/videos" target="_blank"><img border="0" height="307" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieMLb3e-KtArYVuF3jISOc-nnr7mzsqb7_1N0XuUqpOV1FrHikhs9TWmEk2TATF4kd9YNQJ_O0vwnUPS4qZ7jVlLtw31UR0WzcKtTycx-marZb8P0xHqdNLWKrgIxLnHunctA7RocKDgHS/s640/eyscreencasts.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Engine Yard asked if my screencasts could be added to their listing. I said 'yes'!</div>
<div class="separator" style="clear: both; text-align: left;">
It's great to know that the screencasts I made several years ago can still help others learning Ruby today!</div>Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-390464977486059217.post-9714015172074178602011-02-15T23:15:00.000-08:002011-02-15T23:17:21.409-08:00Sinatra: A Whirlwind Tour!Presented at The <a href="http://www.meetup.com/EBRuby/events/15911270/">East Bay Ruby Group</a> on February 15th, 2011<br />
<br />
<br />
<iframe frameborder="0" height="451" src="https://docs.google.com/present/embed?id=ddhknw46_97f5wkr2sz&interval=10&size=m" width="555"></iframe>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-390464977486059217.post-52112346579062805632010-12-11T22:13:00.000-08:002014-12-26T17:49:20.026-08:00Introduction to Erlang<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
This is my second talk related to Erlang. Both have been introductory and well received. I hope you enjoy my slide presentation. I also did a chat demo using real-time updates using Comet.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://intro-to-erlang-presentation.herokuapp.com/" style="margin-left: 1em; margin-right: 1em;" target="_blank"><img alt=" View Presentation" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhEQZDYMCzNwDmWriltXBfCuH3rnVnSTlwdRNUlmfz_GWT45fzy-bVKt5iG-j579jNfc1fxIlUZZ8xw_qO5zSXCJF9Yt47D0TB9_ymdLrBtyaib28rfCW7NJ5M3u9vgM4ruWGQltmkDkRh/s320/Introduction+to+Erlang.jpg" height="320" width="316" /></a></div>
Presented at <a href="http://www.meetup.com/Silicon-Valley-Web-Builder/">Silicon Valley Web Builders</a> meetup<br />
<br />
<a href="https://intro-to-erlang-presentation.herokuapp.com/" target="_blank">Introduction to Erlang Presentation</a><br />
<a href="https://github.com/kblake/erlang-chat-demo" target="_blank">Chat Demo code</a><br />
<br />
Erlang web framework used: <a href="http://nitrogenproject.com/">Nitrogen</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-390464977486059217.post-10091341354485935722010-09-30T21:50:00.000-07:002015-01-05T09:52:42.943-08:00Beginning Erlang for Ruby Developers<div style="text-align: center;">
<br /></div>
If you missed my "Beginning Erlang for Ruby Developers" here is a link to the presentation.<br />
<br />
<a href="https://beg-erlang-for-ruby-devs.herokuapp.com/" target="_blank">https://beg-erlang-for-ruby-devs.herokuapp.com/</a><br />
<div>
<a href="http://beg-erlang-for-ruby-devs.heroku.com/"></a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<img alt="" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGe4FU5NRlB6bq9W0ngGc47G0ta2l1EQoBWTnUgkZu6RM3RGY2x2HbOZu9yeDIj8PTjrCpwrzK6QoHw5BLSUtQowri3yw6rbxcRXja0pfRA_VjunQH7NE3_ZTeMOWJKSAJoFEs8k1_nv5g/s400/preso-erlang.jpg" id="BLOGGER_PHOTO_ID_5522936028171420146" style="display: block; height: 380px; margin: 0px auto 10px; text-align: center; width: 400px;" /></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-390464977486059217.post-40593108174292792742010-09-22T21:00:00.000-07:002012-05-04T14:21:38.586-07:00RubyLearning Guest blog post is up!I wrote a guest blog post for <a href="http://www.rubylearning.com/">RubyLearning</a> and they posted it on their blog. Please go check it out: <a href="http://rubylearning.com/blog/2010/09/23/incorporating-web-apis-to-spark-computer-programming-exercises/" target="_blank">http://rubylearning.com/blog/2010/09/23/incorporating-web-apis-to-spark-computer-programming-exercises/</a><br />
The blog post is intended for Ruby newbies. I hope people find it valuable as they learn a great programming language.<br />
<div>
<br />
<div>
<div style="text-align: center;">
<a href="http://rubylearning.com/blog/2010/09/23/incorporating-web-apis-to-spark-computer-programming-exercises/" target="_blank"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5522932692046341842" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1dSVw7z-8ijM8Ql0IPQpImhL9KWBnU-uR_pS-aXoj58LleRBHb_7h1qlOvCJ_K8U8EFKNJkOY_iVRq-nCMhTlcaeNVvfq8GMBcT7MjPaA8-71DNX7BKTL0qKyFQLNOYPrOgjjY_QUba8r/s320/rubylearning-blog.jpg" style="cursor: hand; cursor: pointer; height: 320px; width: 299px;" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
</div>
</div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-390464977486059217.post-79597532846746643152010-05-03T20:49:00.000-07:002012-05-04T14:21:54.812-07:00Setting up Sinatra and DataMapper on Windows<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2aMQqOtFUoR0ecPebOSb2nVncIKuHOOI8-O7KI2uf0kxI3kgsmYOPZ9hSFuoNS3ce95hdhYrAE36hX8XINesK4ptAlRJARBPa45wLkIm-LHsFQz_HQg2Id_5ZSSNk7Ka7wkZon9f_DwdZ/s1600/windows-sinatra.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="151" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2aMQqOtFUoR0ecPebOSb2nVncIKuHOOI8-O7KI2uf0kxI3kgsmYOPZ9hSFuoNS3ce95hdhYrAE36hX8XINesK4ptAlRJARBPa45wLkIm-LHsFQz_HQg2Id_5ZSSNk7Ka7wkZon9f_DwdZ/s320/windows-sinatra.gif" width="320" /></a></div>
<br />
I use a MacBook Pro for work and pleasure on a day-to-day basis. Recently, I was asked to teach web students at a local high school. These students know html/graphics/flash/etc. The advanced students were ready for some server-side programming and database integration. I wanted the students to be able to get up and going quickly (for motivation reasons) and to create useful apps (using a database). I felt <a href="http://www.sinatrarb.com/">Sinatra</a> to be a great fit for this. I created a Sinatra app for my uncle and his business. It was a joy to work with it and I was able to deploy quickly using <a href="http://heroku.com/">Heroku</a>.<br />
My experience of using Sinatra on my Mac was straightforward. Like most things using Ruby and Mac: it just worked. However, I found out the students at the high school use MS Windows. Fortunately, I have a Windows XP virtual machine running in VMWare so I could prepare that way. I used to teach <a href="http://cis.scc.spokane.edu/?cissoftdev">computer science and web development</a> at Spokane Community College and am aware of teaching Ruby in a Windows lab environment. Things can get tricky at times - and preparing a Sinatra app on Windows XP was a little tricky.<br />
Here I am to quickly document what I can about setting up Sinatra on a Windows environment.<br />
<br />
<ol>
<li>Grab the installer and install Ruby: <a href="http://rubyinstaller.org/">http://rubyinstaller.org/</a></li>
<li>Install Sinatra from the Command Prompt: </li>
<ol>
<li><b><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #333333;">c:> gem install sinatra</span></span></b></li>
</ol>
<li>Install sqlite3</li>
<ol>
<li>Go to <a href="http://www.sqlite.org/download.html">http://www.sqlite.org/download.html</a> and download the <b>Precompiled Binaries for Windows</b>:</li>
<ol>
<li>sqlite-3.x.y.z.zip</li>
<li>sqlitedll-3.x.y.z.zip</li>
</ol>
<li>Unzip and look for these files. Copy them into the Ruby bin directory path <b>c:\ruby\bin</b></li>
<ol>
<li>sqlite3.exe</li>
<li>sqlite3.dll</li>
<li>sqlite3.def</li>
</ol>
<li>Install sqlite3-ruby gem</li>
<ol>
<li><b><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span"><span class="Apple-style-span" style="color: #333333;">c:> gem install sqlite3-ruby</span></span></span></b></li>
</ol>
</ol>
<li>Install <a href="http://datamapper.org/">DataMapper</a></li>
<ol>
<li><b><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span"><span class="Apple-style-span" style="color: #333333;">c:> gem install dm-core</span></span></span></b></li>
<li><b><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span"><span class="Apple-style-span" style="color: #333333;">c:> gem install do_sqlite3</span></span></span></b></li>
</ol>
<li>Code Reloading:</li>
<ol>
<li>Sinatra by default does not reload your code while you are editing and saving. Thus you have to restart sinatra server after changes = annoying!</li>
<li>On the Mac I quickly found <a href="http://github.com/rtomayko/shotgun">shotgun</a> for my code reloading needs. However shotgun does not work on Windows. :(</li>
<li>I then found out another gem that does code reloading on Windows: <a href="http://github.com/rkh/sinatra-reloader">sinatra-reloader</a> whew!</li>
<ol>
<li><b><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span"><span class="Apple-style-span" style="color: #333333;">c:> gem install sinatra-reloader</span></span></span></b></li>
</ol>
</ol>
<li>Sinatra starter code:</li>
<ol>
<li>Put the code snippet (see below) into a file and save as: <b>sinatra_starter.rb</b></li>
<li>From command prompt, start the sinatra server:</li>
<ol>
<li><b><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span"><span class="Apple-style-span" style="color: #333333;">c:> ruby sinatra_starter.rb</span></span></span></b></li>
</ol>
</ol>
</ol>
<div>
<script src="http://gist.github.com/388771.js?file=sinatra_starter.rb">
</script><br />
I hope this helps get some of you started with Sinatra development on Windows. Please refer to these resources to further your Sinatra knowledge:<br />
<br />
<ul>
<li><a href="http://ididitmyway.heroku.com/">http://ididitmyway.heroku.com/</a></li>
<li><a href="http://www.sinatrarb.com/documentation">http://www.sinatrarb.com/documentation</a></li>
</ul>
<div>
<br /></div>
</div>Unknownnoreply@blogger.com5tag:blogger.com,1999:blog-390464977486059217.post-82096791491728053822010-03-03T22:16:00.000-08:002010-03-03T22:19:17.647-08:00Get Started with Rails 3 and RVMPresentation I gave at the <a href="http://cdarb.org">Spokane Ruby User Group</a>. Wednesday March 3rd, 2010.<br /><br /><iframe src="http://docs.google.com/present/embed?id=ddhknw46_80hsrsc5fn&interval=10&loop=true&size=m" frameborder="0" width="555" height="451"></iframe>Unknownnoreply@blogger.com4tag:blogger.com,1999:blog-390464977486059217.post-25600266283008629412009-10-31T08:26:00.000-07:002010-03-23T09:19:17.177-07:00Attributes Sort on Github and GemcutterFor fun and to try out <a href="http://gemcutter.org">Gemcutter</a> I turned <a href="http://gemcutter.org/gems/attributes_sort">AttributesSort</a> into a gem and put it up on <a href="http://gemcutter.org/gems/attributes_sort">Gemcutter</a>. I used <a href="http://github.com/technicalpickles/jeweler/">Jeweler</a> to do all the hard work for me. it was super easy! You can view source code and specs on <a href="http://github.com/kblake/attributes_sort">Github</a>.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-390464977486059217.post-54348820307427208472009-10-25T18:23:00.000-07:002010-05-24T10:12:25.734-07:00Flexible Sort turns into Attributes SortI was looking at my old blog posts and saw this one (<a href="http://blog.dudeblake.com/2008/02/ruby-chops-flexible-sort.html">Flexible Sort</a>) from about a year and a half ago. I thought I'd tweak it a bit and see if I could make it more useful.<br />Below is what you see I've come up with. I've made the calling code off of array instead of a static method on the class type. I like it better. If anyone sees improvements they want to do with it then feel free to fork the gist on github. :) I'll probably throw some tests on this bad boy, <a href="http://github.com/technicalpickles/jeweler">gemify it</a>, and throw it up on <a href="http://gemcutter.org/">gemcutter</a> eventually.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-390464977486059217.post-65091331116745266512009-10-22T19:00:00.000-07:002009-10-22T19:26:31.193-07:00Boy Scout RuleSo I was happily coding the other day and ran across some code new to me. Mind you we used to have something like 8 developers on our team over the last couple of years and now we have 3. So naturally there are parts of the codebase I have not seen before. Anyway, the code looked like this:<br /><br /><script src="http://gist.github.com/216548.js"></script><br /><br />I saw the todos commented above each method and thought I could tidy these up a bit. It wouldn't take long. So here is what I ended up with:<br /><br /><script src="http://gist.github.com/216550.js"></script><br /><br />It took me five minutes and was a nice confidence booster to keep me going on my regular task at hand. So the lesson for the day is follow the <span style="font-weight:bold;">"boy scout rule"</span> which is nicely described here by Uncle Bob Martin: <a href="http://www.informit.com/articles/article.aspx?p=1235624&seqNum=6">http://www.informit.com/articles/article.aspx?p=1235624&seqNum=6</a>Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-390464977486059217.post-62996960537482620482009-10-19T17:02:00.001-07:002010-03-12T16:38:26.650-08:00Code Kata: Simple Content TagIn this video I test drive code to build a simple content tag class. This was presented at <a href="http://cdarb.org/">Spokane/CDA Ruby User Group</a> on Oct 7th, 2009. Enjoy!<br />Code for the video is on Github: <a href="http://github.com/kblake/Code-Kata-Exercise">http://github.com/kblake/Code-Kata-Exercise</a><br /><br />Tools used:<ul><li><a href="http://github.com/technicalpickles/jeweler">Jeweler</a></li><br /><li><a href="http://github.com/mislav/rspactor">Rspactor</a></li><br /><li><a href="http://code.google.com/p/macvim/">MacVim</a></li><br /><li><a href="http://wiki.github.com/dchelimsky/rspec">Rspec</a></li></ul><p><span class="Apple-style-span" style="font-size:medium;">Click on link below to view screen-cast in <b>High Definition</b>.</span></p><p><a href='http://vimeo.com/7155834'><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaLS3trZaqRQN4p-C89lhPSQAUQ5AXw0mVO23Fi2tdRovGCiobRMjWlj_lX-Fa37Jw8RZOc9vvQq8cDVnnCGdFYtwYypAjmkC5l9n95VFrI5V42e68scLgKwzXrL4wXiy5DCmRrKFBwAXX/s400/kata_image.jpg" style="cursor:pointer; cursor:hand;width: 400px; height: 205px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5447910721308350066" /></a></p><p><span class="Apple-style-span" style="font-size:x-large;"><b><a href="http://vimeo.com/7155834">Code Kata: Simple Content Tag</a></b></span><span class="Apple-style-span" style="font-size:x-large;"> from </span><a href="http://vimeo.com/user355200"><span class="Apple-style-span" style="font-size:x-large;">Karmen Blake</span></a><span class="Apple-style-span" style="font-size:x-large;"> on </span><a href="http://vimeo.com/"><span class="Apple-style-span" style="font-size:x-large;">Vimeo</span></a><span class="Apple-style-span" style="font-size:x-large;">.</span></p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-390464977486059217.post-64355300521512080822009-10-18T21:14:00.001-07:002009-10-18T21:14:40.663-07:00Ruby Chops: rubyisms 2 with metaprogramming examples<script src="http://gist.github.com/168924.js"></script>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-390464977486059217.post-82774680327018115552009-10-18T20:58:00.001-07:002009-11-17T14:23:43.809-08:00Ruby Chops: rubyismsI'd thought I'd test out Github Gists embed feature.<br /><br /><script src="http://gist.github.com/168922.js"></script>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-390464977486059217.post-25379214208338452542009-10-14T08:51:00.000-07:002009-10-14T09:32:47.786-07:00Tools of the Trade<b>Hardware</b><div><ul><li>Macbook Pro: 17", 2 intel @ 2.4 GHz, 4GB RAM</li><li>Secondary display: 26" Visio Computer Display</li><li>Wireless Logitech LX8 Mouse</li><li>Wireless Apple Keyboard</li><li>Philips Noise canceling headphones</li></ul></div><div><b>Software</b></div><div><ul><li>Mac OS X</li><li><a href="http://code.google.com/p/macvim/">MacVim</a> (<a href="http://blog.dudeblake.com/search/label/vim">My Vim Tips</a>)</li><li><a href="http://adium.im/">Adium</a> (IM)</li><li><a href="http://www.skype.com">Skype</a> (with desktop screen-sharing!!)</li><li>Work Chat: <a href="https://www.yammer.com">Yammer</a> and <a href="http://campfirenow.com/">Campfire</a></li><li><a href="http://www.atebits.com/">Tweetie</a> (Twitter)</li><li><a href="http://www.grumlapp.com/">Gruml</a> (RSS)</li><li><a href="http://mailplaneapp.com/">MailPlane</a> (Gmail)</li><li><a href="http://www.openoffice.org/">OpenOffice</a></li><li><a href="http://colloquy.info/">Colloquay</a> (IRC)</li><li><a href="http://www.apple.com/downloads/macosx/system_disk_utilities/caffeine.html">Caffeine</a> (Keep your computer awake)</li><li>Safari (surfing and some web development)</li><li><a href="http://www.mozilla.com/en-US/firefox/firefox.html">Firefox</a> (hardcore web development using <a href="http://getfirebug.com/">Firebug</a>)</li><li><a href="http://ccmenu.sourceforge.net/">CCMenu</a> (CruiseControl build status)</li><li><a href="http://growl.info/">Growl</a> (cool system notifications display)</li><li><a href="http://git-scm.com/">git</a> and <a href="http://gitx.frim.nl/">GitX</a></li><li><a href="http://store.shinywhitebox.com/home/home.html">iShowU</a> used to create my screencasts at <a href="http://rubychops.com">http://rubychops.com</a></li><li><a href="http://github.com/mislav/rspactor">Rspactor</a> (autorun specs while BDDing)</li><li><a href="http://skitch.com/">Skitch</a> (sweet screen capture)</li><li><a href="http://rubyonrails.org/">Ruby on Rails</a></li></ul></div><div><b>Hosting</b></div><div><ul><li><a href="http://www.engineyard.com/">EngineYard</a></li><li><a href="http://heroku.com/">Heroku</a></li></ul></div>Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-390464977486059217.post-41577905584309522442009-09-04T10:04:00.000-07:002012-05-04T14:22:15.438-07:00Improving Traditional Software Development Education<div style="font: 11.0px Lucida Grande; margin: 0.0px 0.0px 0.0px 0.0px;">
<span class="Apple-style-span" style="font-size: small;">I read Corey Haines post about his idea for </span><a href="http://programmingtour.blogspot.com/2009/09/software-development-school-idea.html"><span class="Apple-style-span" style="font-size: small;">software development school</span></a><span class="Apple-style-span" style="font-size: small;">. I thought I'd jot down some of my experiences while I taught software development.</span></div>
<div style="font: 11.0px Lucida Grande; margin: 0.0px 0.0px 0.0px 0.0px;">
<br /></div>
<div style="font: 11.0px Lucida Grande; margin: 0.0px 0.0px 0.0px 0.0px;">
<span class="Apple-style-span" style="font-size: small;">I taught community college computer science and web development for 7 years. In the summers I worked as a contractor to gain 'real-world' experience. This allowed me to teach what I learned over the summers in the classroom. Towards the last couple of years of teaching I worked at nights while I was teaching because I enjoyed it so much. </span></div>
<div style="font: 11.0px Lucida Grande; margin: 0.0px 0.0px 0.0px 0.0px;">
<span class="Apple-style-span" style="font-size: small;"><br /></span></div>
<div style="font: 11.0px Lucida Grande; margin: 0.0px 0.0px 0.0px 0.0px;">
<span class="Apple-style-span" style="font-size: small;">To me I saw a lot of teachers take the easy road: picking canned curriculum that laid out non-practical material, have a work study student grade for them, etc. while they go home early. This was frustrating to watch and be around!! I picked industry books (PragProg, Addison-Wesley, etc.) and used them for reference while I created custom curriculum every quarter because of technology changes. I did not picked canned textbooks. They drove me nuts being out of date and out of touch with modern software engineering (most still push Waterfall, ugh). I kept a class blog where I would post my notes, source code from lecture, and screencasts. Even the public could have access to my curriculum (and they did). </span></div>
<div style="font: 11.0px Lucida Grande; margin: 0.0px 0.0px 0.0px 0.0px;">
<span class="Apple-style-span" style="font-size: small;"><br /></span></div>
<div style="font: 11.0px Lucida Grande; margin: 0.0px 0.0px 0.0px 0.0px;">
<span class="Apple-style-span" style="font-size: small;">I worked my tail off late into the afternoons and evenings every day to prepare the best and most up to date lecture I could give. I was also the lead instructor/advisor for the Software Development Program I taught in. We had an internship class setup at the end of the degree but it was not enough. Our intention was to get our students hooked up with a local business they could work with. A few of them worked out but most of them seemed to fall short of what I wanted out of it for my students. Many companies, where I'm from anyway, do not believe in agile practices or open source. I taught Java, PHP, Ruby, and Rails. It was tough to find a match between my students' skill set and the the technologies companies were using. A lot of companies stick to what works and typically are using technologies that are not as new as what my students were learning. A lot of times I had to resort to creating my own projects for students to actually apply what they've learned to a pseudo-real project. </span></div>
<div style="font: 11.0px Lucida Grande; margin: 0.0px 0.0px 0.0px 0.0px;">
<span class="Apple-style-span" style="font-size: small;"><br /></span></div>
<div style="font: 11.0px Lucida Grande; margin: 0.0px 0.0px 0.0px 0.0px;">
<span class="Apple-style-span" style="font-size: small;">For teachers in traditional environments it is hard not to get sucked into the status quo. I basically rebelled and did a few things to keep my degree top notch: </span></div>
<div style="font: 11.0px Lucida Grande; margin: 0.0px 0.0px 0.0px 0.0px;">
</div>
<ul>
<li><span class="Apple-style-span" style="font-size: small;">use industry books (not textbooks)</span></li>
<li><span class="Apple-style-span" style="font-size: small;">moonlight on the side and keep your skills fresh</span></li>
<li><span class="Apple-style-span" style="font-size: small;">create curriculum and make it public (blog, github, etc.)</span></li>
<li>keep updating curriculum, challenge administrators to let you do this. For example, I added an Agile class that allowed me to teach TDD, using version control, and Extreme Programming. That class was fun to teach! :)</li>
<li><span class="Apple-style-span" style="font-size: small;">create screencasts = students love to learn that way!!!</span></li>
<li><span class="Apple-style-span" style="font-size: small;">don't let administration use you to do administrative work (meetings, meetings, meetings...). say 'no' often and keep at making your curriculum awesome</span></li>
</ul>
<span class="Apple-style-span" style="font-size: small;">I've been out of teaching for almost 3 years now. I miss it at times especially investing into students lives and giving them a foundation to be continual learners and researchers. I am enjoying working full time doing Rails. Some things I do to continue to help new developers is by investing my time into <a href="http://www.railstutor.org/">Rails Tutor</a> and making my self available as a <a href="http://www.railsmentors.org/">Rails Mentor</a> which both I think stemmed from the great collaborative work being done at <a href="http://www.railsbridge.com/">Rails Bridge</a>. I hope some of this helps. I like the idea of apprenticeships or whatever avenue works to invest into future developers. </span><br />
<div style="font: 11.0px Lucida Grande; margin: 0.0px 0.0px 0.0px 0.0px;">
<span class="Apple-style-span" style="font-size: small;"><br /></span></div>
<div style="font: 11.0px Lucida Grande; margin: 0.0px 0.0px 0.0px 0.0px;">
<span class="Apple-style-span" style="font-size: small;">Cheers!</span></div>Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-390464977486059217.post-73172182435565371172009-05-05T19:51:00.001-07:002012-05-04T14:22:42.189-07:00Sample Rails App from Highline community college talk<a href="http://github.com/kblake/highlinecc_intro_to_rails/tree/master">Github repo where you can find rails app to download</a>Unknownnoreply@blogger.com0