<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;A0UNRn44cCp7ImA9WhVTEUg.&quot;"><id>tag:blogger.com,1999:blog-4078805449160415851</id><updated>2012-02-25T17:41:37.038+09:00</updated><category term="arduino" /><category term="growl" /><category term="xml" /><category term="scala" /><category term="emacs" /><category term="xmpp" /><category term="text editor" /><category term="tex" /><category term="java" /><category term="html5" /><category term="web" /><category term="C" /><category term="sqlite" /><category term="perl" /><category term="protocol buffers" /><category term="notifyosd" /><category term="paver" /><category term="file system" /><category term="pdf" /><category term="chrome" /><category term="kindle" /><category term="inotify" /><category term="applescript" /><category term="555" /><category term="igraph" /><category term="android" /><category term="xcode" /><category term="terminal" /><category term="git" /><category term="python" /><category term="haskell" /><category term="notifo" /><category term="mac" /><category term="dlna" /><category term="bc" /><category term="vim" /><category term="tv" /><category term="omake" /><category term="ipod touch" /><category term="jython" /><category term="mercurial" /><category term="google" /><category term="R" /><title>EngineeringException</title><subtitle type="html">SAEKI Yoshiyasu's weblog</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://laclefyoshi.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://laclefyoshi.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Yoshiyasu SAEKI</name><uri>https://profiles.google.com/101384646867143843419</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-xEHAXnqop_Y/AAAAAAAAAAI/AAAAAAAAAYc/SuLwm9MVzDM/s512-c/photo.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>63</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/Engineeringexception" /><feedburner:info uri="engineeringexception" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;AkAESHkyeCp7ImA9WhRaFUs.&quot;"><id>tag:blogger.com,1999:blog-4078805449160415851.post-725827754263920210</id><published>2012-02-18T21:38:00.000+09:00</published><updated>2012-02-18T21:38:29.790+09:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-18T21:38:29.790+09:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="mac" /><title>another way of creating RAM disc in Mac</title><content type="html">&lt;br /&gt;
I wrote about &lt;a href="http://laclefyoshi.blogspot.com/2011/05/tmpfs-on-linux-and-mac.html"&gt;a way of creating RAM disc in Mac&lt;/a&gt;. But I knew that using &lt;code&gt;discutil&lt;/code&gt; is better than &lt;code&gt;mount&lt;/code&gt; for creating RAM disc in Mac.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href="http://osxdaily.com/2007/03/23/create-a-ram-disk-in-mac-os-x/"&gt;Create a RAM Disk in Mac OS X&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ diskutil erasevolume HFS+ "ramdisk" `hdiutil attach -nomount ram://1165430`
Started erase on disk1
Unmounting disk
Erasing
Initialized /dev/rdisk1 as a 569 MB HFS Plus volume
Mounting disk
Finished erase on disk1 ramdisk
&lt;/pre&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-k9geX0Z8VZU/Tz-Z4otpGII/AAAAAAAAAgc/B-6-o5Dam9Q/s1600/ramdisk.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="84" width="218" src="http://1.bp.blogspot.com/-k9geX0Z8VZU/Tz-Z4otpGII/AAAAAAAAAgc/B-6-o5Dam9Q/s400/ramdisk.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
The good thing is the disc is visible on Finder. Of course, the disk free space can be checked easily.&lt;br /&gt;
&lt;br /&gt;
Thanks.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4078805449160415851-725827754263920210?l=laclefyoshi.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/mDgSe6theLhaItRQAf6cd6Z88iU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/mDgSe6theLhaItRQAf6cd6Z88iU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/mDgSe6theLhaItRQAf6cd6Z88iU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/mDgSe6theLhaItRQAf6cd6Z88iU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Engineeringexception/~4/0GrsK8eHpIg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://laclefyoshi.blogspot.com/feeds/725827754263920210/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://laclefyoshi.blogspot.com/2012/02/another-way-of-creating-ram-disc-in-mac.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/725827754263920210?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/725827754263920210?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Engineeringexception/~3/0GrsK8eHpIg/another-way-of-creating-ram-disc-in-mac.html" title="another way of creating RAM disc in Mac" /><author><name>Yoshiyasu SAEKI</name><uri>https://profiles.google.com/101384646867143843419</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-xEHAXnqop_Y/AAAAAAAAAAI/AAAAAAAAAYc/SuLwm9MVzDM/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-k9geX0Z8VZU/Tz-Z4otpGII/AAAAAAAAAgc/B-6-o5Dam9Q/s72-c/ramdisk.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://laclefyoshi.blogspot.com/2012/02/another-way-of-creating-ram-disc-in-mac.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUICSXw6cSp7ImA9WhRbGUk.&quot;"><id>tag:blogger.com,1999:blog-4078805449160415851.post-1668378346653923193</id><published>2012-02-11T17:06:00.001+09:00</published><updated>2012-02-11T17:06:08.219+09:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-11T17:06:08.219+09:00</app:edited><title>af* command for treating audio files in Mac</title><content type="html">&lt;br /&gt;
I knew that there are commands for treating audio files in Mac by default.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;afinfo&lt;/h4&gt;&lt;br /&gt;
&lt;a href="https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/afinfo.1.html"&gt;afinfo&lt;/a&gt; is a command for showing information of audio file.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ afinfo happykids.wav 
File:           happykids.wav
File type ID:   WAVE
Data format:     1 ch,  11025 Hz, 'lpcm' (0x00000008) 8-bit unsigned integer
                no channel layout.
estimated duration: 5.576417 sec
audio bytes: 61480
audio packets: 61480
bit rate: 88200 bits per second
packet size upper bound: 1
audio data file offset: 44
optimized
source bit depth: I8
----
&lt;/pre&gt;&lt;br /&gt;
&lt;h4&gt;afconvert&lt;/h4&gt;&lt;br /&gt;
&lt;a href="https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/afconvert.1.html"&gt;afconvert&lt;/a&gt; is a command for converting format of audio file. The supported formats are showed by option: &lt;code&gt;-hf&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ afconvert -hf
Audio file and data formats:
    '3gpp' = 3GP Audio (.3gp)
               data_formats: 'Qclp' 'aac ' 'aace' 'aach' 'aacl' 'aacp' 
                             'samr' 
    '3gp2' = 3GPP-2 Audio (.3g2)
               data_formats: 'Qclp' 'aac ' 'aace' 'aach' 'aacl' 'aacp' 
                             'samr' 
    'adts' = AAC ADTS (.aac, .adts)
               data_formats: 'aac ' 'aach' 'aacp' 
    'ac-3' = AC3 (.ac3)
               data_formats: 'ac-3' 
    'AIFC' = AIFC (.aifc, .aiff, .aif)
               data_formats: I8 BEI16 BEI24 BEI32 BEF32 BEF64 UI8 'ulaw' 
                             'alaw' 'MAC3' 'MAC6' 'ima4' 'QDMC' 'QDM2' 
                             'Qclp' 'agsm' 
    'AIFF' = AIFF (.aiff, .aif)
               data_formats: I8 BEI16 BEI24 BEI32 
    'amrf' = AMR (.amr)
               data_formats: 'samr' 
    'm4af' = Apple MPEG-4 Audio (.m4a, .m4r)
               data_formats: 'aac ' 'aace' 'aach' 'aacl' 'aacp' 'alac' 
    'caff' = CAF (.caf)
               data_formats: '.mp1' '.mp2' '.mp3' 'QDM2' 'QDMC' 'Qclp' 
                             'Qclq' 'aac ' 'aace' 'aach' 'aacl' 'aacp' 
                             'alac' 'alaw' 'dvi8' 'ilbc' 'ima4' I8 BEI16 
                             BEI24 BEI32 BEF32 BEF64 LEI16 LEI24 LEI32 
                             LEF32 LEF64 'ms\x00\x02' 'ms\x00\x11' 'ms\x001' 
                             'paac' 'samr' 'ulaw' 
    'MPG1' = MPEG Layer 1 (.mp1, .mpeg, .mpa)
               data_formats: '.mp1' 
    'MPG2' = MPEG Layer 2 (.mp2, .mpeg, .mpa)
               data_formats: '.mp2' 
    'MPG3' = MPEG Layer 3 (.mp3, .mpeg, .mpa)
               data_formats: '.mp3' 
    'mp4f' = MPEG-4 Audio (.mp4)
               data_formats: 'aac ' 'aace' 'aach' 'aacl' 'aacp' 
    'NeXT' = NeXT/Sun (.snd, .au)
               data_formats: I8 BEI16 BEI24 BEI32 BEF32 BEF64 'ulaw' 
    'Sd2f' = Sound Designer II (.sd2)
               data_formats: I8 BEI16 BEI24 BEI32 
    'WAVE' = WAVE (.wav)
               data_formats: UI8 LEI16 LEI24 LEI32 LEF32 LEF64 'ulaw' 
                             'alaw' 
&lt;/pre&gt;&lt;br /&gt;
There is "MPG3" in a list of supported formats, but &lt;a href="http://stackoverflow.com/questions/435349/how-to-use-afconvert-to-convert-from-caf-to-mp3-format"&gt;Mac doesn't provide any MP3 encoder&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ afconvert -f MPG3 -d '.mp3' happykids.wav 
Error: ExtAudioFileSetProperty ('cfmt') failed ('fmt?')

$ afconvert -f m4af -d aac happykids.wav

$ afinfo happykids.m4a 
File:           happykids.m4a
File type ID:   m4af
Data format:     1 ch,  11025 Hz, 'aac ' (0x00000000) 0 bits/channel, 0 bytes/packet, 1024 frames/packet, 0 bytes/frame
Channel layout: Mono
estimated duration: 5.576417 sec
audio bytes: 15950
audio packets: 63
audio 61480 valid frames + 2112 priming + 920 remainder = 64512
bit rate: 21806 bits per second
packet size upper bound: 399
audio data file offset: 4096
optimized
format list:
[ 0] format:     1 ch,  11025 Hz, 'aac ' (0x00000000) 0 bits/channel, 0 bytes/packet, 1024 frames/packet, 0 bytes/frame
     Channel layout: Mono
source bit depth: I8
----
&lt;/pre&gt;&lt;br /&gt;
&lt;h4&gt;afplay&lt;/h4&gt;&lt;br /&gt;
&lt;a href="https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/afplay.1.html"&gt;afplay&lt;/a&gt; is a command for playback of audio file. Probably, the supported formats are same as afconvert.&lt;br /&gt;
&lt;br /&gt;
I found some weblogs which said that the sound quality of afplay is better than iTunes. But I can't tell the difference.&lt;br /&gt;
&lt;br /&gt;
Thanks.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4078805449160415851-1668378346653923193?l=laclefyoshi.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/KhHFeUetW7whxHyorkc6qrtMnKY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KhHFeUetW7whxHyorkc6qrtMnKY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/KhHFeUetW7whxHyorkc6qrtMnKY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KhHFeUetW7whxHyorkc6qrtMnKY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Engineeringexception/~4/LWFhIbNy9FE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://laclefyoshi.blogspot.com/feeds/1668378346653923193/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://laclefyoshi.blogspot.com/2012/02/af-command-for-treating-audio-files-in.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/1668378346653923193?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/1668378346653923193?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Engineeringexception/~3/LWFhIbNy9FE/af-command-for-treating-audio-files-in.html" title="af* command for treating audio files in Mac" /><author><name>Yoshiyasu SAEKI</name><uri>https://profiles.google.com/101384646867143843419</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-xEHAXnqop_Y/AAAAAAAAAAI/AAAAAAAAAYc/SuLwm9MVzDM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://laclefyoshi.blogspot.com/2012/02/af-command-for-treating-audio-files-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0cMQ38zcCp7ImA9WhRbEE0.&quot;"><id>tag:blogger.com,1999:blog-4078805449160415851.post-6633026828374768608</id><published>2012-01-30T22:20:00.000+09:00</published><updated>2012-01-31T20:24:42.188+09:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-31T20:24:42.188+09:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="pdf" /><category scheme="http://www.blogger.com/atom/ns#" term="applescript" /><title>Removing margins of PDF generated by iBooks Author</title><content type="html">&lt;br /&gt;
&lt;a href="http://www.apple.com/ibooks-author/"&gt;iBooks Author&lt;/a&gt; is very solicitous and beautiful Desktop publishing tool. But I have a complaint about this. It is that margins and a watermark break into PDF generated by iBooks Author.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-SOx6O5G5nMM/TyUL2lNMGhI/AAAAAAAAAfc/_1two7o__zk/s1600/toaru.pdf%25EF%25BC%25884_4%25E3%2583%259A%25E3%2583%25BC%25E3%2582%25B8%25EF%25BC%2589.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="294" width="400" src="http://2.bp.blogspot.com/-SOx6O5G5nMM/TyUL2lNMGhI/AAAAAAAAAfc/_1two7o__zk/s400/toaru.pdf%25EF%25BC%25884_4%25E3%2583%259A%25E3%2583%25BC%25E3%2582%25B8%25EF%25BC%2589.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Probably, Apple indicate PDF generated by iBooks Author should not be published because they think that the function of exporting PDF should be used for confirming the content and layout on Mac when we don't have iPad accidentally.&lt;br /&gt;
&lt;br /&gt;
But, I want to make ebooks with iBooks Author and publish them in good-looking and widely-used PDF on the Web, too.&lt;br /&gt;
&lt;br /&gt;
I tried to remove margins from PDF generated iBooks Author in two ways.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;pdfcrop&lt;/h4&gt;&lt;br /&gt;
&lt;a href="http://pdfcrop.sourceforge.net/"&gt;pdfcrop&lt;/a&gt; is a software for removing margins from PDF. This is supplied with &lt;a href="http://www.tug.org/texlive/"&gt;TeX Live&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
pdfcrop automatically recognizes margins in PDF. But pdfcrop without options yields a disappointing result from PDF genetated by iBooks Author because there is a watermark "&amp;#63743; iBooks Author" in the bottom of it. Therefore, we need to add options for specifying the size of the bottom margin.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ time pdfcrop --margins "0 0 0 -55" ibooks_pdf.pdf ibooks_pdf_cropped.pdf
PDFCROP 1.32, 2011/08/10 - Copyright (c) 2002-2011 by Heiko Oberdiek.
==&amp;gt; 4 pages written on `ibooks_pdf_cropped.pdf'.

real    2m51.121s
user    2m43.072s
sys     0m0.714s
&lt;/pre&gt;&lt;br /&gt;
It took a few minutes to remove margins of 4 pages of PDF.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-prEbVsmPMS4/TyUMP-lUgTI/AAAAAAAAAfo/SCwprqHuqY8/s1600/toaru2.pdf%25EF%25BC%25884_4%25E3%2583%259A%25E3%2583%25BC%25E3%2582%25B8%25EF%25BC%2589.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="265" width="400" src="http://3.bp.blogspot.com/-prEbVsmPMS4/TyUMP-lUgTI/AAAAAAAAAfo/SCwprqHuqY8/s400/toaru2.pdf%25EF%25BC%25884_4%25E3%2583%259A%25E3%2583%25BC%25E3%2582%25B8%25EF%25BC%2589.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ identify ibooks_pdf.pdf
ibooks_pdf.pdf[0] PDF 1024x748 1024x748+0+0 16-bit Bilevel DirectClass 95.8KB 0.010u 0:00.009
ibooks_pdf.pdf[1] PDF 1024x748 1024x748+0+0 16-bit Bilevel DirectClass 95.8KB 0.000u 0:00.009
ibooks_pdf.pdf[2] PDF 1024x748 1024x748+0+0 16-bit Bilevel DirectClass 95.8KB 0.000u 0:00.009
ibooks_pdf.pdf[3] PDF 1024x748 1024x748+0+0 16-bit Bilevel DirectClass 95.8KB 0.000u 0:00.009

$ identify ibooks_pdf_cropped.pdf
ibooks_pdf_cropped.pdf[0] PDF 922x598 922x598+0+0 16-bit Bilevel DirectClass 69.4KB 0.000u 0:00.019
ibooks_pdf_cropped.pdf[1] PDF 922x598 922x598+0+0 16-bit Bilevel DirectClass 69.4KB 0.000u 0:00.019
ibooks_pdf_cropped.pdf[2] PDF 922x598 922x598+0+0 16-bit Bilevel DirectClass 69.4KB 0.000u 0:00.019
ibooks_pdf_cropped.pdf[3] PDF 922x598 922x598+0+0 16-bit Bilevel DirectClass 69.4KB 0.000u 0:00.019
&lt;/pre&gt;&lt;br /&gt;
The result is good, but character information of all pages are lost. Thus, we can't select text on the processed PDF because all pages are imaged.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;PDF hack&lt;/h4&gt;&lt;br /&gt;
PDF can have information for the paper size (&lt;code&gt;MediaBox&lt;/code&gt;) and the display size (&lt;code&gt;CropBox&lt;/code&gt;). There is &lt;code&gt;MediaBox&lt;/code&gt; in PDF generated by iBooks Author, but there is not &lt;code&gt;CropBox&lt;/code&gt;. I added &lt;code&gt;CropBox&lt;/code&gt; into PDF with shell command. The size was decided by the result of being processed by pdfcrop.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ time sed -e 's;/MediaBox;/CropBox [52 75 973 673] /MediaBox;g' ibooks_pdf.pdf &gt; ibooks_pdf_cropped.pdf

real    0m0.004s
user    0m0.002s
sys     0m0.003s
&lt;/pre&gt;&lt;br /&gt;
The process was complete in a moment. I confirmed that the processed PDF can be rendered with Preview.app and Google Chrome (Chrome PDF Viewer plugin). But it seems that some application can't reder the processed PDF.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-Nb2q0Bd51Yc/TyUMtHmY4gI/AAAAAAAAAf0/kQv0x2PUShU/s1600/%25E3%2582%25A4%25E3%2583%25B3%25E3%2582%25B9%25E3%2583%259A%25E3%2582%25AF%25E3%2582%25BF.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="166" width="333" src="http://4.bp.blogspot.com/-Nb2q0Bd51Yc/TyUMtHmY4gI/AAAAAAAAAf0/kQv0x2PUShU/s400/%25E3%2582%25A4%25E3%2583%25B3%25E3%2582%25B9%25E3%2583%259A%25E3%2582%25AF%25E3%2582%25BF.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ identify ibooks_pdf_cropped.pdf 
   **** Warning:  An error occurred while reading an XREF table.
   **** The file has been damaged.  This may have been caused
   **** by a problem while converting or transfering the file.
   **** Ghostscript will attempt to recover the data.

   **** This file had errors that were repaired or ignored.
   **** The file was produced by: 
   **** &amp;gt;&amp;gt;&amp;gt;&amp;gt; Mac OS X 10.7.2 Quartz PDFContext &amp;lt;&amp;lt;&amp;lt;&amp;lt;
   **** Please notify the author of the software that produced this
   **** file that it does not conform to Adobe's published PDF
   **** specification.

ibooks_pdf_cropped.pdf[0] PDF 1024x748 1024x748+0+0 16-bit Bilevel DirectClass 95.8KB 0.010u 0:00.019
ibooks_pdf_cropped.pdf[1] PDF 1024x748 1024x748+0+0 16-bit Bilevel DirectClass 95.8KB 0.000u 0:00.019
ibooks_pdf_cropped.pdf[2] PDF 1024x748 1024x748+0+0 16-bit Bilevel DirectClass 95.8KB 0.000u 0:00.009
ibooks_pdf_cropped.pdf[3] PDF 1024x748 1024x748+0+0 16-bit Bilevel DirectClass 95.8KB 0.000u 0:00.009
&lt;/pre&gt;&lt;br /&gt;
I wrote AppleScript droplet and created the project for simplifying the process to crop PDF by sed.&lt;br /&gt;
&lt;br /&gt;
&lt;script src="https://gist.github.com/1652708.js"&gt; &lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href="https://bitbucket.org/laclefyoshi/cropping_ibooksauthor_pdf"&gt;laclefyoshi / cropping_ibooksauthor_pdf / overview — Bitbucket&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
Thanks.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4078805449160415851-6633026828374768608?l=laclefyoshi.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/5hCyGCNL2-4Ui6nO2mpKK0HUNkQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5hCyGCNL2-4Ui6nO2mpKK0HUNkQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/5hCyGCNL2-4Ui6nO2mpKK0HUNkQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5hCyGCNL2-4Ui6nO2mpKK0HUNkQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Engineeringexception/~4/zHTQfY1znFI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://laclefyoshi.blogspot.com/feeds/6633026828374768608/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://laclefyoshi.blogspot.com/2012/01/removing-margins-of-pdf-generated-by.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/6633026828374768608?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/6633026828374768608?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Engineeringexception/~3/zHTQfY1znFI/removing-margins-of-pdf-generated-by.html" title="Removing margins of PDF generated by iBooks Author" /><author><name>Yoshiyasu SAEKI</name><uri>https://profiles.google.com/101384646867143843419</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-xEHAXnqop_Y/AAAAAAAAAAI/AAAAAAAAAYc/SuLwm9MVzDM/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-SOx6O5G5nMM/TyUL2lNMGhI/AAAAAAAAAfc/_1two7o__zk/s72-c/toaru.pdf%25EF%25BC%25884_4%25E3%2583%259A%25E3%2583%25BC%25E3%2582%25B8%25EF%25BC%2589.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://laclefyoshi.blogspot.com/2012/01/removing-margins-of-pdf-generated-by.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUMCRHg8fSp7ImA9WhRUEUw.&quot;"><id>tag:blogger.com,1999:blog-4078805449160415851.post-5944242416681441779</id><published>2012-01-21T12:44:00.000+09:00</published><updated>2012-01-21T12:44:25.675+09:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-21T12:44:25.675+09:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="jython" /><category scheme="http://www.blogger.com/atom/ns#" term="python" /><title>Outputting data for people with tablib</title><content type="html">&lt;br /&gt;
In order to show some data in processing to others (that are boss or client in business), I think it tiresome to copy and paste data into Excel sheets or export HTML tables.&lt;br /&gt;
&lt;br /&gt;
I found &lt;a href="http://pypi.python.org/pypi/tablib"&gt;tablib&lt;/a&gt; that is a library for formatting data as tabular form or semistructured form.&lt;br /&gt;
&lt;br /&gt;
&lt;script src="https://gist.github.com/1651161.js"&gt; &lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;== show attributes of Dataset ==
['_Dataset__headers', '__class__', '__delattr__', '__delitem__', '__dict__', '__doc__', '__format__', '__getattribute__', '__getitem__', '__hash__', '__init__', '__len__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_clean_col', '_data', '_formatters', '_get_dict', '_get_headers', '_package', '_register_formats', '_separators', '_set_dict', '_set_headers', '_validate', 'add_formatter', 'append', 'append_col', 'append_separator', 'csv', 'dict', 'filter', 'headers', 'height', 'html', 'insert', 'insert_col', 'insert_separator', 'json', 'lpop', 'lpush', 'lpush_col', 'ods', 'pop', 'rpop', 'rpush', 'rpush_col', 'sort', 'stack', 'stack_cols', 'title', 'transpose', 'tsv', 'width', 'wipe', 'xls', 'xlsx', 'yaml']

== output as dict ==
[OrderedDict([('name', 'Alice'), ('age', 21)]), OrderedDict([('name', 'Bob'), ('age', 20)]), OrderedDict([('name', 'Carol'), ('age', 31)]), OrderedDict([('name', 'Taro'), ('age', 10)])]

== output as json ==
[{"name": "Alice", "age": 21}, {"name": "Bob", "age": 20}, {"name": "Carol", "age": 31}, {"name": "Taro", "age": 10}]

== output only female as json ==
[{"name": "Alice", "age": 21}, {"name": "Carol", "age": 31}]

== output as csv ==
name,age,e/o
Alice,21,odd
Bob,20,even
Carol,31,odd
Taro,10,even


== show attributes of Databook ==
['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_datasets', '_package', '_register_formats', 'add_sheet', 'html', 'json', 'ods', 'size', 'wipe', 'xls', 'xlsx', 'yaml']

== output 2 sheets as yaml ==
- !!python/object/apply:collections.OrderedDict
  - - - data
      - - !!python/object/apply:collections.OrderedDict
          - - [name, Alice]
            - [age, 21]
            - [e/o, odd]
        - !!python/object/apply:collections.OrderedDict
          - - [name, Bob]
            - [age, 20]
            - [e/o, even]
        - !!python/object/apply:collections.OrderedDict
          - - [name, Carol]
            - [age, 31]
            - [e/o, odd]
        - !!python/object/apply:collections.OrderedDict
          - - [name, Taro]
            - [age, 10]
            - [e/o, even]
    - [title, null]
- !!python/object/apply:collections.OrderedDict
  - - - data
      - - !!python/object/apply:collections.OrderedDict
          - - [name, Alice]
            - [age, 21]
            - [e/o, odd]
        - !!python/object/apply:collections.OrderedDict
          - - [name, Bob]
            - [age, 20]
            - [e/o, even]
        - !!python/object/apply:collections.OrderedDict
          - - [name, Carol]
            - [age, 31]
            - [e/o, odd]
        - !!python/object/apply:collections.OrderedDict
          - - [name, Taro]
            - [age, 10]
            - [e/o, even]
    - [title, null]


== output 2 sheets as html ==
&amp;lt;h3&amp;gt;Set 0&amp;lt;/h3&amp;gt;
&amp;lt;table&amp;gt;
&amp;lt;thead&amp;gt;
&amp;lt;tr&amp;gt;&amp;lt;th&amp;gt;name&amp;lt;/th&amp;gt;
&amp;lt;th&amp;gt;age&amp;lt;/th&amp;gt;
&amp;lt;th&amp;gt;e/o&amp;lt;/th&amp;gt;&amp;lt;/tr&amp;gt;
&amp;lt;/thead&amp;gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Alice&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;21&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;odd&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Bob&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;20&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;even&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Carol&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;31&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;odd&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Taro&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;10&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;even&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
&amp;lt;/table&amp;gt;
&amp;lt;h3&amp;gt;Set 1&amp;lt;/h3&amp;gt;
&amp;lt;table&amp;gt;
&amp;lt;thead&amp;gt;
&amp;lt;tr&amp;gt;&amp;lt;th&amp;gt;name&amp;lt;/th&amp;gt;
&amp;lt;th&amp;gt;age&amp;lt;/th&amp;gt;
&amp;lt;th&amp;gt;e/o&amp;lt;/th&amp;gt;&amp;lt;/tr&amp;gt;
&amp;lt;/thead&amp;gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Alice&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;21&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;odd&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Bob&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;20&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;even&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Carol&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;31&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;odd&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Taro&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;10&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;even&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
&amp;lt;/table&amp;gt;


&lt;/pre&gt;&lt;br /&gt;
Unfortunately, tablib can't be used in Jython. According to error message, this problem is caused by &lt;code&gt;grammer.py&lt;/code&gt; in &lt;a href="http://pypi.python.org/pypi/odfpy"&gt;odfpy&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ jython
Jython 2.5.2 (Release_2_5_2:7206, Mar 2 2011, 23:12:06)
[Java HotSpot(TM) 64-Bit Server VM (Apple Inc.)] on java1.6.0_29
Type "help", "copyright", "credits" or "license" for more information.
&amp;gt;&amp;gt;&amp;gt; import tablib
Traceback (most recent call last):
  File "&amp;lt;string&amp;gt;", line 1, in &amp;lt;module&amp;gt;
  File "tablib/__init__.py", line 3, in &amp;lt;module&amp;gt;
    from tablib.core import (
  File "tablib/core.py", line 15, in &amp;lt;module&amp;gt;
    from tablib import formats
  File "tablib/formats/__init__.py", line 6, in &amp;lt;module&amp;gt;
    from . import _csv as csv
  File "tablib/formats/_csv.py", line 6, in &amp;lt;module&amp;gt;
    from tablib.compat import is_py3, csv, StringIO
  File "tablib/compat.py", line 45, in &amp;lt;module&amp;gt;
    from tablib.packages.odf import opendocument, style, text, table
  File "tablib/packages/odf/opendocument.py", line 26, in &amp;lt;module&amp;gt;
    import manifest, meta
  File "tablib/packages/odf/manifest.py", line 24, in &amp;lt;module&amp;gt;
    from element import Element
  File "tablib/packages/odf/element.py", line 28, in &amp;lt;module&amp;gt;
    import grammar
java.lang.ClassFormatError: Invalid method Code length 370403 in class file tablib/packages/odf/grammar$py
 at java.lang.ClassLoader.defineClass1(Native Method)
 at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
 at org.python.core.BytecodeLoader$Loader.loadClassFromBytes(BytecodeLoader.java:119)

...

java.lang.ClassFormatError: java.lang.ClassFormatError: Invalid method Code length 370403 in class file tablib/packages/odf/grammar$py
&lt;/pre&gt;&lt;br /&gt;
When I disabled importing pyodf, tablib can be used in Jython.&lt;br /&gt;
&lt;br /&gt;
&lt;script src="https://gist.github.com/1650970.js"&gt; &lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ python
&amp;gt;&amp;gt;&amp;gt; import tablib
&amp;gt;&amp;gt;&amp;gt; print tablib.formats.available
(&amp;lt;module 'tablib.formats._json' from 'tablib/formats/_json.py'&amp;gt;, &amp;lt;module 'tablib.formats._xls' from 'tablib/formats/_xls.py'&amp;gt;, &amp;lt;module 'tablib.formats._yaml' from 'tablib/formats/_yaml.py'&amp;gt;, &amp;lt;module 'tablib.formats._csv' from 'tablib/formats/_csv.py'&amp;gt;, &amp;lt;module 'tablib.formats._tsv' from 'tablib/formats/_tsv.py'&amp;gt;, &amp;lt;module 'tablib.formats._html' from 'tablib/formats/_html.py'&amp;gt;, &amp;lt;module 'tablib.formats._xlsx' from 'tablib/formats/_xlsx.py'&amp;gt;, &amp;lt;module 'tablib.formats._ods' from 'tablib/formats/_ods.py'&amp;gt;)

$ jython
&amp;gt;&amp;gt;&amp;gt; import tablib
&amp;gt;&amp;gt;&amp;gt; print tablib.formats.available
(&amp;lt;module 'tablib.formats._json' from 'tablib/formats/_json.py'&amp;gt;, &amp;lt;module 'tablib.formats._xls' from 'tablib/formats/_xls.py'&amp;gt;, &amp;lt;module 'tablib.formats._yaml' from 'tablib/formats/_yaml.py'&amp;gt;, &amp;lt;module 'tablib.formats._csv' from 'tablib/formats/_csv.py'&amp;gt;, &amp;lt;module 'tablib.formats._tsv' from 'tablib/formats/_tsv.py'&amp;gt;, &amp;lt;module 'tablib.formats._html' from 'tablib/formats/_html.py'&amp;gt;, &amp;lt;module 'tablib.formats._xlsx' from 'tablib/formats/_xlsx.py'&amp;gt;)
&lt;/pre&gt;&lt;br /&gt;
Thanks.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4078805449160415851-5944242416681441779?l=laclefyoshi.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/0l-IB9fr7mHjgDmE8RZv2CwGb8I/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0l-IB9fr7mHjgDmE8RZv2CwGb8I/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/0l-IB9fr7mHjgDmE8RZv2CwGb8I/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0l-IB9fr7mHjgDmE8RZv2CwGb8I/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Engineeringexception/~4/n7E7DwVaoy0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://laclefyoshi.blogspot.com/feeds/5944242416681441779/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://laclefyoshi.blogspot.com/2012/01/outputting-data-for-people-with-tablib.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/5944242416681441779?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/5944242416681441779?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Engineeringexception/~3/n7E7DwVaoy0/outputting-data-for-people-with-tablib.html" title="Outputting data for people with tablib" /><author><name>Yoshiyasu SAEKI</name><uri>https://profiles.google.com/101384646867143843419</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-xEHAXnqop_Y/AAAAAAAAAAI/AAAAAAAAAYc/SuLwm9MVzDM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://laclefyoshi.blogspot.com/2012/01/outputting-data-for-people-with-tablib.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0MAQ3w5fyp7ImA9WhRWGEg.&quot;"><id>tag:blogger.com,1999:blog-4078805449160415851.post-6892302094831023809</id><published>2012-01-06T23:17:00.000+09:00</published><updated>2012-01-06T23:17:22.227+09:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-06T23:17:22.227+09:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="xmpp" /><category scheme="http://www.blogger.com/atom/ns#" term="python" /><category scheme="http://www.blogger.com/atom/ns#" term="notifo" /><title>XMPP client for monitoring messages from im.kayac.com</title><content type="html">&lt;br /&gt;
I'm very sorry and somewhat surprised to hear that &lt;a href="http://notifo.com/"&gt;Notifo&lt;/a&gt; will be closed. But there is &lt;a href="http://im.kayac.com/"&gt;im.kayac.com&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Notifo provided Android app, but im.kayac.com doesn't. All messages from (to?) im.kayac.com can be forwarded to &lt;a href="http://www.google.com/talk/"&gt;Google Talk&lt;/a&gt; (we need to enroll "api@im.kayac.com" in known list of Google Talk in advance). And Android devices have Google Takl client. Additionally, we can use multiple accounts of Google Talk with &lt;a href="https://imo.im/android"&gt;imo for Android&lt;/a&gt; and &lt;a href="https://imo.im/iphone"&gt;imo for iPhone&lt;/a&gt;. So we can use im.kayac.com as push notification service corresponding to multiple platform.&lt;br /&gt;
&lt;br /&gt;
We can do a thing that we can't with Notifo. That is monitoring messages from im.kayac.com on PC.&lt;br /&gt;
&lt;br /&gt;
I wrote a XMPP client in Python and tried to monitor messages from im.kayac.com. I used &lt;a href="https://github.com/fritzy/SleekXMPP"&gt;SleekXMPP&lt;/a&gt; as library for processing XMPP protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;script src="https://gist.github.com/1570732.js"&gt; &lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
A code for posting a message to im.kayac.com is very simple.&lt;br /&gt;
&lt;br /&gt;
&lt;script src="https://gist.github.com/1570745.js"&gt; &lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ python post_im_kayac_com.py 
{"error":"","id":null,"result":"posted"}
&lt;/pre&gt;&lt;pre class="prettyprint"&gt;$ python bot_im_kayac_com.py 
WARNING  dnspython is not installed -- relying on OS A record resolution
INFO     Negotiating TLS
INFO     Using SSL version: 3
INFO     Node set to: MY_GTAKL_ID/*********

This is a test message
&lt;/pre&gt;&lt;br /&gt;
For example, PC can automatically do something and can make Arduino do something in response to messages from im.kayac.com with this XMPP client.&lt;br /&gt;
&lt;br /&gt;
Thanks.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4078805449160415851-6892302094831023809?l=laclefyoshi.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/rt1fiJWI37Thl01gq8a8RHRakPg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rt1fiJWI37Thl01gq8a8RHRakPg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/rt1fiJWI37Thl01gq8a8RHRakPg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rt1fiJWI37Thl01gq8a8RHRakPg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Engineeringexception/~4/LtAnPk3xWDM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://laclefyoshi.blogspot.com/feeds/6892302094831023809/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://laclefyoshi.blogspot.com/2012/01/xmpp-client-for-monitoring-messages.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/6892302094831023809?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/6892302094831023809?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Engineeringexception/~3/LtAnPk3xWDM/xmpp-client-for-monitoring-messages.html" title="XMPP client for monitoring messages from im.kayac.com" /><author><name>Yoshiyasu SAEKI</name><uri>https://profiles.google.com/101384646867143843419</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-xEHAXnqop_Y/AAAAAAAAAAI/AAAAAAAAAYc/SuLwm9MVzDM/s512-c/photo.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://laclefyoshi.blogspot.com/2012/01/xmpp-client-for-monitoring-messages.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0UGRHc6cCp7ImA9WhRXFUg.&quot;"><id>tag:blogger.com,1999:blog-4078805449160415851.post-984071981434828219</id><published>2011-12-22T22:07:00.000+09:00</published><updated>2011-12-22T22:07:05.918+09:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-22T22:07:05.918+09:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="chrome" /><title>Chrome Extension: Amazon to Yahoo! Bookstore</title><content type="html">&lt;br /&gt;
Yahoo! Bookstore (Y!B) is a service of Yahoo! Japan. It is similar to iBookstore. Because Y!B sells EPUB files which contain DRM and provides viewer applications for Android and Windows PC (additionally, it shows that it has a plan for providing applications for iOS and Mac).&lt;br /&gt;
&lt;br /&gt;
Incidentally, Apple doesn't launch iBookstore in earnest in Japan. We can download free EPUB files only.&lt;br /&gt;
&lt;br /&gt;
Y!B is new and the functions are inconvenient. We know convenient recommendation system such as Amazon, but Y!B does't have the function.&lt;br /&gt;
&lt;br /&gt;
I forgot to write the other thing. Amazon also doesn't launch Kindle eco-system in Japan. There was report that Amazon will start to sell Kindle and Kindle e-books before the end of the year in Japan. But there isn't follow-up. What's in japanese publishers' mind?&lt;br /&gt;
&lt;br /&gt;
So, I developed a chrome extension for connecting Y!B with Amazon.co.jp.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href="https://chrome.google.com/webstore/detail/lclpbjfdfhlogldggpfbmdkacpbmmldm"&gt;Chrome Web Store - Amazon to Yahoo! Bookstore&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-cVRAD0cMEvI/TvMq3NVixdI/AAAAAAAAAbI/oDtl7ho9Qrw/s1600/unnamed.jpg" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="250" width="400" src="http://4.bp.blogspot.com/-cVRAD0cMEvI/TvMq3NVixdI/AAAAAAAAAbI/oDtl7ho9Qrw/s400/unnamed.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
This extension adds buttons for Y!B search link into Amazon's page. By using this, Amazon's great system for discoverying real books can be diverted for discoverying e-books in Y!B.&lt;br /&gt;
&lt;br /&gt;
EPUB files of Y!B are few as compared to iBookstore or Kindle store. But there are many comics comparatively. I hope that major e-books services are launched in Japan as quickly as possible.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4078805449160415851-984071981434828219?l=laclefyoshi.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ekviyqnE0sBFMCjUG5aPrcLcdfw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ekviyqnE0sBFMCjUG5aPrcLcdfw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ekviyqnE0sBFMCjUG5aPrcLcdfw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ekviyqnE0sBFMCjUG5aPrcLcdfw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Engineeringexception/~4/wTtQE2sbwyk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://laclefyoshi.blogspot.com/feeds/984071981434828219/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://laclefyoshi.blogspot.com/2011/12/chrome-extension-amazon-to-yahoo.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/984071981434828219?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/984071981434828219?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Engineeringexception/~3/wTtQE2sbwyk/chrome-extension-amazon-to-yahoo.html" title="Chrome Extension: Amazon to Yahoo! Bookstore" /><author><name>Yoshiyasu SAEKI</name><uri>https://profiles.google.com/101384646867143843419</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-xEHAXnqop_Y/AAAAAAAAAAI/AAAAAAAAAYc/SuLwm9MVzDM/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-cVRAD0cMEvI/TvMq3NVixdI/AAAAAAAAAbI/oDtl7ho9Qrw/s72-c/unnamed.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://laclefyoshi.blogspot.com/2011/12/chrome-extension-amazon-to-yahoo.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkMBQnozfip7ImA9WhRQEUo.&quot;"><id>tag:blogger.com,1999:blog-4078805449160415851.post-132017442100583549</id><published>2011-12-06T22:29:00.001+09:00</published><updated>2011-12-06T22:34:13.486+09:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-06T22:34:13.486+09:00</app:edited><title>Calculation on terminal</title><content type="html">&lt;br /&gt;
I calculated &lt;code&gt;1 + 1&lt;/code&gt; in several ways on a terminal when I was free (but I pretended to work).&lt;br /&gt;
&lt;br /&gt;
Rule:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;I started with a situation where the terminal shows only &lt;code&gt;$ &lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;I counted the number of all characters input (including &lt;code&gt;LF&lt;code&gt;) to get answer: &lt;code&gt;2&lt;/code&gt; and be displayed &lt;code&gt;$ &lt;/code&gt; again.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;h4&gt;interpreter: command line argument&lt;/h4&gt;&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ emacs -q -batch -eval '(print (+ 1 1))'  # chars: 40
Loading subst-ksc...
Loading subst-gb2312...
Loading subst-big5...
Loading subst-jis...

2 

$ awk 'BEGIN{print 1+1}'  # chars: 23
2

$ python -c 'print 1+1'   # chars: 22
2

$ perl -e 'print 1+1'     # chars: 20
2 

$ php -r 'echo 1+1;'      # chars: 19
2

$ ruby -e 'p 1+1'         # chars: 16
2
&lt;/pre&gt;&lt;br /&gt;
&lt;h4&gt;calculator&lt;/h4&gt;&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ dc -e '1 1+p'  # chars: 14
2

$ echo 1+1|bc    # chars: 12
2

$ expr 1 + 1     # chars: 11
2
&lt;/pre&gt;&lt;br /&gt;
&lt;h4&gt;bash&lt;/h4&gt;&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ echo $((1+1))  # chars: 14
2

$ $((1+1))       # chars: 9
bash: 2: command not found 
&lt;/pre&gt;&lt;br /&gt;
To tell the truth, my &lt;a href="http://en.wikipedia.org/wiki/GNU_Screen"&gt;screen&lt;/a&gt;'s window &amp;lt;0&amp;gt; is always runs Python interpreter. So I don't need to wonder what to use. This is just for the fun of it.&lt;br /&gt;
&lt;br /&gt;
Thanks.&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4078805449160415851-132017442100583549?l=laclefyoshi.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/R45uwLMN2WsvL2dKCxLsQugb7fY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/R45uwLMN2WsvL2dKCxLsQugb7fY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/R45uwLMN2WsvL2dKCxLsQugb7fY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/R45uwLMN2WsvL2dKCxLsQugb7fY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Engineeringexception/~4/-TbwqbmlYGk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://laclefyoshi.blogspot.com/feeds/132017442100583549/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://laclefyoshi.blogspot.com/2011/12/calculation-on-terminal.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/132017442100583549?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/132017442100583549?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Engineeringexception/~3/-TbwqbmlYGk/calculation-on-terminal.html" title="Calculation on terminal" /><author><name>Yoshiyasu SAEKI</name><uri>https://profiles.google.com/101384646867143843419</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-xEHAXnqop_Y/AAAAAAAAAAI/AAAAAAAAAYc/SuLwm9MVzDM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://laclefyoshi.blogspot.com/2011/12/calculation-on-terminal.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUUNSH8yeip7ImA9WhRREkU.&quot;"><id>tag:blogger.com,1999:blog-4078805449160415851.post-1776238958690095709</id><published>2011-11-26T13:52:00.001+09:00</published><updated>2011-11-26T13:54:59.192+09:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-26T13:54:59.192+09:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><title>Build tools for Java project</title><content type="html">&lt;a href="http://maven.apache.org/"&gt;Apache Maven&lt;/a&gt; is hard to understand. I waste time on maintaining &lt;code&gt;pom.xml&lt;/code&gt; which lengthens out. &lt;a href="http://ant.apache.org/"&gt;Apache Ant&lt;/a&gt;'s &lt;code&gt;build.xml&lt;/code&gt; is in the same situation.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href="http://stackoverflow.com/questions/861382/why-does-maven-have-such-a-bad-rep"&gt;java - Why does Maven have such a bad rep? - Stack Overflow&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
I looked at &lt;a href="http://en.wikipedia.org/wiki/List_of_build_automation_software"&gt;List of build automation software&lt;/a&gt; and found some good build tools as a substitute for Maven and Ant. There are two requirements for build tools: not writing XML files and resolving dependencies automatically.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;SBT and leiningen&lt;/h4&gt;&lt;br /&gt;
&lt;a href="http://en.wikipedia.org/wiki/Simple_Build_Tool"&gt;SBT&lt;/a&gt; is a build tool for Scala project. &lt;a href="https://github.com/technomancy/leiningen"&gt;leiningen&lt;/a&gt; is for Clojure. They support Java projects too (but it looks that the support is as a bonus).&lt;br /&gt;
&lt;br /&gt;
We don't need to write XML files for managing project. They requires configuration file written in Scala or Clojure. They use Maven repositories for resolving dependencies.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;Buildr&lt;/h4&gt;&lt;br /&gt;
&lt;a href="http://en.wikipedia.org/wiki/Apache_Buildr"&gt;Apache Buildr&lt;/a&gt; is based on Ruby. Buildr supports Java, Scala, Groovy and Ruby projects.&lt;br /&gt;
&lt;br /&gt;
Of cource, the configuration files is written Ruby (&lt;a href="http://en.wikipedia.org/wiki/Rake_(software)"&gt;Rake&lt;/a&gt;). It uses Maven repositories for resolving dependencies.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;Gradle&lt;/h4&gt;&lt;br /&gt;
&lt;a href="http://en.wikipedia.org/wiki/Gradle"&gt;Gradle&lt;/a&gt; is similar to Buildr and is based on Groovy. Gradle supports  Java, Scala, Groovy and C++ (experimental) projects.&lt;br /&gt;
&lt;br /&gt;
Because Gradle is a follower project, it skims off other build tools. It is raw but is easy to install and use. Gradle's configuration files is written Groovy and it uses Maven repositories for resolving dependencies.&lt;br /&gt;
&lt;br /&gt;
The choice between Buildr and Gradle is the same as choice between Ruby and Groovy. If you be used to Ruby, you should use Buildr. If not, you might like to choice Gradle and write Groovy.&lt;br /&gt;
&lt;br /&gt;
I will rewrite some Maven projects as Gradle projects.&lt;br /&gt;
&lt;br /&gt;
Thanks.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4078805449160415851-1776238958690095709?l=laclefyoshi.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/5qbcFiE0pUtq7jAjZT_5TtZ0enU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5qbcFiE0pUtq7jAjZT_5TtZ0enU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/5qbcFiE0pUtq7jAjZT_5TtZ0enU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5qbcFiE0pUtq7jAjZT_5TtZ0enU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Engineeringexception/~4/YIgjPUxScuU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://laclefyoshi.blogspot.com/feeds/1776238958690095709/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://laclefyoshi.blogspot.com/2011/11/build-tools-for-java-project.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/1776238958690095709?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/1776238958690095709?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Engineeringexception/~3/YIgjPUxScuU/build-tools-for-java-project.html" title="Build tools for Java project" /><author><name>Yoshiyasu SAEKI</name><uri>https://profiles.google.com/101384646867143843419</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-xEHAXnqop_Y/AAAAAAAAAAI/AAAAAAAAAYc/SuLwm9MVzDM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://laclefyoshi.blogspot.com/2011/11/build-tools-for-java-project.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkIDSXsyeCp7ImA9WhRSEEU.&quot;"><id>tag:blogger.com,1999:blog-4078805449160415851.post-3179682181189985644</id><published>2011-11-12T15:27:00.001+09:00</published><updated>2011-11-12T15:49:38.590+09:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-12T15:49:38.590+09:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="jython" /><title>py_compile in Jython</title><content type="html">&lt;br /&gt;
There is not &lt;code&gt;jythonc&lt;/code&gt; in Jython 2.5.x. But there are two modules &lt;code&gt;py_compile&lt;/code&gt; and &lt;code&gt;compileall&lt;/code&gt; ported from Python.&lt;br /&gt;
&lt;br /&gt;
&lt;script src="https://gist.github.com/1360136.js"&gt; &lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ jython -m py_compile Calc.py
$ ls
Calc$py.class Calc.py
$ java -cp /opt/homebrew/Cellar/jython/2.5.2/libexec/jython.jar:. Calc\$py
init Calc
3
-1
6
3
&lt;/pre&gt;&lt;br /&gt;
I want to use this class file in Java. But I found that it was a pain.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ javap Calc\$py
Compiled from ".Users.yoshiyasu.Calc.py"
public class Calc$py extends org.python.core.PyFunctionTable implements org.python.core.PyRunnable{
    static Calc$py self;
    static final org.python.core.PyString _2;
    static final org.python.core.PyInteger _6;
    static final org.python.core.PyInteger _5;
    static final org.python.core.PyString _0;
    static final org.python.core.PyInteger _4;
    static final org.python.core.PyString _1;
    static final org.python.core.PyInteger _3;
    static final org.python.core.PyCode f$0;
    static final org.python.core.PyCode Calc$1;
    static final org.python.core.PyCode __init__$2;
    static final org.python.core.PyCode add$3;
    static final org.python.core.PyCode sub$4;
    static final org.python.core.PyCode mul$5;
    static final org.python.core.PyCode div$6;
    public org.python.core.PyObject f$0(org.python.core.PyFrame, org.python.core.ThreadState);
    public org.python.core.PyObject Calc$1(org.python.core.PyFrame, org.python.core.ThreadState);
    public org.python.core.PyObject __init__$2(org.python.core.PyFrame, org.python.core.ThreadState);
    public org.python.core.PyObject add$3(org.python.core.PyFrame, org.python.core.ThreadState);
    public org.python.core.PyObject sub$4(org.python.core.PyFrame, org.python.core.ThreadState);
    public org.python.core.PyObject mul$5(org.python.core.PyFrame, org.python.core.ThreadState);
    public org.python.core.PyObject div$6(org.python.core.PyFrame, org.python.core.ThreadState);
    public Calc$py(java.lang.String);
    public org.python.core.PyCode getMain();
    public static void main(java.lang.String[]);
    public static org.python.core.CodeBootstrap getCodeBootstrap();
    public org.python.core.PyObject call_function(int, org.python.core.PyFrame, org.python.core.ThreadState);
}
&lt;/pre&gt;&lt;br /&gt;
These names of methods are strange and these arguments are &lt;code&gt;org.python.core.PyFrame&lt;/code&gt; and &lt;code&gt;org.python.core.ThreadState&lt;/code&gt;. When using &lt;code&gt;jythonc&lt;/code&gt;, we could specify the methods' names and arguments with &lt;code&gt;@sig&lt;/code&gt; docstrings. But &lt;code&gt;py_compile&lt;/code&gt; can't read them.&lt;br /&gt;
&lt;br /&gt;
I want to minimize the writing Java code. It is good to use Java from Jython. I will write Scala code when using external codes from Java.&lt;br /&gt;
&lt;br /&gt;
Thanks.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4078805449160415851-3179682181189985644?l=laclefyoshi.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/tOEYPXD8tpeELPCov_i2xnZj0Nc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tOEYPXD8tpeELPCov_i2xnZj0Nc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/tOEYPXD8tpeELPCov_i2xnZj0Nc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tOEYPXD8tpeELPCov_i2xnZj0Nc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Engineeringexception/~4/tQ8vRoQjzfA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://laclefyoshi.blogspot.com/feeds/3179682181189985644/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://laclefyoshi.blogspot.com/2011/11/pycompile-in-jython.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/3179682181189985644?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/3179682181189985644?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Engineeringexception/~3/tQ8vRoQjzfA/pycompile-in-jython.html" title="py_compile in Jython" /><author><name>Yoshiyasu SAEKI</name><uri>https://profiles.google.com/101384646867143843419</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-xEHAXnqop_Y/AAAAAAAAAAI/AAAAAAAAAYc/SuLwm9MVzDM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://laclefyoshi.blogspot.com/2011/11/pycompile-in-jython.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkIASH4-eSp7ImA9WhRTFEs.&quot;"><id>tag:blogger.com,1999:blog-4078805449160415851.post-4639995533246902137</id><published>2011-11-05T12:42:00.000+09:00</published><updated>2011-11-05T12:42:29.051+09:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-05T12:42:29.051+09:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="google" /><title>Google Developer Day 2011 Tokyo</title><content type="html">&lt;br /&gt;
On November 3, &lt;a href="http://www.google.com/events/developerday/2011/tokyo/"&gt;Google Developer Day 2011 Japan&lt;/a&gt; was held in &lt;a href="http://en.wikipedia.org/wiki/Pacifico_Yokohama"&gt;Pacifico Yokohama&lt;/a&gt;. I could participate it because I'm a chrome extension developer and passed DevQuiz.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-l-pGJe-V8QY/TrSqK0UoLII/AAAAAAAAAZI/cmNNf4MfEE0/s1600/P1070457.JPG" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="300" width="400" src="http://2.bp.blogspot.com/-l-pGJe-V8QY/TrSqK0UoLII/AAAAAAAAAZI/cmNNf4MfEE0/s400/P1070457.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Because I'm interested in Android, I chose Android sessions of the lot. Android sessions contained the presentations about Android 4.0 (Ice Cream Sandwich), Android UI, ADK, etc. Others, there were sessions about HTML5, Google+ and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-bkw6LHBQk8U/TrSsZgDmcdI/AAAAAAAAAZU/js2sgLr5nqY/s1600/P1070472.JPG" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="300" width="400" src="http://3.bp.blogspot.com/-bkw6LHBQk8U/TrSsZgDmcdI/AAAAAAAAAZU/js2sgLr5nqY/s400/P1070472.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-p8hZNnuydg8/TrSsZ7xdYYI/AAAAAAAAAZk/4TXCwWxEZVM/s1600/P1070485.JPG" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="300" width="400" src="http://3.bp.blogspot.com/-p8hZNnuydg8/TrSsZ7xdYYI/AAAAAAAAAZk/4TXCwWxEZVM/s400/P1070485.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Google TV, Chromebook and ADK applications were exhibited. Also, Galaxy Nexus was shown by docomo.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-j0k9O8InYYw/TrSsb9-roZI/AAAAAAAAAZs/-56putArrsY/s1600/P1070479.JPG" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="300" width="400" src="http://1.bp.blogspot.com/-j0k9O8InYYw/TrSsb9-roZI/AAAAAAAAAZs/-56putArrsY/s400/P1070479.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
I got &lt;a href="http://www.zeemote.com/"&gt;Zeemote JS1&lt;/a&gt; that is bluetooth Mobile Gaming Controller for Android. This becomes a bluetooth (HID) mouse for Mac.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-2m3LdoJaYPA/TrSuzADLueI/AAAAAAAAAZ4/jg-cuK2jrBw/s1600/P1070511.JPG" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="300" width="400" src="http://2.bp.blogspot.com/-2m3LdoJaYPA/TrSuzADLueI/AAAAAAAAAZ4/jg-cuK2jrBw/s400/P1070511.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
I've learned by the great sessions and applications. I want to use the knowledge and skills by creating applications and participate Google Developer Day 2012.&lt;br /&gt;
&lt;br /&gt;
Thanks.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4078805449160415851-4639995533246902137?l=laclefyoshi.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/nbCYdBtJBhYZlKnjSxzlHyPB3Pc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nbCYdBtJBhYZlKnjSxzlHyPB3Pc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/nbCYdBtJBhYZlKnjSxzlHyPB3Pc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nbCYdBtJBhYZlKnjSxzlHyPB3Pc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Engineeringexception/~4/WMcSXph7EPc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://laclefyoshi.blogspot.com/feeds/4639995533246902137/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://laclefyoshi.blogspot.com/2011/11/google-developer-day-2011-tokyo.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/4639995533246902137?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/4639995533246902137?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Engineeringexception/~3/WMcSXph7EPc/google-developer-day-2011-tokyo.html" title="Google Developer Day 2011 Tokyo" /><author><name>Yoshiyasu SAEKI</name><uri>https://profiles.google.com/101384646867143843419</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-xEHAXnqop_Y/AAAAAAAAAAI/AAAAAAAAAYc/SuLwm9MVzDM/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-l-pGJe-V8QY/TrSqK0UoLII/AAAAAAAAAZI/cmNNf4MfEE0/s72-c/P1070457.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://laclefyoshi.blogspot.com/2011/11/google-developer-day-2011-tokyo.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkQBQHw4eCp7ImA9WhRTEE8.&quot;"><id>tag:blogger.com,1999:blog-4078805449160415851.post-6406102886770875814</id><published>2011-10-29T12:42:00.000+09:00</published><updated>2011-10-31T11:32:31.230+09:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-31T11:32:31.230+09:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="vim" /><category scheme="http://www.blogger.com/atom/ns#" term="emacs" /><title>Inserting package statement with vim and emacs</title><content type="html">&lt;div&gt;&lt;br /&gt;
I didn't previously have much of a sense of &lt;code&gt;package&lt;/code&gt; statement of Java because the libraries or applications I made were for only myself. But recently, I'm often well aware of the structure of &lt;code&gt;package&lt;/code&gt; on business because I'm in on multiple projects.&lt;br /&gt;
&lt;br /&gt;
When I create a new directory for a project, I use &lt;a href="http://maven.apache.org/"&gt;Maven&lt;/a&gt; and edit source code files with vim or emacs. If I use a rich IDE (e.g. Eclipse or NetBeans), &lt;code&gt;package&lt;/code&gt; statement is inserted automatically into a new file. But I don't use IDE on my office's low-powered computer and it's a pain to check the structure of directories and write &lt;code&gt;package&lt;/code&gt; statement by hand each time.&lt;br /&gt;
&lt;br /&gt;
So, I write vim script and emacs lisp for inserting proper &lt;code&gt;package&lt;/code&gt; statement into Java files.&lt;br /&gt;
&lt;br /&gt;
Maven creates the below directories by &lt;code&gt;mvn archetype:generate&lt;/code&gt;. I create a new Java file in &lt;code&gt;foo&lt;/code&gt; directory.&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;project_dir/
  |_ pom.xml
  |_ src/
       |_ main/
            |_ java/
                 |_ com/
                      |_ foo/
       |_ test/
            |_ java/
                 |_ com/
                      |_ foo/
&lt;/pre&gt;&lt;br /&gt;
&lt;h4&gt;vim script&lt;/h4&gt;&lt;br /&gt;
&lt;script src="https://gist.github.com/1324039.js"&gt; &lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;# open a new Java file
:call InsertPackagepath()
&lt;/pre&gt;&lt;br /&gt;
&lt;h4&gt;emacs lisp&lt;/h4&gt;&lt;br /&gt;
&lt;script src="https://gist.github.com/1324040.js"&gt; &lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;# open a new Java file
M-x eval-expression
(insert-packagepath)
&lt;/pre&gt;&lt;br /&gt;
Vim script is similar to Python code and easy to be written.&lt;br /&gt;
&lt;br /&gt;
Thanks.&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4078805449160415851-6406102886770875814?l=laclefyoshi.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/AG8N4Tzzn42YvM3cY63XFfE1KbY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AG8N4Tzzn42YvM3cY63XFfE1KbY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/AG8N4Tzzn42YvM3cY63XFfE1KbY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AG8N4Tzzn42YvM3cY63XFfE1KbY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Engineeringexception/~4/tl-1dmry7Lk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://laclefyoshi.blogspot.com/feeds/6406102886770875814/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://laclefyoshi.blogspot.com/2011/10/inserting-package-statement.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/6406102886770875814?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/6406102886770875814?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Engineeringexception/~3/tl-1dmry7Lk/inserting-package-statement.html" title="Inserting package statement with vim and emacs" /><author><name>Yoshiyasu SAEKI</name><uri>https://profiles.google.com/101384646867143843419</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-xEHAXnqop_Y/AAAAAAAAAAI/AAAAAAAAAYc/SuLwm9MVzDM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://laclefyoshi.blogspot.com/2011/10/inserting-package-statement.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkIBRH8-fSp7ImA9WhdaEko.&quot;"><id>tag:blogger.com,1999:blog-4078805449160415851.post-8199232000147586969</id><published>2011-10-22T18:09:00.001+09:00</published><updated>2011-10-22T18:09:15.155+09:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-22T18:09:15.155+09:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="xml" /><title>Tools for processing XML</title><content type="html">&lt;br /&gt;
&lt;a href="http://incubator.apache.org/oozie/"&gt;Apache Oozie&lt;/a&gt; is a management system for &lt;a href="http://hadoop.apache.org/"&gt;Apache Hadoop&lt;/a&gt; applications. Oozie reads configuration and controls actions described in  XML file (&lt;code&gt;workflow.xml&lt;/code&gt;).&lt;br /&gt;
&lt;br /&gt;
It is painful to write XML file directly. I found some tools for helping to write &lt;code&gt;workflow.xml&lt;/code&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;xmllint&lt;/h4&gt;&lt;br /&gt;
&lt;a href="http://xmlsoft.org/xmllint.html"&gt;xmllint&lt;/a&gt; is a tool for formatting and validating XML document.&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;xmllint --format XML_FILE &lt;/code&gt; outputs XML document which is reformatted and reindented.&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;xmllint --xinclude XML_FILE &lt;/code&gt; outputs XML document which is processed &lt;a href="http://www.w3.org/TR/xinclude/"&gt;XInclude&lt;/a&gt;. For example, a following XML document A is converted to XML document B.&lt;br /&gt;
&lt;br /&gt;
&lt;script src="https://gist.github.com/1305788.js"&gt; &lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ xmllint --xinclude --format workflow_a.xml
&lt;/pre&gt;&lt;br /&gt;
&lt;script src="https://gist.github.com/1305789.js"&gt; &lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
This document including XInclude element can't be dealt with xmllint (using libxml version 20703) on Mac OS X Lion, but is OK with xmllint (using libxml version 20626) on Linux.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ xmllint --xinclude workflow_a.xml 
workflow_a.xml:14: element include: XInclude error : XPointer evaluation failed: #xmlns(o=uri:oozie:workflow:0.1)  
    xpointer(//o:action[@name='common_properties']//o:configuration/*)
workflow_a.xml:14: element include: XInclude error : could not load common_properties.xml, and no fallback was found
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;xsltproc&lt;/h4&gt;&lt;br /&gt;
&lt;a href="http://xmlsoft.org/XSLT/xsltproc2.html"&gt;xsltproc&lt;/a&gt; is an engine for processing &lt;a href="http://www.w3.org/TR/xslt"&gt;XSLT&lt;/a&gt;. XSLT is a language for transforming XML documents into other XML documents.&lt;br /&gt;
&lt;br /&gt;
Oozie workflow unsupports cyclic flow. So, we need to transform looping workflow into linear workflow. XSLT supports such transformation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;Scala&lt;/h4&gt;&lt;br /&gt;
&lt;a href="http://www.scala-lang.org/"&gt;Scala&lt;/a&gt; has &lt;a href="http://www.scala-lang.org/api/current/index.html#scala.xml.package"&gt;scala.xml&lt;/a&gt; for handling XML documents as objects.&lt;br /&gt;
&lt;br /&gt;
XSLT is a bit complex and has some  a limit. For example, it is hard to write for-loop in XSLT. We can transform XML document or management multiple XML documents by writing Scala scripts easily.&lt;br /&gt;
&lt;br /&gt;
Oozie is convenient but is unfriendly, I hope that more good tools for Oozie appear.&lt;br /&gt;
&lt;br /&gt;
Thanks.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4078805449160415851-8199232000147586969?l=laclefyoshi.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/RrT9ZBd5SQOdKPHb6NU2b-p8vlw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RrT9ZBd5SQOdKPHb6NU2b-p8vlw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/RrT9ZBd5SQOdKPHb6NU2b-p8vlw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RrT9ZBd5SQOdKPHb6NU2b-p8vlw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Engineeringexception/~4/bHhVDZQuH4c" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://laclefyoshi.blogspot.com/feeds/8199232000147586969/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://laclefyoshi.blogspot.com/2011/10/tools-for-processing-xml.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/8199232000147586969?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/8199232000147586969?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Engineeringexception/~3/bHhVDZQuH4c/tools-for-processing-xml.html" title="Tools for processing XML" /><author><name>Yoshiyasu SAEKI</name><uri>https://profiles.google.com/101384646867143843419</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-xEHAXnqop_Y/AAAAAAAAAAI/AAAAAAAAAYc/SuLwm9MVzDM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://laclefyoshi.blogspot.com/2011/10/tools-for-processing-xml.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUIGQXs_eip7ImA9WhdbEEs.&quot;"><id>tag:blogger.com,1999:blog-4078805449160415851.post-4952473006812472413</id><published>2011-10-08T17:45:00.000+09:00</published><updated>2011-10-08T17:45:20.542+09:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-08T17:45:20.542+09:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="tex" /><category scheme="http://www.blogger.com/atom/ns#" term="perl" /><title>PerlTeX: Perl + LaTeX</title><content type="html">&lt;br /&gt;
&lt;a href="http://www.luatex.org/"&gt;LuaTeX&lt;/a&gt; is Lua + pdfTeX. The documents for LuaTeX can have macro written in Lua.  However, LuaTeX can't use latex document classes. I use &lt;a href="http://www.ctan.org/pkg/ptex"&gt;pTeX (pLaTeX)&lt;/a&gt; for publishing Japanese documents and use &lt;a href="http://oku.edu.mie-u.ac.jp/~okumura/jsclasses/"&gt;jsclasses&lt;/a&gt; as document class. But LuaTeX can't use this document class.&lt;br /&gt;
&lt;br /&gt;
I came across &lt;a href="http://www.ctan.org/tex-archive/macros/latex/contrib/perltex/"&gt;PerlTeX&lt;/a&gt; in TeXLive. We can write LaTeX macro in Perl with PerlTeX. PerlTeX works as preprocessor, so PerlTeX interprets macro written in Perl and applies the macro to the document. Any LaTeX interpreters can be specified for interpreting the document after PerlTeX processing (default: latex). Therefore, pLaTeX and jsclasses can be used with PerlTeX. PerlTeX is easier to use than LuaTeX for Japanese.&lt;br /&gt;
&lt;br /&gt;
The following document is an example document using PerlTeX.&lt;br /&gt;
&lt;br /&gt;
&lt;script src="https://gist.github.com/1272011.js"&gt; &lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ perltex document.tex
This is pdfTeX, Version 3.1415926-2.3-1.40.12 (TeX Live 2011)
 restricted \write18 enabled.
entering extended mode
LaTeX2e &lt;2011/06/27&gt;
Babel &lt;v3.8m&gt; and hyphenation patterns for english, dumylang, nohyphenation, ge
rman-x-2011-07-01, ngerman-x-2011-07-01, afrikaans, ancientgreek, ibycus, arabi
c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danis
h, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi, finnis
h, french, galician, german, ngerman, swissgerman, monogreek, greek, hungarian,
 icelandic, assamese, bengali, gujarati, hindi, kannada, malayalam, marathi, or
iya, panjabi, tamil, telugu, indonesian, interlingua, irish, italian, kurmanji,
 lao, latin, latvian, lithuanian, mongolian, mongolianlmc, bokmal, nynorsk, pol
ish, portuguese, romanian, russian, sanskrit, serbian, serbianc, slovak, sloven
ian, spanish, swedish, turkish, turkmen, ukrainian, uppersorbian, welsh, loaded
.
(./document.tex (/usr/local/texlive/2011/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/local/texlive/2011/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2011/texmf-dist/tex/latex/perltex/perltex.sty)
(./document.pipe) (./document.pipe) (./document.frpl) (./document.pipe)
(./document.pipe) (./document.frpl)
No file document.aux.
(./document.pipe) (./document.pipe) (./document.frpl) (./document.pipe)
(./document.pipe) (./document.frpl) (./document.pipe) (./document.pipe)
(./document.frpl) (./document.pipe) (./document.pipe) (./document.frpl)
(./document.pipe) (./document.pipe) (./document.frpl) [1] (./document.aux) )
Output written on document.dvi (1 page, 496 bytes).
Transcript written on document.log.
&lt;/pre&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-nfF_uiNdMXw/TpAME8BIfiI/AAAAAAAAAY4/RkR9YoCgR34/s1600/perltex.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="120" width="400" src="http://2.bp.blogspot.com/-nfF_uiNdMXw/TpAME8BIfiI/AAAAAAAAAY4/RkR9YoCgR34/s400/perltex.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;code&gt;document.lgpl&lt;/code&gt; is generated by PerlTeX.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ cat document.lgpl

############################### PERL CODE ################################
sub latex_displayX {'$x$ is ' . $x}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LATEX RESULT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


############################### PERL CODE ################################
sub latex_reversewords {join " ", reverse split " ", $_[0]}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LATEX RESULT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


############################### PERL CODE ################################
$x = 10
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LATEX RESULT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


############################### PERL CODE ################################
latex_displayX ();

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LATEX RESULT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$x$ is 10

############################### PERL CODE ################################
$x = $x * 10
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LATEX RESULT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


############################### PERL CODE ################################
latex_displayX ();

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LATEX RESULT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$x$ is 100

############################### PERL CODE ################################
latex_reversewords ('The quick brown fox jumps over the lazy dog');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LATEX RESULT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
dog lazy the over jumps fox brown quick The
&lt;/pre&gt;&lt;br /&gt;
We can know how macro in the document works by reading &lt;code&gt;document.lgpl&lt;/code&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;--latex&lt;/code&gt; option is used for specifying LaTeX interpreters.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ perltex --latex=platex document.tex 
This is e-pTeX, Version 3.1415926-p3.2-110415-2.3 (utf8.euc) (TeX Live 2011)
 restricted \write18 enabled.
entering extended mode
pLaTeX2e &lt;2006/11/10&gt; (based on LaTeX2e &lt;2011/06/27&gt; patch level 0)
...
&lt;/pre&gt;&lt;br /&gt;
LaTeX macro is a little bit complicated. PerlTeX helps writing small macro for processing text.&lt;br /&gt;
&lt;br /&gt;
Thanks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4078805449160415851-4952473006812472413?l=laclefyoshi.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/KjMzhlaQtRUIRj--JzFmMl9DZIk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KjMzhlaQtRUIRj--JzFmMl9DZIk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/KjMzhlaQtRUIRj--JzFmMl9DZIk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KjMzhlaQtRUIRj--JzFmMl9DZIk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Engineeringexception/~4/ipYWndbAZWk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://laclefyoshi.blogspot.com/feeds/4952473006812472413/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://laclefyoshi.blogspot.com/2011/10/perltex-perl-latex.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/4952473006812472413?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/4952473006812472413?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Engineeringexception/~3/ipYWndbAZWk/perltex-perl-latex.html" title="PerlTeX: Perl + LaTeX" /><author><name>Yoshiyasu SAEKI</name><uri>https://profiles.google.com/101384646867143843419</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-xEHAXnqop_Y/AAAAAAAAAAI/AAAAAAAAAYc/SuLwm9MVzDM/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-nfF_uiNdMXw/TpAME8BIfiI/AAAAAAAAAY4/RkR9YoCgR34/s72-c/perltex.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://laclefyoshi.blogspot.com/2011/10/perltex-perl-latex.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE4CRX09eip7ImA9WhdVGEg.&quot;"><id>tag:blogger.com,1999:blog-4078805449160415851.post-3364950450069820654</id><published>2011-09-24T18:35:00.000+09:00</published><updated>2011-09-24T18:36:04.362+09:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-24T18:36:04.362+09:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><title>Converting relative link to absolute link</title><content type="html">&lt;br /&gt;
When parsing HTML files, the relative links need to be converted to absolute links.&lt;br /&gt;
&lt;br /&gt;
In Python, &lt;code&gt;urlparse.urljoin&lt;/code&gt; is suitable for converting.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;&amp;gt;&amp;gt;&amp;gt; import urlparse

&amp;gt;&amp;gt;&amp;gt; urlparse.urljoin("http://www.example.org/", "index.html")
'http://www.example.org/index.html'  # OK

&amp;gt;&amp;gt;&amp;gt; urlparse.urljoin("http://www.example.org", "another.html")
    # base-url doesn't have path
'http://www.example.org/another.html'  # OK
&lt;/pre&gt;&lt;br /&gt;
In Java, &lt;code&gt;java.net.URI.resolve&lt;/code&gt; is suitable. Here, I show an example by Jython.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;&amp;gt;&amp;gt;&amp;gt; from java.net import URI

&amp;gt;&amp;gt;&amp;gt; URI("http://www.example.org/").resolve("index.html").toString()
u'http://www.example.org/index.html'  # OK

&amp;gt;&amp;gt;&amp;gt; URI("http://www.example.org").resolve("another.html").toString()
    # base-url doesn't have path
u'http://www.example.organother.html'  # BAD!
&lt;/pre&gt;&lt;br /&gt;
This behavior is hard to be found out because "&lt;code&gt;http://www.example2.org&lt;/code&gt;" is a right URI and the constructor of &lt;code&gt;java.net.URI&lt;/code&gt; doesn't throws &lt;code&gt;java.net.URISyntaxException&lt;/code&gt;. Additionally, "&lt;code&gt;http://www.example2.organother.html&lt;/code&gt;" is a right URI, too.&lt;br /&gt;
&lt;br /&gt;
Therefore, I need to add a code for cheking that the base-url has path or not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;&amp;gt;&amp;gt;&amp;gt; uriNoPath = "http://www.example.org"
&amp;gt;&amp;gt;&amp;gt; example = URI(uriNoPath)
&amp;gt;&amp;gt;&amp;gt; if example.path == '':
...         example = URI(uriNoPath + '/')
... 
&amp;gt;&amp;gt;&amp;gt; example.resolve("index.html")
http://www.example.org/index.html
&lt;/pre&gt;&lt;br /&gt;
Thanks.&lt;br /&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4078805449160415851-3364950450069820654?l=laclefyoshi.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Ri4lkOzFfrR8kjgZFeejWJt0HHo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ri4lkOzFfrR8kjgZFeejWJt0HHo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Ri4lkOzFfrR8kjgZFeejWJt0HHo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ri4lkOzFfrR8kjgZFeejWJt0HHo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Engineeringexception/~4/Fi_NT5QDSnU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://laclefyoshi.blogspot.com/feeds/3364950450069820654/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://laclefyoshi.blogspot.com/2011/09/converting-relative-link-to-absolute.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/3364950450069820654?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/3364950450069820654?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Engineeringexception/~3/Fi_NT5QDSnU/converting-relative-link-to-absolute.html" title="Converting relative link to absolute link" /><author><name>Yoshiyasu SAEKI</name><uri>https://profiles.google.com/101384646867143843419</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-xEHAXnqop_Y/AAAAAAAAAAI/AAAAAAAAAYc/SuLwm9MVzDM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://laclefyoshi.blogspot.com/2011/09/converting-relative-link-to-absolute.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEYCQ3gyfip7ImA9WhdVEks.&quot;"><id>tag:blogger.com,1999:blog-4078805449160415851.post-3547495076328233937</id><published>2011-09-17T21:22:00.001+09:00</published><updated>2011-09-17T21:22:42.696+09:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-17T21:22:42.696+09:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="perl" /><title>Checking if a Perl module is installed</title><content type="html">&lt;br /&gt;
We can run an instant code with one-liner with using &lt;code&gt;-e&lt;/code&gt; and &lt;code&gt;-M&lt;/code&gt; options. By using this, I can check if a Perl module is installed.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ perl -MLWP -e ''

$ perl -Mlocal::lib -e ''
Can't locate local/lib.pm in @INC (@INC contains: /Library/Perl/5.12/darwin-thread-multi-2level /Library/Perl/5.12 /Network/Library/Perl/5.12/darwin-thread-multi-2level /Network/Library/Perl/5.12 /Library/Perl/Updates/5.12.3 /System/Library/Perl/5.12/darwin-thread-multi-2level /System/Library/Perl/5.12 /System/Library/Perl/Extras/5.12/darwin-thread-multi-2level /System/Library/Perl/Extras/5.12 .).
BEGIN failed--compilation aborted.
&lt;/pre&gt;&lt;br /&gt;
Bash special variable: &lt;code&gt;$?&lt;/code&gt; sets the exit status of the last command.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ ls /Network; echo $?
0

$ ls NOTFOUND; echo $?
ls: NOTFOUND: No such file or directory
1
&lt;/pre&gt;&lt;br /&gt;
I wrote a bash function for checking if a Perl module is installed in combination them.&lt;br /&gt;
&lt;br /&gt;
&lt;script src="https://gist.github.com/1223890.js"&gt; &lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ CheckPerlModule File::Path
OK

$ CheckPerlModule Jcode
NG
&lt;/pre&gt;&lt;br /&gt;
Thanks.&lt;br /&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4078805449160415851-3547495076328233937?l=laclefyoshi.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/yu3qoocruDrawkzriEIZLi_DK90/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yu3qoocruDrawkzriEIZLi_DK90/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/yu3qoocruDrawkzriEIZLi_DK90/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yu3qoocruDrawkzriEIZLi_DK90/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Engineeringexception/~4/wC1LoZW1Mcs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://laclefyoshi.blogspot.com/feeds/3547495076328233937/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://laclefyoshi.blogspot.com/2011/09/checking-if-perl-module-is-installed.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/3547495076328233937?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/3547495076328233937?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Engineeringexception/~3/wC1LoZW1Mcs/checking-if-perl-module-is-installed.html" title="Checking if a Perl module is installed" /><author><name>Yoshiyasu SAEKI</name><uri>https://profiles.google.com/101384646867143843419</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-xEHAXnqop_Y/AAAAAAAAAAI/AAAAAAAAAYc/SuLwm9MVzDM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://laclefyoshi.blogspot.com/2011/09/checking-if-perl-module-is-installed.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUQDR3s6eyp7ImA9WhdWFkk.&quot;"><id>tag:blogger.com,1999:blog-4078805449160415851.post-5118739129827319695</id><published>2011-09-10T13:31:00.000+09:00</published><updated>2011-09-10T17:29:36.513+09:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-10T17:29:36.513+09:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="haskell" /><category scheme="http://www.blogger.com/atom/ns#" term="python" /><category scheme="http://www.blogger.com/atom/ns#" term="perl" /><title>Extracting lines including the specified IP addresses from logs</title><content type="html">&lt;br /&gt;
I needed to extract lines which include the specified range of IP addresses from httpd log files. The log file was large size and the fast processing was required So, I tried some methods.&lt;br /&gt;
&lt;br /&gt;
Here, I used httpd access logs in my web server. The total size of log files is about 19MB (72733 lines). I extracted lines which include IP addresses of University of Tokyo from the log files.&lt;br /&gt;
&lt;br /&gt;
A range of IP addresses expresses in &lt;a href="http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing"&gt;CIDR&lt;/a&gt;. The rangees of IP addresses of University of Tokyo are &lt;code&gt;130.69.0.0/16&lt;/code&gt;, &lt;code&gt;133.11.0.0/16&lt;/code&gt; and &lt;code&gt;157.82.0.0/16&lt;/code&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;with Perl&lt;/h4&gt;&lt;br /&gt;
There is &lt;a href="http://search.cpan.org/dist/Net-IP-Match-Regexp/"&gt;Net::IP::Match::Regexp&lt;/a&gt; for checking that an IP address is contained in a range of IP addresses.&lt;br /&gt;
&lt;br /&gt;
I installed this module from CPAN.&lt;br /&gt;
&lt;br /&gt;
&lt;script src="https://gist.github.com/1207879.js"&gt; &lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;with Python&lt;/h4&gt;&lt;br /&gt;
There are &lt;a href="http://pypi.python.org/pypi/ipcalc/"&gt;ipcalc&lt;/a&gt; and &lt;a href="http://pypi.python.org/pypi/netaddr/"&gt;netaddr&lt;/a&gt; for checking that an IP address is contained in a range of IP addresses.&lt;br /&gt;
&lt;br /&gt;
I installed these module from PyPI using pip.&lt;br /&gt;
&lt;br /&gt;
&lt;script src="https://gist.github.com/1208111.js"&gt; &lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;script src="https://gist.github.com/1208104.js"&gt; &lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;with Haskell&lt;/h4&gt;&lt;br /&gt;
There is &lt;a href="http://hackage.haskell.org/packages/archive/iproute/latest/doc/html/Data-IP.html"&gt;Data.IP&lt;/a&gt; for checking that an IP address is contained in a range of IP addresses.&lt;br /&gt;
&lt;br /&gt;
This module is included in &lt;a href="http://hackage.haskell.org/package/iproute"&gt;iproute&lt;/a&gt; package. I installed this package using cabal.&lt;br /&gt;
&lt;br /&gt;
&lt;script src="https://gist.github.com/1207890.js"&gt; &lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;Comparison&lt;/h4&gt;&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ wc -l /var/log/lighttpd/access.log*
    4141 /var/log/lighttpd/access.log
    4688 /var/log/lighttpd/access.log.1
    5019 /var/log/lighttpd/access.log.10
    6265 /var/log/lighttpd/access.log.11
    8291 /var/log/lighttpd/access.log.12
    5657 /var/log/lighttpd/access.log.2
    4850 /var/log/lighttpd/access.log.3
    4626 /var/log/lighttpd/access.log.4
    4963 /var/log/lighttpd/access.log.5
    6795 /var/log/lighttpd/access.log.6
    4580 /var/log/lighttpd/access.log.7
    5804 /var/log/lighttpd/access.log.8
    7054 /var/log/lighttpd/access.log.9
   72733 total
&lt;/pre&gt;&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ time cat /var/log/lighttpd/access.log* | perl ipfilter.pl | wc -l
     612

real    0m2.355s
user    0m2.306s
sys     0m0.036s

$ time cat /var/log/lighttpd/access.log* | python ipfilter_ipcalc.py | wc -l
     612

real    0m6.868s
user    0m6.782s
sys     0m0.077s

$ time cat /var/log/lighttpd/access.log* | python ipfilter_netaddr.py | wc -l
     612

real    0m3.932s
user    0m3.861s
sys     0m0.062s

$ time cat /var/log/lighttpd/access.log* | runhaskell ipfilter.hs | wc -l
     612

real    0m3.706s
user    0m3.599s
sys     0m0.101s
&lt;/pre&gt;&lt;br /&gt;
ipcalc/Python is the slowest. The reason is that &lt;code&gt;ipcalc.Network.in_network(other)&lt;/code&gt; calls &lt;code&gt;long(address)&lt;/code&gt; many times.&lt;br /&gt;
&lt;br /&gt;
iproute/Haskell uses TRIE for storing IP addresses. If the code is compiled with GHC, the better result may return.&lt;br /&gt;
&lt;br /&gt;
I was impressed by the result of Net::IP::Match::Regexp/Perl. As may be expected of a standard tool for text processing, Perl is strong in a job like this.&lt;br /&gt;
&lt;br /&gt;
Thanks.&lt;br /&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4078805449160415851-5118739129827319695?l=laclefyoshi.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ZKNg_NsHQZwvnfwkKKiBlAZ-vwc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ZKNg_NsHQZwvnfwkKKiBlAZ-vwc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ZKNg_NsHQZwvnfwkKKiBlAZ-vwc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ZKNg_NsHQZwvnfwkKKiBlAZ-vwc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Engineeringexception/~4/-kumLa5k6KQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://laclefyoshi.blogspot.com/feeds/5118739129827319695/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://laclefyoshi.blogspot.com/2011/09/extracting-lines-including-specified-ip.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/5118739129827319695?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/5118739129827319695?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Engineeringexception/~3/-kumLa5k6KQ/extracting-lines-including-specified-ip.html" title="Extracting lines including the specified IP addresses from logs" /><author><name>Yoshiyasu SAEKI</name><uri>https://profiles.google.com/101384646867143843419</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-xEHAXnqop_Y/AAAAAAAAAAI/AAAAAAAAAYc/SuLwm9MVzDM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://laclefyoshi.blogspot.com/2011/09/extracting-lines-including-specified-ip.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkADQHo7cSp7ImA9WhdXGUs.&quot;"><id>tag:blogger.com,1999:blog-4078805449160415851.post-8711921363916804160</id><published>2011-09-02T19:52:00.001+09:00</published><updated>2011-09-02T19:52:51.409+09:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-02T19:52:51.409+09:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="C" /><title>compiling gc-7.1 on Mac OS X Lion, it worked?</title><content type="html">&lt;br /&gt;
In &lt;a href="http://laclefyoshi.blogspot.com/2011/08/compiling-gc-71-on-mac-os-x-lion-but.html"&gt;the previous entry&lt;/a&gt;, I failed to compile &lt;a href="http://www.hpl.hp.com/personal/Hans_Boehm/gc/"&gt;gc-7.1&lt;/a&gt; on Mac OS X Lion because I used &lt;code&gt;llvm-gcc&lt;/code&gt;.&lt;br /&gt;
&lt;br /&gt;
I found there were GNU C Compiler: &lt;code&gt;gcc-4.2&lt;/code&gt; and &lt;code&gt;g++-4.2&lt;/code&gt; on Lion. So, I tried to compile gc-7.1 again. As a result, It was apparently successful, but the test was failed.&lt;br /&gt;
&lt;br /&gt;
I needed to edit source code to avoid compile error. One is to replace &amp;lt;ucontext.h&amp;gt; to &amp;lt;sys/ucontext.h&amp;gt;, the other is to delete &lt;code&gt;INLINE&lt;/code&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ diff gc-7.1_orig gc-7.1
diff gc-7.1_orig/alloc.c gc-7.1/alloc.c
875c875
&amp;lt; static INLINE word GC_max(word x, word y)
---
&amp;gt; static word GC_max(word x, word y)
880c880
&amp;lt; static INLINE word GC_min(word x, word y)
---
&amp;gt; static word GC_min(word x, word y)
diff gc-7.1_orig/mach_dep.c gc-7.1/mach_dep.c
163c163
&amp;lt; # include &amp;lt;ucontext.h&amp;gt;
---
&amp;gt; # include &amp;lt;sys/ucontext.h&amp;gt;
diff gc-7.1_orig/mark_rts.c gc-7.1/mark_rts.c
100c100
&amp;lt; static INLINE int rt_hash(ptr_t addr)
---
&amp;gt; static int rt_hash(ptr_t addr)
diff gc-7.1_orig/os_dep.c gc-7.1/os_dep.c
2755c2755
&amp;lt; #   include &amp;lt;ucontext.h&amp;gt;
---
&amp;gt; #   include &amp;lt;sys/ucontext.h&amp;gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ CC=gcc-4.2 CXX=g++-4.2 ./configure
$ CC=gcc-4.2 CXX=g++-4.2 make
$ CC=gcc-4.2 CXX=g++-4.2 make check
FAIL: gctest
FAIL: leaktest
PASS: middletest
PASS: smashtest
PASS: hugetest
PASS: threadleaktest
&lt;/pre&gt;
&lt;br /&gt;
mmm...
&lt;br /&gt;
Thanks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4078805449160415851-8711921363916804160?l=laclefyoshi.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/XYzB5Z689IBdZKplmiEwzloRTBg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XYzB5Z689IBdZKplmiEwzloRTBg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/XYzB5Z689IBdZKplmiEwzloRTBg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XYzB5Z689IBdZKplmiEwzloRTBg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Engineeringexception/~4/UZ4yg0SGMso" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://laclefyoshi.blogspot.com/feeds/8711921363916804160/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://laclefyoshi.blogspot.com/2011/09/compiling-gc-71-on-mac-os-x-lion-it.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/8711921363916804160?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/8711921363916804160?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Engineeringexception/~3/UZ4yg0SGMso/compiling-gc-71-on-mac-os-x-lion-it.html" title="compiling gc-7.1 on Mac OS X Lion, it worked?" /><author><name>Yoshiyasu SAEKI</name><uri>https://profiles.google.com/101384646867143843419</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-xEHAXnqop_Y/AAAAAAAAAAI/AAAAAAAAAYc/SuLwm9MVzDM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://laclefyoshi.blogspot.com/2011/09/compiling-gc-71-on-mac-os-x-lion-it.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0UFSHw8fyp7ImA9WhdXFE8.&quot;"><id>tag:blogger.com,1999:blog-4078805449160415851.post-4218865253738990803</id><published>2011-08-27T15:06:00.000+09:00</published><updated>2011-08-27T15:06:59.277+09:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-27T15:06:59.277+09:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="git" /><category scheme="http://www.blogger.com/atom/ns#" term="xcode" /><title>Xcode and github</title><content type="html">&lt;br /&gt;
I found that Xcode 4 had &lt;a href="http://git-scm.com/"&gt;git&lt;/a&gt; &lt;a href="https://github.com/blog/810-xcode-4-released-with-git-integration"&gt;frontend&lt;/a&gt;. I use &lt;a href="http://mercurial.selenic.com/"&gt;mercurial&lt;/a&gt; for version control of programs or documents because I'm a  Pythonista. I wasn't bothered by them which do I prefer. Thus, I decided to use git for Xcode projects and use mercurial for other projects.&lt;br /&gt;
&lt;br /&gt;
There is &lt;a href="https://bitbucket.org/"&gt;bitbucket&lt;/a&gt; for mercurial. There is &lt;a href="https://github.com/"&gt;github&lt;/a&gt; for git. I tried to correspond with github repositories and Xcode.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;github settings&lt;/h4&gt;&lt;br /&gt;
I had to &lt;a href="http://help.github.com/mac-set-up-git/"&gt;enregister public ssh key for using github&lt;/a&gt;. This time I created a dedicated ssh key pair for github.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ ssh-keygen -t rsa -C "laclef.yoshiyasu@gmail.com"
    # I set name specified as "id_rsa_github"

$ cat &gt;&gt; ~/.ssh/config

Host github.com
    User git 
    Hostname github.com
    PreferredAuthentications publickey
    IdentityFile ~/.ssh/id_rsa_github

(C-d)

$ cat .ssh/id_rsa_github.pub |pbcopy
&lt;/pre&gt;&lt;br /&gt;
I pasted the public ssh key to github settings.&lt;br /&gt;
&lt;br /&gt;
For checking setting, I accessed github.com with ssh.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ ssh -T github.com
The authenticity of host 'github.com (207.97.227.239)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,207.97.227.239' (RSA) to the list of known hosts.
Identity added: /Users/yoshiyasu/.ssh/id_rsa_github (/Users/yoshiyasu/.ssh/id_rsa_github)
Hi laclefyoshi! You've successfully authenticated, but GitHub does not provide shell access.
&lt;/pre&gt;&lt;br /&gt;
In the first accessing, SecurityAgent opened.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-afDUqfRjq_o/Tlh3knFyirI/AAAAAAAAAVo/KUnNeI-gdLM/s1600/SecurityAgent.jpg" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="238" width="400" src="http://3.bp.blogspot.com/-afDUqfRjq_o/Tlh3knFyirI/AAAAAAAAAVo/KUnNeI-gdLM/s400/SecurityAgent.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
I created a new repository on github.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-dTyhcXuoSxE/Tlh5OBDIOEI/AAAAAAAAAV4/usUSkOJPxA0/s1600/Create%2Ba%2BNew%2BRepository%2B-%2BGitHub.jpg" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="306" width="400" src="http://3.bp.blogspot.com/-dTyhcXuoSxE/Tlh5OBDIOEI/AAAAAAAAAV4/usUSkOJPxA0/s400/Create%2Ba%2BNew%2BRepository%2B-%2BGitHub.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
And I took notes of URI of this repository.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-20nnlJNnEjo/Tlh6eztNK4I/AAAAAAAAAWA/T5Znn1IjLjU/s1600/laclefyoshi_First-repository%2B-%2BGitHub.jpg" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="63" width="400" src="http://3.bp.blogspot.com/-20nnlJNnEjo/Tlh6eztNK4I/AAAAAAAAAWA/T5Znn1IjLjU/s400/laclefyoshi_First-repository%2B-%2BGitHub.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;h4&gt;Xcode&lt;/h4&gt;&lt;br /&gt;
For importing github repository to Xcode, I chose a menu item: [File] - [Source Control] - [Repositories...].&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-bFm3xQN5wrQ/Tlh4sHHu5zI/AAAAAAAAAVw/l_T3XG0ZFuc/s1600/Menubar.jpg" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="400" width="270" src="http://1.bp.blogspot.com/-bFm3xQN5wrQ/Tlh4sHHu5zI/AAAAAAAAAVw/l_T3XG0ZFuc/s400/Menubar.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
"Organizer - Repositories" window opened. I selected "Added Repository..." and inputed URI of the github repository.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-_Nlg5Zn2YWw/Tlh7plxpIzI/AAAAAAAAAWI/epuV4yLw1Kc/s1600/Organizer%2B-%2BRepositories.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="95" width="244" src="http://2.bp.blogspot.com/-_Nlg5Zn2YWw/Tlh7plxpIzI/AAAAAAAAAWI/epuV4yLw1Kc/s400/Organizer%2B-%2BRepositories.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-6c0ufartUsw/Tlh79nnKBlI/AAAAAAAAAWY/1AAnujh4KPA/s1600/Xcode.jpg" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="272" width="400" src="http://3.bp.blogspot.com/-6c0ufartUsw/Tlh79nnKBlI/AAAAAAAAAWY/1AAnujh4KPA/s400/Xcode.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-cYUMtETzMgo/Tlh7szTanvI/AAAAAAAAAWQ/inYWr_a4mIM/s1600/Organizer%2B-%2BRepositories.jpg" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="284" width="400" src="http://4.bp.blogspot.com/-cYUMtETzMgo/Tlh7szTanvI/AAAAAAAAAWQ/inYWr_a4mIM/s400/Organizer%2B-%2BRepositories.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
When "Clone" button was pushed, the github repository (origin) was cloned as a local reposotory (master).&lt;br /&gt;
&lt;br /&gt;
I created a file: &lt;code&gt;File.c&lt;/code&gt; in a local repository and committed it.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-m4H_KcTkBa0/Tlh9VBanSvI/AAAAAAAAAWg/mFja36tbO5M/s1600/Xcode-1.jpg" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="294" width="400" src="http://2.bp.blogspot.com/-m4H_KcTkBa0/Tlh9VBanSvI/AAAAAAAAAWg/mFja36tbO5M/s400/Xcode-1.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-FME1cAdnlYY/Tlh9Zl9D45I/AAAAAAAAAWo/cLItqxtJTvM/s1600/Xcode-2.jpg" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="253" width="400" src="http://4.bp.blogspot.com/-FME1cAdnlYY/Tlh9Zl9D45I/AAAAAAAAAWo/cLItqxtJTvM/s400/Xcode-2.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-4cc4tlllJAU/Tlh-k5cJW9I/AAAAAAAAAW4/PV_BIhDzILk/s1600/Organizer%2B-%2BRepositories-1.jpg" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="292" width="400" src="http://3.bp.blogspot.com/-4cc4tlllJAU/Tlh-k5cJW9I/AAAAAAAAAW4/PV_BIhDzILk/s400/Organizer%2B-%2BRepositories-1.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
I couldn't find a item for pushing the local repository to github repository. So I needed to use Terminal.app and &lt;code&gt;git&lt;/code&gt; command.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ cd Documents/Projects/xcode/First-repository/
$ ls -la
total 8
drwxr-xr-x   4 yoshiyasu  staff   136B  8 27 12:23 ./
drwxr-xr-x  11 yoshiyasu  staff   374B  8 27 12:19 ../
drwxr-xr-x  13 yoshiyasu  staff   442B  8 27 12:26 .git/
-rw-r--r--@  1 yoshiyasu  staff   167B  8 27 12:23 File.c

$ git log
commit a8d7253f3d7bb943659266305aa5e364befe9054
Author: SAEKI Yoshiyasu &amp;lt;laclef.yoshiyasu@gmail.com&amp;gt;
Date:   Sat Aug 27 12:26:44 2011 +0900

    added File.c

$ git push origin master
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 371 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To git@github.com:laclefyoshi/First-repository.git
 * [new branch]      master -&gt; master
&lt;/pre&gt;&lt;br /&gt;
I checked the github repository.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-b3uJT8Eeb_w/Tlh-Nj2eXsI/AAAAAAAAAWw/zVLRAnLArI4/s1600/laclefyoshi_First-repository%2B-%2BGitHub-1.jpg" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="102" width="400" src="http://3.bp.blogspot.com/-b3uJT8Eeb_w/Tlh-Nj2eXsI/AAAAAAAAAWw/zVLRAnLArI4/s400/laclefyoshi_First-repository%2B-%2BGitHub-1.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;Branch&lt;/h4&gt;&lt;br /&gt;
I could create branches of a repository in Xcode.&lt;br /&gt;
&lt;br /&gt;
For creating branches, I pushed "Add Branch" button of the repository's Branches menu on "Organizer - Repositories" window.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-ttq5jTuG11E/Tlh_VQklBNI/AAAAAAAAAXA/1T3k_FcY_Pw/s1600/Xcode-4.jpg" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="272" width="400" src="http://1.bp.blogspot.com/-ttq5jTuG11E/Tlh_VQklBNI/AAAAAAAAAXA/1T3k_FcY_Pw/s400/Xcode-4.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
I switched (checkout) the created branch and edited and committed a file. The diff of file can be shown on the commit window.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-Qy3k2N-F-iY/TliAEGlESWI/AAAAAAAAAXI/49L9qfMzW6E/s1600/Xcode-5.jpg" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="253" width="400" src="http://3.bp.blogspot.com/-Qy3k2N-F-iY/TliAEGlESWI/AAAAAAAAAXI/49L9qfMzW6E/s400/Xcode-5.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
I pushed the local repository to the github repository. So two branches were shown.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ git branch
* a-branch
  master

$ git push origin a-branch
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 322 bytes, done.
Total 3 (delta 1), reused 0 (delta 0)
To git@github.com:laclefyoshi/First-repository.git
 * [new branch]      a-branch -&gt; a-branch
 &lt;/pre&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-RK6Q2YnskEA/TliAVWHyV5I/AAAAAAAAAXQ/8vGMJUDzCDE/s1600/All%2BBranches%2Bfor%2Blaclefyoshi_First-repository%2B-%2BGitHub.jpg" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="82" width="400" src="http://2.bp.blogspot.com/-RK6Q2YnskEA/TliAVWHyV5I/AAAAAAAAAXQ/8vGMJUDzCDE/s400/All%2BBranches%2Bfor%2Blaclefyoshi_First-repository%2B-%2BGitHub.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
In Xcode, I couldn't merge the branches and used &lt;code&gt;git&lt;/code&gt; command.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ git checkout master
Switched to branch 'master'

$ git merge a-branch
Updating a8d7253..3a1669d
Fast-forward
 File.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
&lt;/pre&gt;&lt;br /&gt;
Apparently, the items of [Source Contorol] - [Commit], [Push], [Pull], [Update], [Merge] and so on become available when creating and opening  Xcode project. When only cloning a git repository, these items couldn't be used.&lt;br /&gt;
&lt;br /&gt;
Thanks.&lt;br /&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4078805449160415851-4218865253738990803?l=laclefyoshi.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Lvbab89VmBoNWWkS3HuIxkDJB9M/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Lvbab89VmBoNWWkS3HuIxkDJB9M/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Lvbab89VmBoNWWkS3HuIxkDJB9M/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Lvbab89VmBoNWWkS3HuIxkDJB9M/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Engineeringexception/~4/KNiDgBpNG7s" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://laclefyoshi.blogspot.com/feeds/4218865253738990803/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://laclefyoshi.blogspot.com/2011/08/xcode-and-github.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/4218865253738990803?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/4218865253738990803?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Engineeringexception/~3/KNiDgBpNG7s/xcode-and-github.html" title="Xcode and github" /><author><name>Yoshiyasu SAEKI</name><uri>https://profiles.google.com/101384646867143843419</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-xEHAXnqop_Y/AAAAAAAAAAI/AAAAAAAAAYc/SuLwm9MVzDM/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-afDUqfRjq_o/Tlh3knFyirI/AAAAAAAAAVo/KUnNeI-gdLM/s72-c/SecurityAgent.jpg" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://laclefyoshi.blogspot.com/2011/08/xcode-and-github.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0QNR3Y7fyp7ImA9WhdXFEg.&quot;"><id>tag:blogger.com,1999:blog-4078805449160415851.post-5683114932453162443</id><published>2011-08-24T22:19:00.001+09:00</published><updated>2011-08-27T23:29:56.807+09:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-27T23:29:56.807+09:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="C" /><title>compiling gc-7.1 on Mac OS X Lion, but error</title><content type="html">For compiling &lt;a href="http://www.hpl.hp.com/personal/Hans_Boehm/gc/"&gt;gc-7.1 (boehm-gc)&lt;/a&gt; on Mac OS X Lion (Version 10.7) and Xcode 4.1, I had to edit some source files. gcc on Lion is not GNU Compiler Collection, it is llvm.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ gcc -v
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2335.15~25/src/configure --disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2335.15~25/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
&lt;/pre&gt;&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ ./configure
$ make
...
 gcc -DPACKAGE_NAME=\"gc\" -DPACKAGE_TARNAME=\"gc\" -DPACKAGE_VERSION=\"7.1\" "-DPACKAGE_STRING=\"gc 7.1\"" -DPACKAGE_BUGREPORT=\"Hans.Boehm@hp.com\" -DGC_VERSION_MAJOR=7 -DGC_VERSION_MINOR=1 -DPACKAGE=\"gc\" -DVERSION=\"7.1\" -DGC_DARWIN_THREADS=1 -DTHREAD_LOCAL_ALLOC=1 -DHAS_X86_THREAD_STATE32___EAX=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DNO_EXECUTE_PERMISSION=1 -DALL_INTERIOR_POINTERS=1 -DGC_GCJ_SUPPORT=1 -DJAVA_FINALIZATION=1 -DATOMIC_UNCOLLECTABLE=1 -I./include -fexceptions -I libatomic_ops/src -g -O2 -MT os_dep.lo -MD -MP -MF .deps/os_dep.Tpo -c os_dep.c  -fno-common -DPIC -o .libs/os_dep.o
libatomic_ops/src/atomic_ops/sysdeps/gcc/x86_64.h: In function 'AO_test_and_set_full':
libatomic_ops/src/atomic_ops/sysdeps/gcc/x86_64.h:127: error: unsupported inline asm: input constraint with a matching output constraint of incompatible type!
make[1]: *** [os_dep.lo] Error 1
make: *** [all-recursive] Error 1
&lt;/pre&gt;&lt;br /&gt;
In &lt;code&gt;libatomic_ops/src/atomic_ops/sysdeps/gcc/x86_64.h&lt;/code&gt;, there is a function: &lt;code&gt;AO_test_and_set_full&lt;/code&gt;. This function uses inline assembler. I had to make the code responsive to llvm-gcc.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ diff libatomic_ops/src/atomic_ops/sysdeps/gcc/x86_64.h.org libatomic_ops/src/atomic_ops/sysdeps/gcc/x86_64.h
129c129
&amp;lt;               : "0"(0xff), "m"(*addr) : "memory");
---
&amp;gt;               : "0"((unsigned char)0xff), "m"(*addr) : "memory");
&lt;/pre&gt;&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ make
...
 gcc -DPACKAGE_NAME=\"gc\" -DPACKAGE_TARNAME=\"gc\" -DPACKAGE_VERSION=\"7.1\" "-DPACKAGE_STRING=\"gc 7.1\"" -DPACKAGE_BUGREPORT=\"Hans.Boehm@hp.com\" -DGC_VERSION_MAJOR=7 -DGC_VERSION_MINOR=1 -DPACKAGE=\"gc\" -DVERSION=\"7.1\" -DGC_DARWIN_THREADS=1 -DTHREAD_LOCAL_ALLOC=1 -DHAS_X86_THREAD_STATE32___EAX=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DNO_EXECUTE_PERMISSION=1 -DALL_INTERIOR_POINTERS=1 -DGC_GCJ_SUPPORT=1 -DJAVA_FINALIZATION=1 -DATOMIC_UNCOLLECTABLE=1 -I./include -fexceptions -I libatomic_ops/src -g -O2 -MT mach_dep.lo -MD -MP -MF .deps/mach_dep.Tpo -c mach_dep.c  -fno-common -DPIC -o .libs/mach_dep.o
In file included from mach_dep.c:163:
/usr/include/ucontext.h:43:2: error: #error The deprecated ucontext routines require _XOPEN_SOURCE to be defined
make[1]: *** [mach_dep.lo] Error 1
make: *** [all-recursive] Error 1
&lt;/pre&gt;&lt;br /&gt;
There is not &lt;code&gt;/usr/include/ucontext.h&lt;/code&gt; on Mac. But there is &lt;code&gt;/usr/include/sys/ucontext.h&lt;/code&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ ack ucontext.h *
mach_dep.c
163:# include &amp;lt;ucontext.h&amp;gt;

os_dep.c
2755:#   include &amp;lt;ucontext.h&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ diff mach_dep.c.org mach_dep.c
163c163
&amp;lt; # include &amp;lt;ucontext.h&amp;gt;
---
&amp;gt; # include &amp;lt;sys/ucontext.h&amp;gt;

$ diff os_dep.c.org os_dep.c
2755c2755
&amp;lt; #   include &amp;lt;ucontext.h&amp;gt;
---
&amp;gt; #   include &amp;lt;sys/ucontext.h&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ make
...
(cd .libs &amp;&amp; rm -f libcord.1.dylib &amp;&amp; ln -s libcord.1.0.3.dylib libcord.1.dylib)
(cd .libs &amp;&amp; rm -f libcord.dylib &amp;&amp; ln -s libcord.1.0.3.dylib libcord.dylib)
ar cru .libs/libcord.a  cord/cordbscs.o cord/cordprnt.o cord/cordtest.o cord/cordxtra.o
ranlib .libs/libcord.a
creating libcord.la
(cd .libs &amp;&amp; rm -f libcord.la &amp;&amp; ln -s ../libcord.la libcord.la)
$ 
&lt;/pre&gt;&lt;br /&gt;
Done? I checked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ make check
...
tests/thread_leak_test.c: In function ‘main’:
tests/thread_leak_test.c:38: warning: format ‘%lu’ expects type ‘long unsigned int’, but argument 2 has type ‘int’
tests/thread_leak_test.c:38: warning: format ‘%lu’ expects type ‘long unsigned int’, but argument 2 has type ‘int’
/bin/sh ./libtool --tag=CC --mode=link gcc -fexceptions -I libatomic_ops/src -g -O2   -o threadleaktest  tests/thread_leak_test.o ./libgc.la  
gcc -fexceptions -I libatomic_ops/src -g -O2 -o .libs/threadleaktest tests/thread_leak_test.o  ./.libs/libgc.dylib -lpthread
creating threadleaktest
make  check-TESTS
Switched to incremental mode
Emulating dirty bits with mprotect/signals
List reversal produced incorrect list - collector is broken
Test failed
/bin/sh: line 1: 55042 Abort trap: 6           ${dir}$tst
FAIL: gctest
Leaked composite object at 0x10162cee0 (tests/leak_test.c:12, sz=13, NORMAL)

Leaked composite object at 0x10162cf20 (tests/leak_test.c:12, sz=12, NORMAL)

Leaked composite object at 0x10162cf60 (tests/leak_test.c:12, sz=11, NORMAL)

Leaked composite object at 0x10162cfa0 (tests/leak_test.c:12, sz=10, NORMAL)

Leaked composite object at 0x10162cfe0 (tests/leak_test.c:12, sz=9, NORMAL)

Leaked composite object at 0x10162bf20 (tests/leak_test.c:12, sz=8, NORMAL)

Leaked composite object at 0x10162bf50 (tests/leak_test.c:12, sz=7, NORMAL)

Leaked composite object at 0x10162bf80 (tests/leak_test.c:12, sz=6, NORMAL)

Leaked composite object at 0x10162bfb0 (tests/leak_test.c:12, sz=5, NORMAL)

Leaked composite object at 0x10162bfe0 (tests/leak_test.c:12, sz=4, NORMAL)

GC_debug_free: found smashed location at 0x10162bfa8 in or near object at 0x10162bfb0(0�b:0, sz=0)
GC_debug_free: found smashed location at 0x10162bf78 in or near object at 0x10162bf80(EMPTY(smashed?):0, sz=0)
GC_debug_free: found smashed location at 0x10162bf48 in or near object at 0x10162bf50(EMPTY(smashed?):0, sz=0)
GC_debug_free: found smashed location at 0x10162bf18 in or near object at 0x10162bf20(&lt;smashed&gt;, appr. sz = 9)
GC_debug_free: found smashed location at 0x10162cfd8 in or near object at 0x10162cfe0(@�b:0, sz=0)
GC_debug_free: found smashed location at 0x10162cf98 in or near object at 0x10162cfa0(EMPTY(smashed?):0, sz=0)
GC_debug_free: found smashed location at 0x10162cf58 in or near object at 0x10162cf60(��b:0, sz=0)
GC_debug_free: found smashed location at 0x10162cf18 in or near object at 0x10162cf20(EMPTY(smashed?):0, sz=0)
GC_debug_free: found smashed location at 0x10162ced8 in or near object at 0x10162cee0(&lt;smashed&gt;, appr. sz = 25)
/bin/sh: line 1: 55061 Segmentation fault: 11  ${dir}$tst
FAIL: leaktest
Final heap size is 131072
PASS: middletest
GC_check_heap_block: found smashed heap objects:
0x10df1dfe8 in or near object at 0x10df1dfc0(tests/smash_test.c:21, sz=40)
GC_check_heap_block: found smashed heap objects:
0x10df1dfe8 in or near object at 0x10df1dfc0(tests/smash_test.c:21, sz=40)
GC_check_heap_block: found smashed heap objects:
0x10df90f98 in or near object at 0x10df90f70(tests/smash_test.c:21, sz=40)
0x10df1dfe8 in or near object at 0x10df1dfc0(tests/smash_test.c:21, sz=40)
PASS: smashtest
GC Warning: Out of Memory!  Returning NIL!
GC Warning: Out of Memory!  Returning NIL!
GC Warning: Out of Memory!  Returning NIL!
PASS: hugetest
Leaked composite object at 0x10b7a8fe0 (tests/thread_leak_test.c:14, sz=4, NORMAL)

Leaked composite object at 0x10b7a8f80 (tests/thread_leak_test.c:14, sz=4, NORMAL)

Leaked composite object at 0x10b7a8ef0 (tests/thread_leak_test.c:14, sz=4, NORMAL)

Leaked composite object at 0x10b7a8d40 (tests/thread_leak_test.c:14, sz=4, NORMAL)

Leaked composite object at 0x10b7a8e30 (tests/thread_leak_test.c:14, sz=4, NORMAL)

PASS: threadleaktest
==================================
2 of 6 tests failed
Please report to Hans.Boehm@hp.com
==================================
make[2]: *** [check-TESTS] Error 1
make[1]: *** [check-am] Error 2
make: *** [check-recursive] Error 1
&lt;/pre&gt;&lt;br /&gt;
It failed in &lt;code&gt;gctest&lt;/code&gt; and &lt;code&gt;leaktest&lt;/code&gt; and Segmentation fault occurred.&lt;br /&gt;
&lt;br /&gt;
I went under and found &lt;a href="https://github.com/ivmai/bdwgc/"&gt;the github repository&lt;/a&gt; on &lt;a href="http://en.wikipedia.org/wiki/Boehm_garbage_collector"&gt;Wikipedia: Boehm garbage collector&lt;/a&gt;. It would appear that the repository is updated frequently. I think there is hope.&lt;br /&gt;
&lt;br /&gt;
Thanks.&lt;br /&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4078805449160415851-5683114932453162443?l=laclefyoshi.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/qGnkfFHj3MAxcpFg1m7M02jCCHY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qGnkfFHj3MAxcpFg1m7M02jCCHY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/qGnkfFHj3MAxcpFg1m7M02jCCHY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qGnkfFHj3MAxcpFg1m7M02jCCHY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Engineeringexception/~4/DulEySMam4s" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://laclefyoshi.blogspot.com/feeds/5683114932453162443/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://laclefyoshi.blogspot.com/2011/08/compiling-gc-71-on-mac-os-x-lion-but.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/5683114932453162443?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/5683114932453162443?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Engineeringexception/~3/DulEySMam4s/compiling-gc-71-on-mac-os-x-lion-but.html" title="compiling gc-7.1 on Mac OS X Lion, but error" /><author><name>Yoshiyasu SAEKI</name><uri>https://profiles.google.com/101384646867143843419</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-xEHAXnqop_Y/AAAAAAAAAAI/AAAAAAAAAYc/SuLwm9MVzDM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://laclefyoshi.blogspot.com/2011/08/compiling-gc-71-on-mac-os-x-lion-but.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcHRnY4fSp7ImA9WhdXEUQ.&quot;"><id>tag:blogger.com,1999:blog-4078805449160415851.post-385105385836967507</id><published>2011-08-21T21:20:00.001+09:00</published><updated>2011-08-24T22:20:37.835+09:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-24T22:20:37.835+09:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="mac" /><title>Hello, Lion!</title><content type="html">I bought Mac mini (Mid 2011) on this Saturday.&lt;br /&gt;
&lt;br /&gt;
This default OS is Mac OS X Lion 10.7. Because Lion is is  different from Snow Leopard very well, it took me a while to get used to this change.&lt;br /&gt;
&lt;br /&gt;
Firstly, gcc is llvm-gcc. This impact has a tremendous effect for me. For example, &lt;a href="http://www.hpl.hp.com/personal/Hans_Boehm/gc/"&gt;gc-7.1&lt;/a&gt; is required to &lt;a href="http://laclefyoshi.blogspot.com/2011/08/compiling-gc-71-on-mac-os-x-lion-but.html"&gt;modify the source to be compiled&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ ls -l `which gcc`
lrwxr-xr-x  1 root  wheel    12B  8 21 00:50 /usr/bin/gcc@ -&gt; llvm-gcc-4.2
&lt;/pre&gt;&lt;br /&gt;
Secondly, there is not Rosetta in Lion. So, some PPC applications are not working. Therefore I had to seek the response. &lt;a href="http://www.ganttproject.biz/"&gt;GanttProject&lt;/a&gt; for Lion is &lt;a href="https://code.google.com/p/ganttproject/"&gt;here&lt;/a&gt;. &lt;a href="http://jabref.sourceforge.net/"&gt;Jabref&lt;/a&gt; became Lion-compliant in ver.2.7.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-WvvCRuc2-zs/TlD3A9VDWhI/AAAAAAAAAVg/yZmvT6kYHts/s1600/jabref.jpg" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="189" width="222" src="http://1.bp.blogspot.com/-WvvCRuc2-zs/TlD3A9VDWhI/AAAAAAAAAVg/yZmvT6kYHts/s400/jabref.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
I also feel in sense of embarrassment by Mission Control. I don't receive the benefits of Auto save or Versions yet. From now, I experiment on Lion's new feature.&lt;br /&gt;
&lt;br /&gt;
Thanks.&lt;br /&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4078805449160415851-385105385836967507?l=laclefyoshi.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/CI2tu8lcGvEwdfWrM1csCnW3glg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CI2tu8lcGvEwdfWrM1csCnW3glg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/CI2tu8lcGvEwdfWrM1csCnW3glg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CI2tu8lcGvEwdfWrM1csCnW3glg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Engineeringexception/~4/vPUfLe-yPr4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://laclefyoshi.blogspot.com/feeds/385105385836967507/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://laclefyoshi.blogspot.com/2011/08/hello-lion.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/385105385836967507?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/385105385836967507?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Engineeringexception/~3/vPUfLe-yPr4/hello-lion.html" title="Hello, Lion!" /><author><name>Yoshiyasu SAEKI</name><uri>https://profiles.google.com/101384646867143843419</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-xEHAXnqop_Y/AAAAAAAAAAI/AAAAAAAAAYc/SuLwm9MVzDM/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-WvvCRuc2-zs/TlD3A9VDWhI/AAAAAAAAAVg/yZmvT6kYHts/s72-c/jabref.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://laclefyoshi.blogspot.com/2011/08/hello-lion.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0cMSXk-cCp7ImA9WhdQEkw.&quot;"><id>tag:blogger.com,1999:blog-4078805449160415851.post-6239000283933406298</id><published>2011-08-13T14:58:00.000+09:00</published><updated>2011-08-13T14:58:08.758+09:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-13T14:58:08.758+09:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="igraph" /><title>Basic network analysis and visualization with igraph</title><content type="html">&lt;br /&gt;
&lt;a href="http://igraph.sourceforge.net/"&gt;igraph&lt;/a&gt; is a library for analysis and visualization of network graph. I have gotten more chances to analyze network graph recently.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;Using igraph in Python&lt;/h4&gt;&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ mkvirtualenv igraph
(igraph)$ ./configure --prefix=$HOME/.virtualenvs/igraph
(igraph)$ make
(igraph)$ make install
(igraph)$ export C_INCLUDE_PATH=$HOME/.virtualenvs/igraph/include:$C_INCLUDE_PATH
(igraph)$ export LIBRARY_PATH=$HOME/.virtualenvs/igraph/lib:$LD_LIBRARY_PATH
(igraph)$ pip install python-igraph
&lt;/pre&gt;&lt;br /&gt;
&lt;pre class="prettyprint"&gt;(igraph)$ igraph
No configuration file, using defaults
igraph 0.5.4 running inside Python 2.7.2 (default, Jul 15 2011, 23:46:46) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
# == from igraph import * (in Python)
&amp;gt;&amp;gt;&amp;gt; g = Graph.Barabasi(30)
&amp;gt;&amp;gt;&amp;gt; print g
Undirected graph (|V| = 30, |E| = 29)
&amp;gt;&amp;gt;&amp;gt; print g.vcount(), g.ecount()
30 29
&amp;gt;&amp;gt;&amp;gt; [m for m in dir(g) if m.startswith("write")]
['write', 'write_adjacency', 'write_dimacs', 'write_dot', 'write_edgelist', 'write_gml', 'write_graphml', 'write_graphmlz', 'write_lgl', 'write_ncol', 'write_pajek', 'write_pickle', 'write_svg']
&amp;gt;&amp;gt;&amp;gt; [m for m in dir(g) if m.startswith("layout")]
['layout', 'layout_circle', 'layout_drl', 'layout_fruchterman_reingold', 'layout_fruchterman_reingold_3d', 'layout_graphopt', 'layout_grid_fruchterman_reingold', 'layout_kamada_kawai', 'layout_kamada_kawai_3d', 'layout_lgl', 'layout_random', 'layout_random_3d', 'layout_reingold_tilford', 'layout_reingold_tilford_circular', 'layout_sphere', 'layout_star']
&amp;gt;&amp;gt;&amp;gt; g.write_svg("graph.svg", layout=g.layout_kamada_kawai())
&lt;/pre&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-XZc4MUPvmPc/TkX_gCHQzLI/AAAAAAAAAVA/VF2MtDqoRmM/s1600/graph-1.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="400" width="395" src="http://4.bp.blogspot.com/-XZc4MUPvmPc/TkX_gCHQzLI/AAAAAAAAAVA/VF2MtDqoRmM/s400/graph-1.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;pre class="prettyprint"&gt;&amp;gt;&amp;gt;&amp;gt; g.vs[0]["color"] = "red"
&amp;gt;&amp;gt;&amp;gt; g.vs[0]        
igraph.Vertex(&lt;igraph.Graph object at 0x1012d6b50&gt;,0,{'color': 'red'})
&amp;gt;&amp;gt;&amp;gt; g.es[1].tuple
(0, 2)
&amp;gt;&amp;gt;&amp;gt; g.write_svg("graph2.svg", layout=g.layout_kamada_kawai())
&lt;/pre&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-E7JYWi2QZZE/TkX_gfQe_gI/AAAAAAAAAVQ/gcqHMC6hrWY/s1600/graph-2.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="400" width="390" src="http://3.bp.blogspot.com/-E7JYWi2QZZE/TkX_gfQe_gI/AAAAAAAAAVQ/gcqHMC6hrWY/s400/graph-2.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
igraph can calculate PageRank of directed graph.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;&amp;gt;&amp;gt;&amp;gt; g1 = Graph(4, directed=True)
&amp;gt;&amp;gt;&amp;gt; g1.add_edges([(0,1),(0,2),(1,0),(1,2),(3,0)])
&amp;gt;&amp;gt;&amp;gt; g1.edge_betweenness()
[2.0, 2.0, 1.0, 1.0, 3.0]
&amp;gt;&amp;gt;&amp;gt; g1.degree()
[4, 3, 2, 1]
&amp;gt;&amp;gt;&amp;gt; [v.index for v in g1.vs.select(_degree = g1.maxdegree())]
[0]
&amp;gt;&amp;gt;&amp;gt; print g1.summary()
4 nodes, 5 edges, directed

Number of components: 3
Diameter: 2
Density: 0.4167
Reciprocity: 0.2500
Average path length: 1.2857
&amp;gt;&amp;gt;&amp;gt; g1.average_path_length()        
1.2857142857142858
&amp;gt;&amp;gt;&amp;gt; g1.pagerank()
[0.2910808248180501, 0.24604410843705093, 0.40564107854853176, 0.05723398819636713]
&amp;gt;&amp;gt;&amp;gt; g.write_svg("pagegraph.svg", layout=g.layout_kamada_kawai())
&lt;/pre&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-DvXHUL7lwFg/TkX_gQ1DsGI/AAAAAAAAAVI/9Sgm-ZMTfjs/s1600/graph-3.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="167" width="214" src="http://4.bp.blogspot.com/-DvXHUL7lwFg/TkX_gQ1DsGI/AAAAAAAAAVI/9Sgm-ZMTfjs/s400/graph-3.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;h4&gt;Using igraph in R&lt;/h4&gt;&lt;br /&gt;
&lt;pre class="prettyprint"&gt;&amp;gt; install.packages("igraph")
&amp;gt; library("igraph")
&lt;/pre&gt;&lt;br /&gt;
igraph can read external file as edges information.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;&amp;gt; system("cat edges.txt")
0 1
0 2
1 0
1 2
3 0
&amp;gt; g &lt;- graph.data.frame(read.delim("edges.txt", sep=" ", h=FALSE, as.is=T), directed=TRUE)
    # == graph.edgelist(as.matrix(read.delim("edges.txt", sep=" ", h=FALSE, as.is=T)), directed=TRUE)
&amp;gt; g
Vertices: 4 
Edges: 5 
Directed: TRUE 
Edges:
              
[0] '0' -&amp;gt; '1'
[1] '0' -&amp;gt; '2'
[2] '1' -&amp;gt; '0'
[3] '1' -&amp;gt; '2'
[4] '3' -&amp;gt; '0'

&amp;gt; V(g)
Vertex sequence:
[1] "0" "1" "3" "2"
&amp;gt; E(g)
Edge sequence:
          
[0] 0 -&amp;gt; 1
[1] 0 -&amp;gt; 2
[2] 1 -&amp;gt; 0
[3] 1 -&amp;gt; 2
[4] 3 -&amp;gt; 0
&amp;gt; average.path.length(g)
[1] 1.285714
&amp;gt; degree(g)
[1] 4 3 1 2
&amp;gt; edge.betweenness(g)
[1] 2 2 1 1 3
&amp;gt; page.rank(g)$vector
[1] 0.29108082 0.24604411 0.05723399 0.40564108
&amp;gt; plot(g, layout=layout.kamada.kawai)
&lt;/pre&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-MCozOQMuQfs/TkYGSX01GfI/AAAAAAAAAVY/NxMwY2la6EA/s1600/graph-4.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="397" width="400" src="http://3.bp.blogspot.com/-MCozOQMuQfs/TkYGSX01GfI/AAAAAAAAAVY/NxMwY2la6EA/s400/graph-4.png" /&gt;&lt;/a&gt;&lt;/div&gt;
igraph can handle adjacency matrix.

&lt;pre class="prettyprint"&gt;&amp;gt; graph.adjacency(matrix(c(0,1,1,0,1,0,1,0,0,0,0,0,1,0,0,0), nrow=4, ncol = 4, byrow = TRUE))
Vertices: 4 
Edges: 5 
Directed: TRUE 
Edges:
          
[0] 0 -&gt; 1
[1] 0 -&gt; 2
[2] 1 -&gt; 0
[3] 1 -&gt; 2
[4] 3 -&gt; 0
&lt;/pre&gt;&lt;br /&gt;
igraph for Python and R have much the same API. Therefore, I can use igraph easily in every aspect.&lt;br /&gt;
&lt;br /&gt;
Thanks.&lt;br /&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4078805449160415851-6239000283933406298?l=laclefyoshi.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/2lmJdBXKRu7y4rsmPo1PzyjcKWQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2lmJdBXKRu7y4rsmPo1PzyjcKWQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/2lmJdBXKRu7y4rsmPo1PzyjcKWQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2lmJdBXKRu7y4rsmPo1PzyjcKWQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Engineeringexception/~4/lriMzxtbB2U" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://laclefyoshi.blogspot.com/feeds/6239000283933406298/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://laclefyoshi.blogspot.com/2011/08/basic-network-analysis-and.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/6239000283933406298?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/6239000283933406298?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Engineeringexception/~3/lriMzxtbB2U/basic-network-analysis-and.html" title="Basic network analysis and visualization with igraph" /><author><name>Yoshiyasu SAEKI</name><uri>https://profiles.google.com/101384646867143843419</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-xEHAXnqop_Y/AAAAAAAAAAI/AAAAAAAAAYc/SuLwm9MVzDM/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-XZc4MUPvmPc/TkX_gCHQzLI/AAAAAAAAAVA/VF2MtDqoRmM/s72-c/graph-1.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://laclefyoshi.blogspot.com/2011/08/basic-network-analysis-and.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU4EQ3k5eyp7ImA9WhdRFko.&quot;"><id>tag:blogger.com,1999:blog-4078805449160415851.post-2598748278084966002</id><published>2011-08-06T21:42:00.001+09:00</published><updated>2011-08-07T08:38:22.723+09:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-07T08:38:22.723+09:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="web" /><title>schema.org for people or machines</title><content type="html">&lt;a href="http://schema.org/"&gt;schema.org&lt;/a&gt; is a collection of terms for describing contents of web page. Google, Yahoo! and Bing think that the search result view is better with reader these embedded terms in web pages. The terms of schema.org is one of metadata terms. And already, &lt;a href="http://schema.rdfs.org/"&gt;schema.rdfs.org&lt;/a&gt; provides RDF Schema documents for schema.org. &lt;br /&gt;
&lt;br /&gt;
But there is no terms for describing metadata of links. For example, the terms don't include "nofollow". Additionary there are not "noindex" or "noarchive". Thus, schema.org is not for controlling search engine (robot). In my mind, links of web pages have meanings. If these meaning are described, better search result can be provided.&lt;br /&gt;
&lt;br /&gt;
Truthfully, these meaning should be read by AI-programmed robot. But it is difficult that the current AI correctly reads semistructured data like HTML documents. I guess that Google is going to gather the metadata for learning of AI.&lt;br /&gt;
&lt;br /&gt;
People with machines will create the better environment for information system.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://techcrunch.com/2011/08/06/the-internet-is-20-years-old-today/"&gt;Happy 20th Birthday, World Wide Web!&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Thanks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4078805449160415851-2598748278084966002?l=laclefyoshi.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/RB3qbxwxXS5G9na5jUUi47fJdEI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RB3qbxwxXS5G9na5jUUi47fJdEI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/RB3qbxwxXS5G9na5jUUi47fJdEI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RB3qbxwxXS5G9na5jUUi47fJdEI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Engineeringexception/~4/8YZtI79Vsok" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://laclefyoshi.blogspot.com/feeds/2598748278084966002/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://laclefyoshi.blogspot.com/2011/08/schemaorg-for-people-or-machines.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/2598748278084966002?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/2598748278084966002?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Engineeringexception/~3/8YZtI79Vsok/schemaorg-for-people-or-machines.html" title="schema.org for people or machines" /><author><name>Yoshiyasu SAEKI</name><uri>https://profiles.google.com/101384646867143843419</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-xEHAXnqop_Y/AAAAAAAAAAI/AAAAAAAAAYc/SuLwm9MVzDM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://laclefyoshi.blogspot.com/2011/08/schemaorg-for-people-or-machines.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkEAR3s6eyp7ImA9WhdREE8.&quot;"><id>tag:blogger.com,1999:blog-4078805449160415851.post-80385939755312006</id><published>2011-07-30T20:17:00.000+09:00</published><updated>2011-07-30T20:17:26.513+09:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-30T20:17:26.513+09:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="tv" /><category scheme="http://www.blogger.com/atom/ns#" term="android" /><category scheme="http://www.blogger.com/atom/ns#" term="dlna" /><title>DLNA in my room</title><content type="html">I bought a TV: SONY BRAVIA KDL-32EX420. In Japan, &lt;a href="http://en.wikipedia.org/wiki/NTSC"&gt;NTSC&lt;/a&gt; was stopped on July 24 and &lt;a href="http://en.wikipedia.org/wiki/Digital_terrestrial_television"&gt;DTTV&lt;/a&gt; has launched. A TV which I had can't screen DTTV, so I needed to replace it.&lt;br /&gt;
&lt;br /&gt;
The BRAVIA has &lt;a href="http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance"&gt;DLNA&lt;/a&gt; client feature. I tried to use it with Android phone and Macbook.&lt;br /&gt;
&lt;br /&gt;
Firstly, I installed &lt;a href="http://www.tvmobili.com/"&gt;DLNA server: TVMOBiLi&lt;/a&gt; on my Macbook. I needed to select "DEVELOPMENT VERSION" (2.0.0.3163/Jul 13 2011) for communicating with BRAVIA. Secondly, I installed &lt;a href="https://market.android.com/details?id=com.pv.twonkyremote"&gt;Twonky Mobile&lt;/a&gt; on my Android phone. Twonky Mobile becomes DLNA server and client.&lt;br /&gt;
&lt;br /&gt;
Of course, they must be located at the same network for linking together with DLNA.&lt;br /&gt;
&lt;br /&gt;
BRAVIA may not be able to find DLNA servers just after starting the DLNA servers. I needed to wait for about five minutes. When the DLNA servers are displayed on media menu of BRAVIA, it's successful. I can select and play MP3, MP4 and  JPG files.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-kQT8-JK_YO8/TjPdlfZdLGI/AAAAAAAAAUI/UTywgI5pLCM/s1600/P1070186.JPG" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="300" width="400" src="http://4.bp.blogspot.com/-kQT8-JK_YO8/TjPdlfZdLGI/AAAAAAAAAUI/UTywgI5pLCM/s400/P1070186.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-oIU1v9-yTS0/TjPebD0lU6I/AAAAAAAAAUQ/g_Zmx1PXLcQ/s1600/P1070187.JPG" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="300" width="400" src="http://3.bp.blogspot.com/-oIU1v9-yTS0/TjPebD0lU6I/AAAAAAAAAUQ/g_Zmx1PXLcQ/s400/P1070187.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Additionally, Twonky can transfer playable media to DLNA client. This feature is called "Beam".&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-MG-ne2K1F8w/TjPh8wZ7IEI/AAAAAAAAAUY/V6ikgv3cOww/s1600/P1070194.JPG" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="300" width="400" src="http://4.bp.blogspot.com/-MG-ne2K1F8w/TjPh8wZ7IEI/AAAAAAAAAUY/V6ikgv3cOww/s400/P1070194.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Remote control of BRAVIA doesn't use infrared ray and use RF (RF4CE). Furthermore, Sony provides a nice &lt;a href="https://market.android.com/details?id=com.sony.seconddisplay.view"&gt;remote controller application for Android&lt;/a&gt; and &lt;a href="http://itunes.apple.com/us/app/media-remote-for-iphone/id373459732?mt=8"&gt;iOS&lt;/a&gt;. This application uses Wifi. &lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-2kLxLRd-ovA/TjPi6Q_TCeI/AAAAAAAAAUg/XN7E7Mweo7M/s1600/P1070189.JPG" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="300" width="400" src="http://2.bp.blogspot.com/-2kLxLRd-ovA/TjPi6Q_TCeI/AAAAAAAAAUg/XN7E7Mweo7M/s400/P1070189.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
In my room, most of devices can communicate with each other through LAN. Some devices are working as server, others are working as client. An Android phone in my hand controls these devices directly or indirectly. This convenient environment is  very similar to a sight which I imagined when I was a child.  The advancement of technology is great.&lt;br /&gt;
&lt;br /&gt;
Thanks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4078805449160415851-80385939755312006?l=laclefyoshi.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/flEnRTNjt3bBSAtxi9dPiJQiPRM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/flEnRTNjt3bBSAtxi9dPiJQiPRM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/flEnRTNjt3bBSAtxi9dPiJQiPRM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/flEnRTNjt3bBSAtxi9dPiJQiPRM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Engineeringexception/~4/4EhmrHiHiBo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://laclefyoshi.blogspot.com/feeds/80385939755312006/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://laclefyoshi.blogspot.com/2011/07/dlna-in-my-room.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/80385939755312006?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/80385939755312006?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Engineeringexception/~3/4EhmrHiHiBo/dlna-in-my-room.html" title="DLNA in my room" /><author><name>Yoshiyasu SAEKI</name><uri>https://profiles.google.com/101384646867143843419</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-xEHAXnqop_Y/AAAAAAAAAAI/AAAAAAAAAYc/SuLwm9MVzDM/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-kQT8-JK_YO8/TjPdlfZdLGI/AAAAAAAAAUI/UTywgI5pLCM/s72-c/P1070186.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://laclefyoshi.blogspot.com/2011/07/dlna-in-my-room.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEAMRHs8eip7ImA9WhdSE0Q.&quot;"><id>tag:blogger.com,1999:blog-4078805449160415851.post-5685918954345284828</id><published>2011-07-23T12:46:00.000+09:00</published><updated>2011-07-23T12:46:25.572+09:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-23T12:46:25.572+09:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="protocol buffers" /><title>Protocol Buffers Inheritance</title><content type="html">For describing inheritance of messages with &lt;a href="http://laclefyoshi.blogspot.com/2011/07/protocol-buffers.html"&gt;Protocol Buffers&lt;/a&gt;, there are some techniques. I thought about each merits and demerits since the previous entry.&lt;br /&gt;
&lt;br /&gt;
I decided to use intension with &lt;code&gt;extensions/extend&lt;/code&gt; by reference to &lt;a href="http://jfaleiro.wordpress.com/2009/12/03/rms-and-protocol-buffers/"&gt;RMS and Protocol Buffers « Technofinancial Singularity&lt;/a&gt;, &lt;a href="http://www.indelible.org/ink/protobuf-polymorphism/"&gt;Protocol Buffer Polymorphism&lt;/a&gt; and &lt;a href="http://christiankerl.wordpress.com/2011/05/13/bringing-emf-ecore-and-google-protocol-buffers-together/"&gt;Bringing EMF Ecore and Google Protocol Buffers together « Christian Kerl&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;script src="https://gist.github.com/1100941.js"&gt; &lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;script src="https://gist.github.com/1100947.js"&gt; &lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;script src="https://gist.github.com/1100951.js"&gt; &lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ read_person
Person ID: 0
        Name: you
Person ID: 1
        Name: saeki
        He is flying!
&lt;/pre&gt;&lt;br /&gt;
By using &lt;code&gt;extensions/extend&lt;/code&gt; for  describing inheritance, I don't need to rewrite a parent message every time a child message is added. Furthermore, a child message can be assigned to a field which is designated as the parent message.&lt;br /&gt;
&lt;br /&gt;
Thanks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4078805449160415851-5685918954345284828?l=laclefyoshi.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/w1-nYqLUS-yUNw_M5oCh0-K33Ms/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/w1-nYqLUS-yUNw_M5oCh0-K33Ms/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/w1-nYqLUS-yUNw_M5oCh0-K33Ms/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/w1-nYqLUS-yUNw_M5oCh0-K33Ms/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Engineeringexception/~4/f_axgkWX4JA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://laclefyoshi.blogspot.com/feeds/5685918954345284828/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://laclefyoshi.blogspot.com/2011/07/protocol-buffers-inheritance.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/5685918954345284828?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/5685918954345284828?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Engineeringexception/~3/f_axgkWX4JA/protocol-buffers-inheritance.html" title="Protocol Buffers Inheritance" /><author><name>Yoshiyasu SAEKI</name><uri>https://profiles.google.com/101384646867143843419</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-xEHAXnqop_Y/AAAAAAAAAAI/AAAAAAAAAYc/SuLwm9MVzDM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://laclefyoshi.blogspot.com/2011/07/protocol-buffers-inheritance.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C04EQXg_fip7ImA9WhdSE0Q.&quot;"><id>tag:blogger.com,1999:blog-4078805449160415851.post-2741964960176478042</id><published>2011-07-16T14:19:00.001+09:00</published><updated>2011-07-23T12:31:40.646+09:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-23T12:31:40.646+09:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="protocol buffers" /><title>Protocol Buffers</title><content type="html">There are many serialization formats. For example, there are &lt;a href="http://docs.python.org/library/pickle.html"&gt;pickle for Python&lt;/a&gt;, &lt;a href="http://download.oracle.com/javase/6/docs/api/index.html?java/io/Serializable.html"&gt;Serializable API for Java&lt;/a&gt;, and so on. These choices are dependent on the used programming language.&lt;br /&gt;
&lt;br /&gt;
On the other hand, there are &lt;a href="http://en.wikipedia.org/wiki/Serialization"&gt;some serialization formats which are independence on the used programming language&lt;/a&gt;. For exmaple, there are &lt;a href="http://en.wikipedia.org/wiki/XML"&gt;XML&lt;/a&gt;, &lt;a href="http://www.json.org/"&gt;JSON&lt;/a&gt;, &lt;a href="http://code.google.com/apis/protocolbuffers/"&gt;Protocol Buffers&lt;/a&gt;, and so on.&lt;br /&gt;
&lt;br /&gt;
I started to use Protocol Buffers because I need to write a schema of the data for serialization and require the faster behavior.&lt;br /&gt;
&lt;br /&gt;
I wrote a simple proto code and C++ code after reading tutorial.&lt;br /&gt;
&lt;br /&gt;
&lt;script src="https://gist.github.com/1086009.js"&gt; &lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ protoc person.proto --cpp_out=dist
&lt;/pre&gt;&lt;br /&gt;
&lt;script src="https://gist.github.com/1086012.js"&gt; &lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;script src="https://gist.github.com/1086013.js"&gt; &lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ g++ -o add_person add_person.cc person.pb.cc `pkg-config --cflags --libs protobuf`
$ ./add_person

$ cat -v PersonBook  # for showing nonprinting characters
^H^A^R^Esaeki^Z^Qsaeki@example.org^H^B^R^Hfurukawa^Z^Tfurukawa@example.org

$ g++ -o read_person read_person.cc person.pb.cc `pkg-config --cflags --libs protobuf`
$ ./read_person
Person ID: 2
        Name: furukawa
        Email: furukawa@example.org
&lt;/pre&gt;&lt;br /&gt;
I didn't set a manager class for &lt;code&gt;Person&lt;/code&gt;. So this &lt;code&gt;read_person&lt;/code&gt; can read an only last &lt;code&gt;Person&lt;/code&gt;.&lt;br /&gt;
&lt;br /&gt;
I wrote a Python code, too.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ protoc person.proto --python_out=dist
&lt;/pre&gt;&lt;br /&gt;
&lt;script src="https://gist.github.com/1086019.js"&gt; &lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;$ python  read_person.py 
Person ID: 2
        Name: furukawa
        Email: furukawa@example.org
&lt;/pre&gt;&lt;br /&gt;
&lt;script src="https://gist.github.com/1086023.js"&gt; &lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
I want to represent classes inheritance. But Protocol Buffers doesn't provide the way for representing them. But there a way as to use intension; ref.&lt;a href="http://www.indelible.org/ink/protobuf-polymorphism/"&gt;Protocol Buffer Polymorphism&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Isn't there any good way?&lt;br /&gt;
&lt;br /&gt;
Thanks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4078805449160415851-2741964960176478042?l=laclefyoshi.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/nfXLopXfdK0MZkiQDXw8Orq-m_8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nfXLopXfdK0MZkiQDXw8Orq-m_8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/nfXLopXfdK0MZkiQDXw8Orq-m_8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nfXLopXfdK0MZkiQDXw8Orq-m_8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Engineeringexception/~4/iXooc8pRshg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://laclefyoshi.blogspot.com/feeds/2741964960176478042/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://laclefyoshi.blogspot.com/2011/07/protocol-buffers.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/2741964960176478042?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4078805449160415851/posts/default/2741964960176478042?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Engineeringexception/~3/iXooc8pRshg/protocol-buffers.html" title="Protocol Buffers" /><author><name>Yoshiyasu SAEKI</name><uri>https://profiles.google.com/101384646867143843419</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-xEHAXnqop_Y/AAAAAAAAAAI/AAAAAAAAAYc/SuLwm9MVzDM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://laclefyoshi.blogspot.com/2011/07/protocol-buffers.html</feedburner:origLink></entry></feed>

