« first day (1989 days earlier)      last day (2505 days later) » 

2:17 AM
@hftf In the first case, # is bound to an association so #key and #otherkey extract the respective values. In the second case, # is bound to the value associated with "key", so #otherkey has no meaning (unless that value is also an association).
 
 
2 hours later…
3:57 AM
:38199383
 
 
7 hours later…
10:57 AM
I can't get Simplify on Rescale to give this form even though this is how I naturally think of the transformation and it seems simpler than the results given from Simplify. Simplify[(x - min1)/(max1 - min1)*(max2 - min2) + min2 ==
Rescale[x, {min1, max1}, {min2, max2}]]
 
 
2 hours later…
1:20 PM
@WReach @MichaelHale and others, how to shortly explain this error:
<|"key" -> <|"a" -> "1", "b" -> Compress@"test"|>
  |> /. KeyValuePattern[{"a" -> "1", "b" -> val_String}    ] :>
  With[{eval = Uncompress[val]}, eval /; True] (*edited form `val /; True` *)
> Uncompress::argt : Uncompress called with 0 arguments; 1 or 2 arguments are expected.
 
2:03 PM
I suppose I'm misusing KeyValuePattern but I don't fully feel it yet :) Any ideas @MichaelE2 @b3m2a1 @xzczd , I see you :)
 
@Kuba been playing around with this. Very weird. I assume you already saw that KeyValuePattern[{"b" -> val_String}] works fine?
 
2:17 PM
@Kuba It seems to be matching the association twice. The first match is a mystery to me:
<|"key" -> <|"a" -> "1", "b" -> Compress@"test"|>|> /.
 assoc : KeyValuePattern[{a : ("a" -> "1"),
     b : ("b" -> val_String)}] :>
  With[{eval = Uncompress[val]},
   Print[{assoc, HoldComplete[a], HoldComplete[b], HoldComplete[val],
     HoldComplete[eval]}]; val /; True]
 
@Kuba You know currently I only have v9 in my PC and haven't yet play with those Key stuff, so I'd like to sit back and wait for your conclusion :)
 
@Kuba KeyValuePattern evaluates each pattern individually. But it also appears to apply the replacement rule with each match. Consider:
<|"a" -> 1, "b" -> 2, "c" -> 3|> /.
  KeyValuePattern[{"a" -> a_, "b" -> b_, "c" -> c_}] :> "match" /; (Echo[{a, b, c}]; True)
Surely a bug.
Whoops, I take that back. It is not a bug.
The With that contains the Uncompress is part of the match condition. Naturally, it will be called with each match. val is only bound in the second call. The first call generates the message.
 
 
1 hour later…
3:45 PM
Good news: I just noticed that CDF Player 11.1.1 has been released ( wolfram.com/cdf-player )
 
 
2 hours later…
5:23 PM
posted on June 29, 2017 by Swede White

As the Fourth of July approaches, many in America will celebrate 241 years since the founders of the United States of America signed the Declaration of Independence, their very own disruptive, revolutionary startup. Prior to independence, colonists would celebrate the birth of the king. However, after the Revolutionary War broke out in April of 1775, [...]

 
 
1 hour later…
6:25 PM
@J.M. It seems that @J.M. has not connected to SE for a month. Hope he is doing fine and just too busy for MmaSE. @JM offered to "submit to SE staff for inclusion in our sidebar." can anybody else do that?
 
6:56 PM
@andre Roman gave two talks. The one you actually want to refer to would be "Performance of Massively Parallel Computations with the Wolfram Language"
 
7:13 PM
@SjoerdC.deVries Thanks. I'm going to see that immediatly
... Correction done.
 
 
2 hours later…
9:09 PM
Hi, how do I write a sum indexed by primes? E.g., the sum of f(i) from i=2 to i=23 where each i is prime.
 
Total@Array[Prime, 23]
Sum[Prime[i], {i, 1, 23}]
 
9:24 PM
@TheSubstitute Total@Table[f[i],{i,Prime[Range[23]]}]
or Sum[f[i], {i, Prime[Range[23]]}]
 

« first day (1989 days earlier)      last day (2505 days later) »