-
Notifications
You must be signed in to change notification settings - Fork 0
/
atom.xml
1046 lines (786 loc) · 63.9 KB
/
atom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title><![CDATA[The Red Gem of Programming]]></title>
<link href="http://aavalam.github.com/atom.xml" rel="self"/>
<link href="http://aavalam.github.com/"/>
<updated>2013-05-03T16:43:13-05:00</updated>
<id>http://aavalam.github.com/</id>
<author>
<name><![CDATA[Victor and Ashbbb]]></name>
<email><![CDATA[[email protected]]]></email>
</author>
<generator uri="http://octopress.org/">Octopress</generator>
<entry>
<title type="html"><![CDATA[Gravity simulator : Fantastic Green Shoes App]]></title>
<link href="http://aavalam.github.com/blog/2013/05/03/gravity-simulator-fantastic-green-shoes-app/"/>
<updated>2013-05-03T14:18:00-05:00</updated>
<id>http://aavalam.github.com/blog/2013/05/03/gravity-simulator-fantastic-green-shoes-app</id>
<content type="html"><![CDATA[<p>I’d love to introduce a new fantastic Green Shoes app: <a href="http://ifni.co/articles/programming/gravity_simulator">Gravity
simulator</a></p>
<!--more-->
<p><img src="http://aavalam.github.com/images/2013/05/gravity_simulator.png"></p>
<p>Read the <b>2D : Green Shoes</b> section. I’m honored. :)
Watch <a href="http://ashbb.digi2.jp/Gravity_simulator.swf.html">a demo</a> I
executed <a href="http://ifni.co/src/gsim.rb">his code</a> on my Windows 7.</p>
<p>Let’s have fun with Shoes! :-D</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Getting in touch with Linux]]></title>
<link href="http://aavalam.github.com/blog/2013/04/02/getting-in-touch-with-linux/"/>
<updated>2013-04-02T13:38:00-05:00</updated>
<id>http://aavalam.github.com/blog/2013/04/02/getting-in-touch-with-linux</id>
<content type="html"><![CDATA[<p>I have helped a few people get started with Linux the last couple of
years and the tool that helped them get exposed to it, and finally
installing Linux on their system, is called UnetBootin. You can find
their official homepage in the References list below this blog post.</p>
<!-- More -->
<p>The nice thing about UnetBootin is that it runs on Windows, Mac, and
Linux. It gives you access to many different tools and operating
systems that you can then simply install to a USB drive. It isn’t
limited to operating systems, but also for recovery tools,
administration tools, and other “live” CD’s.</p>
<p>The current ‘favorite’ distribution of Linux for an install is probably
going to be Ubuntu, as it is highly documented, has a large user base,
there are plenty of resources that are easily found on the web. It is
available, of course, in the drop down list of UnetBootin as a ‘Live CD’
install, which means that you can install it to that USB thumbdrive that
you have, you can test drive it, and if you like what you see, you can
install it to your system. But you won’t be disappointed in it as a
first install.</p>
<h2>But I want to use the tools on my native system until I feel comfortable enough!</h2>
<p>To get some of the tools that are available on Linux to your current
system, you may want to install some software, such as LibreOffice which
seems to be taking the place of OpenOffice as an ‘Installed by Default’
office suite for some distributions of Linux. The OpenOffice suite is
also a good office suite of tools, though, and LibreOffice is a
derivative of this project.</p>
<h2>DSL - The small ‘Linux on a Stick’ distribution</h2>
<p>Now, DSL may not be exactly for the person wanting to get started or seeing
their very first Linux experiences, but it is good to have in your tool
box. It will get you running and connected to the network on perhaps an
older machine that you want to browse the internet on, or just play
around with. It can do some serious things, but this is an article
written for those that want to get familiar with Linux, so it has its
place.</p>
<p>This gives you a very small Linux distribution with some basic software that
lets you get familiar with the look and feel of a Linux environmnet. It
is meant to be loaded from USB stick, for a temporarily booted
environment, but with your standard useful tools, such as Internet
browsers, ‘Office’ software, etc. It doesn’t have installed by default
the common “Office Suite” software, but is a lightweight distribution.
And those installations are available, so you can install them.</p>
<h2>Congratulations on wanting to expand your Operating Sytem Experience</h2>
<p>There are many reasons to use Linux. Linux is a workhorse operating
system. It is free to install, free to use, has a very long history,
has great people working on it, and is no longer for the technically
elite. My children have used it from a very young age, and my mother
started using it last year.</p>
<p>There are professional grade tools, and games available on it, and the
available software will only grow. Much of the software available is
free in various meanings of the word, including no monetary charge for
use, even commercial use.</p>
<p>If you are just starting out using a Unix-like system, you could be up
and running today. Of course, like any complex system, there is a
learning curve, but you can start being productive with it quickly, and
the good thing is it will open you up to a whole new world of computing.</p>
<p>So congratulations on being open to Open Source Computing!</p>
<h3>References</h3>
<ul>
<li><a href="http://unetbootin.sourceforge.net/">UnetBootin</a></li>
<li><a href="http://www.damnsmalllinux.org/">DSL - Damn Small Linux</a></li>
<li><a href="https://www.libreoffice.org/">LibreOffice</a></li>
<li><a href="https://www.openoffice.org/">OpenOffice</a></li>
</ul>
<h3>The conversation starts here.</h3>
<p>But it continues on our <a href="https://plus.google.com/u/0/116568773932133159290/posts/2DsKysaa3ns">Google Plus post</a></p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Ruby Programming 41st Batch Registrations now open]]></title>
<link href="http://aavalam.github.com/blog/2013/03/14/ruby-programming-41st-batch-registrations-now-open/"/>
<updated>2013-03-14T00:25:00-05:00</updated>
<id>http://aavalam.github.com/blog/2013/03/14/ruby-programming-41st-batch-registrations-now-open</id>
<content type="html"><![CDATA[<p>Registrations are now open for RubyLearning’s popular <a href="http://rubylearning.com/blog/2013/03/14/ruby-programming-41st-batch-registrations-now-open/">Ruby Programming Course</a>. <!-- More -->This is an intensive (as you want it to be), online course for beginners that helps you
get started with Ruby programming.</p>
<p>The course starts on 5 April, 2013, and the first 15 students are getting a discount.</p>
<p>Check out the
<a href="http://rubylearning.com/blog/2013/03/14/ruby-programming-41st-batch-registrations-now-open/">announcement</a> and register today!</p>
<p>I’ll be there!</p>
<p>The discussion starts here, but continues on our <a href="https://plus.google.com/u/0/116568773932133159290/posts/19Sq6jHgVWH">Google Plus Post</a>!</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Ruby 2.0.0 Params Not Just for Methods]]></title>
<link href="http://aavalam.github.com/blog/2013/03/09/ruby-2-dot-0-0-params-not-just-for-methods/"/>
<updated>2013-03-09T03:46:00-06:00</updated>
<id>http://aavalam.github.com/blog/2013/03/09/ruby-2-dot-0-0-params-not-just-for-methods</id>
<content type="html"><![CDATA[<p>While working on documenting things I learned through a Learn Ruby By
Testing project, I came across documenting the new Ruby 2.0 ‘Params’
feature.</p>
<p>I realized that Methods are blocks and Procs and lambdas are very
close, so was wondering if the arguments would cross over.</p>
<p>It turns out that it does.</p>
<!-- more -->
<p>If you are not familiar with the new “named parameters” feature, it
works by taking a Hash argument, along with another new syntax that
starts with a two asterisks. Similar to the “optional argument” syntax,
it basically accepts all other non-named hash keys that you would give
your method. Or, Proc or lambda.</p>
<p>Let’s look at the signature:</p>
<figure class='code'><figcaption><span>ruby_two_oh_params.rb </span></figcaption>
<div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='rb'><span class='line'><span class="k">def</span> <span class="nf">some_method</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="nb">name</span><span class="p">:</span> <span class="s1">'Joe'</span><span class="p">,</span> <span class="ss">age</span><span class="p">:</span> <span class="mi">23</span><span class="p">,</span> <span class="o">**</span><span class="n">additional_params</span><span class="p">)</span>
</span></code></pre></td></tr></table></div></figure>
<p>This describes an argument list consisting of an 0 or more arguments for
<code>*args</code>, a named parameter called name, with the value of ‘Joe’ by
default, and a named parameter of age, with a default value of 23, and
at the end, the syntax that allows you to pass in arbitrary number of
hash keys, with values.</p>
<p>It is important to note that in order to have the **additional_params at
the end, after the normal Hash that you may be used it, you must use the
Ruby 1.9 syntax of <code>key: value</code>, rather than <code>:key => value</code>or it will
break.</p>
<p>Well, that is wonderful, as it means that we no longer need to do the
hash merge to bring in default ‘params’.</p>
<p>But you will have likely read about that elsewhere.</p>
<p>The thing that I was happy to discover was the “named params” are available
for Proc and lambda.</p>
<p>This means that we can now do something like this:</p>
<figure class='code'><figcaption><span>named_params_for_proc_and_lambda.rb </span></figcaption>
<div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
</pre></td><td class='code'><pre><code class='rb'><span class='line'><span class="n">my_proc</span> <span class="o">=</span> <span class="no">Proc</span><span class="o">.</span><span class="n">new</span> <span class="k">do</span> <span class="o">|</span><span class="nb">name</span><span class="p">:</span> <span class="s1">'Joe'</span><span class="p">,</span> <span class="ss">age</span><span class="p">:</span> <span class="mi">23</span><span class="p">,</span> <span class="o">**</span><span class="n">other_params</span><span class="o">|</span>
</span><span class='line'> <span class="o">[</span><span class="nb">name</span><span class="p">,</span> <span class="n">age</span><span class="p">,</span> <span class="n">other_params</span><span class="o">]</span>
</span><span class='line'><span class="k">end</span>
</span></code></pre></td></tr></table></div></figure>
<p>If you were to pass nothing at all to the Proc, you would get this: <code>["Joe", 23, {}]</code></p>
<p>Let’s see what happens if you change the name, and give it a some
undetermined parameter:</p>
<figure class='code'><figcaption><span>example_use.rb </span></figcaption>
<div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
</pre></td><td class='code'><pre><code class='rb'><span class='line'><span class="n">my_proc</span> <span class="o">=</span> <span class="no">Proc</span><span class="o">.</span><span class="n">new</span> <span class="k">do</span> <span class="o">|</span><span class="nb">name</span><span class="p">:</span> <span class="s1">'Joe'</span><span class="p">,</span> <span class="ss">age</span><span class="p">:</span> <span class="mi">42</span><span class="p">,</span> <span class="o">**</span><span class="n">other_params</span><span class="o">|</span>
</span><span class='line'> <span class="o">[</span><span class="nb">name</span><span class="p">,</span> <span class="n">age</span><span class="p">,</span> <span class="n">other_params</span><span class="o">]</span>
</span><span class='line'><span class="k">end</span>
</span><span class='line'>
</span><span class='line'><span class="n">my_proc</span><span class="o">[</span><span class="ss">age</span><span class="p">:</span> <span class="mi">49</span><span class="p">,</span> <span class="ss">hobbies</span><span class="p">:</span> <span class="o">[</span><span class="s1">'long walks'</span><span class="p">,</span> <span class="s1">'candlelight dinners'</span><span class="p">,</span> <span class="s1">'romantic comedies'</span><span class="o">]]</span>
</span></code></pre></td></tr></table></div></figure>
<p>We would end up with this as a return:</p>
<p><code>["Joe", 49, {:hobbies=>["long walks", "candlelight dinners", "romantic comedies"]}]</code></p>
<p>Compared to the extra work we would have had to do to get this in Ruby
1.9, I like it.</p>
<p>Did you know that the conversation starts here, but continues on in our <a href="https://plus.google.com/u/0/116568773932133159290/posts/KJrYYhbMDLz">Google Plus+
Post</a>?</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[My partial VIM configuration]]></title>
<link href="http://aavalam.github.com/blog/2013/03/03/my-partial-vim-configuration/"/>
<updated>2013-03-03T21:54:00-06:00</updated>
<id>http://aavalam.github.com/blog/2013/03/03/my-partial-vim-configuration</id>
<content type="html"><![CDATA[<p>What do you use to configure your editor?</p>
<p>I am usually in VIM for my editor. Not the graphical (gvim) version, the one
that runs in the terminal.</p>
<p>I also use <a href="https://github.com/carlhuda/janus">Carlhuda’s Janus</a> configuration.</p>
<p>But there are things that I change that are simply minor things.</p>
<!-- more -->
<p>To do this, according to the documentation for customization, I use
<code>~/.vimrc.after</code> and here are my settings.</p>
<p>These are miscelanious things that I wanted to have. The relativenumber
setting seems to not be as persistent as I would like though.</p>
<figure class='code'><figcaption><span>My Post Janus VIM Config .vimrc.after </span></figcaption>
<div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
</pre></td><td class='code'><pre><code class='vim'><span class='line'><span class="k">set</span> <span class="nb">t_Co</span><span class="p">=</span><span class="m">256</span>
</span><span class='line'><span class="k">set</span> <span class="nb">showcmd</span>
</span><span class='line'><span class="k">set</span> <span class="nb">foldmethod</span><span class="p">=</span><span class="nb">syntax</span>
</span><span class='line'><span class="k">set</span> <span class="nb">wildmenu</span>
</span><span class='line'><span class="k">set</span> <span class="nb">wildmode</span><span class="p">=</span><span class="nb">list</span>:longest
</span><span class='line'><span class="k">set</span> <span class="nb">virtualedit</span><span class="p">=</span><span class="k">all</span>
</span><span class='line'><span class="k">set</span> <span class="nb">visualbell</span>
</span><span class='line'><span class="k">set</span> <span class="nb">relativenumber</span>
</span><span class='line'><span class="k">set</span> <span class="nb">wrap</span>
</span><span class='line'><span class="k">set</span> <span class="nb">linebreak</span>
</span><span class='line'><span class="k">set</span> <span class="nb">nolist</span>
</span><span class='line'><span class="k">set</span> <span class="nb">textwidth</span><span class="p">=</span><span class="m">0</span>
</span><span class='line'><span class="k">set</span> <span class="nb">wrapmargin</span><span class="p">=</span><span class="m">0</span>
</span></code></pre></td></tr></table></div></figure>
<p>An abbreviation that I use pretty often.</p>
<figure class='code'><figcaption><span>My Post Janus VIM Config .vimrc.after </span></figcaption>
<div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
</pre></td><td class='code'><pre><code class='vim'><span class='line'><span class="c">" rdt<space> does an autocompletion which gives me a rubydoctest</span>
</span><span class='line'><span class="c">" comment block</span>
</span><span class='line'>iab <span class="nb">rdt</span> <span class="p">=</span>begin<span class="p"><</span>CR<span class="p">></span>doctest: <span class="p"><</span>CR<span class="p">>>></span> <span class="p"><</span>CR<span class="p">>=></span> <span class="p"><</span>CR<span class="p">>=</span><span class="k">end</span><span class="p"><</span>CR<span class="p">><</span>Up<span class="p">><</span>Up<span class="p">><</span>Up<span class="p">></span>
</span></code></pre></td></tr></table></div></figure>
<p>This next line clears the highlights that happen when you search. For me, my leader is <code>,</code>.</p>
<figure class='code'><figcaption><span>My Post Janus VIM Config .vimrc.after </span></figcaption>
<div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='vim'><span class='line'><span class="nb">nnoremap</span> <span class="p"><</span>leader<span class="p">><</span>space<span class="p">></span> :<span class="k">noh</span><span class="p"><</span><span class="k">cr</span><span class="p">></span>
</span></code></pre></td></tr></table></div></figure>
<p>Add this in here if you really want to be enforced not to use the
arrow keys. Enable it for a few days and pretty soon you just don’t
reach for the arrow keys until you really need them.</p>
<figure class='code'><figcaption><span>My Post Janus VIM Config .vimrc.after </span></figcaption>
<div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
</pre></td><td class='code'><pre><code class='vim'><span class='line'><span class="nb">nnoremap</span> <span class="p"><</span><span class="k">up</span><span class="p">></span> <span class="p"><</span>nop<span class="p">></span>
</span><span class='line'><span class="nb">nnoremap</span> <span class="p"><</span>down<span class="p">></span> <span class="p"><</span>nop<span class="p">></span>
</span><span class='line'><span class="nb">nnoremap</span> <span class="p"><</span><span class="k">left</span><span class="p">></span> <span class="p"><</span>nop<span class="p">></span>
</span><span class='line'><span class="nb">nnoremap</span> <span class="p"><</span><span class="k">right</span><span class="p">></span> <span class="p"><</span>nop<span class="p">></span>
</span><span class='line'><span class="nb">inoremap</span> <span class="p"><</span><span class="k">up</span><span class="p">></span> <span class="p"><</span>nop<span class="p">></span>
</span><span class='line'><span class="nb">inoremap</span> <span class="p"><</span>down<span class="p">></span> <span class="p"><</span>nop<span class="p">></span>
</span><span class='line'><span class="nb">inoremap</span> <span class="p"><</span><span class="k">left</span><span class="p">></span> <span class="p"><</span>nop<span class="p">></span>
</span><span class='line'><span class="nb">inoremap</span> <span class="p"><</span><span class="k">right</span><span class="p">></span> <span class="p"><</span>nop<span class="p">></span>
</span></code></pre></td></tr></table></div></figure>
<p>Well, there you have it. Most of my configuration file that I have in
addtion to the Janus configuration.</p>
<p>What things do you have in your configuration that you really like to
have? I am sure it is more exciting than mine!</p>
<p>The discussion starts here, but continues on this <a href="https://plus.google.com/u/0/116568773932133159290/posts/WhzgA38YcnB">Google+ Post</a>!</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Decision Driven Fairy Tale for Kids]]></title>
<link href="http://aavalam.github.com/blog/2013/03/01/decision-driven-fairy-tale-for-kids/"/>
<updated>2013-03-01T19:19:00-06:00</updated>
<id>http://aavalam.github.com/blog/2013/03/01/decision-driven-fairy-tale-for-kids</id>
<content type="html"><![CDATA[<p>I’d like to introduce <a href="https://github.com/sebastjan-hribar">Sebastjan</a>’s fantastic project on github: <a href="https://github.com/sebastjan-hribar/princ">princ</a></p>
<!-- more -->
<p><img src="http://www.rin-shun.com/shoes/seba_princ.png" alt="seba_princ.png" /></p>
<p>Watch <a href="http://www.rin-shun.com/shoes/seba_princ.swf.html">a little demo</a>.</p>
<p>Cool! Enjoy with your kids! <br/>
ashbb</p>
<p>The discussion starts here, but continues on our <a href="https://plus.google.com/u/0/116568773932133159290/posts/Pp5E6YB6tQE">Google+ post</a>!</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Testing multiple versions of Ruby]]></title>
<link href="http://aavalam.github.com/blog/2013/02/26/testing-multiple-versions-of-ruby/"/>
<updated>2013-02-26T17:24:00-06:00</updated>
<id>http://aavalam.github.com/blog/2013/02/26/testing-multiple-versions-of-ruby</id>
<content type="html"><![CDATA[<p>When you have code that you would like to test, it is fairly simple to
develop your tests to allow for it to be ran in more than one version of
Ruby. <!-- more --></p>
<p>This is part of the code that I use through inspiration from the <a href="https://github.com/rubyspec/rubyspec/blob/master/core/fixnum/bit_xor_spec.rb#L63">Ruby Spec</a> project. I haven’t checked the code, so I don’t believe it is identical in functionality.</p>
<p>The helper.rb file is loaded with my helper file in my testing folder.</p>
<figure class='code'><figcaption><span>ruby_version_is - helper.rb </span></figcaption>
<div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
</pre></td><td class='code'><pre><code class='rb'><span class='line'><span class="k">def</span> <span class="nf">ruby_version_is</span><span class="p">(</span><span class="n">version_string</span><span class="p">)</span>
</span><span class='line'> <span class="k">if</span> <span class="n">version_string</span> <span class="o">==</span> <span class="no">RUBY_VERSION</span>
</span><span class='line'> <span class="nb">block_given?</span> <span class="p">?</span> <span class="k">yield</span> <span class="p">:</span> <span class="kp">true</span>
</span><span class='line'> <span class="k">end</span>
</span><span class='line'><span class="k">end</span>
</span></code></pre></td></tr></table></div></figure>
<p>This allows me to do the identical thing you saw on line 63 of that link
above. In other words, I can use it with a block and it just does the
right thing.</p>
<p>Or I can use it like a query, and it will either return true or nil.</p>
<p>This makes it simple for me to have tests that are version specific, yet
won’t fill my tests with failures just because of a version difference.</p>
<p>It also lets me search for those things that are specific to a version.</p>
<p>Ruby 2.0.0-p0 is out, and I used it to document the new to_h
functionality</p>
<figure class='code'><figcaption><span>Test using ruby_is_version - core_struct_to_h_spec.rb </span></figcaption>
<div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
<span class='line-number'>15</span>
<span class='line-number'>16</span>
<span class='line-number'>17</span>
<span class='line-number'>18</span>
<span class='line-number'>19</span>
<span class='line-number'>20</span>
<span class='line-number'>21</span>
</pre></td><td class='code'><pre><code class='rb'><span class='line'><span class="nb">require</span> <span class="s1">'spec_helper'</span>
</span><span class='line'>
</span><span class='line'><span class="no">Car</span> <span class="o">=</span> <span class="no">Struct</span><span class="o">.</span><span class="n">new</span><span class="p">(</span><span class="ss">:make</span><span class="p">,</span> <span class="ss">:model</span><span class="p">,</span> <span class="ss">:year</span><span class="p">)</span> <span class="k">do</span>
</span><span class='line'> <span class="k">def</span> <span class="nf">build</span>
</span><span class='line'> <span class="k">end</span>
</span><span class='line'><span class="k">end</span>
</span><span class='line'>
</span><span class='line'><span class="n">ruby_version_is</span> <span class="s1">'2.0.0'</span> <span class="k">do</span>
</span><span class='line'> <span class="n">describe</span> <span class="s1">'Ruby 2.0.0 stuff'</span> <span class="k">do</span>
</span><span class='line'>
</span><span class='line'> <span class="n">before</span> <span class="ss">:each</span> <span class="k">do</span>
</span><span class='line'> <span class="vi">@car</span> <span class="o">=</span> <span class="no">Car</span><span class="o">.</span><span class="n">new</span><span class="p">(</span><span class="s1">'Toyota'</span><span class="p">,</span> <span class="s1">'Prius'</span><span class="p">,</span> <span class="mi">2014</span><span class="p">)</span>
</span><span class='line'> <span class="k">end</span>
</span><span class='line'>
</span><span class='line'> <span class="n">it</span> <span class="s1">'converts class to hash'</span> <span class="k">do</span>
</span><span class='line'> <span class="vi">@car</span><span class="o">.</span><span class="n">to_h</span><span class="o">.</span><span class="n">must_equal</span> <span class="ss">make</span><span class="p">:</span> <span class="s1">'Toyota'</span><span class="p">,</span> <span class="ss">model</span><span class="p">:</span> <span class="s1">'Prius'</span><span class="p">,</span> <span class="ss">year</span><span class="p">:</span> <span class="mi">2014</span>
</span><span class='line'> <span class="k">end</span>
</span><span class='line'>
</span><span class='line'> <span class="k">end</span>
</span><span class='line'>
</span><span class='line'><span class="k">end</span>
</span></code></pre></td></tr></table></div></figure>
<p>Now I can run this test alongside others, and I don’t have to worry
about what version of Ruby it is testing against.</p>
<p>I think that I will add some functionality though. So I can specify a
minimum version of Ruby, and when 3.0.0 comes out, I will know what
things change based on the tests, because they will run against that
version as well, while not running against previous ones.</p>
<p>Anyway, how do you test against different versions of Ruby?</p>
<p>Continue this conversation on our <a href="https://plus.google.com/u/0/116568773932133159290/posts/Ffzy66e8TrH">Google Plus post</a>!</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Ruby 2.0.0-p0 Notes]]></title>
<link href="http://aavalam.github.com/blog/2013/02/25/ruby-2-dot-0-0-p0-notes/"/>
<updated>2013-02-25T03:39:00-06:00</updated>
<id>http://aavalam.github.com/blog/2013/02/25/ruby-2-dot-0-0-p0-notes</id>
<content type="html"><![CDATA[<p>I have been waiting for the 24th of February to see what would come of
the planned release date for Ruby 2.0.0-p0.</p>
<p>I wanted to apply my “Learn By Testing” repository on this new Ruby, and
am running into a few problems. <!-- more --> The first was Bundler 1.3.0 needs to be
installed. Simple enough to install. Just go to the repository, clone
it, select the tagged version, then install it locally as a gem.</p>
<p>Trying to use a Gemfile with Bundler though is giving me some errors.</p>
<p>See, I am using Guard and I wanted to add the <code>rb-inotify</code> gem to my
<code>Gemfile</code>. But in doing so, I get this error:</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>~/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.0.pre.8/lib/bundler/lazy_specification.rb:74:in `method_missing': LazySpecification has not been materialized yet (calling :required_ruby_version []) (RuntimeError)
</span><span class='line'> from ~/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.0.pre.8/lib/bundler/match_platform.rb:11:in `match_platform'
</span><span class='line'> …
</span><span class='line'> from ~/.rvm/gems/ruby-2.0.0-p0/bin/ruby_noexec_wrapper:14:in `eval'
</span><span class='line'> from ~/.rvm/gems/ruby-2.0.0-p0/bin/ruby_noexec_wrapper:14:in `<main>'</span></code></pre></td></tr></table></div></figure>
<p>The problem is that in my RVM I had a bundler 1.2 version installed in
the @global gemset.</p>
<p>Removing the global bundler, making sure that Bundler 1.3.0 was
installed, seems to have corrected the issues.</p>
<p>Now on to write tests for Ruby 2.0 and absorb some knowledge while
recording what I have learned.</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Create and Publish Your First Ruby Gem - A Review]]></title>
<link href="http://aavalam.github.com/blog/2013/02/19/create-and-publish-your-first-ruby-gem-a-review/"/>
<updated>2013-02-19T01:57:00-06:00</updated>
<id>http://aavalam.github.com/blog/2013/02/19/create-and-publish-your-first-ruby-gem-a-review</id>
<content type="html"><![CDATA[<p>A book(let) review.</p>
<p>A hands on guide for Ruby newbies to create and publish their first Ruby
gem.</p>
<p>Satish has published a booklet that takes you through the steps required
to publish your first Ruby Gem. <a href="http://www.amazon.com/gp/product/B00BECCKYM"><img class="right" src="http://ecx.images-amazon.com/images/I/41ZtM8-8HNL._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA278_PIkin4,BottomRight,-55,22_AA300_SH20_OU01_.jpg" width="300" height="300" title="How Do I Create And Publish My First Ruby Gem?" ></a> Recently updated with information on
how to ‘yank’ your gem in case you don’t need it to be available, it is
a good short reference to get you quickly started in the world of Ruby Gems.</p>
<p>There are tools out there that do the work for you in terms of having a
skeleton. This booklet will cover none of those. It will take you
through the basics to get a gem up and running in a few short minutes.</p>
<p>Yes, all the information is available for free. And it is not that
difficult to find it all. But dropping a dollar to have a handy
reference on your Kindle to support Satish’s efforts on RubyLearning is
just a small way to say “Thanks!” and a way to show some love.</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Saying Goodbye to Posterous]]></title>
<link href="http://aavalam.github.com/blog/2013/02/16/saying-goodbye-to-posterous/"/>
<updated>2013-02-16T05:26:00-06:00</updated>
<id>http://aavalam.github.com/blog/2013/02/16/saying-goodbye-to-posterous</id>
<content type="html"><![CDATA[<p>When Twitter bought Posterous, I thought it was going to be a great
thing for us. We would have a long term platform, always improving,
easy to use for guest blogging from those that are not necessarily
familiar with html and markup/markdown. But I was notified by Satoshi
that they will be shutting down in April.</p>
<!-- more -->
<p>Co-founder Garry Tan is providing <a href="http://posthaven.com">this solution</a> for US $5.00 per month as per his tweet. Not a bad idea.</p>
<blockquote><p>Posterous Will Shut Down On April 30th, Co-Founder Garry Tan Launches Posthaven To Save Your Sites</p><footer><strong>@garrytan</strong> <cite><a href='https://twitter.com/garrytan/status/302591116224651265'>twitter.com/garrytan/status/…</a></cite></footer></blockquote>
<p><span class='pullquote-right' data-pullquote='It was great while it lasted'></p>
<p>It was a great thing for us. It was great while it lasted, and we
definitely emjoyed the ease to involve the people that wanted to write
but didn’t want to necessarily have their own blog set up. E-mail to
our blog address, and it was as simple as that. It even let my children
post via e-mail from their e-mail or even from their phones for the
photos that they took occasionally. A great idea for that kind of
thing, easier privacy settings for the kids than Facebook without all the
intricate settings, and just simple to use.
</span></p>
<p>For us, for right now, it looks like it is Github and Octopress. This
should work very well for a technical blog, it should let us express the
things that we would like to express, and it will allow simple team
management for those that have experience with git and markdown.</p>
<p>It won’t be as simple in a lot of ways as Posterous was. But it will
afford us some more features and the fun of learning and playing with a
new system. Plus, it is fully customizable, still without the overhead
you get with hosting your own servers, etc.</p>
<p>We will miss Posterous! But we are excited about moving on and learning
new things.</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[breaktime : Fantastic Green Shoes App]]></title>
<link href="http://aavalam.github.com/blog/2013/02/15/breaktime-fantastic-green-shoes-app/"/>
<updated>2013-02-15T07:26:00-06:00</updated>
<id>http://aavalam.github.com/blog/2013/02/15/breaktime-fantastic-green-shoes-app</id>
<content type="html"><![CDATA[<p><img class="center" src="http://aavalam.github.com/images/2013/02/47266220-breaktime.png" width="396" height="98" title="breaktime gem" ></p>
<p>I’d like to introduce <a href="https://github.com/joony">joonty’s</a> fantastic project on github.</p>
<p>Read this post: <a href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/404416">New gem: breaktime</a></p>
<p>Cool! Try it out! :-D</p>
<p>–ashbb</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Play Othello with Shoes 4]]></title>
<link href="http://aavalam.github.com/blog/2013/02/01/play-othello-with-shoes-4/"/>
<updated>2013-02-01T05:19:00-06:00</updated>
<id>http://aavalam.github.com/blog/2013/02/01/play-othello-with-shoes-4</id>
<content type="html"><![CDATA[<p>Today <a href="https://github.com/shoes/shoes4">Shoes 4</a> has become able to run Othello Game.</p>
<!-- More -->
<p><img class="top" src="http://aavalam.github.com/images/2013/02/othello-sample50.png" width="268" height="319" title=""Othello Game Board on Shoes"" alt=""Othello Game Board on Shoes""></p>
<p>Watch <a href="http://www.rin-shun.com/shoes4/tmp/shoes4-sample50.swf.html">a demo</a>.</p>
<p>Have fun with Shoes,</p>
<p>ashbb</p>
<p>The discussion starts here, but continues on at our <a href="https://plus.google.com/116568773932133159290/posts/MiQhgoqqMHR">Google Plus Post</a>!</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Private easy git repositories using rails and gitlab]]></title>
<link href="http://aavalam.github.com/blog/2012/10/28/private-easy-git-repositories-using-rails-and-gitlab/"/>
<updated>2012-10-28T03:02:00-05:00</updated>
<id>http://aavalam.github.com/blog/2012/10/28/private-easy-git-repositories-using-rails-and-gitlab</id>
<content type="html"><![CDATA[<p>I have installed <a href="http://gitlabhq.com/">gitlab</a> about 4 times over the last 24 hours.</p>
<!-- more -->
<p>First I started with an install from turnkey, so that I could look over a well thought out install. And it was pretty simple aside from one timeout issue. Easilly fixed once I looked through the configuration files. It was running vesion 2.5.0, you can download a virtual machine install from www.turnkeylinux.org, search for gitlab,</p>
<p>I then blew away the VM and installed it again and made some changes that I wanted to see, just to get a feel for how I could manipulate things and break them.</p>
<p>Finally, the last time (and this screenshot) is from an install right from the gitlab instructions. It was very straight forward, I did find one error in /home/git/.gitolite.rc which had a single quote in the wrong place, I replaced it with a slash to give it a glob pattern. (I think it was the right thing to do). If you are
curious, it is on line 22.</p>
<p>This is version 3.0.3 and pulled down from the stable branch.</p>
<p><img src="http://aavalam.github.com/images/2012/10/45405183-image.png" width="812" height="748" title="Screenshot of GITLAB Dashboard" ></p>
<p>From playing with it a little bit (and I found out from pushing the gitlab stable branch only) that gitlab expects and requires a master branch to be created and pushed up, otherwise it doesn’t know to display even the only branch that is there. So that took me a moment to realize.</p>
<p>Remove the master branch, and you will go back to the instruction page directing you to do a git config –global username and mail
standard things for git configuration as it pertains to your
settings.</p>
<p>If you are wanting to play with the demo, you can from the link above… or if you would like to play with it with your own account, you can right at <a href="http://gitlab.com">gitlab.com</a> (I don’t know why that domain isn’t in your face when you go to their main web page.) They are running, as of this post, version 2.9.1.</p>
<p>If you decide to install it or use it in the various ways that you are able to, let me know your results, how you are using it, and what you think about it. Have you customized it? Added a registration page, etc.?</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Exploring Everyday Things with R and Ruby - A Book Review]]></title>
<link href="http://aavalam.github.com/blog/2012/07/10/exploring-everyday-things-with-r-and-ruby-book-review/"/>
<updated>2012-07-10T04:52:00-05:00</updated>
<id>http://aavalam.github.com/blog/2012/07/10/exploring-everyday-things-with-r-and-ruby-book-review</id>
<content type="html"><![CDATA[<p>by: Victor Goff</p>
<p>I got the opportunity to review <em>Exploring Everyday Things with R and Ruby</em> by
Sau Sheong Chang and published by O’Reilly Media.<a href="http://shop.oreilly.com/product/0636920022626.do" title="Exploring Everyday Things with R and Ruby - O'Reilly Media. 2012. 6 Jul. 2012">1</a>
</p>
<!-- more -->
<p>This book, as expected, talks about R and Ruby. The first chapters cover
Ruby at an introductory level.</p>
<p><span class='pullquote-right' data-pullquote='Shoes, a simple but powerful UI toolkit for Ruby'>
In the first chapter, after showing how you can install Ruby and an
introduction to the basics of Ruby, he also provides a quick introduction
to Shoes, a simple but powerful UI toolkit for Ruby<a href="http://my.safaribooksonline.com/book/-/9781449342203/1dot-the-hat-and-the-whip/id2776202" title="Exploring Everyday Things with R and Ruby 1. The Hat and the Whip 2012. 6 Jul. 2012">2</a>, with installation
suggestions and sample code.
</span></p>
<p>His introduction to Ruby covers the basics and is just a little bit more than
enough to understand the code in the rest of his book. I think he did a
really good job of that. The second part of the first chapter, covering Shoes,
explains Shoes in a nutshell rather well, I think. You will get to use Shoes
in later chapters.</p>
<p>He then goes on to introduce R, which I had not used before. He covers in a
way that was fairly straightforward to install and get running. Within a few
moments, I had R installed and the ‘normal’ graphical tools up and running and
was able to run some sample code, and even had graphs floating around my screen
based on data that I created from the samples.</p>
<p>Shortly after that, I had R code being created in my favorite text editor, and
executing code right from there.</p>
<p>His introduction to the language is fairly quick, but again, just a bit more
than enough to get you going.</p>
<p>He also covers some statistical transformation examples to change the statistical
data into plottable information. That is a good thing, because throughout the book,
you will be needing to recognize this in the examples, and will have fun producing
your own graphical representations of data you get.</p>
<p>And all that is enough to get you started creating models to solve real world problems.</p>
<p>For example, do you need to convince your boss that you need more restrooms available
for the people in your office? You can provide some simulations and reports and graphs
(the boss likes graphs, right?) to support your argument, or will it support his
assertion that what you have is just the right amount?</p>
<p>This gets to the fun part. Have you ever wondered how to mine data from your own
e-mail? To find trends of when you send mail, or who you communicate with most?
Finding the most frequently used words and the trending themes in your communications?
You are in luck. He will take you through the Enron Saga to lightly touch on analyzing
that e-mail data <a href="http://www.cs.cmu.edu/~enron/" title="Enron Email Dataset. - 2004. 6 Jul. 2012">3</a>, but easily apply it to your own IMAP e-mail accounts.</p>
<p>How about biometrics, recording your own heartbeat through a home made electronic
stethoscope? Yes, you will be able to do this, and take measurements, and analyze
them graphically. Combine that with pulse oximetry with your webcam and you might
have just enough evidence to convince your boss that your cubicle is suffocating you.</p>
<p>That sounds fun enough, but it will involve analyzing sound files and video files to
get the readings and measurements that you want to produce in a graphical chart.
That makes it fun to the nth power, right?</p>
<p>Well, what can be more fun than Boid’s… and boid is the woid in this next chapter.
Using Ruby Shoes you will explore the flocking of birds, you will write a simulation
and are encouraged to continue playing on.</p>
<p>What follows is an extension of the Boids and introduces the mortality and procreation
of the boids, which were prior to this immortals in a veritable utopia. Life
simulated and analyzed.</p>
<p>Overall, I really enjoyed this book, it was easy to read, had some math in it, of
course, but nothing that requires advanced math. And the topics were fun to work
through. And there is plenty of room to experiment and explore after finishing
the chapters.</p>
<p>Note; This review cross posted at RubyLearnings Blog with permission.</p>
<p>The conversation starts here, and continues on <a href="https://plus.google.com/u/0/116568773932133159290/posts/Hbni5EzVvzB">Google Plus</a>!</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Quick Reference to Minitest and Minitest Spec]]></title>
<link href="http://aavalam.github.com/blog/2012/03/22/quick-reference-to-minitest-and-minitest-spec/"/>
<updated>2012-03-22T17:42:00-05:00</updated>
<id>http://aavalam.github.com/blog/2012/03/22/quick-reference-to-minitest-and-minitest-spec</id>
<content type="html"><![CDATA[<p>I placed this in my ~/bin folder so that I could run it whenever I need a quick refresher on the available assertions. It will automatically include changes as minitest gets updated over time and versions. <!-- more --></p>
<div><script src='https://gist.github.com/2165841.js?file=minitest_assertions.rb'></script>
<noscript><pre><code>#!/usr/bin/env ruby
require 'test/unit'
require 'minitest/spec'
# Reasonable default of 3 columns
@columns = 3
puts "== Spec Style"
def columnize(method)
@column_count ||= 1
print "#{method}".ljust(25)
if @column_count == @columns
puts
@column_count = 0
end
@column_count += 1
end
MiniTest::Spec.methods.sort.each do |method|
if method.to_s =~ /wont/ or method.to_s =~ /must/
columnize(method)
end
end
puts "\n\n== Test Style"
column_count = 1
MiniTest::Assertions.instance_methods.sort.each do |method|
if method =~ /assert/ or method.to_s =~ /refute/
columnize(method)
end
end
</code></pre></noscript></div>
<p>Currently the list shows:</p>
<div><script src='https://gist.github.com/2165841.js?file=output.txt'></script>
<noscript><pre><code>== Spec Style
must_be must_be_close_to must_be_empty
must_be_instance_of must_be_kind_of must_be_nil
must_be_same_as must_be_silent must_be_within_delta
must_be_within_epsilon must_equal must_include
must_match must_output must_raise
must_respond_to must_send must_throw
wont_be wont_be_close_to wont_be_empty
wont_be_instance_of wont_be_kind_of wont_be_nil
wont_be_same_as wont_be_within_delta wont_be_within_epsilon
wont_equal wont_include wont_match
wont_respond_to
== Test Style
_assertions _assertions=
assert assert_block assert_empty
assert_equal assert_in_delta assert_in_epsilon
assert_includes assert_instance_of assert_kind_of
assert_match assert_nil assert_operator
assert_output assert_raises assert_respond_to
assert_same assert_send assert_silent
assert_throws refute refute_empty
refute_equal refute_in_delta refute_in_epsilon
refute_includes refute_instance_of refute_kind_of
refute_match refute_nil refute_operator
refute_respond_to refute_same
</code></pre></noscript></div>
<p>I placed this in my ~/bin folder so that I could run it whenever I need a quick refresher on the available assertions. It will automatically include changes as minitest gets updated over time and versions.</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Programming User Interfaces]]></title>
<link href="http://aavalam.github.com/blog/2010/07/20/programming-user-interfaces/"/>
<updated>2010-07-20T01:31:00-05:00</updated>
<id>http://aavalam.github.com/blog/2010/07/20/programming-user-interfaces</id>
<content type="html"><![CDATA[<p>(Original post date: 03/Mar/2010)</p>
<p>My way of programming the computer systems have been normal, albeit slower than the technology has evolved, I began by imperative programming applications in command line mode and have I kept more within the server components of the solutions that have developed or maintained.</p>
<p>However, every time I make a foray into programming mode applications GUI it always suffers from too much friction and impedance. And even when you reach the end, most often it does not end up being what you expected from the beginning.</p>
<!-- more -->
<p>Leaving aside the issues connected with NPP - Non-Programmers Programming - and with the usual challenges around the lineup - Software Craftsmanship - This article addresses two issues: why is it difficult for programmers to encode good user interfaces and a possible answer to minimize this impedance ( Paper Prototyping ).</p>
<p>Firstly, I have learned that 80% (or more) of the value of an application is evaluated by the user on the user interface of this application.</p>
<p>Jeff Atwood in his article “The User Interface Is The Application”, says that no matter how spectacular the architecture diagrams are that exist for an application, with respect to the user of that application, the user interface is the application. It is true that the task of building a good user interface is difficult but to be taken seriously you have to go beyond and build an impressive user interface.</p>
<p>And he even cites Yukihiro Matsumoto, creator of the Ruby language:</p>
<p>If you have a good interface on your system, and the budget of money and time, you can work on your system. If your system has bugs or is too slow, you can improve it. But if your system has a bad interface, you have basically nothing. It will not matter if it is the work of the highest craftsmanship on the inside. If your system has a bad interface, no one will use it. So the interface or surface of the system, whether to users or other machines, is very important.</p>
<p>The assumption that building a good user interface is difficult, is it reasonable to expect that any programmer with no training or experience in UI Design can build and maintain a good user interface?</p>
<p>Some responses also came from another article from Jeff Atwood, <a href="http://www.codinghorror.com/blog/2005/06/ui-is-hard.html">“UI is Hard”</a>, where he writes that in part are the developers themselves primarily to blame because - like me - most programmers begin to think in code and business logic rather than begin by thinking about the user interface. And that majority is represented in part on your comments to this article.</p>
<p>Other responses came from other similar articles, <a href="http://blogs.msdn.com/rick_schaut/archive/2004/04/02/106929.aspx">“UI Design”</a> blog “Buggin’ My Life Away” by Rick Schaut and <a href="http://www.cooper.com/journal/2003/08/can_programmers_do_interaction.html">“Can Programmers Do Interaction Design?”</a> by Kim Goodwin of Cooper in the Journal.</p>
<p>What is Rick points out that when working on software for the user it doesn’t matter if it is a web application or desktop, or add new features, the focus is in designing the user interface - first and foremost. And this is complicated because programmers are first used to implement efficient algorithms for common problems in computer science but not learned or have enough experience on how to design a good user interface. Secondly, most of the tools facilitates the rapid creation of user interfaces for most simple problems of usability , but they tend to fall short of what is needed also to facilitate the rapid creation of interfaces for a set of usage scenarios that are more complex.</p>
<p>In another interesting article, <a href="http://www.codinghorror.com/blog/2004/09/the-rise-and-fall-of-homo-logicus.html">“The Rise and Fall of Homo Logicus”</a> by Jeff Atwood quotes an excerpt from the book <em>The Inmates Are Running the Asylum</em> by Alan Cooper: There is a large impedance for a programmer to design an interface for the user. Because while most developers have a more forward-thinking knowledge about how everything works, most users have only a thought turned to the success of a task. He ends the article saying that we must stop thinking like Homo Logicus and think more like Homo Sapiens.</p>
<p>The article by Kim said that instead of resulting in the lowest cost having the programmers design the user interface it has been the opposite: it is more inefficient, more costly and more likely to be a failure. And the failures is that it results in more programming, right?</p>
<p>So how to avoid the impedance between what the programmer is able to create and what the user is typically waiting for?</p>
<p>First, many articles recommend to start the development by creating the user interface even to the point (extreme and ironic) to appoint a methodology to be followed: FAD.</p>
<p>Secondly, the use of paper prototyping - what other benefits avoids many of the pitfalls in prototyping applications - due to better mitigate the risks normally inherent in having the feedback of the users only after laborious programming tasks</p>
<ul>
<li>Posted in: <a href="http://recortis.dowedo-it.com/index.php/archives/category/docoding/">doCoding</a></li>
<li>Author: José Carlos Monteiro</li>
</ul>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Hooks in Ruby - A First Look]]></title>
<link href="http://aavalam.github.com/blog/2010/07/16/hooks-in-ruby-a-first-look/"/>
<updated>2010-07-16T07:04:00-05:00</updated>
<id>http://aavalam.github.com/blog/2010/07/16/hooks-in-ruby-a-first-look</id>
<content type="html"><![CDATA[<p>Here is a list of the Ruby Hooks</p>
<ul>
<li>const_missing</li>
<li>included</li>
<li>extended</li>
<li>inherited</li>
<li>method_missing</li>
<li>method_added</li>
<li>singleton_added</li>
<li>method_removed</li>
<li>method_undefined</li>
</ul>
<p>The discussion starts here, but continues on our <a href="https://plus.google.com/u/0/116568773932133159290/posts/PmN66RBNGjY">Google+ post</a>!</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Ternary Operator vs Or Operator vs And Operator]]></title>
<link href="http://aavalam.github.com/blog/2010/07/11/ternary-operator-vs-or-opeartor-vs-and-operator/"/>
<updated>2010-07-11T15:38:00-05:00</updated>
<id>http://aavalam.github.com/blog/2010/07/11/ternary-operator-vs-or-opeartor-vs-and-operator</id>
<content type="html"><![CDATA[<h2>The Ternary Operator and the OR Operator</h2>
<p>The ternary operator is not reasonable for a situation that returns true or false; if the goal is to get a result of true or false from your decision, it is better to simply evaluate the statement itself. <!-- More --></p>
<p>For example, if it reduces to this statement:</p>
<figure class='code'><figcaption><span>snippet1.rb </span></figcaption>
<div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='rb'><span class='line'><span class="n">some_condition</span> <span class="p">?</span> <span class="kp">true</span> <span class="p">:</span> <span class="kp">false</span>
</span></code></pre></td></tr></table></div></figure>
<p>then you are better off just simply using <code>some_condition</code> by itself, as it will evaluate to either true or false.</p>
<p>If, however, you have a statement that evaluates such as</p>
<figure class='code'><figcaption><span>snippet2.rb </span></figcaption>
<div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='rb'><span class='line'><span class="n">some_condition</span> <span class="p">?</span> <span class="kp">true</span> <span class="p">:</span> <span class="p">(</span><span class="n">some_action</span> <span class="ow">or</span> <span class="n">other</span> <span class="n">value</span><span class="p">)</span>
</span></code></pre></td></tr></table></div></figure>
<p>What you may be asking for and really wanting is the OR Operator, rather than the ternary:</p>
<figure class='code'><figcaption><span>snippet3.rb </span></figcaption>
<div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='rb'><span class='line'><span class="n">some_condition</span> <span class="o">||</span> <span class="n">do_this_if_</span><span class="s2">"some_statement"</span><span class="n">_evaluates_as_false</span>
</span></code></pre></td></tr></table></div></figure>
<p>If this doesn’t immediately look familiar, look at this:</p>
<figure class='code'><figcaption><span>snippet4.rb </span></figcaption>
<div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='rb'><span class='line'><span class="n">assign_this</span> <span class="o">=</span> <span class="n">evaluated_condition</span> <span class="p">?</span> <span class="kp">true</span> <span class="p">:</span> <span class="n">expression_if_evaluated_statement_is_false</span>
</span></code></pre></td></tr></table></div></figure>
<p> Is the same as:</p>
<figure class='code'><figcaption><span>snippet5.rb </span></figcaption>
<div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='rb'><span class='line'><span class="n">assign_this</span> <span class="o">=</span> <span class="n">evaluated_statement_if_true</span> <span class="ow">or</span> <span class="n">expression_if_evaluated_statement_is_false</span>
</span></code></pre></td></tr></table></div></figure>
<p>On the other side of the spectrum, when you have</p>
<figure class='code'><figcaption><span>snippet6.rb </span></figcaption>
<div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='rb'><span class='line'><span class="n">some_statement</span> <span class="p">?</span> <span class="p">(</span><span class="n">some_action</span> <span class="ow">or</span> <span class="n">other</span> <span class="n">value</span><span class="p">)</span> <span class="p">:</span> <span class="kp">false</span> <span class="c1"># or nil</span>
</span></code></pre></td></tr></table></div></figure>
<p>You will want to use the AND operator:</p>
<figure class='code'><figcaption><span>snippet7.rb </span></figcaption>
<div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='rb'><span class='line'><span class="n">some_condition</span> <span class="o">&&</span> <span class="n">do_this_if_some_condition_evaluates_as_true</span>
</span></code></pre></td></tr></table></div></figure>
<p>Rather than using the ternary with a false return like:</p>
<figure class='code'><figcaption><span>snippet8.rb </span></figcaption>
<div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='rb'><span class='line'><span class="n">assign_this</span> <span class="o">=</span> <span class="n">evaluated_condition</span> <span class="p">?</span> <span class="p">(</span><span class="n">some_action</span> <span class="ow">or</span> <span class="n">other</span> <span class="n">value</span><span class="p">)</span> <span class="p">:</span> <span class="kp">false</span>
</span></code></pre></td></tr></table></div></figure>
<p>Remember, the point of either is having an evaluated statement that has the possibility of being false (or nil) as well as the possibility of being true.</p>
<p>If your evaluated statement never has both possibilities, then these aren’t the operators for you at this moment.</p>
<p>In conclusion, we use the ternary operator when we have a simple <code>if..then</code> operation that does not return either <code>true</code> or <code>false</code> itself. We use the <code>or</code> and <code>and</code> operator when we need one evaluation or the other. When using the ternary operator, we don’t use it to return <code>true</code> or <code>false</code>, there are easier ways to do that.</p>
<p>The discussion starts here, but continues in our <a href="https://plus.google.com/116568773932133159290/posts/RXLe2TkWEDa">Google Plus Post</a>!</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Using String's strip method rather than chomp]]></title>
<link href="http://aavalam.github.com/blog/2010/07/11/using-strings-strip-method-rather-than-chomp/"/>
<updated>2010-07-11T15:33:00-05:00</updated>
<id>http://aavalam.github.com/blog/2010/07/11/using-strings-strip-method-rather-than-chomp</id>
<content type="html"><![CDATA[<p>I have been in the habit of using <code>String#chomp</code> when interactively
requesting input from people. I am considering using <code>String#strip</code>
instead. <!-- more -->It does more than <code>chomp</code>, in that it will remove leading
whitespace, trailing whitespace and still the <code>$/</code> which is to say the
record separator. I think that it is more suitable for interactive
input, unless you are counting on leading whitespace from someone for
some reason.</p>
<p>The statement that we always say when talking about <code>chomp</code> and <code>to_i</code> or
<code>to_f</code> is that <code>to_i</code> and <code>to_f</code> does the same thing as <code>chomp</code>, and this is
almost true. But <code>to_i</code> and <code>to_f</code> actually work more like strip.</p>