Difference between revisions of "User:Strife Onizuka"

From Second Life Wiki
Jump to navigation Jump to search
m (→‎Tenebrous: Replaced <source> with <syntaxhighlight>)
 
(80 intermediate revisions by 9 users not shown)
Line 1: Line 1:
==About Me ==
<div style="float:right;"><videoflash>hTIsIjZCvHk</videoflash></div>
<div style="float:right;">__TOC__</div>
<div style="float:right; clear:right; border:1px solid #AAAAAA; margin-top:8px; background-color:white;"><div style="margin: 0 8px;">
I'm an immigrant from URU. Was in all 3 of it's beta's.
'''Subpages'''
 
* Personal
Wiki Gnome (causing drama isn't why I'm here).
** {{Sub|Miscellaneous}}
 
* Code
I have a webpage but haven't updated it in a few months...
** {{Sub|int2hex}}
 
** {{Sub|int2hexdword}}
Wiki's are the way of the future when it comes to making documentation Ad-hoc but eventually become static as graffiti grows with popularity as a way of controlling it.
** {{Sub|hexchars}}
 
** {{Sub|Float Functions}}
also contribute to some other wiki's
** {{Sub|String Tree}}
[http://history.secondserver.net/index.php/Main_Page History Wiki]
** [[GetRootLocalPos]]
[http://www.AviSynth.org/BlindWanderer AviSynth:BlindWanderer]
* Articles
 
** {{Sub|The State of State}}
When it comes to writing I tend to go towards concise. A short accurate description is better then a long equally accurate description; less to get confused with, easier to find the important information (because it is ''all'' important).
</div></div>
 
{{RightToc|clear:right;}}
==Downloads==
{| class="sortable" {{prettytable|style=float:right; clear:right; margin:0;}}
 
|- {{Hl2}}
{|style="padding:2px;" border="1" cellspacing="0" valign="top"
! | Updates:
|-{{Hl2}}
! class="unsortable" | Preview
!Updates:
{{/Grid|DMZ}}
!Preview Download
{{/Grid|Agni}}
|-
{{/Grid|Colo|strike=*}}
|[[http://secondlife.com/update.php?userserver=userserver.dmz.lindenlab.com  DMZ]]
{{/Grid|Siva}}
|[[http://secondlife.com/preview/download-preview.php?os=windows&grid=DMZ  Preview]]
{{/Grid|Durga}}
|-
{{/Grid|Aditi}}
|[[http://secondlife.com/update.php?userserver=userserver.agni.lindenlab.com  Agni]]
{{/Grid|Soma}}
|[[http://secondlife.com/preview/download-preview.php?os=windows&grid=AGNI  Preview]]
{{/Grid|Ganga}}
|-
{{/Grid|Uma}}
|<s>[[http://secondlife.com/update.php?userserver=userserver.colo.lindenlab.com  Colo]]</s>
{{/Grid|Shakti}}
|<s>[[http://secondlife.com/preview/download-preview.php?os=windows&grid=COLO  Preview]]</s>
{{/Grid|Vaak}}
|-
{{/Grid|Mohini}}
|[[http://secondlife.com/update.php?userserver=userserver.siva.lindenlab.com  Siva]]
{{/Grid|Yami}}
|[[http://secondlife.com/preview/download-preview.php?os=windows&grid=SIVA  Preview]]
{{/Grid|Nandi}}
|-
{{/Grid|Mitra}}
|[[http://secondlife.com/update.php?userserver=userserver.durga.lindenlab.com  Durga]]
{{/Grid|Radha}}
|[[http://secondlife.com/preview/download-preview.php?os=windows&grid=DURGA  Preview]]
{{/Grid|Ravi}}
|-
{{/Grid|Aruna}}
|[[http://secondlife.com/update.php?userserver=userserver.aditi.lindenlab.com  Aditi]]
{{/Grid|Damballah}}
|[[http://secondlife.com/preview/download-preview.php?os=windows&grid=ADITI  Preview]]
{{/Grid|Bharati}}
|-
{{/Grid|Chandra}}
|[[http://secondlife.com/update.php?userserver=userserver.soma.lindenlab.com  Soma]]
{{/Grid|Danu}}
|[[http://secondlife.com/preview/download-preview.php?os=windows&grid=SOMA  Preview]]
{{/Grid|Parvati}}
|-
{{/Grid|Skanda}}
|[[http://secondlife.com/update.php?userserver=userserver.ganga.lindenlab.com  Ganga]]
|[[http://secondlife.com/preview/download-preview.php?os=windows&grid=GANGA  Preview]]
|-
|[[http://secondlife.com/update.php?userserver=userserver.uma.lindenlab.com  Uma]]
|[[http://secondlife.com/preview/download-preview.php?os=windows&grid=UMA Preview]]
|}
|}


==TightList==
== About Strife ==
<pre>
//Tightlist family of functions Version 1.0
//Copyright Strife Onizuka 2004-2006
//Free to use and distribute as long as this message is not removed.


list TightListParse(string input)
=== Synopses ===
{
    string seperator = llGetSubString(input,(0),(0));//save memory
    return llParseStringKeepNulls(llDeleteSubString(input,(0),(0)), [input=seperator],[]);
}


string TightListDump(list input, string possibles)
Strife joined 3/3/2004, and is an avid scripter, wiki author and SL forum denizen. Not content in selfish information gathering, he shares what he knows through various mediums, so that others may benefit and learn. He volunteers his time to work on many public projects which include: giving scripting advice, writing LSL documentation, providing and improving LSL scripts and libraries. Secondlife has been on Strife's brain for that last {{AgeUnit|03|03|2004}}.
{//TLD( complex) makes a string from a list using a seperator that is supposed to be unique to the string
    string buffer = (string)(input);//dump the list without a seperator
    integer counter = -39 - llStringLength(possibles);
    if(counter == -40)
        if(!~llSubStringIndex(buffer,possibles))
            jump end;//woot, we were given a unique seperator
    possibles += "|/?!@#$%^&*()_=:;~`'<>{}[],.\n\" qQxXzZ\\";//Good character set of rarely used letters.
    do; while(~llSubStringIndex(buffer,llGetSubString(possibles,counter,counter)) && (counter=-~counter));//search for unique seperator


    possibles = llGetSubString(possibles,counter,counter);
=== SL Status ===


    @end;
Strife is unemployed. Leave me a note on my talk page.
    buffer = "";//save memory
    return possibles + llDumpList2String((input = []) + input, possibles);
}


integer TightListTypeLength(string input)
=== Honors ===
{
    string seperators = llGetSubString(input,(0),6);
    return ((llParseStringKeepNulls(llDeleteSubString(input,(0),5), [],[input=llGetSubString(seperators,(0),(0)),
          llGetSubString(seperators,1,1),llGetSubString(seperators,2,2),llGetSubString(c,3,3),
          llGetSubString(seperators,4,4),llGetSubString(seperators,5,5)]) != []) + (llSubStringIndex(seperators,llGetSubString(seperators,6,6)) < 6)) >> 1;
}


integer TightListTypeEntryType(string input, integer index)
Through his public works Strife became a pillar of the SL community.
{
    string seperators = llGetSubString(input,(0),6);
    return llSubStringIndex(seperators, input) + ((input = llList2String(llList2List(input + llParseStringKeepNulls(llDeleteSubString(input,(0),5), [],[input=llGetSubString(seperators,(0),(0)), llGetSubString(seperators,1,1),llGetSubString(seperators,2,2),llGetSubString(seperators,3,3), llGetSubString(seperators,4,4),llGetSubString(seperators,5,5)]), (llSubStringIndex(seperators,llGetSubString(seperators,6,6)) < 6) << 1, -1),  index << 1)) != "");
}


list TightListTypeParse(string input) {
<!-- please see http://en.wikipedia.org/wiki/Wikipedia:Barnstars for the motivation here -->
    list partial;
Strife is a Hippo award winner, [http://blog.secondlife.com/2007/08/25/innovation-award-winners-announced/ awarded "Best Community Organizer" in the 2007 Linden Lab Innovation Awards], and here is [[Linden Lab Innovation Awards|his mention as a runner-up in the 2008 "Best Documentation" category:]] "Last year's winner, Strife Onizuka, continued to be insanely prolific, with thousands of edits over the past year.... Anyone learning LSL is almost certainly indebted to Strife's work in some way."
    if(llStringLength(input) > 6)
    {
        string seperators = llGetSubString(input,(0),6);
        integer pos = ([] != (partial = llList2List(input + llParseStringKeepNulls(llDeleteSubString(input,(0),5), [],[input=llGetSubString(seperators,(0),(0)), llGetSubString(seperators,1,1),llGetSubString(seperators,2,2),llGetSubString(seperators,3,3), llGetSubString(seperators,4,4),llGetSubString(seperators,5,5)]), (llSubStringIndex(seperators,llGetSubString(seperators,6,6)) < 6) << 1, -1)));
        integer type = (0);
        integer sub_pos = (0);
        do
        {
            list current = (list)(input = llList2String(partial, sub_pos= -~pos));//TYPE_STRING || TYPE_INVALID (though we don't care about invalid)
            if(!(type = llSubStringIndex(seperators, llList2String(partial,pos))))//TYPE_INTEGER
                current = (list)((integer)input);
            else if(type == 1)//TYPE_FLOAT
                current = (list)((float)input);
            else if(type == 3)//TYPE_KEY
                current = (list)((key)input);
            else if(type == 4)//TYPE_VECTOR
                current = (list)((vector)input);
            else if(type == 5)//TYPE_ROTATION
                current = (list)((rotation)input);
            partial = llListReplaceList(partial, current, pos, sub_pos);
        }while((pos= -~sub_pos) & 0x80000000);
    }
    return partial;
}


string TightListTypeDump(list input, string seperators) {//This function is dangerous
=== Own Words ===
    seperators += "|/?!@#$%^&*()_=:;~`'<>{}[],.\n\" qQxXzZ\\";
    string cumulator = (string)(input);
    integer counter = (0);
    do
        if(~llSubStringIndex(cumulator,llGetSubString(seperators,counter,counter)))
            seperators = llDeleteSubString(seperators,counter,counter);
        else
            counter = -~counter;
    while(counter<6);
    seperators = llGetSubString(seperators,(0),5);


        cumulator =  "";
I'm an immigrant from URU. Was in all 3 of it's beta's.


    if((counter = (input != [])))
Wiki Gnome (causing drama isn't why I'm here) for about {{#expr:(({{ #time: U | {{LOCALDAY2}}.{{LOCALMONTH}}.{{LOCALYEAR}} }} - {{ #time: U | 3.3.2004 }}) / 31557600) round 0}} years.
    {
        do
        {
            integer type = ~-llGetListEntryType(input, counter = ~-counter);


            cumulator = (cumulator = llGetSubString(seperators,type,type)) + llList2String(input,counter) + cumulator;
I <del>have</del><ins>had</ins> a webpage but I haven't updated it in <del>a few</del><ins>many</ins> <del>months</del><ins>years</ins>...
        }while(counter);
    }
    return seperators + cumulator;
}
</pre>


==Float {{LSL_VR|-Union-}} Integer==
Wiki's are the way of the future when it comes to making documentation Ad-hoc. With popularity graffiti becomes a worsening problem. The wiki owner is left between a rock and a hard place: cope with graffiti edits or cope with out-of-data information. The popular choice is to restrict editing, which ultimately drives away legitimate editors.
<pre>integer fui(float a)
{//union float to integer
    integer b = (a<0) << 31;
    if(a)
    {
        if((a = llFabs(a)) < 1.1754943508222875079687365372222e-38)
            return b | (integer)(a / 1.4012984643248170709237295832896e-45);
        integer c = llFloor(llLog(a) / 0.69314718055994530941723212145818);
        if(c > 127){c = 127;}
        if((a /= (float)("0x1p"+(string)c)) < 1){a*=2; --c;}
        return ((c + 127) << 23 ) | (integer)((a - 1) * 8388608.0) | b;
    }
    return ((string)a == (string)(-0.0)) << 31;
}


float iuf(integer a)
I also contribute to some other wikis:
{//union integer to float
*[http://history.secondserver.net/index.php/Main_Page History Wiki]
    integer c= (a >> 23) & 0xff;
*[http://www.AviSynth.org/BlindWanderer AviSynth:BlindWanderer]
    float b = (a & 0x7fffff) * 1.1920928955078125e-7;
*[http://en.wikipedia.org/wiki/User:BlindWanderer Wikipedia:BlindWanderer]
    if(c == 0xff)
        b = 1 / 0; //NaN or Infinity (since getting them crashes the script, thats we do).
    else if(c)
        b = (b + 1) * (float)("0x1p"+(string)(c - 127));
    else
        b = b * 1.1754943508222875079687365372222e-38;
    return b * ((a >> 31) | 1);
}


string hexc="0123456789ABCDEF";
When it comes to writing I tend to go towards concise. A short accurate description is better then a long equally accurate description; less to get confused with, easier to find the important information (because it is ''all'' important).


string int6hex(integer x)
{{Jira Reporter}}
{
{{skills
    integer x0 = 0;
|Builder=*
    string res = "";
|Scripter=*
    integer c = 26;
|}}
    do res += llGetSubString(hexc,x0 = (x >> c-=4) & 0xf , x0); while(c > 0);
    return res;
}


float iuf_alt(integer a)
== Scite/ESL ==
{//union integer to float
My config files:
    integer c = (a >> 23) & 0xff;
*[https://drive.google.com/folderview?id=0B78L5DGHe6YrV2FFWlE2VTJ4S28&usp=sharing Google Drive]
    float b;
** lsl.api
    if(c == 0xff)
** lsl.properties
        b = 1 / 0; //NaN or Infinity (since getting them crashes the script, thats we do).
** stripper.zip - Whitespace stripper
    else if(c)
** clipboard.zip - copies text to clipboard
        b = (float)("0x1."+int6hex(a << 1)+"p"+(string)(c - 127));
*[https://github.com/Makopo/lslint lslint] (Makopo's fork)
    else
**[http://kwdb.googlecode.com/hg/outputs/builtins.txt builtins.txt] - Up to date keyword file for lslint (generated by [http://code.google.com/p/kwdb/ kwdb])
        b = (a & 0x7fffff) * 1.4012984643248170709237295832896e-45;
*[http://gnuwin32.sourceforge.net/packages/indent.htm indent - code beautifier] (picks up where the whitespace stripper leaves off)
    return b * ((a >> 31) | 1);
*[http://msdn.microsoft.com/vstudio/express/visualc/ MSVC Express]
}</pre>


==Float Compare==
==TightList==
<pre>integer FloatCompare(float a, float b, integer c)
See [[TightList]]
{//compare floats and allow for a margin of error, requires fui().
    if(a - b)//(c) Strife Onizuka 2006
    {//they are not equal
        //First we convert the floats to integer form, as they would be in memory;
        integer a_i = fui(a);
        integer b_i = fui(b);
        integer a_e = (a_i >> 23) & 0xff;
        integer b_e = (b_i >> 23) & 0xff;
        if(!(a_e || b_e) || //to disable the +/- roll under support put a // just before the !
            ((a_i & 0x80000000) == (b_i & 0x80000000)))//sign match check
        {//start by getting and testing the difference, this is what limits c
            integer diff = a_e - b_e;//ugly is fast, basicly, it gets the mantissa, sets the sign on the mantisa,
            if(diff >= -1 || diff <= 1)//shifts it depending on exponent, finaly executes the test.
                if(llAbs(((((a_i & 0x7FFFFF) | (!!a_e << 23)) * ((a_i >> 31) | 1)) >> !~-diff) -
                        ((((b_i & 0x7FFFFF) | (!!b_e << 23)) * ((b_i >> 31) | 1)) >> !~diff)) <= c)
                    jump out;
        }
        return (a > b) - (a < b);
    }
    @out;
    return 0;
}</pre>


==FUI2HexFloat ==
==Float Functions==
<pre>
See [[/Float Functions]]
string FUI2HexFloat(integer b)
{//Dump FUI float-integer to a hex-float string
    string c = "";
    integer d = 0;
    integer e = 0xff & (b >> 23);
    string f = "0x"+(string)(!!e) + ".";
    if(b & 0x80000000)
        f = "-"+ f;
    if(e ^ 127) c = "p" + (string)((e | !e) - 127);
    if((e = 0xfffffe & (b << 1)))
    {
        while(!((e >> d) & 0xf))
            d+=4;
        while(d < 24)
        {
            c = llGetSubString(hexc, b = 0xf & (e >> d), b) + c;
            d += 4;
        }
    }
    return f + c;
}
 
string Float2Hex(float a)
{//Another way to do Float2Hex, i wrote this for the heck of it; not because it's a good idea.
    return FUI2HexFloat(fui(a));
}
</pre>


==BitCount==
==BitCount==
<pre>integer bitcount(integer n)
<syntaxhighlight lang="lsl2">integer bitcount(integer n)
{//MIT Hackmem 169, modified to work in LSL
{//MIT Hackmem 169, modified to work in LSL
     integer tmp = n - ((n >> 1) & 0x5B6DB6DB)//modified mask
     integer tmp = n - ((n >> 1) & 0x5B6DB6DB)//modified mask
                     - ((n >> 2) & 0x49249249);
                     - ((n >> 2) & 0x49249249);
     return (((tmp + (tmp >> 3)) & 0xC71C71C7) % 63) + (n < 0);
     return (((tmp + (tmp >> 3)) & 0xC71C71C7) % 63) - (n >> 31);
}</pre>
}</syntaxhighlight>
 
==Tenebrous==
<syntaxhighlight lang="lsl2">string ignore = "c228d1cf-4b5d-4ba8-84f4-899a0796aa97";
list Tenebrous(){
    integer link = llGetNumberOfPrims();
    list out;
    string s;
    for(link -= (link == 1); !llGetLinkNumberOfSides(link);)
    {
        list t = llGetLinkPrimitiveParams(link, [PRIM_TEXTURE, ALL_SIDES]);
        integer i = t != [];
        while((i -= 4) >= 0)
            if(ignore != (s = llList2String(t, i)))
                out = [i >> 2, s] + out;
        out = llGetLinkKey(link--) + out;
    }
    return out;
}</syntaxhighlight>
 
{{visl
|name=Strife Onizuka
|Greeters=
|Helpers=
|Instructors=
|Mentors=
|LSL=*
|i18n=
|l10n=
|SL4B=
|}}
[[Category:SL Certification Participant|{{PAGENAME}}]]
[[Category:User pages in need of haiku|{{PAGENAME}}]]

Latest revision as of 16:26, 3 February 2023

<videoflash>hTIsIjZCvHk</videoflash>
Updates: Preview
DMZ Preview
Agni Preview
Colo Preview
Siva Preview
Durga Preview
Aditi Preview
Soma Preview
Ganga Preview
Uma Preview
Shakti Preview
Vaak Preview
Mohini Preview
Yami Preview
Nandi Preview
Mitra Preview
Radha Preview
Ravi Preview
Aruna Preview
Damballah Preview
Bharati Preview
Chandra Preview
Danu Preview
Parvati Preview
Skanda Preview

About Strife

Synopses

Strife joined 3/3/2004, and is an avid scripter, wiki author and SL forum denizen. Not content in selfish information gathering, he shares what he knows through various mediums, so that others may benefit and learn. He volunteers his time to work on many public projects which include: giving scripting advice, writing LSL documentation, providing and improving LSL scripts and libraries. Secondlife has been on Strife's brain for that last 2 decades.

SL Status

Strife is unemployed. Leave me a note on my talk page.

Honors

Through his public works Strife became a pillar of the SL community.

Strife is a Hippo award winner, awarded "Best Community Organizer" in the 2007 Linden Lab Innovation Awards, and here is his mention as a runner-up in the 2008 "Best Documentation" category: "Last year's winner, Strife Onizuka, continued to be insanely prolific, with thousands of edits over the past year.... Anyone learning LSL is almost certainly indebted to Strife's work in some way."

Own Words

I'm an immigrant from URU. Was in all 3 of it's beta's.

Wiki Gnome (causing drama isn't why I'm here) for about 20 years.

I havehad a webpage but I haven't updated it in a fewmany monthsyears...

Wiki's are the way of the future when it comes to making documentation Ad-hoc. With popularity graffiti becomes a worsening problem. The wiki owner is left between a rock and a hard place: cope with graffiti edits or cope with out-of-data information. The popular choice is to restrict editing, which ultimately drives away legitimate editors.

I also contribute to some other wikis:

When it comes to writing I tend to go towards concise. A short accurate description is better then a long equally accurate description; less to get confused with, easier to find the important information (because it is all important).

View the issues Strife Onizuka has filed at jira.secondlife.com

Scite/ESL

My config files:

TightList

See TightList

Float Functions

See /Float Functions

BitCount

integer bitcount(integer n)
{//MIT Hackmem 169, modified to work in LSL
    integer tmp = n - ((n >> 1) & 0x5B6DB6DB)//modified mask
                    - ((n >> 2) & 0x49249249);
    return (((tmp + (tmp >> 3)) & 0xC71C71C7) % 63) - (n >> 31);
}

Tenebrous

string ignore = "c228d1cf-4b5d-4ba8-84f4-899a0796aa97";
 
list Tenebrous(){
    integer link = llGetNumberOfPrims();
    list out;
    string s;
    for(link -= (link == 1); !llGetLinkNumberOfSides(link);)
    {
        list t = llGetLinkPrimitiveParams(link, [PRIM_TEXTURE, ALL_SIDES]);
        integer i = t != [];
        while((i -= 4) >= 0)
            if(ignore != (s = llList2String(t, i)))
                out = [i >> 2, s] + out;
        out = llGetLinkKey(link--) + out;
    }
    return out;
}