Search Results: "sto"

6 February 2007

David Welton: Popouts with Rails

In a previous article about Stuff To Do, my ajaxified priority queue program, I talked about how best to keep track of the user's state of activity, should they so desire. I opted for the popup, as that was the best compromise between simplicity, and ease of use for the end user. From an end-user point of view, it's similar to how gtalk can detach from gmail if you want to run it in its own window. The trick was to implement the popup/popout in Rails, which actually ended up being pretty easy, and, all things considered, is a pretty cool technique. It's neat to pop stuff in and out of a web page. The easy part is popping out the window:
<%= link_to_remote("Pop out " + image_tag('popout', :border => 0),
                    :url =>   :controller => 'tasks', :action => 'popout'    ,
                   :title => 'Pop the status window into a popup window') -%>
Which subsequently calls popup.rjs:
page.replace_html('status', "<i><small>status in popup window</small></i></br>" +
                  link_to_remote("<small>Restore</small>",
                                  :url =>   :controller => 'tasks', :action => 'popin'  ,
                                 :title => 'Restore the status window'))
page << 'statuspopup();'
Which is pretty simple - the first call replaces the html in the status div, and the second calls the javascript function statuspopup. This lets us replace what was in the status window with some placeholder text and a 'restore' link in case things get screwy and the user wants to simply restore the old content of the div in question. It's worth noting that we also store the popped out status in session[:popped_out] in order to let the application know that the window is "popped out". This doesn't actually pop the window itself up. The statuspopup function in javascript (located in application.js) takes care of that:
function statuspopup()  
  window.newwindow = window.open('/tasks/openstatus','status',
                                 'height=10,width=210,status=no');
  return false;
 
And then the openstatus action opens the same rails partial that the regular page does:
<%= render(:partial => '/tasks/status', ...
Meaning that you don't have to rewrite the same code in two places. So, that's all it takes to pop up a new window, and replace the contents of the old div in the html page giving the user the sense of having popped a piece of the page out into a popup. So far so good. Now what happens when the user closes the popup? Luckily, we get a reference to the window that opened the popup called window.opener that we can use to comunicate with the main window. For instance, in our case we set up an event listener to fire when the window closes:
window.addEventListener("unload", statusClosed, false);
And this, in turn, takes care of popping the window back into the main page:
function statusClosed()  
new Ajax.Request('/tasks/popin',   method: 'get', asynchronous: false  )
$('popoutlink').style.display = 'inline';
w = window.opener;
target = w.window.document.getElementById('status');
code = $('onidle').childNodes[1].innerHTML;
target.innerHTML = $('status').innerHTML;
target.style['backgroundColor'] = '#bbddbb';
target.style['backgroundColor'] = '#bbddbb';
w.eval(code);
 
Once again, pretty simple. What's happening: We also fix up the color just a bit, to mark the user as active. All in all, it's pretty useful for time tracking. In Linux, it's ver easy to set the new popup to follow you around the screen, making it so that it's not a bother at all to wave the mouse at it to let the application know you're online. All you do is set the 'on top' and 'always on visible workspace' options - at least in Gnome.

Alexander Schmehl: The never ending story...

It seems some of my fellow students have found my blog. Wow, took you only four month to do so. I'm impressed ;) Beside the fact, that I mostly blog in English (most of my posts appear on planet.debian.org) the thing which interested them most was a recent rant blog. Most found it quite funny and some warned me, that it might be a bad idea to continue posting blogs like that... just in case someone tells the lecturer1. Many thanks for the warning! Indeed, many thanks! But why should I be afraid of someone, who needs three attempts to count without error in binary from 0 to 111? 1: I would really like to point out, that he is not a regular professor at our university. It's just that some people thought it would be a good idea to let him teach that course because of his experience as administrator.

Ross Burton: Xrandr 1.2

Since I got my 20" widescreen monitor in the summer, I discovered how bad X's support for resizing displays is. I wanted to have the ability to plug my laptop into the 20" display in the office and expand the desktop to 1680x1050, or remove the 20" display and shrink the desktop back down to the native resolution of 1024x768. It turns out that a number of factors were stopping this, and the only way to do it would have been to restart X. Because of this I ended up using the display at 1024x768 when I did use it, but mostly I stayed on the sofa. Then I heard about xrandr 1.2, the all-singing all-dancing revision of the X Resize and Rotate extension. Basically, it would solve my problem, and as luck would have it my laptop has an Intel chipset and the people hacking on it work at Intel. Yesterday after lots of poking I finally made it all work for this. This involved a lot of poking and a little black magic. The first step is getting an X server new enough. First, you'll need to update some X protocol headers. We'll start with the easy ones that have had releases (grab the latest release you can find): Then you'll need to update various other bits of X: Once this is done and X still works, it's time to brave the perilous world of git. If you've never used git before, it's quite simple for this. Go to the git browser and find the module you want to check out. Click on it, and you'll see two URLs: you want the anongit one. Do git clone [url], and then if I've specified a branch other than master, cd into the directory and do git checkout [branch]. For example:
git clone git://anongit.freedesktop.org/git/xorg/driver/xf86-video-intel
cd xf86-video-intel
git checkout modesetting
You'll need to grab: Build it all in that order. The order is important as if you build the Intel driver against randr 1.0 instead of 1.2, it won't do what you want. By now you should have an X that looks no different. But...
$ xrandr
Screen 0: minimum 320 x 240, current 1024 x 768, maximum 1680 x 1050
VGA disconnected 0mm x 0mm
LVDS connected 1024x768+0+0 246mm x 185mm
   1024x768       50.0 +   60.0*    40.0  
   800x600        60.3  
   640x480        60.0     59.9  
TV disconnected 0mm x 0mm
Now that is clever. Here you can see that I don't have anything connected via VGA, my LVDS (no idea what this stands for, but it means the laptop's panel) has a preferred mode of 1024x768 (thats what the * means), and I have nothing connected to the TV output (because Lenovo didn't wire it up). Now if I plug something into the VGA and run xrandr -s 0 (select default screen size), the external display should power on. Xrandr doesn't try to be too clever, it will leave that to desktop daemons, but by default it will try and make something appear on all of the connected displays. In this case, my 20" TFT gets a clone of my laptop panel, at 1024x768. That is no good though, I want to turn off the laptop panel (as I'll be shutting the laptop) and switch the external display to 1680x1050. This is where the black magic starts... Currently the Intel driver cannot resize the physical framebuffer in memory after X has started, so it defaults to a framebuffer of 1200x1024 (IIRC). That isn't big enough to hold 1680x1050. Also the Intel driver doesn't detect any modes from the TFT. This may be Dell being stupid, or the EDID parser in the driver being too restrictive, I don't know. Luckily we can still use modelines in xorg.conf so I added this:
Section "Monitor"
        Identifier "Dell TFT"
        # This is a standard modeline for 1680x1050 at 60Hz
        Modeline "1680x1050" 149.00  1680 1760 1944 2280  1050 1050 1052 1089
EndSection
        
Section "Screen"
        Identifier      "Screen"
        Device          "Intel"
        Monitor         "Monitor"
        # This says that when using a monitor on the output called VGA, use the
        # settings in the monitor "Dell TFT"
        Option "monitor-VGA" "Dell TFT"
        DefaultDepth    24
        SubSection "Display"
                Depth 24
                # This tells the screen to allocate a frame buffer up to
                # 1680x1050.
                Virtual 1680 1050
        EndSubSection
EndSection
With this, everything just works. If I xrandr with various displays plugged in I can see what they support and can switch modes. To make everything nice and easy I wrote a small script that I bound to an unused function key:
if xrandr -q   grep -q  "VGA connected"; then
  xrandr --output LVDS --off --output VGA --mode 1680x1050
else
  xrandr --output VGA --off --output LVDS --mode 1024x768
fi
(thanks to Eric for pointing out that I don't need to use the hex values). Simple! As you can see the new xrandr is very powerful. If you want to do Xinerama-style dual screen you can do that too: xrandr 1.2 encompasses that behaviour. The final thing to point out is how glad I am that GNOME seems to handle the screen resizing like this so nicely already. When the desktop shrinks Metacity moves windows so they are visible, and when the desktop expands the panel applets on the right stay on the right instead of sitting in the middle. The script I run when I change screens does more than I pasted here: it changes the wallpaper to match the aspect ratio, and also changes the fonts. I hope this has made sense, I know there are a few people out there who were waiting for me to test this before they gave it a go. If anything is too vague, leave a comment and I'll expand it. I should also mention that I've got Ubuntu Edgy packages for everything here in my repository. NP: Animal Magic, Bonobo

Rodrigo Gallardo: Failed training session

I went to the bookstore yesterday, hoping to advance in my Honya Budo training. I actually expected to reach “The feeling of the touch”. I succesfully dodged the powerful alure of a book of photographs by Juan Rulfo, a collection of maps showing the advance of european knowdledge of asian cartography from atiquity, and a collection of MC Escher engravings. Alas, the power of a cheap (MXN30) edition of Pirandello’s Six characters in search of an author proved too much for me. Back to square one, I go.

Lars Wirzenius: Personal life: Monkey see, monkey not do

I realized something about myself today: I have a relatively strong resistance to learning by imitating what other people do. The precise moment for this was when I was putting on a scarf for the first time this winter. I tend to dislike having things around my neck. Every winter I go through several iterations figuring out the most comfortable yet protective way of wearing it. Today I started tying it in a new way, which I'd seen Lynoure use. Half-way through I stopped, telling myself that I can't do it this way, because I didn't invent it myself. Only after I'd already undone the scarf did I realize how stupid this reaction was. I need to watch out for this. If I was an aspiring A list blogger, I'd now make a top ten list of annoying personal learning anti-habits.

5 February 2007

Mike Hommey: Google Keywords

I’ve done this exercise a long time ago, but I think last time was before the first post with Wordpress. So here it is: my improbable (or not) best of search engines keywords for january (provided by webalizer). “ ” - !
“debian fundamentalism” - where ?
“asa dotzler troll” - did Blake Ross post here ?
“could have agree with you anymore” - all your opinion are belong to you
“do i need firefox if i have iceweasel” - firewhat ?
“your name in firefox 2″ - I know
“lifelike androids” - paranoid ones are better
“dumb ass” - still ?
“blitzer blog” - wrong address
“a lot of horse facts” - i don’t know what to say
“damage harddisk instantly” - drop your laptop from the 10th floor
“iceape vs iceweasel” - none of the above
“do you like the american accent” - no
“facts about the horse” - what is it with the horse ?
“feliz a o nuevo happy new year ” - Bonne ann e !
“free mozilla firefox” - as in beer ?
“icebrowser community edition” - nice one
“normal life” - what is it ?
“shake laptop crash hard drive” - shake it the other way
“trademark versus copyright”, “trademark vs copyright”, “trademark vs copyright vs gpl”, “trademark vs reserved”, “trademarked and copyrighted logo”, “registered trade mark vs copyright” - ask mozilla, they are knowledgeable
“what should stop working” - you
“what is a patent” - something I hate (I’ll tell you stories about that soonish)
“why does debian call firefox iceweasel”, “why does debian name firefox iceweasel”, “why iceweasel debian instead firefox” - because we can’t call/name it firefox
“will flashplayer work with iceweasel” - why not ?

Gustavo Franco: Debian Custom Search - The Cabal

Update (05/1): The cabal now emphasize Debian related websites (even the most obscure ones) but also return results to any other topic. I'm sure it's better than Google vanilla for Debian contributors, developers and dedicated users. Give it a try. ;-)

Update (02/1): OpenSearch support has been added. In other words if you're using Firefox or IE7+ (ouch!) add The Cabal in your browser now.Go to The Cabal page and click on your search engines box on top right, you will see "Add The Cabal" on the list.

I've just added a Debian related custom search engine to my people.d.o page. Actually it works using Google Custom Search Engine, but i plan to add Yahoo Search Engine Builder to the mix. The search engine is called "The Cabal".

What it is:
What it isn't:
What is coming?
Search examples:
Suggestions and feedback about how you are using the search are welcome.

MJ Ray: TTLLP Telephones

And the award for worst-addressed post yet goes to COLT Telecommunications for:
"TTLLP
Qewstoke (should be Kewstoke)
Summerset (should be Somerset)"
The dangers of using foreign call centres for data collection, I guess. At least they got the name, street and postcode correct, so it arrived. The post itself was pretty interesting. It said that 0870 numbers will stop being revenue-shared from February 2008, which seems to be confirmed by this Ofcom press release from April 2006 which I hadn't noticed. TTLLP trades its revenue-share for hunt, voicemail, fax termination and so on, so I wonder what will happen to that service after Feb 2008? We recently signed up for numbers where we get outbound SIP to PSTN calls too. I was undecided about which number to use in future, but I guess this means TTLLP will switch to 0844 or 01934. There's a bit of flaming going on at Say Not to 0870 which reminded me to update our entry there. The COLT mailshot came with a calendar to try to persuade you to move your 0870 numbers to them and you can order your own calendar on their site - pictures are holding hands, walking under an umbrella, Brussels Grand-Place (I think), tulips, rowers maybe on Lake Ontario, a diver, a boardwalk, dandelion seeds, walking through fallen leaves, the Millenium Wheel with fireworks, illuminated pine tree, starting an avalaunche and London commuters. Can anyone spot a theme there? I don't.

Martin F. Krafft: Cleaning HTML attachments from emails

Dear Lazyweb: do you know of a tool that can scrub text/html attachments from email, which have the message also in a text/plain attachment? I know storage is cheap these days, but with large mail volumes, there is a noticeable difference between storing 2k emails and 8k of redundancy. Previously, I would send auto-replies to get people to reconfigure their mailers, but that's not a battle I'll ever win, and there is no safe way to send auto-replies without annoying the living hell out of some people at some point. So I stopped and now want to switch to a local solution. I am sure the Anomy Sanitizer, or tools like MIMEDefang could be coerced into doing this, but they come with a lot of cruft that I do not need or want. Rather, I am looking for a lean and mean Unix-style pipe filter that will strip text/html parts if it has enough reason to believe that sibling text/plain parts carry the same information. It has to be capable of dealing with Unicode, or at least be 8bit-clean. And it has to work. Any comments appreciated! NP: Negua / A Way Out

Martin F. Krafft: Install full Vista from upgrade version

This is just hilarious and representative of a company that seems to have no idea about security or the ways of the hackers (from Monsters and Cirtics.com): With a DVD-based Windows Vista upgrade, you can install the complete version, even if you've never owned (or installed) Windows before. Simply don't enter the product key after booting from the DVD and install a 30-day trial. Then reboot with the DVD a second time, and now enter the product key. It will upgrade the trial to a full version. I am definitely not advocating anyone to do this because there are plenty of reasons to avoid Windows Vista; I just post this for the giggles. Microsoft, you are morons. Get a grip. You can't beat the "bad" guys at security. Noone can. And when it's about licencing costs, the only lucrative way seems to find real business models based on a non-volatile basis and with a more sustainable edge to them. NP: Green Carnation / Light of Day, Day of Darkness Update: In the light of the above story, this interview makes me laugh for the sheer amount of hot air. And then there is this this gem, an email from Jim Allchin to Billie Boy and his mate Stevie with fabulous statements, like "... our teams lost sight of what bug-free means, ... what security means..." (as if they ever knew...), or "I would buy a Mac today if I was not working at Microsoft." That was 2004. Three years later it is as if this email had never been written.

Alexander Schmehl: Ups

It seems that I managed to send out bounces for some mails waiting for me in my TODO folder... don't know how I did that. All those messages where delivered succesfully (and most of them quite some time ago) and where stored in a local Maildir-folder. I don't know what went wrong... well... I was playing with mbsync, but I was still in the read the fine manual state... so I still don't know what was going on. So: Sorry for the noise; as soon as I find out what happend, I try to not do it again ;)

3 February 2007

David Welton: In Thrall to Scarcity

As I've talked about in this space in the past, I've been coming to some conclusions about free software (open source, or whatever you want to call it): the economics of it, like anything else, are rooted in scarcity, and if you don't have a bit of that scarcity yourself, you have a lot less leverage This line of thought comes from the age-old question "how to create free software and make money at it?". This is a very important question for me, because I enjoy hacking on free software very much, and would love nothing more than to spend my days doing so. Creating new things, though, rather than working as a "system integrator" and tying pieces together with the smallest amount of glue possible. It's obvious that there is plenty of money to be had for people who simply use free software for their own ends. But what are those ends? We live in a world of scarcity - not everyone can have a fancy car, the nicest house in town, or the fastest computer. Market economies work via the exchange of scarce goods and services. If you have nothing to trade, you have nothing. Now, free software is worth something. Worth a great deal - that is beyond the shadow of a doubt. But since anyone can make a copy, there is no scarcity - once it's out there, you can't trade for it. So... where does this leave our potential free software creator? Let's think about some of the ways around this problem. I've alluded to it in the past, but consulting operations have several problems, especially when considered from the point of view of someone who wishes to create software: So, there you have it. In one way or the other, to make money at something in the long run, you are going to have to find and sell a product that people cannot effortlessly get for free.

Evan Prodromou: 14 Pluvi se CCXV

I was interested to see the announcement on Flickr of a new syntax called machine tags (via a story on machine tags from Programmable Web). Machine tags are a way to provide structured information within a tagging structure. It takes the traditional tagging format (just words) and adds a little structure of the form "namespace:property=value". I like machine tags; they map cleanly into RDF. I'll be interested to see how the rel=tag microformat will grow or adapt to this new structure. My guess is that there will be some resistance. tags:

Robert Collins: 3 Feb 2007

Speeding up bzr info on the hpss with a good sized branch - samba 4.0 (which is > 200MB of bzr repository).
bzr info bzr+ssh://host/home/robertc/SAMBA_4_0
Location:
  branch root: bzr+ssh://host/home/robertc/SAMBA_4_0/
 Related branches:
  parent branch:
http://people.samba.org/bzr/jelmer/mirror/samba/branches/SAMBA_4_0/
 Format:
       control: bzr remote bzrdir
        branch: Remote BZR Branch
    repository: bzr remote repository
 Branch history:
     11316 revisions
      1035 days old
   first revision: Sun 2004-04-04 08:56:30 +0000
  latest revision: Wed 2007-01-24 12:23:42 +0000
 Revision store:
     11316 revisions
    111019 KiB
Before our latest optimisations:
real    14m21.769s
user    1m23.377s
sys     0m11.017s
After:
real    0m11.203s
user    0m0.632s
sys     0m0.104s
I say 'whoot' to the sprinters!

Christian Perrier: Dinosaurs speak to candidates

During the Solutions Linux 2007 event, the .Org pavillion had the (good) surprise to get the visit by M. Fran ois Bayrou, one of the candidates running for the French presidential election (mostly located in the center of our political scenery, between the ultra-liberal Nicolas Sarkozy and the socialist S gol ne Royal. He's given about 12% of votes for the first round by polls). As far as I know, he is the only candidate who visited SL2007. He even visited the .Org pavillion and had a breif talk, on the Ruby France booth, with my old friend Ollivier Robert (longtime FreeBSD activist and committer, security expert and author of calife, a light alternative to sudo). Another old friend, namely Thomas Parmelan is visible at the back of this picture. As far as I have heard, M. Bayrou unfortunately didn't stop at the Debian booth. I suppose that M. Bayrou visited the APRIL booth who launched the candidats.fr initiative, requesting the candidates running for the presidential election to publish their stance about Free Software and Digital Liberties.

Joey Hess: Joey Learns to Fly

flying.png My father and Ed Counts made this short film, and Mark has rescued it from videotape so I can put it on the web. (If Ed Counts doesn't want this on the web, I'll have to take it down.) Watching it closely, I've found many more scenes from my childhood than I remembered. Of course there's the trail up to the cleared spot, and that trestle down near Natural Tunnel, but I also found the house I grew up in, a view from the hill above the house, our barn, and even Ownee and Silas's house. I remember running and jumping down the hill as Ed Counts made sketches and studies for the film. The closest I've ever come to a lucid dream is one where I can jump up, tense the right part of my mind, and not come back down. Thanks, Dad..

2 February 2007

David Welton: I Spy

Well, not really, but some people might think so, or feel intruded on... To back up a bit, and put that in context, I'm currently contemplating ways of making Stuff To Do, my web based todo list/time tracker/work organizer more able to track when a user is active. Currently, it marks you as active if you do anything at all in its web page. The reason I adopted this approach is that I want the program to help the user out, not make the user a slave to the program (ok, switching tasks, hit start..stop...stop stop start stop start start...bleagh!). However, even this approach relies on the user keeping the window open, and visiting it every now and then, which is less likely if you get 'in the zone' and are concentrating on your own work. A couple of methods for dealing with this come to mind: Thoughts? Would you use any of these, or consider any or all of them too high a price to pay to keep track of your hours?

Meike Reichle: First day in Luxembourg

Julien Blache: mactel-drivers: using pommed with a stock Debian kernel

I have made a nice Debian package out of the mactel-linux patches for the appleir and applesmc drivers, so that Debian users can use pommed with a stock Debian kernel. I’ll maintain the package until the stock Debian kernel includes both drivers. Grab it here:
http://people.debian.org/~jblache/pkg/mactel-drivers/

Robert Collins: 2 Feb 2007

So we've been sprinting here in Amsterdam all week. So far we've:

Next.

Previous.