2007-11-28

20,000 Lines Under the Sea

I wanted to write a small script for installing/changing pictures for folders containing photos in Nautilus.

I dug into sources, dug out the required Corba interfaces, understood how bonobo and its python wrapper work.

Under old Ubuntu with Gnome 2.16.1 this script works, under the new one with Gnome 2.20 Bonobo.GeneralError with an empty message is thrown.
#!/usr/bin/env python
import bonobo
import Bonobo

bonobo.activate()
obj = bonobo.get_object ('OAFIID:Nautilus_Metafile_Factory', 'Nautilus/MetafileFactory')
print dir(obj)
I do not like it, but I have no choice - I have to edit ~/.nautilus/metadata

Update 03.12.2007 - The presentation slides Guadec2003 - PyOrbit

Update 17.12.2007 - I got evidence that this is a bug. I'm curious, for how long it will remain unnoticed

2007-11-26

In Gates we trust

Sometimes it seems that authors that compile lists of esoteric programming languages underestimate bat files possibilities.

rem The current day of a month
for /f "tokens=2,*" %%i in ('date /T') do (
set dt=%%i
)
set dt=%dt:~0,2%

2007-11-23

Linux on Laptops

While choosing and tuning my notebook I searched the whole Internet about how Linux works on computers from different vendors.

I did not like:

IMHO plain text is not very good for the description of the supported hardware. Why there is not a site where the user is prompted to place a pre-defined set of ticks and to write a comment, if necessary?

Since it's great to see comparative tables for different laptops or distributions.

2007-11-22

Shoot and run story about installing Ubuntu Gusty on Dell 1520.

The two main problems:

Media direct button
1.00002 At this point I worried for nothing, rmbr.exe utility easily works from the console of Vista repair disk, so Windows can be teared down painless. For some reason I had not managed with the placement of media-direct loader at a logical disk, so I placed both grubs at primary partitions, did not install grub in mbr, started rmbr.exe 3 2 and everything works. It is left to think of the place where on boot under the 8th run level autologin will happen, and to choose the media combine - MythTV, Freevo or Elisa.



Sleep
More with Google than with my own brains I came to the magic row for /etc/defaults/acpi-support, ater it suspend and hibernate began to work middling well.


MODULES="uvcvideo bcm43xx ehci_hcd uhci_hcd"

And for nvidia drivers is required

POST_VIDEO=false
POST_VIDEO=false

Hibernate hangs up if mixer applet or ekiga are running, they do not let to upload snd_hda_intel(sound) and uvcvideо (web camera).


Update 23.11.2007: Here is the description of what I managed to do and what I did not

2007-11-13

Shattleworth strikes back

dscn3730 While Ballmer is trying to impose Windows to Nigerian schoolchildren by foul means, Ubuntu is slowly and steadily spreading in the whole world.

Returning home with a freshly bought Dell Inspion 1520 under my arm, I found in the mailbox a package with two Ubuntu discs. As they say - it's a destiny )

I wanted to spend some time under Vista, get used to baubles, but evidently now I will set up Linux, just at weekends. The keeping of two OSes is a kind of schizophrenia - something you do here, something - there, the constantly shortcuts confusing, and you bite your elbows when you have to reboot for the sake of something.

I'm planning the following:
From LiveCD to sort out the sound and a problem with the hard drive. If everything will be ok, Windows can be teared down.
Update 14.10.2007: I booted from LiveCD and installed irqbalance_0.55-2_amd64.deb and linux-backports-modules-2.6.22-14-generic_2.6.22-14.9_amd64.deb. Could invent nothing more sensible, uploaded all snd_ modules manually and executed modprobe snd_hda_intel. Now sound works.

To remove Recovery and Media Direct partitions, create tiny(5-10м) Media Direct partition at the end of disk. To install Grub there. To set up under Windows Media Direct button for the working with this partition. If everything will be ok, I'll move further.
Update 16.11.2007: I could not place MediaDirect part with grub on logical disk for some reason. But with /dev/sda4 it works.
dscn3747 The further I get the more discoveries I have. Three operating systems pre-installed by dell to the new computer - it's cool. Moreover, initially I thought that bios menu item Diagnostic starts diagnostic programm from the first hidden partition of the hard disk. Not by any means. If to arm with grub and boot from (hd0, 0) then DOS but very pretty testing programm is started. It's the 7th year of the twenty-first century, on my new computer the mouse is working under DOS again ).
And from BIOS tests with the text-mode interface are run. Maybe it is embedded in BIOS? Then maybe, the first hidden partition is not needed at all?

Instead of Vista I've installed Ubuntu with the second grub, and the first grub is set to start ubuntu with some 8 run level, which will boot the absolute minimum, just for mplayer starting ).

Yes, one more thing: after the instalattion I'll have to fix splash screen, but it seems to be very easy.

Link Dump: What is MediaDirect 3? Inside the Dell Utility Partition

Update 26.11.2007: And my little sister received Ubuntu disks just on her birthday. That's marketing ))

2007-11-07

Valid time tables

I do not get it, seems like everything should be quite the contrary.


Quoting the same Dave Ensor and Jan Stevenson. "Oracle Design"


















producte_codeDATE_FROMDATE_TOPrice
113.01.200701.02.20071.12
102.02.200731.10.20072.24
101.11.200701.01.30005.47


select price from prices
where sysdate between date_from and date_to

It seems to be efficient to use index for the columns (PRODUCT_CODE, DATE_TO) since search parameter is located near the upper index bounds. However, note that on query processing still each line which has DATE_TO value grater than SYSDATE will be read. In other words, the optimizer will continue lines reading after we found the required string.

Maximum efficiency is achieved witр recent prices selecting, if column DATE_TO is indexed, and with oldest prices selecting, if DATE_FROM is indexed