@halirutan sorry, I wasn't (I was in the pub). But now I am. Since I know you're an insomniac I guess I'll hang around for a bit and see if you come back. :)
@rcollyer how's life in the WRI stable? Have you met Wolfram yet? Or is this under NDA? ;)
they're slightly different; there's a good question about that around somewhere
basically, Module creates new variables that only look like they have the names you specify, while Block swaps out the actual variables of the names you use and swaps their values back at the end of the Block
it can make a difference if something inside the Module/Block references a variable with the name of a variable you are Module/Block'ing
@OleksandrR. Hehe.. Currently I have a cold and take all the sleep I can get ;-) I'm sure you already found out what I wanted you to ask. It's about this here: mathematica.stackexchange.com/q/19337/187
I imagine cases such as `Experimental`CompileEvaluate@ Select[RandomReal[{-1, 1}, 1000000], # < 0.5 &]`, but anyway, if you have some experience with this function and tips, they are welcome
@Rojo I'm pretty sure Experimental`CompileEvaluate is just Function[expr, Compile[{}, expr][], HoldAll]. I suppose it may be useful in some cases but I've never used it personally.
@halirutan I thought that might be the one... good question, but I'm afraid I don't know the answer. This mutual incompatibility seems to me like it must be an oversight.
@Rojo the main problem I would expect with using this is that if you have even a single non-compilable function included then you've pretty much lost any speed advantage and in fact it's likely to be slower. For that reason I always like to inspect the compiled code myself, which you can't do with Experimental`CompileEvaluate.
@rm-rf -- Sorry I missed you earlier. I do think you and Leonid had a great idea to remake the question as about enum-like types and to make it more general as well. As they exist somewhere, it would prove helpful to access them directly as needed. I just haven't had time to put together another question.
@rm-rf -- Quick follow up. Truly, the idea of code golf never entered my mind, but I do constantly try to refactor my code to improve it and make it more concise or better self documenting. I thought that was fair game, but I better understand now.
@Jagra Yes, Arnoud also felt that such a question would be useful. No rush :)
@Jagra Code review, improving elegance/speed/clarity of code, etc. are perfectly fine here, but golfing generally attracts extremely terse and often unreadable answers, which is why it's generally disliked (only Simon, Mr.Wizard and belisarius seem to enjoy it)
Although some users frown on questions that don't have an immediate practical use for the OP, I personally (and I think many others do as well) consider questions out of curiosity (like the one you asked) useful as long as they're generalizable and not frivolous
@rm-rf -- I actually had a very immediate use for these enum-like types, although not mission critical if you take my meaning. I do like that golfing threesome, but take your point. I much prefer answers on the site that come with explanations. They make everything that much more useful. Thx for the thoughts.
@Szabolcs I thought AT&T uses GSM, so all you need to do is get them to unlock the one they sold you? (I had to do that for someone so I found out more than ever wanted about the US carriers)
It's not a smart phone, but it works fine for talking (at least it did in all other countries---sound is often choppy here with AT&T), and I don't want to spend money on a new phone.
@acl Oh I have the pre-paid thing. You know how that worked? The first phone number I got belonged to a hooker. It took me two weeks before I realised why people kept texting for an appointment.
@acl When I got suspicious, I googled the number, and all became very clear
Then other little things: my number stopped receiving texts two times. Of course I only need to call them and ask them to fix it. But here it takes up to an hour to get through to a real person and talk to them.
This time auto-pay failed, so yesterday my number didn't work. Okay, I paid, got it working. But today auto-pay kicked in and took an extra 50$ from my account ...
have to call them again and not looking forward to it
@acl Yep. DId you know here it costs money to receive calls?
is this with the hooker-number or did you get a new one?
actually you could have sent back an SMS saying "this is the new owner of this number. for $50, I'll refrain from calling back until your wife answers and then telling her what you just wrote" or something like that
but I guess it'll stop being fun after the first 3-4 times
@Szabolcs sounds horrible. If I were you I would probably be considering buying a new phone just to get away from AT&T. Once you consider what your time's worth, and that you have to call them up frequently, and that it takes ages to get through, it'll probably pay for itself quite quickly
I have practically the same problem as this: http://mathematica.stackexchange.com/questions/19337/type-conversion-librarylink-mint-vs-mathlink-integer-type Except not with MathLink/LibraryLink but MathLink / MATLAB engine
@acl I worked for companies having a massive customer base before. An "error" of a few cents per bill per month gets to a millionaire profit at the third quarter. A few legal problems do not interfere with them unless there is a class action
@Szabolcs I call BS on that... this is just unadulterated corporate greed. There is no reason that a text message should cost 20¢ to send and receive... it works out to something like 1.5-2 million $ /GB of data transfer. Ridiculous.
The big question is: can I assume that MLPutInteger16, MLPutInteger32 and MLPutInteger64always work with 16, 32 and 64 bit integers regardless of platform?
Just an integer model. It means: integers, longs, and pointers are all 64-bit. Common alternatives are LP64 (longs and pointers are 64-bit; ints are 32-bit--the most common definition) and LLP64 (long longs and pointers are 64 bit and the rest are 32-bit--this is used on Windows)
Life would be so nice if it were almost always true that short=16, int=32 and long=64 ... funnily I'm pretty sure the other choices are motivated by making porting / backward compatibility easier
@Szabolcs in fact, looking through mathlink.h, it would appear that no attempt whatsoever has been made to support ILP64 platforms... only ILP32 and LP64 are considered.
@belisarius No, there was a gadgets site but it closed way back in 2010. However, depending on the appliance, you might be able to shoehorn it into question that'll fly on one of the existing sites
@OleksandrR. No problem. I have a bluetooth headset. Charger is broken. I want to try to recharge it using a USB port, and don't want to risk the appliance
@belisarius so, I guess it should charge from USB. If it doesn't, you can cut the charger plug off the broken charger, and cut a USB cable in half, and join them together, and then it should charge off USB...
@belisarius all USB is 5V so you should be able to plug it in anywhere. It isn't like Firewire where the voltage could be anywhere between 5V and 48V.
Note: Main OK point from below is that a power supply with the correct voltage rating and a higher than specified current rating will be OK to use in the vast majority of cases. The situations where this does not work are so rare as to be worth risking unless major safety or $ value concerns exis...
@Oleksandr Do you know anything about what sort of assumptions I can make about how size_t would map to (unsigned) int/long, in practice (i.e. Win/Lin/OSX)?
Ok here's the thing. She's my ex.
I want to write an app for her (in Java) for V day. Nothing overly complicated, or overly love-ly. Something mild, something that says I miss her - but in a fun and interesting way.
Suggestions?
PS: I'm not sure what to tag this question. If this breaks any of...
@belisarius not unless it's an Apple charger (they connect certain resistors to these lines so that Apple devices can refuse to charge from non-Apple chargers)
@rm-rf I wrote a snake game for a girl's birthday (not my gf) once in Turbo C++. Ran only on DOS in character mode. I did it on a friend's computer in a dorm, as I didn't have a computer. She liked it and played it :) Those were the days
OK well I don't know what they do but my ipad does charge from all computers I've tried. I now just plugged an iphone that was lying about into my phone's wall plug (also usb, not apple) and it charges
Here is a solution that uses a BezierCurve to indicate a "snipped" axes. The function snip[x] places the mark on the axes at relative position x (0 and 1 being the ends). The function getMaxPadding gets the maximum padding on all sides for both plots (based on this answer). The two plots are then...
@OleksandrR. strange, I tried just now in an iphone 3g (which is old and not mine). let me try later with an iphone 4 and an ipad to see if they charge
@belisarius I made another 3D version of your fountain such that when it's rotated the gravity vector is always aligned screen-down, so the water sprays in an arc, like a garden hose. Should I add that to my answer?
@MichaelE2 I think the best way to decide what's appropriate is: would you like to read this? If so, it's appropriate (unless you have particularly deviant tastes)
Hi everyone. Can someone try to import the following excel file: fonseca.info/myftpdirectory/Book1.xls The file contains two distinct dates, but Mathematica retrieves two equal dates...
@OleksandrR. I might be incorrect about some of this, but it looks like: 1. Mma doesn't come with Java on a Mac and uses the system Java (which is either included with the OS or auto-downloaded when needed). 2. A full JDK comes with OS X, not just a JRE. javac works. The version included is 1.6u37. 3. You can install Java 7 from Oracle, but if you install a JRE, it's only used in the browser. You need to install a JDK to have it used in other apps.
I haven't installed the Java 7 JDK yet, but I believe if I did, Mma would use that.
The things my bird likes the most are those that are forbidden to touch, like the computer. Could lure her anywhere with a computer ... sometimes a bit difficult to type
@Szabolcs Yes. Java on OSX has always been special. They were always some versions behind and were never provided through the usual Sun/Oracle sites AFAIK.
@rm-rf No, no. Please don't misunderstand me. I'm in the middle of a twisted thing and have a lot of my deteriorated neurons dedicated to hold useless info. I can't rethink that right now.
@P.Fonseca okay. Not easily, no. (I'm using Windows 2003.) But I will try it later. Judging by the problems Mma has with time zones this seems a plausible explanation
@halirutan I suppose so... it's because I could get it for free but this isn't the case for the other versions. Also I actually don't like the other versions very much
@P.Fonseca how strange that UTC+1 and UTC+2 have problems whereas GMT doesn't. I wonder what happens if you live in the Azores (UTC-1) or South Georgia (UTC-2)?
and would like to not have the legend obscure the lines. I don't want to put it outside the plot. is there some simple way to make it (eg) 2-column? or do I have to do things manually?
@P.Fonseca South Georgia even more so, I should imagine. Maybe not so attractive for a visit either, being a barren rock. In fact I don't know if anyone lives there at all
@acl @OleksandrR. Açores is a strategic place for the crossing of military airplanes from the USA to Europe. So, although in the middle of the ocean, it has a history of development accelerated by its strategic interest. One of the islands, where Portugal rent’s a “small” piece of ground for an USA air base, is really a mixture of culture between Portugal and USA. As you can imagine, a military base in the middle of a small island, can easily “impose” its ways of living.