« first day (189 days earlier)      last day (4296 days later) » 
00:00 - 04:0004:00 - 00:00

Jin
4:41 AM
^ look ma, i made a graph using M!
 
@Jin With or without hands?
Clap!
 
Jin
@belisarius what does that mean?
 
@Jin It is a joke. Goes like this:
A kid is learning to drive his bike
after a while, he told his mother "Look ma, without one hand!"
then "Look ma, without looking!"
"look ma, without HANDS!"
finally
"look ma, without HEAD!"
a very old joke
sorry :)
 
Jin
i get it now
and i did use hands!
 
good :)
Mma has a steep learning curve, but is very versatile
You can make wonders in 10 lines of code
 
Jin
4:50 AM
moretriangles = Polygon[{a_, b_, c_}] :>
With[{ab = (a + b)/2, bc = (b + c)/2, ca = (c + a)/2}, {
Polygon[{a, ab, ca}],
Polygon[{ab, b, bc}],
Polygon[{c, ca, ab}],
Polygon[{c, ab, bc}]
}];
how do i actually plot that, to see the resulting graph?
 
for example ... most answers here are really functional and complete programs
@Jin wow ! did you write that?
 
Jin
@belisarius yes. i'm a faster learner
 
mmmm
ok! that is pretty advanced code
let me see how to use it
it is a rule
you need a 'substrate" to use it
a Plygon
a triangle probably
let me try
@Jin for example
Graphics[Polygon[{{1, 0}, {0, Sqrt[3]}, {-1, 0}}] /. moretriangles]
it subdivides a given triangle
Did it work?
 
Jin
hmm no
 
Run this
moretriangles = Polygon[{a_, b_, c_}] :>
With[{ab = (a + b)/2, bc = (b + c)/2, ca = (c + a)/2}, {
Polygon[{a, ab, ca}],
Polygon[{ab, b, bc}],
Polygon[{c, ca, ab}],
Polygon[{c, ab, bc}]
}];
///
with shift / enter
and then
////
Graphics[Polygon[{{1, 0}, {0, Sqrt[3]}, {-1, 0}}] /. moretriangles]
///
also shift/enter
 
Jin
4:59 AM
it just plotted a black triangle
 
subdivided
that is what it does
 
Jin
yes that's what i see too
but i was expecting that
 
nono, that seems a composition of these triangles
five of them, rotated
 
Jin
oh i see.
 
I think I can make the code
 
Jin
5:02 AM
also, how do i make the shape not filled in black, but outlined
 
do you want it?
 
Jin
you don't have to. i'm just copying some code from meta. i think i'll go start with something simpler
found some tutorials on youtube, watching them now
this is fun!
 
ColorNegate@
Rasterize@
Graphics[Polygon[{{1, 0}, {0, Sqrt[3]}, {-1, 0}}] /. moretriangles]
this is a way
 
Jin
ColorNegate@ just inverts the colors. what i wanted was having outlines. like the edges are stroked in black lines
 
This is better
Graphics[{FaceForm[White], EdgeForm@Black,
Polygon[{{1, 0}, {0, Sqrt[3]}, {-1, 0}}]} /. moretriangles]
 
Jin
5:05 AM
that's it. thanks!
 
because you don't convert to an image
 
R.M
5:28 AM
@Jin start with a pentagon for that instead of a triangle
If you're using wxffles' code, there's some stuff that's left unsaid between successive lines (the whole thing is there at the end). Here's what'll produce that image above
p = Polygon[Table[N[{Cos[t], Sin[t]}], {t, π/10, 2 π, (2 π)/5}]];
triangulate = Polygon[v_] :> (Polygon[Append[#, Mean[v]]] & /@ Partition[v, 2, 1, {1, 1}]);
moretriangles = Polygon[{a_, b_, c_}] :>
   With[{ab = (a + b)/2, bc = (b + c)/2, ca = (c + a)/2}, {
     Polygon[{a, ab, ca}],
     Polygon[{ab, b, bc}],
     Polygon[{c, ca, ab}],
     Polygon[{c, ab, bc}]
   }];
Graphics[p /. triangulate /. moretriangles]
 
@R.M Yep, I haven't read the original code
I think Jin is a great prospect!
:D
 
R.M
@belisarius Yeah, rules to manipulate polygons is pretty powerful. I just used something similar in my last answer and was reminded of this
 
Jin
@R.M awesome! thanks!
i feel like i just found a new toy... haven't felt this way since.. Illustrator days
 
@R.M I was going to suggest to him to start with a triangle with a 2 Pi/5 angle and rotate it. Strarting with a pentagon is much more natural
@Jin Mma is a curious language. Perhaps unique in many ways. It requires some time and love to become your partner, but the things you can accomplish with a few lines are amazing
 
Jin
5:50 AM
@belisarius sounds like a girlfriend
 
@Jin More or less. Depends on your luck with girls :)
 
R.M
@Jin Nah. For the girlfriend experience, evaluate On[] and then run the code above
 
:549955 You, sexist!
 
R.M
:D
 
@R.M One thing is true, anyway. A girlfriend also has a a steep learning curve
or a lot of curves, it depends
 
Jin
5:57 AM
speaking of girlfriend, i'm using the trial version now. may have to upgrade her to "wife" status tomorrow
 
R.M
Tomorrow? Wow, you move fast, man!
 
@Jin Be careful with the rule girlfriend -> bride -> wife ->widow
 
R.M
I would've waited the full 30 days, but that might be because I'm a college cheapo
are you getting the home edition?
 
Jin
@R.M I know I definitely will use Mathematica for my design stuff, another person in the company may use it for data visualizing stuff.
so if i can convince him to learn how to use M, then i'll get the business version
if not, then i'll get the home edition
 
R.M
\o/ While you're at it, convince SE to order excess and then give away the rest to some of the top users :P
 
5:59 AM
@Jin Data visualizing is easier than graphics design! You will convince him easy
 
R.M
btw, version 9 is coming soon (sept/oct), so keep that in mind too
 
Also, count on us!
 
Jin
i love numbers... crunching numbers.. graphing them...
which probably explains why I play Eve Online, aka Spreadsheet MMO.
 
@Jin Mma is a breeze for hat
ehh
that
>)
 
Good morning/evening :-)
 
Jin
6:02 AM
@Szabolcs good 2am
 
@Szabolcs Hi !
 
(it's sleepy morning here)
 
3 am here
 
Jin
coffee time
and bacon
Graphics[FaceForm[White], EdgeForm@Black,
p /. triangulate /. moretriangles] breaks things
p = Polygon[
Table[N[{Cos[t], Sin[t]}], {t, \[Pi]/10, 2 \[Pi], (2 \[Pi])/5}]];
triangulate =
Polygon[v_] :> (Polygon[Append[#, Mean[v]]] & /@
Partition[v, 2, 1, {1, 1}]);
moretriangles =
Polygon[{a_, b_, c_}] :>
With[{ab = (a + b)/2, bc = (b + c)/2,
ca = (c + a)/2}, {Polygon[{a, ab, ca}], Polygon[{ab, b, bc}],
Polygon[{c, ca, ab}], Polygon[{c, ab, bc}]}];
Graphics[FaceForm[White], EdgeForm@Black,
p /. triangulate /. moretriangles]
 
Graphics[{FaceForm[White], EdgeForm@Black, p} /. triangulate /.
moretriangles]
{} missing
 
Jin
6:08 AM
is there a good tutorial site that teach how to plot basic geometric shapes, and manipulate them?
 
Errr ...
 
@Jin That one will not help with drawing
@Jin Perhaps RM or Verbeia could suggest you some readings
 
Maybe somebody should write a tutorial style blog post on that. Start from zero, learn graphics primitives, and draw some "cool things" at the end.
 
@R.M Heyyyyy
wake up
@Szabolcs Preferably something not easy to do with a WYSIWYG tool
 
6:13 AM
@Jin Vector graphics are stored as a (nested) list of graphics primitives. For example, Graphics[{Circle[{0,0},1], Line[{{0,0},{1,1}}]}]. The {...} thing is a "list" (just an array)
Then you can manipulate them the same way as any other Mathematica expression, which is a much broader topic ...
coffee ..
As I see it, the main practical difference from systems like Processing is that Mathematica works with vector graphics only. Processing and other similar drawing programs work with raster: once you draw something, it is rasterized, and doesn't take time to redraw it. This affects performance.
 
Jin
I thought processing is vector? doesn't it output to canvas or svg?
 
@Jin It does, but the typical way of working with it is to draw onto a bitmap canvas right away and lose vector information as soon as an object is drawn. This makes implementing things like motion blur quite natural.
In Mathematica it's common to transform graphics after they are created (in contrast to recreating them in a different way)
Also, Mathematica wasn't really made for animation, especially real-time animation. It's not possible to make smooth and complex animations like in processing (maybe in the future ...)
I'm not very good at Processing, but once I tried to teach some computer graphics to art students who never programmed before. I found that the things that are easy in Mathematica and easy/convenient in Processing are quite different.
 
Jin
just to be sure, you're talking about processingjs.org right?
 
yes
 
6:34 AM
Graphics[Circle @@@
FoldList[{{ArcTan[#[[1]]/#[[2]]],
ArcTan[#[[1]]/#[[2]]]} &@(Plus @@@ #1), #2} &, {{1, 1}, 1},
Range@10]]
////
Graphics[Circle @@@
FoldList[{{ArcTan[#[[1]]/#[[2]]],
ArcTan[#[[2]]/#[[1]]]} &@(Plus @@@ #1), #2} &, {{1, 1}, 1},
Range@10][[2 ;;]]]
 
So has anyone posted the hedcut question?
I want more questions about making pretty things!
Okay, so before I'm allowed to ask it, I have to try to come up with something myself ...
 
7:10 AM
Perhaps the mods can request that Mathematica.SE be included in the list of target migration sites? (The list that's shown when voting to close as off topic). @MrW @JM @Sjoerd
Look what I just found:
 
7:31 AM
Is there a function which computes a third image from two starting images of the same size based on a custom function? Sort of like a two-argument ImageApply
 
7:50 AM
I can't make sense of what coordinate system PixelValue uses ...
 
8:01 AM
 
 
2 hours later…
10:02 AM
@Jin I gave it a try:
6
Q: How to create the hedcut effect?

SzabolcsYesterday the hedcut style was brought up in chat. How can we create a hedcut-like style automatically in Mathematica? I am looking to create a similar artistic feel, not necessarily reproduce the hedcut style precisely. Relevant resources: Hedcut-like effect in Photoshop A blog showing ...

 
 
2 hours later…
11:48 AM
@Jin Do you think you'll be able to fix the ugly scrollbar issue in the WordPress theme? Or is it too difficult? I'm asking to know how to format code-heavy blog posts. It's better to use inline code if there would be too many scrollbars
 
 
3 hours later…
2:39 PM
I think (and site) this room is the least active when I have time to be here. About 7-16 UTC.
 
@Szabolcs which wordpress theme?
 
2:56 PM
@magma it's like this
 
@Szabolcs the blog is still empty. But what exactly is the point of having a blog?
we have the Q&A, the chat, the meta and now the blog?
 
The blog is for a more general audience. One doesn't need to participate on Mma.SE to find the blog interesting. It's for those posts that people sometimes write as answers, but which as really long self-contained pieces which are interested to more people than the asker.
Several people said they're interested in writing posts, and many more are interested in reading.
It's just another Mma blog with several contributors. We can have lots of things that don't fit the main site, e.g. tutorials, stories about solving problems
@magma you can read some other sites' blogs on Blogoverflow
@belisarius I need you to switch off the Visual editor in WordPress too (since it looks like you have editor rights too---to avoid destroying posts by accident) --- see the blog chatroom
 
3:13 PM
@Szabolcs Ok. I am still preparing my post offline, so it will take some time until I destroy anything :)
 
@belisarius Good, keep it offline. The WP editor is worse than I imagined. The reason I asked you is that you are able to edit others' posts too and occasionally the system seems to load in visual editing mode which automatically strips out some "non-standard" formatting (e.g. MarkDown code blocks, but not only)
 
@Szabolcs I guess I will do all editing offline so
 
acl
@R.M and other OS X users, if/when you switch your OS to 10.8 can you let us know if there are any problems with mathematica?
 
3:34 PM
@acl Hello OS X user! Have you uploaded anything with the image uploader palette recently? If yes, could you send me a screenshot of your History window? I suspect there may be a problem / misalignment on some platforms, but I'm not sure.
 
Jin
@Szabolcs the scrollbar has been fixed on dev, just waiting on a production build
 
Great news! Just in time for tomorrow blog post
 
R.M
@acl Yeah, sure. I'll get a new laptop in a couple of weeks and that should have ML, so will let you know then (current one doesn't support it)
@Jin This close enough for a Hedcut?
2
A: How to create hedcut style images?

R.MHere's a first-pass at a Hedcut style image using Mathematica This is how it was done: First, obtain the image and convert to gray scale: img = ColorConvert[Import["http://i.stack.imgur.com/RjE3P.jpg"], "Grayscale"]; Next, create a disk layer and give it a wavy pattern: dots = Graphics[...

 
Jin
@R.M hmm no.
the problem I see is that, it's hard to use an automated program to generated hedcut
 
R.M
That is true. It's very hard to do it programmatically (in a way that'll work for all images)
 
Jin
3:43 PM
traditionally artists create curvy guidelines for the dots using the contour of the facial structure. not sure how a software would do that
also the final result heavily depends on the quality of the original photo too. it needs to have high contrast, but enough gray area for shading
 
R.M
Ah, I see. I was going by this photoshop tutorial: alleba.com/blog/2006/12/20/photoshop-tutorial-the-hedcut-effect
 
Jin
that tutorial isn't that great
but it's the closest one you can find on the web
 
@R.M It's the same thing I linked to in a blog post, implemented in Mathematica. I was wondering if we can do better than that.
It does look good, especially the version in the blog post, but there must be a way to make it better.
Oh, you just posted the link too.
I'm wondering if it's possible to align the dot pattern with the strongest lines in the image
 
4:08 PM
I believe the guide lines for dots in a hedcut have to be constructed from a 3D model. So information in a picture is not enough, some real world knowledge are needed.
If my impression is right, there seems to be an AI research field about face reconstruction?
 
Jin
4:23 PM
can anyone link me some data visualiztion or data mining examples?
 
@Jin I think "The Mathematica Guidebooks" is a good reference.
It demonstrated many fancy skills on graphics generation.
 
acl
@Szabolcs here
 
@Silvia but for pre-version 6, unfortunately. Also, the Guidebooks are very expensive.
 
Seems to be quite fine on Mac.
 
yes it's a pity it's not up-to-date :(
I borrow it from the library of my collage :)
I mean "college"..
 
5:07 PM
@R.M See above for an underlying pattern
 
Jin
@Szabolcs did you make that in Mathematica?
 
5:25 PM
@Jin Yes. But my code is not yet cleaned up ... here's a bigger version:
It's meant to be used as a background pattern for RM's technique
 
R.M
@Szabolcs what did you use? some like an edge detector or curvature filter?
 
@R.M I don't have time to finish it now, unfortunately. The idea was to construct an incompressible flow from the blurred image, and distort some regular point grid based on that flow.
This flow simply goes along the contour lines and its magnitude is determined by the image gradient
the dots are also slightly distorted along the flow
 
R.M
You mean CurvatureFlowFilter (and then something with it)?
 
if = ListInterpolation@ImageData[Blur[img, 15]]
rot90[{x_, y_}] := {-y, x}

Clear[flow]
flow[x_?NumericQ, y_?NumericQ] :=
 rot90@Identity[{Derivative[1, 0][if][x, y],
    Derivative[0, 1][if][x, y]}]
sorry about the messy code
it would probably be nicer to start with a triangular grid
 
acl
@Szabolcs why is Identity necessary here?
 
5:33 PM
@acl because it used to be something else and I was lazy to rewrite it :-)
2 mins ago, by Szabolcs
sorry about the messy code
 
acl
@Szabolcs ah OK, I just was wondering what I was missing
 
Also, the derivatives of the interpolating function should be precomputed for performance
 
acl
so you calculate grad(if) then. why incompressible?
irrotational
 
@acl I need an incompressible flow because I was trying to keep the distances between neighbouring points relatively unchanged.
 
acl
@Szabolcs no I mean, if that vector is your flow field, it's v=grad(if) and div.v doesn't vanish
I mean if that vector is your velocity, sorry
or do I need a break from staring at eqns for the day
 
Jin
5:37 PM
whoa
"Using .NET/Link.,[19] a .NET program can ask Mathematica to perform computations; likewise, a Mathematica program can load .NET classes, manipulate .NET objects and perform method calls. This makes it possible to build .NET graphical user interfaces from within Mathematica. Similar functionality is achieved with J/Link.,[20] but with Java programs instead of .NET programs."
we use .net
 
@acl I rotated it by 90 degrees, it's perpendicular to the gradient
it goes along the contour lines
if you have simpler / nicer ways to generate an incompressible flow from a scalar field, I'm very much interested! I was unable to come up with a better idea.
 
little graphics gadget for tracking 3d orientations :)
i built up a Frenet-frame visualizer for parametric curves out of this
 
@acl sorry, you're right, of course it's not incompressible ... I need to eat, i'm dizzy
 
acl
@Szabolcs oh no you're right it is, I didn't notice the rot90 bit
div.v vanishes
well I don't see any better way apart from precomputing the derivatives
good idea
 
6:04 PM
@Jin NET/Link is pretty slick, but I have trouble imagining any good integration scenarios with any of the .Net code that y'all have around.
 
@Jin the problem is that if you want to make mathematica accessible from the web in any way, it requires a webmathematica license
desktop .NET stuff is fine though
 
 
5 hours later…
11:07 PM
Hi @R.M
Would you happen to know how to make Mathematica tell me if two objects are comparable? That is, if I put 4 < 5 it evaluates it and returns true. But if I put "a" < "b" then it just returns the expression.
 
R.M
@jmlopez "Comparable" how? < is defined only for real numbers, and so won't work on complex numbers or strings.
Are you trying to check if "a" and "b" are sorted canonically?
 
something like that
If I have a list of objects, say {"a", 1, "b", 4.5, 3+i, Graphics[]}
then I want to put them into a "sorted" form
all I can really do is sort the numbers
and the rest stays in the order in which they appear on the list
so I guess I will have to check if the element is a real or integer (check if its comparable)
otherwise it is not comparable
 
R.M
No, Sort@list will sort everything into its canonical order, which is not a numerical sort
Try Sort@{"b", 1, "a", 4.5, 3 + i, Graphics[]} vs. Sort@{"b", 3 + i, "a", 4.5, Graphics[], 1}
They both return the same result
 
I tried A = {"a", 1, "b", 5.4, 3 + I} and Sort@A gave me {1, 3 + I, 5.4, "a", "b"}
 
nights ... or whatever
 
11:20 PM
6:20 pm here
 
We are ahead 8:20
 
Oh, yeah, same time zone as in California
 
In summer, yes
 
R.M
@jmlopez Yes, that is correct. If there's a complex number, the sorting is by real part and if a tie, by absolute value of imaginary part
 
I see
I just wanted to write a quick binary sorting algorithm with a list of things that may or may not be comparable.
Not that I really need it
@belisarius, so how is the temperature in that third world of yours?
 
11:26 PM
@jmlopez 52 F plus inflation
 
@jmlopez everything is comparable in the sense of OrderedQ. Beyond that you need to decide what kind of comparison you would like to make.
 
@OleksandrR., thanks, that's what I needed
 
00:00 - 04:0004:00 - 00:00

« first day (189 days earlier)      last day (4296 days later) »