How tar -zcf works
by @uaiHebert
#truth

oozey mess
todays bird
cherry valley forever
occasionally subtle
NASA
Cosmic Funnies
I'd rather be in outer space 🛸
noise dept.
Mike Driver

gracie abrams
Keni

Jar Jar Binks Fan Club
No title available
EXPECTATIONS

if i look back, i am lost
🩵 avery cochrane 🩵

shark vs the universe
official daine visual archive
YOU ARE THE REASON
ojovivo
seen from United States

seen from Netherlands

seen from United States

seen from United Kingdom
seen from Netherlands
seen from United States
seen from Georgia
seen from Austria
seen from United Kingdom
seen from Belgium

seen from United States

seen from United Kingdom

seen from United Kingdom
seen from Maldives
seen from Indonesia
seen from Bangladesh

seen from Netherlands
seen from United Kingdom

seen from United Kingdom

seen from Kenya
@marcadams-blog
How tar -zcf works
by @uaiHebert
#truth
How high can you count on your fingers?
How high can you count on your fingers? It seems like a question with an obvious answer. After all, most of us have ten fingers, or to be more precise, eight fingers and two thumbs. This gives us a total of ten digits on our two hands, which we use to count to ten.
It’s no coincidence that the ten symbols we use in our modern numbering system are called digits as well. But that’s not the only way to count. In some places, it’s customary to go up to twelve on just one hand. How? Well, each finger is divided into three sections, and we have a natural pointer to indicate each one, the thumb. That gives us an easy to way to count to twelve on one hand.
And if we want to count higher, we can use the digits on our other hand to keep track of each time we get to twelve, up to five groups of twelve, or 60.
Better yet, let’s use the sections on the second hand to count twelve groups of twelve, up to 144.
That’s a pretty big improvement, but we can go higher by finding more countable parts on each hand. For example, each finger has three sections and three creases for a total of six things to count. Now we’re up to 24 on each hand.
And using our other hand to mark groups of 24 gets us all the way to 576. Can we go any higher? It looks like we’ve reached the limit of how many different finger parts we can count with any precision. So let’s think of something different.
One of our greatest mathematical inventions is the system of positional notation, where the placement of symbols allows for different magnitudes of value, as in the number 999. Even though the same symbol is used three times, each position indicates a different order of magnitude. So we can use positional value on our fingers to beat our previous record. Let’s forget about finger sections for a moment and look at the simplest case of having just two options per finger, up and down. This won’t allow us to represent powers of ten, but it’s perfect for the counting system that uses powers of two, otherwise known as ‘binary’.
In binary, each position has double the value of the previous one, so we can assign our fingers values of 1, 2, 4, 8…all the way up to 512. And any positive integer, up to a certain limit, can be expressed as a sum of these numbers. For example, the number seven is 4+2+1. So we can represent it by having just these three fingers raised. How high an we go now? That would be the number with all ten fingers raised, or 1,023. Is it possible to go even higher? It depends on how dexterous you feel! If you can bend each finger just halfway, that gives us three different states -down, half bent, and raised. Now, we can count using a base-three positional system, up to 59,048. And if you can bend your fingers into four different states or more, you can get even higher. That limit is up to you, and your own flexibility and ingenuity.
Even with our fingers in just two possible states, we’re already working pretty efficiently. In fact, our computers are based on the same principle. Each microchip consists of tiny electrical switches that can be either on or off, meaning that base-two is the default way they represent numbers. And just as we can use this system to count past 1,000 using only our fingers, computers can perform billions of operations just by counting off 1’s and 0’s.
From the TED-Ed Lesson How high can you count on your fingers? (Spoiler: much higher than 10) - James Tanton
Animation by TED-Ed
When a programmer and designer meet on tinder
Gold
Omg this is so awesome! Excited for more!
This is so interesting! I cant wait for more!
Omg this is so interesting! Im excited to do more!
Using NewRelic RPM in Grails Development
If you've never used NewRelic before, you're definitely missing out. It's a very nicely organized and detailed tool for profiling and monitoring your Java/Ruby/PHP etc; project.
If you're developing a Java application, there is helpful documentation to get you going.
However, if you want to use it to profile and monitor your Grails application development, you need to tell Grails to load the agent.
When you run grails run-app on your project, Grails uses it's own built in Tomcat server to serve your application up to you, what it also does, is look for an environment variable called GRAILS_OPTS, if it exists, it uses that to bootstrap the Tomcat instance it runs locally. If it doesn't exist, it uses default settings:
[code lang="powershell"] if [ -n "$GRAILS_OPTS" ] then GRAILS_OPTS="$GRAILS_OPTS" else GRAILS_OPTS="-server -Xmx512M -XX:MaxPermSize=192m -Dfile.encoding=UTF-8" fi [/code]
So, to setup your Grails development environment to use the NewRelic RPM agent do the following:
[code lang="powershell"] export GRAILS_OPTS="-server -Xmx512M -XX:MaxPermSize=192m -Dfile.encoding=UTF-8 -javaagent:/full/path/to/newrelic.jar -Dnewrelic.environment=development" [/code]
The -Dnewrelic.environment=development part is important as it tells the agent to set itself up in development mode, which has a higher memory footprint but more information collected.
Hope that helps!
Speed Quarters
Does your browser keep zooming the text size using a multi-touch trackpad?
Even though you can disable the zooming on your mighty mouse, MBP trackpad or fancy Apple Trackpad, browsers don't want you to be able to disable text zooming. That is a thing of the past, check out this awesome post: http://blog.kenneth.io/2010/10/17/how-to-disable-accidentally-text-zooming-in-browsers-when-using-magic-trackpadmouse-in-osx/comment-page-1/#comment-120
Running your Grails app in the root context
Typically when you run your Grails app in development mode, it runs on the address http://localhost:8080/{app-name}
Should you want to run it in the root context, i.e. http://localhost:8080/ just add the following line to your application.properties:
[code lang="plain"]app.context=/[/code]
Ta da! magic.
Automatic timestamp fields in Grails, just like Ruby on Rails
Granted it's not as slick as Ruby on Rails but you can get Grails to automatically handle your created and updated timestamps for domain model records.
In RoR the t.timestamps statement in your migration file will handle it, in Grails it's just slightly different:
in your domain model groovy class add: [code lang="groovy"] class User {
String firstName String lastName Date dateCreated Date lastUpdated
String toString() { "$firstName $lastName" }
static constraints = { firstName() lastName() } } [/code]
Specifically lines 5 and 6. As long as you have the dateCreated and the lastUpdated properties in your class, Grails will do the dirty work.
You could also use the beforeInsert and beforeUpdate class methods, but that'd defeat the purpose of using the framework!
Setting JAVA_HOME in OSX Snow Leopard
[code lang="plain"]export JAVA_HOME=$(/usr/libexec/java_home)[/code]
TextMate Minimap (AKA: Where have you been all my life?)
I'm an unapologetic Apple fanboy user. Using OS X has many advantages over using Windows; for everyday tasks and software development.
One of the treasures of using OS X is TextMate. It's a very robust, enjoyable and productive tool for writing software.
Today it just got better with TextMate-Minimap.
Normally, I try to keep my code files short and succinct. Having really long source code files is indicative that you need to break it down into more logical chunks. That's not always the case however, especially when dealing with HTML or XML files. One issue is having to navigate to different parts of a long file - scrolling up and down etc; Bookmarks are a good start, but sometimes you don't know the exact line you need to find, you're just looking to move to a section of the file.
Enter TextMate-Minimap:
It shows an overview of your document on the side of the editor window and you can click a section of the overview or drag your mouse along it to scroll-seek.
Very very cool.
Rails Project Template - Authlogic-esque
I've jumped on the Rails template bandwagon...
I started with authlogic.rb, a template designed to setup a rails project with authlogic. Including rspec, factory girl and associated tests. It also uses the fantastic web-app-theme plugin as a default view layout.
I wish there was a standard way to break up all the file templates, like a generator, so that they're not all in one file. I could write that kind of framework but that would kind of defeat the purpose of the quick template setup.
Regardless, it's a pretty swanky system and makes it pretty easy to have a standard template ready to go for rails projects.
Rails migration file timestamp
If you've been looking to generate your own migration file using Rails templates and don't want to hardcode the timestamp, use this:
[code lang='ruby'] Time.now.utc.strftime('%Y%m%d%H%M%S') [/code]
Truncating a string in JavaScript
You don't need to install a jQuery plugin to truncate a string using javascript. That's just overkill.
Let's use the javascript prototype shall we?
[code lang="js"] String.prototype.truncate = function(length) { if (this.length > length) { return this.slice(0, length - 3) + "..."; } else { return this; } }; [/code]
Simple enough, now we can call "truncate" on any string object:
[code lang="js"] // We'll need a long string var str = "Pointing to a graphic of a spider's silk-spinning organ projected on a giant screen, scientist Cheryl Hayashi said, \"That\'s the business end of a spider,\" drawing laughs from hundreds in the TED2010 conference audience. \"Hey don\'t laugh, that\'s my life.\"";
// Now print out the truncated string document.write(str.truncate(100); [/code]
What you should end up with is:
Pointing to a graphic of a spider's silk-spinning organ projected on a giant screen, scientist Ch...
The ellipsis could be optional I suppose, but then it wouldn't look as intentional I think.
Using the show_to helper from acl9 in your views
If you've been trying to figure out how to use the show_to helper built into acl9 it's really quite easy.
Open up app/helpers/application_helper.rb and include Acl9Helpers:
[code lang="ruby"] module ApplicationHelper include Acl9Helpers end [/code]
Specifically line #2. Enjoy!