« first day (1027 days earlier)      last day (3447 days later) » 

1:21 AM
@Murta Round[4.811, 0.01] == 4.81
So I suppose it's the nearest representable value.
 
@Pickett no... Try to use Command +Shit + E to check
I want to create a string with the numbers, and I get 4.8100000000000005 on the string.
@Pickett better, try: ToString[Round[4.811, 0.01],InputForm]
ToString[Round[#,0.01]&/@Range[4.80,4.82,0.005],InputForm]
{4.8, 4.8, 4.8100000000000005, 4.8100000000000005, 4.82}
I need: {4.8, 4.8, 4.8, 4.8, 4.82}
 
@Murta What happens if you run this: ToString@Round[#, 0.01] & /@ Range[4.80, 4.82, 0.005]
 
@Pickett nice, I almost get what I need. Now they are strings, and I need numbers. I can do: Internal`StringToDouble@ToString@Round[#, 0.01] & /@
Range[4.80, 4.82, 0.005]
but I feel it's very clumsy.. no?
 
1:37 AM
@Nasser It is described in the second bullet point of the details section of Evaluate#
 
@murta I'm confused. You don't actually need a string, you just need it to be shown without the decimals? Would NumberForm[Round[#, 0.01], 16] & /@ Range[4.80, 4.82, 0.005] work?
Round[#, 0.01] & /@ Range[4.80, 4.82, 0.005] doesn't show extra decimals for me either. I don't know about this...
 
@Pickett your last form each element is a string, I need it as numbers.
 
 
I get that if you use cmd + shift + E then this is not equivalent to what you did with the StringToDouble trick, I just don't see where it matters.
@Murta OK, so where does this matter?
 
1:49 AM
@Pickett the difference matter when I want to export data indo SQLServer. I have a long dataset to export, and I want to truncate it, to get a faster insert and small file to transfer. I tried to use round to get a small amount of data, but when I export it, I get these extra zeros...
@Pickett I can make another string parser, but the most elegant solution would be if Round (or some equivalent function) gave me the number without these extra zeros decimal places.
It's strange that there is no simple solution to just truncate numbers
Maybe worth a question
 
2:08 AM
@Murta What about this? N@FromDigits@RealDigits@Round[4.811, 0.01]
 
@Pickett nice.. it works!.. Let me do some performance test.
@Pickett Internal`StringToDouble@ToString is faster.
 
Hm, ok :/
 
2:26 AM
need to sleep now!.. Good night!
 
Ok, good night.
 
 
8 hours later…
10:56 AM
hey guys, in a string how can I do a StringReplace at the end of my string if it matches a character? i.e. if my string ends in ",", I'd like to replace it for something
I tried this, but didn't work
StringReplace[#, {___ ~~ "," ~~ EndOfString ->
",ND"}] & /@ test
actually, this kind of worked, but adds another comma at the end...
´StringReplace[#, {"," ~~ EndOfString -> ",ND"}] & /@ test´
oh gosh, nevermind, it worked................
 
11:34 AM
Colour scheme on some of the sciency-promotional making-of videos looked familiar. And yes: "In practice I always did an implementation of the equation myself in Mathematica. I’m a real klutz computationally so Mathematica is just ideal for me." (Kip Thorne)
I think it's also common knowledge that he is a Mma user.
 
 
1 hour later…
12:49 PM
@Murta You must have some modifier keys I don't have, and don't miss... "Try to use Command +Shit + E to check" :]
 
1:10 PM
@kirma user CTRL+Shift+E on Windows (I'm on Mac). But better, use ToString[...,InputForm]
 
@Murta Note your earlier spelling of... "Shift" :)
 
@kirma kkk... sorry about that!... Not intentional
 
Not that I would be insulted, more like amused.
 
1:24 PM
@kirma could be a special key to quit the kernel!.. :p
 
:)
 
 
3 hours later…
4:48 PM
Something's driving me kind of nuts: I want to change the weights of only a certain subset of edges in my graph, called tg. So I did Graph[tg, EdgeWeight->{1<->6 -> 20}], which works fine. But then trying for two at once with Graph[tg, EdgeWeight->{{1<->6 -> 20},{3<->8->30}}] doesn't do anything
no errors but it seems like edgeweight just doesn't know what to do with it
What's the right syntax to do that?
 
@FdotFloss Graph[{1 <-> 2, 2 <-> 3, 3 <-> 1},
 EdgeWeight -> {1 <-> 2 -> 4, 2 <-> 3 -> 5}]
 
ahhh, I'm an idiot
Thank you
 
5:14 PM
Hey guys, I'm trying to multiply a number of columns in a matrix by a vector. To do this I was trying to do the following:
Map[{Transpose[matrix[[All]]]/.{matrix[[All,#]]->matrix[[All,#]]*vector[[#-9,2]‌​]}&,Range[10,30]]
(meaning that I want to multiply columns 10 to 30 of my matrix, with the vector that has positions 1 to 21)
meaning, I would multiply matrix[[All,10]]*vector[[1,2]], matrix[[All,11]]*vector[[2,2]] ... matrix[[All,30]]*vector[[21,2]]
does this make sense?
and do you see what I'm doing wrong?
because transposing that Map back doesn't result a matrix with the original dimensions...
 
5:47 PM
Why is Timing[] not accurate for me? It says it's taking .6 seconds but I can kind of clearly count like, 3 seconds...
 
Because it reports only the time taken to do the computation, not the timing that it also takes to output it (I'm not sure though). But if you look here you'll see the difference between Timing[] and AbsoluteTiming[] (which is probably what you want)
Reading that documentation pages seems to indicate this difference that I explained :)
 
@Sosi, thanks
@Sosi, have you considered using Table[] for your problem?
 
6:03 PM
@FdotFloss how? I ended up solving the problem, but not very elegantly. I'd love to have some input, this seems fairly simple but I couldn't get it done... :\
 
@Sosi, I'm no expert at all... I don't quite understand your problem though, so you want to multiply columns 10->30 by your vector, so the 1st element of your vec hits column 10, 2nd element hits column 11, etc?
 
yep
 
Hm gimme a sec
 
the way I ended up solving is not very satisfying because columns 1 - 9 have text, not numbers. Nevertheless, I solved it like this Transpose[(Transpose[matrix])*{Table[1,9],vector}]
what this is doing is multiplying the first 9 columns (which are text) by 1. But I'd just like to avoid that because I'm picky :P
 
7:01 PM
posted on November 10, 2014 by Christopher Carlson

This year’s Wolfram Technology Conference once again included the One-Liner Competition, an opportunity for some of the world’s most talented Wolfram Language developers to show us the amazing things you can do with tiny pieces of Wolfram Language code. In previous years, One-Liner submissions were allowed 140 characters and 2D typesetting constructs. This year, in [...]

 
So for a problem I'm trying to solve, I need to find the inverse of a matrix, which currently seems to be the speed bottleneck. It's scaling really quickly, that is, for a 10x10 matrix it takes .5s, for a 13x13 it takes 3.2s, for a 15x15 it takes 9.8s. Ideally I'd like to be able to solve a 50x50 one in a reasonable amount of time, but that doesn't seem possible now
is there some way to speed it up I'm not realizing, or is it always a bottleneck?
 
7:36 PM
Ahhh, so my matrix is actually the square of those sizes because it's the Kirchoff matrix of the matrices... so it's actually a 100x100, etc...
 
@FdotFloss Are you inverting it numerically or symbolically? If you work with inexact numbers (i.e. ones that have a decimal point in them), then it will be much faster than otherwise.
@FdotFloss Timing measures the CPU time taken by the kernel process only. There are three kinds of "inaccuracies": 1. if you have 4 cores each working for 1 second, it'll report 4 seconds (even though only 1 second elapsed according to the wall clock). 2. sending the result to the front end, formatting, and displaying it is no included 3. any time not spent by the kernel process (e.g. things spent by other executables called by the kernel) is not included
@FdotFloss AbsoluteTiming measures wall time and fixed 1. and 3. from above, but not 2.
Is there anyone around who uses RLink?
 
@Szabolcs, thanks, I think numerically? Does that mean, the matrix elements are actual numbers as opposed to variables that could be anything? Because they are just decimal numbers
 
@FdotFloss It will solve it numerically if all of them are decimal (i.e. inexact) numbers. That's the fastest way, but of course it's not 100% accurate due to numerical errors. It's pretty much identical to how other software (e.g. MATLAB) does it.
 
Hmmm
Looking at the matrices I'm doing it with, it seems like they're pretty sparse
 
AbsoluteTiming[
 Inverse@RandomReal[1, {100, 100}];
]
^ This takes 0.02 second on my machine.
AbsoluteTiming[Inverse@RandomInteger[10, {100, 100}];] takes 0.24 seconds, about 10 times longer. This is an exact computation.
 
7:49 PM
Hmmm...
 
Hi guys, there an easy way to set the background color of a DensityHistogram, without also setting the background color of the axes as well? Just setting Background sets it for everything
 
4
Q: How to fill only a plotting area with Background

eldoWith ListLinePlot [ {13, 6, 2, 2, 3}, AxesOrigin -> {1, 0},Background -> GrayLevel@0.95, GridLines -> None, ImageSize -> 300, ImageMargins -> 0, PlotLabel -> "XYZ", Filling -> Bottom, PlotMarkers -> Automatic, Frame -> True] I obtained: I would like to move the PlotLabel "XYZ" into th...

 
Ah great, I was thinking a rectangle but I wasn't sure how to make it automatically use the plot range
That answers that
 
That's actually a duplicate, might as well vote to close ..
 
I'm a bit surprised WRI hasn't hyped Mathematica in association to background work on that Interstellar movie. Well, it might be that they'd need a contract to associate themselves with it... (don't ask me, I'm not into movie business.)
 
7:57 PM
@kirma They used Mma for the movie? How?
 
@Szabolcs See comments by Kip Thorne at
http://chat.stackexchange.com/transcript/message/18547033#18547033
 
I haven't seen the movie, nor have I read anything about it yet ...
 
Also, there was some video featuring the black hole work where I spotted diagram probably created with Mma (gravity isosurface or such).
It might be positive spoilers! (I don't really have too positive expectations about the plot, though.)
@Szabolcs They hype about relativistic visuals.
 
@Szabolcs, so finding the Inverse of a 200x200 matrix takes 3.8s, but a 400x400 one takes 52s... Is that about the best I can hope for?
 
@FdotFloss I don't know. It depends on your matrices. Inverse@RandomReal[1, {200, 200}] takes no perceptible time here. Have you compared yours to a random matrix? Have you tried to figure out how those matrices differ?
Are you sure your matrix contains only floating point numbers? Have you tried applying N to it to make sure?
 
8:10 PM
@Szabolcs, Yeah, that's a good point... Let me try that, sorry I misunderstood before, I think
 
8:28 PM
@Szabolcs, so my matrix is mostly zeros. It seems like applying N[] to it before taking the Inverse[] sped it up a ton, but for a few of them also gave me the error Inverse::luc: Result for Inverse of badly conditioned matrix ... may contain significant numerical errors. >>
 
 
1 hour later…
hhh
9:40 PM
I am trying to explain field pressure with following terms below. I used some predict/SARIMA for this kind of task earlier in R. Which tools are for this in Mathematica?

FPR ~ (production, injection, status, unknown_erosion) ~ ({FOPR, FWPR, FGPR, FVPR, FWP, GGPR}, {FWIR,FWIRH}, {GWCT, FOE},{unknown_erosion})
 
hhh
10:28 PM
1st. I need to import the large data file with long header and identifiers specified on many lines, moved question here.
 
hhh
10:44 PM
 

« first day (1027 days earlier)      last day (3447 days later) »