Logo

Who is talking?

Archive

Audit trails for Rails application: with audit_rails gem

almost 5 years ago | Gourav Tiwari: easy_software = Agile.find(ruby_on_rails)

In my current project, there is a requirement to audit user actions, most of which are not model crud operations (more or less like omniture, but this is not a replacement to omniture).So, I looked for a gem which allow me to audit user actions from controller/view as opposed to mode crud operation and I ended up writing audit_rails.This gem provides:Audits based on controller actionsLink tracking for external/internal linksUser login actions (once per-day)Export audit report in excelHere is the link to github repo. I hope this will save someone the pain of re-inventing the wheel.

Audit trails for Rails application: with audit_rails gem

almost 5 years ago | Gourav Tiwari: easy_software = Agile.find(ruby_on_rails)

In my current project, there is a requirement to audit user actions, most of which are not model crud operations (more or less like omniture, but this is not a replacement to omniture).So, I looked for a gem which allow me to audit user actions from controller/view as opposed to mode crud operation and I ended up writing audit_rails.This gem provides:Audits based on controller actionsLink tracking for external/internal linksUser login actions (once per-day)Export audit report in excelHere is the link to github repo. I hope this will save someone the pain of re-inventing the wheel.

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

Um, hi!

almost 5 years ago | Queenie Takes Manhattan: Queenie Takes Manhattan

Hello, my darlings, my doves, my gentle readers. I know, I know - it's been ages. In my defense, the last couple of months have been among the busiest in recent memory, complete with 16 hour workdays, two weeks in Austin, a quick business trip to Chiacgo...and so on.But, but, but! I had no intention of abandoning you, and I have every intention of putting things right. With that in mind, here are a couple of the remarkably delicious things I've enjoyed over the last ten weeks, along with a promise: I'll be back soon in full force.Honest. Three pea salad from Ottolenghi's Plenty.   Shrimp mole from Frontera Grill in Chicago.Plateau de fruits de la mer at Clark's in Austin.Antonelli's Cheese Shop in Austin.Rib-eye fried rice at Elizabeth Street Cafe in Austin.Chicken salad sandwich with gribenes and homemade pickles at Mile End Sandwich Shop.

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

Backbone.js and CoffeeScript - A Perfect Match

almost 5 years ago | Rocky Jaiswal: Still Learning

As I started learning more about JavaScript I was very impressed with CoffeeScript. It felt like JavaScript done right! But with time, as my JavaScript concepts improved I was a bit reluctant to write CoffeeScript. “Why learn one language that produces...

The Unofficial Guide to Rich Hickey's Brain

almost 5 years ago | Daniel Higginbotham: Flying Machine Studios

The Rich Hickey Function Part of my excitement in learning Clojure has been being exposed to Rich Hickey's thoughts on programming. Rich Hickey has a clear, consistent way of viewing fundamental programming concepts that I think any programmer would benefit from. Every time I watch one of his talks, I feel like someone has gone in and organized my brain. In this article (and more to come (possibly)), I begin my attempt to catalog Mr. Hickey's unique viewpoint. Eventually, I would like to produce a concise summary of his ideas. My hope is that this will provide an easily-scannable reference to Clojurists and an accessible introduction to non-Clojurists. What follows is derived from Rich Hickey's talk, "Are we there yet?" Introduction Today's OOP languages - Ruby, Java, Python, etc. - are fundamentally flawed. They introduce accidental complexity by building on an inaccurate model of reality. Where they have explicit definitions for the following concepts, the definitions are wrong: Value State Identity Time Behavior Below, we'll contrast the OOP viewpoint on each of these topics with the Functional Programming viewpoint. But first, we'll compare the models of reality which underlie OOP and FP. It's this underlying difference which gives rise to their different approach to the topics above. Metaphysics, Programming, and You: Comparing OOP and FP When talking about metaphysics things tend to get a little fuzzy, but hopefully this will all make sense. As the ever-trusty Wikipedia explains, metaphysics attempts to answer two basic questions in the broadest possible terms: What is there? What is it like? Rich Hickey explains the difference between OOP and FP metaphysics by contrasting their explanations of what a river is. Object Oriented Programming In OOP metaphysics, a river is something which actually exists in the world. I know, I know, I can hear what you're saying: "Uh... yeah? So?" But believe me, the accuracy of that statement has caused many a sleepless night for philosophers. The wrinkle is that the river is always changing. Its water never ceases to flow. In OOP terms, we would say that it has mutable state, and that its state is ever fluctuating. The fact that the state of the River Object and that Objects in general are never stable doesn't stop us from nevertheless treating them as the fundamental building blocks of programs. In fact, this is seen as an advantage of OOP - it doesn't matter how the state changes, you can still interact with a stable interface and all will work as it should. An object can change, but to all observers it is still considered the same object. This conforms to our intuitive sense of the world. The position of the electrons of the coffee in my mug matters naught; the coffee still interacts with my taste buds in the way I expect. Finally, in OOP, objects do things. They act on each other. Again, this conforms to our intuitive sense of the world: change is the result of objects acting upon each other. A Person object pushes on a Door object and enters a House object. Functional Programming FP Metaphysics In FP metaphysics, we would say that we never step in the same river twice. What we see as a discrete thing which actually exists in the world independent of its mutations is in reality a succession of discrete, unchanging things. The "river" is not a thing in and of itself; it's a concept that we superimpose on a succession of related phenomena. This concept is very useful - I won't belabor that point - but it is just a concept. What really exists are atoms (in the sense of atomic, unchanging, stable entities) and processes. The river is not a stable object; rather, it is a succession of related atoms which are generated by some kind of process. These atoms don't act upon each other and they can't be changed. They can't do anything. Change is not the result of one object acting on another; change is the result of a process being applied to an unchangeable atom. To say that something has changed is to say, "Oh, there's a new atom in this stream of atoms." It's like saying that HEAD points to a new commit in your Git repo. OK! Enough with metaphysics. Now let's describe the more immediately useful topics, starting with Value. Value It's obvious that numbers like 3 and 6 and 42 are values. Numbers are stable, unchanging. It should also be obvious that OO languages have "no proper notion" of values in this sense. As Rich Hickey points out, you can create a class whose instances are composed of immutable components, but there is no high-level concept of immutable value implemented as a first class construct within the class. This is one of the main causes of headaches when doing OOP. How many times have you pulled your hair out trying to figure out how an object's attribute got changed? The fact is, in OO languages there is no built-in mechanism to ensure that the object you're dealing with is stable. This is the big reason why concurrent programming is so difficult. Even in single-threaded programs this is a problem, and it's one of the reasons why we develop sprawling test suites. You can't be sure if a method call on your Toupee object is somehow going to cause a change in your HipsterGlasses object. By contrast, in FP languages emphasis is placed on working with immutable values. Since these values can't change, a whole class of problems simply disappears. Identity In the video, Mr. Hickey says: The biggest problem we have is we've conflated two things. We've said the idea that I attach to this thing that lasts over time is the thing that lasts over time. In FP, identity is essentially a name we give to a sequence of related atoms. "River" refers to the sequence R1, R2, R3, etc, produced by the river process. This is directly analogous to HEAD in Git - it's just a name which is used to refer to actual values. In OO, there really isn't such a distinction. Or as the man himself says, Identity is a putative entity we associate with a series of causally related values (states) over time. It's a label, a construct we use to collect a time series. State In OO, there is no real clear definition of state. Maybe it's, "the values of all the attributes within an object right now." And it has to be "right now", because there's no language-supported way of holding on to the past. This becomes clearer if you contrast it with the notion of identity in FP. In the Hickeysian universe, a State is a specific value for an identity at a point in time. (For me, this definition really clarified my own thoughts.) Time There's no real notion of time in OO. Everything's just "right now". This is part of what causes problems in concurrent programs. By contrast, in the FP worldview we've been exploring, time is well-defined. Time is a by-product of ordering states within an identity. (By the way, I'd really like to write more here, and would appreciate any suggestions.) Behavior Finally, behavior. I don't have too much to write here - I might need to watch some more talks - but I'll include Mr. Hickey's thought-provoking observation: There is no behavior. When you get hit by lightning, who's behaving? This may be what inspired Steve Yegge's post, Execution in the Kingdom of Nouns. The End Well, that's it for now. I hope you've found this post useful. If you have any suggestions, I'd love to hear them!

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,

My Failed(?) Social Web Experiment Still Haunts Me

almost 5 years ago | Daniel Higginbotham: Flying Machine Studios

What will people post if they can't include links and can't use a nickname? This was the question I was looking to answer back in 2007 I launched nobodynotes.com. It was a very simple web site, consisting mainly of a text field and all the posts which people had entered in the text field. You can see it, unstyled, thanks to the wayback machine. Initially, the posts were interesting to me, but probably unremarkable to anyone else. Bits of poetry, parts of song, random curses. But then something unexpected happened. More and more of the posts were written in Persian. Persian!? How did that happen? When I looked at Google Analytics, it showed that the majority of my visits were from Iran, and that most of my visitors were referred from Yahoo Mail. This was not something that I had anticipated. It seemed like the site was going viral in Iran, with people emailing it to each other specifically in Yahoo Mail. Going through the site, I noticed that some of the posts referenced others; each post had a number, and visitors would specify the number of the post they were replying to. But why? Why all this activity from Iranians? I wanted to know, but sadly had no direct way of finding out. After all, everyone was anonymous. Not knowing what else, to do, I tried using Google Translate to see what people were saying. One post in particular stood out. It's probably irretrievable now, but a young man essentially wrote, "Help, I am a gay man living in Iran. I cannot tell anyone, or I will be killed. Please, someone help me." To this day, that post haunts me. Who was this young man? Was he able to find help? Where is he today, and is he OK? I doubt I'll ever know the answer. I eventually shut down the site as traffic slowed to a trickle. But pieces of it remain. It was connected to a twitter account, where you can still read fragments of those posts by anonymous Iranians. And there's the wayback machine, which offers larger slices of conversation. And there's Google Translate, offering me its demented assistance in trying to understand what was happening a world away: Staring at the horizon, leaving the logo side of life, rectified love sitting in contemplation, madness, stood an innocent face, a tired face , relying on the fact, sad face smiling at what an idea! that madness pounding deep into each side. .