« first day (1127 days earlier)      last day (3345 days later) » 

2:33 AM
@OleksandrR. @blochwave Thanks for the information. I need to read in the literature, because I think I might be able to calculate the derivatives of my target-function. My problem has 4 degrees of freedom and currently I have implemented the target-function as black-box, which gives only mean squared error for a specific set of parameters. The model itself is pretty simple.
If you want to have a look, use this
manipulate = Get["http://pastebin.com/raw.php?i=c3vbxCfC"]
and the model formula is
Begin["IPCU`FoveaModelling`Private`"];
manipulate[[1, 1]]
End[];
Back in the days I started with NMinimize because it was easy to implement and I could parallelize it. As usual, I never touched it again because it worked.
 
 
9 hours later…
11:22 AM
@halirutan The default for differnetial evolution is for the population size to be 10 times the dimension of the problem. For small problems like your 4-dimensional one, this is completely unnecessary. A population of 20 vectors is enough. So, if you memoize and cut the population in half, you can gain a factor of 4 right away. About the poor results you saw before, I suggest changing ScalingFactor to 0.8 and CrossProbability to 0.1 or so (N.B. CrossProbability is backwards)
Simulated annealing can get out of local minima and it is certainly easy to understand how and why it works, but I'd say that it's a bit of a blunt instrument for most purposes. My suggestion in general would be not to choose it just because it performs better than the other methods with the default selection of tuning parameters, most of which are quite arbitrary. Of course there are problems for which simulated annealing is absolutely the right choice, so YMMV.
 
@OleksandrR. The population are the initial points, yes?
 
11:48 AM
OK, after really reading the doc it's clear how it works.
 
12:12 PM
@halirutan Would you expect this kind of renaming?
BeginPackage["Test`"]
x = 1;
EndPackage[]



DynamicModule[{x = 2},

 Column[{
   PopupMenu[Dynamic[Test`x], {1, 2, 3}],
   Dynamic[Test`x]
   }]
 ]
 
12:36 PM
@Kuba Can you tell me what you see when you evaluate the following:
 
@halirutan yes
 
BeginPackage["C1`"];
x = 1;
EndPackage[];

DynamicModule[{x = .5}, {Slider[Dynamic[x]], Dynamic[x]}
Now look at the cell-expression of the created dynamic.
 
@halirutan {slider[.5], .5} (*dynamic)
 
@Kuba But use Ctrl+Shift+E to look at the bare cell expression
I see
Cell[BoxData[
 DynamicModuleBox[{C1`x$$ = 0.968},
  RowBox[{"{",
   RowBox[{
    SliderBox[Dynamic[C1`x$$]], ",",
    DynamicBox[ToBoxes[C1`x$$, StandardForm],
     ImageSizeCache->{49., {1., 11.}}]}], "}"}],
  DynamicModuleValues:>{}]], "Output",
 CellChangeTimes->{3.633251776374208*^9, 3.633251848744039*^9}]
which is truly surprising.
 
@halirutan I see the same
Yes, even more strange.
 
12:41 PM
@Kuba And what about this
Module[{x}, Information[x]]
 
@halirutan
C1`x$369
Attributes[x$369]={Temporary}
@halirutan I'm so confused I don't know what question to ask :) and if there is one issue or more.
DynamicModule[{x = 1}, Dynamic@Information[x]]
vs.
C1`x = 2
DynamicModule[{x = 1}, Dynamic@Information[C1`x]]
brb.
@MichaelE2 Hello :) join then game :)
 
12:57 PM
OK, it seems the minimal question is:
When you create a symbol in another context and you add this context to $ContextPath, why is Module or DynamicModule using this context if the local name is the same..
 
@halirutan DynamicModule is some UI in subpackage of the main project which context is C1`.
Let's say that the projec is so vast you are not aware of this names conflict
 
@Kuba It's even worse. What when you just load another package that exports symbol and you use this in your notebook DynamicModule?
 
What do you mean? Why another package wouldproduce C1`x if C1` is quite unique name?
@halirutan Or I missed the point?
 
@Kuba let me think of an academic example.
@Kuba Let's say you have a package about parallelization and it uses a variable defining how much processes are started:
BeginPackage["Package`"];
processes = 5;
EndPackage[];
Now you write a module where you want to have a local definition of how many processes you need. You probably want to compare it to the package's definition:
Module[{processes = 1},
 {processes, Package`processes, processes < Package`processes}
 ]
It this output really expected?
(* {1, 1, False} *)
 
@halirutan For me it's not. But I could live with this if this works:
BeginPackage["Package`"];
Begin["`Private`"];

Module[{processes = 1}, {processes, Package`processes,
  processes < Package`processes}]
End[];
EndPackage[]
@halirutan I don't think it is ok the more that if you use deeper context it is ok:
BeginPackage["Package`"];
`Private`processes = 5;
EndPackage[];

Module[{processes = 1}, {processes, Package`Private`processes,
  processes < Package`processes}]
> {1, 5, False}
 
1:15 PM
@Kuba The requirement is that the context needs to be in $ContextPath. When you use BeginPackage, then only Package is appended to the context path. Therefore, this works.
 
@Kuba Thanks. I'm afraid right now I've got something to get done in 2 hours. My logging in was automatic, due to the computer starting up.
 
@halirutan so what is the lesson for me?
 
@Kuba I'm not sure I have understood all consequences myself.
 
Hey guys, I'm trying to do a Map inside a Block but I'm not getting it straight due to incorrectly setting the #. Basically, I want something like this to work: Block[{alllists}, alllists = {#^2, 3*#} &; {#, alllists} & /@ {2, 3}]
This should output something like {2,{4,6}},{3,{9,9}} if I'm correct
the problem is setting the slot in the first assignment and also on the second assignment
right?
 
@Sosi You syntax does not work for several reasons. A solution that keeps your original code is this
 
1:24 PM
@Sosi Hi :) try with alllists[#]
 
Block[{alllists}, alllists = {#^2, 3*#} &; {#, alllists[#]} & /@ {2, 3}]
 
oh
 
@Sosi And if you have sleepless night, you can chew over this
 
Indeed, it works with my real example too :)
 
With[{alllists = {#^2, 3*#}},
 {#, alllists} & /@ {2, 3}]
 
1:26 PM
thanks @kuba and @halirutan
 
np
 
I am still grasping the difference between Module and Block, but With is completely new to me
 
@halirutan this is kind of understandable if you assume renaming process should be smart enough to deal with Global` but imo. Global should be handled here in a special way. On the other hand not only Global is so special, also notebook context etc.
 
Oh @halirutan, With makes it even simpler! Nice!
 
1:43 PM
@Kuba Are you writing a question about this? Otherwise, I guess I would try to.
 
@halirutan please try. Usually folks don't get me and here I even don't get myself fully :)
 
 
1 hour later…
2:50 PM
0
Q: What can we expect for our closing questions rate?

belisariusComparing the historical closed questions percentage on SO and Mma SE you can see very different behaviors: I don't want to analyze here the StackOverflow site particular nuisances, but I'm showing it only as a reference. Our current closing percentage is near 20% and the growing seems (by n...

 
3:38 PM
@Kuba Here we go
1
Q: Context of localised (dynamic) symbols

halirutanWhen you localise a symbol with Module, the created unique symbol is usually in the current context. There seems to be an exception to this which has further consequences. Let us assume we define a symbol in a package. We can mimic this by defining a symbol in some context and append this conte...

 
@halirutan Thanks :) +1ed
 
Have any of you looked at the Worldbuilding SE beta site? This is the first question I've read, but I'm finding it pretty funny. "How long for some settlers to build a castle town in my fictional world? Late medieval technology, but there is magic and magical resources. There are also animal people."
5
Q: How fast can you develop a frontier village into a barony

grimmsdottirWithin my setting, there are many wild and unexplored lands, some of which are very dangerous, some of which are very benign, but few know how dangerous or safe a place is from the outside. So, there is a very well established Empire, that encompasses all of civilized humanity, with the power of...

That's just so funny to me to ask people on the internet to help you define something as flexible as magic in a fictional world you are designing.
 
3:58 PM
Regarding:
2
Q: How do I change the size of an imported picture in an animation?

FrederickMy code right now plots a function, and animates an image moving along the curve of the function. I want to reduce the size of the image for this animation but I can't figure out how. If I try to change image = Import["image.png"] to image = Import["image.png",ImageSize -> Tiny] it just ma...

I do not agree with the closure as a duplicate of the marked question. The duplicate is far more complicated and nowhere is the simple solution apparent. 75296 is likely a duplicate of another question, or even "easily found in the documentation," but not this one IMO.
I intend to reopen this unless someone can make a compelling argument to the contrary. Even better would be finding a proper duplicate.
 
@halirutan About ContextPath:
BeginPackage["Test`"];
ass = <|1 -> 2|>;
EndPackage[]
Save["test.m", Test`ass]
FilePrint["test.m"]
> ass = <|1 -> 2|>
@Mr.Wizard I agree, I'm sorry, I was to hasty.
 
@Kuba That's not surprising, because Test` is appended to your context path and therefore, all variables can be called (and are used) without there full context.
You wouldn't expect Global` to be in front of every variable although usually that's where they live.
@Ku
bad example
 
4:15 PM
@halirutan I agree. But do I have to create my own Save to save variable that is on context path?
 
@Kuba Nope, just Block the $ContextPath during Save.
 
@halirutan ! thanks.
 
@Kuba np
 
Can anyone confirm that FileNames["*", "*", {n}] does not work? It says in the documentation that "FileNames[forms,dirs,{n}] includes names of directories only if they appear exactly at level n. " but I get an error: "FileNames::innf: Non-negative integer or Infinity expected at position 3 in FileNames[,,{3}]. >>".
 
@shrx Yup. :-/
 
4:34 PM
@shrx yes
 
User Greenonline is bumping up age old posts by editing the word LaTeX occurring in those posts to their latexed equivalent. I suggest we don't encourage this behavior by approving these tiny edits.
 
@Mr.Wizard I chose that linked q as dupe because it had a lot of upvotes. It's posisble there are closer matches, but the link teaches a lot of good stuff, I thought.
Another quick thought is this recent question: mathematica.stackexchange.com/q/73838/245
Actually, the closed question is even a candidate for RTF.
RTFM...
 
5:01 PM
@Jens I think it is probably way too advanced for someone struggling to find the fourth parameter of Inset. I think your recent answer (which I just voted for) is a better choice. Do you disagree?
Fastest spam disintegration I've seen in a while: mathematica.stackexchange.com/q/75330/121 (for those who can see it) -- thanks all!
 
@Mr.Wizard Sure, it's fine with me.
 
Happy Chinese New Year!
5
 
@Mr.Wizard I cannot even tell what they try to sell me.
Maybe I should call their hotline and ask.
 
@halirutan use protection...
 
5:27 PM
@xslittlegrass 恭禧发财
 

« first day (1127 days earlier)      last day (3345 days later) »