« first day (1002 days earlier)      last day (3472 days later) » 

12:15 AM
@WG- You don't need such a complicated example. You can break it down, that it is not possible to expand a.(b + c) although the distributive law holds for matrices.
 
 
11 hours later…
10:47 AM
@halirutan Hi, This is indeed a much easier code. I have only only problem with it. For some reason I can't take a Fourier transform of the image it creates. I've read a bit and saw that the Fourier operator does accept sparse arrays so I don't know why it won't run. Here is the code ApertureSize = {300, 300};
DiscRadius = 20;
PhaseDisc0 = 10;
Disc1 = {40, 50};
PhaseDisc1 = 10;
Disc2 = {200, 250};
PhaseDisc2 = 15;
Disc3 = {200, 200};
PhaseDisc3 = 30;
MagnificationAperture = 0.5;
MagnificationFT = 0.5;
g
@halirutan I hope this way it will looks clearer ApertureSize = {300, 300};
DiscRadius = 20;
PhaseDisc0 = 10;
Disc1 = {40, 50};
PhaseDisc1 = 10;
Disc2 = {200, 250};
PhaseDisc2 = 15;
Disc3 = {200, 200};
PhaseDisc3 = 30;
MagnificationAperture = 0.5;
MagnificationFT = 0.5;
MagnificationSlice = 0.5;
MagnificationFTSlice = 0.5;

makeMask[disks_, r_, {ny_, nx_}] :=
With[{dm = Position[DiskMatrix[r], 1] - (r + 1)},
Plus @@ (Function[{pos, value},
didn't work :)
 
11:14 AM
@AsafMiron Why do you think that you can take the Fourier transform of an image? It's a function for matrices.
You shouldn't use Image or ImageAdjust at all during your calculation. Use it only if you want to display and look at things.
masks = makeMask[{{ApertureSize/2, PhaseDisc0}, {Disc1,
     PhaseDisc1}, {Disc2, PhaseDisc2}, {Disc3, PhaseDisc3}},
   DiscRadius, ApertureSize];
Image[Re[Fourier[masks]]^2]
 
@halirutan I see. I thought Mathematica stores images as matrices
 
@AsafMiron Nope. Images are atomic objects which you can create from a matrix.
 
@halirutan umm why did it come out like that?
It should be transposed
no?
 
@AsafMiron You mean the corners should be in the center, yes?
 
yup
 
11:18 AM
@AsafMiron Nope, with a standard call to Fourier it's not like that. You have to shift (or multiply) it yourself to make it appear in the center.
 
@halirutan hmmm, how do I do that?
is it equivalent to the FFTShift in Matlab?
 
@AsafMiron Read here
13
A: What's the correct way to shift zero frequency to the center of a Fourier Transform?

bill sThe Fourier transform is defined as: $$ H(f)=\int_\infty^\infty h(t) e^{2\pi i f t}dt\\ h(t)=\int_\infty^\infty H(f) e^{-2\pi i f t}df $$ where $h(t)$ is the signal, and $H(f)$ is it's Fourier transform, if $t$ is meassured in second, then $f$ is measured in Hz. The discrete Fourier transform ...

 
@halirutan Thanks!!!
 
@halirutan Will do. Thank you very much for your help. I have a deadline tomorrow and thanks to the help I got here I might just meet it
 
11:45 AM
@@halirutan Got it! `ApertureSize = {300, 300};
DiscRadius = 20;
PhaseDisc0 = 10;
Disc1 = {40, 50};
PhaseDisc1 = 10;
Disc2 = {200, 250};
PhaseDisc2 = 15;
Disc3 = {200, 200};
PhaseDisc3 = 30;
MagnificationAperture = 0.5;
MagnificationFT = 0.5;
MagnificationSlice = 0.5;
MagnificationFTSlice = 0.5;

<< Developer`
makeMask[disks_, r_, {ny_, nx_}] :=
With[{dm = Position[DiskMatrix[r], 1] - (r + 1)},
Plus @@ (Function[{pos, value},
SparseArray[
Select[(pos + # & /@ dm),
1 <= First[#] <= ny && 1 <= Last[#] <= nx &] -> value, {ny,
@halirutan Or better yet, ApertureSize = {300, 300};
DiscRadius = 20;
PhaseDisc0 = 10;
Disc1 = {40, 50};
PhaseDisc1 = 10;
Disc2 = {200, 250};
PhaseDisc2 = 15;
Disc3 = {200, 200};
PhaseDisc3 = 30;
MagnificationAperture = 0.5;
MagnificationFT = 0.5;
MagnificationSlice = 0.5;
MagnificationFTSlice = 0.5;

makeMask[disks_, r_, {ny_, nx_}] :=
With[{dm = Position[DiskMatrix[r], 1] - (r + 1)},
Plus @@ (Function[{pos, value},
SparseArray[
Select[(pos + # & /@ dm),
1 <= First[#] <= ny && 1 <= Last[#] <= nx &] -> value, {ny,
 
12:10 PM
@AsafMiron you can replace the lines
d = masks[[All, All]];
d = d*(-1)^Table[i + j, {i, nRow}, {j, nCol}];
with
d = masks*(-1)^Table[i + j, {i, nRow}, {j, nCol}];
no need to assign d explicitly.
 
@halirutan Cool, changed it. Thanks
 
12:42 PM
First time in the chatroom for quite a while. I see the feature to kick and ban other users has been added for the room operators. :)
And, hello, friends.
 
12:55 PM
@halirutan If you are willing to help for the last time, I have one last problem I can't figure out. When I chose these placings for the discs, I expect the FT of the image to be beating along the line connecting the 2 discs. I don't know why but for some reason I get a rotation of exactly -pi/4 of the FT. I tried using the Rotate operation but it rotates the whole box. It is also interesting to know what's causing this behavior. Thanks in advance! ApertureSize = {300, 300};
 
 
3 hours later…
3:55 PM
0
Q: Self-answered questions to show off a useful technique?

Reb.CabinI've seen a couple of examples of self-answered questions used to show a technique that a user discovered or derived. One of them was advertised up-front as such; the author wrote something like "I'm posting this as a self-answered question in the hope of sharing something useful I created ..." ...

 
@Öskå re hypnotoad - you are most welcome. You might not be aware of the fact, but one of our esteemed mods carried that name for a while (and a jolly good time we had with that, too).
@OleksandrR. welcome!
 
4:27 PM
@YvesKlett I wasnt aware indeed, but I obviously saw rm's picture :D
That frog is horrible with earphones on..
 
@Öskå :D
 
4:48 PM
@YvesKlett All these GIFs gave me a headache, I will never do that again :(
 
@Öskå what a pity - that was fun, though. Best wishes for a quick re-gif-covery!
 
@YvesKlett aha thank you :D Cooking should put my brain back at its place ;o)
 
@Öskå what are you cooking? I am searching for inspiration for dinner.
 
@YvesKlett Nothing fancy :D Got green beans from my garden, plenty of them, so it's going to be green beans! But they have to be "prepared", it's called "beheaded" here :P
 
@Öskå yum - but fiddly work, right?
 
4:57 PM
@YvesKlett Nothing really interesting indeed :P But at least they are fresh ;o)
 
And repetitive manual labor can indeed soothe the mind
 
aha yep! I'm gone now, tschuß :)
 
Guten Appetit!
 
 
1 hour later…
6:17 PM
posted on October 16, 2014 by Jenna Giuffrida

Summer has drawn to a close, and so too have our annual internships. Each year Wolfram welcomes a new group of interns to work on an exciting array of projects ranging all the way from Bell polynomials to food science. It was a season for learning, growth, and making strides across disciplinary and academic divides. [...]

 
6:38 PM
@OleksandrR. Hello Oleksandr :). Same here, this is my first message in quite a while
 
6:51 PM
By the way, Vitaly used to be a moderator right? I just noticed he doesn't show up anymore when sorting the users by "moderator". Maybe it's because I mixed up Verbeia and Vitaly for some time.
 
7:11 PM
Is there anyone around who's still running 10.0.0 and not 10.0.1? Could you check the Java version and let me know?
@rhermans I wasn't able to reproduce the problem with the uploader on Windows with M10.0.1.
@ People using the SE Image Uploader: do you have any problems with it in Mathematica 10.0.1? Does it ever hang after pressing the upload button?
Has anyone tried running Mathematica on Yosemite? Were there any compatibility problems? If not, have you also tried using LibraryLink or Compile[... CompilationTarget -> "C"]?
 
7:33 PM
@Szabolcs Thanks for checking. I have been trying again, and I have the impression that there is some external factor that matters. At some time during the day (London) it did work, fine, slow the first time, fast after. In other occasion, yesterday night, it will hang, say "not responding" then offer to abort dynamic evaluation, but if I wait instead of closing it, it will work the second time. I wander if there is some time-out on the communication with imgur.
 
@rhermans Yes, there should be a timeout for all asynchronous evaluations, and the hang might be related to that.
I'll see how I can increase it and will let you know
 
7:54 PM
@Szabolcs I still don't see the 10.0.1 download in my user portal, so I'm still on 10.0.0. The Java version is 1.7.0_13.
 
@MichaelHale Thanks! I see 1.7.0_21 with 10.0.1 on Mac. What OS are you on?
 
Win 8
 
@MichaelHale If you don't see the 10.0.1 download then something went wrong with your Wolfram account. You should complain and it'll be fixed. I never got 10.0.0 until I complained about it. You might even try Live Chat, should be open for one hour longer wolfram.com/support/contact
 
8:46 PM
@Szabolcs I sent support an email.
 
9:06 PM
@Szabolcs Unfortunately, I de-installed V10.0 yesterday
 
@halirutan According to Michael, 10.0.0 had Java 1.7.0_17 (Windows), while 10.0.1 has 1.7.0_21 (on my Mac)
 
@Szabolcs I have "1.7.0_13" on Linux here with V10.0.1
 
I wonder if the Linux version comes with Java
 
@Szabolcs Yes it does..
1 min ago, by halirutan
@Szabolcs I have "1.7.0_13" on Linux here with V10.0.1
 
I meant to say _13, sorry, not _17!!!
@halirutan Just checked on Windows, 10.0.1 has _13, not _21.
 
9:47 PM
@rhermans Are you still around?
@SjoerdC.deVries Are you here by any chance? You had trouble with the uploader too, right?
OK, I just shoot and you can read later. I realized that there should be a most easy way to test the upload routine itself. If you have the uploader properly installed than the java jar of it is visible in Mathematica and you can call the upload routing by yourself.
Here is how it works: create an image and convert it to a a png-string, load JLink and install Java and the just send the image:
<< JLink`
png = ExportString[Plot[x, {x, 0, 1}], "PNG"];
InstallJava[];
and then you call the following
JLink`JavaBlock[
 JLink`LoadJavaClass["de.halirutan.uploader.SEUploader",
  StaticsVisible -> True];
 SEUploader`sendImage[ToCharacterCode[png]]]
the return value is a html page which contains the valid link to the image like i.stack.imgur.com/lkQy7.png
(Btw, I just showed you can write your own function for uploading images to imgur :-)
 
10:10 PM
@halirutan Yep, it does work, but the first time I sent the image it took more than a minute to return the URL.
 
@rhermans The question is where this delay comes from.
I have seen things where java was not properly installed (I mean started by InstallJava) in Mathematica.
That is basically why we had to call InstallJava in the uploader manually.
 
there may be a problem with instalation. When I call `<< JLink`` I get these errors.

Set::wrsym: Symbol $jlinkExtraReadDirs is Protected. >>

Set::wrsym: Symbol $jlinkExtraWriteDirs is Protected. >>

Attributes::locked: Symbol $jlinkExtraReadDirs is locked. >>

Attributes::locked: Symbol $jlinkExtraWriteDirs is locked. >>
 
@rhermans really?
@rhermans This is strange... (forget about the backticks :)
Ok, now I'm pretty sure that the problem is not the uploader routine itself or the palette that rasters the selection into an image.
 
@halirutan Also, with fresh Kernel its slow as hell, but subsequent repeats are much faster.
 
@rhermans This is the variable we are talking about:
In[32]:= JLink`InstallJava`Private`$jlinkExtraWriteDirs
Out[32]= {/dev/random,/dev/urandom}
@rhermans I guess what happens is that due to this error JavaInstall is horrible slow. We call this in the palette and therefore the first run seems to hang.
Once java is installed, InstallJava doesn't do anything but return.
 
10:20 PM
But the slow part is
JLink`JavaBlock[
JLink`LoadJavaClass["de.halirutan.uploader.SEUploader",
StaticsVisible -> True];
SEUploader`sendImage[ToCharacterCode[png]]]

All previous steps are reasonable timed
 
@rhermans This behavior of InstallJava is even documented:
> Only one Java runtime is ever launched; subsequent calls to InstallJava after the first have no effect.
 
@halirutan OK
 
@rhermans I would definitely contact support@wolfram with this.
 
@halirutan Meaning I should? What do I report? The errors loading JLink, and what else do I say?
 
@rhermans Can you quit the Kernel and time the following please?
(Before that, start the Kernel again with 1+1 or whatever)
AbsoluteTiming[Get["JLink`"]]
AbsoluteTiming[InstallJava[]]
 
10:26 PM
{0.254014, Null}

{0., LinkObject[...]}
 
@rhermans What does the following return
StringCases[Flatten[JavaClassPath[]], __ ~~ "SEUploader.jar"]
(I mean, does it find the uploader jar?)
 
{{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, \
{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, \
{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, \
{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, \
{}, {}, {}, {}, {}, {}, {}, {}, \
{"C:\\Users\\Rodolfo\\AppData\\Roaming\\Mathematica\\Applications\\\
SEUploader\\Java\\SEUploader.jar"}, {}, {}, {}, {}, {}, {}, {}, {}, \
{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, \
 
@rhermans And please time the following for me
AbsoluteTiming[JLink`LoadJavaClass["de.halirutan.uploader.SEUploader",
  StaticsVisible -> True]]
(takes 0.07s here)
 
{3.395194, JLink`JavaClass["de.halirutan.uploader.SEUploader", 0, {
JLink`JVM["vm1"]}, 1, "de`halirutan`uploader`SEUploader`", False,
True]}
 
0
Q: Periodicity of Penrose tiling in the background

ybeltukovRecently (despite the one year of active participation) I noticed that our nice Penrose background consists of identical blocks with visible joints between them:         Of course, it is not a critical problem. But sometimes I become a perfectionist so I ask the question: is it possible to corr...

 
10:32 PM
{2.826162, JLink`JavaClass["de.halirutan.uploader.SEUploader", 0, {
JLink`JVM["vm1"]}, 1, "de`halirutan`uploader`SEUploader`", False,
True]}
 
@rhermans Last one:
AbsoluteTiming[SEUploader`sendImage[{1, 2, 3, 4}]]
 
@halirutan {55.303163, [...]}
 
@rhermans Awesome.. takes 0.9s here
 
@halirutan :)
 
@rhermans The upload routine is really simple. Only 20 lines of code
@rhermans and if you run that last line again it is faster?
 
10:37 PM
@halirutan Yes, way faster {0.794045,[...]}
@halirutan Got to go now, its late here. Thanks for all your help. I can run more test if you need me to, tomorrow.
 
:18192629
JLink`LoadJavaClass["java.io.File", StaticsVisible -> True]
file = File`createTempFile["image", "png"]
@rhermans OK, then have a good night.
 
@halirutan Thanks, good night!
 

« first day (1002 days earlier)      last day (3472 days later) »