Archive of articles classified as' "web"

Back home

An end and a beginning

11/01/2010

What follows is the last post, dermatologist for now, case in Quantum Forest. It is also the first one in the ‘yet to be named’ (codename conuco) new place. I just need to get rid of all the ballast, rescue what I still like from here and then nuke the place.

Very few things last forever. Forever used to mean a hundred or a thousand years—even the universe had a beginning and will have an end; today it could mean three, five years. One of the reasons things last so long (or so little) is the need for self-consistency.

Consistency can be good when we are true to our best, but it can be a drag when we want to become better. I have to break now with over six years of ‘backward compatibility’, which means starting over. Elizabeth Bishop wrote:

The art of losing isn’t hard to master;
so many things seem filled with the intent
to be lost that their loss is no disaster.

The art of losing, the art of letting go, the art of dharma practice aren’t hard to understand, but one needs a life (or two) to master them. Starting over is the first step of the life to master.

Filed in miscellanea, web No Comments

Clusterf*k

1/06/2009

This email follows up earlier communication regarding the major ICT systems failure on Friday night [actually it was the first news I got], sale where the University’s primary data storage system had multiple simultaneous disk failures.

Note that while no staff email has been lost, staff files on the P: or K: drives have only been recovered from backups made early Friday morning. Files that were created new, or modified during Friday have been lost.

Just in case, if you emailed me on Thursday/Friday you better send me the email again.

Filed in web No Comments

Eight years is nothing

31/03/2009

The screenshot shows the ‘State of the Surname’ as of 2001. Eighty-five hits for Apiolaza, side effects most of them referring to my papers and emails to groups.

Google Search 2001
Google search for 2001.

Repeating today the search, we get a dramatically different answer§.

Filed in photos, web 1 Comment

Generating dynamic Google maps with Python

1/02/2009

As I have mentioned before, I have been putting together some dynamically generated maps for environmental information. A barebones version of my Python code to generate the KML file is:

#!/usr/bin/env python
# encoding: utf-8
 
import urllib, random
 
# Charting function
def lineChart(data, size = '250x100'):
    baseURL = 'http://chart.apis.google.com/chart?cht=lc&chs='
    baseData = '&chd=t:'
    newData = ','.join(data)
    baseData = baseData + newData
    URL = baseURL + size + baseData    
    return URL
 
# Reading test data: connecting to server and extracting lines
f = urllib.urlopen('http://gis.someserver.com/TestData.csv')
stations = f.readlines()
kmlBody = ('')
 
for s in stations:
    data = s.split(',')
    # Generate random data
    a = []
    for r in range(60):
        a.append(str(round(random.gauss(50,10), 1)))
 
    chart = lineChart(a)
 
    # data is csv as station name (0), long (1), lat (2), y (3)
    kml = (
        '<Placemark>\n'
        '<name>%s</name>\n'
        '<description>\n'
        '<![CDATA[\n'
        '<p>Value: %s</p>\n'
        '<p><img src="%s" width="250" height="100" /></p>\n'
        ']]>\n'
        '</description>\n'
        '<Point>\n'
        '<coordinates>%f,%f</coordinates>\n'
        '</Point>\n'
        '</Placemark>\n'
        ) %(data[0], data[3], chart, float(data[1]), float(data[2]))
 
    kmlBody = kmlBody + kml
 
# Bits and pieces of the KML file
contentType = ('Content-Type: application/vnd.google-earth.kml+xml\n')
 
kmlHeader = ('<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n'
             '<kml xmlns=\"http://earth.google.com/kml/2.1\">\n'
             '<Document>\n')
 
kmlFooter = ('</Document>\n'
             '</kml>\n')
 
 
print contentType
print kmlHeader
print kmlBody
print kmlFooter

Well, this is not exactly barebones, because we also wanted to generate dynamic graphs for each placemark, in the easiest possible way. My first idea was to use one of the multiple javascript libraries available in the net However, a quick search revealed that KML files do not support javascript in the description tag. That was the time when I remembered playing with Google Charts a while ago. The lineChart function above is simply a call to create a line chart using the charts API. Because this is a test, I used 60 randomly generated data points, which explains the presence of random as an imported library.

Originally, I did not want to use javascript at all, so inserted the code as a search in maps, generating a link like http://maps.google.co.nz/maps?q=http://gis.someserver.com/dynamicmap.py Just copy the address, send it to some one and, presto, they have access to my map. However, I wanted to embed it in a blog post§ and I was struggling to do it. The solution was to click on the ‘Link’ link in the generated map to copy the ‘Paste HTML to embed in website’ link. This gives an iframe block that can be copied in any page or blog post.

While helping a friend to create another map, we faced the problem that the data set was being updated every five minutes. What is the problem? The map was not being refreshed often enough. The I am not sure if the problem was a browser cache or Google Maps, but it could be solved by calling the KML file with a random extra argument (the script does not need take any arguments, so anything after the question mark is ignored). In my case I needed a frequent random argument, so I use the current time (using the date would work for once a day updates). This meant inserting the map using javascript (and using a Google Maps key). The code for a simple page–from the header onwards–would look like:

<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>A simple dynamic python generated map</title>
<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=my_key"
  type="text/javascript"></script>
<script type="text/javascript">
    //<![CDATA[
 
    function load() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
        map.setCenter(new GLatLng(-33.458943, -70.658569), 11);
        var pollution = new GGeoXml("http://gis.uncronopio.org/testmapscsv.py?"+
                        (new Date()).getTime());
        map.addOverlay(pollution);
      }
    }
    //]]>
</script>
</head>
<body onload="load()" onunload="GUnload()">
<div id="map" style="width:750px;height:600px"></div>
</body>

It was not too bad for mucking around on Friday in between doing house chores.

Filed in geocoded, programming, web No Comments

A quick change

2/01/2009

On leave. Gone to the beach. Or Camping. Thinking a lot. Too much. Back to basics. Gone to the beach. Or camping.

In other news, sick changed blog theme from plaintxtBlog to Emptyness. I also streamlined the theme for uncronopio’s main site.

Gone to the beach. Or camping.

Filed in miscellanea, web No Comments

Short text, long text

14/08/2008

I recently started reading Haruki Murakami’s Blind Willow, treat Sleeping Woman collection of short stories(*). I often skip prefaces and introductions but, approved for an unknown reason, I began skimming the pages and read:

Since the beginning of my career as a fiction writer in 1979 I have fairly consistently alternated between writing novels and short stories. My pattern has been this: once I finish a novel, I find I want to write some short stories; once a group of stories is done, then I feel like focusing on a novel. I never write any short stories while I’m writing a novel, and never write a novel while I’m working on short stories. The two types of writing may very well engage different parts of the brain, and it takes some time to get off one track and switch to the other.

In my case it is the same with other types of writing (no comparison with Murakami intended): scientific papers are my novels and blog posts are my short stories. I have spent the last month working(**) in three papers, which involves a large amount of time thinking, tinkering and putting the words together.

During this time I have not posted one item in Quantum Forest. I did post seven short items in Spanish (in Tren de Carga), but nothing that required much thinking, really, I know that. However, it was good from the microblogging point of view: dozens of updates in Twitter and Amarillo. Microblogging is almost automatic.

There are some times for updating the ‘public face’ (this site) but there are others when much more interesting things take precedence.

(*)Incidentally, last year I did enjoy Murakami’s The wind-up bird chronicle. You may find many people commenting on the many loose ends left in the novel. There are many, but are not a deal breaker.

(**)When I say working, this covers not only writing, but putting together datasets and doing statistical analyses.

Filed in web, writing No Comments

Writing cycles

16/05/2008

Although the RSS feed of this site shows few changes during the current month, neurosurgeon it does not mean that I have not been writing on the web. It is only that I have not been writing under the Quantum Forest ‘brand’.

I have to acknowledge that I have been pleasantly surprised by microblogging as incarnated in Twitter (my stream). Medium restrictions (post length, diet minimum formating) contribute to make life easier and posting enjoyable. As with any medium, erectile it can produce excellent content or an inane succession of vapid posts; I am trying to avoid the latter, while posting relatively frequently.

Another site that has been receiving my attention is Tren de Carga (or check here if you want to see only my contributions). It is strange how the brain works, but sometimes I have the overwhelming urge to write in Spanish (which goes to Tren de Carga), while others is all about English. Unfortunately, there is little control about when is a language dominating my writing needs. It reminds me of this game called Boggle, where one has limited time to find words with dice. If I am playing in English all I can see are words in Spanish and vice versa. This is not a winning characteristic, at least when playing Boggle.

Filed in web, writing No Comments

Updating ephemera

8/05/2008

Ephemera plural noun: a- things that exist or are used or enjoyed for only a short time. b- items of collectible memorabilia, pharm typically written or printed ones, that were originally expected to have only short-term usefulness or popularity: e.g. Mickey Mouse ephemera.

Alternative definition: Pieces of text that will become irrelevant in a short while and/or do not deserve a full-length page.

Sometimes I have the occasional sound bite or flotsam and jetsam that — although I want to make public — do not warrant writing a full post. I used to deal with this through my Ephemeral wiki page, but it still was a bit of a hassle, and after a while was not being updated. I finally gave up and joined the Twitter crowd, not because I am interested in following other people, but due to the ability to easily update my blog with ephemera.

Thus, I can now either write a quick post either using TwitPod* (a mac twitter client) or via a text message from my mobile phone. The message is then published via WPTwitter (a Wordpress plugin) and painlessly put on the sidebar of my blog, under a ‘Twitter flotsam’ header.

* It may not be the best Twitter client, but did I mention that I use it only for posting and that I do not follow other users? Yes, I did.

Filed in software, web No Comments

Things have to look like

6/05/2008

I think that I have written before about this. Why do virtual things have to look like something — often a supposedly familiar object — else? I was stuck on this again through two almost unconnected but with almost the same look interfaces:

They both happen to look like the front page of a newspaper. Of course they are not the only sites that look like a newspaper, but I just happened to come across them and not any other piece of virtual junk.

The idea behind Times is simple: you (me) are used to read news in a newspaper. RSS items are ’sort of news’ and they look nice when organised as a newspaper. Then, they should be presented as such. The morning news screams ‘I am kind of a newspaper so I should look like one’. Period.

But should they? Papers are big, spread when there was plenty of space available to open the bloody things completely. But now we fold them, we read ‘text’ (either plain or highly decorated) and try to extract maximum information from ever increasing noise. Is something that looks like a several centuries old piece of paper a good interface to summarise too many pieces of flotsam? May be updates, news, email should just float to the top according to our reading habits or topic popularity (some times inverting to extremely unpopular topics).

Does an arbitrary spatial configuration provides any additional information? Doubtful, but it some times looks pretty.

Filed in software, web No Comments

The surprise of the quotidian

8/03/2008

I do not like much writing with a white background (my eyes hurt). Therefore I have changed the default colours for TexShop’s editor using the following commands in a Terminal window:


# These lines change background colour (in RGB proportions)
defaults write TeXShop background_R .1
defaults write TeXShop background_G .1
defaults write TeXShop background_B .1
# These lines change the font colour for comments
defaults write TeXShop commentred .99
defaults write TeXShop commentgreen .96
defaults write TeXShop commentblue .90

It is also possible to change transparency of the editor window with something like defaults write TeXShop SourceWindowAlpha 0.85.
I have been working a lot on statistical analyses this week, seek
looking at issues of data relatedness, phlebologist
connectedness between sites and overall data quality measurements. A quote to remember:

Without assumptions there can be no conclusions — John Tukey

It is amazing how quickly we get used to things and lose the capability of surprise. In Future Perfect Jan Chipchase reminds me every time that the world is a surprising place, viagra here
where not only what we do but the way of doing things is important, full of meaning and diverse. A sign, a phone, a price label, a small container or a small idea: all of them can be surprising if we pay enough attention. Thanks.

Filed in web No Comments