Eplelogg 2011

Masse epler i år.I tillegg til juicepressing har årets epleprosjekt vært å bake seg gjennom alle eplekakene i “Den store Epleboka”

Juice;
1. oktober:
Plukket inn ca 40 kg James Grieve nedfallsfrukt, presset 12 kg, 5.5 liter juice i første omgang fikk ut ca en liter til etterpå.
2. oktober
Plukket inn ca 30 kg James Grieve til, presset 24kg til 14 liter
3. oktober
Presset 12kg epler til 7 liter juice
4. oktober
Presset 24 kg epler til 13liter juice

18. oktober:
Plukket inn en god del epler, ca 40 kg, mye lagret
Presset 24 kg til 11 liter juice

28. oktober

12 kg til 6 liter- mulig at noe av det som har blitt tatt inn for lagring blir presset.

Totalt så langt: 57 liter

Posted in epler, Mat | Comments Off on Eplelogg 2011

Value from radiobuttons – a prototype.js way

Radiobuttons are occasionally useful, but they really seems to be made for being read out through the good old form submit. But if you want to read the value from java script?

With prototype.js linked in, it can be done this way:

function radiovalue(form,radioset){
	var rb=$(form)[radioset];
	var value;
	$A(rb).each(function(r){
		if(r.checked){
			value=r.value;
		}
	});
	return(value);
}

The form must have an id and the function is called with the id of the form and the name of the radiogroup, ie with the html

<form id="radioform">
<input type="radio" name="specttype" value="Sum" />Sum specter
<input type="radio" name="specttype" value="Det.1" />Detector 1
<input type="radio" name="specttype" value="Det.2" />Detector 2
</form>

the javascript

radiovalue('radioform','specttype') 

will return the value of the selected radiobutton.

Posted in Data, Diverse, javascript | Comments Off on Value from radiobuttons – a prototype.js way

mapserver removed on debian

Edit: By now (october 2011) the dependencies are fixed and mapserver can again be installed through a normal apt-get install cgi-mapserver and it will survive upgrades.

During a dist-upgrade on my wheezy/sid debian system, cgi-mapserver turned out to be removed. That was by no means intende by me… The culprit turned out to be the upgrade from libdap10 to libdap11. I have not found out what this library is intended to to, but searching around a bit, it seems like libdap11 should be downward compatible with libdap10. I.e. the mapserver package should have been updated to be able to live with libdap11, but I have no time now to wait for a new version. I am not running mapserver on a production machine, but I use it for some testing, so far it has worked fine for me. If you have the same problems, follow this description on your own risk, don’t do this if you do not understand the risks!

All the following must be done as root: (following a sudo -i or su -) # symbols the prompt, all things after the # should be on one line.

  1. Fake a libdap10 library.
    # ln -s /usr/lib/i386-linux-gnu/libdap.so.11 /usr/lib/i386-linux-gnu/libdap.so.10

    Now the library will be found by programs that looks for the libdap.so.10
  2. Reinstall libdapclient3. This has a dependency of libdap10, so it cannot be installed through the normal apt-get. First download it:
    # apt-get download libdapclient3
    Then install it, forcing it to ignore dependencies (Be sure first that libdap10 is the only non-satisfied dependency, by doing a normal apt-get install)
    # dpkg --force-depends --install libdapclient3_3.11.1-9_i386.deb
  3. Do the same thing with the libdapserver7 and cgi-mapserver:
    # apt-get download libdapserver7
    # dpkg --force-depends --install libdapserver7_3.11.1-9_i386.deb
    # apt-get download cgi-mapserver
    # dpkg --force-depends --install cgi-mapserver_5.6.6-2_i386.deb
  4. Other modules such as *-mapscript may be installed the same way

After this the cgi-mapserver should be in service again. The version numbers of the files may of cource change.
Disclaimer: This will cause problems with upgrades until a new version of cgi-mapserver with the correct dependencies is released. apt-get -f install will remove cgi-mapserver again.

Posted in mapserver | Comments Off on mapserver removed on debian

Slide between now and then – with prototype.js

At queness there is described how to make system for “sliding between” two different photos, e.g. to show before and after pictures using jquery. It all works well, but as I am using prototype.js, and I prefer to only use one library, I have rewritten the javascript to use prototype.

/*
 * Effect for sliding between two different images e.g. for showing a before and after situation.
 * 
 * Initially made for jquery - http://www.queness.com/post/6480/create-an-attractive-before-and-after-photo-effect-with-jquery
 * 
 * Ported to use prototype.js by Morten Sickel Sep 2011
 * 
 */
window.onload=function() {
    // Some options for customization
    var leftgap = 10;       /* gap on the left */
    var rightgap = 10;      /* gap on the right */
    var defaultgap = 50;    /* the intro gap */
    var caption = true;     /* toggle caption */
    var reveal = 0.5;       /* define 0 - 1 far does it goes to reveal the second caption */
    var img_cap_one;
    var img_cap_two;
    // find each of the .beforeafter
    $$('.beforeafter').each(function (i) {
        // peels out the filenames of the images - must be in same dir as the html 
        var img_mask = i.down('img').src;
	img_mask=img_mask.substring(img_mask.lastIndexOf('/')+1);
	var img_bg = i.down('img',1).src;
	img_bg=img_bg.substring(img_bg.lastIndexOf('/')+1);
	// get the captions 
        img_cap_one = i.down('img').alt;
        img_cap_two= i.down('img',1).alt
        // get the dimension of the first image, assuming second image has the same dimension
        var width = i.down('img').width;
        var height = i.down('img').height;
        // hide the images, not removing it because we will need it later
        i.select('img').each(function(el){
	    el.hide();
	});
        // set some css attribute to current item for graceful degradation if javascript support is off
        // i.css({'overflow': 'hidden', 'position': 'relative'});
        // append additional html element
        i.insert('<div class="ba-mask"></div>'); // this is where the upper image will go
        i.insert('<div class="ba-bg"></div>');   // this is where the lower image will go
        i.insert('<div class="ba-caption">' + img_cap_one + '</div>');  // caption                    
        // set dimentions and the images as background for ba-mask and ba-bg
        // TODO: move to creation of divs?
        size={width: width,height: height};
	size.backgroundImage='url("' + img_mask + '")';
	i.down('.ba-mask').setStyle(size);
	size.backgroundImage='url("' + img_bg + '")';
	i.down('.ba-bg').setStyle(size);
        // animate to reveal the background image
        //    Original:    i.children('.ba-mask').animate({'width':width - defaultgap}, 1000);    
	// TODO: animate - script.tacolo.us ?
	// instead just reveal a little bit of the background image 
        i.down('.ba-mask').setStyle({width:width - defaultgap});
        // if caption is true, then display it, otherwise, hide it
        // TODO - this looks strange... :
	if (caption) i.children('.caption').show();
        else i.children('.ba-caption').hide();
            
	// Handling mousemove event
        // Todo - only move the "bar" if the mouse is pressed - think I would prefer that 
        // TODO - that must be user settable
        Event.observe(i,'mousemove',function (e) {
	  // get the position of the image
	  pos_img = i.offsetLeft;
	  // get the position of the mouse pointer
	  pos_mouse = e.pageX;       
	  // calculate the difference between the image and cursor
	  // the difference is the width of the mask image
	  new_width = pos_mouse - pos_img;
	  img_width=i.down('img').width;
        //  $('mouse').innerHTML=new_width; // used for debugging 'mouse' must exist in the html
        // get the captions for first and second images
        // TODO - these are set further up, is this better?
	//img_cap_one = i.down('img').alt;
        //img_cap_two = i.down('img',2).alt;
        // make sure it reveal the image and leaves some gaps on left and right
	// it depends on the value of leftgap and rightgap
	  if (new_width > leftgap && new_width < (img_width - rightgap)) {         
	    i.down('.ba-mask').setStyle({width:new_width});
	  }   
	// toggle between captions.
        // it uses the reveal variable to calculate
        // eg, display caption two once the image is 50% (0.5) revealed.
	  if (new_width < (img_width * reveal)) {         
	      i.down('.ba-caption').innerHTML=img_cap_two;
	  } else {
	      i.down('.ba-caption').innerHTML=img_cap_one;           
	  }                                    
	}); // end of mousemove event handler
      }); 
    }; 

The css and html is the same as on queness, except that prototype must be loaded rather than jquery.
All honour to queness for the idea and initial programming. There are still a couple of todos here, but the general functionallity works with prototype.

Updates with html and css to follow…

Posted in Diverse, javascript | Comments Off on Slide between now and then – with prototype.js

Howto set up remote kde login on debian

Some proofreading may be needed, but the ideas should be clear – I hope.

Using kde 4.6.5

When starting to set up X systems, it is easy to confuse the notion of ‘client’ and ‘server’. Usually we think of the machine we are directly working at as the client and the remote one as the server – which makes sense in most cases – the server is the machine which has the resources that are needed, eg a data base, a web server, or some disks. In the case of an X-system, the server is the machine with the screen and input devices, i.e. the machine on which we are working, whereas the client is a machine that runs a program that is accessing these resources. So the local machine is the server, the remote is the client… I’ll (try to) use the words local and remote to distinguish between the two parties.

Alternatives
In many ways remote X-login is considered an old fashioned tecnology. There are two other thecnologies that are more used now.

Running X over ssh
When logged into the local machine running in an x-application, open an ssh-session to the remote machine,

ssh -Y

Then an application that is run under ssh on the remote machine will display a window on the local one.
This is considered more secure than the traditional x-login, but then it is neccesary to first log in on the local, then start (possibly automatically) an application there to log in to the remote machine. OK for me, not OK for the rest of the family that do want to have things as simple as possible.

rdp – the remote desktop protocol
Run an rdp-server on the remote machine, connect with an rdp-client from the local machine. The rdp-protocol is even supported in windows, with a rdp-client as a standard (although often pretty unknown) application. I do not know anything about the security implications of rdp.
On linux there are a plenty of rdp-clients to choose from, from rdesktop to krdc, a kde-program. I have tried a number of those and have always run into two problems: I have not managed to have them to use my norwegian keyboard, and the colors always looks wrong, eg in a standard kde-setup, all the text in the start-menu disappears. If I manage to resolve those issues and I can make an auto-login on the local machine starting a rdp-client – that may be the best solution.

Setting up remote x-login
As none of the other setups gives the simple “single log on ” that I want, I have to use remote x-logon, over the xmdcp protocol. It is said to be quite unsafe, but I am only using it on my cabel based home network.

On the remote machine:
Edit /etc/kde4/kdm/kdmrc
Under the [Xdmcp]-header set Enable=TRUE
restart kdm an the remote is ready for connections

On the local machine
Edit /etc/kde4/kdm/kdmrc

under # Greeter config for local displays
[X-:*-Greeter]
edit:
LoginMode=DefaultRemote
and set
ChooserHosts=*,

Restart kdm on the local machine, and you should be met with a list allowing you to select a remote machine to log into, after that, you get the normal kdm-login screen.

It is possible to make the remote machine(s) broadcast their willingness to allow a remote x-login, then it is not neccesary to list their names in ChooserHosts, so far I have not set up that.

What’s next
Maybe look into broadcasting rather than static lists of hosts as I have plans to set up a few old machines as traditional x-terminals.
Definiately look into how to get sound on the local machine. My idea is to use the phonon server over the net, and I think this site may be able to explain me how…

Posted in Diverse, linux | Comments Off on Howto set up remote kde login on debian

Faktarasjonaliseringspartiet?

Det er et eller annet med Frp og enkle fakta – at en ordførerkanditat tilsynelatende ikke har kvalitetssjekket utsagnene han kommer med i et intervju er jo interessant i seg selv.

Carl I Hagen blir intervjuet i Aftenposten om hva han vil gjøre som ordfører i byen:

Aftenposten: Hva bør være byens neste store kollektiv/transportsatsing?

Hagen: 7,5 minutts ruter på alle t-baner. E18-vestover og tunnelene ved Manglerud og Røa. “

Hvis Hagen gidder å høre på de som kan noe om drift av kollektivsystemer, kunne han ha hørt at 7,5 min rute på alle t-baner er umulig slik dagens system er bygget opp – men fakta er som kjent til bare for å plage frp… (eventuelt mener han at han vil gå inn for å bygge ny t-banetunnell med en gang, men det ville vel vært for utrolig)

5 linjer gjennom sentrum – alle i 7.5 minutters rute gir et nytt tog inn på stasjonene på fellesstrekningen hvert 1.5 minutt, man skal ikke følge mye med på av- og påstigning i rushtiden for å se at det ikke går, og da har vi ikke nevnt noe om sikkerhetsavstand mellom tog.

Posted in Diverse | Comments Off on Faktarasjonaliseringspartiet?

Vaskemaskintrøbbel

Jeg hadde ingen planer om å bli hobby-vaskemaskinreparatør, men sånt skjer…

F06 sa Bauknechtmaskinen. Vi kjøpte den etter å ha blitt fortalt at det skulle være en skikkelig bra en… og med stort sett alle slitedeler skiftet på garanti (i og for seg gratis, men det tar jo 14 dager hver gang før reparatøren klarer å komme…), så hadde jeg jo et håp om et relativt problemfritt vaskemaskinhold noen år framover. Men nei da. Litt googling viste at F06 betyr at motoren ikke får den hastigheten maskinen mener den skulle hatt, stort sett betyr dette utslitte børster. Børsteskift på den motoren er en relativt grei sak, så jeg tok turen til WP-service som er den norske representanten i Oslo for å kjøpe deler. For å være sikker på å få riktige tok jeg med motoren. Teknikeren jeg snakket med synes børstene så greie ut, men mente at feilmeldingen stort sett betydde gåene børster og motoren ellers virket grei, så jeg fikk et nytt par til en svært god pris. So far so good. Smilende hjem og skifte børster, fyre maskinen og F06… Ikke fullt så god stemning. Ny tur til WP-service og hjem igjen, denne gangen med en ny motor til en ikke fullt så god pris. Inn med motoren og … F06. Den ettermiddagen ble det sagt lite pent om Bauknecht og jeg søkte opp en skuddsikker halvtonns Miele maskin på “finn gies bort” – kveldstur til Bærum, suicidal vaskemaskinbæring i trang kjellertrapp og lånt sekketralle for å transportere maskinen på plass hjemme. Etter at den nye (svært gamle) maskinen var på plass, skulle jeg få den gamle (relativt nye) maskinen ut. Hvem er det da som får maskinen til å ta overbalanse på sekketrallen og vippe rundt, hvem er det da som kan se maskinen nedenifra i sollys, hvem er det sa som umiddelbart ser en røket ledning i motorkontakten. … Men, på den annen side, om Bauknechten fortsetter å være like driftssikker som den har vært til nå, så kan det jo være like greit å ha en backupvaskemaskin.

Og hadde bare jeg og han som ekspederte meg hos wp-service hørt på han andre teknikeren som passerte og mumlet noe om gåen motorkabel, hadde jeg kanskje sluppet å kjøpe en ekstra motor samt en tur til Bærum…

Motorplassering

Motoren sitter nederst i vaskemaskinen. Det er bare nødvendig å løsne skruen oppe til høyre for å få den ut (på bildet er motorkablen koblet ut, den henger ned til høyre for motoren)


Børster Børstene sitter på den enden av motoren som er innerst i maskinen. For å få dem ut, må en ledning kobles av og to skruer løsnes

Kullstiften i børstene skal ha god kontakt med ankeret.

Vær obs på mulige skader i motorkabelen…

Update:21. januar 2013: I helgen som var kortsluttet pumpen – nå skal vaskemaskinen fra helveste ut.

Posted in Diverse | Comments Off on Vaskemaskintrøbbel

Starigrad – Plakenica

En uke i Kroatia, Starigrad – Plakenica. Fly fra Rygge til Zardar med Ryan air, nesten litt skuffende at man gikk glipp av deres legendarisk dårlige service, selvsagt måtte vi betale ekstra for alt – selv om det må sies at toalettet på flyet var gratis, men kabinpersonalet var da hyggelige og effektive nok.
Det var jo litt spennende å ha bestilt bolig på nett, det vil si akkurat det har vi jo gjort mange ganger, men denne gangen hadde vi ikke klart å finne noen andre referanser enn hjemmesiden til Villa Kristina.
Imidlertid, vel framme skulle all angst bli gjort til skamme. Hus, leilighet og beliggenhet var nøyaktig som vist på nett og personalet var svært tilstedeværende og hyggelige.

Paklenica nasjonalpark
* Mer følger *

Posted in Diverse | Comments Off on Starigrad – Plakenica

Det private offentlige rom

For en tid siden skulle jeg markedsføre en konsert med Flea Market i Drøbak. Jeg hadde en bunke plakater som skulle settes opp. Det viste seg jo å være lettere sagt enn gjort – de fleste steder det var aktuelt å sette opp noe var det skilter med “Plakater forbudt”. Jeg er relativt lovlydig av meg, og i alle fall, skulle det bli noe bråk, ville det gå utover konsertarrangøren på det Gamle Bageriet og Flea Market, og det ville jeg jo ikke ønske.

Jeg husker tilbake på 80-tallet i Oslo. Der var det vegger som ble tapetsert med plakater med reklame for konserter og utstillinger – og et og annet politisk eller religiøst møte. Nå i Drøbak finnes det jo knapt en plakat. Byen er ren og pen og ryddig og tilsynelatende steril og død. Det vil si, her og der finnes det jo kommersielle reklameplakater. De som har penger kan jo kjøpe seg den plassen de vil ha, men for de som ikke ønsker bildene i det formatet enn si har penger til å kjøpe seg en slik plass er mer eller mindre skvist ut i tausheten.

Kan ikke si det bedre enn Odd Børrezen:

Unnskyld at vi finns.

Håper at Hittegodsen laster opp sin versjon av den samme etter hvert…

Posted in Diverse | Comments Off on Det private offentlige rom

Data sharing policies

I just got an email complaining about web scraping on a common data presentation portal to fetch data for the android app “Global Nuclear Watch” and bragging about some steps they had taken to stop it. I felt an answer was apt:

“Just my 0.02$ thought – and (partially) not the official view of NRPA

There is a saying that goes like “You should be the best source of your own data” – if you are not that, and the data are interesting for someone, somewhere are going to present them in a better way.

Are the data public or not? If they are public, we shold just accept that things like that happens – in fact, at nrpa we are currently cooperating with some people doing web-scraping taking the stance that they are giving our data an added value and we are in fact happy that someone finds so much interest in our data that they actually do some work on them. (and also making the data better availble for our own use, those of us that have android phones have Global Nuclear Watch installed) We are also planning to offer the data as xml or json or some other format to make it easier for those adding value to our data.

If the data are not public – well then they should not have been made public in the first place, thenthey should have been hidden in a password protected system. Even though at the moment the present way of “scraping” has been stopped, if the interest is big enough, someone will find out how to do it in another way .- and this time they will probably not contact and try to cooperate. In worst case, if the interest should be high enough, someone may start a project hiring low salary people or starting a kind of internet action where people around the world start to manually read and type out the data – how to stop that? – that may also be pretty bad pr for our organisations “They say they share the data, but they only want to have it presented their own way, what are they hiding??”

Of cource each of you decides (within the limits of your local legislation) what to do with your data – but as soon as the data are out there, in my opinion, it is much better to cooperate with those who try to make something that we had not forseen or planned out of them. If there are “non legal” application around using our data, we can theoretically hunt them down and try to stop them, but that will cost a lot of resources and will probably at the end only give us even more bad pr. If we make the data available with some kind of requirement for use, of cource someone may still take the data and use them in other ways, but there will probably be even more people who use them according to our requirements which will probably more or less drown out the few people who (in our opinion) misuse our data.

For an example, see the Norwegian met office’s page on their data policy: http://www.yr.no/verdata/1.6810075 (if it comes up in Norwegian, there is a link on the middle a bit down to switch to the English version)”

Posted in Diverse | Comments Off on Data sharing policies