Logo

Who is talking?

Archive

Pointers in C and x86 Assembly Language

10 months ago | Pat Shaughnessy: Pat Shaughnessy

16GB of DDR random access memory my son used in his new gaming PC Recently I’ve been trying to learn how to read x86 assembly language. In http://patshaughnessy.net/2016/11/26/learning-to-read-x86-assembly-lang

Learning to Read x86 Assembly Language

12 months ago | Pat Shaughnessy: Pat Shaughnessy

A 16-bit Intel 8086 microprocessor from 1978 (source: RodolfoNeres via Wikimedia Commons) Writing assembly language is

Need a Second Opinion on Your Ruby Code? Ask Crystal

about 1 year ago | Pat Shaughnessy: Pat Shaughnessy

Running the Crystal compiler on your Ruby codeis like asking a second doctor for their opinion. When it comes to your health, you don’t hesitate to get a second opinion. Doctors don’t always agree, and a second doctor’s app

Two Dumb Ruby Mistakes

over 1 year ago | Pat Shaughnessy: Pat Shaughnessy

Coding is like climbing: You need equipment that will catch you when you make a mistake. (source: Elke Wetzig via Wikimedia Commons)

Is Your Postgres Query Starved for Memory?

almost 2 years ago | Pat Shaughnessy: Pat Shaughnessy

Like a patient with low blood pressure, a slow SQL query might not be getting the memory it needs. For years or even decades, I’ve heard about how important it is to optimize my SQL statements and database schema.

A Look at How Postgres Executes a Tiny Join

almost 2 years ago | Pat Shaughnessy: Pat Shaughnessy

Reading the Postgres source code is like attending a free Computer Science lecture, complete with working examples. Aside from saving and retrieving data, the primary feature of a relational database is the ability

What Do Perl and Go Have in Common?

about 2 years ago | Pat Shaughnessy: Pat Shaughnessy

TL/DR: Both Perl and Go only partially implement object oriented programming, in a confusing way. Using either language you can create structures equivalent to objects but without using keywords such as class or new. Converting a Go function into a method by adding a receiver reminds me of “blessing” a Perl has

Don’t Let Your Data Out of the Database

over 2 years ago | Pat Shaughnessy: Pat Shaughnessy

Don’t let your data escape from your database and cause unintended performance mistakes. Keep your data in the database, not for security reasons but to avoid performance mistakes. Often the best way to speed up your applicati

Mark Methods Private When You Don’t Test Them

almost 3 years ago | Pat Shaughnessy: Pat Shaughnessy

My father in law once lived in same building where Picassowas born, near the Plaza de la Merced in Málaga, Spain. In Ruby and many other languages, you write private methods to implement internal logic you don’t want

Using Rake to Generate a Blog

almost 3 years ago | Pat Shaughnessy: Pat Shaughnessy

Jim Weirich showing a real power rake at GORUCO 2012 Last year I needed to replace the software I use to serve this web site. Instead of just using h

Koichi Sasada Encourages Us To Contribute To Ruby

almost 3 years ago | Pat Shaughnessy: Pat Shaughnessy

Ruby処理系開発コミュニティは、あなたの挑戦を歓迎する。 The Ruby core community welcomes your challenge. Today I’m happy to post an English translation of a new appendix to Ru

Matz’s Foreword to Ruby Under a Microscope

almost 3 years ago | Pat Shaughnessy: Pat Shaughnessy

A Japanese translation of Ruby Under aMicroscope was published last month. Matz wrote a new foreword to http://patshaughnessy.net/ruby-under-a-micros

Discovering the Computer Science Behind Postgres Indexes

about 3 years ago | Pat Shaughnessy: Pat Shaughnessy

Captain Nemo and Professor Aronnax discussing theengineering and science behind the Nautilus. This is the last post in a series based on a presentation I did at the Barcelona

Following a Select Statement Through Postgres Internals

about 3 years ago | Pat Shaughnessy: Pat Shaughnessy

Captain Nemo takes Professor Aronnax on a tourof the engine room, a fascinating descriptionof future technology from an 1870 perspective. This is the third of a series of posts based on a presentation I did at the

How Arel Converts Ruby Queries Into SQL Statements

about 3 years ago | Pat Shaughnessy: Pat Shaughnessy

In one of the climactic scenes in 20,000 Leagues Under theSea, Captain Nemo and his crew battle a giant octopus. This is the second in a serie

20,000 Leagues Under ActiveRecord

about 3 years ago | Pat Shaughnessy: Pat Shaughnessy

First published in 1870, 20,000 Leagues Under the Seadescribes an underwater adventure that takes placeonboard a submarine called the “Nautilus.”

A Rule of Thumb for Strong Parameters

over 3 years ago | Pat Shaughnessy: Pat Shaughnessy

It can be hard to open the Strong Parametersdoor and let permitted values into your Rails 4 app. Last week I banged my head against the wall for a few hours trying to figure out how to whitelist input values for my Rails 4 app

Using a Ruby Class To Write Functional Code

over 3 years ago | Pat Shaughnessy: Pat Shaughnessy

The time sheets I used at my first programming job in the Summer of 1986 looked just like this. Recently I’ve been spending some of my free time studying Clojure and Haskell. I’ve been learning how a program built with a

Use An Ask, Don’t Tell Policy With Ruby

almost 4 years ago | Pat Shaughnessy: Pat Shaughnessy

Innisfree is an actual island in Lough Gill, County Sligo, Ireland The next time you need to develop a new algorithm, ask Ruby for what you want, don’t tell it what to do. Don’t think of your code as a series of instructions for t

What does (((λ f . (λ x . (f x))) (λ a . a)) (λ b . b)) mean?

almost 4 years ago | Pat Shaughnessy: Pat Shaughnessy

This week I’ve been spending some free time between projects working on my function programming skills. I’m a Ruby developer but have always been fascinated by functional languages such as Haskell, Clojure and of course Lisp. I was excited this morning when I stumbled across a fascinating article called 7 lines of code

Ruby Multiplies Like a Fourth Grader

almost 4 years ago | Pat Shaughnessy: Pat Shaughnessy

Ruby multiplies large integers using the same algorithm we learned in elementary school. Imagine yourself as an 8 or 9 year old at a chalkboard learning to multiply. Your teacher asks you to write one number over anothe

How Big is a Bignum?

almost 4 years ago | Pat Shaughnessy: Pat Shaughnessy

Ruby represents small integers using Fixnum and large integers using Bignum. Most of us don’t use Ruby to perform complex calculations for science, engineering or cryptography applications; instead, we migh

Three RubyConf Surprises

almost 4 years ago | Pat Shaughnessy: Pat Shaughnessy

This year RubyConf was an inspiring, enthusiastic and fun experience. If you weren't lucky enough to be able to attend in person, I would highly recommend taking a look at http://rubyconf13.multifacete

Expanded Ruby Under a Microscope Available in Print!

about 4 years ago | Pat Shaughnessy: Pat Shaughnessy

Order your copy today at NoStarch.com. Use coupon code LENS to get a 40% discount! I’m happy to announce Ruby Under a Microscope

Generational GC in Python and Ruby

about 4 years ago | Pat Shaughnessy: Pat Shaughnessy

Both the Ruby and Python garbage collectors handle old and young objects differently. Last week I wrote u

Visualizing Garbage Collection in Ruby and Python

about 4 years ago | Pat Shaughnessy: Pat Shaughnessy

Note: This post is based on a presentation I just did at RuPy in Budapest. Instead of just posting my slides I thought it would be more useful if I wrote it down as a blog post while it’s still fresh in my mind. I’ll post the video link here when the RuPy folks have it online. FYI I’m planning to do a http://rubyconf.org/program#pat-sha

Ruby’s Top Self Object

about 4 years ago | Pat Shaughnessy: Pat Shaughnessy

Creating functions without a class is awkward in Smalltalk, but simple in Ruby. Much of Ruby’s implementation of objects and classes is modeled after Smalltalk, one of the original object oriented languages first built in the

RubyKaigi: Making a Japanese Conference Accessible to the World

over 4 years ago | Pat Shaughnessy: Pat Shaughnessy

Note: I co-wrote this article with Chris Salzberg, an Canadian Rubyist living in Japan who attended RubyKaigi. For the first time, RubyKaigi offered simultaneous translation from Japanese to English

Meet Fifteen Ruby Core Committers

over 4 years ago | Pat Shaughnessy: Pat Shaughnessy

We all know Yukihiro Matsumoto invented Ruby, but how many of the other people behind Ruby can you name? Judging from this photo taken just a few weeks ago at RubyKaigi 2013, the Ruby 2.0 release was a real team effort, with commits both from the people on stage in Tokyo and hundreds of other open source developers located around the world.

Coming This Fall: “Ruby Under a Microscope” Updated and in Print

over 4 years ago | Pat Shaughnessy: Pat Shaughnessy

With almost 200 diagrams, my 2012 eBookis an illustrated guide to Ruby internals

Ruby, Python, Java, C and Programmer Happiness

over 4 years ago | Pat Shaughnessy: Pat Shaughnessy

  “Ruby is designed to make programmers happy.” - Yukihiro “Matz” Matsumoto Not everyone might agree, but as a Rubyist I think Matz achieved his design goal. There’s something intangible about Ruby’s syntax that makes it fun,

Ruby’s Missing Data Structure

over 4 years ago | Pat Shaughnessy: Pat Shaughnessy

Have you ever noticed Ruby doesn’t include support for linked lists? Most computer science textbooks are filled with algorithms, examples and exercises based on linked lists: inserting or removing elements, sorting lists, reversing lists, etc. Strangely, however, there is no linked list object in Ruby…

Ruby 2.0 Works Hard So You Can Be Lazy

over 4 years ago | Pat Shaughnessy: Pat Shaughnessy

Lazy enumeration isn’t magic;it’s just a matter of hard work Ruby 2.0’s new lazy enumerator feature seems like magic. In case you haven’t

An Interview With Laurent Sansonetti

almost 5 years ago | Pat Shaughnessy: Pat Shaughnessy

Laurent Sansonetti created RubyMotion It was only last April when Laurent Sansonetti captured the imagination of the

Ruby MRI Source Code Idioms #3: Embedded Objects

almost 5 years ago | Pat Shaughnessy: Pat Shaughnessy

Last year I wrote a post about how the core team optimized Ruby to process shorter strings faster than longer strings. I found that Ruby strings containing 23 or fewer characters are much faster. Why am I bringing this up again now? Well, it turns out this isn’t a single optimization that the core team has added for

Ruby MRI Source Code Idioms #2: C That Resembles Ruby

almost 5 years ago | Pat Shaughnessy: Pat Shaughnessy

Reading Ruby’s C source code can beas easy as reading your own Ruby code

Ruby, Smalltalk and Class Variables

almost 5 years ago | Pat Shaughnessy: Pat Shaughnessy

Many of the ideas behind Ruby’s object modelwere developed for Smalltalk in the 1970s. A couple weeks ago [an article by Ernie

An Interview With Jim Weirich

almost 5 years ago | Pat Shaughnessy: Pat Shaughnessy

This appeared on RubySource.com last week; just getting around to posting a link to the interview here also…. Jim Weirich is the Chief Scientist at Neo

A High Level Code Walk Through Ruby MRI

almost 5 years ago | Pat Shaughnessy: Pat Shaughnessy

Watch it now on rubyinside.com! Have you ever thought about taking at look at Ruby’s internal C source code,