adventures logo
adventures in linux programming
brasil
portuguese
usa
english

SOFTWARE


bibliotheca
easyrunner
tdesk
wmx
microterminal (FPGA)
webmail
SlideDraw
SlideWidget
LsBrowse
Gscan
KeenView driver
Quadronegro
pppliga
Tiny Cobol
SQLforms

COURSE NOTES


Fac. Nova Roma
CBQ Recife 2012
TcheLinux 2009
CONISLI 2004
C básico
Linux sob medida
Sys.Admin.
Tcl/tk
tclslides talk
tclslides talk 2
FSL(P.Alegre) 2003
Forum linux I
Real Time Linux
Americano Batista Linux

MISC


GDI printers
SOS Linux
gimp tutorial
tcl-guide
hardware projects
free photos
short commands
brazilian keyboard
personal info
html editing
resume
favorite places (links)

ESSAYS


Chapeuzinho Vermelho
Linux Pernambuco
Why Linux?
Installfest
Day after

What's new

A mediocre person tells. A good person explains. A superior person demonstrates. A great person inspires others to see for themselves. - Harvey Mackay


Without freedom there can be no morality. - Carl Jung (1928), Two Essays on Analytical Psychology, R. F. C. Hull, tr., 1953


A democracy cannot exist as a permanent form of government. It can only exist until the voters discover that they can vote themselves largesse from the public treasury. From that moment on, the majority always votes for the candidates promising the most benefits from the public treasury with the result that a democracy always collapses over loose fiscal policy, always followed by a dictatorship. The average age of the world's greatest civilizations has been 200 years. - Alexis de Tocqueville


April 3, 2013 -- Starkit for Raspberry Pi

I have bought a Raspberry Pi single-board computer, and found it enjoyable and suitable for a number of small projects. As I use tclkit and kits for most of my projects, I needed tclkit compiled for the ARM, and specifically, for the RPi. So, if you don't want to redo this work, here it is. I have put the project in my Github page: github.com/rpragana/tclkit-RaspberryPi.

BTW, my rssReader project (now with some improvements) is there too, in its own Github project: github.com/rpragana/rssReader


March 21, 2013 -- RSS Reader

A quick application of Tatu, runs in Linux or Windows (you need a separate tclkit executable for your platform, download it here). You run the starkit with "tclkit rssReader.kit", optionally with an "gui" argument to show you buttons to a console, exit. Then you open a Firefox or Google Chrome browser and point it to http:://localhost:15732/ you are ready to go. You will need a "bmarks.html" file which is exported by Firefox with the feeds (you can grab one here as an example). Put it it the same directory as the rssReader.kit. The rssReader.kit will show all the current items of all the rss feed sources listed in bmarks.html, so add more urls there (the sample have just 10 urls).

Here is it, rssReader.kit.


Nov 10, 2012 -- Nova Roma/Fuctura Presentation

This is a kind of autobiographical presentation I have made at a Ubuntu Linux event today. I have talked about past and current projects, both about hardware and software. Of course, the usual suspects like TinyCobol, Tatu, and several others were found. Plenty of historical images here. See link at the left column on "course notes".


Oct 16, 2012 -- Tatu Oct2012 release

Here there are two versions of Tatu, which I talked about at the CBQ presentation (see previous post). The full kit is tatu.kit and the other is a minimum package without the bells and whistles of the former kit: tatuMin.kit . Choose yours and happy download!


Oct 16, 2012 -- CBQ Presentation

I have made a short presentation for the Brazilian Congress of Chemistry, in Recife, today. It was about Tcl and my Tatu web server and its use on automation projects. You may find the slides at the left column of the site (look for CBQ).


Aug 1, 2012 -- TweetAgenda - some screenshots

Here are some TweetAgenda screen shots, taken with Opera Mobile. As the interface is made with jQM (jQuery Mobile), it will work very well both in smartphones and desktop computers.

This is main screen. From here you may hand edit (or cut-paste) an individual tweet, configure the time between tweets, or load a file with a list of tweets in json format (advanced for most users).

This is the scheduled tweets screen. From here you may push a button (list item) and edit or delete each tweet. The smal numbers are times calculated for each tweet. Click the numbers, you select a tweet and may change its place by click another. Its color becomes yellow, while selection is active.

This is during tweet edition. The textarea is used for editing the tweet contents. The buttons below for saving or deleting the tweet. To leave it as is, just close the dialog.


Jul 31, 2012 -- TweetAgenda - more bugfixs

TweetAgenda (released 2012-07-31) is another bugfix release. The previous kit was mixing updates when several records were being edited, one after the other. Now proper operation is expected.


Jul 20, 2012 -- TweetAgenda - new bugfix release!

TweetAgenda (released 2012-07-20) have the function to swap entries, for reordering tweets, fixed. You click the small counter with predicted time to select and the the same value in another tweet to swap them. Notice that only the clicked items are changed, all others remain the same. This is because the ordering is by time of inclusion of an item. The swapping operation just swap those times.

-->
Jul 16, 2012 -- TweetAgenda - improved release!

TweetAgenda (released 2012-07-16) now have a function to reorder the tweets (click the small number with predicted time to select, then click the same number in another row to move), better editing, and fixed a bug which prevented it to refresh properly after an remove/modifying operation. Please see instructions on the previous post to install and other information.


Jul 14, 2012 -- TweetAgenda - schedule those tweets!

There are several online Twitter scheduling tools, most of them paid and others free but cumbersome to use. So here is your own "twitter scheduler server". It will run in port 12991 (can be changed to any) and will schedule many tweets to be delivered each 30 minutes or any other time interval you want. Furthermore, you will enter browse your pending tweets and may edit or remove any of them, from your web browser. You will be in control! Yeah!

TweetAgenda is a starkit (get "tclkit" for linux or windows to run it) and can be installed easily. Just copy it to where you want. Place a twitter.cfg file with your Twitter credentials (user, password, oauth token and its secret) by downloading and editing its contents. Then you're ready to go. Start the server and point your browser to http://localhost:12991/ and then post your tweets. Click the buttons to list/edit what's already post. Keep the server running in background ("screen" is your friend under Linux). Any trouble, please complain about it by dropping me a email.

Most important of all: have fun and don't pay a dime anymore to schedule your tweets. Happy tweeting!


Jan 3, 2012 -- More changes in Visual Tcl

have been working again with Visual Tcl and added another small feature, a way to align (placed) widgets on its parents, keeping its -x and -y as multiples of given values. It's a quik-and-dirty change, like my old addition "copy-attribute". If you're interested, here is vtcl-modif-20120103.kit, a starkit with the changes applied.

It seems Visual Tcl has no official maintainer, but I have no time to accept that mission. So anyone that have the time to do so, please, add those patches to the official version. I thank you very much, and so the users.


Jul 18, 2011 -- Tatu version 0.6.1

Get the latest tatu-0.6.1.kit . Still more improvements. Not yet any documentation, sorry. You may want to check out chinook.sqlite to experiment with a database. (see project homepage at http://chinookdatabase.codeplex.com for more information on this sample database) Tatu already have support for SQLite3 inside (again, you may get more info at http://www.sqlite.org), interfaced with Tcl.


Jul 4, 2011 -- Tatu version 0.6

Get the latest tatu-0.6.kit . Added ETag support to the server, and some other http headers. The Layout editor is much improved, now saving separate js/css/html pages, with support for editing events (javascript handlers), jQuery UI dialogs, and much more. There is a need for documentation. Any takers?


May 28, 2011 -- Tatu vers. 0.5.1

Grab your new Tatu starkit tatu-0.5.1.kit (as before, right-click and "save as" to download). The layout editor is much better now. It supports many advanced CSS3 features like gradients, text and box shadows (even multiple), border radius, and some more. There is a new command to make paginated DIVs, which you recall (at the generated html) with $('#YourDivId').selectPage(n) where n is the number of page you want to show. Of course, this is a jQuery selector, but the source is very small, so you may use it even without jQuery. Comments are welcome!


May 14, 2011 -- Tatu vers. 0.5

Grab your new Tatu starkit tatu-0.5.kit (as before, right-click and "save as" to download). Now there is a new tool, a visual html/css editor with some jQuery UI macro-widgets, and other html elements. It features a nice toolbar where you can view/change most css properties. Use the menu to save, or export a html file with the same filename as yours.

To begin a new design, create an empty file and rename it as "something.hole" ("hole" in portuguese carry a brazilian joke, "buraco do tatu", sorry if it is not what you expected!). Then right-click it and choose the layout editor, just below the text editor. Opera users should select the file first and use the toolbar at the top (as there is no context menu in Opera). It was tested also in Google Chrome (which I use for development), and Firefox 3/4, successfully.

This is still a work in progress, so expect bugs. Boy, I have been working in that for less than a month! Expect to see large improvements in the next weeks. And the main Tatu project is far from finished. I plan to turn it in an easy-to-use web development tool, full-featured.


April 26, 2011 -- Tatu vers. 0.4.3

Enhancements and still some bug fixes tatu-0.4.3.kit (please right-click and "save as" to download). There was some problems acessing the server from other machines in the file manager, now ok. Added command to duplicate files (make copies).

I'm trying to find a good way to create layouts for (but not only for) forms, to visually edit widgets like it could be done in Visual Tcl or SpecTcl, but for javascript/css widgets, of course. Maybe someone is interested in helping me. It is fun! You have a nice environment for editing (without rebuild the kit, or restarting the server), by running "tclkit tatu.vfs/main.tcl" and just refreshing the browser after each change. By opening multiple browser windows, you can cut-n-paste code between two editor instances, duplicate templates as new files, etc. All inside your Google Chrome or Firefox!


April 23, 2011 -- Tatu vers. 0.4.2

More fixes and news tatu-0.4.2.kit (please right-click and "save as" to download). Now it can upload files into the kit, as expected. There was a mess with multipart form date which required me to rewrite parts of the code. There is also a new added editor for html files, CKEditor. To enter it, first select the file (.html) in the file manager and open to edit as text, then click the button "ckeditor" in the floating toolbar. There is no way to come back to the text editor (CodeMirror). You finish it by saving your changes, then edit again.


April 19, 2011 -- Tatu vers. 0.4.1

This is a bug fix: tatu-0.4.1.kit (please right-click and "save as" to download). The released 0.4 corrupts some edited files by not escaping json strings as expected.


April 18, 2011 -- Tatu vers. 0.4

Tatu is now version 0.4: tatu-0.4.kit (please right-click and "save as" to download). Besides the usual suspects, bugs removal, there are some news. It now incorporates a kit file manager and editor, with syntax highlight for javascript, htm and css (but not for tcl, unfortunately, soon arriving). Also, there is an integrated debugger and logger, so you don't need a console to see what's going on, or to send some introspections commands. All right there, in your browser, a nice console with history, colored output and full text wrap. Everything is javascript/html/css, so you may use its own tools to see how it's done.

The idea is to make Tatu become a web server with its own IDE, self-modifiable. There is no object-relational mapping yet, but perhaps it would be interesting to have some kind of layout editor to make easier to create interface for web applications. If you edit something, remember the starkit will be writte back (modified), so please, make a copy of the kit first. Be careful if you try to change anything at "tatu.kit/lib/*" or you may render the kit inoperable! Enjoy!


February 3, 2011 -- Tatu vers. 0.3, Now with routes

Here is tatu-0.3.kit. And now, a quick guide to write routed commands:

  • A routed command receives two arguments: a connection handler, and a Tcl dict with all parameters assigned to a route. Most commands will be sub-commands of this handler (we store it in the examples, in the variable conn, so most commands will be like $conn cmd);
  • To set headers at the response, one may call $conn outHeader, with an status code (http status) , which must be present, or leave it blank ("") to not modify it, followed by a list of pairs of header identifiers followed by their values;
  • To output actual content to the message's body, use $conn out.
  • After defining your routing command, register it with the server with tatu::addRoute . The first argument is a "Sinatra-like" route with ":name" being the name of each parameter which appears on the route.
Let's see an example to clarify the things a bit.
proc route1 {conn parms} {
	$conn outHeader 200 {Content-Type text/plain}
	$conn out "Example of plain text output from a command (service)
Parameters: $parms"
	return 
}

proc route2 {conn parms} {
	$conn outHeader 200 {Content-Type text/plain Content-Disposition
			{attachment; filename=tatuOut.txt}}
 	$conn out "This should be placed in tatuOut.txt, as default.\n"
	$conn out "Parameters: $parms"
	return
}

proc route3 {conn parms} {
	$conn outHeader 200 {Content-Type text/plain}
	$conn out "method=[$conn reqCmd]\n"
	$conn out "queryNames: [$conn queryNames]\nQuery variables:\n"
	foreach var [$conn queryNames] {
		$conn out "$var --> [$conn queryData $var]\n"
	}
}

tatu::addRoute "/book/:title/author/:author" route1
tatu::addRoute "/simple/:n" route2
tatu::addRoute "/query" route3


January 31, 2011 -- Tatu vers. 0.2

Here is tatu-0.2.kit (please right-click and "save as" to download). It was rewritten with "snit" to make it easier to grow. Next, I'll try to add a router to map RESTful paths to commands, and later, an object-relational mapper. The idea is not to grow it too much, as it is going to serve local connections mainly. Don't worry, if there are no docs now, I will fully document it with usage and several examples (more elaborate than now). But if you browse the code, you will see it is still very simple at about 300 lines. To do that, "sdx unwrap tatu.kit" and look for the source at tatu.vfs/lib/tatu/tatu.tcl. The tests with a database, require an sqlite3 database with filename "database.sqlite". You may change the queries to suit your tables.


January 25, 2011 -- Tatu - an embedded http 1.1 server

Here is tatu-0.1.kit a simple 250 lines web server with many Http 1.1 features (pipelining, persistent connections), not fully compliant yet, but we'll get there. It requires a standard 8.5.x tclkit (not 8.6 beta, as some other servers around).

It is written in Tcl (of course!) and is very easy to deploy, because it can run from inside a starkit. The kit is large, because there are several demonstration code examples, with widgets, javascripts, css, html, and a couple cgi simple services: one for uploading files, and the other to query a server-side SQLite database.

Browser storage in HTML5 is very limited (only 5-10MB files maximum), so not practical for any application we may have. The idea is to have a local server, with no such limitations to create our desktop applications in the browser. Next, we will try to add a router for RESTful access mapped to the database. This, coupled with libraries such as backbone.js, jquery and others, will bring to life very easy to deploy and start programs.

BTW, the name "tatu" means "armadillo" in portuguese! I hope you liked it.


October 2, 2010 -- Tcl for Android

If you use Android Scripting (SL4A) you will find here a complete interpreter for this environment. But, unfortunatelly you will have to install the zip files by hand, until they become available from the code.google.com site above. I have already written to the forum of the project, but while they don't make the package files available for automatic installation, I will keep them here. Enjoy!


September 27, 2010 -- Tcl 8.5.9 for Android

Tcl is easy to compile both for Linux or Windows. But... to cross-compile it to the Android platform (Arm processor), things are not the same. Well, I just bought a nice Motorola Milestone mobile phone and I became glad to see the linux kernel, specially under a shell application: processes, devices, modules, everthing was there. There is a nice project android scripting which features several interpreters controlling most features of the phone: python, ruby, javascript, lua, perl, and others interpreters are support. Except, of course, for my favorite! Then I discovered that in previous releases Tcl was there too, but the author disappeared. I asked then for help in several places, to no avail. Nobody seems interested in having Tcl working in the mobile platform of the future. So, here I am, after digressing so much!

The first step is to download full Android sources and build them. I choose the branch "eclair", because it matches what I have in my phone. Then build it. This is a time consuming process. Please, read carefully the instructions on the android source site. Then grab agcc, a perl script that will make the build process easier. I have put agcc in /root/bin (yes, I usually log as root, despite what the security experts say), and the android sources at ~/Android/mydroid. If necessary, change the script below. Here is my configure script:

export PATH=/root/Android/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin:$PATH
export CC=/root/bin/agcc
export GCC=$CC

export CROSS_COMPILE=arm-eabi
export ac_cv_func_strtod=yes
export tcl_cv_strtod_buggy=1

./configure --host=arm-eabi --target=arm-eabi --prefix=/root/Android/Tcl/tcl-build --disable-shared
There are a couple of edits in the Makefile generated to fix things up. Instead of giving all of them here, I have made available the full build, with the original tcl8.59 sources here.

After that, do "adb push tclsh /data" to copy tclsh to your phone (or emulator) and also push the full tcl library directory to /data/tcl8.5/library. If you put it somewhere else, set TCL_LIBRARY before calling tclsh, because it will not find init.tcl. In the next time, I'll prepare a wrapper for android scripting, so Tcl can be featured there again! Would you like to help me?


August 9, 2010 -- New bibliotheca release

I have been improving my books manager bibliotheca, as I have added many books to my online library (there are now more than 2,200 books!). I have added tools to manage the shelves (click the menubutton with the shelf name to open the dialog), a search facility, and some other improvements.

Here is the new package (right-click and save-as, because it has no extension, it is a starkit).


March 10, 2010 -- Visual Tcl bug fix

Finally I found a fix for a bug which persists since a long time ago in vtcl. If you include both a spinbox and a text widgets, and select one (spinbox) then the other (text), then a bgerror happens. The reason is because both have the option "-wrap" with incompatible choices. The fix for this (and possible others of the same kind) is to unset all array variables vTcl(w,opt,*), to eliminate the variable traces installed for option tracking. This version of Visual Tcl is reasonably usable by now! Enjoy! BTW, this vtcl is compatible with tcl 8.5. To install, just uncompress it somewhere, edit the "vtcl" startup script, and create a symbolic link from "vtcl" to your path, or just copy it there.

Here is the new package


March 10, 2010 -- More Visual Tcl patches

If you liked the previous patches I've made to Visual Tcl, you certainly will like this new release. Now it includes a command to copy both regular attributes and geometry options to other widgets. You should first select a widget, right-click and choose "Copy/Paste attributes" form the popup menu. Then you choose which attributes to copy from the two listboxes (use Control-click or Shift-click to multiple select), and click "ok". From now on, each clicked widget will have the attributes pasted, until you right-click again and choose the "Stop Paste attributes" menu item. Be careful not to place several widgets (with place manager) one above the other! Also, the geometry management paste only holds if the destination widget have the same geometry manager as the source widget. Unfortunatelly, there is not yet any way to undo the operations, so use carefully!

Here is the patched package


February 8, 2010 -- Visual Tcl patched

Visual Tcl is a nice GUI builder, but lacks a couple of useful features, for instance, a way to change the order of widgets. Well, no more, here is a patched package, with some other fixes as well. To reorder widgets inside a container (toplevel, frame, labelframe, etc), select any of the children widgets or its parent container, right-click and select "Tab order". The you may choose a widget with the arrow keys, or change its order up/down with the PgUp/PgDown (Prior/Next) keys. If a container is inside another, its order may be important too. Don't overlook it!


Older news

Github


Tumblr


Slideshare



Desarmamento


Obama


Desarmamento


tcl curso flyer


tiny-cobol


adventures


comments powered by Disqus

Last updated: 2013/08/29 15:03:32