Ads by Google

Thursday, December 24, 2009

Cygwin 1.7 Released

Just saw on the mailing list that cygwin 1.7 has been released. For people who have to work on Windows, Cygwin provides an Unix like emulation on Windows.

Just in time for Xmas and the new year.

Season's greetings to all and best wishes for the new year.

Thursday, December 10, 2009

Offtopic Observations

After a bit of travel to Europe, am back.

Welsh signboards make me giggle like a retard. It looks like whatever letters crop ups when a cat sits on your English keyboard.

And it is indeed news to me, that whole swathes of people in the East (Chinese especially) sign off their IM or Yahoo chat with 88. Yep, the number 88.

That is all.

Friday, November 20, 2009

Churn baby, Churn

Rs 19.

That's the fee for number portability.  Less than a half pack of ciggies cost.  With a purported 400 million user base, it's going to be one massive headache for the operator.  Much of the problem is one of their own making.  Increasing the subscribers without attendant increase in cell phone towers.  Dropped calls and no connectivity, with people on prepaid watching their precious talk time go down without a word being spoken, they're going to get socked like crazy by the prepaid crowd.

Everyone of my friends and colleagues are just waiting for this to get rolled out and then, they'd hit the phones and switch. I believe the salesmen who work on commission to close out on subscribers for each operator will make a killing in the first few months.

Though, I'm pretty sure, the operators will find a way to make it a disincentive to switch.  One rumour I heard was that it might take as long as 4 or 6 weeks for the switch to be complete.   If the US experience is considered when portability was introduced, I'd wait a good 6-8 months before switching.

If it comes to that.  I'll take a lower bill and other extra minutes thrown in, anytime rather than switch.  Since I have my broadband and mobile from the same operator, hopefully I have some leverage.

Hopefully.


Wednesday, November 11, 2009

Another Day, Another Language: Go: From Google

From LWN, I learnt that Google has released a new systems language because....nothing had been done in that area for some time.

So, we have Go.

After you've gone through the FAQs, which I strongly suggest you do, as it contains interesting pointers on the whys and whats of this language,  one has this nagging feeling ....

Exactly what issue are they addressing and for whom?  It's there in the FAQ but are YOU convinced?

Tuesday, November 10, 2009

MobileOrg 1.0 for iPhone/iPod Touch now available

I've been meaning to post this for sometime but I kept forgetting.  Well, the title says it all, from the org-mode mailing list on the announce.

Read the post for the features and links for downloading it.  There's even a screencast here.

Sunday, November 1, 2009

A quick way of looking up colours in LaTeX

While making beamer presentations, I generally use dvipsnames or svgnames as an option to beamer. This allows me to use named colours instead of giving some RGB numbers to get the colour I want.

Well, sort of.

I mean you still have to figure out what HoneyDew looks like. I used to google it up and check how the colours actually looked. Now, I've got a simpler way to do it. Just do, M-x list-colors-display in Emacs and it shows about the same list as that of svgnam.def with the visual colours. Saves you a few keystrokes and clickies.


You of course, are using Emacs and AucTeX aren't you? :-)



Sunday, October 25, 2009

Carnatic Music Internet Radio/streaming stations?

If anyone knows of a working internet radio station focused on Carnatic Music, could you let me know of them in the comments?  My searches have lead to me only one and the rest seems to be pretty dead.

And the one I found is pretty simple to use too, I have to just plug the url into Windows Media Player and it works.

Tuesday, October 20, 2009

JTikZ: A Java library that produces TikZ code

From an email to the pgf mailing list, Evan Sultanik has written a Java Library to create TikZ code.  If you code in Java, then it might be useful even if the code is in early stages of development.  The library can be found here.

Instructions on using the Library can be found in the email.


Thursday, October 15, 2009

Using Emacs Regular Expression Builder

Sometimes it's worth using or getting help on the work you're trying to do. For example, in the Unix world, regular expressions are powerful tools to match,print, find or delete text strings. While mostly the regular expressions achieve what we want, it might be good to get some help in identifying whether the regex is doing what we intend it to do.

In Emacs, there is such a feature called re-builder, invoked as M-x re-builder. As you type the regular expression in the minibuffer like prompt within the double quotes, the text buffer gets highlighted with the current regex that has been typed so far. As you keep modifying the regex, the buffer too is highlighted dynamically on what that regex will match. Once you're satisfied with the regex C-c C-w will copy it to the kill ring and use it in, say C-M % which is generally bound to query-replace-regexp.

The following screenshot shows the matched text and the regex entered. I was trying to delete off everything after the 2nd semicolon.


The highlighted portion is due to the regex shown below


Give it a shot. It saves you a lot of time figuring out the correct regex.

Saturday, October 10, 2009

Gnuplot tricks blog

If you've done any kind of plotting on the Unix side, you probably would have heard of gnuplot. I've been using it for years on and off and all my learning has been to cadge off the demo scripts on the home page. Those are excellent of and by themselves. To complement that, I saw a post on the gnuplot newsgroup about a blog http://gnuplot-tricks.blogspot.com/ by Zoltán. As mentioned in the post, he also maintains the same examples at this site.

I must say, it is an excellent blog on using gnuplot and I confess, that it does make me want to learn gnuplot to the extent the blog author has done.

Go take a look for the fantastic quality of the graphs.

Wednesday, October 7, 2009

Incrementing counters in Emacs macros

If you've used macros in Emacs, sooner or later you'd need to automatically increment as expressed in this thread. If you read the thread, you'd see a number of suggestions but the simplest is to use the builtin Emacs counters. The Emacs manual too mentions how to use them.

The Emacswiki too mentions how to use them and some tricks in getting it to do it the way you want.

Learn it, it saves a tremendous amount of drudgery typing

Saturday, October 3, 2009

Passing AWK variables to shell commands for evaluation

For some reason, I never seem to get how to use the shell from within GNU AWK to manipulate the AWK variable and return it. Spending a lot of time with the system and getline command, I still couldn't figure out how to pass a variable to a shell command, evaluate it and then return the value.

After much trial and error and googling, this seems to work.
a=20090601
cat ../data/C_100119.dat | \
awk -v compdate="$a" '{
while ("date --date="$4 " +%Y%m%d"|getline aa)
{
if(aa >= compdate)
print $0
else
exit
}
}'


where I'm extracting records whose 4th column date value is greater than a.

Hope this is useful to others.

Update: Scratch the above code. I got some feedback about the correct ways to use getline.
a=20090601
awk -v compdate="$a" '
{
if (("date --date="$4 " +%Y%m%d"|getline aa) >0){
if(aa >= compdate) {
print
next
}
}
exit
}' ../data/C_100119.dat



is a better way to do it.

Saturday, September 19, 2009

Making WinEdt work with MiKTeX 2.8

Apparently people are running into some issues making WinEdt work with the latest version of MiKTeX.   The following post by the WinEdt team might be of use to WinEdt users.  It details how to fix WinEdt to make it call MiKTeX properly.

Friday, September 11, 2009

An improved or better Quicksort?

Via reddit, this is an interesting post on using 2 pivots to do quicksort with an attendant savings in swaps and speed.  I wonder how soon this will get into other tools.


Sunday, September 6, 2009

Getting Slide or Frame numbers in Beamer Warsaw Theme

While preparing a presentation using Beamer, I decided to get the slide numbers(frame numbers in Beamer parlance) into the presentation just to pace my slides. And it turns out that it's not easy as it sounds. I tried a variety of setbeamertemplate options and even considered editing the template. I believe beamerouterthemesplit.sty is the file to change though I have no idea what I have to do.

A bit of googling got to me to this page and I have no idea why the suggestion works. But it does. I have broken it into 2 lines with a extraneous \ at the end of the first line.

\title[Short Title \hspace{4em} \insertframenumber\ \
of \inserttotalframenumber
]{Full Title}


Friday, September 4, 2009

An Emacs keybindings help tip

In Emacs, C-h k or C-h m will show you the help regarding what function is bound to the key or what keys are bound in the buffer you're currently working on.  If it's a drag to scroll through the entire list or if you want to narrow it down, you can press the prefix keys and then C-h to get only those keybindings that start with the prefix key. 

For example, pressing the prefix C-x r and then C-h  (C-x r C-h) will only show the help regarding the key bindings starting with the prefix C-x r.  This is useful when you enable a minor mode that has a prefix key combination that you use infrequently.  In the normal case, you'd have to invoke C-h m and then scroll down to the respective section in the help buffer.  If you knew the prefix, then pressing the prefix followed by C-h will be "context" sensitive help.

Based on the thread here on gnu.emacs.help.

Sunday, August 30, 2009

A Lisp book incident

The herd effect in programming is very powerful.  Whatever is the programming flavour this year, that's where the crowd is going to be.  Lots of Java, C#, VB etc.   If you ever wondered on the uptake of Lisp and its ilk....

A few years ago, I happened on a copy of Winston Horn's Lisp book in a book store.   The book seemed untouched, was dusty and was jammed in one corner of a bookshelf.  When I wanted to buy it, the owner seemed happy to get rid of it.  He even gave me a good discount over the list price saying "That's the last copy I have and you're the first person in years to buy this book"

hmmm....

Lugging it around my workplace, a few weeks later, I misplaced it.  Searching all over the usual places, I couldn't locate it.  Resigned to the fact that I lost the book within a few weeks of purchase, I made a half hearted call to security, whether someone returned the book there.

To my delight, he said, that the book was found by one of the security personnel in the cafeteria and I could come and collect it.

When I went to get it, the head of security said "What is this Lisp?  I've not heard of it.  If this had been a Java, C# or ASP book, you'd not have got the book back. It would have been taken by someone."

Guess that's the bright side of getting your book back. OTOH, Lisp popularity....

Sunday, August 23, 2009

WoMan: An Emacs interface to read man pages

If you've worked with terminals and launched man in it, it's a bit weird to suddenly use vi commands to navigate the man pages.  And it really is a problem to navigate on older *nixes with the way the screen moves or refreshes itself. Well, Emacs has a really good interface to read manpages call WoMan (Without Man).  Nicely formatted, easier navigation and ability to jump from section to section is among the features I like in it.

It can be launched as M-x woman and will prompt for a command you want the manpage on.  Now, if you have cygwin installed, it should work without a hitch, otherwise you might have to customise woman-manpath and woman-path to point to where the manpages lie.  Reading the variable documentation on both using C-h v , which should tell you how to set it.

Note that, it launches a new frame (Window in Microsoft terminology) to display the manpage and would probably be in a different font.  You can close the frame by pressing C-x 5 0.


Saturday, August 15, 2009

Getting DocView to work on Windows Emacs

Emacs 23 has a new document viewer called docview.  From the manual

is a viewer for DVI, Postscript (PS),and PDF documents.  It provides features such as slicing, zooming, and searching inside documents.  It works by converting the document to a set of images using the `gs' (GhostScript) command, and displaying those images.

To get it to work on Windows, you'd at least need to have a working LaTeX system like MiKTeX.  And also have ghostscript installed.  Now, if you read the Docview info, this is all you need to get it work but on Windows you need to jump through additional hoops to view it.

As a first step, M-x getenv RET PATH should show something like this.

C:\MiKTeX2.7\miktex\bin;C:\cygwin\bin;C:\cygwin\usr\bin;C:\gnu\bin\;....

Next configure all doc-view-*-program to point to the correct binaries.
Upto this point, docview will work to convert the DVI or PDF file to a PNG file.  In order to view the files, you need to have Emacs with Image support.  On Windows, the following DLLs are required to make it work.
glut32.dll
jpeg62.dll
libimage.dll
libpng12.dll
libpng13.dll
libpng3.dll
librle3.dll
libtiff3.dll
zlib1.dll
which can be had from downloading the following from the gnuwin32 site.
libpng-1.2.37-bin.zip
libpng-1.2.37-dep.zip
tiff-3.8.2-1-bin.zip
jpeg-6b-4-bin.zip                        
tiff-3.8.2-1-dep.zip
jpeg-6b-4-dep.zip                        
Note that the actual version numbers may differ.  Just take only the DLLs and dump them in the Emacs bin directory. Or you could put them somewhere in the search path, so that you don't have to do this step every time a new Emacs version is released.

Docview should now work without a hitch.  The added bonus is that other image formats can also be viewed within Emacs with all the other DLLs plugged in, in Image mode.

In my set up, docview program variables point to a mix of MiKTeX and Cygwin binaries and that has not created any issues so far.

Thursday, August 13, 2009

Sending Emails from the commandline Part 2

Previously I had posted about my challenges in getting attachments sent and being seen reliably as one in most MUAs. Spending a few more days pottering around and testing, I finally settled on mpack. Using mutt, I could not get it to work consistently in an cygwin environment as it kept dumping core.

I downloaded mpack, ran make and then installed it. Based on the manpage and a few examples on the web, I rejigged my shell script use mpack to generate a MIME encoded mail message, wrapped with msmtp needed headers and mailed it out. Works flawlessly.

So far.

The code snippet below is the way I used it.
function send_it () {
/usr/sbin/msmtp -t < $1
echo "mail send status" $?
if [ $? -ne 0 ]; then
echo "Fail: $1 file not deleted"
else
echo "Success: Removing $1 file"
rm $1
fi
}

function mpack_it () {
# outmimefile, zip file name, tmpfile split_part
mpack -s "Generated Output $4 : `date` " -o $1 $2
#change inline to attachment, insert msmtp needed headers and delete message-ID
sed 's/inline/attachment/' $1 | sed "/^Subject:/i\
To: \nFrom: xxxxxx@gmail.com \nBcc: $LIST"|sed '1,1d' > $3

}


The attachment itself is base64 encoded.

This solution, I'm reasonably satisfied with, though I'm pretty sure when I try an all Win32 solution, it might flame out spectacularly.

Sunday, August 9, 2009

RefTeX 4.34 released

Just got an email stating that a new version of RefTeX has been released.  You may want to upgrade depending on your needs.


Saturday, August 8, 2009

Sending attachments from the command line

I spent about 2 hours trying to get this sorted out but I'm pretty much unsatisfied with  the results.

I want to send emails with largish attachments from a script.  And I use msmtp as my MTA.  After reading up things and trail and error, this works for me.

$( cat ./mail.txt; uuencode output.zip output.zip) | /usr/sbin/msmtp -d -t

where  mail.txt has the From,To,Subject and body text and the .msmtprc file has the mailserver userid and password details to connect to the smtp server.  Since I use the cygwin based msmtp, as a script this sends out emails as desired.

The problem is that, the file is not recognised as an attachment in some mail clients and sometimes the encoded file is inline in the body of the text.  On Lotus Notes of my colleague, it appears an attachment in the mail body but he sees no attachment icon to identify it in the folder.  In Gmail  Sent Mail folder, the attachment is completely inline in the mail body and that is significantly going to slow opening those mails in the browser.

Reading up a bit more, I sort of figured, that the attachment needs to be MIME encoded for the attachment to reliably seen as attachments in most MUAs.

Asking around with the author of msmtp, it turns out MIME support is more of MUA thing rather than the MTA.  He suggested using mutt or any other MUA to accomplish the same.  So I have

mutt -s "$SUBJ" -a A_N_scrips.zip  -b "$LIST" < $TMPFILE
where LIST is the list of email addresses and TMPFILE is the message body.  This works except that on large attachments, mutt seems to dump core.  I worked around that by splitting the attachments and sending it in 2 different emails.  Not good but enough to send the files across.  Of course, you need an .muttrc file to be configured to use msmtp to send the mail.

But I think, using an MUA to send a MIME encoded file is a bit much.

Are there any other methods to do it?  Without using Perl?

Wednesday, August 5, 2009

Maximising your screen real estate

If you're a bit like me in that you rarely use the tool bar and menu bar in Emacs, it might be a good idea to turn it off to get some additional lines in your buffer. While it may be strange to look at initially, you soon get used to it as you rarely ever need it.

Add the following to your .emacs
(tool-bar-mode nil)
(menu-bar-mode nil)
And in the rare case you want those back, you can invoke it by M-x tool-bar-mode or M-x menu-bar-mode to get them back.


Saturday, August 1, 2009

Emacs 23.1, Gnus and msmtp

After I upgraded my Emacs to the latest version on Windows, I found that my mail sending was not working anymore. And I use msmtp on cygwin to send emails instead of sendmail by subbing the sendmail binary with msmtp.

;;;;dont set this if you use msmtp!!!
;; (setq message-send-mail-function 'smtpmail-send-it)
(setq sendmail-program "/usr/sbin/msmtp")


This has been working for ages without any issues and I had not made any changes to my .gnus file. Baffling.

What's more, the *Messages* buffer kept saying 'Starting Firefox...'

So, I checked whether msmtp was sending emails through the command line. Check. works fine.

Inspected my .gnus file to see whether the paths were pointing to Emacs 22.2 version. Check. Nothing.

There I was, staring at the .gnus buffer wondering what to do next. Maybe debug this? I set
(setq gnus-verbose 9)
(setq gnus-verbose-backends 9)

and try sending again. Nothing in the *Messages* buffer.

I stare some more at .gnus buffer.
;;;;dont set this if you use msmtp!!!
;; (setq message-send-mail-function 'smtpmail-send-it)
;; (setq smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil)))

hmmm...dimly I sort of make out message sending is not working. Maybe I better check out the documentation and see what it says.
I hit C-h v on message-send-mail-function and I see

Valid values include `message-send-mail-with-sendmail'
`message-send-mail-with-mh', `message-send-mail-with-qmail',
`message-smtpmail-send-it', `smtpmail-send-it',
`feedmail-send-it' and `message-send-mail-with-mailclient'. The
default is system dependent and determined by the function
`message-send-mail-function'.
See also `send-mail-function'.


I get into the Emacs manual and search for 'send-mail-function'. And I find this

The variable `send-mail-function' controls how the default mail user
agent sends mail. It should be set to a function. In most cases, the
default is `sendmail-send-it', which delivers mail using the Sendmail
installation on the local host. On Mac OS X and MS-Windows, however,
the default is normally `mailclient-send-it', which passes the mail
buffer on to the system's designated mail client (see `mailclient.el').
To send mail through an SMTP server, set `send-mail-function' to
`smtpmail-send-it' and set up the Emacs SMTP library (*note Emacs SMTP
Library: (smtpmail)Top.).

So, that's why it was invoking Firefox! The OS was thinking Firefox was the associated default mail client and Emacs was simply calling that.

So message-send-mail-function was calling message-send-mail-with-mailclient instead of message-send-mail-with-sendmail.

I set
(setq message-send-mail-function 'message-send-mail-with-sendmail)

and now everything is back to normal. Now, if you noticed the Emacs manual talks only about send-mail-function and not message-send-mail-function. But since Gnus uses message.el, it was easy for me to find the correct switches.






Thursday, July 30, 2009

Emacs-23.1 Released

Looks like the tarball is up there but the page is not yet updated and the windows binaries are not there yet.

Get. it. now.

Edit: Announcement here

Thursday, July 9, 2009

Last Pretest Emacs Released

Barring a major bug, the last pretest release of Emacs is out.  The windows binaries are here.

The tentative release date of Emacs 23.1  appears to be July 22. Mark your calendars.


Saturday, July 4, 2009

Quickly looking up words in Google through Emacs

Here is a post by Joe Fineman that outlines how to quickly look up something in Emacs.  You need to have w3m installed for it to work.  And it is indeed easier than switching to the browser and looking it up.

(defun google (what)
"Use google to search for WHAT."
(interactive "sSearch: ")
(save-window-excursion
(delete-other-windows)
(let ((dir default-directory))
(w3m-browse-url (concat "http://www.google.com/search?q="
(w3m-url-encode-string what)))
(cd dir)
(recursive-edit))))

(global-set-key "\C-Cg" 'google)






Wednesday, June 24, 2009

Sourceforge voting has started

As I mentioned in a few of my previous posts here and here, org-mode has been nominated  for the community choice awards 2009.

Well, the voting is now open.  Please vote for org-mode which is under the category 'Most likely to change the way you do everything'.  It hardly takes a minute.

Saturday, June 20, 2009

Another Emacs Pretest is out

A new version of the Emacs Pretest is available for download.  The Windows version can be found here, though it seems you might have to wait a bit, as the binary is not available as of posting.

Tuesday, June 16, 2009

Org video for the SourceForge Commmunity Choices Award 2009

In case you didn't know, org-mode has been shortlisted by Sourceforge for community choice award.  In the course of submission, the org-mode developers and users produced a video that showcases orgmode.

The youtube video is here.
Org-mode presentation

Maybe this will convince you to use orgmode?

Wednesday, June 10, 2009

A damn good introduction to org-mode

I'll have to second Carsten here on the awesome new tutorial on all things org by Bernt Hansen.  In Carsten's own words

If you are serious about using Org-mode to get organized, this is simply an awesome resource of ideas, customization snippets, tips and tricks.  I am learning looking at that, too.
And that's from the creator of org-mode!

it's just fantastic.  Give it a read or better still, take a printout and curl up with it.


Monday, June 8, 2009

Deleting mail source files in Gnus

When Gnus fetches mail, it typically stores them as Incomingxxxxxx files under ~/Mail directory and then splits it into nnml or nnfolder depending on your backend preferences.  If you fetch mail frequently, there will be lots of such files under the Mail directory.  One reason why these files exist is, in the rare case you corrupt some recent email or delete it accidently, it can still be retrieved by checking the Incoming files.

However if you want to delete them, you could set the following and it will automatically delete them after 2 days.  You could set it to any number you wish.

(setq mail-source-delete-incoming 2)
(setq mail-source-delete-old-incoming-confirm nil)


More information about other customisation options can be found at the node Mail Source Customization in the Gnus Manual.



Monday, June 1, 2009

Firefox users flip out over sneak MS add-on

This is certainly not going to go down well, is it?  Basically, Microsoft is supposedly pushing an add on that users cannot uninstall and probably not want in the first place.

The last paragraph alone is enough to make people think more about switching to Linux.

Methinks, there might be a lawsuit in the offing.

Sunday, May 24, 2009

Well, the new Pretest Release is out now

Well, whatever issue that seemed to have delayed the pretest seems to have been fixed.  You can get the latest pretest here and the Windows binaries are here.

Friday, May 22, 2009

This had me keeling over with Laughter

From here

<rmrfResume> So let me get this straight.

<rmrfResume> You built a linux system from scratch using hardened GCC

<rmrfResume> secured the whole system with RSBAC

<rmrfResume> Developed private chroots for each and every service ran on it

<rmrfResume> which include an http, ftp, smtp, pop3, imap, irc, and dyndns server

<rmrfResume> WITH mail filtering and dynamic mysql databases for each service

<rmrfResume> with the mysql daemon in its own chroot

<rmrfResume> then did same system networking for the whole lot

<rmrfResume> and had everything running in a single night?

<Pryoidain> I do cocaine.

<cjk> oh

<asaph[Away]> WOW

<rmrfResume> suddenly it all makes sense.


Delay in Emacs Pretest release

While checking for the next pretest release of Emacs, found that the README file says one version while the directory has the older version. A quick google check revealed some bug has caused the maintainers to delay the release.

Oh, well.

Monday, May 18, 2009

Making Emacs start up faster

Here's a couple of tricks to get Emacs to start faster on gnu.emacs.help.  Of course, it depends on how big your .emacs file is, in the first place.  From autoloading to byte compiling your .emacs file, it's all there. 

Take a look, it might be of some help.  Looks like the daemon option is among the best ways to do it.


Saturday, May 9, 2009

Sourceforge Community Choice Awards: Nominate org mode

If you liked using org-mode, why don't you nominate and vote for it in any of the category list they have provided at sourceforge?

Show your support by nominating this excellent and elegant tool.

Sunday, May 3, 2009

Another Emacs Pretest Released

One more Emacs Pretest packages has been released.  The Windows binaries can be found here.

Sunday, April 26, 2009

Having more than one article buffer open at the same time in Gnus

I didn't know this was possible at all, though truth be told I rarely need to have more than one article buffer open at a time. I simply copied the contents and pasted in another buffer if I wanted to compare or check anything.

Anyways, here's a post on how to go about setting it up. 

Friday, April 24, 2009

Firefox CTAN plugins

Via gmane, saw a post about Firefox plugins for CTAN.  Might be useful for folks who want to search from Firefox without going into the CTAN site directly.

If you want to subscribe to CTAN announcements or to the archives, go here or here.

Sunday, April 19, 2009

Htmlize latest version

Just so you know, the latest version of htmlize.el seems to be in the contrib directory of org-mode git repository. Of course, you can also download it from here, the author's site.

For an explanation of what htmlize is, see the emacswiki page. or if you go to the author's site, you will see this file, which is the generated HTML output of his emacs buffer as he sees htmlize.el! Htmlize is able to generate the appropriate html colour codes so that the generated output matches the way you have set up font locking in your Emacs buffer!

The simplest way to understand how htmlize works is to
  1. Download htmlize and load it
  2. Open an existing text file or some code file like a C/C++ program
  3. M-x Htmlize-buffer
  4. Save the generated .html file
  5. Open it using the browser
It would also help to read the documentation commentary in the elisp code.

I've used it many times to show my co-workers my code, instead of just sending the actual code file. You see, their editors (which are definitely not Emacs) does not do syntax highlighting like the way I'm used to or does not have syntax highlighting at all. With this, I have a portable html file and still have the font locking that I want while I'm explaining my brain dead code to them.


Friday, April 10, 2009

Viewing CHM files in Emacs

.chm files are used for documentation and are generally distributed by Microsoft and other companies that accompanies their product. That is, when they're not using PDF.

Well, Emacs can view those CHM files within its buffer.  This page on Emacswiki tells you how to setup Emacs to view chm files.  Note that it requires archmage which is needed to extract the chm content and it looks there is no binary for Windows.  Unless of course, you'd want to build a binary for the Windows platform.  Those with cygwin installed might have an easier time.


Wednesday, April 1, 2009

A better hideshow key combination?

Via the org-mode mailing list, this blog post on a better set of key bindings might be a better way than the ridiculous bindings currently for hideshow.

Do try and let the author know how it works out for you.

Tuesday, March 31, 2009

Emacs Pretest 3 Released

The third pretest release of emacs 23 is now available.  As  usual the windows binaries are available here. Take it for a spin.

Sunday, March 22, 2009

How to use Org-mode for Project Planning

Here is an excellent article on using org-mode for project planning.  If you manage to use org-mode to the extent listed on the article, you pretty much would have learnt most things about org-mode

Though the article is a bit old, it's still a good pointer on using org-mode.


Friday, March 6, 2009

LaTeX Beamer: How to get a logo in the top right corner of the slide

Here's a simple way to place the logo where you desire when you want to get your image on your slide in beamer. Note that you'd need the Textpos package to place the image where you want.


Wednesday, February 25, 2009

Setting term mode colours

For those of you using term mode in Emacs, this suggestion here might be useful if you want to tinker with the colour scheme.

Basically you need to hook the following into term mode as mentioned in the thread.

;; Redefine the 8 primary terminal colors to look good against black
(setq ansi-term-color-vector
[unspecified "#000000" "#963F3C" "#5FFB65" "#FFFD65"
"#0082FF" "#FF2180" "#57DCDB" "#FFFFFF"]))


The colour sequences are of course in hex.


Friday, February 20, 2009

R support added to Org mode

Carsten has just released 6.23 of org mode with R support. From the release notes

Dan Davison has contributed /org-R.el/ which is now in the
contrib directory. Org-R performs numerical computations and generates graphics. Data can come from org tables, or from csv files; numerical output can be stored in the org buffer as org tables, and links are created to files containing graphical
output. Although, behind the scenes, it uses R, you do not need to know anything about R. Common operations, such as tabulating discrete values in a column of an org table, are available "off the shelf" by specifying options on lines starting with `#+R:'. However, you can also provide raw R code to be evaluated.

The R tutorial for org can found here. Of course, you should have R and ESS installed for it to work.



Tuesday, February 17, 2009

Using Licenses as a Marketing Tool

After reading this article on moonlight, I've got this uncomfortable feeling over Open Source licensing.

Let me explain.

In the context of moonlight, it is clear that Adobe has significant lead over Microsoft with its flash tools. So, Microsoft has released a competing tool with an Open Source license and patent infringement protection support. It does appear to be a marketing ploy aimed at Adobe by making it available for free and getting market share from the open source crowd(if it works, that is).

As it stands right now, we have two competing tools that deliver rich content or whatever, one with overwhelming market share and the other just about starting out. The underdog ups the ante by releasing under an opensource license and providing support for cross platform running.

While I'm not claiming the open source crowd cannot see what is happening, does it need to get into this at all?

Two software companies are fighting it out, it's their fight; one ropes in the Open source crowd to fight the other. If there was some ideal to all the Licensing stuff, it now looks like it's now used as a marketing ploy between companies. And in the trenches, the programmers are getting played?

The licensing was about rights to programmers(at least I used to think so), now, it's one more tactic in marketing fights.

Cui bono?



Monday, February 16, 2009

A single standard phone charger. What took them so long?

Via Boingboing, an idea that makes eminent sense.  The amount of irritation that one goes through to get a cell phone charged when you can't find yours....this is a no brainer.

The European Commission plans to force mobile phone manufacturers to manufacture one mobile phone charger for all mobile phones, according the European Commissioner for Industry, Gunther Verheugen in an interview with the German international broadcaster Deutsche Welle.
Can't wait for that to happen. Seriously.

Friday, February 13, 2009

February TUG News

Karl Berry posted this on the comp.text.tex that they're planning to apply for the Google Summer of Code. If you're interested, do get in touch with TUG.

And there are other bits of interesting information on the same post.

Sunday, February 8, 2009

Org-Mode Beginners Customization Guide

Just saw this on the org-mode mailing list. If you're a novice org user or thinking of using org, this tutorial out to be useful to you.

I also suggest that you post to the thread with your own point of view as a beginner. That would help in making a better guide. You probably need to subscribe to the mailing list to post.

Friday, February 6, 2009

Importing a CSV file into LaTeX

I didn't know that csvtools were deprecated in favour of datatool.

A request on the comp.text.tex newsgroup led to this article (PDF file) written by Uwe Ziegenhagen which, though in German, is pretty much self explanatory if you look at the sample code and the generated tables. At least, some were.

The good news is, that the article should soon get translated in English some time later in a couple of month's time.

Which is a bit of a timesaver when you consider that you might have to write another shell or perl script to snarf and spit out a LaTeX file if you didn't have datatool.




Monday, February 2, 2009

Emacs Pretest 1 available now

The first pretest release of what will be Emacs 23.1 is now available for testing.

It might be a good idea to take it for a spin.

The Windows versions are available here.

Wednesday, January 28, 2009

Making Emacs open a default directory

Watch this interesting thread on the emacs newsgroup.  Note how complicated the request sounds and the wealth of simpler solutions that follow.  It's instructive to know that you don't need to use macros or fiddle around with any settings in elisp to do all of this.

My recommendation is that, if you have frequently want to access a particular directory, use bookmarks.  I posted about them here and here.

Saturday, January 24, 2009

R support for Org-mode

org-mode has some decent support for plotting using gnuplot for some time now.  For those using R, it looks like there might be some support for that too, if the preliminary discussions are anything to go by.

Do note that at this stage, you need ESS to be also installed.

Friday, January 16, 2009

Difference between Echo Area and Minibuffer

This thread on gnu.emacs.help provides clear description of what is the minibuffer and echo area.

The confusion arises because the location of text is the same for both. Also the OP's request is useful for a beginner too.

Tuesday, January 13, 2009

CWE/SANS TOP 25 Most Dangerous Programming Errors


Via the TheRegister, finally, someone has come up with a list of errors that will generally get you knackered when you develop your application.

Nice.

Obviously, this list will be useful to people who want to code better and  crackers, who know that things rarely if ever get patched.  Don't get me wrong, I'm all for full disclosure and all that but given the way automated patch cycles work, I'm not hopeful that  a manual sweep of applications will ever be done.

And the rest of the programming world will move on; creating "better" classes of gargantuan errors that will make the security world weep.

Bet on it.

Only when a super massive botnet gets created by some cracker which exploits some or all variations of the errors, will some cosmetic re-arrangement of the deck chairs happen.

Wednesday, January 7, 2009

Good movie formats to embed in LaTeX and PDF

This should be an interesting thread to follow for those who embed movies in their LaTeX document. A fairly good discussion on comp.text.tex on what works and what doesn't with different multimedia file formats and different viewers on different platforms.
*hey, that's 3 differents in one sentence.

Essential reading for those who want to make some interactive PDFs. Just in case, you didn't know, the popular package to embed them is movie15 which allows you embed video and audio files.

Of course, your PDF file will then be humongous; no, no magic compression or size reduction will occur.

Sunday, January 4, 2009

January 2009 TUG News

Just saw a post on the comp.text.tex newsgroup by Karl Berry on the latest TUG news. And that the new PracTeX journal is also out. To those interested in SAS and LaTeX, some of the articles might be useful.

Take a look.

Thursday, January 1, 2009

Applying the same patch again and again

I sync up my org-mode code using git by issuing git pull. And I keep getting the same error every time the one file I edit is modified.

$ git pull
remote: Counting objects: 98, done.
remote: Compressing objects: 100% (31/31), done.
remote: Total 85 (delta 57), reused 82 (delta 54)
Unpacking objects: 100% (85/85), done.
From git://repo.or.cz/org-mode
8915859..cd92610 master -> origin/master
Updating 8915859..cd92610
error: Entry 'Makefile' not uptodate. Cannot merge.

That's because the Makefile has been edited to point to the correct Emacs binary path and other customisations. So I had to rename the Makefile and then redo the command.

$ mv Makefile m
$ git pull
Updating 8915859..cd92610
Fast forward
ChangeLog | 6 +
Makefile | 2 +
ORGWEBPAGE/Changes.org | 140 ++++++++++++++++-
doc/ChangeLog | 12 ++
doc/org.texi | 170 +++++++++++++++-----
lisp/ChangeLog | 51 ++++++
lisp/org-exp.el | 291 +++++++++++++++++++++--------
lisp/org-export-latex.el | 37 +++--
lisp/org-footnote.el | 391+++++++++++++++++++++++++++++++
lisp/org.el | 81 ++++++++--
10 files changed, 1042 insertions(+), 139 deletions(-)
create mode 100644 lisp/org-footnote.el

And then edit the Makefile to re-apply the changes again. Specifically the diff lines highlighted is what I have to change everytime.

$ diff Makefile m
14c14
< EMACS=emacs
---
> EMACS=c:/gnu/emacs-22.2/bin/emacs
17c17
< prefix=/usr/local
---
> prefix=c:/gnu
76d75
< org-footnote.el \
102c101
< DOCFILES = doc/org.texi doc/org.pdf doc/org doc/dir doc/.nosearch
---
> DOCFILES = doc/org.texi doc/org.pdf doc/org doc/dir
316d314
< lisp/org-footnotes.elc: lisp/org-macs.elc lisp/org-compat.elc

Well, a simpler way to do it is as follows.

  1. Issue a git pull
  2. If the Makefile has a conflict, rename the file and issue a git pull again
  3. Generate a patch file by issuing diff -e NEWfile OLDfile > foo.patch
  4. apply the patch on the Makefile as patch Makefile foo.patch
  5. The edits that one has made is re-applied on the new Makefile
$ diff -e Makefile m
316d
102c
DOCFILES = doc/org.texi doc/org.pdf doc/org doc/dir
.
76d
17c
prefix=c:/gnu
.
14c
EMACS=c:/gnu/emacs-22.2/bin/emacs
.
$ diff -e Makefile m > b.patch
$ patch Makefile b.patch
$ make

Since I don't make any changes to org-mode codebase and the only thing that has to be changed everytime Makefile changes is the path info, this is a bit faster than editing the Makefile everytime.

Though it took me sometime to figure it out and there's still this nagging doubt whether there's a even simpler way.

Any ideas?

EDIT: Just realised that the patch file will have to edited to have ONLY the changes you want else it will remove the newer lines added to other parts of the Makefile. So, this post is kind of wrong and displays a slightly addled view of patching AND version control.

Looks like PUBLIC FAIL!