sketchucation logo sketchucation
    • Login
    1. Home
    2. jessejames
    3. Posts
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    โš ๏ธ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update
    J
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 9
    • Posts 166
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: They say Ruby is slow...

      @dan rathbun said:

      @jessejames said:

      It is really a disservice to all of us that Python is not included in SketchUp. Some will argue...
      @unknownuser said:

      Well the dev team does not have time to support another language
      Thats true, just give us the hooks we need and we will write and maintain the Python API and Python API docs, no need to lift a finger!

      Good News for Jesse ! It's already been DONE. It's called SuPy, and the current version is 1.6, written by a guy named Greg Ewing in New Zealand. Here's the link:
      http://www.cosc.canterbury.ac.nz/greg.ewing/SuPy/

      Since YOU are our resident expert in Python... we appoint you to test it out and give us a report:
      (1) Is it faster? (ie: SU Ruby scripts vs SU Python scripts)
      (2) And can SU Python scripts be compiled?

      Anyone think of anymore evaluation questions?

      Hello Dan,

      Yes i already knew about SuPy because my begging, nagging, and borderline stalking to everyone on planet earth including GvR himself help to bring attention to the Python community of Python's role in SketchUp. I am forever in the service of Greg Ewing for his wonderful work on this module.

      However, this is a Ruby module and not a REAL Python API. Basically Python calls Ruby code, then Ruby calls SketchUp, very inefficient! Therefore it suffers from extreme slow speeds and has to work around the differences between Python and Ruby languages. The intention of this module was to shed light on Python's abilities in the hope Google would then give us the hooks we need for a REAL Python API. I would love for all scripters to have a choice between Python and Ruby, and constantly improve both API's. This would foster even better plugins in the future, sadly though so many of the Ruby guys are so rabidly against it none of the noobs are brave enough to try it.

      posted in Developers' Forum
      J
      jessejames
    • RE: They say Ruby is slow...

      @thomthom said:

      @jessejames said:

      Here are the same tests using Python on a machine with less than half the power of yours!!!

      What is more interesting here is that adding more arithmetic operations doesn't appear to increase the processing time as it does in Ruby. You only see a minor difference in the first test - without any arithmetic operations.

      Is it due to + being a method in ruby? (I don't know how that works in Python)

      I'm not sure how the internals of Python and Ruby compare but i do know that Python is far superior to Ruby in many ways.

      Some of which are learnability, rich documentation (both packaged and 3rd party), amazing introspection abilities, forced indentation (which promotes code readability), syntactic consistency (no Tim Toady), a huge stdlib which includes a built in GUI kit, multi-paradigm object oriented, imperative, and functional (without the perl symbols), very small number of key words (AND the best words where choosen), and of course much faster than Ruby, ...need i say more?

      Actually there exist no better scripting language than Python. Python was built to be a powerful "pseudo code like syntax" programming language that non-programmers can learn very quickly whilst also never disappointing a professional.

      It is really a disservice to all of us that Python is not included in SketchUp. Some will argue...

      @unknownuser said:

      Well the dev team does not have time to support another language

      Thats true, just give us the hooks we need and we will write and maintain the Python API and Python API docs, no need to lift a finger!

      And thats how the Ruby API should be handled too. This would take a major burden off the dev team and result in a much better interface for all of us. It will happen if all you scripters start beating the war drums, instead of just whining that Google doesn't make this or that method. We can make Ruby API exactly how we want to, and who else knows better what WE need?

      Here is a short example of Python introspection and the wonderful help function.

      >>> a = [1,2,3, 1,2,3]
      >>> type(a)
      <type 'list'>
      >>> dir(a)
      ['__add__', '__class__', '__contains__', '__delattr__', '__delitem__', '__delslice__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getslice__', '__gt__', '__hash__', '__iadd__', '__imul__', '__init__', '__iter__', '__le__', '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__reversed__', '__rmul__', '__setattr__', '__setitem__', '__setslice__', '__sizeof__', '__str__', '__subclasshook__', 'append', 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort']
      >>> help(a.count)
      Help on built-in function count;
      
      count(...)
          L.count(value) -> integer -- return number of occurrences of value
      
      >>> a.count(1)
      2
      

      Now what if i want to see my namespace, easy!

      >>> dir()
      ['__builtins__', '__doc__', '__name__', '__package__', 'a']
      

      You can even write your own docstrings for functions, methods, and classes

      >>> def add(x, y);
      	" add(1,2) -> 3"
      	return x+y
      
      >>> add.__doc__
      ' add(1,2) -> 3'
      >>> help(add)
      Help on function add in module __main__;
      
      add(x, y)
          add(1,2) -> 3
      
      >>> add(3,4)
      7
      

      It's the same for classes.

      posted in Developers' Forum
      J
      jessejames
    • RE: They say Ruby is slow...

      @thomthom said:

      Heck even simple addition operation is dead slow... what to do?

      Hi ThomThom,

      I am glad you posted this because i've often wondered how python and ruby compare speedwise, now i have been proven right, again!

      Here are the same tests using Python on a machine with less than half the power of yours!!! AMD Athlon 64X2 Dual Core Processor 4800+ 2.50 GHz
      2.00 GB RAM (but windows Vista consumes half of it!)

      >>> tests = ["t=time.time()\nfor x in xrange(1000000);\n    1.0\nprint time.time()-t",
      "t=time.time()\nfor x in xrange(1000000);\n    1.0+2.0\nprint time.time()-t",
      "t=time.time()\nfor x in xrange(1000000);\n    1.0+2.0+3.0\nprint time.time()-t",
      "t=time.time()\nfor x in xrange(1000000);\n    1.0+2.0+3.0+4.0\nprint time.time()-t",
      "t=time.time()\nfor x in xrange(1000000);\n    1.0+2.0+3.0+4.0+5.0\nprint time.time()-t",]
      >>> for test in tests;
      	exec test
      
      	
      0.0980000495911
      0.12700009346
      0.128000020981
      0.125999927521
      0.12700009346
      
      posted in Developers' Forum
      J
      jessejames
    • RE: HELP setting up a SU code editor

      @driven said:

      Martin, I hope you saw my apology, and perceive it as such. I put your absence down to workload and it hadn't occurred that I may have 'driven' you away... thanks for pointing it out jessejames

      Thanks John for apologizing and i now hold a great respect for you. Anyone can make mistakes, but only the truly honorable have the capacity to admit them. Thank you!

      posted in Developers' Forum
      J
      jessejames
    • RE: HELP setting up a SU code editor

      @unknownuser said:

      I didn't think that YOU (the author of one of the most comprehensive "hey guy's SU codings NOT hard" books proscribed to the FOFO school of teaching and learning

      I hadn't grasped that your, "hey guys, no need to look under the hood" API was devised to slow peoples own programing knowledge.

      I must say I'm rather disappointed in your attitude.

      Yes i must say i am rather disappointed in your low brow attempts to slander Martin. If you don't like the way Martin chooses to teach Ruby scripting, guess what, DONT READ IT!

      You only make yourself look like a vindictive little brat when you make comments like these and i am very upset no one else has called you out on it (mods i'm talking to you!)

      I think Martin takes a wise approach to teaching by allowing the student to take the course that suits them well, not by cramming certain practices down their throats and saying deal with it.

      This whole thread is in my option a waste of time. You need to listen more to Dan Rathburn because he is on the right track.

      @unknownuser said:

      "Google give us the power and we will build the infrastructure".

      posted in Developers' Forum
      J
      jessejames
    • RE: IE9 looking good

      @thomthom said:

      Is that an automatic reply ti anything MS or IE related? Or did you actually look at the stuff they have been posting about IE9?

      Yes it is. After years and years of using anything MS produces i can tell you it's the only reaction i can muster anymore! IE is the worst browser i have ever used. Finally after all these years some genuis at MS said..

      @unknownuser said:

      "well maybe we "should" allow people to remove our crappy software if they don't like it"

      Ya Think?!?!

      I am sick of MS's bloatware and bugs. Windows ships with back doors wide open and i'm sick of it!!!! And what really gives me the culo rojo is their "holier than thou" attitude about software and licensing. Check this link were i give a complete rundown of all the carp software built into windows. And the worse part is YOU CAN"T UNINSTALL IT! ITS BUILT INTO THE DAMN OS!

      @unknownuser said:

      Microsoft has more to answer for for the crap they put in purposly than for the bugs that get in accidentally

      MS == half@sshippocrite
      true

      posted in Developers' Forum
      J
      jessejames
    • RE: IE9 looking good

      @thomthom said:

      IE9 looking good

      ๐Ÿคข

      Sorry Thom Thom i am allergic to BS

      posted in Developers' Forum
      J
      jessejames
    • RE: Only 10,000 so far.

      @remus said:

      Considering each one is done in ~2 mins i think theyre fairly good.

      Well i agree and i don't want anyone thinking i would belittle anyones art. I did honstly find some of them very well drawn, far better than anything i could do. But some are just little more than scribbles and stick figures. If the guy is really serious then i wish him good luck, but the Taco bell drawing club thing just lost it for me.

      posted in Corner Bar
      J
      jessejames
    • RE: Only 10,000 so far.

      Oh crap, this is just a PR stunt to increase traffic on his lamo blog! And some of the sketches are pretty lame too. I only saw one or two that were interesting. You could find better art on any refrigerator in america, usually with the words [font="Comic Sans"]"I Love Mommy"[/font] scribbled across the top!

      Wait you think this thread is funny, go to his blog and look for this link

      @unknownuser said:

      Taco Bell Drawing Club

      ๐Ÿคฃ

      posted in Corner Bar
      J
      jessejames
    • RE: Idea: show console on script error

      @tig said:

      
      > begin
      >   ### do all of your code here
      >   ###
      >   ##
      >   #
      > rescue Exception => e
      >   Sketchup.send_action("showRubyPanel;")
      >   puts e.message
      > end
      > 
      

      Great idea TIG!

      posted in Developers' Forum
      J
      jessejames
    • RE: Does "C" equal "C" ?

      @ Todd ๐Ÿ˜ณ it seems that you are actually replying to ThomThom and not Jim and in that context your comment makes sense. The way you quoted it it looked like you where replying to Jim directly so looks like i am the boob here!

      <<<<<<<<<<<<<|;-)

      posted in Developers' Forum
      J
      jessejames
    • RE: View.draw(GL_POINTS, points) - point size?

      @thomthom said:

      How on earth does one control the size of the point?

      in OpenGL it's as simple as

      glPointSize(5.0)
      

      but of course that may not help in the Ruby API world?

      posted in Developers' Forum
      J
      jessejames
    • RE: Does "C" equal "C" ?

      @unknownuser said:

      @jim said:

      Everyone's done it. Yesterday I wrote this as an example:
      def = Sketchup.active_model.selection[0].definition

      def is a reserved word.

      WOW, good catch Todd, will you provided your eagle eye services to debug some of my code? ๐Ÿคฃ

      PS: i hope your rates are "reasonable" ๐Ÿ˜•

      posted in Developers' Forum
      J
      jessejames
    • Idea: show console on script error

      Hello,

      I think it would be a great idea to show the ruby console anytime a script throws an error. Now before the lemming "protectors" start their wailing and gnashing of teeth, yes we should have a menu item in SketchUp like... "Show Console on Script Error" (minimized of course). Or maybe a Ruby command would be a better idea -- keep the "lemmings" from taking the proverbial "swan-dive to hell"

      ๐Ÿ˜‰

      posted in Developers' Forum
      J
      jessejames
    • RE: How to move a group?

      @mcdull said:

      i want to move a selected group,and select the group with the code

       model = Sketchup.active_model
      >       entities = model.entities
      >    selectgroup = model.selection
      >    select_entity = selectgroup[0]
      

      how to move it to other location?

      You are really creating more alias than you need. Actually you could do this script with just one line. If your never going to call an alias more than once why waste the CPU cycles?

      
      Sketchup.active_model.selection[0].transform!(Geom;;Transformation.translation([0,0,50]))
      

      ...but you may want to popup a dialog if the user forgot to select something or the selected "something" is not a group or component, or you may want the user to input an amount to move etc..! The script rolling is left as an exercise for the reader ๐Ÿ˜‰

      posted in Developers' Forum
      J
      jessejames
    • RE: Bankers and Bonuses

      @unknownuser said:

      For many generations we've endured a rapidly increasing density of hot, non-flammable and otherwise inert gas (like CO2); and unless we do something about all the politicians producing it, we're doomed.

      ...The only thing worse than organized religion is organized politics!

      posted in Corner Bar
      J
      jessejames
    • RE: Clear the Ruby Console with Win32 API?

      @thomthom said:

      So this means SU caches ALL the text? it doesn't append to the existing text, to completely rewrites it?? No wonder that thing is slow!

      The Ruby console "As Is" needs to die a torturous and horrible death, and in its place, a new multi-line console "shining prince" (not IO! ๐Ÿ˜‰ ) would herald in the new era of scripting bliss!

      posted in Developers' Forum
      J
      jessejames
    • RE: By value or by reference?

      @thomthom said:

      When passing arguments from a method to another in Ruby, is that by value or by reference?

      Oh Lord, this very same question caused a major flame war to arrupt on c.l.python the other day, are you sure you want to ask this question?!? ๐Ÿ˜‰

      posted in Developers' Forum
      J
      jessejames
    • RE: Double Standards by Apple?

      @solo said:

      I live down the road from a Baptist church/campus (It's like a christian theme park complete with Starbucks, clothing and bookstores, restaurants etc, which happens to be down the road from a Hooters. On sundays at midday you cannot get a seat at Hooters as it's full of baptists "breaking bread" after church. ๐Ÿ˜’

      The Hypocrisy of Christians knows no bounds! I can say that because i was raised as a fire and brimstone baptist racisist hate monger myself! -- thank God intelligence stepped in and i now think for myself and believe in true freedoms for all!

      If i had a choice (when i was a young lad) between boobs[1] and death match games ,well i would take both and a double dose on Sundays, these are things that are interesting to boys. And for crying out loud how else you gonna learn? ๐Ÿ˜ฒ And to those "self proclained" "mother of the year" types; NEWS FLASH! your little "Johnny" is into far more than you could ever imagine! ๐Ÿ˜ฎ

      Q: Whats next, forcing scantily clad women with big hooters to wear tighter bras so no one see's a jiggle. The women that complain about this are the very same pig nose gossip hounds who are just jealous because their "flap-jacks" are not as perky!

      I can you tell you guys that sometimes a little "jiggle" can make a mans "bad day" into a "wonderful day". I know there is a God, not because some book tells me so or because some sleazy preacher wearing three thousand dollar suits and gold rings on every finger playing into the greed and vainity of gullible "sheeple" spouting "lusty descriptors" like "pearly gates" and "streets paved with gold", but because of all the god **** beautiful T&A i see on a daily basis!!! Thank God for double D's!

      [1]of course i'm not referring to explicit pron, i'm referring to the wobble boobs

      posted in Corner Bar
      J
      jessejames
    • RE: Video textures possible in SketchUp

      @stuartb said:

      Just thinking . . between this and AdamB's lighting plugin . . its all looking quite exciting! but you really have to wonder what on earth the 'official Skoogle Development Team' are beavering away on? More style builders?

      I just "happend" upon this thread today. Yes it IS 2010 after all and it seems sadly that Skoogle Dev Team is still pumping out style templates but not much else. Here is the range of emotions that pretty much describe what i felt after reading this thread...

      ๐Ÿ˜† ๐Ÿ˜ฎ ๐Ÿ˜ฒ ๐Ÿ˜• ๐Ÿ‘Š ๐Ÿ˜ž ๐Ÿ˜ข ๐Ÿ˜ณ ๐Ÿ˜’ ๐Ÿคข

      posted in Developers' Forum
      J
      jessejames
    • 1 / 1