27

by Christian Neukirchen in Anarchaia, Wed, 27 Aug 2008 10:15:45 GMT

And it’s so sad that you’re so sad and you’re so bad for me
I followed your perfume as you ran down the street
I caught you and held you and pushed back your fringe and swore undying loyalty
— The Indelicates, New Art For The People

You have gone so far
You have gone too far
So tonight
It’s just me and the minibar
— The Dresden Dolls, Me And The Minibar

View: 27 - More entries from Anarchaia, Hacking

26

by Christian Neukirchen in Anarchaia, Tue, 26 Aug 2008 09:38:47 GMT

This train is bound for glory, this train.
This train is bound for glory, this train.
This train is bound for glory,
Don’t carry nothing but the righteous and the holy.
This train is bound for glory, this train.
— Woody Guthrie, This Train Is Bound For Glory

#ruby-de
19:18 <entropie_> fass
19:18 <jazlov> jazen: Truppenübungsplatz
19:18 <eTM> interessant
19:18 <eTM> als schimpfwort
19:18 <chris2> das ist eher für frauen, oder?
19:18 <entropie_> chris2: LOL

Who says we die?
Before we live
I promise you walls of grace
to carry on
When we’re lost
We’ll find a way
— Shiny Toy Guns, I Promise You Walls

View: 26 - More entries from Anarchaia, Hacking

25

by Christian Neukirchen in Anarchaia, Mon, 25 Aug 2008 12:01:10 GMT
#ruby-pro
19:26 <Pistos> Don't you love it when you run a spec in the morning, it fails, then you go get some lunch, run it again, and it passes…
19:26 <Pistos> Maybe the spec was just hungry?

And where is the love?
Who knows what to do?
The men and the women carry us through
Across the river, to the promised land
— Dan Bern, Where is the Love?

You are my whore, you are the one I adore,
you are the one that my twisted heart adores,
like a dog I will gnaw, like a dog I will paw,
you’re the one that my twisted heart adores.
— The Tiger Lillies, Whore

ThoughtA bookmarklet for archive.org: wayback.

View: 25 - More entries from Anarchaia, Hacking

24

by Christian Neukirchen in Anarchaia, Sun, 24 Aug 2008 10:24:29 GMT

To make a name for learning
when other roads are barred,
take something very easy
and make it very hard.
— Piet Hein, Wide Road

The Nationalists, the Socialists,
The Communists, the Capitalists
They all agree you don’t exist
And they all watch as you slash your wrists
— Tiger Lillies, Gypsy Lament

View: 24 - More entries from Anarchaia, Hacking

23

by Christian Neukirchen in Anarchaia, Sat, 23 Aug 2008 10:22:39 GMT

Any asshole can open up a museum
Put all of the things he loves on display
So everyone could see them
The house, a car, a thoughtful wife
Ordinary moments in his ordinary life
— Rilo Kiley, It’s A Hit

Wake up in the morning
I shall wake up and so shall you
And I wake up, the sun is beautiful
And it is warming you and I
Fragile as we lie
— Eisley, One Day I Slowly Floated Away

View: 23 - More entries from Anarchaia, Hacking

22

by Christian Neukirchen in Anarchaia, Fri, 22 Aug 2008 09:24:45 GMT

Don’t move so slow, don’t move so slow,
dont move so slow, dont move so slow
so move, yeah move.
I got nowhwere to go, I’ve got nowhere to go
— Tegan And Sarah, I Can’t Take It

If I had rubies and riches and crowns
I’d buy the whole world and change things around
I’d throw all the guns and the tanks in the sea
For they are mistakes of a past history.
Let me die in my footsteps
Before I go down under the ground.
— Bob Dylan, Let Me Die In My Footsteps

View: 22 - More entries from Anarchaia, Hacking

21

by Christian Neukirchen in Anarchaia, Thu, 21 Aug 2008 11:27:42 GMT

I laid with you for hours
Staring at your face
I laid with you for hours
Remembering your taste
— The Glove, Mouth To Mouth

Thank you for the warning
But I still see inside
A little global warming
Never hurt no one
— Dresden Dolls, The Gardener

View: 21 - More entries from Anarchaia, Hacking

20

by Christian Neukirchen in Anarchaia, Wed, 20 Aug 2008 09:55:53 GMT

She will crush you, she’ll excite you
She’ll destroy you, she’ll ignite you
She’ll take you to a world of darkness
And death, and death!
— Inkubus Sukkubus, All Along The Crooked Way

People are crazy and times are strange
I’m locked in tight, I’m out of range
I used to care, but things have changed
— Bob Dylan, Things Have Changed

View: 20 - More entries from Anarchaia, Hacking

19

by Christian Neukirchen in Anarchaia, Tue, 19 Aug 2008 09:52:50 GMT

Not every pain hurts
Deep inside
When you learn to divide
Don’t fear the danger
Follow your heart to the light
Live your dream and learn to carry on
— Lacrimosa, Not Every Pain Hurts

I really don’t care and neither does he
If this hotel melts into the sea
Polished and so rare, this is the way that we see.
The coldness helps, it’s our favorite remedy.
— Rasputina, The New Zero

View: 19 - More entries from Anarchaia, Hacking

18

by Christian Neukirchen in Anarchaia, Mon, 18 Aug 2008 09:35:09 GMT

And it’s been a long time
Which agrees with this watch of mine
And I know that I miss you
and I’m sorry if I dissed you
— Modest Mouse, Trailer Trash

If it doesn’t kill you
It will shape you
If it doesn’t break you
It will make you
— Siouxsie Sioux, If It Doesn’t Kill You

View: 18 - More entries from Anarchaia, Hacking

17

by Christian Neukirchen in Anarchaia, Sun, 17 Aug 2008 11:33:47 GMT

Now you are punished
For absolutely nothing
And I feel so good
Because once more
I don’t have to be honest
— The Gathering, Locked Away

ThoughtWrite a procmail script to summarize your lottery spam winnings.

All the sense you are capable of
does not seem to save you
You heed the glance of a smile
Was it impossible to float for a while?
— The Gathering, Amity

View: 17 - More entries from Anarchaia, Hacking

16

by Christian Neukirchen in Anarchaia, Sat, 16 Aug 2008 10:30:58 GMT

I wish I was a mole in the ground
Yes I wish I was a mole in the ground
If I’s a mole in the ground I’d root that mountain down
And I wish I was a mole in the ground
— I Wish I Was A Mole In The Ground

I want four young ladies to bear up my coffin,
I want three young maidens to carry me on,
And each of them carry a bunch of wild roses,
To lay on my body as I pass along.
— Rally Wood, One Morning in May

View: 16 - More entries from Anarchaia, Hacking

Threaded XMLHttpRequest In Shoes

by why in Hackety org, Fri, 15 Aug 2008 17:36:59 GMT

Threads can be tough and don’t suit beginners very well. And, well, Ruby threads can tie up the main app thread.

So, Shoes steals the underpinnings of Ajax to give you asynchronous downloads without needing to get into threading. Many of the young Sneakers are building Twitter and Flickr apps; it seemed the morally upright thing to do. In addition, I was able to use these HTTP threads to load remote images in the background. So, in Shoes, images loaded from the web will appear as they load.

Here’s the simple-downloader.rb from the samples that come with Shoes:

To achieve this, Shoes uses platform code for both threading and HTTP. On Windows, CreateThread and WinHTTP. On Linux, pthread and curl. And, on OS X, NSDownload and NSThread.

Downloading is reduced to a single line:

Shoes.app { download "http://shoooes.net/shoes.png", :save => "shoes.png" }

This happens asynchronously, so shoes.png won’t be there yet when this method ends. It might be huge. It might appear an hour later. You can attach a finish event to be notified when the download is complete.

Shoes.app do
  download "http://shoooes.net/shoes.png", :save => "shoes.png" do |dl|
    alert "Scuse me. Your shoes.png has arrived."
  end
end

Omit the :save option and you can get back the download as a string.

Shoes.app do
  download "http://hacketyhack.net/pkg/osx/shoes" do |dl|
    alert "The latest OS X download is: #{dl.response.body}"
  end
end

You can also attach :method, :headers and :body options to the download, if you want to customize the request beyond that. I studied XMLHttpRequest closely and tried to be sure the same things could be done with this.


As for events, you get four of them: start, progress, finish and error. You can either pass proc objects in as options:

Shoes.app do
  url = "http://shoooes.net/dist/shoes-0.r905.exe"
  status = para "Downloading #{url}"

  download url, :save => "shoes.exe",
    :start => proc { |dl| status.text = "Connecting..." },
    :progress => proc { |dl| status.text = "#{dl.percent}% complete" },
    :finish => proc { |dl| status.text = "Download finished" },
    :error => proc { |dl, err| status.text = "Error: #{err}" }
end

Or, use the method syntax:

Shoes.app do
  url = "http://shoooes.net/dist/shoes-0.r905.exe"
  status = para "Downloading #{url}"

  get = download url, :save => "shoes.exe"
  get.start { |dl| status.text = "Connecting..." }
  get.progress { |dl| status.text = "#{dl.percent}% complete" }
  get.finish { |dl| status.text = "Download finished" }
  get.error { |dl, err| status.text = "Error: #{err}" }
end

The last thing I will mention is that every queued download is attached to the window containing it. When you close the window, the download stops. So, if you’re queueing a download from a temporary popup, be sure to queue it on the main app window.

15

by Christian Neukirchen in Anarchaia, Fri, 15 Aug 2008 09:25:54 GMT

This is the hammer that killed John Henry
Won’t kill me, won’t kill me, won’t kill me
This is the hammer that killed John Henry
Won’t kill me, won’t kill me, won’t kill me
— Spike Driver Blues

Oh death, where thy sting? Oh grave, where is thy victory?
You thought you had a hold on me but you were wrong, I’ve been set free
— Randy Travis, Oh Death

View: 15 - More entries from Anarchaia, Hacking

14

by Christian Neukirchen in Anarchaia, Thu, 14 Aug 2008 09:55:41 GMT

Torn between two lovers, feelin’ like a fool
Lovin’ both of you is breakin’ all the rules
Torn between two lovers, feelin’ like a fool
Lovin’ you both is breakin’ all the rules
— Mary MacGregor, Torn Between Two Lovers

On a rainy day
and as the world will blow to bits
I’ll cradle you and hold you tight
— Eels, Something Is Sacred

View: 14 - More entries from Anarchaia, Hacking

 

Hacking

Great ideas for hackers, interesting solutions to problems, geeky stuff

Feeds