-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
644 lines (328 loc) · 21.4 KB
/
index.html
File metadata and controls
644 lines (328 loc) · 21.4 KB
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
<!DOCTYPE html>
<!--[if IEMobile 7 ]><html class="no-js iem7"><![endif]-->
<!--[if lt IE 9]><html class="no-js lte-ie8"><![endif]-->
<!--[if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
<head>
<meta charset="utf-8">
<title>amber tunnell</title>
<meta name="author" content="Amber Tunnell">
<meta name="description" content="Merge Sort is a divide and conquer sorting algorithm. It is much more efficent than either Bubble Sort or Insertion Sort with an average and worst …">
<!-- http://t.co/dKP3o1e -->
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="canonical" href="http://ambertunnell.github.io">
<link href="/favicon.png" rel="icon">
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
<link href="http://feeds.feedburner.com/ambertunnell" rel="alternate" title="amber tunnell" type="application/atom+xml">
<script src="/javascripts/modernizr-2.0.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>!window.jQuery && document.write(unescape('%3Cscript src="./javascripts/libs/jquery.min.js"%3E%3C/script%3E'))</script>
<script src="/javascripts/octopress.js" type="text/javascript"></script>
<!--Fonts from Google"s Web font directory at http://google.com/webfonts -->
<link href="http://fonts.googleapis.com/css?family=PT+Serif:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Fjalla+One' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Handlee' rel='stylesheet' type='text/css'>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-53821540-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<!-- <body class="collapse-sidebar sidebar-footer" > -->
<body>
<header role="banner">
<div class="header-title"><a href="/">amber tunnell</a></div>
<br><div class="header-subtitle">puts 'my thoughts on the magic that is code'</div>
</header>
<nav role="navigation"><ul class="subscription" data-subscription="rss">
<li><a href="http://feeds.feedburner.com/ambertunnell" rel="subscribe-rss" title="subscribe via RSS">RSS</a></li>
</ul>
<form action="http://google.com/search" method="get">
<fieldset role="search">
<input type="hidden" name="q" value="site:ambertunnell.github.io" />
<input class="search" type="text" name="q" results="0" placeholder="Search"/>
</fieldset>
</form>
<ul class="main-navigation">
<li><a href="/">blog</a></li>
<li><a href="/blog/archives">archives</a></li>
<li><a href="/blog/about">about</a></li>
<li><a href="/blog/projects">projects</a></li>
</ul>
</nav>
<div id="main">
<div id="content">
<div class="blog-index">
<article>
<header>
<h1 class="entry-title"><a href="/blog/2014/10/07/merge-sort/">Sorting Algorithms Series: Merge Sort</a></h1>
<p class="meta">
<time datetime="2014-10-07T14:54:35-04:00" pubdate data-updated="true">Oct 7<span>th</span>, 2014</time>
| <a href="/blog/2014/10/07/merge-sort/#disqus_thread"
data-disqus-identifier="http://ambertunnell.github.io/blog/2014/10/07/merge-sort/">Comments</a>
</p>
</header>
<div class="entry-content"><p><strong>Merge Sort</strong> is a divide and conquer sorting algorithm. It is much more efficent than either <a href="/blog/2014/08/20/bubble-sort/">Bubble Sort</a> or <a href="http://localhost:4000/blog/2014/08/23/insertion-sort/">Insertion Sort</a> with an average and worst case time complexity of O(n log n).</p>
<p>In Merge Sort, you divide a list of items to be in the smallest units possible. You sort the smaller units, then repeatedly merge the small units back together until you have a sorted list.</p>
<ol>
<li>Take an array of items. Split the array into single subunits.</li>
<li>Since an item with only one input is considered sorted, merge the subunits together so that you now have subunits with 2 items each.</li>
<li>Sort each of these 2-item subunits so that they are all ordered correctly.</li>
<li>Continue merging the subunits together and sorting them individually until you have a completely merged and sorted list.</li>
</ol>
</div>
<footer>
<a rel="full-article" href="/blog/2014/10/07/merge-sort/">Read on →</a>
</footer>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2014/10/06/all-of-the-javascript-basic-terms-and-concepts-for-beginners/">All of the JavaScript: Basic terms and concepts for beginners</a></h1>
<p class="meta">
<time datetime="2014-10-06T18:27:45-04:00" pubdate data-updated="true">Oct 6<span>th</span>, 2014</time>
| <a href="/blog/2014/10/06/all-of-the-javascript-basic-terms-and-concepts-for-beginners/#disqus_thread"
data-disqus-identifier="http://ambertunnell.github.io/blog/2014/10/06/all-of-the-javascript-basic-terms-and-concepts-for-beginners/">Comments</a>
</p>
</header>
<div class="entry-content"><p>When I first started learning JavaScript, I was thrown off by some of its terminology and quirks. This post is intended to offer some guidance into the craziness of the JavaScript world for beginning JavaScripters.</p>
<p>JavaScript is a dynamically-typed, object-oriented programming language that is usually used on the client side in web browsers.</p>
<p>Functions are central to one’s undertanding of JavaScript, so let’s start with the difference between function declarations and function expressions.</p>
</div>
<footer>
<a rel="full-article" href="/blog/2014/10/06/all-of-the-javascript-basic-terms-and-concepts-for-beginners/">Read on →</a>
</footer>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2014/08/23/insertion-sort/">Sorting Algorithms Series: Insertion Sort</a></h1>
<p class="meta">
<time datetime="2014-08-23T16:01:26-04:00" pubdate data-updated="true">Aug 23<span>rd</span>, 2014</time>
| <a href="/blog/2014/08/23/insertion-sort/#disqus_thread"
data-disqus-identifier="http://ambertunnell.github.io/blog/2014/08/23/insertion-sort/">Comments</a>
</p>
</header>
<div class="entry-content"><p>Like <a href="/blog/2014/08/20/bubble-sort/">Bubble Sort</a>, <strong>Insertion Sort</strong> is a simple sorting algorithm.</p>
<p>Insertion Sort works by iterating up the current array, placing the current element into the correct place in the new sorted array.</p>
<ol>
<li>First, take the first element of the unsorted array out of the array and put it into an empty new array.</li>
<li>Take the next element out of the unsorted array and place it into the new array. If it is smaller than the first element in the new array, swap them. If not, leave it at the end.
<li>Take the next element out of the array and put it at the end of the new array. If it is larger than the previous end element, leave it. If not, iterate through the array until you find its correct position and insert it there.
<li>Continue this process until your original array is empty and you have a new completely sorted array.</li>
</ol>
</div>
<footer>
<a rel="full-article" href="/blog/2014/08/23/insertion-sort/">Read on →</a>
</footer>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2014/08/20/bubble-sort/">Sorting Algorithms Series: Bubble Sort</a></h1>
<p class="meta">
<time datetime="2014-08-20T21:37:50-04:00" pubdate data-updated="true">Aug 20<span>th</span>, 2014</time>
| <a href="/blog/2014/08/20/bubble-sort/#disqus_thread"
data-disqus-identifier="http://ambertunnell.github.io/blog/2014/08/20/bubble-sort/">Comments</a>
</p>
</header>
<div class="entry-content"><p><em>When I was learning Ruby, we never discussed sorting algorithms. It’s my understanding that most sorting algorithm problems can be solved quite easily using built-in methods in most languages. That being said, it is important to understand the different sorting techniques available in computer science. Along those lines, here’s a series of blog posts on the most common sorting algorithms!</em></p>
<p>We’ll start with Bubble Sort.</p>
<p><strong>Bubble Sort</strong> is a simple sorting algorithm.</p>
<ol>
<li>You start by comparing the first two items in an array. If the first item is larger than the second, you swap the two items.</li>
<li>Then, you compare the second and third items. If the second is larger than the third, you swap them.</li>
<li>Continue until you reach the end of the array.</li>
<li>Then, you start from the beginning again and repeat the process until you have one full pass of the array in which you did not swap any items.</li>
<li>You now have a sorted array!</li>
</ol>
</div>
<footer>
<a rel="full-article" href="/blog/2014/08/20/bubble-sort/">Read on →</a>
</footer>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2014/07/18/writing-beautiful-code-with-haml/">Writing beautiful code with haml</a></h1>
<p class="meta">
<time datetime="2014-07-18T00:25:50-04:00" pubdate data-updated="true">Jul 18<span>th</span>, 2014</time>
| <a href="/blog/2014/07/18/writing-beautiful-code-with-haml/#disqus_thread"
data-disqus-identifier="http://ambertunnell.github.io/blog/2014/07/18/writing-beautiful-code-with-haml/">Comments</a>
</p>
</header>
<div class="entry-content"><p>The more I code, the more I think of coding as an art form. Good code is easy to read by other humans, efficient, and easily adaptable. But great code is also elegant. When you look at a great piece of code, it feels <em>right</em>. Similarly, poorly written code, while often functional, just feels wrong and frustrating to look at.</p>
<p>Writing view templates using <a href="http://en.wikipedia.org/wiki/ERuby">ERB</a>, the default Rails templating language, has always seemed unnecessarily messy to me. ERB tags do not flow well with Ruby code or HTML tags. They are time-consuming to write in code. You also cannot use the <code>command-slash</code> commenting shortcut in Sublime Text with them; you must comment out each line of Ruby code separately (which makes them even more time-consuming to maintain).</p>
<p>Therefore, I was delighted when I discovered <a href="http://haml.info/">HAML (HTML abstraction markup language)</a>. A markup language that was designed to replace messy ERB templates with simpler, cleaner design. Why? Because markup should be beautiful.</p>
</div>
<footer>
<a rel="full-article" href="/blog/2014/07/18/writing-beautiful-code-with-haml/">Read on →</a>
</footer>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2014/06/29/analyzing-instance-variables-in-ruby/">Analyzing instance variables in Ruby</a></h1>
<p class="meta">
<time datetime="2014-06-29T21:26:29-04:00" pubdate data-updated="true">Jun 29<span>th</span>, 2014</time>
| <a href="/blog/2014/06/29/analyzing-instance-variables-in-ruby/#disqus_thread"
data-disqus-identifier="http://ambertunnell.github.io/blog/2014/06/29/analyzing-instance-variables-in-ruby/">Comments</a>
</p>
</header>
<div class="entry-content"><p>Instance variables in Ruby can be accessed in two ways. Directly with an @ symbol, <code>@variable</code>, or through a method call, <code>self.variable</code>. Many Rubyists think these are synonymous. However, they are not.</p>
<p>By accessing the data through the method call, you are protecting the data from being accessed directly. Therefore, if the data changes unexpectedly, you will only have to adjust the one method. If you access the data directly throughout your code, you may have to change it many times so that your code doesn’t break.</p>
<p>It is a fine distinction, but can become an incredibly important one the larger your program is.</p>
</div>
<footer>
<a rel="full-article" href="/blog/2014/06/29/analyzing-instance-variables-in-ruby/">Read on →</a>
</footer>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2014/06/15/hidden-ruby-magic-tricks/">Ruby magic</a></h1>
<p class="meta">
<time datetime="2014-06-15T17:53:07-04:00" pubdate data-updated="true">Jun 15<span>th</span>, 2014</time>
| <a href="/blog/2014/06/15/hidden-ruby-magic-tricks/#disqus_thread"
data-disqus-identifier="http://ambertunnell.github.io/blog/2014/06/15/hidden-ruby-magic-tricks/">Comments</a>
</p>
</header>
<div class="entry-content"><p>I’ve been learning Ruby for about 2-3 months now, and I’ve already fallen in love. Hard. The language is so intuitive that often I find myself trying methods in Ruby that I’ve never learned about just because I think there is a good chance they’ll work. And, often if they don’t do exactly what I thought they did, they still do something interesting that is awesome. </div>
<footer>
<a rel="full-article" href="/blog/2014/06/15/hidden-ruby-magic-tricks/">Read on →</a>
</footer>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2014/06/03/useful-ruby-resources/">Useful Ruby resources</a></h1>
<p class="meta">
<time datetime="2014-06-03T22:17:00-04:00" pubdate data-updated="true">Jun 3<span>rd</span>, 2014</time>
| <a href="/blog/2014/06/03/useful-ruby-resources/#disqus_thread"
data-disqus-identifier="http://ambertunnell.github.io/blog/2014/06/03/useful-ruby-resources/">Comments</a>
</p>
</header>
<div class="entry-content"><p>After being at <i>The Flatiron School</i> for two weeks, I’ve come to realize that it’s all in the resources. Every task can be done quicker, smarter, and better with the right resources. Considering that, here’s an on-going list of awesome resources for the beginning Rubyist that I’ve learned about so far. If you know of other great resources not yet included, mention them in the comments! </div>
<footer>
<a rel="full-article" href="/blog/2014/06/03/useful-ruby-resources/">Read on →</a>
</footer>
</article>
<div class="pagination">
<a href="/blog/archives">blog archive</a>
</div>
</div>
<aside class="sidebar">
<section>
<h1>about</h1>
<center><img style="width: 50%; border-radius: 200px; margin:5px" src="/images/ambertunnell.jpg"></center>
<p style="margin-bottom: 5px; display:inline;">Full stack web developer in New York City. </p><a href="/blog/about" style="display:inline;"> More.</a>
</section>
<section>
<h1>recent posts</h1>
<ul id="recent_posts">
<li class="post">
<a href="/blog/2014/10/07/merge-sort/">Sorting Algorithms Series: Merge Sort</a>
</li>
<li class="post">
<a href="/blog/2014/10/06/all-of-the-javascript-basic-terms-and-concepts-for-beginners/">All of the JavaScript: Basic terms and concepts for beginners</a>
</li>
<li class="post">
<a href="/blog/2014/08/23/insertion-sort/">Sorting Algorithms Series: Insertion Sort</a>
</li>
<li class="post">
<a href="/blog/2014/08/20/bubble-sort/">Sorting Algorithms Series: Bubble Sort</a>
</li>
<li class="post">
<a href="/blog/2014/07/18/writing-beautiful-code-with-haml/">Writing beautiful code with haml</a>
</li>
</ul>
</section>
<section>
<h1>categories</h1>
<ul id="categories">
<li class='category'><a href='/blog/categories/computer-science/'>computer science (3)</a></li>
<li class='category'><a href='/blog/categories/haml/'>haml (1)</a></li>
<li class='category'><a href='/blog/categories/javascript/'>javascript (3)</a></li>
<li class='category'><a href='/blog/categories/ruby/'>ruby (6)</a></li>
<li class='category'><a href='/blog/categories/sorting-algorithms/'>sorting algorithms (3)</a></li>
</ul>
</section><section>
<h1>found on</h1>
<div class="social-media-section">
<a href="https://github.com/ambertunnell" class="social-media-icon github" rel="tooltip" title="Github" target="_blank"><i class="social_media fa fa-github fa-2x"></i></A>
<a href="http://stackoverflow.com/users/3826943/amber-tunnell" class="social-media-icon stackoverflow" rel="tooltip" title="Stack Overflow" target="_blank"><i class=" social_media fa fa-stack-overflow fa-2x"></i></A>
<a href="https://careers.stackoverflow.com/ambertunnell" class="social-media-icon" class="social-media-icon" rel="tooltip" title="Stack Overflow Careers" target="_blank"><i class="social_media fa fa-stack-exchange fa-2x"></i></A>
<a href="https://linkedin.com/in/ambertunnell/" class="linkedin" class="social-media-icon" rel="tooltip" title="Linkedin" target="_blank"><i class="social_media fa fa-linkedin fa-2x"></i></A>
<a href="https://twitter.com/ambertunnell" class="twitter" class="social-media-icon" rel="tooltip" title="Twitter" target="_blank"><i class="social_media fa fa-twitter fa-2x"></i></A>
<a href="https://www.behance.net/ambertunnell" class="social-media-icon" rel="tooltip" title="Behance" target="_blank"><i class="social_media fa fa-behance fa-2x"></i></A>
<a href="http://combustingstar.deviantart.com/" class="social-media-icon" rel="tooltip" title="Deviantart" target="_blank"><i class="social_media fa fa-deviantart fa-2x"></i></A>
<a href="http://instagram.com/ambertunnell" class="social-media-icon" rel="tooltip" title="Instagram" target="_blank"><i class="social_media fa fa-instagram fa-2x"></i></A>
</div>
</section>
<section>
<h1>email me</h1>
<a href="mailto:amber.tunnell@gmail.com">amber.tunnell@gmail.com</a>
</section>
</aside>
</div>
</div>
</div>
<footer role="contentinfo"><p>
Copyright © 2014 - Amber Tunnell <br/>
<span class="credit">Powered by <a href="http://octopress.org">Octopress</a> + <a href="https://github.com/ioveracker/mnml">mnml</a>.
</span>
</p>
</footer>
<script type="text/javascript">
var disqus_shortname = 'ambertunnelloctoblog';
var disqus_script = 'count.js';
(function () {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/' + disqus_script;
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
}());
</script>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js#appId=212934732101925&xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<script type="text/javascript">
(function() {
var script = document.createElement('script'); script.type = 'text/javascript'; script.async = true;
script.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(script, s);
})();
</script>
<script type="text/javascript">
(function(){
var twitterWidgets = document.createElement('script');
twitterWidgets.type = 'text/javascript';
twitterWidgets.async = true;
twitterWidgets.src = '//platform.twitter.com/widgets.js';
document.getElementsByTagName('head')[0].appendChild(twitterWidgets);
})();
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-53821540-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</div>
<!-- hides sidebar when collapsed -->
<script> $(document).ready(function(){
$(".toggle-sidebar").click(function(){
$("aside.thirds").toggle();
});
});</script>
</body>
</html>