« first day (1165 days earlier)      last day (3309 days later) » 

2:37 AM
@Kuba See also Options[$DefaultFrontEnd, ComponentwiseContextMenu].
 
 
5 hours later…
7:57 AM
@MichaelE2 Great, thanks. I saw this post but wasn't looking on right part back then.
 
Say, ColorConvert[{r, g, b}, "RGB" -> "LCH"][[1]]
Argh! How do I define an expression to evaluate only if certain symbols are bound to values?
(How did those comments get reordered?)
 
@kirma what do you need to happe then?
happen*
 
Above returns {r, g, b} which is not really what I want. Instead, I'd want L value of color once r, g and b are actually available.
 
@kirma I don't get it.
@kirma You want symbolic output in terms of r g b?
 
@Kuba Symbolic would be fine, but apparently ColorConvert doesn't give symbolic output. I'd want to pass this expression to another function which binds r, g and b, and evaluates the expression above. (Actually I want to use this as a part of constraint to NMaximize.)
 
8:10 AM
@kirma `f = Function[{r, g, b}, ColorConvert[{r, g, b}, "RGB" -> "LCH"][[1]],
HoldAll];
r = g = b = 1;
f[r, g, b]`?
 
@Kuba If r, g and b are unbound, that still evaluates incorrectly to {r, g, b}.
 
@kirma and expected result is?
 
ColorConvert[{r, g, b}, "RGB" -> "LCH"][[1]] (as ColorConvert doesn't evaluate for non-numeric r, g, and b it seems.)
 
@kirma well, didn't you get the message?
ColorConvert::ccvinput: {r,g,b} should be a valid image, a color directive, a list of machine-sized real numbers of length up to 5, or a list of such objects. >>
 
@Kuba not in my case, at least on 10.0.2.
 
8:21 AM
@kirma I'm on 10.0.2 too
 
Eh.
Interesting. I restarted my kernel and now it gives that message.
f[r_, g_, b_] /; And @@ (NumericQ /@ {r, g, b}) := ColorConvert[{r, g, b}, "RGB" -> "LCH"][[1]] sort of does what I want.
 
 
1 hour later…
9:39 AM
One set of colors (black and white predefined) that NArgMax considers to have biggest pairwise minimum perceptual difference...
 
10:01 AM
@MichaelE2 I'm trying to use it to customize context menu. But how to force front end to send command to Kernel?
So, how to makes this work:
Style[Graphics3D[Cuboid[]],
 ComponentwiseContextMenu -> {"Graphics3DBox" -> {
     MenuItem["&print", Print[1]]}}]
@MichaelE2 I was trying with:
MenuItem["&print",
 System`EnterExpressionPacket[
  MakeExpression[MakeBoxes[Print[1]], StandardForm]]]
But it seems I can only use FrontEnd` commands.
 
 
1 hour later…
11:20 AM
@EmilyBelkin You are invited to chat.
 
12:09 PM
hey guys... the other day I saw a question about reconstructing a 3D object from its front, side and top view, but I can't find it any more. can someone point me to it?
 
12:20 PM
@Kuba Try
Style[Graphics3D[Cuboid[]],
 ComponentwiseContextMenu -> {"Graphics3DBox" -> {MenuItem["&print",
      KernelExecute[ToExpression["Print[1]"]],
      MenuEvaluator -> Automatic]}}]
Adapted from mathematica.stackexchange.com/questions/1339/… -- This is not really my field...
5
Q: How can I define a 3d-body through different views?

vonjdIn one of the maths blogs I follow I stumbled upon the following question: The bottom, side, and front views of an object are shown below: How would the object look in three dimensions? My question Is it possible to use these views and construct a 3d body out of them that you can then turn in...

 
12:43 PM
@Michael thanks!
 
@MartinBüttner You're welcome.
 
Different Method for NArgMax, quite much better results.
 
1:23 PM
I think either my displays are bad, my eyes are bad, Mma is broken, or every ColorDistance variant has some colour pairs that are perceptually much closer than the function thinks.
Consider red and purple above.
"CIE2000" thinks they're further away from each other than those two pale blues.
 
2:16 PM
If run
a = {1, 2, 3, 4};
b = {5, 6, 7, 8};

then I can access those vectors with %1 and %2 respectively. Does anyone know if there is a "why" this happens? I was not expecting it to save both vectors, only the last and I was also only expecting it to save "Null" not the vector itself.
 
@Pickett It is mentioned in the docs for CompoundExpression: Subscript[expr, 1];Subscript[expr, 2]; returns value Null. If it is given as input, the resulting output will not be printed. Out[n] will nevertheless be assigned to be the value of Subscript[expr, 2].
The docs for Out explain that it saves multiple.
 
@MichaelHale oh ok, thank you I will read to pages.
 
@Pickett That functionality has to work outside of notebook interfaces, so it is based on lines/complete expressions, not cells. So if you evaluate two definitions in a cell (separated by a new line so they aren't part of the same CompoundExpression) and then evaluate another cell, you will see that it, for example, labeled the first cell In[1], and the next cell In[3].
 
2:34 PM
yeah, that makes sense. Thanks again.
 
3:02 PM
@MichaelE2 That's the answer, thanks ;)
 
@Kuba You're welcome. Enjoy the weekend!
 
@MichaelE2 Thanks, you too :)
 
 
6 hours later…
9:32 PM
What is the difference between: MathLink`CallFrontEnd and FrontEndExecute?
 

« first day (1165 days earlier)      last day (3309 days later) »