Blog Archive

Tuesday, May 26, 2009

I got stuck with .docx Lightweight viewer -.-


Today i was a bit excited, i was almost finishing building my operating system environment.


Well, look, first i made a little research to look for a tool that can convert .docx to something else(preferently html(optional), open source(mandatory)), ok, i found some, remember that my goal is not use any GUI app or something colselly related to it, i want a command-line tool ! ;)

wv -> deprecated(dont support .docx)
wv2 -> just a library
odf-converter-> need mono, if i install mono i will bring the whole planet of files from internet like java apps does, so, i wont it, i want something native, little and fast.
DocToText -> hmm, i could use, i tried to compile it, saw some #includes missing, didn't had patience to fix basic things, so i gave up on this one.

Then ...

abiword -> i decided to use gentoo normal process to download and install things, i removed every GUI dependency that i didn't want being include in my repository, but unfortunatly i found a spy entering in my secret base, some soldiers with name matching the pattern "gnome", ohh no, my base will be destroyed haha.

Then ...

I got to try the manual process, well, let's check if it really depends that thing, and it did.
But, ohh well, there is me, backing to the big world of 10000000 packages being installed on my system, so i gave up trying to make a little system, that wasn't the first time i couldn't fix that GUI dependencies, the developers of that applications some times forget to think in the command-line guys.



I don't known, ahh well, maybe latter.

Even some of the best(and big) apps (openoffice) didn't the support very well the OpenXML format, and me, thinking in the command-line tools(i'm crazy yaaa i'm).

But, ya, i forgot, as i use the GMAIL(google is nice you can say ;) it convert a lot of formats to html automatically for you see before you download the anex.

So, basically, send for yourself the .docx thing and view in the html.

Monday, May 25, 2009

Lightweight CHM viewer?

Most of the books that we find in the web are in the CHM file format, at least it's better to extract the HTML than from PDF files, but when you saw my last post i wrote about another library that do what we want ;), now its time for the CHM file format.

Let's extract what matters.

Well, if you wanna try yourself, get the source here(wow a new update 2 days ago \o/, thanks goes to Hey Jed Wing).

Hey, remember before you do the stuff "configure --prefix=<path>&&make&&make install" check the features that you can enable, so FIRST "configure --help|less", there might be still an option like --enable-examples(im not with the source right now, and i can't compile it because im compiling a lot of things at this moment).

After the job is done, you might see a new application with a name that should be something like extract_chmLib, to use it check the command-line help anyway, but if you is a kid hard to handle, so type "extract_chmLib <mychmfile.chm> <directory to put the results>"

You will see a lot of files, the directory where the relevant files are are usually under a directory that its name contains just numbers, and under it you always see 2 files, "toc.html" and "main.html".

You want organize the resulting files by hand? o.O

Ok, thats hard for you? learn some shell scripting language, like bash.

I known something about bash ;)

Ohh that's ugly, yes it's but, it works.

You might find usefull sed + bash.

Good luck, when you start getting fluent with bash programming plus some stream line editor(sed ;) you will see why we sometimes like the CLI interface.

But, those things we just see if we are able to, like eyes, just those that has can see.But, those developed that skill, but how? I don't known, but our progress might tell us ;)

Lightweight PDF viewer?

I don't known why pdf exist(html is not enought?why? ok for printing... :| ), but ok we might find a way to get this thing back to a format that is easy to edit and look the source code, the convertion to the HTML.

First we need to say thanks to xpdf authors that have started developing nice tools, not just a viewer.And, later we might say thanks to the new tool that a KDE developer is maintaining at the poppler.freedesktop.org, thats a library to replace the "hacks" some people do using the xpdf to add support to the pdf file format to their apps.As stated, when something must be fixed, we just fix the library.

That's more than a library, take a look at what the source can produce, you will see a nicely done tool that i hope they continue improving it, that one is >>> pdftohtml <<<.

A moment for a smile ;)

Continuing...

That tool has nice parameters that you can put to get good results, the -c to generate complex html documents, a feature for exchanging pdf links by html links, if you want skip the images you can specify the -i parameter, output hidden text and other common parameters like ones to specify the owner and the password, well what i have to say, a great tool, even i'm not using KDE(i say 100%) im eating a slice of the cake that developers are producing.

If i find tools related to html convertion, sure i will post here.

Now we almost have a nice lightweight desktop, but some readers get books in CHM file format.

That's not a problem.

Do you want extract the HTML from it?

Next post.

;)

Lightweight web browsers

No, its not Chrome or Safari, im talking about lightweight, and when im talking about lightweight forget rich and fancy GUI stuff.


  • Links2: good
  • Lynx: a bit outdated
  • w3m: hmm what to say about this one? emacs users maybe...
  • Elinks: nice

One of them support regular expressions, that one is really nice. ;)

The others?

hmmm, the developers are walking a bit slow in some projects, but, anyway there are few people
in this world that can see the amount of interfaces that we could use to control a browser or say anything else, the pure text is nice some times, the markup language for example, say SSML
that's not only for disabled people, who say that is the "disabled one" IMHO.


Note, i like beautiful GUI like Apple ones, but i think that the information on the web(ok the filtered one) is much more beautiful than any GUI.

;]

Please im under a terminal, i need to see one image... ;)

Is nice when we see somebody not too much dependent upon GUI stuff!

Ok fellow, here we go...

Your kernel has support for let's say VGA/VESA?

You known how you check it? if no, i think it's time for you go to the linux kernel download the kernel sources(the full one), put it under /usr/src, unpack it, make a symbolic link from /usr/src/- to /usr/src/linux and go inside there, make sure you have grep installed, and start kidding in the land of pattern searching ;)

Basically(no matter what distribution you have in your hands, you must be able to do it manually :) you need to go to the directory named Documentation.

Do you at least known how to read documentation in Unix-like environment ya?

If you don't, sorry but, i guess that first some other steps must be done, try to check what you can find in that website ->TLDP, what those people do there.

When we turn the computer on, in the boot process if you see a penguim on top of your screen, then the framebuffer is activated, you should look for the special file that provide the access tho the framebuffer, most of the times if you didn't have changed the rules of udev that will be something like /dev/fbX, where X is the number used to differentiate the framebuffer on your machine, here i have just one, it start from 0, so /dev/fb0.

If you known how compile the kernel, you probably known where to find documentation for it, as i wrote, its under Documentation, there you can find, oh let's our reader do its homework...

There are video modes, those adjust the resolution and the depth color for the video output, if you think that in the configuration of your bootloader might have this parameter, then grep for 'vga=' pattern, i don't known what bootloader you are using but, might be lilo, grub or syslinux, however a easy thing is to find the configuration where it should be, grep recursively into the /etc or /boot directory.

Remember the keyword "framebuffer".

http://freshmeat.net/search?q=<query>&submit=Search

Our query might me something like: framebuffer, vga, vesa, fb, etc.

Please remember you should encode your url rfc1738 .

Note: don't include etc. it's a latin abreviation(a dead language sure?) that is used a lot by the
people till today, that happens because people don't known how to write, "and something more..." ;)

I have to say, some of them need patches, do you ever knwon how to compile a software, a Free and Open Source Software(FOOS)?

Have you sometime used the diffutils?

Have you sometime used the gcc?

Are you a programmer?

Where you are, where you will go?

Sunday, May 24, 2009

Why i didn't started programming in the python language

Think, most times when i sit in front of my computer i found that people is using a new language, "that language is nice for it, because A, B and C, etc.", we have some stable ones like C, C++ in the general aspect and others less used by the people like lisp, smalltalk, etc.

Today we have, let's say take a look into this website and, its just wat is known from the author and their "visitors".

Sure i wont make programs with Fortran, but that doesn't matter, today our effort to unify things didn't get well, we like to try out everything we thing that might be nice, even for a little fun.

The core are the concepts, anyway, OO aspects, procedural, Aspect Oriented Design?(i stay just with OO, tanks).

Most of the times we have a good tool on our hands, but most of these times we aren't ready for this, to deal with, the learning curve can be fast, but there is a lot of directions somebody can take, and, i just say Thanks even if i dont use it some time when i said i wanted to.

Today what i see in the open source development is that, even with a lot of "open source languages" in most of the times a lot of softwares is sharing implementations that make dependencies with perl and python.Most of the times perl comes with its XML parser and python with the interface for some GUI apps.

The support is really big, most of the C/C++ libraries that are frequently used by open source programs have a binding for be used with python, sure the perl has a lot of libraries, but it's not
necessarly a software with quailty, or even usefull. At the first glance we look the syntax, but it's not the features we programmers should look for, are those that improve what is more relevant at moment(maintenance, before, now and maybe after ).

Some one said ... a famous one ;)

"...
Perl still has its uses. For tiny projects (100 lines or fewer) that involve a lot of text pattern matching, I am still more likely to tinker up a Perl-regexp-based solution than to reach for Python. For good recent examples of such things, see the timeseries and growthplot scripts in the fetchmail distribution. Actually, these are much like the things Perl did in its original role as a sort of combination awk/sed/grep/sh, before it had functions and direct access to the operating system API. For anything larger or more complex, I have come to prefer the subtle virtues of Python—and I think you will, too." Eric S. Raymond

Planning is not with me, really.

But, like i said, i might give a try. ;)

A nice python utility - Shed Skin

While checking out gnucitizen i found something really interesting for python programmers and something that need attention(there is just 1(ONE) developer doing this work 8|) and its something really nice to speed up some python programs(although im not a python programmer, but one day i'll be!)

What it's?

As the author in the code.google say it's a:

"... experimental compiler, that can translate pure, but implicitly statically typed Python programs into optimized C++. It can generate stand-alone programs or extension modules, that can be imported and used from larger Python programs.

For a set of 35 non-trivial test programs (at over 10,000 lines in total; see the shedskin-examples-0.1.1.tgz download), measurements show a typical speedup of 2-40 times over Psyco, and 2-220 times over CPython. Because Shed Skin is still in an early stage of development, however, many other programs will not compile out-of-the-box. "

mark.dufour

Ok speed is not everything. ;)

"May the force be with you" mark.dufour, because alone that will be a bit dificult.

Frequently i see nice projects that are developed mostly by one person, its incredible, and some of them are used by a lot of people, and no one even care about the developers effort.

Ok that software wont be used by "a lot" of people, but is nice to remember the gratitude of people when they use your software that you gave for free and hoping good results.

"... Unfortunately, there is still only one active developer, so please consider joining the project! "

not only in your project ...

Maybe people fear the progress of the humanity ;)