Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
G

George Jonsson

@George Jonsson
About
Posts
104
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • regular expression to find tax file numbers
    G George Jonsson

    I agree with Peter_in_2780 that you should separate the matching of the number and the validation calculation. Just create two methods, one where you check the format and the other to calculate and validate the check digit. You didn't specify any variants of the text you want to match, so I just guessed what it could look like. For the actual regular expression you could do like this:

    Input: TFN '123456782'
    Regex: ^TFN\s*(')?(?\d{3}\s*\d{3}\s*\d{3})(')?\s*$

    It will get these variants:

    TFN '123456782'
    TFN'123 456 782'
    TFN123456782
    TFN 123 456 782

    Explanation:

    ^ Start of the string
    $ End of the string
    \s* Consumes 0 or more white space characters. It will make sure you match TFN123 and TFN 123
    (')? Optional quotation mark
    (? ...) Named group, makes it easier to extract the actual number

    If necessary, you will have to remove the spaces in a second step. Hope it helps.

    Regular Expressions algorithms regex tutorial question

  • Need help with API Values in XElement
    G George Jonsson

    Your question is not very clear, but I assume you want to create an XElement that when written to a file will look like this

        Event Status
    

    This is one way to do it.

    XNamespace ns = "should probably be the XSD namespace";

    XElement documentation = new XElement(ns + "documentation");
    documentation.SetValue("Event Status");

    XElement annotation = new XElement(ns + "annotation");
    annotation.Add(documentation);

    XElement eventStatus = new XElement(ns + "element");
    eventStatus.SetAttributeValue(XName.Get("name"), "EventStatus");
    eventStatus.SetAttributeValue(XName.Get("type"), "xsd:string");
    eventStatus.Add(annotation);

    XElement root = new XElement("root", new XAttribute(XNamespace.Xmlns + "xsd", ns));
    root.Add(eventStatus);

    string s = root.ToString(); // Just a debug test line

    XML / XSL question csharp database xml json

  • How to create XSD without repeating myself
    G George Jonsson

    I guess you can do something like this: First create your own type.

    Then use it for your elements, head, body and foot

    XML / XSL xml database tutorial question

  • The growing importance of the Julia language
    G George Jonsson

    I had no idea. I must start to write more scripts then. ;P

    The Insider News

  • Physicists manage to slow down light in a vacuum
    G George Jonsson

    Here in the Philippines it is actually even more "exciting", because they mix both metric and the US system. In some stores you by a cable by the yard and in others by the meter. My favourite is the paper sizes. The following are commonly used:

    Short (Letter)
    A4
    Long (Folio)
    Legal
    A3

    Both me and my printer are confused. And as an oddity, McDonald's is the better option because the major competitors are Jollybee and Wendy's. Must be unique in the world that McDonald's is the preferred choice. ;P

    The Insider News

  • Physicists manage to slow down light in a vacuum
    G George Jonsson

    Quote:

    And apologies to those offended by non-SI units. 3x10^8m/s just seems like a boring number.

    You can write it 300 000 km/s, that's one of the beauties with the metric unit. (Try to go from yards to miles. :))

    The Insider News

  • The growing importance of the Julia language
    G George Jonsson

    A good debugger would be nice too.

    The Insider News

  • Google Translate
    G George Jonsson

    Most definitely. Google should fix this issue. Meanwhile you can dump your code in the Q&A forum and demand that someone translates it for you. ;P It has happened before.

    The Lounge

  • Learning C++
    G George Jonsson

    The book I used once upon a time was in Swedish, so it wouldn't help you. There are plenty of sites out there and this is just one example: C++ Language - C++ Tutorials[^]

    The Lounge

  • The growing importance of the Julia language
    G George Jonsson

    I have a confession to make. Julia wasn't on my radar. :-O

    The Insider News

  • Cheer Up!
    G George Jonsson

    Actually she is. :-D I can still bring out the old photo at times when she is grumpy. And girls get grumpy for all kinds of reasons unknown to man. ;P

    The Lounge com

  • Cheer Up!
    G George Jonsson

    Haha I once made a look alike comparison with Grumpy Cat and my girlfriend. I thought it was spot on, but she didn't appreciate it all that much. :-D

    The Lounge com

  • Cheer Up!
    G George Jonsson

    Could work. And maybe it is cuddly as well as ugly.

    The Lounge com

  • Not a good sign
    G George Jonsson

    Quote:

    So, it seems she is replacing one code generating tool for another! Laugh | :laugh: One that doesn't talk back

    A slippery slope you have been pushed out on. ;)

    The Lounge csharp business question announcement

  • Oracle is a piece of shit!
    G George Jonsson

    Doesn't Oracle own MySQL these days?

    The Lounge csharp mysql oracle com graphics

  • 14-Year-old CEO Turned Down $30 Million Offer for His Start Up
    G George Jonsson

    Haha. Not a good thing to do if your girlfriend is sneaking up on you either. That kind of trouble I can live without.

    The Lounge sysadmin announcement

  • 14-Year-old CEO Turned Down $30 Million Offer for His Start Up
    G George Jonsson

    Maybe if you could carry the knowledge you have now with you. But I was more thinking of the money, though. Would be nice with a pile of cash to lean back on.

    The Lounge sysadmin announcement

  • Google voice search records and keeps conversations people have around their phones – but you can delete the files
    G George Jonsson

    Well, they have read our mails and documents for years, so why not voice recording too.

    The Insider News html announcement

  • How did the Open DNS take control of my browsing?
    G George Jonsson

    I'm very sure no one else has used my computer, but it might, as you say, have been bundled with something else. I didn't install anything new the last few days, though. But how do you configure the filter level with OpenDNS? Different DNS server addresses or a configuration page somewhere? I didn't dig into it as I don't want it.

    The Lounge question sysadmin com algorithms data-structures

  • 14-Year-old CEO Turned Down $30 Million Offer for His Start Up
    G George Jonsson

    At least one honest guy around. :)

    The Lounge sysadmin announcement
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups