« first day (169 days earlier)      last day (4332 days later) » 

12:00 AM
0
Q: Optimizing all permutations of certain equations

NickI'm solving an optimization problem in Mathematica. Here are some of the constraints: eq12 = 4 z1 - 3 z2 - 4; eq13 = 2 z1 - 2 z3 + 2; eq14 = 1.5 z1 + z4 + 1; eq23 = 7 z2 + 2 z3 - 3; eq24 = 10 z2 - 4 z4 + 2; eq34 = z3 + 5 z4 - 5; (The actual constraints are eq12 > 4, eq13 > 4, etc...) From th...

 
@belisarius Lets see
 
in addition to x /. x->x+1 I am not sure what else he wants
 
@belisarius I think it's about doing all the thrading and generate all the replacement rules he needs automatically
 
That is easy
And@@ ... Thread ... using upvalues
 
If it's easy you shouldn't answer
 
12:07 AM
But he should provide the skeleton of minimize he is using
 
because you are bad at samaritanism
 
@Rojo I bet you $5 I will downvote the first answer
 
Hahaha
I bet you 5$ you will
 
ok. deal
posting the first answer now :DDDD
 
You sure?
 
12:09 AM
not really
ok you won. I can't stand a bet
 
Haha
Now post your real answer
 
Nahhh it's too much work because he did not post the skeleton. I know what follows. When you made up an answer he comes again and says ... "that is not my scenario"
 
That's true
You got experience
 
he he he
yep
@Rojo He who doesn't know how to ask, doesn't kow how to thank
2
 
I would star that
but then again
I choose not to
 
acl
12:14 AM
@Rojo restraint is the mark of a man
 
@acl haha
 
@Rojo You have a strong will
 
Hehe
 
acl
what is a "higgs boson"?
 
It's a fat particle
 
acl
12:23 AM
aha
 
It's what makes me fat
It's what makes the fat particles that make me fat fat
Comes, does its job, and disappears before anyone watches
@acl, honestly, I haven't got the slightest idea
 
acl
"Renormalization of Yang-Mills theory is one of the biggest achievements of twentieth century physics"
biased, much?
 
Hehe
They put some money on that LHC, so it better be big
 
@Rojo The Higgs is the "mass field". Everything in physics is a field now ... excpt mass. If the Higgs is there, then everything is a field and physicists can forget at once and forever all non punctual particles. Isn't it great?
 
12:41 AM
@belisarius, is it?
Hehe
 
@Rojo Of course! Physicists say so!
 
@belisarius Then great!! I'm glad for the field of Physics then
and the field of physicists
 
@Rojo both are the same. that was clearly stated by the physicists a century ago
 
CHM
@Rojo I haven't evaluated your answer yet, but if it works, I'll feel ashamed.
Wow.
Can you explain this to me please? I don't get how it works so easily.
 
Oh, @CHM, I didn't see you had asked in here
Did you understand?
In any case, it's a start, because you put "$900" in your example and expected it to be grouped
 
CHM
12:55 AM
@Rojo I'm not familiar with the i: X:>i syntax.
@Rojo I do expect it to be grouped if possible, but I get it that it would require some fiddling
 
i:NumberString
NumberString is a pattern
i:NumberString just names that pattern i
i:NubmerString:>i is a rule that fits a NumberString and turns it into itself (doesn't do anything, but however matches)
 
I tried to plot this: Plot[x^1.2, {x, -10, 10}, PlotRange -> All]
It shows only the positive values in the plot, then I made this: Table[x^1.2, {x, -10, 0}]
It gave me: {-12.8221 - 9.31577 I, -11.2992 - 8.20937 I, -9.80992 -
7.12733 I, -8.35748 - 6.07206 I, -6.94607 - 5.04662 I, -5.58112 -
4.05492 I, -4.27002 - 3.10235 I, -3.02345 - 2.19667 I, -1.85863 -
1.35038 I, -0.809017 - 0.587785 I, 0.}
Those values are complex numbers, aren't they? What happen with them when you try to plot them?
 
CHM
@Rojo Hmm. I'll play around with some strings to make sure I get it ;)
Thanks a lot!
 
1:20 AM
@CHM no problem
 
 
3 hours later…
4:13 AM
@GustavoBandeira Complex numbers aren't valid points in Graphics[]. How would you position them in the Cartesian plane anyway?
 
 
2 hours later…
6:20 AM
@SjoerdCdeVries What happens exactly when you try to use it? Does CCompilers[] return it?
 
 
3 hours later…
9:17 AM
@belisarius I wonder how long it will be before someone writes a book on how the Higgs boson was found. Like Simon Singh did with the proof of Fermat's last theorem.
 
9:27 AM
0
Q: Formatting support for \[LeftDoubleBracket] and \[RightDoubleBracket]

Mr.WizardIt has become common practice on Mathematica.SE to us the Unicode characters for a number of Mathematica symbols. This works because these are correctly interpreted when copied and pasted into a Notebook. Mathematica provides double-bracket characters for Part application. These can greatly im...

 
 
1 hour later…
10:37 AM
Congratulations @JM!
 
Awesome, I now have access to the mod tools...
(:D)
 
@JM Congratulations. Prepare to be underwhelmed.
 
@Heike No need for prep, I was already sufficiently underwhelmed at math.SE... ;)
 
Congratulations on the big 10K.
 
It's great that we have six active users with 10k who are not moderators (and I think at least two more fairly soon at current rates).
 
10:46 AM
(thanks, everybody)
 
Would one of you do me a favor and edit a post for me? I'm trying not to use up all my edits-before-CW.
 
@MrWizard I thought edits by other people also converted questions to CW
 
@Heike As far as I know that's by a different mechanism: number of people making edits, versus number of edits.
 
Oh, ok. What do you want to edit?
 
In this the line dPcore[L_, p : {q__, _}] should be dPcore[L_, p : {q___, _}]
I have a feeling I'm going to be making more edits to this in the future and I don't want to "waste" one on a 1 character bug fix.
 
10:53 AM
@MrWizard I've made the edit
 
Thanks.
 
11:04 AM
See you later.
 
 
1 hour later…
12:27 PM
I had intended to make the following question community wiki, but there doesn't seem to be an option to force that manually. Didn't there use to be a tickbox to do that?
0
Q: What are some general strategies to avoid using For loops

VerbeiaWhile there are some cases where a For loop might be reasonable, it's a general mantra – one I subscribe to myself – that "if you are using a For loop in Mathematica, you are probably doing it wrong". But For and Do loops are familiar to people who already know other programming languages. It is ...

 
@Verbeia It's a mod-only feature for questions. Are you sure you want this CW?
 
@JM well, it's a deliberate attempt to create a canonical resource for new users. I'm just not sure I should actually milk rep for that. But let's leave it and see whether it starts looking like a collective effort CW.
 
@Verbeia it looks like you're semi answering your own question in the question itself.
 
@Heike Yes, Mr.Wizard just suggested I split it out into an answer, so I am in the process of doing that.
 
1:11 PM
@Szabolcs I noticed while I was working on a recent CUDA question that I couldn't compile the example in the documentation anymore. CUDAQ didn't give me True so I tried CUDAResourcesInstall[Update -> True] to force a reinstall, which didn't work. I then discovered that CCompilers[] didn't return Visual Studio anymore.
Unistalled all compiler stuff. Reinstalled VS and the SDK. SDK install broke. Uninstall all, installed SDK only. Install worked, but compiling didn't.. Unistalled again, VS again and SDK. SDK install broke off with an unspecified error again.
 
@verbeia will you join me
 
@MrWizard This was confusing. Was working on the same post as you did
 
Um... oops? That's why I'm trying to get @Verbeia in here to talk; I don't want to be working at cross purposes.
 
1:26 PM
Well of to work again.
@JM congrats!
 
@SjoerdCdeVries Okay, I'll try not to make a wreck of the place while you're out.
@RM What happens if I "reopen" a merged question?
 
acl
@Heike it's hard to make the work of huge impersonal groups sound sexy though
 
R.M
@mrw I'm not sure. I think it leaves it as a stub without answers... Merges can be undone but it's a dev tool. It probably won't bring his draft back
 
2:00 PM
@SjoerdCdeVries Yes, it's so delightful to have access to 10k tools... :D ;)
Nah, the drafts aren't stored anymore post-merging. Which is very unlucky for Leonid.
 
In light of the mess-up that I caused as the result of that merge being late, I propose that in the future, if a question is to be merged with one that must first be migrated from StackOverflow, the new question be Closed or Locked until the migration is complete and the merge is ready. Will this be helpful?
 
@acl To be honest, I don't find Oxford dons particularly sexy either (at least not the ones I've met).
 
R.M
@MrWizard why not have a moratorium on merges? There were a lot of questions merged that I didn't think were worth merging
Duplicates, sure, but not identical... so when you merge them, one has a set of answers from the other and they don't make sense.
 
@MrWizard I'd propose leaving a comment that "I'll be merging this question with question xxx in an hour", or some other convenient time frame.
Advance warning, if you will.
 
R.M
2:15 PM
@JM 10, 9, 8, 7, 6, 5,... oops, sorry. I lied.
@Heike What's an Oxford don?
 
@RM That's certainly an option; I wasn't going to migrate this one until Verbeia suggested it. (FWIW I do think it is a duplicate in the sense that we both intend the same thing, and there was only one answer each at the time.)
@JM People could still be composing answer that are lost, no? It seems like a Lock would make clear that the question is not ready for interaction. Still I think R.M may have the right idea; this just wasn't worth the trouble all around.
 
@RM A fellow of the University of Oxford or one of it's colleges.
And by fellow I mean someone with a fellowship.
 
R.M
@Heike ah, ok.
 
A don can also be a lecturer of tutor.
 
R.M
@MrWizard the lock and warn might be an option... people can't compose any new answers and those who have started, might get a warning when locked or will at least not be able to submit.
 
2:20 PM
At least I think so. It's a senior person at least.
 
R.M
Oxford is one of those places where I would like to do a short stint some day
 
@RM It's a funny place. If you go there, make sure you're connected to one of the colleges. You won't know about full Oxford life otherwise.
 
R.M
@Heike Isn't a connection to a college necessary only if you're an undergrad? (at least, that's how it is in the US)
 
@RM In Oxford and Cambridge, Colleges are part of the university. All undergraduates and grad students and nearly all university lecturers are connected to a college. A student has to be accepted by a college to enrol as an undergraduate of the university. Grad students are usually connected to the same college as their supervisor.
 
This is crossposted over at SO. The SO version is older by about an hour, so it isn't like they didn't get an answer over there and repost here. Procedures for this? Vote to close the SO post?
 
2:35 PM
@rcollyer Given that there weren't any answers on the SO post, I think it's safe to close that one.
 
@Heike that's what I figured. But, that isn't a "normal" close reason. I'll have to wing it then.
 
@rcollyer No I understand. I would say it's a duplicate, but I don't think questions on SE sites count.
 
@Heike no, they don't. So, I voted for off-topic.
 
acl
3:00 PM
@Heike but they can be made to look so if you haven't met them, that's the point
 
3:33 PM
@SjoerdCdeVries I'm not too familiar with VS, as it doesn't work so well on this old WinXP machine. But I did use it before and I do know that the VS compiler is detected through environment variables. So the first thing is to open a command prompt and type set to see all environment variables. Verify that you have VS100COMNTOOLS and it's pointing to the correct location of the compiler.
 
Also, see if you can run cl.exe at the command prompt (if the installation messed up, perhaps not, and that would need to be fixed before any issues in Mathematica's detection would become relevant).
 
 
1 hour later…
4:46 PM
Straw poll: for this question, nobody's yet posted an answer expanding on Daniel's suggestion in the comments. I feel that this method is the best and most elegant and have used it recently, but on the other hand the question is old and has 4 answers already. Worth posting an additional answer, or not?
 
@OleksandrR Have at it. :)
 
 
2 hours later…
6:47 PM
Yeah, have at it. I will be needing all those answers next week and I was thinking about doing it as Daniel suggested :D. Glad you linked at that question, I hadn't seen it
Hey @Heike
 
Hey @Rojo
 
I just saw that last question on the game of breakout, that's probably going to be closed, but
it gave me the idea that even though I never did something like that, I'd probably like to do some blog post on the process of creating some game like such as that, in some organized way
I think even though I have no experience and I'm not an expert on dynamic and such, 95% of the people in here aren't either
What do you think?
@Heike
 
@Rojo I think it could be a very instructive thing to do.
 
@Heike I think so too... So I'm open to game suggestions
 
pong?
or some other classic like tetris or pacman.
 
6:57 PM
Pacman!! Haha
I think Pacman is too much for a first
 
I think so too.
 
Tetris could be nice
 
That shouldn't be too hard to implement.
 
@acl, what do you think?
 
acl
@Rojo it would be cool (I was just trying to understand the code in the breakout game)
especially if you also explained what each bit of code does. that would be useful, too
 
7:02 PM
@acl, that's the idea, to show the process
and not just the working code
@acl, any game suggestions?
 
acl
that would be great actually
chess? :)
 
@acl it should be simple, and could be interesting and instructive in a different way than what I had in mind...
Of course, as long as you don't expect MMA to play it
 
@Rojo I'm sure there is an Internal`Kasparov function hidden away somewhere in mma.
 
acl
@Rojo but that would be the fun part! (actually, making a board and allowing only legal moves would be instructive, as you said )
 
@Heike and if not, I put it to play randomly, and he/she who loses against it can't join the forum
@acl, making MMA play well should be terribly hard, and there sure is 203957829348 of research on that. Makes no sense for me to dig in only to make something lame
I think
By the way, all of you, if other ideas not dynamic-related on blog posts you think I might be able to do come to mind, let me know
 
acl
7:10 PM
@Rojo I am aware of that :)
 
@Rojo Aren't there any online chess computers you could (ab)use?
 
acl
ok, tetris?
 
@Heike, I was thinking about that
Hehe
 
@acl That's what I suggested.
 
acl
@Heike right, I hadn't noticed
 
7:12 PM
At least it makes me feel less of a philastine.
 
@Heike, you'll do the dancing russians when someone passes a level
 
@Rojo I don't remember those.
 
@Szabolcs The VS100COMNTOOLS variable is there all right, but no other compiler related variables. It's pointing to the tools folder, but that's not the folder where the compilers reside. I don't know why it doesn't work anymore.The first time I didn't have to set anything. It worked straight out of the box.
 
 
@Rojo I think I played a different version.
 
acl
7:18 PM
I have posted an answer to the symmetric matrix question in which I casually use Flatten with a matrix for the last argument.
 
@acl, haha
 
acl
I am now sitting back, awaiting the deluge of upvotes from the adoring masses.
 
Gotta go now
 
@acl I like using the second argument of Flatten. Especially now that I understand how it works (on a clear day).
@Rojo bye
 
acl
@Rojo bye
@Heike that's the problem, I need to think hard to understand it.
 
7:20 PM
So far Tetris seems a little bit more itneresting... But I'm still open to anyone who sees this to suggest/vote, since I won't be having too much time for a few days
 
acl
and I only understand it temporarily
 
Buhbye
 
@acl It works for me when I'm not trying to think about it.
 
acl
@Heike you clearly have a better brain than I
 
@acl I doubt it.
 
acl
7:25 PM
Up to things like {{2}, {1}} it's more or less OK, above that, I just write loops and compile them
 
I do too little with compile. I never know which functions are compilable and which ones aren't.
 
acl
in addition, my collaborators tend to get lost when they see things like MapThread[Join, {rtmp, Rest /@ Flatten[rtmp, {{2}, {1}}]}] in the codeme
@Heike I find it's generally more useful the closer your code is to C. if you have actual functions, it probably won't make much difference (but that could just be a side-effect of my programming style)
 
@acl That's what I found. The problem is that I'm better at Mathematica than at C so I tend to just stick to actual functions.
BTW, have you tried running the code in this question? It takes ages to import the data and takes up all my memory slowing down my laptop to a crawl.
 
acl
@Heike using this kind of short but dense code is good up to a point of complexity. beyond that, I give up and just write loops. I guess different people have different thresholds (this is what it looks from reading code by some people here).
 
@OleksandrR I see three versions of cl.exe in various folders, but just running cl.exe from the command line doesn't work.
 
acl
7:39 PM
@Heike it does not seem to need more than a few hundred MB here
MaxMemoryUsed[] says 181600640
 
@acl Maybe I should try it again in a fresh session.
I only had 179MB of memory left before I killed the kernel
 
acl
aside: in my previous comment, I meant complexity of the local code itself, not of the whole program. I find this kind of coding allows me to keep more of the program "in view" at the same time, but the upper limit for local complexity for me is something like Flatten with a second argument like {{2},{1}}. more than that and it slips from my mind immediately (but I admit stuff slips out of my mind easily)
@Heike hang on, it seems I missed the second Import. Now see a rising memory usage
(and a comment has been added that this needs memory...)
 
@acl Yes I saw that as well.
It's not exactly a minimal working example.
 
acl
that it is not
 
8:25 PM
@acl good Flattening there! Could have written it as {{2}} instead of {{2},{1}} as well.
@SjoerdCdeVries I think you have to load the vcvarsx86.bat or vcvarsamd64.bat first to set up the environment. The question is, whether or not the C compiler actually works outside of Mathematica.
@JM @Rojo okay then! I will do an answer in a bit.
 
9:09 PM
posted on July 05, 2012 by Wolfram Blog Team

Before you know it, it’ll be October and time for the Wolfram Technology Conference 2012. We thought you’d be interested in finding out more about some of the things we’re doing this year. First, we’re offering a social networking and personalized schedule-building tool for all registered attendees. You can connect with your fellow attendees, arrange [...]

 
9:27 PM
@OleksandrR Do I run both bat files or just one?
 
acl
@OleksandrR OK thanks. how could I have worked that out from the docs?
 
0
Q: Good citizen badge?

JagraNot certain if the site can do this, but I think it could help keep things lively if it could. Could we set up a "Good Citizen" badge awarded when one has answered more questions than they have asked. Even better if it could operate dynamically -- too many questions without answer contributio...

 
@SjoerdCdeVries just one, depending if you have a 32-bit (x86) or 64-bit (AMD64) computer.
@acl good question. I'm not sure. Maybe not.
 
acl
9:55 PM
@OleksandrR in OS X, there is a separate environment (shell vars etc) for GUI programs; does windows offer a unified environment for GUI and command line applications?
 
10:09 PM
tried a complete new installation. Now downloaded the SDK ISO instead of the webinstall. Result seems the same. Installation was broken off. Last few words in the log file: === Logging stopped: 6/07/2012 00:02:08 ===
MSI (s) (74:64) [00:02:08:440]: Product: Microsoft Visual C++ Compilers 2010 Standard - enu - x86 -- Installation failed.

MSI (s) (74:64) [00:02:08:440]: Windows Installer installed the product. Product Name: Microsoft Visual C++ Compilers 2010 Standard - enu - x86. Product Version: 10.0.30319. Product Language: 1033. Manufacturer: Microsoft Corporation. Installation succes
 
@acl Windows is like Linux in that respect, if you know how that works. Windows also doesn't really make a distinction between command-line or GUI apps.
 
Many other parts were installed successfully
 
@SjoerdCdeVries sorry, no idea what that's all about. When I've used it, Visual C++ has always worked fine, although as you know, I mainly use MinGW anyway.
 
@OleksandrR Well, actually I didn't. Any advantage in using that?
 
@SjoerdCdeVries oh right, well anyway I posted about it on Mathgroup on a few occasions. gcc generally is a better compiler than Visual C++ and you can use gfortran too. Other than that, not really.
 
10:32 PM
@MrWizard sorry, I went to bed after that, and then my phone and internet at home went down. Now I'm at work so I can't really do anything for a while. I agree that questions that are about to be merged should be locked.
 
10:43 PM
@Verbeia re: phone and internet down. Are you with Vodafone too :)
 
10:56 PM
@MikeHoneychurch No, Optus - trusty old cable internet. I suspect the weather has brought some lines down somewhere.
 
I have to bluetooth to my phone to go online these days
 
@MikeHoneychurch sounds expensive. I've never had a problem with Optus before - been with them since the mid90s for phone and since about 2000 for cable internet.
anyway better do some work - see you
 

« first day (169 days earlier)      last day (4332 days later) »