Friday, July 2, 2010
ruby, gsub, and backslash characters within the replacement
My ruby problem of the day: I have e-mail addresses, and I want to use them within procmail rules. Therefore certain characters like the dot character and also the "+" need escaping.
It took me an endless while, like certain things always take an endless while on unknown grounds.
I started with single quotes just as in the gsub examples in the pickaxe3 book.
I didn't get the right number of backslashs in place within the replacement string, as long as the replacement string used single quotes.
Finally a Google search for "ruby gsub replacement backslash" led me to a solution. Not to an overly serious one, to be honest.
The example there used double quotes, so I replaced my single quotes with double quotes, and I started again increasing the number of accumulated backslash characters. That way I achieved within a pretty short time, what I needed to achieve. Not that I had learned too much.
It took me an endless while, like certain things always take an endless while on unknown grounds.
I started with single quotes just as in the gsub examples in the pickaxe3 book.
I didn't get the right number of backslashs in place within the replacement string, as long as the replacement string used single quotes.
Finally a Google search for "ruby gsub replacement backslash" led me to a solution. Not to an overly serious one, to be honest.
The example there used double quotes, so I replaced my single quotes with double quotes, and I started again increasing the number of accumulated backslash characters. That way I achieved within a pretty short time, what I needed to achieve. Not that I had learned too much.
Labels:
The Ruby Programming Language
Thursday, July 1, 2010
Ruby User Group Berlin / 2010-07-01 "meetup" / a brief report
At today's meeting of RUG-B
Here are
I am rather keen to see Jan's slides and his code getting announced on the Google Group.
Well, ruby apps run in a Google App environment through jruby, which in turn runs on a JVM. Jan told us of two different working approaches. Rails does run in theory in that environment, but it takes way too long to start. Instead Sintra seems to be the ruby framework of choice wrt the Google App Engine.
I might err there …, sorry, rephrase:
maybe that question is heretic, but simply put: what's the status of perl on the Google App Engine?
Looks like nothing moved after 2009-07-01 with perl-appengine, right?
I personally would love to see a perl app say "hello world!" on the Google App Engine.
RUG-B's mailing list lives on Google Groups.
- Jan Berkel talked to us about Ruby on Google App Engine
(link added at 2010-07-02-14-42),
- and Benjamin Krause talked to us about Unobtrusive Google Analytics Event Tracking.
Here are
I am rather keen to see Jan's slides and his code getting announced on the Google Group.
Well, ruby apps run in a Google App environment through jruby, which in turn runs on a JVM. Jan told us of two different working approaches. Rails does run in theory in that environment, but it takes way too long to start. Instead Sintra seems to be the ruby framework of choice wrt the Google App Engine.
I might err there …, sorry, rephrase:
maybe that question is heretic, but simply put: what's the status of perl on the Google App Engine?
Looks like nothing moved after 2009-07-01 with perl-appengine, right?
I personally would love to see a perl app say "hello world!" on the Google App Engine.
RUG-B's mailing list lives on Google Groups.
Wednesday, June 30, 2010
some *-berlin.de domains
All of a sudden today I thought I should register a couple of domains.
Here they are:
Quite a good start -- even e-mail addresses are set up!
If you want to have any such e-mail address -- talk to me!
Here they are:
Quite a good start -- even e-mail addresses are set up!
If you want to have any such e-mail address -- talk to me!
working through elance.com
what do you think about working through elance.com as a "provider"?
Labels:
project market
Spidering Hacks - O'Reilly Media
CHAPTER ONE
Hack #2 – Best Practices for You and Your Spider
…
Be Liberal in What You Accept
… This is an inexact science, to put it mildly. …
…
Monitor your spider’s output on a regular basis to make sure it’s working as expected [Hack #31], make the appropriate adjustments as soon as possible to avoid losing ground with your data gathering, and design your spider to be as adaptive to site redesigns [Hack #32] as possible.
…
Don’t Reinvent the Wheel
Hack #4 – Registering Your Spider
By the way, you might think that your spider is minimal or low-key enough that nobody’s going to notice it. That’s probably not the case. In fact, sites like Webmaster World (http://www.webmasterworld.com) have entire forums devoted to identifying and discussing spiders. Don’t think that your spider is going to get ignored just because you’re not using a thousand online servers and spidering millions of pages a day.
Naming Your Spider
… There are web sites, like http://www.iplists.com, devoted to tracking IP addresses of legitimate spiders. …
Hack #5 – Preempting Discovery
No matter how gentle and polite your spider is, sooner or later you’re going to be noticed. Some webmaster’s going to see what your spider is up to, and they’re going to want some answers.
…
Hack #6 – Keeping Your Spider Out of Sticky Situations Hack
Bad Spider, No Biscuit!
… There is nothing stopping a disgruntled site from revising its TOS to deny a spider’s access, and then sending you a “cease and desist” letter. … Spidering another site’s content and reappropriating it into your own framed pages is bad. Don’t do it. …
Competitive IntelligenceSome sites complain because their competitors access and spider their data—data that’s publicly available to any browser—and use it in their com- petitive activities. You might agree with them and you might not, but the fact is that such scraping has been the object of legal action in the past. Bid- der’s Edge was sued by eBay (http://pub.bna.com/lw/21200.htm) for such a spider. …
Possible Consequences of Misbehaving Spiders
… But considering lawyer’s fees, the time it’ll take out of your life, and the monetary penalties that might be imposed on you, a lawsuit is bad enough, and it’s a good enough reason to make sure that your spiders are behaving and your intent is fair. …
CHAPTER TWO
Assembling a Toolbox
Hacks #8–32
…
Chapter 4 Gleaning Data from Databases
…
Hack #69 – Aggregating RSS and Posting Changes
-> meta feeds, aggregating feeds, …
Hack #2 – Best Practices for You and Your Spider
…
Be Liberal in What You Accept
… This is an inexact science, to put it mildly. …
…
Monitor your spider’s output on a regular basis to make sure it’s working as expected [Hack #31], make the appropriate adjustments as soon as possible to avoid losing ground with your data gathering, and design your spider to be as adaptive to site redesigns [Hack #32] as possible.
…
Don’t Reinvent the Wheel
- …
- Best Practices for You
Hack #4 – Registering Your Spider
By the way, you might think that your spider is minimal or low-key enough that nobody’s going to notice it. That’s probably not the case. In fact, sites like Webmaster World (http://www.webmasterworld.com) have entire forums devoted to identifying and discussing spiders. Don’t think that your spider is going to get ignored just because you’re not using a thousand online servers and spidering millions of pages a day.
Naming Your Spider
… There are web sites, like http://www.iplists.com, devoted to tracking IP addresses of legitimate spiders. …
Hack #5 – Preempting Discovery
No matter how gentle and polite your spider is, sooner or later you’re going to be noticed. Some webmaster’s going to see what your spider is up to, and they’re going to want some answers.
…
Hack #6 – Keeping Your Spider Out of Sticky Situations Hack
Bad Spider, No Biscuit!
… There is nothing stopping a disgruntled site from revising its TOS to deny a spider’s access, and then sending you a “cease and desist” letter. … Spidering another site’s content and reappropriating it into your own framed pages is bad. Don’t do it. …
Competitive IntelligenceSome sites complain because their competitors access and spider their data—data that’s publicly available to any browser—and use it in their com- petitive activities. You might agree with them and you might not, but the fact is that such scraping has been the object of legal action in the past. Bid- der’s Edge was sued by eBay (http://pub.bna.com/lw/21200.htm) for such a spider. …
Possible Consequences of Misbehaving Spiders
… But considering lawyer’s fees, the time it’ll take out of your life, and the monetary penalties that might be imposed on you, a lawsuit is bad enough, and it’s a good enough reason to make sure that your spiders are behaving and your intent is fair. …
CHAPTER TWO
Assembling a Toolbox
Hacks #8–32
…
Chapter 4 Gleaning Data from Databases
…
Hack #69 – Aggregating RSS and Posting Changes
-> meta feeds, aggregating feeds, …
Labels:
HTTP scripting,
meta feeds
Tuesday, June 29, 2010
jobs.perl.org needs a couple of changes -- let's start brain storming!
For me as a freelancer it's very clear:
Yes, I tried to contact Ask Bjørn Hansen at ask(AT)perl.org before I started this here, but to no success.
- There must be separate feeds for freelance and salaried staff.
- There should be an opportunity of commenting on the job postings, e.g. if the original poster doesn't close the job, it makes sense to get that information from somebody else, maybe from somebody who was somehow involved. Yes, that cannot happen anonymously.
- …
Yes, I tried to contact Ask Bjørn Hansen at ask(AT)perl.org before I started this here, but to no success.
"Senior Software Engineer - Perl" / "Germany, Karlsruhe" / "Pay rate: 70,00 €/h" / CLOSED
"Closed", so the recruiter says.
What a pity, that comments on job postings on jobs.perl.org are not possible.
What a pity, that comments on job postings on jobs.perl.org are not possible.
"Tour de Babel" by Steve Yegge
[...]
My whirlwind tour will cover C, C++, Lisp, Java, Perl, (all languages we use at Amazon), Ruby (which I just plain like), and Python, which is in there because — well, no sense getting ahead of ourselves, now.
[...]
"A Quick Tour of Ruby" by Steve Yegge
Very nice to read.
I personally keep loving both of them. I can afford that in the comp.lang.* area and in some others as well, but that doesn't concern my girl-friend, of course.
I actually came across Steve, when I searched for elisp.
Ruby used to annoy me simply by existing. I first heard about Ruby years ago, in maybe 1997 or 1998, and folks said it was kind of like Perl, but "cleaner", whatever that meant. Ruby fans back then seemed like a tiny minority of rebels and fringe separatists.Steve ...'s home page.
Ruby irked me primarily because we already had Perl, which was working just fine thank you very much. And if for some strange reason you didn't like Perl, we had Python. If Perl fans were dog owners, and Python fans were cat owners, then Ruby fans seemed like ferret owners. They could go on and on about how much they adored their beady-eyed albino stretch-limo rats, and how cute they were, but we all knew they were just looking for attention. Nobody really wants a pet rat. (Ferret owners will correct me and say they're not rodents; they're more closely related to weasels and skunks. As if that helps.) Regardless, I didn't want to have anything to do with Ruby.
Last year, though, I was looking at a bunch of different languages in the hopes of finding one to replace Perl for small- to medium-sized tasks. One day my magic Perl dust had worn off rather suddenly, and I'd joined the growing ranks of people who were beginning to notice the emperor was a wee bit underdressed. But all the alternatives to Perl looked pretty bad themselves, and I started judging languages by how far I'd get into the reference manual before throwing it across the room.
I eventually picked up a Ruby book -- ...
I personally keep loving both of them. I can afford that in the comp.lang.* area and in some others as well, but that doesn't concern my girl-friend, of course.
I actually came across Steve, when I searched for elisp.
Monday, June 28, 2010
iPhone apps, that I need sooner or later
- Telefonkarte (Calling Card): supplies you with support for all sorts of call-through telecom providers, even your FRITZ!Box at home can serve as one and is indeed supported by this app
- …
Labels:
FRITZ.Box,
iPhone,
iPhone apps,
wishlist
how to avoid to accidentally Quit Firefox?
Is there any config. variable?
There is a checkbox labeled "Warn me when closing multiple tabs". That does the job.
There is a checkbox labeled "Warn me when closing multiple tabs". That does the job.
Labels:
Mozilla Firefox
first steps in IRC with pidgin
- "Add Account" for each IRC server/user pair (e.g. irc.freenode.net), that you want to use, within pidgin with IRC as protocol
- "Join a Chat" (below Buddies), select the right Account (i.e. one of your IRC protocol/server accounts), enter the Channel (including the '#'), leave the Password blank! here we are!
I did all this with a (fink) pidgin on my MacBook running Snow Leopard (OS X), but I don't doubt, it will also run on my openSUSE Samsung notebook.
networks and logos
Where do you get to the personalised logos resp. badges of misc. networks:
To be continue …
To be continue …
Labels:
networks
Sunday, June 27, 2010
how to structure my stuff on github.com
I need help. Does anybody want to instruct me, how to set up my stuff resp. repositories on github.com? My profile there is this. I created a RELAX-NG schema earlier today, and that's the first to upload.
- Filesystem Hierarchy Standard
- Linux packagement on sabi.co.uk
- ...
Labels:
github.com,
trees
bulk upload of events in XML at XING
At this link XING tells us, that they accept XML files in a certain format for uploading events to their site. They supply us with some nice but rather informal documentation in PDF, but there is no schema. Now that made me a little curious today, I downloaded their template file, created a few variants of the sample entry, and running trang I created a RELAX-NG schema file (anybody interested?). trang seems to not recognise date-time values of tags, so that always needs a little manual post-processing.
O, yes, I proudly uploaded one such event that way. (Actually on the first attempt I got the year wrong, that was quite embarrassing.)
O, yes, I proudly uploaded one such event that way. (Actually on the first attempt I got the year wrong, that was quite embarrassing.)
Saturday, June 26, 2010
my approach to HTTP scripting, web harvesting, page scraping, and all that
- use LiveHTTPheaders in Firefox
- resp. ieHTTPHeaders in IE for extracting the relevant HTTP traffic;
- run my script scan_HTTP_log_file.pl on that and create a raw perl script (raw because e.g. it doesn't know, that it includes session IDs etc. as constant literals),
- that makes use of my JHwis toolkit around libcurl, it also includes a truely working cookie machine.
- on the Curl web-site you can also find formfind.pl, that helps a lot in finding all the "input" tags.
- now you have a raw perl script, that you can enrich will all necessary condition handling – there is all kinds of stuff in that code (like in any code generated from visiting a web-site), that you need to replace by dedicated handling, like session IDs and similar fields and URL ingredients; associate coordinate names with the resp. image names.
- on CPAN lives a module by the name of HTML::TableExtract for extracting HTML tables;
I wrapped it up a little, so that I can make use of it on a command line. - that command line utility supplies me with all necessary options for related tasks regarding navigating through HTML and all its tables, just what HTML::TableExtract actually does.
- I love writing "small" utilities in perl resp. ruby, that I wrap up bash resp. zsh scripts.
All that makes my swiss army knife of web harvesting and page scraping.
Reality is seriously more challenging than text book examples, trust me!
Right, I could make all of that open source. I just recently started my open sourcerer career, after SzabGab had stayed in my place for a couple of days around LinuxTag.org/2010 at Berlin.
I should also mention Daniel Stenberg, the father of curl. IMO without his great work the art of HTTP scripting would not stand, where it stands today.
Right: last not least: no, I am not into dealing with AJAX and all that. For the last couple of years my approach has been: with the toolset I described above I can still manage "all" tasks without caring for AJAX. It does not matter enough.
Friday, June 25, 2010
visit Cristina Brizola's web spaces and buy something from her, maybe even a Frida Kahlo portrait copy!!!
Set up a flickr.com account for "mother of son#2".
She needs migrating from spaces.live.com to flickr.com rather sooner than later.
Do me a favour and buy some of her pictures!
She also does pretty nice Frida Kahlo portrait copies.
Yes, I know, I still have to create articles on her on en.wikipedia.org and de.wikipedia.org.
http://www.flickr.com/people/CrisBrizola
http://CristinaBrizola.spaces.live.com/
http://en.wikipedia.org/wiki/Cristina_Brizola
http://de.wikipedia.org/wiki/Cristina_Brizola
She needs migrating from spaces.live.com to flickr.com rather sooner than later.
Do me a favour and buy some of her pictures!
She also does pretty nice Frida Kahlo portrait copies.
Yes, I know, I still have to create articles on her on en.wikipedia.org and de.wikipedia.org.
http://www.flickr.com/people/CrisBrizola
http://CristinaBrizola.spaces.live.com/
http://en.wikipedia.org/wiki/Cristina_Brizola
http://de.wikipedia.org/wiki/Cristina_Brizola
Labels:
Cristina_Brizola,
flickr,
Frida Kahlo
Wednesday, June 23, 2010
shared synchronised editing with GNU Emacs
I continuously edit my ~/diary on my openSUSE Linux notebook and on my MacBook.
Emacs helps me there quite a lot. In case I changed something on that file on some other computer than the one I am currently sitting in front of, it warns me and also offers me to revert to the last version saved to disk.
I really love that.
Emacs helps me there quite a lot. In case I changed something on that file on some other computer than the one I am currently sitting in front of, it warns me and also offers me to revert to the last version saved to disk.
I really love that.
Labels:
emacs,
Linux,
Mac OS X,
MacBook Pro,
openSUSE
Timer Utility - i use this on mac os x
Alarm clock, countdown timer, and stopwatch.
great stuff!!!
almost like the iPhone utility
great stuff!!!
almost like the iPhone utility
Labels:
Mac OS X
Facebook does (not) import my Google Buzz public feed
First it didn't, what surprise ;-)
Update / 2010-06-23 17:00:
Works now.
I actually first tried that through "Import an External Blog", and you can only name there a single one. But they seem to reject that because of some details in the XML, that they don't like ;-)
But you can always use NetworkedBlogs for more letting other streams like blogs and whatever RSS feeds flow into "your" Facebook (wall).
Update / 2010-06-23 17:00:
Works now.
I actually first tried that through "Import an External Blog", and you can only name there a single one. But they seem to reject that because of some details in the XML, that they don't like ;-)
But you can always use NetworkedBlogs for more letting other streams like blogs and whatever RSS feeds flow into "your" Facebook (wall).
Labels:
Facebook,
Google Buzz
Tuesday, June 22, 2010
Photo Booth on OS X
It was time to change the pics on Facebook, Skype etc. again.
Wondered how to take a few pics using the MacBook.
Finally found Photo Booth.
Move the utility's window to that corner of the screen, where you want your face to look at, otherwise your eyes look into the "wrong" direction. Sounds obvious, I know.
Wondered how to take a few pics using the MacBook.
Finally found Photo Booth.
Move the utility's window to that corner of the screen, where you want your face to look at, otherwise your eyes look into the "wrong" direction. Sounds obvious, I know.
Labels:
Mac OS X,
Photo Booth
we remember the end of WW I and its armistice in Compiègne Forest
- article on en.wikipedia.org
- the armistice at the end of WW II has also taken place in Compiègne Forest
- today is still a bank holiday in Belgium
Labels:
World War I
Monday, June 21, 2010
some old funny Python anti-Perl and Ruby anti-Python propaganda
Have you ever come across this
this piece of Python anti-Perl propaganda? The article that referred to it is actually Ruby propaganda and dated 2004-07, so that anti-Perl propaganda is even older than that. The Ruby now found a followup. Look and enjoy!
By any chance: isn't there any gifted artist around, that the Perl community can make use of in order to create some Perl-minded stuff?
Update / 2010-08-05:
In response to my re-share here more sweet perl vs. ruby vs. python propaganda got created by Mark Keating:
http://mdk.per.ly/2010/06/25/propaganda/ :
By any chance: isn't there any gifted artist around, that the Perl community can make use of in order to create some Perl-minded stuff?
Update / 2010-08-05:
In response to my re-share here more sweet perl vs. ruby vs. python propaganda got created by Mark Keating:
http://mdk.per.ly/2010/06/25/propaganda/ :
debugging my .procmailrc
It's usually not really big fun, if you find a message like this in your procmail log file: "procmail: Missing action".
Well, I don't yet know of a procmail syntax checker, which is rather a pity, so the debugging is of a dynamic kind.
Just add "VERBOSE=on" in the beginning of your .procmailrc, enjoy the flood of "procmail: No match on ...,", and find your "procmail: Missing action" occasionally in the middle of it. You found the corrupted rule then. The rule in question might actually be a very rarely used one resp. one pretty at the end of your .procmailrc, so it may take a while resp. a couple of incoming mails, until it gets used and shows up.
Once you found and corrected the offender, I am quite sure, you will remove "VERBOSE=on" very quickly.
Well, I don't yet know of a procmail syntax checker, which is rather a pity, so the debugging is of a dynamic kind.
Just add "VERBOSE=on" in the beginning of your .procmailrc, enjoy the flood of "procmail: No match on ...,", and find your "procmail: Missing action" occasionally in the middle of it. You found the corrupted rule then. The rule in question might actually be a very rarely used one resp. one pretty at the end of your .procmailrc, so it may take a while resp. a couple of incoming mails, until it gets used and shows up.
Once you found and corrected the offender, I am quite sure, you will remove "VERBOSE=on" very quickly.
Labels:
procmail
spoilt files from bittorrent
I recently saw "a friend" ;-) who complained, that he had downloaded huge movie files from a bittrorrent, and when he tried to watch them, it turned out, that a special viewer is needed, and that that special viewer even makes a monthly subscription necessary. Well, under these circumstances downloading movies from bittorrents don't make sense.
Labels:
bittorrent
Subscribe to:
Posts (Atom)