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]
<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.