« first day (565 days earlier)      last day (3933 days later) » 

12:05 AM
Any one knows if this is the right way to pull out a channel from RGB image for display, without it becoming grayscale? i.e. it has to remain 3D else Image will display the channel as gray scale. This is what I did:
lena = Import["ExampleData/lena.tif"];
d = ImageData[lena];
red = d; red[[All, All, {2, 3}]] = 0;
green = d; green[[All, All, {1, 3}]] = 0;
blue = d; blue[[All, All, {1, 2}]] = 0;
Grid[
 {{Image@red, Image@green, Image@blue}}]
I could not find a build-in function in M for this. Strange. So I had to zero out each channel manually and keep the one I want to display. If someone find a build-in function, please let me know. I am not good at this stuff...
 
12:19 AM
@Nasser Not a built-in, but see the 2nd application in the docs for ColorSeparate
 
@rm-rf sure, will check it now.. thanks.
 
@Nasser: ImageMultiply[ColorSeparate[lena][[1]], Red]
 
@Nasser What about
MapThread[ImageMultiply, {ColorSeparate[lena], {Red, Green, Blue}}]
Or if you more into linear algebra
Image /@ Transpose[Map[IdentityMatrix[3]*# &, ImageData[lena], {2}], {2, 3, 1, 4}]
 
OMG !!
I think I'll take the first one before it, thank you. I can read that, but not the second one :)
I'll update my post now using MapThread[ImageMultiply, {ColorSeparate[lena], {Red, Green, Blue}}] instead of how I did it. But for YCbCr I have to keep it as I did, since there is not such build in function for that. ... I wrote:
c3 = lenaYCbCr; c3[[All, All, {1, 2}]] = 1
c1 = lenaYCbCr; c1[[All, All, {2, 3}]] = 1;
c2 = lenaYCbCr; c2[[All, All, {1, 3}]] = 1;
I really did not know if I should put 0 or 1 on the other channels. I did not seem to make a difference visually...
 
 
1 hour later…
1:35 AM
@MichaelE2 I assume this has something to do with the precision of the slider. Basically, one would expect, that it moves in steps of 1, but when there are too many steps to make it gets confused. Just assume you would have to make a million steps to come a pixel forward.. Btw, you can create the dual of this problem:
Manipulate[x, {x, 0, 1, 10.^(-10)}]
 
@halirutan Yes, I know, although I haven't bother to find the exact value where it fails. ` Manipulate[x, {x, 0, 2000000000, 1}]` works. Obviously there's a limit being exceeded. No warning, though; not even a "Possible Issue" in the docs.
 
@MichaelE2 It's even more fun if you type 0.5 (in my example) into the opened controls and try to move the slider then..
it instantly jumps back to 0.
 
@halirutan Neat. The limit, 10^(-10), is not a very very small number (much bigger than $MachineEpsilon), but way smaller than a pixel's worth. Seems odd to me.
Being able to move left, beyond the domain of the slider, seems odd, too. You'd think it would Clip.
 
@MichaelE2 Just over 2 billion is the limit for signed 32 bit integers. Maybe it breaks when Mathematica switches to arbitrary precision.
 
@MichaelHale Nice idea.
@MichaelHale That seems to be right. Good catch.
It explains the backwards movement, too.
 
1:47 AM
@MichaelE2 @MichaelHale Yes, the exact value is
Manipulate[x, {x, 0, 1, 1.0/(2^31 - 1)}]
This works
removing the 1 fails.
So the reason could be that you can always play a slider where it moves like an Animator and it has to increase some value. Maybe they use a this place an int which is increased and decreased.
 
@halirutan That seems reasonable.
Manipulate[x, {x, 1, 3000000000, 1,
  Manipulator[
    Dynamic[x,
     newx \[Function] (x = #2[[1]] + Floor[newx - #2[[1]], #2[[3]]])],
     Most@#2] &}]
is a workaround
So it doesn't have to hinge on machine-size integers.
This fails: Manipulate[x, {x, 2^31, 2^31 + 10, 1}]
So basically an Integer slider which deals with integers greater than or equal to 2^31 needs a custom control.
 
@MichaelE2 Why does this fail?
 
@halirutan I suppose because max limit 2^31 + 10 is too great? (I assume it fails for you.)
 
@MichaelE2 Check this:
Manipulate[Mod[x, 100], {x, 2^31, 2^31 + 10, 1}]
Doesn't this suggest, that at least the counting works. Although I have no idea why it is converted to real values.
 
After I clicked on the button
Originally it showed 48.
 
2:03 AM
(9.0 for Mac OS X x86 (64-bit) (January 24, 2013))
and OSX 10.8.4
 
@halirutan Oops. I pasted it into the beta V10.
I guess things are changing... :)
 
@MichaelE2 Hehe.. one more thing to report.
 
@halirutan I get this in V9.
@halirutan Yep. Personally, I think it would be nice to have a slider that worked with exact integers.
 
OK, I'm out for now. See you all later.
 
@MichaelE2 Anything cool in the v10 beta?
 
2:11 AM
@MichaelHale I'm not sure what I'm allowed to say -- I don't recall the exact terms of the prerelease agreement. WRI tends to like to be the ones to spill the beans. (Sorry, but I'm cautious.)
 
I understand.
 
@MichaelHale Thanks.
 
@MichaelE2 Do you use Mathematica professionally or just as a hobby? I was working on F# at Microsoft, but I bailed a few years ago and I've been trying to find a way to make a living from Mathematica coding ever since. I've just come up with hobbyist projects that will let me use it a lot. You seem to know the language very well. Feel free to disregard this. I don't mean to pry in a public chat room.
 
@halirutan When you get back: Perhaps on integer overflow, the number is converted to an equivalent Real. (I assume that's a choice, instead of arbitrary precision integers.)
@MichaelHale I teach college mathematics. I use Mma primarily in teaching, and sometimes in research. Occasionally I've used it to solve administrative problems.
 
@MichaelE2 Thank you. I've never actually met someone that uses Mathematica in person, so this chat room is pretty intriguing for me.
 
2:24 AM
@MichaelHale I think there are some users here who use it commercially, and quite a few who are academics who use it for research.
 
@MichaelE2 Interesting. What do you research?
 
@MichaelHale I started in number theory, but shifted more toward two other fields analysis and history of math. My teaching duties take up most of my time, which I love actually, but the problems I take on have to have the property that I can make progress on them during summer.
By the way you remarked on my knowing Mathematica. I started using Mma around 1990. There were a few, sad years in between when I did not have access to it.
 
Oh wow. I first heard of it when they released v7.
 
Then I found this site last year. This has really helped fill some gaps.
I think I still have version 3 on an old NeXTstation that's sitting in a box somewhere. (Maybe it's v2)
 
Pretty cool. I had access to computers in the early 90s, but I didn't really get into them until I heard about computer graphics a little before Jurassic Park was released. Then I got into programming to make games and interactive graphics. Then through a short phase in business software, and then most recently scientific and technical computing.
 
2:35 AM
@MichaelE2 Heh, are you at least allowed to say that you're a beta tester?
 
@rm-rf Oh, I hope so. :) I hope that beta testiing itself isn't meant to be a secret.
Actually, as I recall, the terms this time seemed more relaxed -- or at least, they didn't threaten me ten times and make me sign a hard copy.
 
It used to be that bad, huh?
 
@rm-rf It's the corporate lawyer mentality, I suppose. They are letting me see proprietary technology that is a "trade secret" I suppose.
 
This is slightly off topic, but considering you guys have a lot more experience then I do, would you suggest there any other tools out there that are as useful as Mathematica for software development. When I realized the amount of functionality Mathematica had I was quit amazed (JLink, .Net Link, C Link, and C compilable, LISP like).
 
I'm certainly the most productive in it. You just have to be aware that you are making a huge tradeoff on the number of other people that can use the stuff you make.
 
2:41 AM
@Liam Expensive what? I'm piss ass poor student :P
 
corrected /expensive/experience/
 
:D
 
@Liam I don't do large-scale software development, so I can't really comment. I do know that if I have an idea, I can usually get something up and running in Mathematica in less than an hour so that I can see how it will work. But it can take a long time to get the kinks out.
 
@Liam "Software development" is broad... I would say it depends on what you want to do. If you're thinking of web apps/web technologies and such (without heavy backed number crunching), mathematica might be a poor choice, since you have better alternatives with javascript, ruby, python and the like.
 
@rm-rf web development isn't really congntive difficult software development IMO
 
2:45 AM
On the other hand, Mathematica is very handy in rapidly prototyping stuff and testing it
 
Mathematica is great for prototyping but additionally I have found it be quit useful for debugging. Which is primarily what I have done in software developement.
 
Often times, the problems I face with Mathematica are not the same kinds of problems I'd face with most other languages... by far, the biggest time sink for me has been hunting down mysterious unpacking (sometimes in internal code)
 
@rm-rf Do you use Mathematica professionally?
Oops, I see student comment.
 
@MichaelHale I'm in academia/research and yes, I use it regularly (but I don't make my living out of it)
 
@MichaelHale Athens is a cool college town. I lived 3 years ago.
 
2:50 AM
What do you research?
 
Hope you don't feel alienated about demographics
 
@Liam Oh? Yes. I was born here. I just moved back last year after being in Seattle for 3 years.
Bumming with my parents. The easy life.
 
Yeah I like there a lot. I was born in Atlanta, but grew up in Athens also.
 
Ah, good deal. I went to Ga Tech, so I was in Atlanta for a few years.
 
Great school. I'm in Chicago suburbs now quit cold most of the year.
 
2:54 AM
My roommate moved up there. He was mechanical engineering, but got a job in software.
 
Yeah software is big right now.
 
@rm-rf If you make a bunch of slides with things like: Manipulate[..] /. {var_, ...} :> {{var, init1}, ...}, where init1, init2, does the sort of thing Autorun does, then you can make a movie GIF in about 1/3 the time as Vitaly Kaurov's Export/Import method.
Would such a thing be posted to the meta question?
Or because it's Manipulate specific, should it be different?
Unfortunately handling all the different controls has made the code get semi-long.
 
@Liam I was computer science, but I feel like it should have been a two year degree. The second half is just doing group projects for free when I was getting paid to do the same sort of stuff at internships and part-time jobs.
 
@MichaelHale I'm currently a student trying to decide between potential majors options. Do you have any advice?
 
You are undecided undergrad now?
 
2:59 AM
Yes
 
Bioinformatics is a great area to be getting into.
 
@MichaelHale Once upon a time, professional training was done by the professions (on the job), not so much by the universities. For the last hundred years or so, it has been shifting. What you said made me think you spent the last two years learning from your or your classmates' mistakes, and not costing some firm $$$. :)
 
@MichaelE2 That makes sense I suppose.
@Liam Bioinformatics is too specialized for an undergrad major now, but I would find a professor doing that work at your school and go talk to him or her.
 
@MichaelHale If you don't mind me asking what languages was your coursework primarily in?
 
I think it is a great mix of logical/technical/programming skillset with a broad and deep empirical knowledge to learn from modern biology. The field is growing like crazy and there are plenty of opportunities and discoveries to be made. And your programming skills will be valuable for other areas.
At school it varied a lot per class. Java initially (then I heard some switched to C#), LISP for AI, C and toy assembly for networks and operating systems, C# for robotics, Smalltalk for an object oriented design class, and then it became use whatever you want really.
I was self-taught C++ and C# going into college.
Most of the engineering students hit some Matlab.
I think it would have been awesome to have a class that used Mathematica.
 
3:10 AM
Bioinformatics is the exact degree my parents have been advising.
after hearing "became use whatever you want really." I bet you used brainfuck right? ;)
I'm amazed your a self taught C++ programmer, I can keep most of that straight for a couple days that in goes out the window
So you never used Mathematica in any of your classes?
 
VHDL in circuits.
No, I discovered it on Wikipedia actually.
I love bioinformatics. I'd like to genetically engineer lawn grasses that don't have to be cut. I think it will be feasible in the 3 to 5 year timeframe.
Yeah, my first C++ book was pretty dry, but I guess I thought games were interesting enough to push through it.
 
Wow I'm amazed you didn't use Mathematica in school. Mathematica is one of the most useful tools that I've come across. Even the notebook interface is enough to at least try the it once.
 
Yeah, I was pretty blown away when I first saw it. I remember I had accepted a job offer to go work on F# at Microsoft. So I was getting caught up on it and they had an example where they modify some 3D plot that frictionless points were rolling around on. And they modify the steepness of the curve as the balls are rolling.
And I was thinking wouldn't it be great if you could just select any variable as an independent variable and watch it change. Then I had heard of Maple and figured I needed to look back at computer algebra systems to see what they have. So then I saw Mathematica listed on the Wikipedia article and checked it out and I was pretty blown away.
Then that was the same week they released v7, so I downloaded a student copy and I've been using it ever since. I basically spent most of my time at Microsoft doing "competitive analysis" on Wolfram Research and Adobe.
 
How does Wolfram Research compete with Microsoft exactly? Aren't they mostly separate markets?
 
Microsoft was/is trying to use F# to broaden their offerings into scientific and technical computing. Then they had to cut funding to forward looking projects during the bad economic times.
So I was going to have to update Visual Basic options pages, so I left to keep writing Mathematica and see where it would take me. It eventually took me back to living with my parents, but I've had a great time and I'm very happy.
 
3:25 AM
Just do what you love
 
Pretty much. I'll take an unpredictable future for a more enjoyable present every time.
But if you want to chat about bioinformatics or making an open source Mathematica library that is organized like Wikipedia I'm available anytime.
 
I'm quit interested in the Wikipedia project and how it might turn out. Organization isn't exactly ideal in Mathematica atleast for me. To help my organization I just end up embedding my most used functions into PNGS use the following code pastebin.com/PFqJMkME It works well for anything that has visual outputs. I just push it to a web server, I could do the github approach, but it hasn't been worth the effort for the small snippets I mostly need.
 
You were doing some steganography?
 
Yes I keep couple 100 pictures in a folder which I can arrow through when I'm trying to reconstruct some type of output.
 
That's fine. I think we have a decent amount of choices for hosting files/text/images, but they are always only modifiable by you. I'm curious if the wiki collaboration model can be applied to coding.
Like, allow checkins by anyone as long as they don't break test cases or some other constraints.
 
3:40 AM
It is a good idea
 
They try to do constraints on big software projects even with well controlled teams, but people still break builds from time to time. I don't think the wiki model would work perfectly, but it might lower the barrier to entry enough to allow a project to grow in really interesting ways beyond what a typical open source organized project would allow.
Maybe with the Wikipedia article organization people would write tests in advance for articles showing functionality that they would eventually like, then those tests could get upvotes, and then any checkins need to improve performance on existing tests or enable new tests to pass for the first time that have a certain amount of upvotes.
For now I'm just scrolling through Wikipedia articles until I see some chart or visualization and if it uses data that isn't available in Mathematica or Wolfram Alpha I write an importer and simple function to access it.
Maybe I'd heard of the World Ocean Atlas before, but now I can use its data in one line because I saw that data was used to make a picture on an article I came across.
And then once I think there are code stubs for enough articles there will start to be really interesting ways to tie them together for some new functionality. I want it to be trivial to run simulations that incorporate dozens of parameters.
Trivial to set them up I mean because we can use the articles as scaffolds to build to high level functionality.
NDSolve is a pretty high level function, but I think in the future it will be considered low level compared to how sophisticated software will eventually be.
 
I would start with some basic GUI interfaces that are fairly simple to at least help people understand what is going on.
A picture is worth a thousand words, so although I understand what you are saying I'm not entirely sure I understand ;)
 
Yes, I think we could put interfaces into the code associated with different articles. I just quickly defined a scope for code to be included as any code that can be used to enhance, generate, or verify content in the associated Wikipedia article.
So I've started three of them so far and plan to do lots more. en.wikipedia.org/wiki/User:Wakebrdkid/Wikicode
 
3:56 AM
How is using Wikipedia better/different then using Mathematica's built documentation system?
 
I haven't written any documentation other than Symbol::usage="..."
 
You certainly could implement a push pull mechanism in Mathematica's documentation system.
And how is that better? As they say write the code once document 16 times
 
I just look at the test cases for now. It is something I need to figure out though.
 
Are you on? or actively use github?
 
I recently made an account but I haven't used it.
 
4:02 AM
I fail to see how what you recommend is better then github or ( other CMS). Do have experience with CMS(github') or Linux?
 
Only from a couple of classes. I just don't want to have to approve people to work on a project. I think with a wiki they can just work on it if they want.
 
I would read into github.com well git en.wikipedia.org/wiki/Git_(software) actually freecode.com and subversion.tigris.org . They all have similar offerings from what I currently understand.
Going to bed good night
 
Good night. I hadn't considered just giving away the password for uploads to a traditional CMS.
I think I still have a lot of code left to write before other people would want to contribute though.
I wonder in the Wolfram Library what is the maximum number of other packages (counted recursively) any single package uses.
 
 
5 hours later…
8:54 AM
@Mr.Wizard @halirutan if any around, can I please ask a question on Halirutan method for the image post? How to use it to get the same looking image as as wiki formula? Do I need to do something more than just ImageApply[m.# &, lena]? Here is my code
ClearAll[rgb2YCbCr];
house = Import[
   "http://upload.wikimedia.org/wikipedia/commons/d/d0/Barns_grand_\
tetons.jpg"];
lena = Import["ExampleData/lena.tif"];
rgb2YCbCr[{r_, g_, b_}] :=(*ref:en.wikipedia.org/wiki/YCbCr,
  digital formula*)
  {16 + (65.481 r + 128.553 g + 24.966 b),
   128 + (-37.797 r - 74.203 g + 112 b),
   128 + (112 r - 93.786 g - 18.214 b)};
m = {{0.299, .587, .114}, {-.168736, -.331264, .5}, {.5, -.418688, \
-.081312}};

lenaUsingFormula = Map[rgb2YCbCr, ImageData[lena], {2}];
and I get this:
if I use ImageAdjust on Halirutan method image, I still do not get the same thing:
may be I need to do some scaling or something?
 
 
2 hours later…
10:29 AM
@Nasser I'm not sure "Analog YPbPr" (Halirutan's version) is supposed to look exactly like "Digital Y′CbCr" which is what you use. Did you try the conversion right underneath those sets of equations "or simply componentwise..." to get from Pr and Pb to Cb and Cr? Anyone else trying out this code be warned that lenaYCbCr is lenaUsingFormula
 
@Calle The stuff below this: lenaUsingHalirutanMethod = ImageApply[m.# &, lena]; deals with displaying each channel (Y,Cb,Cr). I wanted to know why the result of the command above does not show the same as using the other wiki formula I have there? Are they not to be the same? So if Halirutan method is using the Analog version, and I was using the digital version, then we are comparing apples with oranges here. Right? I am missing something...
Only Halirutan I think would know.
I am not an image expert at all. took one course in it long time ago.
WHat I wanted is to use Halirutan method to obtain the same looking image as the wiki digital formula, so I can update my post and put all in same line to compre.
 
 
3 hours later…
2:02 PM
Hey guys!
 
2:41 PM
@Sosi heya
 
3:07 PM
How's it going @JacobAkkerboom?
 
Heya, fine, and you?
 
All good
 
today the boss wants us to leave earlier so that we can all go to the beach
 
ahh nice :D
 
3:18 PM
sigh, if only I didn't have so much to do...
 
Ahh
Do you have to do a lot of Mathematica stuff? Or other stuff?
 
a lot of other stuff to do with Mma :P
 
Hehe
Well, at least you can work with MMA :)
 
yeah :P
well, I got to rush. still got to get the swimsuit (or however it is called the male version of that)
See you tomorrow! ;)
 
@Sosi ok have fun at the beach I hope! Cya!
 
3:21 PM
posted on August 05, 2013 by Crystal Fantry

Thirty-three extremely intelligent high school students gathered at Bentley University to participate in our second annual Mathematica Summer Camp. The program lasted two weeks, and within this small window of time, students created their very own Mathematica projects. At the end of the camp, students presented these projects to their peers, camp instructors, and Stephen [...]

 
 
7 hours later…
10:06 PM
It's surprisingly quiet here this evening..
 
I'm here. Writing importers for USGS mineral production data.
 
@MichaelHale but no interesting discussion is going on ;-)
Btw, our so called FAQ is useless for anyone who is trying to find help on how to properly format a post.
 
Ah, well I'm currently on rhenium. An interesting fact is that it was apparently the last stable element to be discovered, but that might be off topic.
 
Sorry, I meant help..
@MichaelHale discovered by whom?
 
Walter Noddack, Ida Tacke, and Otto Berg
 
10:14 PM
@MichaelHale the good old days when we Germans were top scientists ;-)
 
I think the Germans are still doing fine. They are driving most of the Wikidata development. That is the source of most of my emails from Germans. After I finish cleaning the data set I'll need to make a sample image showing what you can do with it, so if anyone has a few favorite minerals from this list I will use them in the sample image comparing their historical production amounts. minerals.usgs.gov/ds/2005/140
 
 
1 hour later…
11:16 PM
@Mr.Wizard Are you around?
 
11:26 PM
What do we do if the accepted answer is wrong (and I don't want my answer to be accepted). The answer which is accepted suggests that it is necessary to clone a tensor if you want to return it to Mathematica and that the docs are wrong. I spoke to Todd Gayley and he confirmed that this should work without cloning and it is a bug.
I see that the accepted answer is a workaround to the bug but then this should be pointed out because once it is fixed, cloning the tensor is useless overhead.
 
@halirutan Until it is fixed, that's the answer, right?
You can perhaps let that user know what TG said...
 
@rm-rf TG commented after our talk under my answer.
TG told me that it seems they are currently working on it.
 
Ah, I see that... perhaps nudge TG himself to post an answer indicating that it's a bug and that it will be fixed?
 
@rm-rf What bothers me is the line "Yes. I believe the docs are in error." in the accepted answer.
 
An easier way out would be to ping xslittlegrass, point them to TG's comment and ask them to unaccept, at least for the time being... then when there's confirmation that the bug is fixed, you can update the answer or TG can post, etc.
Or perhaps just ask them to make a note of TG's comments in the question
 
11:38 PM
@rm-rf Yes, that's probably the best idea.
 

« first day (565 days earlier)      last day (3933 days later) »