Journal Journal: PyCon 2011 4
I am in Atlanta for PyCon, and you're on Slashdot reading about it. So there. Neener neener neener.
I am in Atlanta for PyCon, and you're on Slashdot reading about it. So there. Neener neener neener.
So Libya has cut itself off from the net. This isn't an entirely unexpected move. But it has the side effect of screwing over anyone with a
But somehow I just can't find it in me to feel any sympathy for them. At the time they launched, I pointed out that they were putting themselves at the mercy of the Libyan government. But it seems they preferred the two digit
Maybe it'll act as a warning to those who have jumped on the
Here are six files for ya, showing a problem in 3 different scripting languages. What will they do?
--------- test1.php:
<?php
require 'test2.php';
define('SOMECONSTANT','hello world');
function foo() {
return SOMECONSTANT;
}
echo foo(); echo "\n";
--------- test2.php:
<?php
require_once 'test1.php';
echo foo(); echo "\n";
--------- test1.py:
#!/usr/bin/python
import test2
SOMECONSTANT='hello world'
def foo():
return SOMECONSTANT
print foo()
--------- test2.py:
#!/usr/bin/python
import test1
print test1.foo()
--------- test1.rb:
#!/usr/bin/ruby
require 'test2.rb'
SOMECONSTANT='hello world'
def foo
SOMECONSTANT
end
puts foo()
--------- test2.rb:
#!/usr/bin/ruby
require 'test1.rb'
puts foo()
---------
Ok, scriptfiends, predict the output of these three commands:
php -q -f test1.php
python test1.py
ruby test1.rb
and then do some pasting and try it out. Match your predictions?
The PHP one bit me pretty hard today.
I have a password written on a post-it note underneath my keyboard. Decades went by without this ever having happened, but now I have one of these. [rationalize]And I'm keeping the post-it, because it'll probably be months or years before I ever need that password again, so there's just no chance I'll be able to remember it (it's actually a pretty well-made password).[/rationalize] OTOH, I suppose I could just throw it away and then the next time I need it, ask someone for it again. [truth]But no, it amuses me that I've entered the ranks of people with passwords on post-its at their desks, so I'm keeping it, for that reason if nothing else.[/truth]
Maybe not, but if you "set > workspace/job.properties" and pass your Job Path in to jmeter as a property, you can read the damn things back out with a beanshell sampler later on. Handy for grabbing variables from your Hudson parameterized build. Just don't forget to define JobPath as ${__P(JobPath,)} in your user defined variables.
import java.io.BufferedReader;
String response = "";
try {
BufferedReader in = new BufferedReader(new FileReader("${JobPath}/workspace/job.properties"));
String nextLine = in.readLine();
while(null != nextLine) {
String[] keyval = nextLine.split("=");
if (2 == keyval.length) {
vars.put(keyval[0],${__eval(keyval[1])});
}
response = response + nextLine + "\n";
nextLine = in.readLine();
}
} catch (java.io.FileNotFoundException e) {
response = "Unable to locate properties file for environment; using defaults.";
}
SampleResult.setResponseData(response);
I just received mail notification that a fellow user has bought me a gift subscription to slashdot. I'm already friends/fans with the person but his email address isn't visible so I can't thank the person off-/. (wimp, change your privacy settings and deal with the spam!
Not sure what I did to deserve it, but I thank you!
If you want ruby mode to do syntax highlighting, make sure to have (global-font-lock-mode 1) before you load the ruby mode library. This will save much misery.
It's what we were all hoping for, and I'm pleased that it's come to pass. It's not perfect, and I don't agree with all of their decisions. However, even an imperfect alternative to the current H.264 situation is a massive improvement. I'm pleased they've gone for a full stack solution of not only VP8 but also Matroska(-ish) and Vorbis, too. If nothing else, it's likely to mean that a) Vorbis will be shipped by default on most platforms[1], and b) hardware support for both VP8 and Vorbis should be widespread in the very near future. Further, there's a commitment to transcode all of the existing videos on YouTube. That's a massive endorsement. Of course, the risk with that is the reduced quality that will come from three or more lossy transforms, but given that they've announced it, they're clearly not too concerned about that. The future's looking very bright indeed.
[1] Or will it? I've yet to see any official response from Microsoft or Apple on this. But it's going to be hard for them to ship something that won't play YouTube videos by default. Of course, in the short and probably medium term, YouTube will continue to offer videos in other formats as well. But we'll see how it plays out in the long term.
Also interesting to see the stats on when their systems were delivered to McLaren and Brawn, and where the performance of those cars was afterwards. I know there's more to F1 than CFD, but it certainly plays a large part these days.
Short Flash vid...
http://en.tackfilm.se/?id=1273610622233RA56
Any program which runs right is obsolete.