THCB
on Mar 14, 2008 at 10:07
|
2 replies
|
by my_nihilist
|
This is the result of bidirectional challange, see my final comment there if you are interested in my decision. Thanks halfcountplus for the winning suggestion.
If you use vim on a dark background THCB will suit your mind.
THCB may be just a *nix thing for reasons described by ikegami below. It will still work if you don't provide a valid user name and want to try it "anonymously". Ctrl-c interrupts to give you a prompt so you can talk, but you obviously won't see anymore incoming messages while you wait at the prompt (don't worry, they will be waiting). nb. that removing the line breaks was intentional...
Type DONE at the prompt to quit. Ctrl-\ might work too.
Update: i added a unique on_background colorscheme for each "name:" until there are five names. After that uniqueness is obseleted.
Update #2: now uses Term::ReadLine::Gnu (altho it just sez Term::ReadLine, it won't work unless Term::ReadLine::Gnu is there). This permits slightly improved editing, like use of the <- and ->. ReadLine also adds a command history ("up" and "down"), but since this is not so useful in the CB i replaced it with the names of previous chatters in square brackets, for quick person-to-person style address. There is also a "chatclip" programmed into the first three F-keys. PLUS rather than fire off a greeting when you log in, your username now appears in THCB's "X" titlebar. PLUS you can now cancel a line by ending it with "*!*"
Really I would like to learn to do GUI web apps in perl, so this will hopefully develop and if anyone wants to help, eg. by pointing me in some direction, please go ahead.
|
A new face for Perlmonks
on Mar 12, 2008 at 07:30
|
4 replies
|
by holli
|
note: currently broken while refactoring.
I have started to develop a new user interface for Perlmonks based on the ExtJS Javascript library named ExtPM.
It is by no means finished, but under active development, so it might be broken when you you look at it.
|
Tk Virtual Keyboard Example
on Mar 06, 2008 at 13:01
|
0 replies
|
by zentara
|
|
I received a few requests on how to actually use Tk Virtual Keyboard. Here is a simple example. I encoded the key and password (but left the method in there for instructions), so just looking at the script, will not reveal anything.
Ideally, it would be nice to have the key and password on a usb key. Also, this is just a simple example, I believe it would be possible to run gpg thru IPC::Open3, and you could print the selected keys for the password to your gpg key directly into the gpg input pipe. So you would have your gpg private key on a usb stick, then use the virtual keyboard to enter the armoring password. So the test password for this is 'yadda yadda yadda yadda' ......without the single quotes.
|
"Rubics Cube" game - part 3
on Mar 04, 2008 at 11:05
|
0 replies
|
by tos
|
|
part 3 of 4.
sorry, sorry, sorry with cream upon ... :-)
|
"Rubics Cube" game - part 2
on Mar 04, 2008 at 10:29
|
0 replies
|
by tos
|
|
This source-part has to be concatenated after the first one first one
Sorry, but "on the fly" i don't see other quick possibilities
:-)
|
"Rubics Cube" game
on Mar 04, 2008 at 09:54
|
2 replies
|
by tos
|
|
Dear Monks,
my way to gui-programming was heavily influenced by perl/Tk. It ever impressed me and I like the examples that come with „widget“. So i always wanted to create my own (bigger) Tk-application.
Someway the idea occured to me to tinker the „Rubics Cube“ with the instruments that perl/Tk offers. After first experiences with a graphical rather rudimentary approach the second attempt was an actual 3d-application.
This for me ambitious project led me to a broad variety of problems. Solving these improved (as i think) my way of programming and my comprehension. Additionally i had to recall some mathematical basics from linear algebra. Briefly said, my tinkering didn't make me more stupid :-).
Meanwhile qb3 („kjuBeeThree“), as the application is called, has grown up to 5000 lines of code and the result relatively satisfies me. Unfortunaly i didn't reach one of my aims. Qb3 isn't able to solve given twisted cubes on its own.
My ambition concerning qb3 has faded in the last time. There are a lot of other perlish things which now stronger attract my attention than this.
Nevertheless i would like to see qb3 getting better and more capable. Therefore i'll give my „Unfinished“ to the PM-community, hoping that perhaps one or two are in the mood to work along on qb3. It also might be that there are quite interesting techniques to be seen in the code. Especially the own „3d-engine“ could be of interest.
Qb3 has a lot of bugs and surely there are many things that could be done better. But if seen pragmatically and not with an academic claim i would like to say that the result so far is quite cute. I mostly like to see it shuffle while it's rotated.
Qb3 runs „out of the box“ on unix and windows if Tk.pm is installed. Regard the shape of the mousepointer. If it changes its appereance it's worth to click (and move). Try all mousebuttons.
For editing the source use vim with tabstop=3 and :set fdm=marker.
$Id: qb3,v 0.68 2008/03/04 14:30:10 tos Exp tos $
# md5sum qb3
81b7f0a98394acd86d51132094c20835 *qb3
You have to concatenate the four sourceparts in order. Then you'll have gotten the whole.
Download the parts as qb3-1,2,3,4. Then make a
cat qb3-? >qb3
the result should have the above shown md5sum
Happy playing and regards,
tos
p.s.: as you surely already noticed this isn't my native language. So, please bear with me. Of course laughing is allowed. I can't hear it anyway. :-)
p.p.s.: there is a picture of qb3 on my homenode
|
PgUp Home
on Mar 01, 2008 at 11:23
|
2 replies
|
by halfcountplus
|
I have seen a few people wanting to use the F-keys, PgUp, End, (etc) in non-GUI apps. I once did too. Unfortunately this requires changing terminal modes with the poorly documented Term::ReadKey, but if you still want to go ahead, my short script will read the multicharacter KEYS and remember them with names you give them (eg, F7). These keys are identified by reducing the number of unique elements in 3,4, or 5 byte KEYS (remember, 1 character = 1 byte!) according to the chart at the beginning. You can hex these raw character values and use them in regex with \x.
So it can be done, but most people really won't want to ;)
IMPORTANT: if you don't exit cleanly (w/ ENTER) the terminal probably won't return to normal mode, and your command line will now be unresponsive...
Update: I noticed recently there is a "Curses" module for perl on CPAN which probably makes this a lot simpler -- ie. i'm wrong, Term::ReadKey is neither the only nor the best option. However, Term::ReadLine::Gnu recognizes these multi-character escape sequences in "bind_keyseq".
|
Regenerating grub.conf
on Feb 28, 2008 at 16:00
|
1 reply
|
by Tanktalus
|
|
Automatically modifying grub.conf when inserting a new kernel or removing an old one on linux can be difficult. Even just modifying it in vi can be annoying. So, after getting some advice from other Linux users, I settled on the idea of regenerating it.
When I add a new kernel, I always rename it to /boot/kernel-$version-gentoo$release (where $release =~ /-r\d+/ or it's blank) to make it easy to view. So, using that personal convention, combined with a bit of Template Toolkit, I get this script. I think all my personal conventions are at the top of the script, or in the template at the bottom.
Hope this helps other linux users out there that may be building their own kernels (and thus modifying grub.conf themselves).
|
FlickrDownload.pl
on Feb 20, 2008 at 11:02
|
1 reply
|
by jfroebe
|
|
If you've ever tried to back up your Flickr account or download the public Flickr photos of other users, then your options were pretty limited on Linux. After trying and failing to get FlickrDown to work under wine, I decided to write my own... in perl :)
The various Flickr API's on CPAN are incomplete with respect to obtaining the list of public/friends photos. I had to use XML::Parser::Lite::Tree::XPath to extract the photos from each Flickr page.
By default, we obtain the largest photo available (orginal -> large -> medium -> small), populate the EXIF comments field with the Flickr photo title, description and url. We verify the file type with File::MimeInfo::Magic and change/add the file extension as necessary.
During testing I received numerous duplicate files which were mostly resolved by adding a rudimentary duplicate file checker.
It should work on just about any platform that Perl does.
Thoughts?
|
pnt2bmp
on Feb 10, 2008 at 12:14
|
1 reply
|
by shotgunefx
|
|
Found some of my old drawings I did on my Tandy 1000 using Tandy Deskmate circa 1989, nothing existed to view them or convert them. I was able to figure out the format (for my version of Deskmate anyway), this will generate a BMP from the PNT file.
|
|