home | narrative | services | contact | blog | (646) 515-5825 | info@critical-masses.com
I work on Windows, and produce Python kits for various projects. Of course one of the kits is a source kit, as a .tar.gz. Python's distutils does a fine job of this, but it uses the native system command to tar up the files, and this means my tar files are from Windows.
The problem is that Windows doesn't know how to make tar files that look native on Unix: the permission bits aren't right, they come out as 0700:
drwx------ batcheln/100 0 2010-08-21 14:13 coverage-3.4b1/The tar command let me set the mode bits in a command-line switch, which means I could set them in an environment variable, but that would make all the files have the same permission bits, and directories and files should be different.
To fix this problem, I wrote a distutils extension command. It turned out to be not difficult, distutils has good extensibility.
To make a new command, create a new package directory somewhere, I called my "distcmd". To make a command called "fixtar", you you derive a class from distutils.core.Command, name it fixtar, and put it in a file called fixtar.py. You have to provide three methods:
from distutils.core import CommandThe initialize_options and finalize_options methods are required. It's too bad distutils didn't allow them to be omitted in cases like mine where there are no options to specify. The run() method is the interesting one, that's where all the work will happen. In mine, I read the tar file distutils made, and I create a new tar file just like it, but with the permissions and owner info that I want:
def run(self):To invoke my new command, I have to tell setup.py to pull it in with the --command-packages=distcmd switch. Then I can simply use "fixtar" as a command on the line just like any other:
python setup.py --command-packages=distcmd sdist --keep-temp --formats=gztar fixtarNow I get a tar file that looks right:
drwxr-xr-x ned/coverage 0 2010-09-04 19:44 coverage-3.4b2/There's a bit more complication to it, because of the --keep-temp switch that I needed to keep the original tarred files around so they could be re-tarred. The real fixtar.py also cleans up that directory.
This was more than I wanted to do to get the right permissions in a tar file, but it was a chance to see how distutils extensions work, and it lets me make all my kits in one place.
Ned BatchelderMAT, which stands for Memory Analyzer Tool, is a fast and feature-rich Java heap analyzer that helps you find memory leaks and reduce memory consumption.
The project got integrated into the release train with Helios and comes with great features. I will highlight one of them, which is pretty useful in debug/development mode. I’m talking about the ability to acquire Heap Dump directly inside MAT.
In effect, this way requires that the process is still running. It is a debug/development use case. You still need dumps on OutOfMemoryError for production environment. You can find some information on the way to do that on the MAT wiki.
To learn more things about MAT, I recommend you to follow the MAT webinar which happens on September 8th.
Continue reading Palm puts webOS 2.0 SDK into limited release starting today
Palm puts webOS 2.0 SDK into limited release starting today originally appeared on Engadget on Tue, 31 Aug 2010 14:00:00 EST. Please see our terms for use of feeds.
Permalink | Email this | CommentsJoshua Topolsky00241996685294250995I read Michael Lewis’ The Big Short: Inside the Doomsday Machine months ago, and have been feeling guilty about not recommending it, because this material is sort of essential for anyone who would like to understand how our economy ended up in the toilet. Read on, not just for a (spoiler: positive) review, but for potentially time- and money-saving advice.
Sidebar: Michael LewisI should disclose that I’m a hopeless Michael Lewis fan; in my review of Moneyball I wrote “I suspect there may not be a greater living writer of reportorial non-fiction” and yes, I still suspect that. So you could either use my admitted bias to discount this review, or alternately join the club and next time you see a Lewis book in the airport bookstore, just grab it.
Sidebar: Maybe Don’t Read the BookThe book has its roots in a November 2008 piece in Portfolio magazine, The End. I’m not actually sure that the book is a better piece of work than the (much shorter) essay; and I am pretty sure that all the really important lessons of the book are there in The End.
Now if you enjoy Lewis’ narrative of this frankly-incredible-even-though-we-all-watched-it-happen story, you probably want to get the book, just because there’s room for more narrative and the rest is mostly just as good.
But considered as a work of the non-fiction writer’s art, I’d have to favor the shorter version for its ruthless focus and pace.
The StoryIt’s simple enough; Lewis found individuals and partnerships (three in the book, one in the essay) who decided the mortgage bubble was bullshit far before most others did, and made gobs of money betting it would pop, and he walks us through their experience. Most of their time doing this was pretty stressful, because a lot of apparently-smart people were betting against them every step of the way and taking home millions doing so. Even when it all fell apart and they got paid it was stressful, because they understood the scale of the disaster before anyone else.
Anyhow, they’re interesting people, the financial tools used both for inflating the bubble and betting against it are interesting too, and Lewis can tell a story with the best of them. Unless you’re oblivious to recent economic history, you’ll like it.
Lesson 1It’s one we should have learned already, long ago: The business of Finance is 100% about making big money for people in the business of Finance. Everything else is irrelevant. The party line is that it’s about routing capital from those who have it to those who need it in a maximally-efficient market-driven way. Hah hah hah.
There’s another legend that it’s about making money for investors. Double hah hah hah. If you’re an investor, it’s about them making bets with your money and if they lose you lose, if they win you get a few scraps and they get a bigger vacation home.
This really should not be surprising. There is apparently no social or ethical force that will cause people to bypass a chance to shovel money into their own pockets, without regard for catastrophic costs to their fellow-humans no matter how predictable. This needs to be an axiom in the thinking of all future regulatory planners.
Lesson 2Of all the failures that led to the big meltdown, the most aggravating is the failure of the bond-rating agencies. These people took good money for pasting AAA credit ratings on piles of the most implausible shit imaginable, and what’s irritating isn’t that they did it, it’s that apparently they didn’t break any laws and thus there’s little prospect of the long prison terms that anything smelling of natural justice would require.
If you shared my blank, astonished “how could that happen?” reaction, you’ll probably enjoy Roger Lowenstein’s Triple-A Failure, published in April 2008 in the New York Times.
Once again, not surprising: having debt ratings paid for by the people issuing debt creates a huge conflict of interest, and per Lesson 1, any such conflicts will be taken advantage of by Finance insiders to fleece the sheep otherwise known as you and me.
Lesson 3Finance’s relationship to the economy should best be considered by policymakers as that of a dangerous parasite to its host. Any benefits offered at the margin by its market-making functions are dwarfed by the existential threats it is empirically observed to pose, on a regular basis, to the proper functioning of the real economy.
An earlier draft had the word “real” in the previous sentence enclosed in quotes. I took them away, because it really is real, as opposed to Finance which, on the evidence, is the mostly-toxic product of pure imagination, imagination fevered by a lethal illness that the rest of us are in danger of catching.
I’d say Finance should be regulated into utility status all over the civilized world, and if the community of hard-core financial engineers really wants to go on being a collective pathogen, they’ll be forced to acknowledge that what they do just isn’t civilized behavior, and do it somewhere else. We’ll be way better off without them among us.
Kyle Brandt, a system administrator, asks Should Developers have Access to Production?
A question that comes up again and again in web development companies is:
"Should the developers have access to the production environment, and if they do, to what extent?"
My view on this is that as a whole they should have limited access to production. A little disclaimer before I attempt to justify this view is that this standpoint is in no way based on the perceived quality or attitude of the developers -- so please don't take it this way.
This is a tricky one for me to answer, because, well, I'm a developer. More specifically, I'm one of the developers Kyle is referring to. How do I know that? Because Kyle works for our company, Stack Overflow Internet Services Incorporated©®™. And Kyle is a great system administrator. How do I know that? Two reasons:
From my perspective, the whole point of the company is to talk about what we're doing. Getting things done is important, of course, but we have to stop occasionally to write up what we're doing, how we're doing it, and why we're even doing it in the first place -- including all our doubts and misgivings and concerns. If we don't, we're cheating ourselves, and you guys, out of something much deeper. Yes, writing about what we're doing and explaining it to the community helps us focus. It lets our peers give us feedback. But most importantly of all, it lets anyone have the opportunity to learn from our many, many mistakes … and who knows, perhaps even the occasional success.
That's basically the entire philosophy behind our Stack Exchange Q&A network, too. Let's all talk about this stuff in public, so that we can teach each other how to get better at whatever the heck it is we love to do.
(Sometimes I get the feeling this idea makes my co-founder nervous, which I continually struggle to understand. If we don't walk the walk, why are we even doing this? But I digress.)
The saga of System Administrators versus Programmers is not a new one; I don't think I've ever worked at any company where these two factions weren't continually battling with each other in some form. It's truly an epic struggle, but to understand it, you have to appreciate that both System Administrators and Programmers have different, and perhaps complementary, supernatural powers.
Programmers are like vampires. They're frequently up all night, paler than death itself, and generally afraid of being exposed to daylight. Oh yes, and they tend think of themselves (or at least their code) as immortal.
System Administrators are like werewolves. They may look outwardly ordinary, but are incredibly strong, mostly invulnerable to stuff that would kill regular people -- and prone to strange transformations during a moon "outage".
Let me be very clear that just as Kyle respects programmers, I have a deep respect for system administrators:
Although there is certainly some crossover, we believe that the programming community and the IT/sysadmin community are different beasts. Just because you're a hotshot programmer doesn't mean you have mastered networking and server configuration. And I've met a few sysadmins who could script circles around my code. That's why Server Fault gets its own domain, user profiles, and reputation system.
Different "beasts" indeed.
Anyway, if you're looking for a one size fits all answer to the question of how much access programmers should have to production environments, I'm sorry, I can't give you one. Every company is different, every team is different. I know, it's a sucky answer, but it depends.
However, as anyone who has watched the latest season of True Blood (or, God help us all, the Twilight Eclipse movie) can attest, there are ways for vampires and werewolves to work together. In a healthy team, everyone feels their abilities are being used and not squandered.
On our team, we're all fair-to-middling sysadmins. But there are a million things to do, and having a professional sysadmin means we can focus on the programming while the networking, hardware, and operational stuff gets a whole lot more TLC and far better (read: non-hacky) processes put in place. We're happy to refocus our efforts on what we're expert at, and let Kyle put his skills to work in areas that he's expert at. Now, that said, we don't want to cede full access to the production servers -- but there's a happy middle ground where our access becomes infrequent and minor over time, except in the hopefully rare event of an all hands on deck emergency.
The art of managing vampires and werewolves, I think, is to ensure that they spend their time not fighting amongst themselves, but instead, using those supernatural powers together to achieve a common goal they could not otherwise. In my experience, when programmers and system administrators fight, it's because they're bored. You haven't given them a sufficiently daunting task, one that requires the full combined use of their unique skills to achieve.
Remember, it's not vampires versus werewolves. It's vampires and werewolves.
[advertisement] JIRA Studio - SVN hosting, issue tracking, CI and Google Apps integration. Free trial »
(author unknown)13345519443336942279054495843877525615870591347365873228225704789780218355940157103300030384966378671667545755742622521903911420922383773120061575019810698619630496223524196460909709169809340965372499110424438708058564631720295927381757364209047600930574429815112554872001671708601241160506215811766415599552031804552073159710037071734432930623236970833604934317788135283534745309068276887873606537051274847597774819326910065689251771835886182136322037469030450749141204501697859707197838708203143828029280293025352988770501397612889676772215784045441835069158064650544651970639630042320503005318183708690838890501961878079648010130037786300270003891842945584508915834275668816438059244293389274689781154854662758131139909672041804595895303153985914893534125241583160307057638539403566572875710457118055590628626691732020584567357366249917902587239214294730682033566227243161922180817441402330350937309250466072926724282174521723845679361910459149314368916461110440489522814240470156880410285435052500409156360606579224018023438169920072713112429386897083146501586132108417340191610365744210337260297009644210150436147410444495911601343346600606760471676690516025859887196610230881108575079185030029212739052642024080619183611263934748274940812822188111481838617598174124210320466154935050743706619850295661303121876381002312042911823059098142080629319191311311824919089162414330508079598114896223548146052545730596353851207778696849211367210401255636016345539129945879749058352820845973546279416610212701376001804235794026814134226889397851132096370970992977313698421821838533989011707411986540192751619717314227262659418221096189467971546116047839158262729371806310384309777949007132639796973331865020768849783689785721285859230603858174201135089225884630042053714077557464119790394204119047963778701014446539998601099145666816816852791660178033222270656862205262567316137078845151421051558671679441116729532977400280613079015803360268902109722061571571504190013385711859771772412337431559872980393URL shorteners are the bane of the internet. However, for those of us who use Twitter on a regular basis, you know that 140 characters can be limiting. URLs can theoretically be 2,000 characters or more, but most are in the 40 to 80 character range. That's almost half your tweet! So we use URL shorteners to not only shorten the URLs, but (in the case of some services like Bit.ly) to track clicks and get statistics about who clicked on these short URLs.
The problem, however, with the popular URL services is that the more that they are used, the longer their URLs get. Both Bit.ly and Tiny.cc are up to 6 characters in their autogenerated URL paths. Add in the URL protocol (http://), the hostname (bit.ly) and the initial slash, and you've got minimum 20 character URLs.
So why use someone else's short URL service, when you can create your own, branded, shorter short URL service with URLs like lb.cm/a or jen.cm/j? A branded URL shortener can also be a sign of prestige or add a layer of trust. For instance, Flickr's URL shortener, flic.kr only links to Flickr photos. When you click on a flic.kr URL, you know what you're going to get. Google has a similar service with goo.gl and WordPress has recently launched wp.me. Even if you open it up for the public to use, as we have with lb.cm, there's just a certain geek prestige in having your own URL shortener.
Why Drupal?So why use Drupal as a URL shortener? There are several single-purpose stand-alone Open Source URL shorteners out there already. And Drupal is sometimes criticized as being big and slow. URL shorteners need to be small and fast. On the other hand, we're not really expecting bit.ly-level traffic here, are we? Maybe we can consider Drupal.
jeffEver since I saw tomatoes growing in a greenhouse that had a suspension system to hoist them up, I’ve wanted to do something like that. I’ve also been wanting to make a structure using Starplate connectors. This year the two ideas came together to create a tomato suspension dome.
The structure The kitThe Starplate kit is just 11 metal plates that accept 2-by-3s or 2-by-4s on edge, like so:
I used 8-foot 2-by-3s. Around the edge of the pentagonal base I planted peas, pole beans, and morning glories. Inside, it was all tomatoes and basil. Although I used indeterminate vines, they didn’t reach as high as I’d imagined. So I never had to climb a ladder to pick tomatoes.
The big question in my mind was how to hoist the tomatoes. I ended up putting eyehooks into the upper struts, spaced about 18″ apart, and running string through them to form concentric pentagons descending from the peak. Then I could toss the weighted end of a string up and over to make a pulley anywhere in the enclosure.
SuspensionHere’s the suspension method:
It entails:
Every couple of weeks, as the vines grew, I’d detach the collar, raise it up, reattach, and hoist.
OutcomesThe peas and beans did OK, but were happier in other parts of the garden. The tomatoes rocked. I’m not ambitious enough to do any real canning, but here’s one happy outcome: 6 quarts of fresh salsa and a couple of gallons of juice infused with jalapenos, serranos, and poblanos.
Another outcome: oven-dried tomatoes. These are just like sun-dried except they only take 12 hours in the oven at 200 instead of days in the sun.
The salsa was a ton of work but oven drying is dead easy. I’ve got a lot more tomatoes still to come, and this the future for many of them.
Next yearThings to do differently:
Probably not. If you’ve ever been bitten by the dome bug, it’s just something you have to get out of your system sooner or later. Domes are preposterous structures, really, as Stewart Brand pointed out hilariously in How buildings learn. There’s a reason why we build rectangularly: You can use standard materials, you can expand outward, you can use interior space efficiently. Domes create big structures from small amounts of material, but they’re not very practical structures. There are surely easier ways to hoist tomatoes. Still, it’s been fun!
When conference organizers count people, the number they care about most is registered paying attendees; they track that every day as the conference approaches. Suppose you are an outsider, considering attending or sponsoring or exhibiting at the conference, and you inquire as to the likely attendance. You will never be given the real number; instead you will be told a number which is at least twice that, and usually higher. This is justified by including trade-show exhibitors’ staff, the conference organizer’s own people, PR folk and journalists, the food service crew, and is basically pulled out of a monkey’s butt. Just thought you’d like to know.
I get so many question on how to extend Notes 8 that I finally decided to create a series of blog posts on how to do it. All the posts in the series may be found under the extending_notes8 tag. In all of the examples I assume a working knowledge of Eclipse and Java programming and how to work with extension points.
For this first post I'll touch on one of my favorite features of Notes 8 that is MyWidgets and LiveText. From the user interface you may create a number of widget types (web, Notes etc.) that act on selected text but what if you wanted to perform an action that didn't lend itself to one of these widget types? What if you wanted to couple text selection to a Java action? Well look no further. In this post I'll show you how to combine the org.eclipse.ui.popupMenus extension point with a org.eclipse.jface.text.ITextSelection object contribution to do what is transparently done using MyWidgets.
Let me preface this by saying that it's still far easier to do this using MyWidgets but still this isn't rocket science.
To accomplish this task you'll need two pieces. First of you need the code to execute. This is done using an action class that implements org.eclipse.ui.IObjectActionDelegate. This means you need to implement three methods:
The run-method isn't as interesting as it just performs the action. The method is called in the UI thread. The selectionChanged-method is more fun as this is where you extract the selected text. Below is a snippet of code on how to do it.
public void selectionChanged(IAction action, ISelection selection) { StructuredSelection sel = (StructuredSelection)selection; try { IAdapterManager amgr = Platform.getAdapterManager(); Object obj1 = sel.getFirstElement(); Object obj2 = amgr.getAdapter(obj1, ITextSelection.class); if (obj2 instanceof org.eclipse.jface.text.ITextSelection) { ITextSelection txtSelection = (ITextSelection)obj2; this.selection = txtSelection.getText(); } } catch (Throwable t) { this.selection = null; } }
The second piece to the puzzle is to tell the platform when you would like your action to be listed ie. when select is selected. This is done in the plugin.xml using the org.eclipse.ui.popupMenus extension point and by doing an object contribution as shown below. The italic text (the id's and the action label) may be changed to your liking. The bold/italic text is the class name of your action which should be changed to match your action class.
<?xml version="1.0" encoding="UTF-8"?> <?eclipse version="3.4"?> <plugin> <extension point="org.eclipse.ui.popupMenus"> <objectContribution id="com.lekkimworld.textsel.objectContribution1" objectClass="org.eclipse.jface.text.ITextSelection"> <action class="com.lekkimworld.textsel.SelectionAction" enablesFor="*" id="com.lekkimworld.textsel.action1" label="Perform action from selected text"> </action> </objectContribution> </extension> </plugin>
The next post (which will be published tomorrow) will show you how to act upon LiveText that is couple your Java action to text that the Notes client recognizes and highlights for you. Stay tuned...
(author unknown)As with many facets of Drupal, and coding in general, there are multiple ways to accomplish the same task. A good exmple of this was with the recent additions to the Lullabot team. The expanded team brought together three skilled developers and an amazing designer each with their own methods of site building. On one side we have Jerad Bitner and myself, who for the past few years have been building sites exclusively with Panels module. On the other side we have James Sansbury and Jared Ponchot who also build beautiful sites using the more recent Context module.
Our first collaboration was the redesign of Lullabot.com, since this project was initially designed and scoped by James and Jared, the decision to use Context module was already in place. I was in no rush to learn Context, when I knew the same result could be achieved with Panels. Lucky for me James and Jared are both excellent resources for answering questions and giving great examples. Now that the project is complete I have a better understanding of Context module. This article is intended to identify the similarities, differences, pros and cons of using each module to build a Drupal website.
daveWe launched three new Stack Exchange sites this week!
We’ll have three more for you next week, too.
Need to hire a really great programmer? Want a job that doesn't drive you crazy? Visit the Joel on Software Job Board: Great software jobs, great people.
Joel Spolsky1408879050626390430106405729912562463760098177979502426685210581455473148430343903801761260999623005030276774808047905490020795170090824043211877129783530419051035772812907621228681678916573994447203917072657407905682479076992409743403153550344909058573806303110373899759076777721084396694657995141400269596067416318895416716557904205785744003337139735612256111462137315376507677312062102046146266200045898479825849149830609167081937334632512749119725897205467023271954997522281300370435170520915948018221096189467971546052447507238517468440065185516264837899711202780556576183488112772420570333416210548074017483505458717222735332394573116075676011876763333500123388775544362399502516243541824287120093947138659904455481294752560287223933600923267311484067730123374315598729803931166448845922923998013742359704896557530115667897002645250620989878931173629617013251790576554864262183172319674823220351131669497072589421405555732295665518113169413040697063191751008784134274218275918439447457438969707018163609559946098750724560964993263844315641278962218785911
Then, you will be told how to import the EMF-related OSGi bundles into a new NetBeans Platform application. As a next step, you will create a new module and copy the classes generated by Eclipse (e.g., the Supplier and Product classes, together with their supporting classes) into the new module. Finally, you'll create a second module where the suppliers and products will be created and displayed:
That tutorial will, in the end, provide full instructions on a very common need—the need of EMF models to be handled within Swing applications. With NetBeans Platform 6.9, that process is now seamless. It's as easy to import an OSGi bundle as it is to import any other JAR file, while Equinox integration into NetBeans Platform applications ensures that the OSGi framework checks all the dependencies between the bundles when the application starts up. Currently I have all the dependencies correctly set up, the above application now deploys without a single problem message being generated by Equinox. Pretty cool.
In other news. If you understand German, take a look at Michael Müller's new review of Heiko Böck's NetBeans Platform 6.
(author unknown)Many may not know this but you can optimize your install kits prior to deploying the new Notes 8.5 client. Check out the Domino Administrator help for how to use the addToKit tool to have Eclipse features and plug-ins automatically installed when the product is installed. This is a great way to deploy plug-ins without using things like Widgets or Composite Applications which would require the end user to restart the Notes process.
Flightglobal's Tree of Communication explains how a digital publisher reports news and shows how facts, opinion and analysis can be communicated through the modern web.
Yahoo! Pipes is a web application that provides users with the opportunity to create their own data mashups and RSS feeds that aggregate the web pages, feeds and services of their choice, eg Flickr images, blog posts and latest stories are collated into one RSS feed.
The user can "pipe" these feeds to create something appropriate for their own purposes eg adding it to their Facebook profile page thereby sharing this information with their friends.