I was working on replacing some mockup code for testing an internal library with python. Basically, the C code is incredibly big and I would rather mock the 3rd party API we are using in python. I wrote a generator to create wrapping code that forwards the C API calls to my python module.
Now that most of the work is finished, I get the following error message from my python mock:
1 2 3 4 5 6 | Traceback (most recent call last): File "simple_mockup.py", line 2, in <module> import threading File "/usr/lib/python2.5/threading.py", line 11, in <module> from time import time as _time, sleep as _sleep ImportError: /usr/lib/python2.5/lib-dynload/time.so: undefined symbol: PyExc_ValueError |
1 2 3 4 5 6 7 | #include <Python.h> void test_python() Py_Initialize(); PyRun_SimpleString("import threading\n"); |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #include <stdio.h> #include <dlfcn.h> int main(void) const char *error; void *handle = dlopen("./demo.so", RTLD_LAZY EXTRA_RTLD_FLAGS); void (*test_python)(); *(void**) &test_python = dlsym(handle, "test_python"); if ((error = dlerror())) fprintf(stderr, "%s\n", error); return 1; printf("Calling test_python @ %p in shared object @ %p.\n", test_python, handle); (*test_python)(); dlclose(handle); printf("Feels fine, finishing.\n"); return 0; |
1 2 3 4 5 6 7 8 9 10 11 12 13 | #! /bin/sh gcc -shared python-config --includes -o demo.so demo.c python-config --ldflags echo "Running example with default RTLD flags:" gcc -DEXTRA_RTLD_FLAGS=0 -o main main.c -ldl ./main echo echo "Passing RTLD_GLOBAL in addition:" gcc -DEXTRA_RTLD_FLAGS=RTLD_GLOBAL -o main main.c -ldl ./main echo |
torsten@pulsar:~/sh_bug$ ./run_it.sh
Running example with default RTLD flags:
Calling test_python @ 0xb77084bc in shared object @ 0x96bc018.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python2.5/threading.py", line 11, in <module>
from time import time as _time, sleep as _sleep
ImportError: /usr/lib/python2.5/lib-dynload/time.so: undefined symbol: PyExc_ValueError
Feels fine, finishing.
Passing RTLD_GLOBAL in addition:
Calling test_python @ 0xb783f4bc in shared object @ 0x95e1018.
Feels fine, finishing.
Sucky. So embedding Python into an application is easy but if you want to use the interpreter and its modules from a plugin, you are out of luck. Somebody knows a way around this problem? The only solution I can think of is to link libpython.so into each of the python plugins.
Update: Work around
Small update: For my current problem, the work around is to run the application with the python library preloaded: LD_PRELOAD=/usr/lib/libpython2.5.so.1.0 app. Back to adding functionality
Over the summer, there was a bit of a tussle at the highest level of
Ubuntu governance over whether or not Canonical Ltd., the company
that funds the majority of work done directly in Ubuntu, should name its
file syncing and backup service Ubuntu One.
Canonical's service involved a freely licensed client included in the
Ubuntu distribution but, as a network service running on Canonical
servers, it was not clearly a part of Ubuntu (the GNU/Linux
distribution) or Ubuntu (the community) in the way the term was usually
used within the community. Although the network service itself was not
Franklin Street Statement free, this was not the most important
issue for everyone who objected to the name. The major issue for many
seemed to boil down to the fact that, free or not, Ubuntu One is a
service run entirely by Canonical outside the reaches of the Ubuntu
governance structures.
Decisions were made and not everybody -- and maybe not anybody -- was
absolutely happy with the outcome. My goal is not try to revive old
arguments here. As far as I'm concerned, the issues are settled and the
service is called Ubuntu One. That said, the questions raised during
the episode are fundamental to Ubuntu and to other firm-sponsored FLOSS
projects. Now that the dust has settled, they are worth reflecting on.
From a legal perspective, there never was any ambiguity. Canonical "owns"
the Ubuntu trademark. In this important sense, "Ubuntu" means whatever
Canonical says it means. This is hardly new. As just one example, the
Official Ubuntu Book (of which I am an author) was written by
community members but became official because Canonical blessed it. But
despite the fact that they don't need to, Canonical has often consulted
with the community and its governance structures about trademark
licensing policy.
This was also not a case of Canonical not listening to the community.
Canonical employees approached the Ubuntu Community Council
(Ubuntu's highest governance board of which I am a member), listened
carefully to concerns, and responded thoughtfully.
The question was not even about a clash between what Canonical and the
CC thought about the issue. An unambiguous majority of the board,
including all the Canonical employees and several of the community
members, supported the idea of Canonical using the trademark.
The question was one about who gets to make the decisions about the
Ubuntu name and about what role the community and Canonical would each
play. Despite the fact that a majority of the Ubuntu community council
was likely to support the proposed name, the CC was told by Canonical
CEO Mark Shuttleworth that a vote was irrelevant. Canonical made it
clear that decisions about the Ubuntu trademark were simply not in the
CC's purview. The decision on how the name was to be used was something
that Canonical was not willing to delegate to an "outside" (the firm)
governance body. Few businesses would. And although I don't agree with
the decision as a community representative, I might have even made the
same call from Canonical's shoes.
In traditional firms, it's usually pretty clear where the organization's
boundary lies. In FLOSS projects -- and especially in FLOSS project
like Ubuntu who are sponsored in very large part by a single for-profit
company -- boundaries are fuzzier. The conversation about "Ubuntu One"
can be seen as a fight over what "Ubuntu" refers to, and, more
importantly, who gets to answer that question. In deciding whether to
call a service "Ubuntu", a decision is made on what Ubuntu is. Names are
powerful.
Is Ubuntu just a Canonical project? Are Ubuntu's contributors really
just Canonical contributors by proxy? I think the answer to both
questions is "no" but the boundary issues involved are complicated and
under constant negotiation. Every time Canonical uses the Ubuntu name
itself or grants others the ability to do so, these boundary issues
are negotiated, one way or another.
This boundary setting work reveals an important tension that firms
releasing FLOSS must all struggle with. To what extent and in what ways
do communities get to decide what a FLOSS project is and to what
extent do sponsoring firms get to do so? How should projects and firms
do this most effectively? What should we even be optimizing for?
I think that any resulting balance has a huge effect on whether a FLOSS
project is, on one hand, released under a free license but run like any
old corporate project or, on the other, a true "bazaar" style project
where no single firm dominates -- or where they fall on that spectrum.
Names and trademarks are one way that projects define their own
identities and act as an important frontier in this balancing act. As
every firm/project negotiates their own answers to questions of names
and boundaries, there are important implications for the project's
ability to attract volunteers, solicit contributions from other firms,
and more. The confusion around conversations about Ubuntu One shows that
we still have a lot to learn.
Q. What testing is required? Prior to mass producing or distributing any Licensed Product or component that claims compliance with the HDMI Specification (or allowing someone else to do such activities), each Adopter must test a representative sample for HDMI compliance. First, the Adopter must self test as specified in the then-current HDMI Compliance Test Specification. The HDMI Compliance Test Specification provides a suite of testing procedures, and establishes certain minimum requirements specifying how each HDMI Adopter should test Licensed Products for conformance to the HDMI Specification.Now, I can understand that if you buy any old HDMI cable off Ebay for $1, it may be a knock-off that uses the HDMI logo illegally. But there is no way that the certified $50 Philips cable (still very over-priced, but at least not insane, and discounted to $35) performs any differently to some overpriced Monster model certified to exactly the same standard. The thing that annoyed me most was his analogy to buying a tyre. He stated that "if you walked up to a tyre salesman and I said don't want the Pirelli's, just put the cheap-o tires on my Ferrari" I'd be insane, and thus by extension of that logic I was insane for not buying a Monster cable for my great new Tivo. This analogy is completely flawed and really just dishonest. A Ferrari is much more powerful and goes much faster than a standard car. It is plausible it needs a better engineered tyre to perform adequately given the additional stresses it undergoes. A Tivo doesn't put out any more or any less bits than any other HDMI certified equipment, no matter what you do. If the cable is certified as getting all the bits to the other end under whatever environmental conditions specified by the HDMI people, then it's going to work for the 99% of people with normal requirements. Nobody wants to make a significant investment in a piece of audio-visual equipment and feel they are getting something that isn't optimal. Harvey Norman's use of this understandable consumer sentiment to sell ridiculously over-priced cables that do nothing is extremely disappointing. I'm sure the commissions on these things encourage this behaviour, so it is useless expecting the retailer or individual sales assistant to change their policy to reccommend reasonably priced cables. However, it is really Tivo and other manufactuers who get the raw end of this deal; a $130 cable is over 20% of the price the actual Tivo! That is surely affecting people's purchasing decisions. If Tivo and others included a certified HDMI cable with their device, as they do with component cables, and had "Certified HDMI 1.3 cable included" plastered on the box, it would be a harder sell to explain why the manufactuer would bother shipping a certified cable that is supposedly insufficient, and consumers would hopefully avoid the very distasteful high-pressure theatrics I was subjected to today.
I am moving from my old Debian development system to a new one, changing architectures from i386 to amd64. So I need to do a fresh install, but basically I want to keep my package selection.
Conventional wisdom is to use dpkg --get-selections and dpkg --set-selections to preserve the package selection. However, this does not keep the information about automatically installed packages.
Instead, I used
aptitude search '?installed?not(?automatic)' -F %p > packages.txtto dump the packages I installed manually. Installing these was a matter of running:
aptitude install cat packages.txtIn fact this was taking so long that I loaded the packages in batches using
cat packages.txt xargs -n 100 aptitude install --schedule-only; aptitudeWhile I was at it, it ran
aptitude remove '?obsolete'on the original system, killing of a few hundred packages that accumulated since 2003.
I first tried my new headphones in my hotel room and they worked really well at blocking the noise from the nearby road (El Camino Real in Menlo Park) as well as the noise from the heater in my room. At the airport they entirely blocked the sound of the airport air conditioning system (which was surprisingly loud I didn t realise how loud until I tried the headphones).
On the flight the headphones worked really well. I used them for hours when they weren t plugged in to any source, just stopping the noise was a huge benefit. I was also able to listen to music (both MP3s on my laptop and the plane sound system) at a relatively low volume with an apparent high quality. The Bose store I visited in Stanford mall has a sound system set up to emulate the noise you experience inside a jet to demonstrate what the headset can do. It really lives up to this demonstration! I recommend them to anyone who wants over-ear noise canceling headphones and can afford $US300 + tax.
But one thing to note is that not everyone likes such things my wife didn t like the sound that they generate (the least bad way to describe it is as a soft hiss). This is definitely not something you would want to buy based on reviews alone, it must be tested in-store.
The main technical suggestion I can make for improvement to the QC-15 is for it to have slightly softer and thicker padding where it contacts the sides of the wearer s head. I find that my glasses prevent it from making as good contact as I would like, and that when wearing it while eating the contact is significantly broken with every jaw movement which is really annoying. A minor suggestion is that every pair of headphones should have the left and right ear pieces clearly marked, I really shouldn t have to read an instruction manual to discover which way to wear it.
One thing that surprised me was the inclusion of business cards for the headset! Here is a picture:
A new release of Rcpp
awaits inclusion on CRAN and has also
been sent as a .deb to Debian. It will
hit mirrors over the next few days, in the meantime you can get it
here as well.
This release has a couple new features :
cfunction from Oleg Sklyar's excellent
inline package
has been imported and adapted. This means simple C++ programs can be defined in an R character
vector and passed to cfunction which will create a complete file that it then
compiles, links and loads --- giving you access to compiled C++ code right from the R prompt
without having to worry about compiler flags, linker options, ... Better still, we extended
this to not only support Rcpp but
any external library via addtional header / linker arguments that will be passed to R via
the PKG_CPPFLAGS, PKG_CXXFLAGS and PKG_LIBS environment
variables.
RcppSexp for simple int, double or std::string scalars as well as vectors; this is particularly
useful for the inline support.
Widgets are little web applications run on the client side. They re not particularly new and there are a lot of them about, but there s little consistency between them, so they re a bit of a pain to use in practice still.
The good news is that W3C have published Widget Packaging and Configuration W3C Candidate Recommendation which should help to encourage consistency.
The bad news is that Apple has made patent claims about the Widgets 1.0: Access Requests Policy First Public Working Draft. A Patent Advisory Group has been set up, which means that Apple s patents have probably delayed that part of widget standardisation to at least next February.
You may remember that Apple also patent-bombed the Widgets Updates work earlier this year and work has only just resumed after the patent detour.
Two things come to mind:
I've recently gotten myself an Android phone. The Android app market is not as mature as iPhone's App Store, but there is a lot of applications, and plenty of chaff to separate the wheat from. I found most of the apps I use by browsing "top Android apps" lists on the web, so I am putting up a similar list here in case someone finds it useful.
The IANA port allocated for ManageSieve is 4190/tcp, and the old port used by timsieved and other managesieve software in many distros (2000/tcp) is allocated for Cisco SCCP usage, according to the IANA registry.
Starting with the version 4.38 of the Debian netbase package, the sieve service will be moved from port 2000 to port 4190 in the /etc/services file. This affects to those using Debian Squeeze, and Debian Sid. Debian Etch and Debian Lenny users are NOT affected.
Any installs which used the sieve service name instead of a numeric port number will switch to the new port number as soon as the services are restarted/reloaded, and in some cases, immediately after /etc/services is updated.
This will affect Cyrus IMAP. This may also affect other sieve-enabled software such as DoveCot.
In order to avoid downtime problems, mail cluster administrators using Debian are urged to verify their Cyrus (and probably also DoveCot) installs, and take measures to avoid services moving from port 2000/tcp to port 4190/tcp by surprise in either servers or clients.
It is worth noting that:
/etc/services will only be automatically updated if you never made any modifications to it. Otherwise, you will be presented with a prompt by ucf or dpkg asking you about the changes. Henrique de Moraes Holschuh
So a few years ago I got stuck with no health insurance as I had a fellowship that had for its history accepted professors (with health insurance) not fresh off the boat PhDs as was the case with me. Since I was at a Large State school it was nearly impossible for me to get insurance and finally I ended up paying 400 a month and getting a whole lot of headache. In many ways my ordeal was a fluke following a change of policy and this fellowship now provides insurance to its postdocs.
Increasingly, however, it seems like a number of postdoctoral fellowships shirk from their duties and don t provide a drop of health insurance. Given the academic job market, many academics don t have any choice but to accept these positions and if they don t come with insurance, well then these folks are shelling out thousands upon thousands of dollars for basic, really lousy, coverage. Given that universities for the most part have decent, even in some cases kick ass insurance, with a large pool of people, shutting postdocs out of their pool is.. gross and just plain wrong.
One of my fellow friends, currently on the market and currently screwed by her last postdoc wrote up a short document (aka Academic Labor Hall of Shame) and I thought I would post it here as it gets to the heart of the issues and starts shaming some of these shameful universities. If you know of other postdoctoral positions that don t offer insurance, please please leave a comment. We will include it in the hall of shame.
Academic Labor Hall of Shame
Universities like to promote themselves as bastions of enlightenment, but their treatment of temporary and hidden employees is often anything but enlightened. Or progressive. Or fair.
1. Postdoctoral fellows and researchers:
There is a growing trend towards classing postdocs as not employees . I learned this recently when I was laid off from postdoctoral position at the University of Pennsylvania. I planned to extend my health insurance through COBRA, which is currently federally subsidized for workers who lost their jobs during the financial crisis. I was shocked when Penn initially claimed that I was not eligible for the subsidy (made available through the American Recovery and Reinvestment Act of 2009, the so-called stimulus act ). Their reason was that postdocs were not classed by Penn as employees. I appealed this with the Office of General Counsel and after a few weeks was told that I was indeed eligible, as Penn had found an inconsistency in [their] policy for certain categories of post docs between tax treatment and the availability of COBRA/ARRA . This means that while I am in fact eligible for this subsidy, postdocs paid through many other classes of grants are still not.
If you want to see an example of this process of sorting some postdocs into not employee status, here is another one:
So a few years ago I got stuck with no health insurance as I had a fellowship that had for its history accepted professors (with health insurance) not fresh off the boat PhDs as was the case with me. Since I was at a Large State school it was nearly impossible for me to get insurance and finally I ended up paying 400 a month and getting a whole lot of headache. In many ways my ordeal was a fluke following a change of policy and this fellowship now provides insurance to its postdocs.
Increasingly, however, it seems like a number of postdoctoral fellowships shirk from their duties and don t provide a drop of health insurance. Given the academic job market, many academics don t have any choice but to accept these positions and if they don t come with insurance, well then these folks are shelling out thousands upon thousands of dollars for basic, really lousy, coverage. Given that universities for the most part have decent, even in some cases kick ass insurance, with a large pool of people, shutting postdocs out of their pool is.. gross and just plain wrong.
One of my fellow friends, currently on the market and currently screwed by her last postdoc wrote up a short document (aka Academic Labor Hall of Shame) and I thought I would post it here as it gets to the heart of the issues and starts shaming some of these shameful universities. If you know of other postdoctoral positions that don t offer insurance, please please leave a comment. We will include it in the hall of shame.
Academic Labor Hall of Shame
Universities like to promote themselves as bastions of enlightenment, but their treatment of temporary and hidden employees is often anything but enlightened. Or progressive. Or fair.
1. Postdoctoral fellows and researchers:
There is a growing trend towards classing postdocs as not employees . I learned this recently when I was laid off from postdoctoral position at the University of Pennsylvania. I planned to extend my health insurance through COBRA, which is currently federally subsidized for workers who lost their jobs during the financial crisis. I was shocked when Penn initially claimed that I was not eligible for the subsidy (made available through the American Recovery and Reinvestment Act of 2009, the so-called stimulus act ). Their reason was that postdocs were not classed by Penn as employees. I appealed this with the Office of General Counsel and after a few weeks was told that I was indeed eligible, as Penn had found an inconsistency in [their] policy for certain categories of post docs between tax treatment and the availability of COBRA/ARRA . This means that while I am in fact eligible for this subsidy, postdocs paid through many other classes of grants are still not.
If you want to see an example of this process of sorting some postdocs into not employee status, here is another one:
Great, I spent a few hours today to set up a nice OpenVPN server. Nice in that I wanted the (Windows) clients to be able to access the company network like they were connected locally.
My idea was to use the OpenVPN tap mode and let the DHCP server at work assign IPs to the VPN clients.
This turned out to be a dumb idea. After I got everything going, I noticed the following message in syslog (which probably scrolled by previously in the debug drivel):
NOTE: your local LAN uses the extremely common subnet address 192.168.0.x or 192.168.1.x. Be aware that this might create routing conflicts if you connect to the VPN server from public locations such as internet cafes that use the same subnet.Hmm, sure, I guess that will exclude every second incoming VPN connection. Summary: Think about IP space clashes before setting up a VPN.
# vmfs-lvm extent0 extent1 ... extentn remove
This will remove the last extent.
Update: There was a bug when setting some values at volume level. The git snapshot link above has been updated accordingly.
The following is written in German and probably only interesting for people living near D sseldorf. I decided to post this to Planet Debian as it might interest some of you :)
In September, the Debian GRUB maintainers took a step further in the long way of deprecating grub in favour of grub2.
From my personal point of view, grub2 is not the way to go. Mostly because of these reasons:
# apt-get install -t experimental extlinux syslinux-common
# sed -i -e 's ^postinst_hook =.*$ postinst_hook = update-extlinux ' \
-e 's ^postrm_hook =.*$ postrm_hook = update-extlinux ' \
/etc/kernel-img.conf
# mkdir -p /boot/extlinux
# update-extlinux
# extlinux-install DEVICE
Update: Rather than having /etc/kernel-img.conf modified by users, bootloader packages should add symlinks to their update scripts to /etc/kernel/postinst.d and /etc/kernel/postrm.d. Uploaded new version to experimental. Thanks maks for mentioning it.
Next.