My bad. I take it back
Posts made by seconddevil
-
RE: Read/Write windows file metadata
At what point did this place become a f***ing help forum?
-
The try{ throw(...); } catch(...){ log(...); } pattern
Just found this gem in some code:
try { if (!backupDir.mkdir()) { throw new Exception(""); } } catch (Exception e) { logger.error("Could not create backup directory " + backupDir.getAbsolutePath()); }
-
RE: Sun's XPRESS language
That looks very familiar.... oh yeah, it's LISP!
(cond (and (not-null (ref "accounts[Exchange].firstname")) (not-null (ref "accounts[Exchange].lastname"))) (concat (substr (ref "accounts[Exchange].firstname") 0 1) (ref "accounts[Exchange].lastname")))
Making it real (read: valid) CL or Scheme would be trivial too....
-
RE: Behold the power of doing nothing
@Eternal Density said:
@halcyon1234 said:
@Welbog said:
@bstorer said:
<font color="#698d73">Real men use a comma for the thousands separator!</font>
Real men use and as the thousands separator.Real men use scientific notation.
X
Real men use Roman Numerals
Real men use sets
{{{{{{{{{{nil}, nil}, nil}, nil}, nil}, nil}, nil}, nil}, nil}, nil}
-
RE: Error'd - BT News
@Carnildo said:
The Real WTFTM is that they're using a Perl one-liner on a live system.
The real WTF is Microsoft
-
TODO list: Book a hotel room, make a time machine, ...
From this place: http://www.hostelcosmos.com/terms-and-conditions/
-
RE: How to find the smallest number that is evenly divisible by all of the numbers from 1 to 20
@Ren said:
@seconddevil said:
[14]> (find-seq-lcd 1 5)
60
[15]> (find-seq-lcd 4 5)
20
[16]> (find-seq-lcd 4 7)
420
[17]> (find-seq-lcd 1 10)
2520
[18]> (find-seq-lcd 1 20)
15519504Um... are you missing something? 1..10 seems to be right, but something ending with a '4' doesn't seem to be divisible by 20 to me...
You are quite right. I re-wrote it using the built-in lcm and got the right answer (but thats cheating)...
[mossda@localhost:~]$ cat test.lisp
(defun find-seq-lcd (start end)
(loop for m from start to end with r = 1
do (setf r (lcm r m))
finally (return r)))
[mossda@localhost:~]$ clisp -q
[1]> (load "test.lisp")
;; Loading file test.lisp ...
;; Loaded file test.lisp
T
[2]> (find-seq-lcd 1 20)
232792560
[3]> (find-seq-lcd 1 10)
2520
[4]> (time (find-seq-lcd 1 20000))
Real time: 1.609 sec.
Run time: 1.61 sec.
Space: 68659024 Bytes
GC: 126, GC time: 1.206 sec.
487932562728827051853192251818304... (this goes on several thousand digits)... 7411295098112000000
[5]>
-
RE: How to find the smallest number that is evenly divisible by all of the numbers from 1 to 20
Simplest solution I could come up with... (using the power of lisp number types)
(defun find-seq-lcd (start end)
(loop for m from start to end with r = 0
do (setf r (+ r (/ 1 m)))
finally (return (denominator r))))
Examples:[14]> (find-seq-lcd 1 5)
60
[15]> (find-seq-lcd 4 5)
20
[16]> (find-seq-lcd 4 7)
420
[17]> (find-seq-lcd 1 10)
2520
[18]> (find-seq-lcd 1 20)
15519504
-
RE: Recursive javascript security
@KludgeQueen said:
Then they escaped some code, making it virtually indecipherable (LOL); unless, of course, you have to deal with this sort of thing on a daily basis & you've written a handy utility:
WScript.echo(unescape("...")); is a lot easier
-
WTF License plates replaced for crappier ones for free
Honestly some people have no life...
http://www.wxii12.com/news/16699280/detail.html
-
RE: Download delivery methods
@Dalden said:
What other types of delivery methods did they anticipate for a download?
https over avian carrier (http://www.faqs.org/rfcs/rfc2549.html)
-
RE: Firefox 3 version 2.0.0.14
[img]http://imgs.xkcd.com/comics/photoshops.png[/img]
-
RE: In the news - HASH(0xa8081f8)
You were being sarcastic? man, I thought for a second I was the sarcastic one... what a relief!
As for the contribution.... it was meant to be the equivalent of a full stop, but some people just won't let go.
-
RE: My Neighbour, the hacker.
@DOA said:
In case anyone got confused english isn't my native language either. And I live in my own country. The point I'm making is that I'd like to see my copatriots get a clue and learn how to pronounce certain words if for no other reason than to avoid looking stupid in front of foreigners. Tourism is our largest industry after all.
Shit man, you have your own country?!
-
RE: In the news - HASH(0xa8081f8)
@morbiuswilters said:
@seconddevil said:
[dsm@localguest:~]$ perl -e 'my $some = {}; print "$some\n";'
HASH(0x10010f50)
[dsm@localguest:~]$Thank you for posting what we already knew.
Always glad to remove the need for a lengthy and pointless discussion
-
RE: In the news - HASH(0xa8081f8)
[dsm@localguest:~]$ perl -e 'my $some = {}; print "$some\n";' HASH(0x10010f50) [dsm@localguest:~]$
-
RE: Preprocessor mastery
@bitpirate said:
Of course, people who actually know how the preprocessor works can be evil too: (this is from memory, but i've seen it many many times)
#define ITERATE(_type, _array, _size, _code) \
for (unsigned int currentIndex=0;currentIndex<(_size);currentIndex++) \
{ \
_type currentValue = _array[currentIndex]; \
_code \
}[...]
int array[512];
ITERATE(int, array, 512,
printf("[%d] = %d\n", currentIndex, currentValue); /* Imagine this code spanning 50 lines or so */
)Seen that before... can be quite useful when used right. I myself have written a few pseudo-functions just like that (mostly to do math)
-
RE: The oldies are the goodies
I think TRWTF is that they didn't read the Perl FAQ about matching numbers.