« first day (1682 days earlier)      last day (2792 days later) » 

6:05 AM
@Pickett "If x is initially true then it's important that it doesn't evaluate the false statement, and vice versa." - but for that you don't need Hold/ReleaseHold, do you? Isn't If enough?
@Pickett " However every time I toggle between true and false it reevaluates the expressions, I don't want that either." how the If check should be done otherwise? Or have I misunderstood "expression"
@Pickett I'm not sure what is the goal but maybe something along those lines:
ClearAll[f]
 f[x : (True | False)] := f[x] = If[x, Print[1]; true, Print[2]; false]
Dynamic@f[x]
Checkbox@Dynamic@x
 
 
1 hour later…
7:09 AM
Hi guys! There is a way in Mathematica to make plots like this one?
The red points are poles of a complex function and the sawtoothed lines are branch-cut. This complex functions is a priori unknown
 
@Kuba Thanks, I'm sorry for being unclear, I wasn't thinking clearly overall last night. I see now that If is HoldRest and so yes, the holds should be unnecessary. I have a follow up question related to what I said in the end of my last question, "and I don't like it too much either since true and false can be large, complex expressions." I'd like to do something like:
ClearAll[f, b]

SetAttributes[f, HoldRest]
f[x : (True | False), true_, false_] :=
 With[{tr = Hash[true], fa = Hash[false]},
  f[x, tr, fa] = If[x,
    Print["true"]; true,
    Print["false"]; false
    ]
  ]
With[{true = RandomInteger[100, 10], false = RandomInteger[100, 10]},
 Dynamic@f[b, true, false]]
Checkbox@Dynamic@b
 
@Pickett what about my code, where contents are not arguments? only x
 
It works if I remove Hash, so the hash is the problem for some reason.
@Kuba Well, this is for a GUI element akin to PaneSelector. If I only memoize on x then I can only use it for one GUI element. I want to reuse the function.
 
@Pickett probably because you are casching for hashed arguments while you have still original epxressions in `Dynamic.
 
oh yes, I see that now facepalm
 
7:22 AM
@Pickett What if you have twice the same gui, should it be cached globally or per gui?
 
@Kuba I would expect it to be cached globally, but it won't happen
 
@Pickett I'd probably use different or local f for each gui.
But if you aim in reusable and stable gui element like HoldAndCachePaneSelector then I think it is a good question for main.
 
@Kuba I will see if I can make local functions work for my use case, if not I will post it to main. Thanks.
 
@p
@Pickett the problem with localization is that if DynamicModule variable is big and you have many of them, it will slow the FE down.
That is why I don't know how to solve general problem but creating private fs functions for specific gui should not be a problem.
 
 
2 hours later…
9:41 AM
@Kuba This has the properties I was looking for:
ClearAll[f, b]
SetAttributes[f, HoldRest]
f[x : (True | False), true_, false_] :=
 With[{tHash = Hash[true], fHash = Hash[false]},
  f[x, _?(Hash[#] == tHash &), _?(Hash[#] == fHash &)] = If[x,
    Print["true"]; true,
    Print["false"]; false
    ]
  ]
With[{true = RandomInteger[100, 10], false = RandomInteger[100, 10]},
 Dynamic@f[b, true, false]]
Checkbox@Dynamic@b
nvm, I'm so slow thinking today omg.
 
10:06 AM
Hi :)
Do you know if it is possible to only sort parts of lists? Like list[[All,1;;6]] stays the same and list[[All,7;;]] gets sorted?
 
@pH13-YetanotherPhilipp ` list[[All,7;;]] = Sort @ list[[All,7;;]]`
 
@Kuba Thank you!
 
11:01 AM
I'd expect this to not need to call the Kernel while resizing the Pane:
DynamicModule[{x = {123, 123}},
 Panel@Pane[Dynamic[x], ImageSize -> Dynamic[x],
   Scrollbars -> {False, True}]
 ]
But link snooper says it does. Should that be the case?
 
 
5 hours later…
3:49 PM
posted on August 26, 2016 by Zach Littrell

We are constantly surprised by what fascinating applications and topics Wolfram Language experts are writing about, and we’re happy to again share with you some of these amazing authors’ works. With topics ranging from learning to use the Wolfram Language on a Raspberry Pi to a groundbreaking book with a novel approach to calculations, you [...]

 
 
3 hours later…
7:09 PM
@Kuba The problem you helped me with earlier was a misguided attempt at answering this question. Please check it out when you have the time.
 

« first day (1682 days earlier)      last day (2792 days later) »