Author Topic: -={ Challenge }=- Subst at n  (Read 7279 times)

0 Members and 1 Guest are viewing this topic.

VovKa

  • Water Moccasin
  • Posts: 1631
  • Ukraine
Re: -={ Challenge }=- Subst at n
« Reply #30 on: March 29, 2010, 11:47:34 AM »
just to complete the picture :)
Code: [Select]
(defun SubstNth (n item lst / arr)
  (vlax-safearray-put-element
    (vlax-safearray-fill
      (setq arr (vlax-make-safearray vlax-vbInteger (cons 0 (1- (length lst)))))
      lst
    )
    n
    item
  )
  (vlax-safearray->list arr)
)
don't benchmark it :(

JohnK

  • Administrator
  • Seagull
  • Posts: 10640
Re: -={ Challenge }=- Subst at n
« Reply #31 on: March 29, 2010, 11:51:13 AM »
* Se7en giving Visual Studio a try.

Oh my goodness?! Ok, so i cant just compile a file by opening it up in the VS IDE and hitting "compile" so i started to "build a project". ...You've got to be kidding me?! This thing is crazy!  And you guys think that Vim/Mingw is complicated?!

;p

It was a parody / lampoon post anyway, direct element access is fundamental to arrays in C, C++, VB, Python ...
Yeah i know but it too was greek to me and i wanted to check it out. :)
array[nu] = blah.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: -={ Challenge }=- Subst at n
« Reply #32 on: March 29, 2010, 11:51:41 AM »
Awesome VovKa. I had thought of that one to be honest but the fact it would be challenging to deal with heterogeneous data stopped me. Glad you posted one regardless.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

LE3

  • Guest
Re: -={ Challenge }=- Subst at n
« Reply #33 on: March 29, 2010, 11:55:39 AM »
In any of these challenges, do we've known who or which of the proposals has won? or do we just end up uploading all the possible options, for future reference? and decide which one is the best to fit the current needs, can we or who will judge them? or can we simple open a topic to place/write a function to do some specific task? and this can end being like a library reference - it is challenge the proper wording?

And yes I like these type of topics.

Sorry folks, got to ask, hope you won't mind, thanks.

The winner is the body of knowledge that the swamp represents. I'm not interested in anything else, in particular nonsense like "Person A's submission is better than Person B's". That's the fastest way to have people stop posting their ideas or deleting posts when "better" solutions are posted. Sometimes we bench performance, and that's cool, because performance itself is only one of many things that constitutes a good algorithm. </opinion>

so Mike, to clear up my English class 102, challenge is not a competition? or I am way off/away of the tree? if that it is well, something was lost on the translation :)

JohnK

  • Administrator
  • Seagull
  • Posts: 10640
Re: -={ Challenge }=- Subst at n
« Reply #34 on: March 29, 2010, 12:03:46 PM »
LE3, When i posted the first "challenge" i choose the word because of of its many meanings. -i.e.(that is to say) "Challenge" as more of a "challenge the brain" meaning and/or a fun (not for real) task. 
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: -={ Challenge }=- Subst at n
« Reply #35 on: March 29, 2010, 12:05:54 PM »
so Michael, to clear up my English class 102, challenge is not a competition?

You asked who the winner was, I answered you.

The challenge is whether one can pen a solution the problem, not whether Bob is better than Bill.

</opinion>

:)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

nivuahc

  • Guest
Re: -={ Challenge }=- Subst at n
« Reply #36 on: March 29, 2010, 12:06:35 PM »
In any of these challenges, do we've known who or which of the proposals has won? or do we just end up uploading all the possible options, for future reference? and decide which one is the best to fit the current needs, can we or who will judge them? or can we simple open a topic to place/write a function to do some specific task? and this can end being like a library reference - it is challenge the proper wording?

And yes I like these type of topics.

Sorry folks, got to ask, hope you won't mind, thanks.

The winner is the body of knowledge that the swamp represents. I'm not interested in anything else, in particular nonsense like "Person A's submission is better than Person B's". That's the fastest way to have people stop posting their ideas or deleting posts when "better" solutions are posted. Sometimes we bench performance, and that's cool, because performance itself is only one of many things that constitutes a good algorithm. </opinion>

so Mike, to clear up my English class 102, challenge is not a competition? or I am way off/away of the tree? if that it is well, something was lost on the translation :)

The "winner" is anyone who walks away from the challenge having learned something. Like me. I don't participate in the challenges themselves, but I read every one of them with great interest.

LE3

  • Guest
Re: -={ Challenge }=- Subst at n
« Reply #37 on: March 29, 2010, 12:10:20 PM »
got it - thanks.

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: -={ Challenge }=- Subst at n
« Reply #38 on: March 29, 2010, 01:10:36 PM »
The "winner" is anyone who walks away from the challenge having learned something. Like me. I don't participate in the challenges themselves, but I read every one of them with great interest.

Hooray, I also winner!   :-D

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: -={ Challenge }=- Subst at n
« Reply #39 on: March 29, 2010, 01:37:53 PM »
Hooray, I also winner!  :-D

says one of the swamp's best teachers
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: -={ Challenge }=- Subst at n
« Reply #40 on: March 29, 2010, 02:04:02 PM »
In that sense I have been a winner many times because of your solutions Evgeniy  :-)

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: -={ Challenge }=- Subst at n
« Reply #41 on: March 29, 2010, 04:24:53 PM »
In that sense I have been a winner many times because of your solutions Evgeniy  :-)
x2
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

JohnK

  • Administrator
  • Seagull
  • Posts: 10640
Re: -={ Challenge }=- Subst at n
« Reply #42 on: March 29, 2010, 05:15:17 PM »
Ok, now i'm just waiting for Greg and the "Group hug" post.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org