« first day (1954 days earlier)      last day (2531 days later) » 

1:50 AM
Can anyone tell me what option controls the appearance of the above conversion prompts? I feel like I have come across this before but now cannot find the option
 
2:17 AM
@WReach You around?
Simple example:
$test=Table[Association[
    Unique["x"]-><|"val1"->RandomInteger[5],"val2"->RandomInteger[5]|>],{50}]
To sort this list first by val2 and then by val1, is there anything shorter than
SortBy[{Last[#]["val2"] &, Last[#]["val1"] &}][$test]
Especially, can I get rid of the Last[#] inside a Query and still maintain the complete structure after sorting?
 
3:12 AM
@WReach Nevermind, I made of course an error in creating the example :(
 
3:23 AM
@halirutan Perhaps $test // SortBy[#[[-1, {"val2", "val1"}]] &]
or to get a stable sort: $test // SortBy[{#[[-1, {"val2", "val1"}]] &}]
 
@WReach Yep, thanks. My structure was indeed a whole association which makes things easy.
.. and always remember to use Key explicitly in SortBy when you use it on associations.. god damn it.
(that was a note to myself)
 
3:41 AM
@WReach How did you know about the trick to make SortBy stable? That never occurred to me from the documentation. I just assumed it always broke ties with canonical order once it reached the end of the list. Like it does with just a single sorting function. That's very useful to know. Thanks. I already have one code simplification I know I can make in one of my notebooks now.
SortBy[{{1, 2}, {1, 1}}, First] vs SortBy[{{1, 2}, {1, 1}}, {First}] if anyone was wondering what I'm referring to.
 
4:00 AM
@MichaelHale I can't remember where I first heard about it. It surely wasn't the documentation :) I seem to recall that it might have been a throw-away comment on a Stackoverflow post by someone connected to WRI. Or maybe even on Mathgroup.
 
Cool. Thanks. I'll send a suggestion to add that to the documentation.
 
@MichaelHale
14
A: Stable Sorting, ie, Minimally-Disruptive Sorting

Andrew MoylanAfter asking around, I was given a satisfying explanation: Short answer: You want SortBy[list, {f}] to get a stable sort. Long answer: SortBy[list, f] sorts list in the order determined by applying f to each element of list, breaking ties using the canonical ordering explained under Sort. (Thi...

 
Hm. Well the way Andrew explains it there might have actually made me try it on my own. "Note that SortBy[list, f] is the same as SortBy[list, {f, Identity}]" But what the docs actually say made me just assume Identity was just tacked onto the end of it no matter what. "SortBy[e,f] is equivalent to Sort[{f[#],#}&/@e][[All,-1]]"
 
4:32 AM
Suggestion sent.
 
Does someone remember if and how it is possible to change the background style of the selected item in a ListPicker?
 
 
3 hours later…
8:11 AM
@halirutan I know I've changed the colors before. I think it's in the docs under one of the options.
@halirutan that must have just been the standard background
But this works:
l = {1, 2, 3};
ListPicker[
Dynamic[a],
l,
Background ->
{Dynamic[
First@FirstPosition[l, First@a]
] -> Red
}
]
 
 
1 hour later…
9:45 AM
Anybody know what errors I have made in this answer?
2
A: WarpingCorrespondence and custom DistanceFunction

yodeAs the documentation in Details and Options indicating,any custom DistanceFunction is not allowed: WarpingCorrespondence accepts a DistanceFunction->d option with settings We can know Total[Abs[u-v]]/Total[Abs[u+v]] is equivalent to the BrayCurtisDistance totally as its documentation,but re...

 
 
2 hours later…
12:09 PM
@MichaelE2 Hello,
 
@yode Hi
 
I'm glad to see your answer,but I don't know apply it in my this anwre
size = 1; Graphics[
NestList[Composition[(size = size*.5; Map[drawH[#, size] &]),
Level[#[[All, 1, 2 ;;]], {-2}] &], {drawH[{0, 0}, 1]}, 2]]
@MichaelE2 This is my Composition version.But it doesn't work..
size = size*.5 should out of the Map here..Confusing
"I don't know how to apply it into my this answer."
 
Map makes is more difficult. Make each statement a function:
size = 1;
Graphics[
 NestList[
  Composition[
   Map[drawH[#, size] &],
   (size = size*.5; #) &,
   Level[#[[All, 1, 2 ;;]], {-2}] &
   ],
  {drawH[{0, 0}, 1]}, 2]]
Or combine size with Level instead of Map:
size = 1;
Graphics[
 NestList[
  Composition[
   Map[drawH[#, size] &],
   (size = size*.5; Level[#[[All, 1, 2 ;;]], {-2}]) &
   ],
  {drawH[{0, 0}, 1]}, 2]]
 
@MichaelE2 Thanks very much.. :)
 
@yode You're welcome. :)
 
12:23 PM
And I have update that answer as your method
 
1:19 PM
@MB1965 Yes, I didn't use this because it has 2 flaws as far as I know: The first major one is that although it changes the background color of the item, the default highlighting color is added to it (which is critical as I want a consistent layout). The second one is that there is no obvious way to extend this to multiple selected elements. But the first one is the main no-go for me, but thanks for giving it a try.
I have debugged through the whole code that turns a listpicker to its box-representation. The final box coloring is defined by ListPickerBoxBackground which is calculated through several steps. The main step is to turn the highlevel Background option for listpicker by using e.g.
GridDump`ColumnRestructure[Background, {{GrayLevel[1], GrayLevel[0.5]}, {1 -> Red}},
   "Rows"]
and
GridDump`ColumnRestructure[Background, {{GrayLevel[1],   GrayLevel[0.5]}, {1 -> Red}},
   "RowsIndexed"]
On the whole way down to the box-representation there doesn't appear a way to influence the high-light color of the selected item.
I fgreped through all the Default.nb and Core.nb style definitions but I started to go in circles. I had the hope that the dynamic highlighting color is exposed somewhere (and maybe it is) but I have no idea what to look for.
 
 
2 hours later…
3:35 PM
posted on May 25, 2017 by Devendra Kapadia

Derivatives of functions play a fundamental role in calculus and its applications. In particular, they can be used to study the geometry of curves, solve optimization problems and formulate differential equations that provide mathematical models in areas such as physics, chemistry, biology and finance. The function D computes derivatives of various types in the Wolfram [...]

 
 
2 hours later…
5:06 PM
0
Q: Is it possible to change file attributes external to Mathematica?

LCarvalhoIs it possible to change file attributes external to Mathematica, such as DOC, JPG, ...? I'd like to change the Creation Date of a batch file from a folder with DOC files, for example.

 

« first day (1954 days earlier)      last day (2531 days later) »