Journal Journal: fb down?
seems that there's a bit of an outage. happening for you as well?
seems that there's a bit of an outage. happening for you as well?
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);
New JonesBlog update. Lockheed Martin C-5M Super Galaxy
I want a linky to an unredacted copy. Anyone have it?
You need to go to a strip club to get over the trauma. And while you're there, just remember that the hand that brings you your drink is the same hand that jacks you off in the back room - the efficient, invisible hand of Ayn Rand!
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!
Yo, Tom Hudson, I'm real happy for you and I'ma let you finish, but Breitbart is the greatest troll of all TIME!
New JonesBlog update. Louisville, Kentucky
We are starting out on a new collaboration on retinal research. Fun stuff.
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.
Gay bashing, assault, theft and kidnapping is not funny, but don't they look like Bert and Ernie ?
I'll never empty my list of freaks. First of all because Pudge is on there, and for him to un-freak me would require him to change his mind.
But of far more interest than that is my former brother-in-law. I hadn't forgotten that he showed up here when his crazy assed sister left me. Hadn't thought about him in a while. Was looking around some pages and saw his name on my freaks list. Then I remembered he was 'an hero'. And I laughed. I hope it hurt. It probably did, because for it to have been painless it would require him to do something right for once in his miserable life.
Cowardly chickenshit.
Jonesblog has finally made the transition to modern underpinnings. It is now running on Wordpress... Huzzah.
Living on Earth may be expensive, but it includes an annual free trip around the Sun.