Posts

Showing posts from December, 2004

lab 24 - google api

NAME lab 24 - call google api from inferno DESCRIPTION I looked around to see what was available. Inferno has no WSDL or SOAP support, and limited xml. However, most of the SOAP messages are boiler plate, so we just need a program to handle the http. The program svc/webget/webget is something I hadn't noticed before. It serves a file /chan/webget which we can write GET and POST messages to and read back the result. With this in mind I tried writing shell scripts to read and write the SOAP messages to the google api url. I needed to debug webget a little because the POST didn't work. The changed files are attached below. The google api download came with sample SOAP messages. I inserted my key (removed from the attached files), and placed the string PHRASE where the search phrase was to appear. The shell script runs sed on the file replacing PHRASE with the actual search p

lab 23 - tickfs

NAME lab 23 - annotating a file system DESCRIPTION i have tried out some experiments with annotating the filesystem; really, several iterations of the same idea. my latest attempt is tickfs , which i think comes close to doug mcilroy's idea of a metadata file system. each file served by tickfs is a binary relation, the key is usually an absolute pathname, and the attribute is defined by the name of the relation. each relation is also bi-temporal. it's a historical record of changes to each key, value pair and it determines whether a key, value pair is true at a given time. adding metadata is simple, % echo ${quote i . /doc/sh.ms 'the inferno shell' } > /n/tickfs/desc % echo ${quote i . /doc/sh.ms 'rogger peppe' } > /n/tickfs/author the dot indicates the current time, but any time represented as seconds since the epoch can be given. q

lab 22 - news aggregator

NAME lab 22 - news aggregator DESCRIPTION Rssget downloads an RSS xml file indexes it into tickfs . Then using tickquery , which should be copied into /dis/svc/httpd you can query the RSS aggregator using address http://localhost/magic/tickquery. % mkdir rss % cd rss % mount -c {tickfs} /n/rss % touch /n/rss/index /n/rss/desc /n/rss/chan /n/rss/title % svc/httpd/httpd& use localcron to call rssget periodically on your favourite news feeds. tickquery looks if the first keyword begins with 'date:' the rest of the word is treated as a rng(1) and restricts the results to within the date range. For example, to search for RSS entries since 1st of the current month mentioning google, date:1, google or show me all entries collected on the 21st of the current month date:21 Here is a demo of this service. more interesting examples I have yet to work out. it gets more

lab 21 - popi

NAME lab 21 - popi DESCRIPTION Ported popi from the book Beyond Photography - The Digital Darkroom which is online and many of the examples from the book should work. I took the C code, translated it to limbo, then tried to add the trig functions and polar coordinates. I referenced Rich Burridge's version of popi to get ideas while adding the extra features. See the guide file here for many of the examples from chapter 3 The combination of the program and the online text makes a good example of an active essay. While reading the text the user can type in the formulas and edit them to explore further into the tool and it's possibilites. It enhances reading of the text and understanding of the tool. CONCLUSION This took longer to debug than I expected and I still have doubts about parts of it. The polar coordinates when used as a target do not work, rounding erro

lab 20 - libmux

NAME lab 20 - libmux in limbo DESCRIPTION To learn about mux in detail I tried to implement libmux in limbo. It actually resembles the mux from libventi more than libmux. They are pretty similar. I was going to do a detailed description of the mux in devmnt but it turns out this has already been done here by nemo. When I get this working it can be applied to the venti lib for session rpc, to build a libfs for direct client 9p interaction, bypassing devmnt, and for application protocol muxing, say for sam. This is a partial implementation. I didn't complete send , recv , gettag and settag functions, so this has not been tested. I'm just posting it here now so I don't lose track of it. I'll come back to it later, maybe writing more for the Venti library or libfs. This is more an excercise to understand the workings of libmux and venti's session rpc. FILES

lab 19 - wm

NAME lab 19 - understanding wmclient DESCRIPTION In trying to understand wm (1) and its supporting libraries wmclient (2), tkclient (2), and titlebar, I modified them to resemble (if you squint) rio. I haven't adopted rio's menus or button controls. Here's a screenshot . I began with a copy of wmclient. I wanted to peel away the layers between the application and wm. I removed the dependency on titlebar and created a border that would manage the window. I removed whatever else I thought was unneccessary. I ended up with myclient which talks directly to wm. Window management is based on button clicks on the border. Button 1 moves , button 2 reshapes, and button 3 deletes the window. I liked the window management so I wanted to use that for all windows. To copy the border changes back to wmclient.b was easy. But most windows programs in inferno use the tkclient. F

lab 18 - mux

NAME lab 18 - mux DESCRIPTION Much of my recent reading has led me back to various implementations of a multiplexer. This is an important and powerful abstraction and I want to understand it better. I know very little about it now. I'd like to implement one in limbo, for example to multiplex the link between sam and samterm as suggested in the protium paper. Hence my interest in sam in the earlier lab. Here is a some of the things I've been reading recently about multiplexers. See if you see a pattern. J. Hickey's Master thesis at MIT implements mux for plan9 which puts a 9p multiplexer into user space and provides asynchonous IO for user threads. Search 9fans for multiplexing where there is some interesting discussion on the use of multiplexers in plan9. For example, an idea by rog and russ's response And futher proposals by russ