Every once in a while, despite your grime, your gang graffiti on every wall, your drunks pissing in alleys, and your abject antipathy to shoveling snow or even putting your trash in actual trash bins, you manage to be quite nice. Thanks for the sunset this evening.
Rufus has been helping out around the home office: providing moral support, slobbering on pant legs, and conducting some thought-leadership workshops (read: napping for hours on end). He’s a real team player.
I’m amazed at what people find in my work, and I don’t like to limit what you see with a title. For me titles are very difficult, and I don’t usually even think in terms of a theme when I’m creating a sculpture. Once it’s finished I’ll come up with a title, but one person might see flowers, another something from the sea or something from a dream. Bellagio was inspired by the hotel on Lake Como, and I wanted to use the lake in the title – it’s so romantic. I used the word fiori (flowers), but everybody sees something different.
While working on a project for the State Hermitage Museum last year, I had to implement some image watermarking. The basic requirement was that for a certain type of uploaded image, its largest thumbnail should have the museum’s logo tiled across it. I was using attachment_fu to handle the image upload, and ImageMagick/RMagick to process the thumbnails.
Unfortunately, RMagick’s watermark method doesn’t support tiling. To work around, I had to call the composite_tiled! method on a colorized image. This code is in my Thumbnail model, which includes attachment_fu:
class Thumbnail <ActiveRecord::Base
has_attachment :content_type=>:image,
# some settings omitted:watermark_overlay=>File.join(RAILS_ROOT, '/public/images/watermark-overlay-image.png'),
:watermarkable_size=>"1500>"
after_attachment_saved do|record|if record.respond_to?(:parent_id)and record.parent_id.nil? # the original image, not the smaller thumbnails
with_image record.full_filenamedo|img|
img.composite_tiled!(Magick::ImageList.new(attachment_options[:watermark_overlay]).first.colorize(0.4, 0.4, 0.4, 'grey'), # process and colorize imageMagick::SoftLightCompositeOp)
img.write record.full_filename# save imageendendendend
Now every Thumbnail record will automatically have a watermarked large image.
This is Gordie, the Gansen family pet bird. He’s been around since 1997, making him 12 years old. Words cannot express how much I love this little guy.
He loves nothing more than to run around and chase pieces of paper. If you tap on the paper, the following will happen:
And sometimes he gets a bit overstimulated and decides to bite everyone, then it’s time to hang out in the cage:
This junk email wiggled its way through Google’s filtering, much to my delight. After reading it, I felt genuinely touched, as if Deborah was really worried for me, worried that I wouldn’t claim my money.
Oh, Deborah, if I ever make it over to Benin to collect my fifteen thousand United States dollars, I’ll give you a hug.
Email in full:
Fund Beneficiary,
Welcome to ECO BANK Money Gram money transfer Cotonou Benin Plc,
Beneficiary! This is to notify you that we have concluded your payment through Money Gram.
Here is your 3payment MTCN of USD$15,000.00 united state dollars $5,000.00 each, First payment, MTCN 212-314-53 (2) 805-217-78 (3) 968-584-30 and we will give you the sender name to pick up this money immediately you send the activation remittance permit fee which is $188.00 dollars to the name below.
Receiver Name == Augustine Okolo
Address: …. Benin / City Continuo
Test Q…………What?
Ans ……………..Payment.
Amount $188.00
Kindly send the activated remittance permit fee with the given infor…and call for sender name on +22 998 377 738 Urgent, The grace given to you, is a previledge, not a right, therefore it must not be abused. When i imagine the magnitude of your compensation funds left in our possession,it pains me to see that you are yet to get your transfered.
You should count yourself extremely luck for the fortune that has come your way today . It is one in a life time fortune and you should concentrate on finalizing this transaction rather than responding to negative thoughts.
As a friend, i will not like you to loose this chance which has come up today because not every body in this life has this great chance that has come your way including me.Act fast in remitting the fee and let us finalize this transaction which has already stayed longer than expected. I await your swift response, comply and details
I’m working on a small project that involves loading a UTF-16LE (16-bit Unicode, Little Endian) CSV file, converting it to UTF-8 (normal Unicode, as it may be) with iconv, then parsing the values with FasterCSV. Everything was working fine except for loading the first column of data by the column header value. For example, given data:
First Name
Last Name
Email
Jimbo
Jones
jimbo.jones@example.com
I could access column 2 (Last Name) as either row.field("Last Name") or row.field(1). However, if I tried to access the first column using row.field("First Name"), it would return nil. row.field(0), on the other hand, would return the proper value.
Hmmmm.
After some sleuthing, I examined the raw content of the string:
Ah, ha! The first three characters are the byte-order mark, or BOM. Ruby, for whatever reason, does not strip it when reading a file as input, so it’s passed along in the input stream. When loading a file with FasterCSV, it’ll keep those characters in the key name, causing lookups by the first column key name to return nil.
I modified my file conversion code as follows:
def convert_to_utf8
# Data files are exported as Little Endian UTF-16. We need to parse as UTF-8
contents = File.open(@file_name).readbegin
converted = Iconv.iconv('UTF-8', 'UTF-16LE', contents)
converted.first.gsub!("\xEF\xBB\xBF", '')# strip the BOM (byte order mark) from the first line of input
output = File.open(@file_name, 'w')
output.write(converted)rescueIconv::Failureputs $!.inspectendend