Archive for July, 2006
You are now browsing the archive for July in 2006.
I just discussed RTS games with a friend, and for some reason I mentioned Star Wars: Galactic Battlegrounds. He got all rabid about how SW:GB was just a rip-off of Age of Empires II: Age of Kings. Actually, he went so far as to saying that SW:GB was just AoK with other graphics and a new campaign. I’d like to take this chance to tell everyone with similar ideas that this is bullshit.
The misconception is not unwarranted, though. Yes, the two games are very similar in both style and gaming experience. This is because — as most of us already have noticed — SW:GB uses the AoK engine. That is, though, the only similarity. Let’s just look at some of the units.
In SW:GB, the basic ground units are trained in two buildings, the Troop Center and the Mech Factory, depending on whether their purposes were basic or advanced. In AoK, the basic ground units’ training stations were split into three buildings, Barracks, Stable and Archery Range, depending on the units’ basic attributes.
I’m not even going to mention the individual units’, buildings’ and races’ unique properties. I hope this will prevent people from stating such stupid deductions again.
This is the second mission in the Basic Web category. It is a significant step up from the first mission, where only the knowledge of a very basic technique was required. Here, you need to think logically. Let’s approach the problem in the same way as in the previous mission — check the source code. In the relevant code area, which you can find by searching for a string present in the mission paragraph (for instance “Sam”) with Ctrl F, you find only this:
What we see here is a simple HTML form, containing a password field and a submit button. Nothing interesting, that is. The only way we can continue here is by trying out the form and following wherever it leads: Just input some random password, e.g. “test”. You will, probably to your surprise, not be faced by a page saying “incorrect password”, but a page saying:
“Warning: fopen(password.php) [function.fopen]: failed to open stream: No such file or directory in /var/www/hackthissite.org/html/missions/basic/3/index.php on line 35″
First off, this is apparently an unintentional (from Network Security Sam’s point of view) error. Error messages are probably the by far most common security leak, and are often likely to expose vulnerabilities. This error message reveals first that the file is a PHP file (although this could be faked, it is not very likely), and second, more importantly, that there was a file which could not be opened. The mission designers left us a not-so-subtle hint (“However, he neglected to upload the password file”) which tells us what file was not uploaded: the password file.
Now for the logic thinking: Assuming that the password file existed, what happen? Probably, the password that you inputed would be matched with the one in the password file, and if they matched, you would be granted access to the next page. Now if there is no password file, what would the user input be matched with? Yep, you guessed it — nothing. Try just clicking the submit button without touching the password file. Mission complete.
Note that this is why it is very important — from a security perspective — to always check if every function works. In this case, if our dear Network Security Sam would only have taken a few seconds to check if his call to fopen() (a function that opens a file) really opened a file, his script would have been impenetrable.tramadol hcl 1cintoxication acute tramadola1 xanax mylanacetamin tramadolviagra 3.98 orderagcode aan xanaxlevitra 2cialis compare viagraviagra 2cialis levitra sales Map
The first mission in the Basic Web category, also known as the idiot test, is certainly not a very realistic mission. It isn’t supposed to, either — It is supposed to teach you the basics needed to solve these missions. In these situations, you should always begin with looking at the source code. If you are using Firefox (which I definitely recommend), right-click and choose View source. In this level, the solution is actually written there:
Input the password (in this case it is abcd1234, but you should have another one) in the password field and press enter. Congratulations.add student loan consolidationloan ar cash advanceflexible loan adverseloan affordable housingprogram alaska loans studentresidential america loan center$500 day pay loan1000 loans guaranteed Map
This is a Perl script that I wrote in order to finish the first of the “permanent programming” missions on HackThisSite.org. In mission 1 (for some reason the count starts on one and not zero), the objective is to solve some anagrams, which are randomly picked from an open wordlist, within a very short time limit.
The words were given in a list, such as:
- lohtactr
- oigoeb
- ahtmopn
- exairv
- tlydsu
- aroonc
- ldaref
When I copy-pasted it, It showed up as a list with pound signs (#) for every new bullet point. The following simple script quickly converts it to plain text.
my @wrds;
while (<STDIN>) {
chomp;
s/\\#[ \\t]*/,/;
push @wrds;
print;
}
The above example would, if processed by this script, yield:
lohtactr oigoeb ahtmopn exairv tlydsu aroonc ldaref
I just spent about ten minutes navigating Fritz 9 in search for a way to export a game as a PGN file. Since even Google failed me, I figured that I could save some other confused chess players out there some time by posting the way I found. If there is a faster way (which there, in my opinion, should be), please let me know.

If you haven’t done so already, save the game to a database with Ctrl S. Bring up the Fritz database manager with F12 and find your game. If you have a lot of games there, simply use the filtering functions. Right-click on the game that you want to save as a PGN file, and choose Output followed by Selection To Textfile.... Choose your format (RTF, HTML, Text or PGN) and click OK.
It is totally illogical, yet it works. Note that I did this in Fritz 9: There might be a different way in other versions.movie original movie poster posterhome paris hilton moviesparis hiltons porn moviesex movie parismovies phat azzpig movies sexpokemon movie thememovies online porn Map
In TI Basic, there already exists a function for drawing a normal circle, though there is none for drawing a filled circle, a circle in which all pixles are on. There is a fast way of drawing a filled circle with TI Basic, however: Use the Pythagorean theorem to find out where the bounds of the circle are for every x value. For each x value, also draw a line between the top and the bottom.
: 30 -> R
: 45 -> M
: 30 -> N
: ClrDraw
: 0 -> Xmin
: 96 -> Xmax
: 0 -> Ymin
: 64 -> Ymax
: M - R -> X
: While X <= M + R
: sqrt ( R2 - ( X - M ) 2 ) -> A
: Line( X , N + A , X , N - A)
: X + 1 -> X
: End
That’s it. This program draws a circle centered on (M,N) with the radius R.
After I had played around a bit with WordPress, I took a look in the plugin directory. Its size and diversity nearly challenges the humongous Firefox extension database. Since one of my intentions with Timblog is to publish code snipets I write, a particular plugin caught my eye: CodeHighlighter, a plugin that automatically highlighted code syntax in posts using the GeSHi PHP class.
I watched the demo, and without doubting for a second I downloaded the plugin. Easy as pie — I downloaded it, unzipped it, uploaded the folder to /wp-content/plugins/ and went to the Plugins tab to activate it.
The first two attempts, which were very simple worked flawlessly. The code got pretty colours, and the functions were even hyperlinked to their respective perldoc pages. Only thing I missed was line numbering.
When I tried a bit more complexed code, containing regular expressions, on the other hand, CodeHighlighter turned against me. First it refused even rendering the code. The problem was an HTML tag inside one of the regular expressions, which somehow messed things up. Other problems occured after I circumvented that one by changing the Perl code:
- A plus sign mysteriously disappeared from a regular expression:
s/ / / became to s/ //. Problem “solved” by removing that part of the code.
- An uneven, but correct, number of quotation marks in a regular expression caused the GeSHi engine to interpret it as a very long multi-line string. Problem solved by changing the regexp, which incidentally actually made the code more effective.
- Tags in a regular regexp just ruined stuff. Solved by replacing the greater-than and lesser-than signs with wild cards (
.).
- Backslashes were removed. Solved by escaping them, replacing
\ with \\.
Don’t get me wrong — CodeHighlighter is a really good and easy-to-use syntax highlightning plugin, and I recommend it. I just had to mention this since I struggled in well over an hour with it.loan 800 bank9 9 loan payment autofederal 9 direct loanstudent nursing 9 loan13 9 payday quick loan paydaycredit 90 bad day for loanloans bad 90 credit daymortgage loans 97 financing Mapfux pregnant moviesmovies umd pspmovies domain horror publicsapphic schoolgirl moviesscariest moviemovie sexy scenes clipsmovie shemale galleryporn soft movies core Map
LWP is short for libwww-perl, which is a collection of WWW modules for Perl. With LWP you can easily access most web protocols, such as HTTP, HTTPS and FTP. LWP is used in this script in order to retrieve data from an Altavista search. The modules used here are:
- LWP::Simple
- LWP::UserAgent
- HTTP:Response
LWP::Simple is a very basic module of LWP, which supports simple GET commands. LWP::UserAgent creates the user-agent, a simulated web browser. HTTP::Response is used to treat the response you recieve from LWP::Simple.
To search Altavista automatically, LWP gets the URL to which you are forwarded when you enter a keyword in the search form of Altavista. This script uses regular expressions to find the first non-sponsored search result from that URL.
# Include the relevant modules
use LWP::Simple;
use LWP::UserAgent;
use HTTP::Response;
# Print some nice instructions
print "Type string";
# Continually read from standard input
while () {
# Remove the line end (\n, \r or \n\r)
chomp;
# Create the "browser"
my $browser = LWP::UserAgent->new;
# Define the URL. $_ is the chomped and substituted input
my $url = "http://www.altavista.com/web/results?q=" . $_;
# Get the response from the Altavista server
my $response = $browser->get($url);
# Get the content from the response
$_ = $response->content;
# Match the first non-sponsored result with a regular expression
m/a class='res' href='.*?'(.*?)\/a .*?span class=ngrn(.*?)\/span/;
# Get the search result's URL
my $gurl = "http://" . $2;
# Get the search result's title
my $title = $1;
# Print the result!
print "$title \n $gurl \n";
}
Disclaimer: I would never use Altavista manually, because I love Google and everything it does with all of my heart. I first tried this with Google, but I didn’t get it to work. Instead of solving the problem, I just changed to Altavista. My apologies.2 wayne lil ringtone carterfree tone nokia ringtone 6310ialaddin ringtones htmringtone phone download alltelfree ringtone music phone alltelpics amanda harringtonsanyo ringtone 5300 freepolyphonic adam ringtone g Maponline22 levitra 22buymg 10 20 vs mg levitrait acid reflux levitra amerimedrx wetrackb2 c 1 by powered levitradose 1597 1108 levitra171 b b levitra 1191230 20mg levitra 17721920 1333 levitra info Mapamateur porn xxxpornholio amateurcreampies lucysgotlegs gigagalleriesporn movies amateureporn amateurhousewifeamateurpornoporn amateurs vidsamatoriali filmati porno videoporn amatuare Map
There are several ways to calculate primes. Probably, the most efficient one is recursively dividing a number with all primes lower than the number itself. Since no primes are divisible by numbers other than themselves and 1, it would be possible to divide a number with all numbers below it. All numbers are essentially built up of primes, and therefore we can safely skip dividing by numbers which are not primes themselves, speeding up the process significantly.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
| # The array where the primes will be stored
my @primes = (2);
# The maximum number of iterations
my $max = 100;
# The starting iteration
my $i = 2;
# Whether the current loop is to be broken
my $b = 1;
# Start the loop
while ($i < $max) {
# Check for each prime which has already been calculated
foreach $n (@primes) {
# If that prime is not divisible by the the current number..
if (!($i % $n)) {
# ..break the loop
$b = 1;
next;
}
}
# If the loop was supposed to be broken,
if ($b) {
# reset $b
$b = 0;
# If not,
} else {
# add the number to the prime array
push @primes, $i;
}
# Increment $i
$i++;
} |
After the script has been interpreted, the $max first primes will be in the array @primes. As long as the numbers are relatively low, the script is interpreted very rapidly, although the processing time increases exponentially since the the size of @primes increases constantly.ringtones i dterm seriescell dying ringtoneringtones edit and makeelk buggle ringtonelll episode ringtonesfree ringtone polyphonic sony ericssonringtones ericsson w810iezdvd ringtone registryfix Map
« Later Posts —
Earlier Posts »