Conrad launched the 3.6 series of
Armadillo earlier today with a first 3.6.0 release.
So RcppArmadillo, our wrapper for R and Armadillo, is now on
CRAN with its corresponding version 0.3.6.0. No R level or interface changes
were needed, and the upstream changes are summarized below.
Changes in RcppArmadillo version 0.3.6.0 (2012-12-07)Courtesy of CRANberries, there is also a diffstat report for the most recent release As always, more detailed information is on the RcppArmadillo page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.
- Upgraded to Armadillo release Version 3.6.0 (Piazza del Duomo)
- faster handling of compound expressions with submatrices and subcubes
- added support for loading matrices as text files with
NaNandInfelements- added
stable_sort_index(), which preserves the relative order of elements with equivalent values- added handling of sparse matrices by
mean(),var(),norm(),abs(),square(),sqrt()- added saving and loading of sparse matrices in arma_binary format
I want to start this post by saying two things:| Week | Squeeze | Wheezy | Diff |
|---|---|---|---|
| 43 | 284 (213+71) | 468 (332+136) | +184 (+119/+65) |
| 44 | 261 (201+60) | 408 (265+143) | +147 (+64/+83) |
| 45 | 261 (205+56) | 425 (291+134) | +164 (+86/+78) |
| 46 | 271 (200+71) | 401 (258+143) | +130 (+58/+72) |
| 47 | 283 (209+74) | 366 (221+145) | +83 (+12/+71) |
| 48 | 256 (177+79) | 378 (230+148) | +122 (+53/+69) |
| 49 | 256 (180+76) | 360 (216+155) | +104 (+36/+79) |
| 50 | 204 (148+56) | ||
| 51 | 124 (124+54) | ||
| 52 | 115 (78+37) | ||
| 1 | 93 (60+33) | ||
| 2 | 82 (46+36) | ||
| 3 | 25 (15+10) | ||
| 4 | 14 (8+6) | ||
| 5 | 2 (0+2) | ||
| 6 | release! |
Before we begin, everyone should read up on hashtables and what open
addressing / closed hashing is. The context is lines 111 190 of Python s
Objects/dictobject.c as of today (so we get the line numbers straight).
(I ve reworded this wlog entry a bit; I originally wrote it too late at
night for it to read coherent.) Basically, I ve got an application where
I d like to use a hashtable for a number of things not as generic as
Python, and with focus on small footprint. I d like to offer associative
arrays in a scripting language, where the keys are always arbitrary byte
strings excluding NUL. Also, I d like to use the hashtable as backend for
indexed arrays, where the keys are uint32_t and the usual use
case is sequential. Finally, I m using it for several internal tables,
such as a list of keywords, one of builtins, one of special variables,
etc. which is a reason for me to not use a self-balancing binary tree
as data structure (reading further below might suggest that, but getting
a sorted list of hashtable keys is not the focus, though not unimportant).
Why is the shift on perturb done after its first use? In my experiments (using 32-bit width everywhere), for the pathological case of an 8-element (i = 3) table with three entries 0, 0x40000000 and 0x800000000, the second round yields 1 for all three, so it cannot have to do with the upper bits. My lookup looks like:
mask = 2 - 1; j = perturb = hash(key); goto find_first_slot; find_next_slot: j = (j << 2) + j + perturb + 1; perturb >>= PERTURB_SHIFT; /* FALLTHROUGH */ find_first_slot: entry = table[j & mask]; if (!match(entry)) goto find_next_empty_slot;
This means that my first check is always the bare hash (so only do it if needed is no reason) and, since I m using gotos, I could just move the perturb >>= PERTURB_SHIFT; line before the line recalculating the next j to use. This seems to make more sense, even in the face of Python. (I actually looked at the Python file s comments again today because I thought to use a different resolution, but they have a good rationale for using the multiplication by 5.) Why can t we just use i as the PERTURB_SHIFT? Sure, this changes a shift-right by a constant, which can possibly be encoded as immediate value in assembly (unless you re on a pre-80186, which can only do SHR AX,1 and SHR AX,CL but not SHR AX,4, but that s outside of mksh s scope) into a right-shift by a variable, but i is already known, and I think the behaviour is better (it wouldn t eat any bits; assume the same 8-entry hashtable and pathologic keys 0, 8 and 16). Again: who do I think I am to go against the wisdom of the Python people, who seem to have shed more thought on this than everyone else I saw, asked, read about (including Spammipedia). That s why I m asking here. On that reference: I don t support spammers or people nagging for donations or premium accounts, like Xing and Groundspeak/Geocaching.COM, at all. In fact, I urge others to do the same, so it really hurts them; it may be their business model, but not if they spam me. Besides, OpenCaching.DE exists. Another thing is: to avoid CVE-2011-4815, I m randomising the hash used, with one seed value per hashtable, changed before a resize operation. I originally thought to seed it with nonzero, but then I have to rehash on hashtable resize, so I ll be XORing the final hash value instead (thanks ciruZ for the idea). I m thinking of omitting that for indexed arrays, as an attacker almost certainly cannot determine the keys there. (To directly use the indexed array keys, which are already uint32_t, as hashes makes using i from even more important.) The hash I m using is a modified Jenkins one-at-a-time called NZAAT: it s my new generic standard n n-cryptographic hash, and the changes are thus: while adding a byte, another increment of the hash is done (so NUL counts), and the finaliser got prefixed with the shift-left-add+shift-right-xor sequence of the adder (but not adding any value or the +1), to get best avalanche for all bytes. I actually compiled several versions of Hash.cs on a Windows VM at work to analyse the original one-at-a-time and all of my modifications; these turned out to be the simplest ones (I originally had added 0x100 instead of 1, but the effect was the same, and +1 is usually cheaper on most CPUs). Also, to avoid people being able to get to the seed, a user will always get only a sorted list of hashtable keys (numeric for indexed arrays, ASCIIbetically otherwise; see also my thoughts on JSON from the previous wlog entry). What algorithm do I use? For strings, comparisons are much more expensive, so I d like to keep them low. Memory use is also a factor; allocating one large(r) block is better than many small ones due to the pool allocator overhead and due to portability to ancient Unic s (which is another reason for me to use a hashtable which is a small struct plus an array of pointers, and then pass the list of keys as array of string pointers, instead of a tree). For both reasons, I m thinking a relatively simple MergeSort: I need to allocate the result array anyway, so I can just get two and free the one that isn t the end result, and it s AFAICT the cheapest on comparisons other than Tree Sort (which nobody really seems to use, and which would effect to using a balanced binary tree again). Since keys are unique, stability and duplicate handling is never an issue. I d like to use only one algorithm and one data structure, not a combination, as compactness is a design goal. Please drop your thoughts on Freenode, e.g. by /msg MemoServ send mirabilos your text here or per eMail to the domains debian, freewrt or mirbsd, which are organisations, with the localpart tg. Or just contact me as usual, if you re already acquainted. Or lookup 0xE99007E0. Thanks in advance! (Especially, Python Developers thoughts are welcome.)
For more than ten years now, I am a regular and happy user of GnuCash, the free accountancy program. Especially the integrated online banking support for HBCI that allows me not only to fetch my transactions, but also to transfer money using a cryptographic makes it a great tool. Nevertheless, it has shortcomings, especially when it comes to reports. And for some reason I never felt the urge to hack on that C/Guile code (although I recently hacked a bit on the UI).
So we finally made it, and sent out an
official announcement for
apt.postgresql.org.
This new repository hosts packages for all PostgreSQL server versions (at the
moment 8.3, 8.4, 9.0, 9.1, 9.2) for several Debian/Ubuntu distributions
(squeeze, wheezy, sid, precise) on two architectures (amd64, i386). Now add
packages for extension modules on top of all these, and you get a really large
amount of binaries from a small number of sources. Right now there's 1670 .deb
files and 148 .dsc files, but the .dsc count includes variants that only differ
in the version number per distribution (we attach .pgdg60+1 for squeeze
packages, .pgdg70+1 for wheezy and so on), so the real number of different
sources is rather something like 81, with 38 distinct source package names.
Dimitri Fontaine,
Magnus Hagander, and I have been working
on this since I first presented the idea at PGconf.EU 2011 in Amsterdam. We now
have a Jenkins server building all the packages, an archive server with the
master repository, and a feed that syncs the repository to the postgresql.org
FTP (well, mostly http) server.
If you were previously using pgapt.debian.net, that's the same archive as on
apt.postgresql.org (one rsync away). Please update your sources.list to point
to apt.postgresql.org, I'll shut down the archive at that location at the end
of January.
Here's the Quickstart
instructions from the Wiki page:
Import the repository key from http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc:
wget -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc sudo apt-key add -Edit /etc/apt/sources.list.d/pgdg.list. The distributions are called codename-pgdg. In the example, replace squeeze with the actual distribution you are using:
deb http://apt.postgresql.org/pub/repos/apt/ squeeze-pgdg mainConfigure apt's package pinning to prefer the PGDG packages over the Debian ones in /etc/apt/preferences.d/pgdg.pref:
Package: * Pin: release o=apt.postgresql.org Pin-Priority: 500Note: this will replace all your Debian/Ubuntu packages with available packages from the PGDG repository. If you do not want this, skip this step. Update the package lists, and install the pgdg-keyring package to automatically get repository key updates:
apt-get update apt-get install pgdg-keyring
Google Latitude history dumps come in KML, and KML isn t super compatible with existing GIS tools. I wrote a quick snippit to output CSV from a KML dump on google latitude.
from lxml import etree
import sys
root = etree.fromstring(open(sys.argv[1], 'r').read())
track = root.xpath("//*[local-name()='Track']")[0]
coord = None
when = None
print "time,lat,lon"
for node in track.iter():
name = node.xpath("local-name()")
if name == 'coord':
lon, lat, z = node.xpath("text()")[0].split()
coord =
"lat": lat,
"lon": lon,
"zee": z
elif name == 'when':
when = node.xpath("text()")[0]
if coord and when:
print "%s,%s,%s" % (
when,
coord['lat'],
coord['lon']
)
coord, when = None, None
P.S. namespaces in lxml is nasty.
I'm maintaining a lab of debian squeeze machines that run OpenOffice.org (i'm considering upgrading to LibreOffice from squeeze-backports). I'd like to adjust the default page margins for all users of Writer. Most instructions i've found suggest ways to do this as a single user, but not how to make the change system-wide. I don't want to ask every user of these machines to do this (and i also don't want to tamper with each home directory directly -- that's not something i can maintain reliably). Alas, i can find no documentation about how to change the default page margins system-wide for either Oo.o or LibreOffice. Surely this is something that can be done without a recompile. What am i missing? Tags: configuration, libreoffice, margins, openoffice.org, sysadmin, templates
So I finally got the first laser-cut version of the Silly Wal(l Cloc)k done:
The back plate was cut from a 1mm plexiglass sheet using this SVG. The black parts were spray painted with matte black and inserted back into the hollowed out sections (I should have made pictures of the pieces before assembling; too lazy to do it now). This proved out to be somewhat problematic, since keeping the small pieces (the chin and the white part of the suitcase handle) in place isn t really easy without gluing everything together, which I wanted to avoid because I m not sure what effect the glue might have on plexiglass in the long term.
Another problem was the fact that the plexiglass sheet is white, but slightly translucent. Since the back piece of the clock is black, this caused the white parts to look dirty . As a workaround for both problems I ended up using a thin white cardboard sheet as additional background, where the small hollowed out pieces could be affixed and the translucency of the plexiglass could be hidden.
On the other hand, the 1mm thickness for the plexiglass turned out to be perfect for the clock hands (or feet). I think it would still have worked with 2mm, but that might be too heavy for the puny clock torque and they might start snagging on each other.
Careful eyes will also note that I made a stupid mistake when writing down the dimensions for the back plate and it ended up being slightly smaller than the available space. Not my brightest moment, but it worked out alright with the additional cardboard background.
The next iteration will probably be made with a different two-color plexiglass sheet that can be engraved. Let s see how that works out.
Related: Silly Wal(l Cloc)k
Some brief software updates:
Although I've made extensive notes on common static site generators, and they will be discussed at length in the near future, I do want to highlight one problem common to 90% of them: Symbolic links. For example webgen fails my simple test:~/hg/websites$ webgen create test.example.com ~/hg/websites$ cd test.example.com/src/ ~/hg/websites/test.example.com/src$ mkdir jquery-1.2.3 ~/hg/websites/test.example.com/src$ touch jquery-1.2.3/jquery.js ~/hg/websites/test.example.com/src$ ln -s jquery-1.2.3 jquery ~/hg/websites/test.example.com$ webgen Starting webgen... ... Finished ~/hg/websites/test.example.com$ ls out/ grep jq jquery-1.2.3Here we see creating a symlink to a directory has not produced a matching symlink in the output. Something I use frequently. for example. Some tools mangled symlinked directories, or files, some ignore them completely. Neither is acceptible.
I ve been looking for a set of slides that I could have reused to make a 30 minutes introduction to my colleagues at the computer science department.
Finding none that would be suitable (i.e. including graphical examples and not only being the canvas for a workshop), I tried to proceed with making one of my own.
I ve reused the document git concepts simplified, whose content seemed quite good, and have converted it to a set of slides.
Here s the result, which has been reworked a bit vs. the original git concepts simplified :
<iframe allowfullscreen="allowfullscreen" frameborder="0" height="356" marginheight="0" marginwidth="0" mozallowfullscreen="mozallowfullscreen" scrolling="no" src="http://www.slideshare.net/slideshow/embed_code/15517872" style="border:1px solid #CCC;border-width:1px 1px 0;margin-bottom:5px" webkitallowfullscreen="webkitallowfullscreen" width="427"> </iframe>
Here s the PDF version.
Note that if you prefer a version that aligns more with the original, here s also an older version, in : https://github.com/olberger/git-notes/tree/master/gcs
Update: For the lone reader that cannot attend my presentation, I should recommend to read first the HTML version by Sitaram at git concepts simplified, as the slides miss some details (which I ve kept in the beamer notes only), then only refer to my slides in a second time, for some additions.
If you want the org-mode source (containing the dot source of the diagrams), contact me. I ll maybe upload the source into some Git repo whan I have enough demand/time Armed with this knowledge I can now move forward and script the DNS and DHCP updates I wanted to do.#!/usr/bin/env python import getpass import xmlrpclib server_url = 'https://cerebrum-uio.uio.no:8000'; username = getpass.getuser() password = getpass.getpass() server = xmlrpclib.Server(server_url); #print server.get_commands(sessionid) sessionid = server.login(username, password) print server.run_command(sessionid, "user_info", username) result = server.logout(sessionid) print result
Please Note: this article is written from my personal perspective as a Debian Developer, and is not the opinion or expression of my employer.Amazon Web Service s EC2 offers customers a number of Operating Systems to run. There are many Linux Distributions available, however for all this time, there has never been an Official Debian Image or Amazon Machine Image (AMI), created by Debian. For some Debian users this has not been an issue as there are several solutions of creating your own personal AMI. However for the AWS Users who wanted to run a recognised image, it has been a little confusing at times; several Debian AIMs have been made available by other customers, but the source of those images has not been Debian . In October 2012 the AWS Marketplace engaged in discussions with the Debian Project Leader, Stefano Zacchiroli. A group of Debian Developers and the wider community formed to generated a set of AMIs using Anders Ingemann s ec2debian-build-ami script. These AMIs are published in the AWS Marketplace, and you can find the listing here: No fees are collected for Debian for the use of these images via the AWS Marketplace; they are listed here for your convenience. This is the same AMI that you may generate yourself, but this one has been put together by Debian Developers. If you plan to use this AMI, I suggest you read http://wiki.debian.org/Cloud/AmazonEC2Image, and more explicity, SSH as the user admin and then sudo -i to root. Additional details Anders Ingemann and others maintain a GitHub project called ec2debian-build-ami which generates a Debian AMI. This script supports several desired features, an was also updated to add in some new requirements. This means the generated image supports:
The new maintenance release 0.2.10 of
RInside
is now on CRAN, including
Windows binaries. RInside provides
a set of convenience classes which facilitate embedding of
R
inside of C++ applications and programs, using the classes and functions provided by the
Rcpp R and C++
integration package.
This release helps with an update to stack checking, required by a recent
change in R itself. The
NEWS extract below has more details.
Changes in RInside version 0.2.10 (2012-12-05)CRANberries also provides a short report with changes from the previous release. More information is on the RInside page. Questions, comments etc should go to the rcpp-devel mailing list off the Rcpp R-Forge page.
- Adjusted to change in R which requires turning checking of the stack limit off in order to allow for access from multiple threads as in the Wt examples. As there are have been no side-effects, this is enabled by default on all platforms (with the exception of Windows).
- Added new threads example directory with a simple example based on a Boost mutex example.
- Disabled two examples (passing an external function down) which do not currently work; external pointer use should still work.
Next.