« first day (776 days earlier)      last day (2085 days later) » 

12:59 AM
@JacobAkkerboom Yeah, the keyboard issue is two-fold. Most popular languages allow you to get KeyUp events as well as KeyDown events and they also let you poll the current state of any key on the keyboard at any time. The latter way is the most popular method for keyboard input in games. You just check which keys are pressed during the logic phase of each frame update. M only lets you check the modifier keys like Ctrl, Shift, and Alt though.
For games that aren't drawing frames as quickly as possible the KeyUp events can be useful, like our current community game.
M's Dynamic actually makes it easier than most languages to for example have the AI blocks redraw every .1 seconds but still update your character whenever an arrow key is pressed.
I haven't used LISP since the class, but it was a really great class. It certainly made it easy to smoothly transition to the unifying symbolic expression concept in M.
@kirma Good eye. I'd guess reorganization. They probably started that section because of the group of active users that do 3D printing, but then the section itself seemed kind of redundant with Solid Geometry and Importing & Exporting Geometry sections.
@JacobAkkerboom I didn't really understand the Church-Turing thesis until after I learned some LISP, and it was a different enough way of thinking that made Wolfram's survey of universality in NKS really enjoyable.
Because I found M and NKS at the same time when they released v7.
 
 
3 hours later…
3:43 AM
Tldr
 
Understandable. I've had excessive amounts of free time over the past several years.
 
4:36 AM
@MichaelHale That's not an excuse for thinking. Try to play more league of legends
@MichaelHale You're lucky. I lost my notification sound a while ago (surely while misconfiguring something else) and I can't recover it
 
Lol. Who decided on the notification sound for this chat? It is terrible. I was spacing out listening to Neanderthal Bone Flute Music: youtube.com/watch?v=sHy9FOblt7Y
@belisarius I don't have much experience with MOBAs.
 
@MichaelHale You're lucky. I lost my notification sound a while ago (surely while misconfiguring something else) and I can't recover it
 
I recently discovered the Awesome Games Done Quick fundraiser. I had no idea people would replay games that many times.
I don't think good games are produced fast enough. I want to be overwhelmed by choice there like I am with music.
 
@MichaelHale Any Vivaldi's is more complex than any game. And Vivaldi made thousands
 
But games can include all of Vivaldi's compositions. Vivaldi's compositions can't include all games.
 
4:49 AM
@MichaelHale That's not fair. A elephant can have maps drawn in its skin, and maps can have elephants pictured on them. So, every elephant is as complex as all maps.
 
Elephants are definitely as complex as maps. I can generate pages of complex cellular automaton patterns, but I might only look at them for a few minutes while spending hours listening to minimalist music by Steve Reich and Philip Glass.
 
@rm-rf Is there a way on SE to make a poll to know what is the distribution of out users' first language?
 
I was just referring to the space of ideas that can be expressed through the given artistic medium of music and games. Music is sound waves, and games can contain sound waves.
 
@MichaelHale That depends on where the elephant is
 
Music can suggest images in your head, but it's not the same as streaming light into your eyes. It can come with cover art though.
Cool pic. My first thought was Ayers Rock.
 
4:59 AM
@MichaelHale :) Have you read "Le Petit Prince "?
 
I haven't, but I'm familiar with it from best-selling or most-translated books lists.
 
@MichaelHale That drawing is from the book :)
 
@belisarius Not on SE, but feel free to set up a surveymonkey or something like that and run a poll.
I've seen TeX - LaTeX run polls on its meta to find out users' geographic distribution (and perhaps for other things), so it might be possible to do something like that.
 
@rm-rf Ok. Thanks. I'll Try. Perhaps we could post an ad asking the users to fill the questionnaire
 
@belisarius Hey, not a bad idea! :)
I'll bet a good majority of the users don't have English as their first language.
 
5:08 AM
@rm-rf That's my suspicion ...
 
@belisarius You can toggle the options in the little speaker icon at the top of this window (to the left of the "all rooms" button)
 
@rm-rf That's how it is set right now
@rm-rf But no sound
 
@belisarius Ah, ok. Well, my sound is usually turned off
 
I don't mind a sound. I frequently wander over to the couch to watch Netflix or YouTube. It's just that particular sound reminds me of a program crashing.
 
@MichaelHale Chat.SE's is probably the most jarring...
http://cdn.sstatic.net/chat/so.mp3
http://cdn.sstatic.net/chat/meta.mp3
http://cdn.sstatic.net/chat/su.mp3
http://cdn.sstatic.net/chat/sf.mp3
http://cdn.sstatic.net/chat/bonfire.mp3
http://cdn.sstatic.net/chat/ubuntu.mp3
http://cdn.sstatic.net/chat/se.mp3
 
5:22 AM
Interesting. I didn't know they all had separate sounds.
 
@MichaelHale They don't. Only Stack Overflow and Meta Stack Overflow have sounds different from the rest of the network... for historic reasons.
 
Oh. I'd select the sf.mp3 if those were the choices in user preferences.
 
@MichaelHale You've to pay for it. The whole SE revenue is based upon users who hate their notifying tunes
 
5:34 AM
@belisarius Fools! If only they had based it upon users who hate their mods, you'd have single-handedly made them profitable ;D
 
@rm-rf I don't need to hate someone to ... you know
 
 
2 hours later…
7:12 AM
0
Q: Generating high quality charts in Mathematica for use in latex and word docs

olliepowerI decided to ask this in meta because I did not feel it was specific enough to be asked in the mathematica forum. Mods, please redirect if I am out of line. I frequently have a probelem using my charts in reports because the text (axes labels ant tick marks) look low resolution (fuzzy). When...

 
 
1 hour later…
8:31 AM
We now have food, energy, and a score. I changed the player to yellow and added position trackers on the side because my deuteranomalous vision was struggling with the red dot on speckled green and brown background.
landscape =
  Map[If[# < .47, 2,
     If[RandomReal[] > Rescale[#, {.45, .53}], 5, 1]] &,
   GaussianFilter[RandomReal[1, {100, 100}], 5], {2}];
people = RandomChoice[Position[landscape, 1], 200];
pos = RandomChoice[Position[landscape, 1]];
x := pos[[1]];
y := pos[[2]];
dir = {0, 0};
score = 0;
energy = 100;

validQ[p : {x_, y_}] :=
  If[Clip[p, {1, Length@landscape}] == p &&
    MatchQ[landscape[[x, y]], 1 | 5], True, False];
move[p_, o_] := If[validQ[p + o], p + o, p];
randomMove[p_] :=
  If[RandomInteger[3] == 0,
 
8:50 AM
3250 on first full run. Had to wait to die after all the food was gone so we might want to lower the amount of energy given per plant.
 
9:06 AM
@MichaelHale I got 3800, I also had to wait. It was quite interesting, as for me there were certain areas of the map that were relatively isolated, but that had a lot of food. I first ate all the food in areas where there was a lot of competition, and then went back to the areas the AI "couldn't get to".
I just looked up the Church-Turing thesis as well :P
 
 
3 hours later…
11:49 AM
@belisarius perhaps fun (or perhaps the opposite of fun :P). It is perhaps the craziest code I have written
0
A: Custom highlighting in definitions

Jacob AkkerboomCrazyness! Ok so this behaviour relies on something like x = s_; f[x] := s behaving like you how you want it to. I must say I am guilty of making crazy definitions myself. Personally I don't like leaving any evaluation on the left hand side up to SetDelayed in cases like these. Anyway, you can do...

 
Let's see
@JacobAkkerboom I guess so. I can't even understand the question
 
@belisarius yeah I was also taken aback by it. Especially the definition using Quiet. The idea is that you have want to be able to input a symbol that will be the name of a pattern. That is also the idea in my answer, but there I first extract the symbol from another pattern :P
 
@JacobAkkerboom I think I need some sleep before even trying to understand a convoluted problem right now. Sorry, but the two neurons that are still awake aren't the better ones of my dozen
 
@belisarius ah, well, it wasn't a very serious Q&A anyway :). Say hi from me to your other neurons when they wake up :P
 
@JacobAkkerboom _IF_they wake up :)
 
 
4 hours later…
3:50 PM
posted on March 04, 2014 by Wolfram Blog Team

As an instructor at the School of Architecture Paris-Malaquais, Maurizio Brocato chooses to use Mathematica because he finds alternative solutions “less complete.” Only Mathematica incorporates the requisite image, logic, and mathematics functionality into one platform. Brocato teaches his doctoral students the importance of understanding formal and fundamental viewpoints, and his g

 
 
3 hours later…
7:02 PM
Does anyone know if there's a built-in function to calculate the julian day (or the nth day of the year) for a given date? For example, {2013, 3, 1} would be 60. I know how to do it using the date functions + logic, but I'm not sure if I'm missing an option.
 
@rm-rf maybe DayCount[{2013,1,1},{2013,3,1}]+1, could be something simpler though
DayCount[{2013}, {2013, 3, 1}] + 1 has slightly simpler syntax
 
Concerning my “Custom highlighting in definitions” question… I find myself repeatedly using the same (complex) patterns in different definitions. When something happens more than twice, it needs to be abstracted. Yes, it's not clear (for now) how to predict behaviour of LHS evaluation but I really don't see why should the problem itself be easily dismissed.
 
Hi @rm-rf! What's up?
 
7:23 PM
@LeonidShifrin Hey
Taking a break?
 
Hi @Rojo. Well, sort of. But this time I am here since @rm-rf wanted to discuss something.
@Rojo How are things going?
 
@LeonidShifrin Good, good. The derivative of things at least is good and that's what usually defines how I'm doing
These last week was a tooth pain torture, so now this corticoid injection makes me feel in heaven
What about you
 
hi all!
 
@belisarius On behalf of all, hi
 
@Rojo Well, I am generally Ok, just a bit sick this week, taking a bit of a break to get back to shape. Things are going mostly Ok, I just got a little tired recently, it has been more work in the last couple of months than I find comfortable. But I guess many of my colleagues would tell a similar story.
Hi @belisarius
 
7:33 PM
@rm-rf You here?
Please tell me what do you think about this poll
Should I add any other interesting question?
@LeonidShifrin @Rojo too ...
 
@belisarius What's that for?
 
@Rojo I'm curious about our language distribution
 
@belisarius Done. Good thing I didn't put my username. Otherwise, people would know that it was me. (only one that answered so far)
 
@Rojo Oh! yes. That information is absolutely confidential, I understand
 
@belisarius I can't say anything constructive, because I don't know the context of your interest in this. Could perhaps ask also which languages one'd like to learn if given some free time / opportunity.
 
7:43 PM
Such as R, Scala, etc
 
I meant human languages, since the survey seems to be about those. Or is it about programming languages?
 
I already know some Mathematica. Now I'd like to learn the Wolfram Language
@LeonidShifrin I'm just kidding. I also don't konw much about the context
@LeonidShifrin I'd suggest to you not to overwork yourself and choose your limits, but. Given that I'll benefit from your work in v10, it's hard not to be selfish
 
@LeonidShifrin It's about human languages. My main interest is to know how many native English speakers are lurking here vs. the rest
 
@Rojo The problem is that for complex projects, they dictate their own development pace, and sometimes you just have to work more because otherwise you just can't overcome certain barriers. Add to this the overall rush and pressure we are all under, and you get the picture. And the current project is easily the hardest one I'we worked on so far.
@belisarius That's what I kind of figured
 
Hi @LeonidShifrin
 
7:51 PM
@LeonidShifrin I see. Are you able to tell what project?
 
Yay rm is here (excuse my enthousiasm)
 
I wanted to ask you about the right way to "read in" symbols from a subpackage/subcontext into a package. Consider these two structures:
Package/
|- Kernel/
    |- init.m
|- SubpackageA.m
|- SubpackageB.m
|- Package.m
and
Package/
|- Kernel/
    |- init.m
|- Package.m
 
Hi @rm-rf.
Ok
So?
 
I usually use symbols from other sub-packages with Needs["Package`SubpackageA`" instead of the second argument of BeginPackage. I've noticed that sometimes, it produces shadowing warnings when the same symbol (in the subpackage's private context) exists in the Global context
Even though the sub-contexts are not added to the context path, a warning is generated. I've not been able to reproduce this at will.
Oh wait... perhaps I should be using AppendTo[$ContextPath, ...].
 
@rm-rf Here is what may cause it: when you use BeginPackage, with non-trivial second argument (list of contexts), they are cached. Then, when you call Needs, even though it is not apparent, all those packages are also added to the $ContextPath, not just the one you mention in Needs.
 
7:58 PM
@LeonidShifrin I don't use the second argument of BeginPackage...
 
@rm-rf I meant when defining those packages which you then load via Needs.
@rm-rf I did have similar cases of sudden shadowing messages, and I seem to remember that those were due to this stuff.
 
@rm-rf You have some example files?
 
@chuy That's also what I came up with. On a second read, that does look pretty darn straightforward and it seems pointless to needlessly look for a "built-in". Thanks! :)
@Rojo MATLink is an example... in this case though, it's the subcontext that's loaded in the same manner.
 
@rm-rf What has to be run to get the message?
 
@rm-rf I would not use AppendTo[$ContextPath,...] unless absolutely necessary. It would be far better to debug this and find the reason. It is rather unlikely to be a bug in Mathematica.
 
8:03 PM
> I've not been able to reproduce this at will.
hehe... Sorry.
 
@rm-rf Perhaps because you not always have the symbol already defined in your global context while loading?
 
@Rojo The way it's written, I don't think there should be any conflicts, regardless of whether the symbol is defined in Global or not. However, I've seen some shadowing errors when working, but I was too busy then to dig into the problem... I don't know if it's some sort of race condition.
This is probably too vague to ask anyone to debug (which I'm not!)... I just wanted to know if I was reading the subpackages/subcontexts in correctly or if there is a preferred way to do it.
 
@rm-rf Oh. I've used some weird unrecommended package structures and so far, all the messages made sense
so perhaps it's just something you overlook and hadn't had time to recheck
 
@rm-rf As far as I can tell, the shadowing messages always appear for a reason. This means that, however temporarily, you had some symbols exposed to the $ContextPath more than once.
@rm-rf You can debug this rather easily: overload Message via a dynamic environment, and search for Names["*`yourSymbol"] once you get the shadowing message - you can extract the symbol name from the message text. Run your code in a dynamic environment, and you'll see which contexts are conflicting, when and why.
 
@LeonidShifrin Ok. I think I'm beginning to get a sense of where this error might come from... suppose I do AppendTo[$ContextPath, "ContextA`"];AppendTo[$ContextPath, "ContextB`"] and I happen to have a Module[{x}, ...] in each of them, then both of them will have an x in their respective contexts which are both on the path.
 
8:14 PM
@rm-rf Weren't the symbols in the private contexts?
 
@Rojo See, that's my mistake. I didn't create a sub-sub-context for the sub-context :)
 
@LeonidShifrin I sometimes find it easier to do TraceDialog[theCode, Message]
@rm-rf Oh, that I've run into too. Everything inside Private except for the declarations :P
 
@rm-rf Ok, that makes sense.
@rm-rf I assumed that all your packages have Private domains, so did not think in this direction
 
0
Q: Mathematica SE (human) language survey

belisariusI'm curious about the site users' distribution of native (and other known) languages. I made a poll using SurveyMonkey that can be found here I would like three kinds of feedback Suggestions for other interesting questions Someone with better artistic abilities than me to design an add Your ...

 
@LeonidShifrin The packages all do. The subcontexts (within a single file) didn't have their own private context and I forgot about this :)
 
8:17 PM
@rm-rf Ok, I see. But it does it make one to understand the namespaces in Mathematica better, does it not? :)
@rm-rf I am using it currently and find it more convenient in some ways
 
@LeonidShifrin As long as it's alternative and not replacing, great
 
@LeonidShifrin It certainly does, and in hindsight, this was 100% expected and I should've seen it. This almost never came up during all my package development/testing because the order in which the functions are called (which depends on the usage) could be such that the x in Module is used from an existing context. It would have to take some fortuitous order of function calls to trigger the shadowing.
 
@rm-rf Re: order-depending shadowing - well, this is another manifestation of the fact that the namespacing in Mathematica is not a bulletproof mechanism (just like scoping), and can be broken. I like it though - it is simple and very user-controllable
 
9:18 PM
hey buddies!
Quick question: given the list mylist={{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}; how can I use Cases to select those elements whose Max at a certain position is <9?
Something like Cases[li,_?(Max[#[[All,3]]<9)&]
would, ideally, output {4,5,6}
(my real list has 3 levels, so this is why I need the maximum and not just the position at 2nd level)
 
@Sosi I don't understand " whose Max at a certain position "
 
Ok, let me elaborate. I'm sorry that was confusing (tiredness is a problem at this time of the day)
given mynicelist = {{{1, 2, 3}, {4, 5, 6}}, {{7, 8, 9}, {10, 11, 12}}};
if I calculate Max[mynicelist[[1,All,3]]] I get 6, and Max[mynicelist[[2,All,3]]] I get 12.
 
Sosi, What is the desired output in this case?
 
@JacobAkkerboom Pi :)
 
Huhu :P
 
9:31 PM
I therefore want to calculare all subsublists whose elements in 3rd position are larger than Max[mynicelist[[1,All,3]]] or something similar
hum, I think this is still confusing :s
 
yep
there is none
 
ok, I need a few more minutes and I'll come up with a decent mwe
ya xD I now noticed it too xD
I need a couple of minutes
 
Ok, here it is
given list={{{1, 2}, {2,3}, {4, 6}}, {{7, 8}, {10,14},{5,7}}};
for each element of list: compute the Maximum at position 2, and find all cases where subsublists have elements at position 2 with value = Maximum/2
this would output {{2,3},{5,7}}
 
@Sosi note that there is a mistake in Cases[li,_?(Max[#[[All,3]]<9)&]. The bracket should be around the & symbol. I know you said: "something like this", but still, Pattern test is tricky like that (and in this case can be completely avoided using Select instead of Cases btw). Ok now let's see :)
 
9:37 PM
@JacobAkkerboom thanks!
 
So, for my latest example, it should be something like Cases[list,_?(#[[2]]===Max[All,2]]/2&),2]
the problem is with finding the Maximum, as you can see it is wrong as is
I hope this makes it easier for you helping me :)
 
Something like this?
Function[xx,
With[{max = Max[Transpose[xx][[2]]]},
Select[xx, max == 2*#[[2]] &]]] /@ list
which gives

{{{2, 3}}, {{5, 7}}}

Which I suppose only has too many brackets :P
 
eheheh that is not a problem. I was hoping everything could be done inside one single function (i.e. inside a single Cases or Select), but that works too. Also, why did you choose Select over Cases?
 
Hm ah I always prefer Select when there are not really patterns involved
btw the Transpose is silly, it can be done with part
Function[xx,
With[{max = Max[xx[[All, 2]]]},
Select[xx, max == 2*#[[2]] &]]] /@ list
 
9:46 PM
Indeed, it works well! Now let me try with my real example
:D
thank you so much!
 
@Sosi no problem :). It is nice to translate language into MMA code like this
btw if you are using cases like this, you will have shorter syntax with select ;)

select = Function[{list, func}, Cases[list, _?(func)]]
probably more speed too
 
meh, it doesn't work with my example... :S
and I'm already too tired :s
can you solve my tiredness too? :P
 
hehe
<<Energy`

reloadBatteries[]
Sleep[]
I don't know :P
 
:c
 
Too bad it didn't work on your example
 
9:53 PM
the real problem now is my tiredness that is preventing me from finding out what is wrong
i guess i'll call it a day, since it's almost 11pm and i still have to go home
omg
i got it
 
i'm so stupid!
 
that was quick!
 
in my real example, there is no such thing as that equality! it's only an approximated number!
so i have to define an interval -.-
 
Ha, well you figured it out mid-sentence. At least you were multitasking :)
 
9:54 PM
see?
xD
btw, is that your cat?
 
:P
Ah no, unfortunately not
But my landlady has a nice cat
 
eheheh it's pretty!
i used to have a cat too
 
Hehe yeah. I like its "facial expression"
Ah nice
Are you are cat person? :)
 
i used to think i was more a dog person
(btw, it IS working now! thanks! :D)
 
My landlady also has a dog that kinda scares me :P
:D :D :D
yaya
I hope you sleep better for it :)
 
9:56 PM
but i never had a chance to have a dog, only a cat. And I loved it! it was so laaaaaaaaazy
 
and it loved yogurt! it used to close his eyes while eating yogurt, so delighted that it was
 
The cat in my avatar looks attentative, don't you think? :P Probably the only non-lazy cat
Haha
 
eheheh it's pretty!
:D
ok, now I can rest and finally go home!
 
I used to sometimes give my landladys cat some milk or other dairy.. but it didnt handle it too well
 
9:58 PM
why?
 
Ahh ok
It had to puke.. I'm not entirely sure if it was the milk, but it seems likely
 
you know
i was told (but i'm not sure whether it is true or not) that you shouldn't give milk to a cat :P
my never had a problem with the yogurts, but we only seldom gave them to him
 
I guess the lactose isn't so nice for them
 
:)
well, I'm off!
thank you so much for the help buddy
it was very very nice
 
Alright, have a good night :). Again, no problem :)
 
10:05 PM
Some upvotes here, please
 
 
1 hour later…
11:08 PM
@belisarius Is it possible to see the survey results in real time (via a link)? Or can only the creator veiw it?
 
@rm-rf The only way of getting the results (for free) is via graphics and log-ing in as the creator. All other options are $$$
 
oh well...
 
@rm-rf but the app isn't clear ... at all
let me search a little
 
11:56 PM
@rm-rf Nope, they try to monetize the service too early. They don't allow downloading data or sharing the result pages for free. I'll take care to keep the results up to date, though
 

« first day (776 days earlier)      last day (2085 days later) »