Difference between revisions of "User:Strife Onizuka"

From Second Life Wiki
Jump to navigation Jump to search
m (→‎Tenebrous: Replaced <source> with <syntaxhighlight>)
 
(70 intermediate revisions by 9 users not shown)
Line 1: Line 1:
== Status ==
<div style="float:right;"><videoflash>hTIsIjZCvHk</videoflash></div>
<div style="float:right; clear:right; border:1px solid #AAAAAA; margin-top:8px; background-color:white;"><div style="margin: 0 8px;">
'''Subpages'''
* Personal
** {{Sub|Miscellaneous}}
* Code
** {{Sub|int2hex}}
** {{Sub|int2hexdword}}
** {{Sub|hexchars}}
** {{Sub|Float Functions}}
** {{Sub|String Tree}}
** [[GetRootLocalPos]]
* Articles
** {{Sub|The State of State}}
</div></div>
{{RightToc|clear:right;}}
{| class="sortable" {{prettytable|style=float:right; clear:right; margin:0;}}
|- {{Hl2}}
! | Updates:
! class="unsortable" | Preview
{{/Grid|DMZ}}
{{/Grid|Agni}}
{{/Grid|Colo|strike=*}}
{{/Grid|Siva}}
{{/Grid|Durga}}
{{/Grid|Aditi}}
{{/Grid|Soma}}
{{/Grid|Ganga}}
{{/Grid|Uma}}
{{/Grid|Shakti}}
{{/Grid|Vaak}}
{{/Grid|Mohini}}
{{/Grid|Yami}}
{{/Grid|Nandi}}
{{/Grid|Mitra}}
{{/Grid|Radha}}
{{/Grid|Ravi}}
{{/Grid|Aruna}}
{{/Grid|Damballah}}
{{/Grid|Bharati}}
{{/Grid|Chandra}}
{{/Grid|Danu}}
{{/Grid|Parvati}}
{{/Grid|Skanda}}
|}


Taking a couple days off from typing. RSI acting up. [[User:Strife Onizuka|Strife Onizuka]] 17:20, 13 March 2007 (PDT)
== About Strife ==


==About Me ==
=== Synopses ===
<div style="float:right;">__TOC__</div>
 
I'm an immigrant from URU. Was in all 3 of it's beta's.
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}}.
 
=== SL Status ===


Wiki Gnome (causing drama isn't why I'm here).
Strife is unemployed. Leave me a note on my talk page.


I have a webpage but haven't updated it in a few months...
=== Honors ===


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.
Through his public works Strife became a pillar of the SL community.


also contribute to some other wiki's
<!-- please see http://en.wikipedia.org/wiki/Wikipedia:Barnstars for the motivation here -->
[http://history.secondserver.net/index.php/Main_Page History Wiki]
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."
[http://www.AviSynth.org/BlindWanderer AviSynth:BlindWanderer]


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).
=== Own Words ===


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


{|style="padding:2px;" border="1" cellspacing="0" valign="top"
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.
|-{{Hl2}}
!Updates:
!Preview Download
|-
|[[http://secondlife.com/update.php?userserver=userserver.dmz.lindenlab.com  DMZ]]
|[[http://secondlife.com/preview/download-preview.php?os=windows&grid=DMZ  Preview]]
|-
|[[http://secondlife.com/update.php?userserver=userserver.agni.lindenlab.com  Agni]]
|[[http://secondlife.com/preview/download-preview.php?os=windows&grid=AGNI  Preview]]
|-
|<s>[[http://secondlife.com/update.php?userserver=userserver.colo.lindenlab.com  Colo]]</s>
|<s>[[http://secondlife.com/preview/download-preview.php?os=windows&grid=COLO  Preview]]</s>
|-
|[[http://secondlife.com/update.php?userserver=userserver.siva.lindenlab.com  Siva]]
|[[http://secondlife.com/preview/download-preview.php?os=windows&grid=SIVA  Preview]]
|-
|[[http://secondlife.com/update.php?userserver=userserver.durga.lindenlab.com  Durga]]
|[[http://secondlife.com/preview/download-preview.php?os=windows&grid=DURGA  Preview]]
|-
|[[http://secondlife.com/update.php?userserver=userserver.aditi.lindenlab.com  Aditi]]
|[[http://secondlife.com/preview/download-preview.php?os=windows&grid=ADITI  Preview]]
|-
|[[http://secondlife.com/update.php?userserver=userserver.soma.lindenlab.com  Soma]]
|[[http://secondlife.com/preview/download-preview.php?os=windows&grid=SOMA  Preview]]
|-
|[[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==
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>...
See [[TightList]]


==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
    if(a){//is it non zero?
        integer b = (a < 0) << 31;//the sign, but later this variable is reused to store the shift
        if((a = llFabs(a)) < 2.3509887016445750159374730744445e-38)//Denormalized range check & last stirde of normalized range
            return b | (integer)(a / 1.4012984643248170709237295832899e-45);//this works because the math overlaps; saves cpu time.
        integer c = llFloor(llLog(a) / 0.69314718055994530941723212145818);//extremes will error towards extreme. following yuch corrects it.
        return (0x7FFFFF & (integer)(a * (0x1000000 >> b))) | (((c + 126 + (b = ((integer)a - (3 <= (a /= (float)("0x1p"+(string)(c -= (c == 128)))))))) << 23 ) | b);
    }//for grins, detect the sign on zero. it's not pretty but it works. the previous requires alot of unwinding to understand it.
    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]
    return ((float)("0x1p"+(string)((a | !a) - 150))) * ((!!(a = (0xff & (a >> 23))) << 23) | ((a & 0x7fffff))) * (1 | (a >> 31));
*[http://www.AviSynth.org/BlindWanderer AviSynth:BlindWanderer]
}//will crash if the raw exponent == 0xff; reason for crash deviates from float standard; though a crash is warented.
*[http://en.wikipedia.org/wiki/User:BlindWanderer Wikipedia:BlindWanderer]
</pre>


As a specialized mode of transport, this is faster the [[Float2Hex]] and just as lossless.
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).
<pre>
string fuis(float a){//float union to base64ed integer
    if(a){//is it non zero?
        integer b = (a < 0) << 31;//the sign, but later this variable is reused to store the shift
        if((a = llFabs(a)) < 2.3509887016445750159374730744445e-38)//Denormalized range check & last stirde of normalized range
            b = b | (integer)(a / 1.4012984643248170709237295832899e-45);//the math overlaps; saves cpu time.
        else
        {
            integer c = llFloor(llLog(a) / 0.69314718055994530941723212145818);//extremes will error towards extremes. following yuch corrects it.
            b = (0x7FFFFF & (integer)(a * (0x1000000 >> b))) | (((c + 126 + (b = ((integer)a - (3 <= (a /= (float)("0x1p"+(string)(c -= (c == 128)))))))) << 23 ) | b);
        }
        return llGetSubString(llIntegerToBase64(b),0,5)
    }//for grins, detect the sign on zero. it's not pretty but it works. the previous requires alot of unwinding to understand it.
    if((string)a == (string)(0.0))
        return "AAAAAA";
    return "gAAAAA";
}


float siuf(string b)
{{Jira Reporter}}
{//base64ed integer union to float
{{skills
    integer a = llBase64ToInteger(b);
|Builder=*
    return ((float)("0x1p"+(string)((a | !a) - 150))) * ((!!(a = (0xff & (a >> 23))) << 23) | ((a & 0x7fffff))) * (1 | (a >> 31));
|Scripter=*
}//will crash if the raw exponent == 0xff; reason for crash deviates from float standard; though a crash is warented.
|}}
</pre>


==Float Compare==
== Scite/ESL ==  
<pre>integer FloatCompare(float a, float b, integer c)
My config files:
{//compare floats and allow for a margin of error, requires fui().
*[https://drive.google.com/folderview?id=0B78L5DGHe6YrV2FFWlE2VTJ4S28&usp=sharing Google Drive]
    if(a - b)//(c) Strife Onizuka 2006
** lsl.api
    {//they are not equal
** lsl.properties
        //First we convert the floats to integer form, as they would be in memory;
** stripper.zip - Whitespace stripper
        integer a_i = fui(a);
** clipboard.zip - copies text to clipboard
        integer b_i = fui(b);
*[https://github.com/Makopo/lslint lslint] (Makopo's fork)
        integer a_e = (a_i >> 23) & 0xff;
**[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])
        integer b_e = (b_i >> 23) & 0xff;
*[http://gnuwin32.sourceforge.net/packages/indent.htm indent - code beautifier] (picks up where the whitespace stripper leaves off)
        if(!(a_e || b_e) || //to disable the +/- roll under support put a // just before the !
*[http://msdn.microsoft.com/vstudio/express/visualc/ MSVC Express]
            ((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 ==
==TightList==
<pre>
See [[TightList]]
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)
==Float Functions==
{//Another way to do Float2Hex, i wrote this for the heck of it; not because it's a good idea.
See [[/Float Functions]]
    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>


{{Jira Reporter}}
==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;
}