Showing posts with label address books. Show all posts
Showing posts with label address books. Show all posts

Wednesday, August 29, 2012

Ruby: can I name the class of a particular variable? is there something like "is_a?"?

What is a simple / elegant way in Ruby to tell if a particular variable is a Hash or an Array? - Stack Overflow

The answer is of course: yes, you can.
And: yes, exactly.

XmlSimple treats elements with attributes as Hash, w/o attributes they are simply String.

"googlecl-0.9.12 -> googlecl-0.9.13" brought a change, where a specific element now does not have attributes any longer, and this broke my code, that reads "google contacts list … --fields=xml".

Solved one of my two urgent home software problems.

Tuesday, August 16, 2011

Samsung Galaxy Tab 10.1 vs. Google Mail Contacts

If you go to Google Mail with GalaxyTab's builtin web browser for looking up your Contacts: they are not there. The web app knows the browser and suppresses the display of the Contacts. That way they make you use the builtin Contacts Android app. That one is not bad or ugly, but I don't like to get my usual way simply removed.

Sunday, March 27, 2011

RubyForge: XML::Simple (with my experiences as updates)

RubyForge: XmlSimple: Project Info

Rather short after discovering this module, I made use of it with my FRITZ!Box call monitor in order to read my Google Contacts as XML. With this approach, that was a rather easy piece of cake.

Update 2011-03-29:
If an element has not attributes, the (text) content of that element simply gets appended as string to the list at the hash field by the name of that element.
Now if the element has attributes, the (text) content goes together with the attributes to a hash list, that gets appended to that list instead. The (text) content actually goes into a hash field by the name of "content".
Example:
text -> "e"=>[            "text"]text -> "e"=>[{"content"=>"text","a"=>"v"}]
My Ruby code operates like this:
x.instance_of?(Hash) ? x['content'] : x

Monday, March 7, 2011

my call monitor software is going jruby

My FRITZ!Box call monitor is written in ruby-1.9. So far I am running it using MRI-ruby-1.9.

This call monitor is a FRITZ!Box call monitor, it does not monitor the calls on my smartphone yet (which is rather, rather sad). Most of the year (for economical reasons) I should sit in a customer's office quite a little away from my place – receiving calls on my smartphone. So it makes much sense to get my call monitor software to monitor the calls on my smartphone one day (rather sooner than later).

Just recently (with the help of RVM) I delved into the the jruby world, and of course I am trying to run my call monitor software also with "jruby --1.9".
My current problems with "jruby-1.6.0.RC2 --1.9" are with I18N and encodings, so I cannot open my gmail address book with "r:UTF-16LE:UTF-8". My evasive strategy is to let it read a UTF-8 version of it.
The ruby CSV module, that parses my address book using regular expressions, seems to give the runtime system yet unseen tasks.
Maybe I am not too far away from running a slightly adapter version of my call monitor in jruby and therefore on a JVM.

Of course, IronRuby (a .Net ruby implementation) is also an option.

There are not that many different smartphone operating systems, that run JVM-s, so we are mainly talking about Android.
Does Android allow non-core software to (sort of) monitor the incoming and outgoing calls?

Once jruby successfully runs my call monitor, the way is free to go for an Android implementation. I am rather hot for it.

Update 2011-03-07:
After a couple of postings on user@jruby.codehouse.org and especially with the support of Thomas E. Enebo, my software now runs just as well with the very, very latest jruby, that I produced through "rvm install jruby-head".


Update 2011-03-28:
Now it runs reading the XML Google Contacts, which is more comfortable, as I can download it on the command line.

Wednesday, March 2, 2011

your Google Contacts address book as XML

Today I came across a rather interesting thread on the googlecl-discuss mailing list, it's subject was "Backing up contacts", and it thrilled me instantly. With this command line, you get your address book dumped as completely, as it currently can get:
$ google contacts list --title='' --fields=xml
Of course you must have an up-to-date gdata-python-client and googlecl installation. But you do have that anyway, don't you? I updated mine today.

Yes, the XML misses an enclosing top-level element – but you can add that easily.

I would also love to see the groupMembershipInfo in a rather "accessible" way, but I guess, that will also come sooner or later.

This lists alls groups (and not in XML for currently trivial reasons), but I am not able to relate the groups to the (group) URIs mentioned in the contacts XML:
$ google contacts list-groups --title='' --fields=xml --verbose ".*"


My FRITZ!Box call monitor software will make use of the XML Google Contacts rather soon. That way I can skip all the current JRuby CSV and m17n problems. Its also more comfortable to download, because I can do that on the command line. And if it's more comfortable, you do it more often. Backing up your address book frequently isn't a bad idea either, right?!

Update 2011-03-28:
Task accomplished for my FRITZ!Box call monitor software, also if executed through jruby-1.6.0.

Thursday, November 4, 2010

Contacts Manager within my Google Apps domain and contact picture

It looses its pictures, it doesn't accept new ones, it doesn't show an error message, it's weird and somehow broken. When I searched for this problem picture recently, I wasn't able to find other descriptions than mine.

When I "Add a picture", it let's me proceed, but finally after I want to "Apply Changes", nothing happens. After a while I decide to press "Back to upload".
Today they actually started telling me "Error while saving your picture." But I have no idea, what that refers to, and "the web" does not offer a solution here either.

This does not happen with my standard Google account, but only with my Google Apps domain account.

Wednesday, October 20, 2010

do not work on your Google Mail address book in parallel!

I worked on my address book in two different tabs of my browser. That was actually Google Chrome 8, but I think, that doesn't matter. If you modify and save an address book entry in tab "B", you will not see these changes in tab "A". They are not coordinated, and that's not optimal. I am quite sure, the changes in tab "B" are still updated on your persistent database at Google's sites, and you can expect to see the changes, when you load your address book anew.

Thursday, August 12, 2010

Googe Mail "Contacts Manager" has even gotten much, much nicer …

… with the recent update.

I wonder how long it will take for the new features to find their way into the Google Apps version of the Contacts Manager.

Friday, August 6, 2010

my blogs, my blog followers, my IM contacts, Jabber SPAM

I have no idea, how often my blog articles get read. I have no idea, whether my friends read my blogs. I am not too optimistic there.

But I do have quite an extensive list of IM contacts. And there is that nice book on XMPP resp. Jabber at O'Reilly's. Why not write an application, that takes my blogs' syndication feeds and broadcasts them to my IM contacts. Maybe that will make my IM contacts list quite shorter in a pretty short time. Who knows?

Maybe there is already some software out there, that does exactly that or just almost. Maybe you want to tell me.

Wanderlust, Michael Lopp, and my FRITZ!Box call monitor

Just the way Michael Lopp describes it in his book Being Geek -- The Software Developer's Career Handbook in the section on Wanderlust, I have carried around that idea with me for quite a while, that I would like to be able to see on my phones, from which company somebody is calling, in case I don't have a specific entry for him/her in my address book.

Today I got up and I knew, the feature is actually already implemented. I do maintain a list of country calling codes, which my call monitor actually reads, when it starts up. Today I just understood, that a company's core phone number is just a little longer than a country calling code, but actually my software doesn't mind that. So I started adding company core phone numbers to that list.

And from now on, that should only be rare occasions, where I don't know, from which recruiting company and which location, the recruiter is calling from. I love it.

Wednesday, July 21, 2010

how to make a rectangle image a square image using GIMP


I like reusing profile pictures from the web in my Google Mail Contacts aka address book.
On Xing or LinkedIn these pictures not necessarily are square, but on Google Mail Contacts you have to choose a sub-square. So maybe you want to resize the picture appropriately, so you don't cut it, where you don't want to cut it. Here is, how to proceed:
  • Image / Canvas Size: disconnect the coupling between width and height,
  • then make both the same, preferredly the larger one,
  • then center
  • and resize!
  • Last not least: save the file with the highest quality!
BTW my designer mate doesn't like GIMP, he prefers Photoshop. I gave GIMP a try for this purpose, and it did, what I expected it to do, in a perfect way, every try a perfect hit!

Wednesday, June 16, 2010

Google Mail Contacts is my personal killer app

Serious!!!
Once again: it syncs with the iPhone address book.
I use it for reverse look up (phone number to address book entry) together with my telephone system in my home office, and that's build around an AVM "FRITZ!Box". The glue software got implemented by myself in ruby (w/o Rails).
Why ruby? I thought, I could make it run with Cocoa Ruby on the iPhone. But you know yourself: Apple fights those kinds of things. And just for running it with a GUI on a usual Mac OS X? No, that's not worth my effort.

Update / 2010-06-16 11:45:
I forgot mentioning xing.com here. Downloading vCards from xing and adding them here – that's just awesome!

I really love using vCards and profiles pictures from Xing

I "always" also "copy" them for my Google Mail address book, which gets synced with my iPhone's address book. This really makes my life so much easier  – recognising resp. remembering people by their faces is so much easier.
Update / 2010-06-16:
I forgot to mention, that I always use Xing's vCards for new contacts to create resp. complete their entries in my Google Mail resp. iPhone address book.

Friday, June 4, 2010

phonebook on Facebook

Did you know, you have a phonebook on Facebook? Now you do. But nowadays more and more Facebook friends remove their phone numbers from their Facebook profile.

Thursday, May 20, 2010

a call monitor for the FRITZ!Box, using a gmail address book and an area code directory

The FRITZ!Box family of routers also provide telephony services, actually all my phones go through my 7390. They are built using Linux and Busybox. On its TCP/IP port 1012 it offers event records on all telephony actions. Last Christmas I implemented a ruby script dealing with these event records and the "call threads". Yes, there is even a notion of "call threads". At that time I already decided I wanted to use my gmail address book as the data base for looking up all telephone numbers. Now I completed this task. There is a directory of area codes for Germany ("ONB"). I also make use of that one now: For every caller, whose telephone number is not listed in my gmail address book, I show at least from which area he called. I am rather glad with this software.
Initially I also wanted to make this ruby script an OS X cocoa ruby script with a colorful GUI, maybe to run on my iPhone. I'm not sure, whether I will ever be able to work on this.

Update 2010-07-02:
Having my script running now stably for quite a while, it was time for a new feature – somehow.
I have been using procmail for splitting my incoming e-mail for like 13 years or so now.
The procmail rules obviously derive from the addresses I am expecting e-mail messages from.
In former times I had a plug-in for emacs's BBDB, that created raw procmail rules from my emacs address book.
Now with my new approach it makes sense to generate procmail rules from the gmail address book.
Tonight I was in the mood for an little programming excercise, and I implented this feature rather spontaneously. I like it very much.
Right …, generating procmail rules isn't really a proper task for a call monitor, I do know that.

Update 2011-03-28:
This software now makes use of an XML Gmail address book. If you want to find out more on this issue, filter this blog using the tags shown below!

Thursday, October 29, 2009

creating phone book and diary entries from incoming calls on my router

If you read this title, how mad do you think I am? Honest!

Alright, "as you know" (so of course this article only applies to some sort of computer nerds), my router is a FRITZ!Box 7270, it's also the base station for my (wireless) phones, and a lot more ... -- certainly one of my most important toys or gadgets. And I have 2 of them, one for at home, one for anywhere outside, where I can only connect to the Internet through UMTS.

So alright, back to the title of this article!

  • It's nice to record your incoming and outgoing calls in your diary, right? (my diary is emacs style)
  • It's nice to get something descriptive displayed on your phone, when somebody calls, right?
  • It's nice to extend your phone book through time as easily as possible, right?

Well, my router is running Linux as its operating system kernel, and BusyBox on top of it. On each incoming phone call it runs a shell script with a few parameters, of course the caller's phone# (if available) and also the callee's phone#. (I do have more than one phone#, and why not also record the called phone#, just for the record?) It tries to associate a name with the caller's phone#, if there is a matching entry in the phone book.

Quite a while ago I started implementing such a shell script, and obviously (as it is almost an ordinary (bash) shell script), I can develop and test it on any of my computers, that can run shell scripts, like any of my openSuSE computers, any WinXP computer running cygwin, a Mac running OS X, ... . Yes, I cannot create a full blown shell script, I will not pipe a lot through one-liner perl or ruby scripts on my router, but still: it's a handy and useful, not so tiny shell script.

So far it appears to me, as if no such executable gets called on the router for outgoing calls, but I can still mimic this behaviour by calling that script on my main development box.

Having said this, my script (fritz_box_calllog.sh) fulfills all the requirements, that I listed above in that bullet list.
For incoming calls without caller id and/or without a matching entry in the phone book it creates a piece of XML text, that I can paste into my FRITZ!Box XML phone book, and where I can fill in a phone# and a name or any descriptive text, so next time, I want to dial that phone# myself, I can select it from the phone book. And maybe another time that person will call you with caller id, and then you will be able to greet that person with her/his name. Wouldn't that be nice?

The implementation of this software also got inspired by Matthias Hühne's "Dial!Fritz", that I run on my iPhone. But of course his software is far completer and nicer, and it's well integrated.

Wednesday, October 14, 2009

iPhone address book Group info blanked again

I love "categorising" the contacts in my address books, in iPhone "speak": keeping them in Groups. I installed a utility, that can do that, it's called Grouper. But occasionally the all the Group details, that I entered get entirely reset. Actually the Group names still get listed, but all the Groups are left empty. I think, for the time being, I will not use that again on the iPhone.