« first day (1594 days earlier)      last day (2887 days later) » 

12:31 AM
@halirutan It is done to avoid to avoid a wraparound effect. It is what Gonzalez and Woods does.
 
@Pickett And the "wrapping around" are the periodic boundary conditions :)
So you can choose between the padding color of the border and the periodic image itself
 
@halirutan But it looks like the convolution (there is a comparison at the end of the answer) has a much smaller edge effect :/
 
@Pickett Well, I need to look at it. Maybe it's your approximation of the gaussian in the fourier.
Maybe later.. currently player BF for the first time since many days
 
12:51 AM
@halirutan Yes, could be. Thank you for responding.
 
 
5 hours later…
5:49 AM
@Pickett Do we have anything in Mma to format colours in a HTML firendly way?
 
 
1 hour later…
7:10 AM
@Szabolcs No built in that I am aware of, but there are questions dealing with such color formatting from both perspectives: How do you convert RGBColor to an HTML-style string? and How to convert a hex color string to RGBColor?
 
 
2 hours later…
9:22 AM
asso = <|"a" -> 1,
"b" -> {<|"b1" -> 1, "b2" -> 2|>, <|"b1" -> 2, "b2" -> 3|>},
"c" -> {1}|>

Why this preserves the Association head of `asso`:
asso // Query[{   "a",   "b"   }]
While this doesn't:
asso // Query[{   "a",   "b" /* f   }]
Or better, how to preserve it in the second case?
 
9:45 AM
0
Q: Preserving a structure of association while querying

Kubaasso = <|"a" -> 1, "b" -> 2, "c" -> 3|> asso // Query[{ "a", "b" }] <|"a" -> 1, "b" -> 2|> but asso // Query[{ "a", "b" /* f }] {1, f[2]} While I would like to get: <|"a" -> 1, "b" -> f[2]|> and I would like the solution to be applicable also deeper when the query is ...

 
gwr
10:16 AM
@Kuba Try something like asso // Query[{"a" -> Identity, "b" -> f}] maybe?
 
@gwr so it's that easy... Post an answer or vote to close the question please :P
 
gwr
@Kuba LOL. I find working with Dataset and Association fascinating but potentially brain twisting. I catch myself looking up the documention like a newcomer everytime I start working with these things. Maybe I am getting old? :))
2
 
@gwr I don't think so. ps. do you know how to neatly convert this:
<|"a" -> 1, "b" -> <|"b1" -> 1, "b2" -> 2|>, "c" ->3|>
to
<|"a"->1, "b1"->1|>
Ah, I grasped the concept I think.
Query[<|"a" -> "a", "b1" -> Query["b", "b1"]|>]
@gwr Thanks! :)
 
gwr
@Kuba Welcome, now you were faster than me to grasp the concept. But one needs a lot of coffee for it. :)
 
 
1 hour later…
11:51 AM
@MichaelHale Hi are you still around?
 
@Kuba Yes. What's up? Was just reading chat as part of my routine to wake up enough to get out of bed lol.
 
@MichaelHale I'm clearly having a bad day today :) What have I missed again?

g[s : {__} : {}] := s
g[]
==> g[]
while I would expect {}
 
12:14 PM
@Kuba You need BlankNullSequence instead of just BlankSequence because otherwise the {} doesn't match it as a valid replacement.
g[s : {___} : {}] := s
I don't actually know if that explanation is correct, but that's my guessed explanation after finding the code tweak that worked.
 
@MichaelHale ahh, so optional has to match the pattern too. I faced that before. Thanks for reminding.
 
No prob. I hadn't tried that before. Good to know.
 
 
1 hour later…
1:30 PM
@Kuba I guess the way to think about the behavior, even if it doesn't explicitly do this, is to imagine that it splits the Optional into two definitions. g[s:{___}]:=s and g[]:=g[{}]. Then you will naturally remember the default value has to match the original pattern.
 
@MichaelHale while this is probably good to keep in mind, it's not intuitive for me so I will probably forget it again :)
 
@Kuba Ah, interesting. I'm biased the opposite way I guess. If I'm in a rush I often forget about Optional and end up simulating it with multiple definitions anyway.
 

« first day (1594 days earlier)      last day (2887 days later) »