Google Drive – Conditional formatting of entire rows

I was searching for a possibility to format entire rows or defined cells in condition to a formula or content of another cell. This is a really handy functionality of other spreadsheet programs. So I thought it should also be possible in Google Drive … yeah, but only with a selfwritten function. Here [1] I found the first hints and with the API [2] I finished mine:


function onEdit() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName('Issues'); // Change to your own
var rows = sheet.getRange('a1:c');
var numRows = rows.getNumRows();
var values = rows.getValues();

for (var i = 0; i <= numRows - 1; i++) {
var n = i + 1;
if (values[i][2] == 'finished') {
sheet.getRange(n + ':' + n).setBackgroundColor('white');
sheet.getRange(n + ':' + n).setFontColor('lightgrey');
}
else if (values[i][2] == 'new') {
sheet.getRange(n + ':' + n).getCell(1,2).setBackgroundColor('yellow');
sheet.getRange(n + ':' + n).setFontColor('black');
}
else if (values[i][2] == 'workingOn') {
sheet.getRange(n + ':' + n).getCell(1,2).setBackgroundColor('red');
sheet.getRange(n + ':' + n).setFontColor('black');
}
else {
sheet.getRange(n + ':' + n).setBackgroundColor('white');
sheet.getRange(n + ':' + n).setFontColor('black');
}
}
};

function onOpen() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName('Issues'); // Change to your own
var sortRange = sheet.getRange('a2:c');
sortRange.sort([{column: 1, ascending: true}, {column: 3, ascending: true}]);
}

Hope it helps you too!

[1] http://productforums.google.com/forum/#!topic/docs/t6xPcOkjNbQ/discussion
[2] https://developers.google.com/apps-script/reference/spreadsheet/spreadsheet

arch latex bug

hey folks!

Have you got this nasty error message?

This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Arch Linux) restricted \write18 enabled.---! /var/lib/texmf/web2c/pdftex/latex.fmt doesn't match pdftex.pool(Fatal format file error; I'm stymied)

Then you should do the following:

… copying the *.pacnew files in /etc/texmf over the non .pacnew files and running fmtutil –all fixes the issue.

Found here: https://bbs.archlinux.org/viewtopic.php?id=166163

Grub 2 and the VGA parameter

It was annoying to have only a resolution of 640×480 in the virtualbox instance of my new debian virtual instance. So I have had to do something. Here [1] I found the solution of the already well known problem:

In Grub2 the vga= parameter is deprecated.

To set a screen resolution for your console you can do the following log in as root

edit /etc/default/grub uncomment the GRUB_GFXMODE=640×480 and change the resolution to something you can use e.g. 1024×768
Add the line
GRUB_GFXPAYLOAD_LINUX=keep
to the file to have the same resolution at the Linux console. You do not edit the 00_header file as some suggest you need to do.

run update-grub

run reboot to confirm that your changes worked!

[1] https://wiki.debian.org/GrubTransition

how to restart udev

hey folks,

if you need to refresh your /etc/udev/rules.d/config.rule and for example add some embedded devices, take your editor and do so:

#EnergyMicro J-Link Device
SUBSYSTEM=="usb", ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0101", GROUP="users", MODE="0666"

if you don’t want to restart your service or reboot your machine to enable your changes, here is a really handy command:

udevadm control --reload

happy coding and developing!

http://www.freedesktop.org/software/systemd/man/udevadm.html

Logitech K400r and the missing middle mouse button

Recently I bought me a new wireless keyboard. Reason was the advice of my physiotherapist to improve my sitting posture at work, so she told me to place the monitor in eye level and the keyboard and mouse near the edge of the desk. But this is not really easy with a notebook. Therefore I searched for a lightweight keyboard with an integrated touchpad: Logitech K400r won the selection.
The keyboard is small so I need to getting used to it but it worked out of the box even on my new installed linux arch distribution. Only one thing was annoying: the missing middle mouse button. I need this little helper so much on a linux system, think only about the handy copy&paste function …

After asking google for help I was a little bit disappointed, because “neojam” [1] wasn’t able to activate/find a way to use the middle mouse button. But I was willing to find a way.

First of all I thought about the possibility to map keys with xmodmap. So I started xev to realize the proper code for the middle mouse button. This approach led to nowhere, because clicking both mouse buttons on my laptop was indicated as “button2″ but not on the K400r, there I got only “button1″ and “button3″. So I searched for a possibility to map the simultanouse clicking of both buttons. I found the hint to use the “Emulate3Buttons”-Option in the xorg.conf. The default set of this configuration is disabled, but I didn’t want to enable it for the generic mouse InputDevice. This site [2] helped me to remember the “MatchProduct”-Option for special configuration of InputClasses in the xorg.conf. With the xinput list command I got this output:

$ xinput list
⎡ Virtual core pointer                        id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                  id=4    [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad                  id=10    [slave  pointer  (2)]
⎜   ↳ TPPS/2 IBM TrackPoint                       id=11    [slave  pointer  (2)]
⎜   ↳ Logitech Unifying Device. Wireless PID:4024    id=13    [slave  pointer  (2)]
⎣ Virtual core keyboard                       id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard                 id=5    [slave  keyboard (3)]
    ↳ Power Button                                id=6    [slave  keyboard (3)]
    ↳ Video Bus                                   id=7    [slave  keyboard (3)]
    ↳ Sleep Button                                id=8    [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard                id=9    [slave  keyboard (3)]
    ↳ ThinkPad Extra Buttons                      id=12    [slave  keyboard (3)]

So I only had to add this stuff to my xorg.conf:

Section "InputClass"
    Identifier      "Logitech K400r"
    MatchProduct    "Logitech Unifying Device. Wireless PID:4024"
    Option          "Emulate3Buttons" "yes"
EndSection

And finally my precious middle mouse button worked also on my new keyboard 8-)

[1] http://forums.logitech.com/t5/Keyboards-and-Keyboard-Mice/Disappointed-with-my-new-K400r-keyboard/td-p/948530
[2] https://wiki.archlinux.org/index.php/Xorg

splash screen with plymouth on xubuntu 12.10

there were some troubles configuring the splash screen. here is a possible solution based on the listed links below:

vim /etc/default/grub
>>
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_GFXMODE=1280x1024
GRUB_GFXPAYLOAD_LINUX="1280x1024"

grub-update

vim /etc/initramfs-tools/conf.d/splash
>>
FRAMEBUFFER=y

update-alternatives --config default.plymouth
update-initramfs -u

http://ubuntuforums.org/archive/index.php/t-2066656.html
http://askubuntu.com/questions/202764/plymouth-not-showing-after-upgrading-to-ubuntu-12-10
http://askubuntu.com/questions/98022/startup-shutting-down-screen-showing-xubuntus-bootsplash-and-not-ubuntus

awn taskmanager shows an ugly, useless green plus sign

after installing xubuntu 12.10 alpha on my notebook, awn (avant-window-navigator) wasn’t the same again even though i dropped my .gconf directory to new installed user drive. the reason was the new config directory of awn ~/.config/desktop-agnostic.

so i found the solution at the bug report #990774:

apt-get build-dep avant-window-navigator
apt-get -b source avant-window-navigator
sudo dpkg -i *.deb

hope it works for you too!