XCeed Extended Toolkit MaskedTextBox Format behavior - formatting

I'm using Xceed Extended Toolkit Masked TextBox in WPF 4.5 with C#.
I have a simple MaskedTextBox:
<xctk:MaskedTextBox Text="{Binding CNPJ}" Mask="00.000.000/0000-00"/>
The problem is, when application is running the dots in the mask are replaced by commas:
How can I make the Mask use dots instead of commas?

input \ before ".", example:
Mask="00\.000\.000/0000-00"

Related

Visual Studio IDE - Removes heading 0's from my code

When I write a hex value in my VB.NET code, I want it to look like this:
&H0F (Binary: &B00001111)
but instead, Visual Studio makes it (imo) unreadable by removing the leading 0's:
&HF (Binary: &B1111)
That way, I cant see easily whether it's a byte, a short, etc.
So my question is: Is there a setting in the Visual Studio IDE that disables this "feature"?
I really want to keep those 0's.
Thank you in advance!
In VS2017 and above: if you use the group separator _ (underscore character), the leading zeros will not be removed by the editor. See: Hexadecimal, binary, and octal literals
Note that the group separator adds no intrinsic meaning to value; they are just meaningless formatting characters . What I mean by that is that only the digits are preserved when it is evaluated by the parser. Think of it as all "_" are removed from the string before evaluating. So, &B1_1_1_1 is the same as &B1________________1_1_1.
Some Examples:
Dim b As Byte
b = &B0000_1111
b = &B0_0_0_0_1_1_1_1
b = &H0_F

pandas to_latex() escaping "\\newline" for use in LaTex

I am struggling with inexplicable behavior differences between Windows and Mac handling of \newline in a jinja template string.
I have a string, mystring = '123 \\newline 456', that is inside a dataframe. When I use pandas to_latex() on a Mac, this gets converted to 123 \textbackslashnewline. But on Windows, it gets converted to 123 \textbackslash newline
The difference between the two complicates the work-around, which is to replace \textbackslash with an empty string. On the Windows version I need to include the space and on the Mac version I need to not include the space.
Is there a better way to incorporate \newline into the table? I tried r'\newline' and I tried just '\newline' and neither work. The reason the latter doesn't work is that the IDE I am using (PyCharm) interprets the single slash as a line break rather than as part of the string. The double-slash that I use is simply meant to get around that, but then to_latex() interprets the double slash as \textblackslash.
I discovered that the issue was really with pandas to_latex() command and have edited the original question.
For the Windows version, pandas was replacing \\newline with '\textbackslash newline'. But on the Mac, it was replacing it with '\textbackslashnewline' without the space. I was then using:
.replace('textbackslash', '')
which worked on the Mac but failed on Windows because of the extra space. What I cannot figure out though is why there is a difference between the Mac and Windows to_latex() functions.
Note that I am aware of the escape=False option in to_latex(), however that messes up instances where I want the parts of the string escaped (e.g. \$).

How to set comma as ytics separator on gnuplot

NOTE: I have read the "set decimalsign lcale" in the manual - which
seems the usual advice.
However, that deals with changing the the usual English decimal point, not adding a thousands separator.
I would like to display my ytics as "2,000,000"
How can I achieve this?
gnuplot uses the standard C-style formatting for its tic labels, so there isn't really a good way to do this automatically. If you know where you want the tics you can specify them manually, e.g.:
set ytics ("0" 0, "1,000,000" 1e6, "2,000,000" 2e6)
You can type ? set xtics for more info.
If you want to do it automatically, there may be a way to write a gnuplot function implementing something like the solution here, but that may be more trouble than it is worth.

ANSI escape codes in GNU Smalltalk

I'm trying to make a console-based program that makes use of ANSI escape codes with GNU Smalltalk. I can't seem to figure out how to go about printing a string object formatted with ANSI escape codes. I've tried the following.
'\x1b[31mHi' displayNl
This prints the entire string, including the escape code, without any formatting. I would have expected this to print "Hi" in red (and then everything else in the console after that, as I didn't reset the color.)
After googling a bit, I was able to find a couple issues on mailing lists where people were trying to produce things like newlines using "\n". Most of the answers were using the Transcript object's cr method, but I didn't find anything about colors in the textCollector class.
It looks like it shouldn't be all that hard to create my own module in C to achieve this functionality, but I'd like to know if there's a better way first.
I'm aware of the ncurses bindings, but I'm not sure that'd be practical for just making certain pieces of text in the program colored. So, is there a standard way of outputting colored text to the terminal in GNU Smalltalk using ANSI escape sequences?
Ended up getting an answer on the GNU Smalltalk mailing list. Looks like you can use an interpolation operator to achieve this.
For example ('%1[31mHi' % #($<16r1B>)) displayNl. would change the color to red, and ('%1[34mHi' % #($<16r1B>)) displayNl. would change the color to blue.
Basically, the % operator looks for a sequences that look like "%(number)" and replaces them with the objects in the array to the right of the operator. In our case, the array has one item, which is the ascii escape character in hexadecimal. So the "%1" in "%1[31mHi' is being replaced with the escape character, and then printed.
(This answer was stolen almost verbatim from Paolo on the GNU Smalltalk mailing list.)

.net Masked Text Box

What is the mask for "percentage", in a WinForms application (VB.net)?
Per the documentation here: http://msdn.microsoft.com/en-us/library/system.windows.forms.maskedtextbox.mask.aspx
\ Escape. Escapes a mask character,
turning it into a literal. "\\" is the
escape sequence for a backslash.
So the mask for a % sign is \%
Before posting, I made up a quick and dirty winforms app, tried it and it works.
Edit - added although this next item in the documentation makes it look like just a straight % sign should work without the backslash, so I tried it and it works as well.
All other characters Literals. All
non-mask elements will appear as
themselves within MaskedTextBox.
Literals always occupy a static
position in the mask at run time, and
cannot be moved or deleted by the
user.
textEdit1.Properties.Mask.MaskType = Numeric;
textEdit1.Properties.Mask.EditMask = "00.00%%";
textEdit1.Properties.Mask.UseMaskAsDisplayFormat = true;
http://community.devexpress.com/forums/t/59535.aspx