2010-11-30

svn: local edit, incoming delete upon update

http://stackoverflow.com/users/369203/xah-lee
http://groups.google.com/group/ergoemacs/browse_frm/thread/e798dcbb9cd9e3b6

when i do a “svn status .”, i get this:

! C auto-complete-config.elc
> local edit, incoming delete upon update
! + C auto-complete.elc
> local edit, incoming delete upon update
! + C popup.elc
> local edit, incoming delete upon update
! + C fuzzy.elc
> local edit, incoming delete upon update


basically, these files shouldn't be in the repository. A developer has removed them. Then, i think i did a “svn rm ...” after the fact by mistake (should've done “svn update .” instead).

So now, when i do “svn status .”, i get these tree conflict messages.

I found the doc here http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-conflicts.html
but not sure how to “merge” it according to the doc.

how to get rid of them?

i think my working copy is in sync with the repository. Don't know why these messages shows. These files should be removed and are removed as far as i know everywhere. I tried “svn update .” and “svn revert .” but i still get this message when i do “svn status .”.

------------------------


On Nov 30, 3:57 pm, David Capello wrote:
> Hi Xah, maybe you can do
>
> svn revert auto-complete-config.elc
> svn revert auto-complete.elc
> svn revert popup.elc
> svn revert fuzzy.elc
>
> inside the auto-complete directory. And
> then svn update

i tried
svn revert .
before but that didn't work. Haven't tried revert on each file.

someone on stackoverflow
http://stackoverflow.com/questions/4317973/svn-how-to-resolve-local-edit-incoming-delete-upon-update-message
suggested this:

svn resolve --accept working

but that didn't work for me neither. I think maybe i did some combination of “svn rm” or delete the file in my working copy manually or something that screwed up the tree data.

in the end i just deleted the parent dir and did a update. That solves it. A simple solution i haven't thought of before.

thanks David.

Xah

unix date util in emacs shell problem

http://stackoverflow.com/questions/4313914/problem-with-unix-date-util-running-in-emacs-shell

here's a oddity.

on Cygwin bash on Windows Vista, i can get date like this:

$ date
2010-11-30 4:40:48 AM PST

xah@xah-PC ~
$ date +%s
1291120855

but in emacs “shell”, running the same date command, i get this:

c:\Users\xah\web\xahlee_org\comp>which date
which date
/usr/bin/date

c:\Users\xah\web\xahlee_org\comp>date
date
The current date is: 2010-11-30
Enter the new date: (yy-mm-dd)


c:\Users\xah\web\xahlee_org\comp>date +%s
date +%s
The system cannot accept the date entered.
Enter the new date: (yy-mm-dd)

any idea what's going on?

2010-11-23

new ergonomic keyboards

On Nov 23, 10:33 pm, Xah Lee wrote:
> i'm sorry to say, but when i read almost anything by programers about
> keyboarding, keybinding, in the past 10 years, 99% of them are purely
> idiotic to the extreme. I used harsh terms because the more i studied
> keyboard and all related issues, the more i see how extremely idiotic
> these opinions are.
>
> Here's some examples:
>
> • best way to avoid rsi is never to learn touch type. (expressed by
> Stephan Monnier (emacs maintainer), as well as keyboard maestro's
> author.)
>
> • the swapping of Caps Lock and Ctrl on a normal standard keyboard is
> good idea. Expressed by many.
>
> • emacs's keybinding is efficient.
>
> for 70 articles on Keyboards, Layouts, Hotkeys, Macros, RSI, typing
> habits, see:
>  http://xahlee.org/Periodic_dosage_dir/keyboarding.html
>
>  Xah

was quickly written, but forgot some more points. More examples with my answers:

• best way to avoid rsi is never to learn touch type. (expressed by Stephan Monnier (emacs maintainer), as well as keyboard maestro's author.)

the opinion by Stephan can be seen on comp.emacs sometimes in 2010 i think.

the one expressed by keyboard maestro's author Peter N Lewis is at http://xahlee.blogspot.com/2010/08/left-wrist-motion-pain-vi-esc-syndrome.html

and this opinion can sometimes be seen elsewhere on forums.

• the swapping of Caps Lock and Ctrl on a normal standard keyboard is
good idea. Expressed by many.

See 〈Why You Should Not Swap Caps Lock With Control〉 http://xahlee.org/emacs/swap_CapsLock_Ctrl.html

• emacs's keybinding is efficient.

See: 〈Why Emacs's Keyboard Shortcuts Are Painful〉 http://xahlee.org/emacs/emacs_kb_shortcuts_pain.html

• Happy Hacker keyboard is a fantastic keyboard. (expressed by many, in particular Shawn Sabbets, author of ratpoison (a Linux tool that arranges all your windows without gaps))

See 〈The Idiocy of Hacker Keyboards〉 http://xahlee.org/emacs/keyboards_hacker_idiocy.html

• «I'm a programer. I never use the F1 F2 etc keys, and find those Media keys or extra app launching keys stupid.» This is seen often on programer forums or keyboard review sites such as amazon.

for 70 articles on Keyboards, Layouts, Hotkeys, Macros, RSI, typing
habits, see:
http://xahlee.org/Periodic_dosage_dir/keyboarding.html

PS i think Stephen, Peter, Shawn are great coders, but just that some of their opinions on keyboard i find falling into common myth.

programer will be recalcitrant on their opinions about keyboard, because they'd say “i use it all my life!”. Yet, typically they never spend a hour to look into the actual field of keyboarding issues or field of study of ergonomics.

This situation is similar to for example pro mathematicians will admadantly claim some math notation issues, or love of TeX/LaTeX, like, “i should know because i work with it all my life”, yet their opinion being completely idiotic.

also similar, is lots of programers, who, over the years in their career, inevitably came to know several langs. So, they'll have bunch of extremely idiotic opinions on language design, syntax, and software engineering, terminologies, semantics. They'll be loud about it. Yet, they really don't know much of any of these fields as a dedicated study. e.g. they have never taken a day in their lifes, to actually study a article, or issue, about a syntax design as a subject by itself. Typically, what they've done instead, is like: «perl is like this, or lisp is like this, or i know Haskell this and OCaml that way, i've coded in them for 10 years, and i've taken a class about parsing in college, therefore, it should be X, i tell you!».

I LOL

Xah

2010-11-16

emacs define-mode-abbrev oddity?

http://groups.google.com/group/gnu.emacs.help/browse_frm/thread/f32a510414508935#

On Nov 16, 6:54 am, harven wrote:
> Xah Lee writes:
> > this is a odd thing.
>
> > when in emacs-lisp-mode, and when you define a abbrev (e.g. call
> > define-mode-abbrev then “ah” then “add-hook”), then call write-abbrev-
> > file
>
> > then you get this in your abbrev file (e.g. at 〔~/.emacs.d/
> > abbrev_defs〕)
>
> > (define-abbrev-table 'lisp-mode-abbrev-table '(
> >     ("ah" "add-hook" nil 0)
> > ))
>
> > note that it's lisp-mode-abbrev-table not emacs-lisp-mode-abbrev-
> > table.
>
> > Why's that?
>
> > (if you change it to the latter, it won't work.)
>
> > i'm wondering because i want the abbrev to be for emacs-lisp-mode
> > only, not general lisp mode.
> > It appears that emacs-lisp-mode is defined on top of lisp-mode. Ok, so
> > my question is, what's the purpose of lisp-mode? Is that supposed to
> > be the base for other lisp lang modes to be defined on top of? A look
> > at scheme-mode seems to confirm this, but still, i want my abbrev for
> > emacs lisp mode only. Is that possible?
>
> > thanks.
>
> >  Xah ∑http://xahlee.org/☄
>
> I would try the following in .emacs
>
> (define-abbrev-table 'emacs-lisp-mode-abbrev-table '(
>   ("ah" "add-hook" nil 0)))
>
> (add-hook 'emacs-lisp-mode-hook (lambda()
>          (setq abbrev-mode t)
>          (setq local-abbrev-table emacs-lisp-mode-abbrev-table)))

thanks. Interesting solution.

Before i redefine my stuff, i did some more testing on my original question.

i tried to go to scheme-mode and apparantly the abbrev does not work, but only in emacs-lisp-mode.

if i'm in scheme-mode and i call define-mode-abbrev, it generate this code:

(define-abbrev-table 'scheme-mode-abbrev-table
'(
("ttt" "hhh" nil 0)
))

So, my question is probably caused by unnecessarily looking under the hood.

> I think that the nil argument after add-hook is deprecated in emacs ≥ 23.

any reference you have on this? thanks.

Xah ∑ http://xahlee.org/ ☄

emacs macro, use of keys

2010-11-16

http://xahlee.org/emacs/emacs_macro_example.html
http://groups.google.com/group/comp.emacs/browse_frm/thread/b144ac63476bbd2a#

On Nov 16, 8:20 pm, des...@verizon.net wrote:
> Xah Lee writes:
> > new article on emacs keyboard macro as well as elisp code.
> > Command Name       Key
> > start-kbd-macro     Ctrl+x (
> > end-kbd-macro       Ctrl+x )
> > call-last-kbd-macro         Ctrl+x e
> > apply-macro-to-region-lines        
> > Saving Your Keyboard Macro for Future Use
>
> Nice article.
>
> I use keyboard macros a lot and usually apply them to many lines.
>
> I could never see how the binding C-x e is sufficient.
> It's way too hard to type 5, 10, or 100 times.
>
> I know it can be repeated with a count but still sometimes I want
> to move around and apply it to various lines or words.
>
> So, I use this keybinding:
>
> (define-key global-map [(S-f19)] 'call-last-kbd-macro);; Shifted PgUp Key
>
> This converts the Page Up key in the 6 key group above the arrow keys
> into a repeat macro key.
>
> All my bindings for the PgUp key:
>
> (define-key global-map [(f19)] 'repeat-complex-command)
> (define-key global-map [(S-f19)] 'call-last-kbd-macro)
> (define-key minibuffer-local-map [(f19)] 'previous-history-element)
> (define-key minibuffer-local-map [(shift f19)] 'next-history-element)

nice and interesting.

i didn't know that PageUp key is also f19 in emacs?
A quick search in elisp manual doesn't seem to find it. Any pointer?

i have never used “repeat-complex-command” myself.

for me, the page up/down keys are used more for things related to moving by chunk.

Ctrl+PageUp = previous-user-buffer
Ctrl+PageDn = next-user-buffer

Hyper+PageUp = search-pagebreak-prev
Hyper+PageDn = search-pagebreak-next

(the search-pagebreak-prev is pretty much emacs's backward-page, but backward-page's got a problem in that it doesn't do so if the formfeed char ^L is part of a comment, sometimes required because the lang take ^L as syntax error)

other my combo with Page key are pretty standard:

Shift+PageUp = scroll-down with selection.
Alt+PageUp = scroll-other-window-down

same for Down...

for extra function keys, i use the keys on the number pad, either system-wide or within emacs.

e.g.

+ = switch to last app
- = next song
Shift+- = last song
1 = describe-char
4 = ispell-word
0 = lookup-word-definition
Ctrl+0 = lookup-wikipedia
. = xah-browse-url-at-point

many of these functions are personally defined ones or in ErgoEmacs.

for system-wide, it's either defined in AutoHotkey or IntelliType, and sometimes app dependent.
The f1 to f12 are all used up. They pretty much are one-key press to switch to a particular app. e.g. emacs is f6, Firefox is f7, Google Chrome is f4, IE is f9, PowerShell is f10...

Xah

2010-11-08

3d description language

2010-11-08

Xah wrote:
> i've been wondering about that. Specifically, for my needs, i really
> need a lang like povray that lets me program (say in python) to
> generate the povray sphere box lighting etc positions and sizes, to
> generate a picture. Usually for math illustration purposes.
>
> • 〈Illustrating Geometry with POV-Ray〉http://xahlee.org/3d/illus_geometry.html
>
> however, for my need i don't really need realism rendering alone with
> its waiting for the picture.
>
> also, i really want real-time viewing and animation than static
> images. (see  http://xahlee.org/3d/viz.html)
>
> so, in past few years, i've been somewhat looking. Am pretty sure
> these days Blender or perhaps others has scripting that that really
> does what i need much better that POV-Ray. That is, a language that
> describe geometry primitives that can be rendered, but i don't really
> need fancy rendering like ray-tracing, but more or less just
> projection and dynamic interaction....
>
> for example, let's say i have a sphere of radius 1 at position {2,3,4}
> and  a box of side length 1 ot {2.5,2, 2}. Then, suppose my camera
> (view point) is at {-1,3,2} looking in the direction of origin.

namekuseijin wrote:
> yes, but you can't "code" in those with the same ease as with pov's
> SDL.
>
> in povray SDL:
>
> sphere { 1 <2,3,4> }
> box { -1,1 translate <2.5,2,> }
> camera { location <-1,3,2> look_at 0 }
> // some light, will ya?
> ligh_source { <1,1,-1>*10 1 }
>
> in python using Blender API:
>
> cam = bpy.data.scenes[0].camera
> cam.location = (-1,2,3)
>
> that just adjusts the current scene camera location to your desired
> location.  I don't even know how to do the rest, like even locking its
> focus to the origin, let alone adding the primitives... if the log in
> 2.55 is of any use, the operation to add a sphere is:
>
> bpy.ops.mesh.primitive_uv_sphere_add(segments=32, rings=16, size=1,
> view_align=False, enter_editmode=False, location=(-1.35352, -2.99709,
> 0), rotation=(0, 0, 0), layer=(True, False, False, False, False,
> False, False, False, False, False, False, False, False, False, False,
> False, False, False, False, False))
>
> sucks, huh?  Blender is a wonderful tool for artists, not much for
> programmers or math-types.

humm...

maybe it's time to ask stackoverflow for a definitive answer about this.

i find it hard to believe there's no lang that describe 3D primitives.

actually, there's Mathematica
• 〈Introduction To Mathematica's 3D Graphics Format〉
http://xahlee.org/3d/mma.html

and there's a LOT for 2D (svn, flash, there's a js lib i recently learned but forgot the name).

for 3D, there's google's
http://code.google.com/p/o3d/

which is very promising, but i haven't spent time on yet.

but i was really hoping in Blender too... given its status, i think it's trivial to create a primitive descriptive lang similar to POV-Ray, and my guess is that it's already there...

> > My question is, those who blender experience, whether blender could
> > practically be used like POV-Ray since i don't really need POV-Ray's
> > rendering but need all the blender's interactivity etc features.
>
> if you need interactivity, you don't need scripting with python
> either.  Just use the menus and options.  That's the way to use
> Blender, since its geared at artists.
>
> here's my best attempt ever at something artistic with Blender:
>
> http://blenderartists.org/forum/showthread.php/190197-Stereo-Fruits

the best i've done is a cube. lol.

btw, do you know how to in POV-Ray to make the rendering outline only? e.g. like those of technical drawing. i.e. similar to showing just wireframe, but taking out all the wires only showing the object edge, and also hide internal or other parts that's can't be seen.

Xah ∑ http://xahlee.org/ ☄



On Nov 9, 1:36 am, namekuseijin wrote:
> On Nov 8, 11:54 pm, Xah Lee wrote:
>
> > about Blender not able to take a scene description file for creating
> > simple geometric objects, i'm still not sure. There's also the .obj
> > file, and recently collada file format, and vrml, and possibly there's
> > import utility that takes pov files. So, it's likely one can just use
> > python to create objects in these files. Also, besides Blender,
> > there's quite a few other free 3D modelers... am sure one of them can
> > do it.
>
> > ... also, Second Life is about to support importing mesh using collada
> > format.
>
> > am sure that for someone working in this area... there's easy route to
> > create 3D scenes by using python or any lang to generate a file of
> > highlevel dsecription 3d primitives similar to pov's format, then just
>
> hmm, .obj and collada are file formats for raw meshes.  That means you
> would use python to generate meshes vertex by vertex.  In that case,
> even a stupid call like:
>
> bpy.ops.mesh.primitive_uv_sphere_add(segments=32, rings=16, size=1,
> view_align=False, enter_editmode=False, location=(-1.35352, -2.99709,
> 0), rotation=(0, 0, 0), layer=(True, False, False, False, False,
> False, False, False, False, False, False, False, False, False, False,
> False, False, False, False, False))
>
> is higher level than that...
>
> I still very much prefer sphere { location radius }, though...
>
> you could certainly hid it away like:
>
> def sphere( loc=(0,0,0), radius = 1 ):
>     return bpy.ops.mesh.primitive_uv_sphere_add(segments=32, rings=16,
> size=radius*2,
> view_align=False, enter_editmode=False, location=loc, rotation=(0, 0,
> 0), layer=(True, False, False, False, False,False, False, False,
> False, False, False, False, False, False, False,
> False, False, False, False, False))
>
> and for the other primitives as well...

yes. but the point is it is trivial to write a functions to generate primitives as vertexes.

so, you can write

def sphere(center, radius, meshdensity) = {...}

On Nov 9, 1:36 am, namekuseijin wrote:
> On Nov 8, 11:54 pm, Xah Lee wrote:
>
> > about Blender not able to take a scene description file for creating
> > simple geometric objects, i'm still not sure. There's also the .obj
> > file, and recently collada file format, and vrml, and possibly there's
> > import utility that takes pov files. So, it's likely one can just use
> > python to create objects in these files. Also, besides Blender,
> > there's quite a few other free 3D modelers... am sure one of them can
> > do it.
>
> > ... also, Second Life is about to support importing mesh using collada
> > format.
>
> > am sure that for someone working in this area... there's easy route to
> > create 3D scenes by using python or any lang to generate a file of
> > highlevel dsecription 3d primitives similar to pov's format, then just
>
> hmm, .obj and collada are file formats for raw meshes.  That means you
> would use python to generate meshes vertex by vertex.  In that case,
> even a stupid call like:
>
> bpy.ops.mesh.primitive_uv_sphere_add(segments=32, rings=16, size=1,
> view_align=False, enter_editmode=False, location=(-1.35352, -2.99709,
> 0), rotation=(0, 0, 0), layer=(True, False, False, False, False,
> False, False, False, False, False, False, False, False, False, False,
> False, False, False, False, False))
>
> is higher level than that...
>
> I still very much prefer sphere { location radius }, though...
>
> you could certainly hid it away like:
>
> def sphere( loc=(0,0,0), radius = 1 ):
>     return bpy.ops.mesh.primitive_uv_sphere_add(segments=32, rings=16,
> size=radius*2,
> view_align=False, enter_editmode=False, location=loc, rotation=(0, 0,
> 0), layer=(True, False, False, False, False,False, False, False,
> False, False, False, False, False, False, False,
> False, False, False, False, False))
>
> and for the other primitives as well...

yes. but the point is it is trivial to write a function to generate primitives as vertexes.

so, you can write

def sphere(center, radius, meshdensity) = {...}

def rectangle(center, sideLength1, sideLength2,sideLength3, meshdesity) = {...}

def cone(vertex, height, orientation, angle) = {...}

def parametricSurface(formula, uRange, vRange, steps) = {...}

etc. trivially.

Then, you create your scene by calling these functions. Then, they print to a mesh format file. Then, call another app or using the 3D modeler's scripting lang to import this .obj or collada file into the 3D modeler, then you have it.

all this can be done easily... perhaps with AutoHotkey so one doesn't even need to use the mouse.

Xah


On Nov 9, 12:50 pm, namekuseijin wrote:
> On 9 nov, 18:06, Xah Lee wrote:
>
> > On Nov 8, 11:49 am, namekuseijin wrote:
>
> > > there are some very tricky tricks to do that, like this:
>
> > >http://tuabiht.chez-alice.fr/PovEdge_Site/PovEdge.html
>
> > wrote a article about this.
>
> > • 〈Outline Rendering of 3D Models (POV-Ray)〉http://xahlee.org/3d/outline_rendering.html
>
> "I think the fact POV-Ray cannot do it is just a particular historical
> or idiosyncratic reason."
>
> it's like I said before:  povray uses true math primitives as
> described by math equations.  There are no edges or faces to compute
> or hide:  just math surfaces that are either intersected or not by
> light rays (line segments).  All raytracers do it that way, but some
> specialize only in coarse and limited mesh-based geometry.  Povray
> supports meshes, though, which is why PovEdge works:  everything in
> PovEdge scenes is made out of meshes, even spheres or cubes, and thus
> the povedge macro can calculate edges and such needed info.

the fact POV-Ray use math equations as opposed to meshes to represent its 3d primitives doesn't matter. Again, it's just how POV-Ray came to be, it's particular idiosyncracy, its feature set, data structure and algorithm choices, implementation decisions. Doesnt matter what modeling tech a 3d app uses, may it be math equation or polygons or nurbs or other variations. The goal is to render the output image using uniform color for all visible surface. (aka outline rendering; cartoon style)

btw, Second Life can do it, and i think isn't the Zelda on Nintendo Cube done in a cartoon style? (thin it was around 2004?) so, clearly the technology to render 3d modeles as outline (flat cartoon illustrations) in real time is already a solved problem. Having just wrote that, i think any 3D field pro can simply tell us how to do it.

> > do u have a real name namejuseijin? makes people more comfortable
> > citing you.
>
> Namekuseijin At Gmail Dot Com
>
> :)
>
> shouldn't we be doing this by mail?  I'm sure Lispers are not
> amused...

they are certainly amused. All this can be done in lisp. And, isn't there some 3d modeler using lisp? there's autolisp... :) and the famous SICP book uses algorithmic art as one of its main subject in i think chapter 2.

the 3d modeler Wings is written in Erlang... oops wait, that's not lisp.

Xah

2010-11-07

is there povray lang without rendering?

On Nov 7, 5:48 am, namekuseijin wrote:
> On 6 nov, 13:50, Xah Lee wrote:
> > i think povray was geek love about 15 years ago. I think it's dead
> > since mid 2000s.
> > In the 1990s or perhaps 1980s, it used to be that every self-
> > respecting coder would know about POV-Ray. Today, i don't think most
> > “hackers” know what it is. But they probably have heard of Blender and
> > Gimp for sure.
>
> yes, but you can't "code" in those with the same ease as with pov's
> SDL.

i've been wondering about that. Specifically, for my needs, i really need a lang like povray that lets me program (say in python) to generate the povray sphere box lighting etc positions and sizes, to generate a picture. Usually for math illustration purposes.

• 〈Illustrating Geometry with POV-Ray〉
http://xahlee.org/3d/illus_geometry.html

however, for my need i don't really need realism rendering alone with its waiting for the picture.

also, i really want real-time viewing and animation than static images. (see http://xahlee.org/3d/viz.html )

so, in past few years, i've been somewhat looking. Am pretty sure these days Blender or perhaps others has scripting that that really does what i need much better that POV-Ray. That is, a language that describe geometry primitives that can be rendered, but i don't really need fancy rendering like ray-tracing, but more or less just projection and dynamic interaction....

for example, let's say i have a sphere of radius 1 at position {2,3,4} and a box of side length 1 ot {2.5,2, 2}. Then, suppose my camera (view point) is at {-1,3,2} looking in the direction of origin.

all i want, is to have this rendered into a image. But i don't need realistic rendering. I rather have instantaneous rendering even with just outline, and say once it's created in blender, i can rotate or change view point in real time.

is this possible with blender?

for example, here's POV-Ray rendering:

http://xahlee.org/SpecialPlaneCurves_dir/ConicSections_dir/ball_shadow.png

showing some properties of conics. Really nice. But often all i need are these:

http://xahlee.org/3d/i2/conicsHypCut3D.png
http://xahlee.org/surface/helicoid-catenoid/helicoid-catenoid_twist4.png
http://xahlee.org/MathGraphicsGallery_dir/sphere_projection/sphere_proj_illus.png
http://xahlee.org/PageTwo_dir/MathPrograms_dir/scr/curved_space_mac.jpg
http://xahlee.org/MathGraphicsGallery_dir/SpheresCubes_dir/spheresCubes.html

i tried to learn blender but it's quite complex.

btw, i HAVE spent many hours reading about Blender. I know it has scripting lang (it uses python) and i know it even have a game engine built in (meaning: real-time animation and physics engine even, particle systems etc. But i think the project is still much beta and no doc).

My question is, those who blender experience, whether blender could practically be used like POV-Ray since i don't really need POV-Ray's rendering but need all the blender's interactivity etc features.

Xah

 It's the difference between having a DSL and having a general-
> purpose language with lib calls.  Makes quite a difference, specially
> for stuff like this:
>
> http://local.wasp.uwa.edu.au/~pbourke/exhibition/scc4/final/
>
> its newsgroups still is very much alive though, specially off-topic.

is there povray lang without rendering?

On Nov 7, 5:48 am, namekuseijin wrote:
> On 6 nov, 13:50, Xah Lee wrote:
> > i think povray was geek love about 15 years ago. I think it's dead
> > since mid 2000s.
> > In the 1990s or perhaps 1980s, it used to be that every self-
> > respecting coder would know about POV-Ray. Today, i don't think most
> > “hackers” know what it is. But they probably have heard of Blender and
> > Gimp for sure.
>
> yes, but you can't "code" in those with the same ease as with pov's
> SDL.

i've been wondering about that. Specifically, for my needs, i really need a lang like povray that lets me program (say in python) to generate the povray sphere box lighting etc positions and sizes, to generate a picture. Usually for math illustration purposes.

• 〈Illustrating Geometry with POV-Ray〉
http://xahlee.org/3d/illus_geometry.html

however, for my need i don't really need realism rendering alone with its waiting for the picture.

also, i really want real-time viewing and animation than static images. (see http://xahlee.org/3d/viz.html )

so, in past few years, i've been somewhat looking. Am pretty sure these days Blender or perhaps others has scripting that that really does what i need much better that POV-Ray. That is, a language that describe geometry primitives that can be rendered, but i don't really need fancy rendering like ray-tracing, but more or less just projection and dynamic interaction....

for example, let's say i have a sphere of radius 1 at position {2,3,4} and a box of side length 1 ot {2.5,2, 2}. Then, suppose my camera (view point) is at {-1,3,2} looking in the direction of origin.

all i want, is to have this rendered into a image. But i don't need realistic rendering. I rather have instantaneous rendering even with just outline, and say once it's created in blender, i can rotate or change view point in real time.

is this possible with blender?

for example, here's POV-Ray rendering:

http://xahlee.org/SpecialPlaneCurves_dir/ConicSections_dir/ball_shadow.png

showing some properties of conics. Really nice. But often all i need are these:

http://xahlee.org/3d/i2/conicsHypCut3D.png
http://xahlee.org/surface/helicoid-catenoid/helicoid-catenoid_twist4.png
http://xahlee.org/MathGraphicsGallery_dir/sphere_projection/sphere_proj_illus.png
http://xahlee.org/PageTwo_dir/MathPrograms_dir/scr/curved_space_mac.jpg
http://xahlee.org/MathGraphicsGallery_dir/SpheresCubes_dir/spheresCubes.html

i tried to learn blender but it's quite complex.

btw, i HAVE spent many hours reading about Blender. I know it has scripting lang (it uses python) and i know it even have a game engine built in (meaning: real-time animation and physics engine even, particle systems etc. But i think the project is still much beta and no doc).

My question is, those who blender experience, whether blender could practically be used like POV-Ray since i don't really need POV-Ray's rendering but need all the blender's interactivity etc features.

Xah

 It's the difference between having a DSL and having a general-
> purpose language with lib calls.  Makes quite a difference, specially
> for stuff like this:
>
> http://local.wasp.uwa.edu.au/~pbourke/exhibition/scc4/final/
>
> its newsgroups still is very much alive though, specially off-topic.


On Nov 8, 11:49 am, namekuseijin wrote:
> On 8 nov, 17:02, Xah Lee wrote:
>
> > Xah wrote:
> > > bpy.ops.mesh.primitive_uv_sphere_add(segments=32, rings=16, size=1,
> > > view_align=False, enter_editmode=False, location=(-1.35352, -2.99709,
> > > 0), rotation=(0, 0, 0), layer=(True, False, False, False, False,
> > > False, False, False, False, False, False, False, False, False, False,
> > > False, False, False, False, False))
>
> > but i was really hoping in Blender too... given its status, i think
> > it's trivial to create a primitive descriptive lang similar to POV-
> > Ray, and my guess is that it's already there...
>
> Its language is python and all it does is access Blender API.  In
> other words:  it's merely a general-purpose language calling libs and
> it does suck for that task.  Pov's SDL OTOH is a DSL for 3D scenes and
> a very good one at that.  It's particularly best for math
> visualization indeed.  It's isosurface primitive can describe general
> functions.
>
> > the best i've done is a cube. lol.
>
> but that's the default scene! :p
>
> > btw, do you know how to in POV-Ray to make the rendering outline only?
>
> there are some very tricky tricks to do that, like this:
>
> http://tuabiht.chez-alice.fr/PovEdge_Site/faq.html
>
> but it's not very feasible because that's not how povray works:  there
> are no "edges" so to speak in povray primitives because they're not
> polygon meshes, they are indeed geometrical primitives described by
> math equations.  Raytracers simply intersect light rays in the scene
> with the surface of such geometric objects.
>
> still, you may try it.

http://tuabiht.chez-alice.fr/PovEdge_Site/PovEdge.html

that's useful info! exactly what i needed. Too bad POV-Ray can't do it.

about Blender not able to take a scene description file for creating simple geometric objects, i'm still not sure. There's also the .obj file, and recently collada file format, and vrml, and possibly there's import utility that takes pov files. So, it's likely one can just use python to create objects in these files. Also, besides Blender, there's quite a few other free 3D modelers... am sure one of them can do it.

... also, Second Life is about to support importing mesh using collada format.

am sure that for someone working in this area... there's easy route to create 3D scenes by using python or any lang to generate a file of highlevel dsecription 3d primitives similar to pov's format, then just run a program so that the file gets important into any of the interactive 3d package, thus then can be viewed and manipulated in real time.

Xah

2010-11-04

emacs CEDET

On Nov 4, 1:25 am, Elena wrote:
> On Oct 30, 2:19 pm, Xah Lee wrote:
>
> > If i
> > write a emacs book, are you likely to buy it?
>
> >     * Yes, if it's good.
>
> >     * No, am not likely to spend money on emacs/elisp book.
>
> I voted "no" because I don't think an Emacs Cookbook is needed: there
> is enough information scattered around the Internet already.  What I
> feel the lack of is a structured in-depth explanation of Emacs' most
> complex packages: CEDET, Semantic Bovinator, ecc.  which are not
> explained in Emacs' manual.
>
> A guide to setup Emacs to its best: that's something I would pay for.

yeah. CEDET is a beast. But it's also for very advanced elisp coders. Cookbooks or most programing books (e.g. O'Reilly) don't cover the really advanced things, because there's little market for it.

CEDET's future status isn't mature though. I think few people, even senior emacs developers, actually use or know how to make use of it. I think there are probably less than a hundred people in the world knows CEDET enough to write elisp package using it.

if writing a cookbook focused on emacs lisp programing, then probably a chapter introducing CEDET is proper. It also means i'll probably spend at least a month full time just to study CEDET. :)

O, and Elna, you are a emacs dev for many years right? haha. You probably can write a chapter on cedet much easier and better than i can.

Xah ∑ http://xahlee.org/ ☄

2010-11-01

why use special unicode chars

From: Xah Lee
Date: Oct 18, 3:29 am
Subject: What's List Comprehension and Why is it Harmful?
To: comp.lang.lisp, comp.lang.scheme, comp.lang.functional

On Oct 18, 3:03 am, Marc Mientki wrote:

> Am 18.10.2010 11:59, schriebXahLee:

> > On Oct 18, 2:34 am, Marc Mientki  wrote:
> >> One question: why contain your pages always this junk? (red marked):
> >>    http://img256.imageshack.us/img256/7618/xahleehtmljunk.jpg

> >> regards
> >> Marc

> > ug. what browser + OS are you using?

> Firefox 3.6.10 on windows XP + SP3.

> > those are unicode 「」
> > LEFT CORNER BRACKET x300c
> > RIGHT CORNER BRACKET x300d

> Is there need for unicode for such trivial things like {[]}?

short story is no but am a unicode geek :)

long story is... i need a way to quote code...  the corner bracket was
choosen because it's standard chinese punctuation thus almost all
computer today bought in the past 5 years can display it, and because
it's different than ascii so it avoids ambiguity and complications.
e.g. when the quoted text also contains the char that you use for
quoting....

thanks for your info. I'll think about removing them...

the other thing is that those markers are very useful when you think
about info processing and automation. e.g. in the future i can
trivially write a script list all inline code i have on my site, or to
htmlize/css all quoted code. e.g.

• 〈Unix Shell Text Processing Tutorial (grep, cat, awk, sort, uniq)〉
http://xahlee.org/UnixResource_dir/unix_shell_text_processing.html

in that page, does the char show up correctly? The chars are not in
the html text, but is added by CSS due to markup. And the code are all
colored red.

PS: the most popular example of studious use of quoting in a tech doc
is emacs manual or any manual from FSF. e.g.

• 〈Constant-Variables〉
http://xahlee.org/elisp/Constant-Variables.html

but however, they use ascii hack of the 1970s, e.g. like `this' and
``this''.

Xah ∑ http://xahlee.org/ ☄