Author Topic: ( Challenge ) Just curious  (Read 8698 times)

0 Members and 1 Guest are viewing this topic.

LE

  • Guest
Re: ( Challenge ) Just curious
« Reply #75 on: December 04, 2006, 03:54:23 PM »

Evgeniy;

Это - способ сказать на английском языке, что Вы очень шикарны


Luis, you do not cease to surprise me!
You know Russian? (I do not trust, that the previous message has been translated by the program)

 :-)

I know few words now... I asked my nephew to do the translation for me...

Didge

  • Bull Frog
  • Posts: 211
Re: ( Challenge ) Just curious
« Reply #76 on: December 06, 2006, 02:32:26 AM »
I'm no "Master" either, this little snippet averaged 1.06 seconds on my home PC.
If I wasn't so lazy I would've combined the two functions into something a touch more efficient.

Surprisingly this same code took 1.28 seconds on an identically spec'd PC.

Code: [Select]
(defun c:MIN-MAX (/ IN-FILE OUT-FILE LST)
  (setq IN-FILE (open (getfiled "Select Source File" "" "csv" 0) "r")
       OUT-FILE (open (getfiled "Save Results to"    "" "csv" 1) "w")
          START (getvar "DATE"))
  (while (setq LINE (read-line IN-FILE))
    (setq LST (strlst-intlst (csv-2-list "," LINE)))
    (write-line (strcat (rtos (apply 'min LST)) " " (rtos (apply 'max LST))) OUT-FILE)
  )
  (close IN-FILE)
  (close OUT-FILE)
  (princ (strcat "\nElapsed time: " (rtos (* 86400.0 (- (getvar "date") START)) 2 2) " secs."))
)
(defun CSV-2-LIST (delim str1 / x)
  (if (atom str1)(setq x delim)(setq x (cadr str1) str1 (car str1)))
  (while (not (eq str1 (setq str1 (vl-string-subst "\" \"" x str1)))))
  (setq STR (read (strcat "(\"" str1 "\")")))
)
(defun STRLST-INTLST (lst / )
  (setq return (list))
  (foreach STR LST
    (setq return (append return (list (atof STR))))
  )
)
Think Slow......

Cathy

  • Bull Frog
  • Posts: 251
Re: ( Challenge ) Just curious
« Reply #77 on: December 06, 2006, 04:48:36 PM »
Well the last time I posted a collaborative project I was accused of using this forum and the members knowledge as a way of getting my work done, which of course I would never do. Being accused of that hurt my feelings, to say the least.

Mark, I am so sorry!  I certainly never meant to be mean, malicious, or to hurt your feelings when I mentioned Tom Sawyer in that thread.  I should know by this time that I should never try to be humorous. 

I had actually intended on participating in that project, but then suddenly things got busy here and I didn't have the time.  I have certainly enjoyed the recent challenges though, and appreciate your doing them. 

Please accept my apology.   

Mark

  • Custom Title
  • Seagull
  • Posts: 28685
Re: ( Challenge ) Just curious
« Reply #78 on: December 06, 2006, 05:20:13 PM »
Well the last time I posted a collaborative project I was accused of using this forum and the members knowledge as a way of getting my work done, which of course I would never do. Being accused of that hurt my feelings, to say the least.

Mark, I am so sorry!  I certainly never meant to be mean, malicious, or to hurt your feelings when I mentioned Tom Sawyer in that thread.  I should know by this time that I should never try to be humorous. 

I had actually intended on participating in that project, but then suddenly things got busy here and I didn't have the time.  I have certainly enjoyed the recent challenges though, and appreciate your doing them. 

Please accept my apology.   

Apology accepted.

Thanks Cathy, I feel all warm and cozy now. :-)
TheSwamp.org  (serving the CAD community since 2003)