• What are you working on? December 2011 Edition
    3,353 replies, posted
Got shaders to work, material system is over 33% of all engine code now [img]http://dl.dropbox.com/u/4838268/shader.png[/img]
[QUOTE=synthiac;33554750]music?[/QUOTE] Sounds like [media]http://www.youtube.com/watch?v=W3hU3cCEF7k[/media]
[img]http://i.imgur.com/40Bti.png[/img] I have fucked up [editline]3rd December 2011[/editline] [img]http://i.imgur.com/Dsnqy.png[/img] And now it's fixed! I think those are valid avatars at least.
[QUOTE=amcfaggot;33555364] [img]http://i.imgur.com/Dsnqy.png[/img] And now it's fixed! I think those are valid avatars at least.[/QUOTE] Strip the garryis=awesome part?
If you strip that part, it'll load the cloudflare file instead of using the server directly, which could end up being months old. [editline]3rd December 2011[/editline] If you'd use that url I mean.
The only reason I was thinking of keeping it was because your browser makes a request with that specific URL, and I wanted the API to reflect the same request. [editline]3rd December 2011[/editline] [QUOTE=Murkrow;33555540]If you strip that part, it'll load the cloudflare file instead of using the server directly, which could end up being months old. [editline]3rd December 2011[/editline] If you'd use that url I mean.[/QUOTE] Oh that explains that bit. Thanks, I didn't know that.
[QUOTE=amcfaggot;33555364] [img]http://i.imgur.com/Dsnqy.png[/img] And now it's fixed! I think those are valid avatars at least.[/QUOTE] Pailendy, Quark and Azzymaster Have the same avatar?
Fuck. Thank you for pointing that out. It also coincides with this bug: [img]http://i.imgur.com/zLqUZ.png[/img] Or there are secretly a lot of other professional game server drama providers I just don't know about here. [editline]3rd December 2011[/editline] The problem has been found, but I'll need to speak with Gran on how he wants to work around the issue. We're detecting you guys' usergroups by searching for the color of your span element to your displayed username. This isn't ideal, and I personally think it's probably just best to grab what's inside of the anchor in your .username element, then parse that for the usergroup in a second string operation. Some of you aren't Gold Members here, and it's offsetting everyone's reported avatars, because that's the value we find after your usergroup. To get a better feel for how we're pushing all of this HTML information into a member object, I'll show you our Lua pattern for doing so: [lua]"username_container.-href=\"members/.- title=\"(.-) is (.-)line.-#(......).-img src=\"(/avatar/.-)\"" [/lua]
[QUOTE=amcfaggot;33555766]Fuck. Thank you for pointing that out. It also coincides with this bug: [img]http://i.imgur.com/zLqUZ.png[/img] [/QUOTE] [quote]<font size="4">[/quote] [quote]<font>[/quote] HNNNNG
[QUOTE=supersnail11;33555964]HNNNNG[/QUOTE] It's not like he had an alternative in order to acheive that same result. [img]http://img803.imageshack.us/img803/7228/screenshot2011120316534.png[/img] .. well might as well post this; randomly generated perlin noise terrain in unity: ([url=http://pixellegacy.com/terrain/]test it out here[/url]) [img]http://img51.imageshack.us/img51/1693/screenshot2011120316573.png[/img]
[QUOTE=amcfaggot;33555766] To get a better feel for how we're pushing all of this HTML information into a member object, I'll show you our Lua pattern for doing so: [lua]"username_container.-href=\"members/.- title=\"(.-) is (.-)line.-#(......).-img src=\"(/avatar/.-)\"" [/lua][/QUOTE] You're using Regex to parse HTML?
[QUOTE=foszor;33557065]You're using Regex to parse HTML?[/QUOTE] Oh dear god please nobody post the stackoverflow thing. It's so old :(
I hope it's okay to update you with these small fixes, but I got titles integrated as well as usergroups parsed better, and avatars fixed. [IMG]http://i.imgur.com/x1nKh.png[/IMG] My cursor likes to get in the screenshots to feel important. [editline]3rd December 2011[/editline] [QUOTE=foszor;33557065]You're using Regex to parse HTML?[/QUOTE] No, I'm using Lua patterns to parse HTML. :v: [editline]3rd December 2011[/editline] Specifically, this is the new pattern: [lua]threadPageMemberPattern = "username_container.-href=\"members/.- title=\"(.-) is (.-)line.-\">(.-)</a>.-\"usertitle\">(.-)</span>.-img src=\"(/avatar/.-)\"" [/lua]
[QUOTE=amcfaggot;33557095]I hope it's okay to update you with these small fixes, but I got titles integrated as well as usergroups parsed better, and avatars fixed. [IMG]http://i.imgur.com/x1nKh.png[/IMG] [editline]3rd December 2011[/editline] No I'm using Lua patterns to parse HTML. :v: [editline]3rd December 2011[/editline] Specifically, this is the new pattern: [lua]threadPageMemberPattern = "username_container.-href=\"members/.- title=\"(.-) is (.-)line.-\">(.-)</a>.-\"usertitle\">(.-)</span>.-img src=\"(/avatar/.-)\"" [/lua][/QUOTE] I don't know if you followed Overv's work on the Android FP app, but using patterns to parse HTML is a terrible idea. You should see if Lua has any DOM parsing modules.
[QUOTE=foszor;33557140]I don't know if you followed Overv's work on the Android FP app, but using patterns to parse HTML is a terrible idea. You should see if Lua has any DOM parsing modules.[/QUOTE] It is a terrible idea, and I fully understand the potential bugs and hacks of using patterns/regex to parse HTML, but I actually agree with his stance on not using a DOM parser. While it's the "right" way to go about this, patterns are a quick and easy native way to accomplish some of our goals. [editline]3rd December 2011[/editline] When we have a more structured project, we'll replace patterns with a DOM parser. Sound good?
[QUOTE=amcfaggot;33557172]It is a terrible idea, and I fully understand the potential bugs and hacks of using patterns/regex to parse HTML, but I actually agree with his stance on not using a DOM parser. While it's the "right" way to go about this, patterns are a quick and easy native way to accomplish some of our goals.[/QUOTE] Being an API, there are potentially going to be many other applications that will depend on it. It would be wise to build it strong from the ground up.
[QUOTE=foszor;33557231]Being an API, there are potentially going to be many other applications that will depend on it. It would be wise to build it strong from the ground up.[/QUOTE] You have a good, solid point. In this case, since we'll be moving over to a public repo soon, I'll make it a high priority to rip out the pattern stuff. I'll yell at Gran and see if we can find a reliable DOM parser then.
But truth be told, I was using Regex to parse HTML for a Chrome extension I wrote. Once I converted it to DOM it was actually easier than Regex and less code. [editline]3rd December 2011[/editline] automerge :argh:
[QUOTE=foszor;33557277]But truth be told, I was using Regex to parse HTML for a Chrome extension I wrote. Once I converted it to DOM it was actually easier than Regex and less code.[/QUOTE] I figured it would be a little more time consuming. I like jQuery's way of going through the DOM with its $("#idname") magic and the such. If there was a Lua DOM parser that could do something to that degree, I'd change in a heartbeat. I'll look up parsers now then.
[QUOTE=HeroicPillow;33556705]It's not like he had an alternative in order to acheive that same result. [img]http://img803.imageshack.us/img803/7228/screenshot2011120316534.png[/img] .. well might as well post this; randomly generated perlin noise terrain in unity: ([url=http://pixellegacy.com/terrain/]test it out here[/url]) [img]http://img51.imageshack.us/img51/1693/screenshot2011120316573.png[/img][/QUOTE] Hey guys I know HTML and this HTML is better than THAT HTML - I can't believe you used that HTML! I would have never known unless I looked at the code - but it MAKES ME SICK TO MY STOMACH TO SEE DEPRECATED TAGS!!!!!
Has anyone ever seen a get/set implementation like this? : [code] int FilePriority(int file_index) void FilePriority(int file_index, int priority) [/code] I thought that was very out of the ordinary
I used lua string patterns to parse data for my Pokemon gamemode, and shit it was horrible. This is the entire file for getting each Pokemon's base info: [lua]local ID = glon.decode(file.Read("pokemon/ids.txt")) --table of pokemon, just {[name] = id} local Info = {Overview = {}, Stats = {}, Evolution = {}} local SkipKeys = {"oldbug", "family", "sprite1", "type1-1", "type2-1", "sprite2", "type1-2", "type2-2", "sprite3", "type1-3", "type2-3"} local Number = 1 local NextQuery = true local function GetData(Args, Contents) local Name = table.KeyFromValue(ID, Args[1]) local CurInfo, CurStats, CurEffect, CurEvolution = {}, {}, {}, {} local Code = string.match(Contents, "<textarea id=\"wpTextbox1\" [^>]+>.-</textarea>") local Infobox = string.match(Code, "{{PokémonInfobox|.-}}") for Line in string.gmatch(Infobox, ".-\n") do Line = string.gsub(Line, "\n", "") local Key, Value = string.match(Line, "([%w-]+)%s-=%s-([%w,'\"%.]+)") if not(Key and Value) then continue end if(table.HasValue(SkipKeys, Key)) then continue end CurInfo[Key] = Value end local BaseStats = string.match(Code, "====%s?Base stats%s?====.-}}") for Line in string.gmatch(BaseStats, ".-\n") do Line = string.gsub(Line, "\n", "") local Key, Value = string.match(Line, "([%w-]+)%s-=%s-([%w,'\"%.]+)") if not(Key and Value) then continue end if(table.HasValue(SkipKeys, Key)) then continue end if(string.match(Key, "^type.?$")) then continue end CurStats[Key] = Value end local Effectiveness = string.match(Code, "===Type effectiveness===.-}}") for Line in string.gmatch(Effectiveness, ".-\n") do Line = string.gsub(Line, "\n", "") local Key, Value = string.match(Line, "([%w-]+)%s-=%s-(%d+)") if not(Key and Value) then continue end if(table.HasValue(SkipKeys, Key)) then continue end CurEffect[Key] = Value end local Rarity = string.match(Code, "===Game locations===.-==") for Line in string.gmatch(Rarity, ".-\n") do Line = string.gsub(Line, "\n", "") local Key, Value = string.match(Line, "([%w-]+)%s-=%s-([%w%s{%[|%]},é]+)") if not(Key and Value) then continue end if not(Key == "frlgraritya" or Key == "frlgarea") then continue end if(Value[#Value] == "|") then Value = Value:sub(1, -2):Trim() end --CurInfo[Key] = Value print(Value:match("%[%[.-%]%]")) end local Evolve = string.match(Code, "===Evolution===.-}}") local CurStage for shit in string.gmatch(Evolve, "name%d%s-=%s-%w+") do local Stage, name = string.match(shit, "name(%d)%s-=%s-(%w+)") if(name:lower() == Name) then CurStage = tonumber(Stage) end end if(CurStage) then for Line in string.gmatch(Evolve, ".-\n") do Line = string.gsub(Line, "\n", "") local Key, Value = string.match(Line, "([%w-]+)%s-=%s-([%w%s'%.]+)") if not(Key and Value) then continue end if(table.HasValue(SkipKeys, Key)) then continue end local Stage = tonumber(string.match(Key, "%a+(%d)")) if(Stage) then if(Stage == (CurStage + 1)) then if(string.gsub(Key, "%d", "") == "name") then CurEvolution[string.gsub(Key, "%d", "")] = Value end elseif(Stage == CurStage) then if not(string.gsub(Key, "%d", "") == "name") then CurEvolution[string.gsub(Key, "%d", "")] = Value end end else print(Name.." has key with no stage\n"..Key.." = "..Value) end end Info.Evolution[Name] = CurEvolution end Info.Overview[Name] = CurInfo Info.Stats[Name] = CurStats NextQuery = true end hook.Add("Think", "PokemonData", function() if not(NextQuery) then return end if(Number > 151) then file.Write("pokemon/info.txt", glon.encode(Info)) return end local Name = string.upper(table.KeyFromValue(ID, Number)[1])..string.sub(table.KeyFromValue(ID, Number), 2) if(Number == 122) then Name = "Mr._Mime" end http.Get("http://bulbapedia.bulbagarden.net/w/index.php?title="..Name.."_(Pok%C3%A9mon)&action=edit", "", GetData, Number) Number = Number + 1 MsgN(Name.."'s turn!") NextQuery = false end)[/lua] It took weeks to finally get it to a workable state. [editline]3rd December 2011[/editline] That looks even worse than I thought now that I look back on it
Speaking of HTML, why don't they do away with <span> and <div> and just make a general <thingy> tag? Everything's basically done in CSS or the style attribute anyway, so making such a distinction seems arbitrary. Also, I've always wanted to hide [code] span { display: block; } div { display: inline; } [/code] in a stylesheet somewhere and write everything backwards. Imagine the hapless web dev/userscript author's reaction when they stumble upon that.
[QUOTE=garry;33557412]Hey guys I know HTML and this HTML is better than THAT HTML - I can't believe you used that HTML! I would have never known unless I looked at the code - but it MAKES ME SICK TO MY STOMACH TO SEE DEPRECATED TAGS!!!!![/QUOTE] Why'd you quote me? Supersnail was the one that scoffed at someone using a deprecated tag, I just told him why it was used.
Ever have that time where you want to work on a project but then realize you have like 5 other ones you're already working on?
[QUOTE=supersnail11;33558252]Ever have that time where you want to work on a project but then realize you have like 5 other ones you're already working on?[/QUOTE] This is why I try not to start anything anymore unless I can dedicate a few weeks of time into it. Otherwise I create projects on a whim.
I'm working on installing IntelliJ on my Linux partition. Wheeee
Actually getting some work on Mari0 done.. Restructured my whole tilelist thing so it now properly distinguishes between SMB and Portal tiles and also properly added custom tiles. [t]http://i.imgur.com/4cvaa.png[/t] Gonna have to redo entities tomorrow. (Or whatever the proper name for enemies, doors and stuff like that is)
Can anyone link me to that script for Chrome that stops gifs/videos from automatically playing? And you have to click play for them play
[QUOTE=RiceWarrior;33558439]Can anyone link me to that script for Chrome that stops gifs/videos from automatically playing?[/QUOTE] [url]http://dl.dropbox.com/u/4093439/garryfixer.user.js[/url]
Sorry, you need to Log In to post a reply to this thread.