My bad. I take it back
S
seconddevil
@seconddevil
0
Reputation
25
Posts
206
Profile views
0
Followers
0
Following
Best posts made by seconddevil
This user hasn't posted anything yet.
Latest 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]>