Could someone with V10 running Windows please evaluate this code for me Framed@Pane[Style["+", 12], {12, 12}, Alignment -> {Center, Center}] and let me know if the alignment is centred? There has been a bug persisting for several version on Windows. Just wondering if it has been fixed yet. thanks
@Szabolcs No, but that sounds very interesting! I assume that the best you can hope for is to get something like a confidence interval. I'm 90% certain the root is in this interval but only 50% certain that it's in some smaller interval. Good luck!
Thanks @Simplex . Looks like this is one of the many bugs that persist for multiple versions that Wolfram simply ignore. Not good enough on their part IMO
It crashed again on me when doing a paste inside a string. Still can't guarantee repro it though. However, if I start a new notebook, type "abc", copy it, type " in a new cell, paste the "abc", and then try to undo, it won't undo properly.
@Simplex on a Mac alignment works properly for Pane. i.e. both horizontal and vertical alignments are centred. This has been broken for a long time on Windows (and it seems Linux). It is another example of an ongoing bug that frustrates any attempt to get consistent layouts across platforms.
Maybe convert the "+" into Graphics? Something like `ExportString["+", "PDF"] // ImportString[#, "PDF"][[1]] & // Cases[#, FilledCurve[__], \[Infinity]] & // Graphics`. Graphics objects seem to have more "stable" layout than texts. (ref [the Grid vs GraphicsGrid question](http://mathematica.stackexchange.com/q/52185/17).)
As far as I know, this is not a bug but the behavior of different font-sizes.
I had a similar issue lately when I was creating icons. It seems that := is not aligned. The colon is lower than the equal sign. This vanishes for larger font-sizes.
@Silvia I have a work around that doesn't involve using graphics ...graphics is something i want to avoid. Point is that these bugs should not persist over 3 or 4 versions. And figuring out work arounds ends up being time consuming. Just fix the bugs!
@MikeHoneychurch Sorry was just cooking the meal. The most annoy thing I faced is HorizontalGauge[Dynamic[x]]. It keeps "shaking" when I drag the marker. Now I know I can change the ImagePadding setting to a fixed value to fix the problem, but I still don't understand why they're designed like this.
I'm currently trying to fix the clipboard issue on Linux, so I was thinking that copying text through xclip to a temp file, then copying the xclip content to the clipboard might "fix" the copy/paste issue with chrome. Right now I'm doing this:
My question is that on the imgur uploader one only has to select a cell, and the selected text turns into a png image. Thus, would it possible to do the same and export the selected cell to the ".mmaclip" file?
@Öskå First of all (although I already have reported it to Wolfram), it would probably be helpful to create a post in the Wolfram Community (group: UserInterface) because there, more officials will see it.
@Öskå How bout we create a separate branch on the ImageUploader repository and include it there? Because including this button in the general palette will break it for other users (they don't have xclip) or we have to make it system dependent.
@halirutan Then we are thinking the same, that's a beginning :P
@halirutan The problem is that I don't see any way to turn a cell content into a string.., this is beyond my knownledge (same goes with turning it into an image). I tried looking to this but I didn't really find it.
@Öskå Turning it into an image is pretty simple, because you can use Rasterize for that. The question is, what should happen if the user selects and copies an image, or a 2d formula? Do we want to transform it to input-form?
@halirutan Copying anything else than a text input (so no image in the input) shouldn't be handled IMO. There is the ImageUploader for that.
@halirutan There are only a few image processing cases when an image is used directly in an input, and it's usually in the docs only. When I use it I rather like to have the image defined before, then use it as a variable inside the image processing function. Same goes with Graphs.
Review etiquette question: Just reviewed a First Post, which was a comment instead of an answer. A comment on the answer by @Öskå recommended deletion, and I shared that opinion. My options at this point are "No action needed" and "skip". Is there any value in me adding to the comments or is the no-action-needed approach fine since my concern has already been mentioned by another reviewer?
@bobthechemist I guess neither "No action needed" or "Skip" would help (you would get a +1 for the First Post review stats if you click on "No action needed" though). I already flagged the answer, I guess nothing more can be done.. :) Don't know if rm or Mr.W. deleted it or if it's simply the user who deleted it.
@halirutan The current clipboard without Mathematica?
Kenzo Nakamura uses Mathematica to create Escher-inspired mathematical art. His trademark piece, Three-Circle Mandala, depicts a large circle covered by three smaller, repeating circles that form a Sierpinksi gasket. When Nakamura began using Mathematica, he didn’t originally intend to use it for his artistic endeavors. He found the program by chance at a seminar while [...]
Can TextRecognize do hand-written numbers, or do I have to resort to Classify? I.e., how to make TextRecognize[Erosion[Closing[Binarize[ Import["http://www.mertig.com/zahl.jpg"]], 0.5], 1]] return 335104859`
@Öskå I think I have to use Classify anyway. Do you know how I can get 9 distinct images? I.e., one for each number? (Kind of ImageSplit or something similar) ?
I was playing with WatershedComponents and ImageForestingComponents, but I am not so familiar with those functions.
Something like ImageForestingComponents[ Closing[Binarize@Import["http://www.mertig.com/zahl.jpg"], .5], Automatic, {4, 2}] // Colorize
ImageForestingComponents[ Erosion[Closing[ Binarize@Import["http://www.mertig.com/zahl.jpg"], .5], .5], Automatic, {4, 4}] // Colorize gives me different colors for each number.
@RolfMertig Take a look at ComponentMeasurements. In order to separate each number you can for example compute the bounding box of each component and use ImageTrim to select them. SelectComponents can be useful as well. There are a few questions on number sand TextRecognize; basically Tesseract (the underlying engine) is not good at individual characters but it can do it if the conditions are good. For hand-written numbers Classify will perform much better.
The old approach (based on answers here) was to use ImageCorrelate.
@Öskå I'm on my way home now. Would you test this here. It copies and prints the current selection as text where it can handle even styled things with Integrage or whole cells:
Button["Copy", Block[{value},
value = NotebookRead[SelectedNotebook[]];
If[Head[value] === String,
value = Cell[value]
];
If[Head[value] =!= Cell,
value = Cell[BoxData[value]]
];
Print[First@
MathLink`CallFrontEnd[
FrontEnd`ExportPacket[value, "PlainText"]]];
]
]
If it gives reasonable output in many cases, you could try your xclip approach with it
@bobthechemist I usually upvote the comment. If I can't be sure it's been flagged for deletion, I'd flag it also from the button on the answer. (I'm sure it can show up in the mods' review queue only once.) Then I'd click "No action needed", if that's my only choice. (Isn't there a "Done" button normally?)
@MichaelE2 Thanks - there is a done, but it wasn't highlighted unless I did something, and was hesitant to flag so as not to bother mods with something that looked as if it were already flagged.
@halirutan Your function works like a charm, I'm just having issues with single quotes and printf. If I copy a code with single quotes, printf will eat them considering that they belong to it.. e.g. this is the following command as it looks like from your function:
@Silvia I have. It seems that in windows 8 they have removed the command line compiler support from the sdk. I am trying to install visual studio express 2012 to get this working. Very frustrating
Any recommendations on how to best organize the custom functions used on a daily basis? Straight in the init.m, single package, any specific place where you leave you. I know this is highly subjective as @Mr.Wizard pointed out, but would love to hear from those who are very much experiences and understand potential pros and cons.
@PatoCriollo I prefer packages over init.m because lets me load only the functionality I need. This is important to me as my work often pushed the memory limits, so I liked to limit what was needed.
As to organization, I try to have each package have a narrow scope, as this goes with the theme of limiting what I load at any give time. But, I also tried to make each package relatively complete within its scope. This took some extra time, and usually I stopped at good enough, but it would give me something to tinker with.
@PatoCriollo To clarify I recommended putting the functions in one or more packages, and loading those pages from init.m, not putting the functions directly in init.m.