« first day (2235 days earlier)      last day (2239 days later) » 

1:13 AM
@PlatoManiac Looking at the implementation it seems it's broken. But answered with what I dug up.
 
1:39 AM
@b3m2a1 Cool!! I will have a look. From the doc of zmq (api.zeromq.org/4-2:zmq-socket) I expect very few things are implemented so far. Else WRI will give some doc for different zmq typologies. However found this really handy looking tool (nchan.io) as a proxy between any external consumer/subscriber/publisher and a web facing MMA application. Started exploring few options.
 
2:03 AM
@PlatoManiac actually when you make a socket you can open it with any of those different types. The default seems to be "PAIR" but I saw nothing suggesting other types than that, "PUB", and "SUB" is supported.
 
2:30 AM
If someone has CUDALink working for them, it would be nice if he could try out the TLDR from my answer here
2
A: cannot load CUDAFunction from cubin, ptx or library file

halirutanHere we go: Upfront, this was a pain as the CUDALink` package uses GPUTools`, LibraryLink` and since we are compiling on our own, CCompilerDriver` played its own role. Therefore, it was a lot of code to look at but I believe I found the reason. TL;DR Okay, okay... I believe the main mistake was ...

 
@PlatoManiac Here are all the socket types it supports: ZeroMQLink`Private`socketTypes
 
 
2 hours later…
4:15 AM
@b3m2a1 Ya most useful ones of zeromq are listed there. But how to get them to work is not clear to me. I see tons of options here:
ZeroMQLinkSocketOptionsgetSockOpts /@ {pub, sub} // Dataset using the pub and sub of your answer
May be one needs to use this options correctly (based on zmq doc api.zeromq.org/4-2:_start) to get the other socket types work properly. God knows....not clear to me :)
 
4:32 AM
One interesting topology will be this one for example: i.stack.imgur.com/rehoR.png The ZeroMQLinkPrivatesocketTypes lists all the necessary ingredient socket types.
 
5:31 AM
@PearsonArtPhoto I have not used Cloud Mathematica. I found early one that Manipulate/Dynamics do not work well yet on it. This was 2 years ago. I do not know if this changed or not. The whole idea of cloud credit needed to have someone run your program on the cloud makes little sense to me. I am not learning Javascript to use for basic plotting. Look at D3.js library. It is amazing. But hard to learn. But no plugin, and no cloud credit. WRI is not handling this whole cloud thing too well
@RolfMertig Tiobe index ranking of languages beyond the first 10 or so, can't really be trusted. For sure Mathematica is used much more than Maple. Just look at the Maple forum at stackoverflow and see how much traffic it gets and compare that to this site.
 
 
4 hours later…
9:47 AM
How to know the range of this graphic
GeoGraphics[Entity["AdministrativeDivision", {"Beijing", "China"}]]
I just get a graphic
But I hope to know the range about longitude and latitude exactly..
 
10:32 AM
@yode It's just like any other graphics, it is just code:
map = List @@ GeoGraphics[Entity["AdministrativeDivision", {"Beijing", "China"}]];
map[[2 ;;]]
That gives you a list of options. Here's the GeoRange:
GeoRange /. test[[2 ;;]]
You can also right click on the image and choose "get coordinates"
 
 
1 hour later…
Lee
11:36 AM
Mathematica users in the New York area that want to form a community can join the New York Mathematica Meetup. It's a new meetup. Given the huge number of meetups in the NY area I was surprised there was none for Mathematica.
 
 
2 hours later…
2:02 PM
FileExistsQ[File[""]] any ideas to make this give false instead of an error? Seems "wrong" for it to error instead of give false
 
 
1 hour later…
3:29 PM
@Edmund This is a common complaint about the language. It's really about how you use the result. In short, you should use TrueQ on practically everything
@Edmund It really depends on the context, but if you use pattern matching {True ->..., _ ->....} then this isn't ever a problem.
 
@Edmund In a perfect world, all the xxxQ functions would simply return true or false. Unfortunately, we live in the Wolfram Nebula in a place far, far away from the perfect world.
As Searke said, something like TrueQ[Quiet@FileExistsQ@File[""]] is your choice here.
 
@halirutan Well, let me be more precise. I recc TrueQ for all programmers who are new or struggle with this. In reality, I advocate for the abolishment of If statements entirely.
@halirutan and we agree, largely that it would be nice if there were a solid Core of *Q functions that were guaranteed to return Boolean values. But also think about the fact these wouldn't be as useful in symbolic computing.
If I had a time machine, I would go back and try to convince the designers that "If" should never be used symbolically and so it should always evaluate. But this would require them to have made a different, symbolic "If" as well.
@Edmund I filed a suggestion about that behavior. So we'll see.
 
3:52 PM
Can someone cast another re-open vote on this one?
2
Q: How can I solve my system of differential equations

MehrabI have 3 differential equations and I want to obtain an analytic expression for f[r]. It does not matter what equations are and I just need the command to solve such equations. I know that these equations have two possible different solutions and maple can obtain them easily. I just need the comm...

The OP edited his question and included code.
@Searke The If not evaluating when the condition is not true or false is indeed one thing that often leads to confusion esp. for new users. Particularly, since this behavior is so different from many other programming languages like C.
 
4:12 PM
@Lee And I thought in a city like NY there is a Mathematica group on every corner. Hmm... now I'm surprised.
 
@Searke Thanks
@halirutan Thanks.
 
 
1 hour later…
5:46 PM
I'm trying to convert from single-precision floating point to a real number, but it's not giving me full precision. Is there any way to address this?
I.e. using Real32 import/export I'm importing "57.295780181884765625", which is exactly representable in 32-bit floating point, but Mathematica is telling me the value after import/export is 57.29578018188477, which is rounded (precision 16).
 
@Searke without breaking too much the historical decisions, I wouldn't mind too much if some of these aspects were managed with options, forcing pure numeric evaluation or the either way around. The amount of dummy ?NumericQ functions in my code would definitely go down.
2
@halirutan the world direction is different... With AI algorithms being used more and more, the "don't know for certain" is going to be on pair with True and False...
 
@varkor Can you provide an example using ImportString?
 
I can:
ImportString[ExportString[57.295780181884765625, "Real32"], "Real32"] // InputForm
and in comparison with "Real128" the correct value is given.
 
so that's how you do it. Thank you.
 
@C.E. something like:
```
real32Digits[x_]:=IntegerDigits[First[ImportString[ExportString[x,"Real32"],"UnsignedInteger32"]],2,32];
fromReal32Digits[li_]:=First[ImportString[ExportString[FromDigits[li,2],"UnsignedInteger32"],"Real32"]];
DecimalForm[fromReal32Digits[real32Digits[57.295780181884765625]],DefaultPrintPrecision->50]
```
 
5:58 PM
The issue here seems to be the following. When we look at the binary representation of this number, we get
In[59]:= RealDigits[57.295780181884765625, 2]

Out[59]= {{1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0,
   0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0}, 6}
 
@varkor ok, I see. Thank you.
 
There are a lot of zeroes at the end. Let's see what happens when we ignore them:
FromDigits[{{1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1}, 6}, 2] // N // InputForm
And we end up with the representation that you get: 57.295780181884766
Ha! Forget what I said.
Even if we provide all digits it doesn't work. I guess I know why..
 
I think 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1 is the correct binary representation of the single precision number, though, so those zeroes are correct.
 
6:17 PM
posted on March 02, 2018 by Brian Wood

Do you want to do more with data available on the web? Meaningful data exploration requires computation—and the Wolfram Language is well suited to the tasks of acquiring and organizing data. I’ll walk through the process of importing information from a webpage into a Wolfram Notebook and extracting specific parts for basic computation. Throughout this [...]

 
@varkor Actually, I believe your number is not representable in 32 bit. If you count the number of bits until the last 1, you will find 24 bits. Real32 however has only a mantissa of 23 bit.
Here is an example that has a mantissa length of 23 bit and it works correctly
ImportString[ExportString[57.29578399658203, "Real32"], "Real32"] // InputForm
 
@halirutan: on h-schmidt.net/FloatConverter/IEEE754.html, if you type "57.295780181884765625" into decimal representation, you'll see that it's exactly represented by the float.
 
6:34 PM
I have just crossed one of Orly's airport metal detector (South Paris), and noticed there were 2 assistants distributing people through 6 active belts. That is 1 per 3 belts (not counting with the priority assistant and the ones of the belts themselves), just to tell people: "please wait a second" and "you can go to belt number #"... located just a few meters away...
I take several dozens of flights per year, and from multiple airports, and so, I can attest that these metrics are not that different between airports... This being said, something is way wrong with technology application or adoption, as those assistants where definitely not there for their human relations attributes
 
@varkor Hmm, I'm a bit on thin ice here, but if Mathematica uses indeed the IEEE-754 standard, shouldn't the binary representations not be the same?
 
@halirutan: I'm pretty sure Mathematica is storing the correct binary form for the number. It's just when it's converting back to a real, it's either not converting correctly/at full precision, or it's not displaying all the precision it actually has.
 
@varkor We can take the binary output of StringExport and convert it back to numbers. This gives me:
 
It should always have exactly 32 bits of precision (however many digits that is), because it's converting from a 32-bit number, but it doesn't seem to do that.
 
@varkor Ah, right. I was forgetting about the endian
IntegerDigits[#, 2] & /@
 Reverse@ImportString[ExportString[57.295780181884765625, "Real32"],
   "Binary"]
{{1, 0, 0, 0, 0, 1, 0}, {1, 1, 0, 0, 1, 0, 1}, {1, 0, 1, 1, 1, 0}, {1, 1, 1, 0, 0, 0, 0, 1}}
This seems to match what I get from your site (some blocks have to be padded with 0)
 
6:43 PM
Yep
The question is: can that form be converted back into the original real?
 
@varkor The point here seems to be that I don't understand, why the re-imported number has MachinePrecision
This is not enough. The original number has a Precision of about 20, while machine-precision is only 16 on my machine.
 
@halirutan: yes, that was exactly what I was confused about
 
Yes, this is the reason.
 
I couldn't figure out how to force the precision to be true to the original (or just arbitrarily higher).
 
Even with Real64, the imported result will always have machine precision.
 
6:48 PM
Huh...
Can you think of any workarounds to force higher precision?
 
With Real128, you get a higher precision for the import.
 
What, really? :O It seems very strange that Real128 should be any different.
 
You can surely build the exact number yourself by building a small custom import function, but how fast needs this to be?
 
Sadly, I was hoping to make this as fast as possible... I want to analyse a property of the entire range of 32-bit floating point numbers :/
 
@varkor Let me think about this for a while. I need to run for now. This is btw a good question you can ask on main!
 
6:53 PM
On main?
 
On the main site
Not asking in chat.
 
Oh, of course.
@halirutan: thanks for looking into it!
It's nice to know I wasn't doing anything too stupid to not figure it out :)
 
No proplem. That was fun.
 
I have to go too, but I'll come by later.
 
 
4 hours later…
10:46 PM
ok feels like i am starting to get confused over associations and how they work, any easy way to transform a key list (for example {1,2,3}-> "c"} to a list of keys (1->c,2->c,3->c) ?
 

« first day (2235 days earlier)      last day (2239 days later) »