Is there any way to change NumberDecimalSeparator in current culture?
This code doesn't change anything...
I write it in App.xaml.cs in InitializeLanguage() function..
Thread.CurrentThread.CurrentUICulture.NumberFormat.NumberDecimalSeparator = ".";
Thanks in advance!
I can't think of a good reason why you'd want to do that. It is more than likely to confuse your users since they are used to seeing numbers formatted according to the rules of their own culture.
If you really do have a compelling case for doing this, though, why not find a culture with the format that you want to apply, and supply that culture as an argument to your string conversion code to achieve the same result?
Related
enter image description here
Is there really a problem with the parameters? Or is there something else?
I was going to convert this less file to css. But,something wrong is holding my ankle...
In my opinion, the compiler accepts '*' as a selector, not multiplication, and if not, let me know what's wrong is..
With Regex, I need to find and replace all the mailaddresses in a fully rendered HTML-page, because i want to SPAM-protect all of them. To be precise i want all addresses except them in formular-elements (because if a validation of a user-input fails, i still want to display the inserted mailaddress and not a replaced one).
To find or write a Regex to simply search mailaddresses is not a problem. The problem is the exclusion of the ones in formular-elements. Has anyone a suggestion how to resolve this problem? Is this possible in Regex?
Some examples:
I want to match "...My content, mail#mail.com, more content......"
But i don't want to match: "...Your mail:mail#mail.com..."
I know it would be better to parse the HTML and simply skip form-elements, but performance matters and as i said before, this task is performed every time the website is called...
Thanks for your help!
It's probably impossible. See: RegEx match open tags except XHTML self-contained tags to start with. Second regex doesn't do a very good job of "not". (Some regex support it, some don't, but all are slow at it.) Perhaps someone who is much better at regex than me might be able to help you, but I suspect doing this is impossible.
I have a crawler that scans a few websites and I'm unable to find this encoding structure, I was hoping it might look familiar to someone if not, it's worth a shot in the dark.
%3D-67%7C-40%7C-18%7C-105%7C114%7C50%7C-106%7C-119%7C6%7C-120%7C-31%7C-77%7C-86%7C-38%7C69%7C-74%7C54%7C-60%7C45%7C72%7C-21%7C52%7C-21%7C4
I was using http://www.w3schools.com/tags/ref_urlencode.asp but i dont think this is acsii
Well i'm trying to follow this link.
http://www.autotrader.com/redirect/redirector_link.jsp?to_url=http%3A%2F%2Fwww.carfax.com%2Fcfm%2Fcheck_order.cfm%3Fpartner%3DATD_D%26vin%3D-67%7C-40%7C-18%7C-105%7C114%7C50%7C-106%7C-119%7C6%7C-120%7C-31%7C-77%7C-86%7C-38%7C69%7C-74%7C54%7C-60%7C45%7C72%7C-21%7C52%7C-21%7C45&mis=FCVDBDLNCF850&car_id=301290632&make=HONDA
And get back the VIN
Looks URL-encoded to me, the plaintext being
=-67|-40|-18|-105|114|50|-106|-119|6|-120|-31|-77|-86|-38|69|-74|54|-60|45|72|-21|52|-21|4
Now how to further interpret this I don't know, might be something custom. More context might help.
This is actually URL-encoding. The result is something like this:
=-67|-40|-18|-105|114|50|-106|-119|6|-120|-31|-77|-86|-38|69|-74|54|-60|45|72|-21|52|-21|4
This looks a lot like a serialization of a byte[] value.
Can you give a little more context, like, for example, where does this string come from ?
I'm trying to set validation for an image alternate text, and here's what I think should be validated so far. It's a pretty simple RegEx, but I'm yet to start learning that topic..
Double quotes
< and > characters to prevent HTML input
Is there anything else you would add to this?
Would text length ever be an issue?
I appreciate your help and if someone could provide this simple RegEx I'd be really grateful :)
That sounds like a good place to start for me. Max size: pick something sane, unless you want it to be valid to post a dissertation as an alt text - though it is probably possible. As for the regex to validate it's okay:
/^[^"<>&\\]{0,XXX}$/
where XXX is the maximum size you want. Or get rid of the {0,XXX} altogether and replace it with * to mean "zero or more". Syntax depends on language, of course.
Also found this, looked interesting:
http://www.cs.tut.fi/~jkorpela/html/alt.html
Update:
Yeah, you two make a good point. As long as the quotes used around the alt-text aren't themselves single-quotes, then they should be fine.
And as per other answers below, possibly also & and . Though you may need to be careful with how many slashes, whether they are before things that matter. And also, whether and such things are allowed in the text itself.
What is the best way to typeset a function with arguments for readibility, brevity, and accuracy? I tend to put empty parentheses after the function name like func(), even if there are actually arguments for the function. I have trouble including the arguments and still feeling like the paragraph is readable.
Any thoughts on best practices for this?
I usually take that approach, but if I feel like it's going to cause confusion, I'll use ellipses like: myFunction(...)
I guess if I were good, I would use those any time I was omitting parameters from a function in text.
I would simply be a little more careful with the name of my variables and parameters, most people will then be able to guess much more accurately what type of data you want to hold in it.