Don't click here unless you want to be banned.
LSL Wiki :
GabrielSpinnaker
HomePage
::
PageIndex
::
RecentChanges
::
RecentlyCommented
::
UserSettings
:: You are crawling021.us.archive.org
Is the man half-machine or is the machine half-man? Stuff I've done: ""<ul><li>""[[http://geekmafia.net/~gabespin/phatbits/ In-world color sprite editor]], inspired by ChromalBrodsky ""<li>""[[http://geekmafia.net/~gabespin/simstats/ Sim performance stats]] (developed independently of ChromalBrodsky; now dormant) ""<li>""Example Ruby code for the [[XMLRPCImplementations]] page ""<li>""Wrote some functions: ##[[integer]] gsDayOfWeek([[integer]] year, [[integer]] month, [[integer]] day)##: Returns day of week for given ##year##/##month##/##day##. 0 = Sunday, 1 = Monday, 2 = Tuesday, etc. From a [[http://www.tondering.dk/claus/cal/node3.html#SECTION00360000000000000000 formula]] from Claus T?ndering's [[http://www.tondering.dk/claus/calendar.html Calendar FAQ]]. %%(lsl) integer gsDayOfWeek(integer year, integer month, integer day) { integer a = (14-month)/12; integer y = year - a; integer m = month + (12 * a) - 2; return (day + y + (y/4) - (y/100) + (y/400) + ((31*m)/12)) % 7; } %% ##[[string]] gsNormalizeString([[string]] str)##: 'Normalizes' ##str## (i.e., lowercases it and removes characters that may be illegal for whatever reason). Obviously, you can change the ##badchars## to match whatever characters might be 'bad' for your particular application. %%(lsl) string gsNormalizeString(string str) { string badchars = "!@#$%^&*()[]{}<>,;':/\\\" =|?"; // " // The LSL editor's syntax highlighting was fixed, but the wiki's was not! string replace = "_"; integer x; integer y; str = llToLower(str); for (x = 0; x < llStringLength(badchars); x++) { do { y = llSubStringIndex(str,llGetSubString(badchars,x,x)); if (y != -1) { str = llDeleteSubString(str,y,y); str = llInsertString(str,y,replace); } } while (y != -1); } return str; } %% ##[[string]] gsSubstituteString([[string]] source, [[string]] pattern, [[string]] replacement)##: Replaces all occurrences of ##pattern## in ##source## with ##replacement##. %%(lsl) string gsSubstituteString(string source, string pattern, string replacement) { string str = source; integer pos; integer end; do { pos = llSubStringIndex(str,pattern); if (pos != -1) { end = (llSubStringIndex(str,pattern) + llStringLength(pattern)) - 1; str = llDeleteSubString(str,pos,end); str = llInsertString(str,pos,replacement); } } while (pos != -1); return str; } %% ""</ul>""
Valid XHTML 1.0 Transitional
::
Valid CSS
:: Powered by
WakkaWiki 0.1.2