• What are you working on? December 2011 Edition
    3,353 replies, posted
Man, Eve is good. [IMG]http://dl.dropbox.com/u/27714141/CleverEve.png[/IMG] [editline]31st December 2011[/editline] Download for this build: [url]http://dl.dropbox.com/u/27714141/CleverOmegle.zip[/url] I think I'm done coding for the day.
[QUOTE=voodooattack;33978368]Man, Eve is good. [IMG_THUMB]http://dl.dropbox.com/u/27714141/CleverEve.png[/IMG_THUMB] [editline]31st December 2011[/editline] Download for this build: [url]http://dl.dropbox.com/u/27714141/CleverOmegle.zip[/url] I think I'm done coding for the day.[/QUOTE] All of those bots fail the Turing test, as it's easy to tell them apart from the humans: the bots are already more intelligent.
[QUOTE=Darwin226;33969516]It's probably an optimization since the box will probably be filled. [editline]30th December 2011[/editline] Late[/QUOTE] There is still one case where it works incorrectly: [img]http://shrani.si/f/q/l1/3moSl3ef/mirrors.png[/img] The upper box would be fine if it was filled in, but the lower one clearly lets light through. It only seems to happen if you let light cross the diagonal that splits the lit part of the box in two halves.
\snip
[QUOTE=TheBoff;33979051]I'm working on persuading my mother that incest is acceptable.[/QUOTE] Are you doing that in C++? [editline]31st December 2011[/editline] [code]Welcome to CleverOmegle. Press 'Connect' to start! -------------------------------------------------------------------------------- You're now chatting with a random stranger. Say hi! [14:26] Stranger: r u horny and looking for cock? [14:26] You: hai [14:26] You: no Exception: System.Net.WebException: The remote server returned an error: (404) Not Found. at System.Net.HttpWebRequest.GetResponse() at dotOmegle.PostSubmitter.PostData(String url, String postData, Int32 retries) Exception: System.Net.WebException: The remote server returned an error: (404) Not Found. at System.Net.HttpWebRequest.GetResponse() at dotOmegle.PostSubmitter.PostData(String url, String postData, Int32 retries) Exception: System.Net.WebException: The remote server returned an error: (404) Not Found. at System.Net.HttpWebRequest.GetResponse() at dotOmegle.PostSubmitter.PostData(String url, String postData, Int32 retries) Exception: System.Net.WebException: The remote server returned an error: (404) Not Found. at System.Net.HttpWebRequest.GetResponse() at dotOmegle.PostSubmitter.PostData(String url, String postData, Int32 retries) Exception: System.Net.WebException: The remote server returned an error: (404) Not Found. at System.Net.HttpWebRequest.GetResponse() at dotOmegle.PostSubmitter.PostData(String url, String postData, Int32 retries) Exception: System.Net.WebException: The remote server returned an error: (404) Not Found. at System.Net.HttpWebRequest.GetResponse() at dotOmegle.PostSubmitter.PostData(String url, String postData, Int32 retries) Exception: System.Net.WebException: The remote server returned an error: (404) Not Found. at System.Net.HttpWebRequest.GetResponse() at dotOmegle.PostSubmitter.PostData(String url, String postData, Int32 retries) Exception: System.Net.WebException: The remote server returned an error: (404) Not Found. at System.Net.HttpWebRequest.GetResponse() at dotOmegle.PostSubmitter.PostData(String url, String postData, Int32 retries) [14:26] Cleverbot: Are you a good looking computer? Stranger disconnected. Starting a new conversation. Exception: System.Net.WebException: The remote server returned an error: (404) Not Found. at System.Net.HttpWebRequest.GetResponse() at dotOmegle.PostSubmitter.PostData(String url, String postData, Int32 retries) Exception: System.Net.WebException: The remote server returned an error: (404) Not Found. at System.Net.HttpWebRequest.GetResponse() at dotOmegle.PostSubmitter.PostData(String url, String postData, Int32 retries) Exception: System.Net.WebException: The remote server returned an error: (404) Not Found. at System.Net.HttpWebRequest.GetResponse() at dotOmegle.PostSubmitter.PostData(String url, String postData, Int32 retries) Exception: System.Net.WebException: The remote server returned an error: (404) Not Found. at System.Net.HttpWebRequest.GetResponse() at dotOmegle.PostSubmitter.PostData(String url, String postData, Int32 retries)[/code] CleverOmegle doesn't work for me D:
For those who missed my previous 2 hints; GLSL Sandbox is amazing You can edit GLSL code and see the results live, it is very fun to mess with stuff other people made as well [t]http://dl.dropbox.com/u/44437457/other/hypno.png[/t] Just look at that fancy hypno shader, made by me, found here [url]http://glsl.heroku.com/e#931.0[/url]
[IMG]http://puu.sh/c1ZZ[/IMG] :downs:
[QUOTE=Naarkie;33979379][IMG]http://puu.sh/c1ZZ[/IMG] :downs:[/QUOTE] You wrote an "idiot reply" generator?
Redoing my tile engine now that I have a better understanding of how it's all going to work, mostly because I cant even read the old code.
Not quite what I'm working on, but related - picked up a late Christmas present from Staples, for maths and programming and whatnot: [quote][img] http://www.imgur.com/EbMpr.jpg[/img][/quote] :D
My first foray into the world of OS development. The kernel is written in C and there's a bit of assembly to allow the bootloader to start it up. I'm not sure why but writing this stuff is strangely compelling. [img]http://i.imgur.com/mgwBA.png[/img]
What
[QUOTE=esalaka;33980169]What[/QUOTE] You are going to hate.
[QUOTE=esalaka;33980169]What[/QUOTE] Stop hating.
[QUOTE=Asgard;33980288]You are going to hate.[/QUOTE] no :saddowns:
[QUOTE=pebkac;33978816]There is still one case where it works incorrectly: [img]http://shrani.si/f/q/l1/3moSl3ef/mirrors.png[/img] The upper box would be fine if it was filled in, but the lower one clearly lets light through. It only seems to happen if you let light cross the diagonal that splits the lit part of the box in two halves.[/QUOTE] In-game you would never get a mirror partially inside a solid box, but I may as well fix that for the sandbox.
So, I wrote this method last night to fetch [URL="http://www.pandorabots.com/botmaster/en/mostactive"]this list[/URL] of Pandora Bots. [csharp]private void refreshBotList() { PostSubmitter popular_list = new PostSubmitter(); popular_list.Url = "http://www.pandorabots.com/botmaster/en/mostactive"; popular_list.Type = PostSubmitter.PostTypeEnum.Get; string list_html = string.Empty; bool error; do { error = false; try { list_html = popular_list.Post(); } catch (WebException) { error = true; } } while (error && MessageBox.Show(this, "Could not connect to Pandora Bots.", "Network error", MessageBoxButtons.RetryCancel, MessageBoxIcon.Warning) == DialogResult.Retry); if (error) { BotName = null; BotId = null; return; } ClearList(); string pattern = "<td.*>\\s*<a.*?href\\s*=\\s*[\"\']/pandora/talk\\?botid=(?<id>.*?)[\'\"].*?>" + "(?<name>.*)</a>\\s*</td>\\s*<td.*>\\s*(?<interactions>\\d+)\\s*</td>"; Regex regx = new Regex(pattern); MatchCollection matches = regx.Matches(list_html); if (matches.Count > 0) { foreach (Match m in matches) { GroupCollection g = m.Groups; if (!g["name"].Success || !g["id"].Success) continue; AddBot("popular", HttpUtility.HtmlDecode(g["name"].Value), HttpUtility.HtmlDecode(g["id"].Value), HttpUtility.HtmlDecode(g["interactions"].Value)); } } else AddBot("popular", "List not available."); if (CustomBots != null) { foreach (PandoraBotRecord bot in CustomBots) AddBot("custom", bot.Name, bot.Id); } else AddBot("custom", "None added."); }[/csharp] Today, when I woke up and looked at the regular expression above, I realised that I have no idea how the fuck it works. Does anybody else have this problem? Regular expressions only make sense while I'm in the process of writing them.. :suicide:
[code]Programming King: 1 (x27): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33540826&viewfull=1#post33540826 2 (x27): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33952345&viewfull=1#post33952345 3 (x26): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33948461&viewfull=1#post33948461 4 (x26): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33653065&viewfull=1#post33653065 5 (x25): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33879227&viewfull=1#post33879227 6 (x16): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33935197&viewfull=1#post33935197 7 (x16): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33931914&viewfull=1#post33931914 8 (x14): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33581811&viewfull=1#post33581811 9 (x12): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33944455&viewfull=1#post33944455 10 (x12): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33944822&viewfull=1#post33944822 11 (x10): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33937786&viewfull=1#post33937786 12 (x10): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33677469&viewfull=1#post33677469 13 (x10): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33683218&viewfull=1#post33683218 14 (x9): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33980127&viewfull=1#post33980127 15 (x9): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33606364&viewfull=1#post33606364 16 (x9): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33953233&viewfull=1#post33953233 17 (x8): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33904441&viewfull=1#post33904441 18 (x8): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33836595&viewfull=1#post33836595 19 (x8): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33924863&viewfull=1#post33924863 20 (x8): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33595807&viewfull=1#post33595807 21 (x7): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33658685&viewfull=1#post33658685 22 (x7): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33965065&viewfull=1#post33965065 23 (x7): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33934132&viewfull=1#post33934132 24 (x7): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33972604&viewfull=1#post33972604 25 (x7): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33617641&viewfull=1#post33617641 Artistic: 1 (x39): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33684144&viewfull=1#post33684144 2 (x32): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33685077&viewfull=1#post33685077 3 (x28): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33807940&viewfull=1#post33807940 4 (x26): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33668214&viewfull=1#post33668214 5 (x26): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33569527&viewfull=1#post33569527 6 (x24): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33951408&viewfull=1#post33951408 7 (x22): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33607223&viewfull=1#post33607223 8 (x21): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33823064&viewfull=1#post33823064 9 (x20): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33551436&viewfull=1#post33551436 10 (x18): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33754997&viewfull=1#post33754997 11 (x16): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33817161&viewfull=1#post33817161 12 (x16): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33546416&viewfull=1#post33546416 13 (x15): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33539467&viewfull=1#post33539467 14 (x15): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33778044&viewfull=1#post33778044 15 (x15): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33878574&viewfull=1#post33878574 16 (x14): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33876605&viewfull=1#post33876605 17 (x14): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33961061&viewfull=1#post33961061 18 (x14): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33634327&viewfull=1#post33634327 19 (x13): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33840299&viewfull=1#post33840299 20 (x12): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33620950&viewfull=1#post33620950 21 (x12): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33739192&viewfull=1#post33739192 22 (x12): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33686864&viewfull=1#post33686864 23 (x11): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33895231&viewfull=1#post33895231 24 (x11): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33710323&viewfull=1#post33710323 25 (x10): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33692340&viewfull=1#post33692340 Winner: 1 (x74): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33694632&viewfull=1#post33694632 2 (x72): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33700775&viewfull=1#post33700775 3 (x47): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33551096&viewfull=1#post33551096 4 (x35): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33660292&viewfull=1#post33660292 5 (x34): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33614737&viewfull=1#post33614737 6 (x30): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33847598&viewfull=1#post33847598 7 (x28): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33704320&viewfull=1#post33704320 8 (x24): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33694595&viewfull=1#post33694595 9 (x23): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4cd 9c48&p=33772731&viewfull=1#post33772731 10 (x23): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33919085&viewfull=1#post33919085 11 (x22): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33584500&viewfull=1#post33584500 12 (x22): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33598803&viewfull=1#post33598803 13 (x21): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33681512&viewfull=1#post33681512 14 (x20): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33802640&viewfull=1#post33802640 15 (x20): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33928275&viewfull=1#post33928275 16 (x18): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33966505&viewfull=1#post33966505 17 (x16): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33692408&viewfull=1#post33692408 18 (x16): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33688632&viewfull=1#post33688632 19 (x15): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33867125&viewfull=1#post33867125 20 (x15): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33751010&viewfull=1#post33751010 21 (x15): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33964539&viewfull=1#post33964539 22 (x15): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33975131&viewfull=1#post33975131 23 (x15): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33694450&viewfull=1#post33694450 24 (x14): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33619368&viewfull=1#post33619368 25 (x14): http://www.facepunch.com/threads/1144771?s=ee0880e6c1560a857872c54bb4c d9c48&p=33977983&viewfull=1#post33977983 [/code] This list will be updated. Highlights parsing for the entire thread takes roughly 90 seconds. Requests to reparse the thread will be fulfilled.
[code] <td.*>\\s*<a.*?href\\s*=\\s*[\"\']/pandora/talk\\?botid=(?<id>.*?)[\'\"].*?>(?<name>.*)</a>\\s*</td>\\s*<td.*>\\s*(?<interactions>\\d+)\\s*</td>[/code] There's a few weird things in this regex, like you keep using '.*?' but in that the ? has no effect, since the * makes the match optional anyway. (Also use a HTML parser :v:) [b]Edit[/b] Well Apparently not. See Overv's post.
[QUOTE=danharibo;33981728][code] <td.*>\\s*<a.*?href\\s*=\\s*[\"\']/pandora/talk\\?botid=(?<id>.*?)[\'\"].*?>(?<name>.*)</a>\\s*</td>\\s*<td.*>\\s*(?<interactions>\\d+)\\s*</td>[/code] There's a few weird things in this regex, like you keep using '.*?' but in that the ? has no effect, since the * makes the match optional anyway. (Also use a HTML parser :v:)[/QUOTE] Regex is witchcraft :tinfoil:
[QUOTE=voodooattack;33981582]So, I wrote this method last night to fetch [URL="http://www.pandorabots.com/botmaster/en/mostactive"]this list[/URL] of Pandora Bots. Today, when I woke up and looked at the regular expression above, I realised that I have no idea how the fuck it works. Does anybody else have this problem? Regular expressions only make sense while I'm in the process of writing them.. :suicide:[/QUOTE] [url]http://stackoverflow.com/a/1732454/442078[/url] [url=http://www.codeproject.com/KB/cs/DOL_HTML_Parser.aspx]Just use an html parser.[/url]
[QUOTE=danharibo;33981728][code] <td.*>\\s*<a.*?href\\s*=\\s*[\"\']/pandora/talk\\?botid=(?<id>.*?)[\'\"].*?>(?<name>.*)</a>\\s*</td>\\s*<td.*>\\s*(?<interactions>\\d+)\\s*</td>[/code] There's a few weird things in this regex, like you keep using '.*?' but in that the ? has no effect, since the * makes the match optional anyway. (Also use a HTML parser :v:)[/QUOTE] No, that extra question mark indicates a non-greedy match. That means it will stop as soon as it finds a match instead of trying to find the longest available match. In the case of [i].*?>[/i], that means it will stop when it finds the first > and not go any further.
[QUOTE=Overv;33981820]No, that extra question mark indicates a non-greedy match. That means it will stop as soon as it finds a match instead of trying to find the longest available match. In the case of [i].*?>[/i], that means it will stop when it finds the first > and not go any further.[/QUOTE] Ah I see, Makes sense.
[QUOTE=danharibo;33981728][code] <td.*>\\s*<a.*?href\\s*=\\s*[\"\']/pandora/talk\\?botid=(?<id>.*?)[\'\"].*?>(?<name>.*)</a>\\s*</td>\\s*<td.*>\\s*(?<interactions>\\d+)\\s*</td>[/code] There's a few weird things in this regex, like you keep using '.*?' but in that the ? has no effect, since the * makes the match optional anyway. (Also use a HTML parser :v:)[/QUOTE] Yeah, I just noticed when you brought it up, it's benign as far as I know though.. [QUOTE=high;33981768][url]http://stackoverflow.com/a/1732454/442078[/url][/QUOTE] I had a feeling that someone was going to link me to that... I'm not parsing HTML elements, I'm extracting text patterns that happen to be embedded in html. I'm sure that I'm using the right tool for the right job. [editline]31st December 2011[/editline] [QUOTE=Overv;33981820]No, that extra question mark indicates a non-greedy match. That means it will stop as soon as it finds a match instead of trying to find the longest available match. In the case of [i].*?>[/i], that means it will stop when it finds the first > and not go any further.[/QUOTE] Aha!! Now I remember! (No, not really.. :eng101:)
[QUOTE=voodooattack;33981874] I had a feeling that someone was going to link me to that... I'm not parsing HTML elements, I'm extracting text patterns that happen to be embedded in html. I'm sure that I'm using the right tool for the right job.[/QUOTE] You are still matching around tags though. If you have html tags in your regex string then you should really be using an html parser instead.
[QUOTE=voodooattack;33981874]Yeah, I just noticed when you brought it up, it's benign as far as I know though.. I had a feeling that someone was going to link me to that... I'm not parsing HTML elements, I'm extracting text patterns that happen to be embedded in html. I'm sure that I'm using the right tool for the right job. [editline]31st December 2011[/editline] Aha!! Now I remember! (No, not really.. :eng101:)[/QUOTE] Yeah, Regex is ideally used for matching text, but you're using it to match XML &&|| HTML which have better tools for the job (since they have their own conventions and rules that are hard to express with a simple Regex)
[QUOTE=danharibo;33981974]Yeah, Regex is ideally used for matching text, but you're using it to match XML &&|| HTML which have better tools for the job (since they have their own conventions and rules that are hard to express with a simple Regex)[/QUOTE] Impossible to express even.
I would recommend using XPath for querying XML documents, this page having some decent examples: [url]http://msdn.microsoft.com/en-us/library/ms256086.aspx[/url] If you're lucky you can probably find a library that can use XPath to query HTML too.
[QUOTE=amcfaggot;33981641][code]//table snip[/code][/QUOTE] That batman picture I posted is second by one winner rating. I have a strong urge to self-rate :v: [editline]31st December 2011[/editline] Also, I'm ripping apart that C++ grapher I started and replacing it with another solution that should be faster, as well as a [i]lot[/i] simpler. I'm glad I left the idea to mature a little :)
What if you are trying to find errors in an XML document however? Errors that a parser may hide, ignore or internally correct? I can see cases (Such as a small, known dataset) where a simple regex would work fine, and be cleaner code-wise. In fact this is one point that stack overflow seem to agree on, in that link.
Sorry, you need to Log In to post a reply to this thread.