Difference between revisions of "User talk:Void Singer"

From Second Life Wiki
Jump to navigation Jump to search
m (fixed blurb wrapping)
m (→‎Dead Links: bad ref deleted, comments updated)
 
(79 intermediate revisions by 11 users not shown)
Line 1: Line 1:
<div style="float:right;">__TOC__</div>
== Comments: ==
{{message}} Comment Format
<pre>=== Topic === <-- this line is optional
{{message}} this is my comment
~~~~ <-- will be replaced by User Name + Time Stamp automatically</pre>
 
{{message}} welcome all to my User Talk page. Feel Free to leave a message below, and thanks for stopping by! --[[User:Void Singer|Void Singer]] 05:54, 20 November 2007 (PST)
 
=== Advanced Visitor Greeter ===
{{message}} Void.  Not had a detailed look, but it would appear that the call to llRegionSayTo has too many parameters ... looks like the edit from oct has broken it ...?
[[User:Kimm Paulino|Kimm Paulino]] 13:52, 15 February 2012 (PST)
 
:Good catch, thank you, I've corrected it. was a bad update from the previous function.<br/>-- '''[[User:Void_Singer|Void]]''' <sup><small>([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])</small></sup> 05:33, 16 February 2012 (PST)
 
=== LandMark Teleport Script ===
{{message}} Hello Void! Just wanted to know where I'd put the landmarks and positions in the script and in what format. When you state min. 3 linked prims, what does this mean? Sorry, new to all this. I've noticed most teleporters are of "Sit" type and I need to teleport to a location about 2700m from ground level. Any feedback is appreciated. Thank you
[[User:HDBadBoy Afterthought|HDBadBoy Afterthought]] 11:59, 6 September 2011 (PDT)
 
:{{message}} the Landmark Teleport script uses the map window to send teleport locations, it work much like the favorite locations bar on V2+ (except for others if you set it out).... no special format is needed for the landmarks, but if you rename them then the hover text it generates for them will use the new name. as for the 3 prims, in the instructions you'll note that the script itself goes in the root, and you need two more with the name "next" and "prev" which will be buttons for the script to change landmarks.... although it's important to mention that this is NOT the ideal script for teleport locations on the same region. for that I suggest a [[PosJump]] type of script, which gives you the type of immediate "sit" style action most users expect for local teleports.<br/>-- '''[[User:Void_Singer|Void]]''' <sup><small>([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])</small></sup> 04:45, 7 September 2011 (PDT)
<br>
 
=== Re: Formatting [topic added by Void due to page reordering] ===
{{message}}It looks well thought out. I'm pretty laid back about style as long as it's consistent. The only thing I put my foot down on is tabs being 4 spaces. All a matter of preference thou. I find prefixing variables with anything other then a letter to indicate type is overkill. I write my LSL as ESL (which is LSL passed through a C precompiler) and I reserve all uppercase lettered names for ESL macro's and defines. -- [[User:Strife Onizuka|Strife Onizuka]] 03:09, 3 November 2007 (PDT)
<br>
<p>{{message}}Amazing. I've been programming for 25 years and have developed a style that chooses the opposite of most of Void's rules. Why is it that these questions lead to such equally satisfactory results in competent programming organizations that are so different. I suppose that it's similar to the reason that Spanish isn't the same as French.</p>
<p>I'll go Strife one further, though, and put my particular foot down about the insane (to me) verbosity of prefixing variables, function names, etc. with garbage characters that serve no useful purpose I can see, and is constantly bonking the reader who has to read through several largely irrelevant or self-evident characters to get to the important part - what the variable is. It's like getting tapped on the side of the head with a pencil every time I trip over one of the darn things. Is this another sad legacy of Microsoft? I'd never seen such a thing before I had to start writing Windows code. And I'll note, I work in RL in an environment where we have several hundred thousand lines of legacy code I have to refer to regularly, (and a couple of legacy programmers) that use "Hungarian" notation like this, and after 10 years of reading it I STILL get tapped every time I see one.</p>
<p>I do have one possibly pertinent point, though. I had been ambivalent about where the brace at the opening of a block goes for a couple years, having programmed in environments for most of my time where they were to be on a (wasteful) line of their own. After spending some time in Java, where the convention tends to be 'on the same line' I was still uncertain I had an opinion, except that I really don't like the effect that mixing the styles has. (That happens with templates, copy/paste, etc.) However, a few weeks ago when working on some poor code (mine) that was too long and nested too deeply I spent quite a while tracking down a missing opening brace. I realized that had it been on its own line I'd have seen it almost immediately. Given modern monitor resolutions and sizes, I don't think the vertical height saved is worth the obviousness that it exists.</p>
<p>So there, finally the definitive answer to the "same line or different line" question.</p>
<p>Ah, the style wars, long shall they rage.</p>
<p> In the end, as both you and Strife observe, it is all personal preference as modified by the need to be consistent with those you work with. Thanks, much, for taking the time to write it down. I should do it too if I care so much I guess. --[[User:RJ Thibaud|RJ Thibaud]] 12:25, 23 December 2007 (PST)</p>
 
=== RE: style etc ===
{{message}} heh, thanks for reading it at least, I'm not fanatical about it, each person develops their own style, and to be honest I only adapted the style I normally use for lsl, from my other coding projects, so it's prone to updates (a few of which I've yet to add in). The particular style I use is geared towards maximum understanding of the code for those new to scripting/programming so they can more easily find their way through code. But as noted, for an experienced coder it can be a bit like 'duh I know that'. Coming from an enviroment with lots of new coders though, I tend to keep it up for their benefit more than my own. The opening brace debate is long running with me, and I do realize the pro's and cons, but have gotten myself in the habit of expecting open braces on the same line, and visually reading the statement (if, do, etc) and the indent as opening the statement and even briefly played with inlining the closing statement (but found it interfered with the visual nesting effect sometimes).
 
I mostly provided the example style as something to explain, rather than recommend, because I was bored enough to write it one day, and had been asked a few times about it. I have found that prefixing of some kind tends to avoid collisions with developing languages like lsl, as I noticed happened once or twice when people named constants or variables that later became LSL constants, and I've discouraged a few people from using llFunctionName for that and other reasons (like people that see the call and try to use it elsewhere). I'ts all good though, whatever gets the job done and works as expected. [[User:Void Singer|Void Singer]] 13:35, 25 December 2007 (PST)
 
== 0x80000000 X_X ==
 
Yep I forgot about 0x80000000. The limit however accepts 2038 and then overflows. So I wrote a version that detects overflows and accepts the entire integer range. It should be noted that if you get clever on it, and give it a year before 1970 but have the final date fall in or after 1970 it will have a fit. Likewise for years after 1969 but the final dates fall before 1970. Could turn off the overflow detection for centrally located years but that's more work. But it will parse [2100,12,13,23,59, -2147483648] and [1845, 1, 1, 0, 0, 2147483647] properly... i think. =^_^= -- '''[[User:Strife_Onizuka|Strife]]''' <sup><small>([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])</small></sup> 06:28, 20 January 2010 (UTC)
:{{message}} I'll take a look in a bit, and I do like the integer division and bit shift solution in the unix2stamp, much cleaner... in the other, subtracting out 68 less to make the entire range positive... I like that part, shouldve done it from the start (it was converted from a quickie 1970+ version that I think argent did) although I had capped the dates to provide symmetry with the opposite function (since it's much easier to cap that one on a particular day, and 19 days on the edge seemed a small loss, vs detecting up to the last available second)... haven't checked the leap day / month detection in the loop replacement but I'll assume it's good until I double check. ps, I appreciate the fixes (always something to be learned) but can we separate out revisions that are more than corrections or order changes... it makes it harder to compare versions side by side (as the wiki only gives changed lines)... not complaining, I appreciate the feedback... PPS bad cabbit you didn't test to be sure? =)<br/>-- '''[[User:Void_Singer|Void]]''' <sup><small>([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])</small></sup> 23:37, 20 January 2010 (UTC)
 
:: As I was reading the code, I was like "this code is so evil I think it is something I must have done in a past life". I really enjoy niggling away at code like this, reducing it to it's bare essentials. With that loop, once I saw that the sister function shared it, it made sense why you used it, symmetry. Yeah I agree with you about the comparisons being easier but it all sort of rolled out all at once; it didn't help that I pushed allot of the adjustment math through multiplications and divides. P.S. This version I posted I did check (in LSLEditor, with only minor mods, casting the bools to ints), I wanted to make sure I didn't screw up the math somewhere. P.S.S. I was considering replacing the (i * 30) with (i << 5) - (i << 1) cause it would be theoretically faster to execute but I didn't because it would probably take longer to setup the registers. P.S.S.S. I really enjoyed the coding (It's a great piece of code) but I forgot about everything else I was supposed to be doing yesterday; the secretary of my Physical Therapist was nonplussed that I hadn't called to cancel. *sigh* P.S^4 I was thinking I would work on the sister function, see if the loop can be eliminated altogether. Could do it with a list. A tree of if's would be better but more expensive. I think instead I'll trick out [[Float2Hex]] to use my super evil [[User:Strife_Onizuka/int2hex|Int-Base64-Hex converter]]. -- '''[[User:Strife_Onizuka|Strife]]''' <sup><small>([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])</small></sup> 03:47, 21 January 2010 (UTC)
 
:{{message}}well I'm glad I could give you something fun to play with, though I am sorry it interfered with your RL schedule (such is the nature of our passions eh?) still haven't had a chance to poke at it... I'm barely fitting forum posts in between RL concerns =/ stupid RL, always demanding I do things like work and eat and sleep... meh <br/>-- '''[[User:Void_Singer|Void]]''' <sup><small>([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])</small></sup> 16:47, 21 January 2010 (UTC)
 
:{{message}}'''Update:''' looking at it, the month calc doesn't look right, as it would include the current month and looks to be off by a day for some months... after fiddling with it, I came up with this... <lsl>//rtn =
86400 *
(//y -= 1902
(int)(y*365.25 + 0.25) - 24837 + // (y>>2)*1461 + (int)((y&3)*365.375) - 24837 +
//m -= 1
m*30 +(m-(m<7)>>1) + (m<2) - ((y&3)>0)*(m>1) +
//d -= 1
d) +
h +
m +
s</lsl> check me on that but I think that's right for the symmetry capped version. shouldn't flow unless it's fed bad m/d/h/n/s, which I could force cap with llAbs(x%#) to prevent, so that even purposely malformed dates would fall in the +/-2145916800 range.
 
::Interesting solution. Hadn't thought to use a typecast. That is a great simplification. The problem was probably caused by the right shift, as -1 >> 1 == -1, not the same as -1 / 2 == 0. -- '''[[User:Strife_Onizuka|Strife]]''' <sup><small>([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])</small></sup> 20:17, 24 January 2010 (UTC)
 
:{{message}} I did finally figure out that the extra months says were being subtracted out of the year calc, but had to abandon that for protection of missing months. I did note  "&& ((vIntYear - 100) % 200)" was overkill, since those dates would fall outside the full valid range anyhow.
:"1+(d-(5+(y==4))/30" is as far as I got on loop replacement for the sister function, too hard to calculate a variable cutoff for a variable number based on that number... I may test whether an if structure will be smaller or faster.. or maybe a string or list with cutoff dates.. not as elegent as I'd have liked but ::shrug:: whatever works.<br/>-- '''[[User:Void_Singer|Void]]''' <sup><small>([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])</small></sup> 00:01, 25 January 2010 (UTC)
 
== References to forum threads ==
{{message}}The references to these threads: http://forums.secondlife.com/showthread.php?t=108960 and http://forums.secondlife.com/showthread.php?t=109571 in the caveat on throttling on the [[llHTTPRequest]] page are now broken. Did your archive project manage to catch any of theses? If so is it possible to distill the relevant info from them and add it to the page? [[User:Pete Olihenge|Pete Olihenge]] 10:18, 16 February 2010 (UTC) PS: I mean if you can give me access to the text of those threads, I can have a go at making a précis.
 
{{message}}I'll take a look today, I didn't archive them by their thread ID's but rather by their page titles (or part thereof), but the links should still be in the page in print view, so I'll run text search and see if anything turns up... Gromlocks case probably won't be helped by self throttling, but I did think about that when he posted.<br/>-- '''[[User:Void_Singer|Void]]''' <sup><small>([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])</small></sup> 15:56, 16 February 2010 (UTC)
 
:oh gods, you didn't just spider the forums? -- '''[[User:Strife_Onizuka|Strife]]''' <sup><small>([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])</small></sup> 17:08, 16 February 2010 (UTC)
 
::@Strife: I know, but with the load it was experiencing (probably from unthrottled spider requests =P), the fact that I didn't have anything on hand to do it with, and I wanted relevant description on the file names it was faster to just do a quick link rewrite to get the print view, and grab the pages manually.... it's only about 23*40 pages or so.... I just went after the most valuable stuff to cut down on chatter, so library scripts, a few posts I had bookmarked, and stickies.... what can I say, I was really busy doing other stuff too, and the archiving was what I was doing in between.... unfortunately I'm going to need to do a parser for the broken bbcode, because you'rs won't work on print view pages, even after adding the local url and setting fileIsGreasable... c'est la vie
 
::PS. when you have a chance, can you show me what I might change in Template:void-box so that when clicking edit on the container in a page I get the content of the box to edit, instead of the template page? my wiki foo is weak. I love the layout / ease of use, but would like to make it more functional so I don't have to do full page edits for just a single box (plus then others can use it easier too)<br/>-- '''[[User:Void_Singer|Void]]''' <sup><small>([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])</small></sup> 23:07, 16 February 2010 (UTC)
 
{{message}} sorry Pete, it's not in there, unfortunately the wiki pages don't have something similar (though it's the same setup as a notecard reader which there are examples of) <br/>-- '''[[User:Void_Singer|Void]]''' <sup><small>([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])</small></sup> 23:25, 16 February 2010 (UTC)
 
:As to fixing the template... I haven't ever found a solution. It was the original reason LSL documents had section editing turned off (now the templates are so complex that edit links don't make sense). Shoot, I nearly forgot I need to make a template for Operators. -- '''[[User:Strife_Onizuka|Strife]]''' <sup><small>([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])</small></sup> 06:16, 17 February 2010 (UTC)
 
{{message}} Note to self: fix those links when the forum archives come online. Hmm, that page is a bit... forbidding? [[User:Pete Olihenge|Pete Olihenge]] 07:32, 17 February 2010 (UTC)
 
=== RE: list format to Unix timestamp ===
{{message}} hello. I'm using for over a year your u2StampUnixInt function and I have found a bug. If I submit at your function a time superior at 2010 2 28 with 0h00 (example [2010,3,14,0,0,0]) the day is additionned of 1 day.
[[User:Elenia Boucher|Elenia Boucher]] 19:58, 14 March 2010 (UTC)
 
{{message}} Thanks for that Elenia I found the bug, and posted the corrected change (there was a bad transposed leap year calculation)... should work fine now, and again, thank you <br/>-- '''[[User:Void_Singer|Void]]''' <sup><small>([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])</small></sup> 06:39, 17 March 2010 (UTC)
 
== nPose wiki page ==
 
Hi, Void.  I've been trying to contact you via the blogorum messaging system, but it claims you don't exist! (I've stared a jira about that about that http://jira.secondlife.com/browse/WEB-1622). 
 
Anyway, Nandana Singh has asked me to help with the admin and distribution for nPose, and I'd like to take up your suggestion of posting the code in the wiki as well as continuing to distribute it in world via the GridShout system.  I'm going to need some help setting up the pages, though, and I'm wondering if you could assist me with this some time over the next week or so.
 
I'll watch this page, though maybe you'll have better luck with the messaging system than have I.  Or you could reach me via SLU.
 
[[User:Innula Zenovka|Innula Zenovka]] 12:11, 28 April 2010 (UTC)
 
:Hi Inunla, more than happy to help, I've setup an easy to edit basis on a [[User:Nandana_Singh/nPose|sub page of Nandana's user page]], with a link to and from [[User:Nandana_Singh|her main user page]], and can add another link to the library once it's all in place. if you have any trouble getting it working right, just paste plain text of the information that needs to go the page below the existing content (PS use the edit tab at the top of the page to add content, the in-page edit links can't be made to work, and apparently can't be removed just for templates).
:as for the problem with messaging me on the blogorums, use a period instead of a space in my name and it should work, although I often miss them for days =X <br/>-- '''[[User:Void_Singer|Void]]''' <sup><small>([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])</small></sup> 09:11, 29 April 2010 (UTC)
 
== Re: Weekday from ( Y, M, D ) format ==
{{message}} [http://mathforum.org/library/drmath/view/55837.html This item] may be of relevance and/or interest; the author claims the algorithm to be accurate for ''any'' date. I came across it via the [http://lslwiki.net/lslwiki/wakka.php?wakka=llGetTimestamp llGetTimestamp page in the old waka ]. [[User:Pete Olihenge|Pete Olihenge]] 02:27, 31 July 2010 (UTC)
 
== Mind your own business? ==
<nowiki>[Childish Rant posted by Kira Komarov (who wasn't even bold enough to sign their own edit) removed]</nowiki>
 
Kira Komarov (here I signed it) =))
 
{{message}}Thanks for stopping by to log your opinion, it's been noted and categorically dismissed exactly the way you chose to dismiss the the agreement on every single edit you added to this wiki. you have no authority to ignore or rewrite that agreement. only LL does. My statements are within the letter of the law. if you don't like them then may I kindly suggest you go piss up rope, because I'm really not interested in your misplaced ravings, here or anywhere else.


*Born: 1975
:P.S. and just so that you know, I've copied every last one of those pages and images, in accordance with the license of this wiki... not because I personally have any particular use for them, but just to annoy you. please feel free to direct any future ravings and/or threats you may wish to make or imply to spam@lindenlab.com so they can get a good laugh too.<br/>-- '''[[User:Void_Singer|Void]]''' <sup><small>([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])</small></sup> 02:19, 24 May 2012 (PDT)
*Name: Void is fine, "Your Majesty" works too ;)
*Location: Utah, for the moment
*History: Started off making webpages, then scripting for webpages (jscript), went to college for 3 years, studied programming and networking. I do a little of everything, from digital art, to running my own web & streaming media servers, to anything you can think of in SL.
I'm easy-going, love to help, pretty non-judgmental, and love interesting scripting challenges =)
I know a little about alot, and alot about very little. I'm also kinda random, rather shy, and occasionally bouncy so.... beware!


= Coding Practices: part 1 (formatting) =
=== [further childish antics and harassment by Kira Komarov removed and reported for abuse] ===
this is a listing of how I format code, for readability and self documentation, not everyone likes it, but if you use something and stick with it, others will thank you, and you'll thank yourself later when you look at it and your eyes want to glaze over thinking "WTF was I doing?"
Like I said, not interested<br/>-- '''[[User:Void_Singer|Void]]''' <sup><small>([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])</small></sup> 04:30, 24 May 2012 (PDT)
#variables:
#* all user variables are prefixed with "v" (for variable) [so we can quickly Id variables]
#* all variables have their type included in 3 letters (eg. vStrData) [so we know the type, saves debugging typcast problems]
#* all variables denote what they are for (eg. key vKeyOwner = llGetOwner();) [saves on comments, makes it esay to know what we're doing]
#* all States prefixed "vs" -eg vsStateName [so we can id states]
#* all user defined functions prefixed "vf" and return type -eg vfFunctionName [so we can Id functions and their return types]
#* All Globals are prefixed with "vg" (for variable-global) [makes it easy to spot globals]
#* All Constants are prefixed "c" and placed in all caps to distinguish from ll -eg cSTR_TITLE [easier to spot non ll constants]
#* Bitmasks and booleans are given type "vBit" and "vBoo" [so we know how they are being used]
#Comments: [use lots of them to help us remember/see what code is trying to do]
#*Sections/Headers: "//--// text //--//"
#*Code: " //-- the line below does X" (note the extra space indent
#*Edit/Notes: " //-- the line to the left is editable or could use changes"
#Brackets/Whitespace:
#*Functions: space away from the container -eg. llRound( vIntNumber ); [makes it different from grouping]
#*math: always separate math -eg 2 + 2, exception increments --x, ++x [easier to read/debug]
#*Grouping: do not space inside, or out -eg. ((vIntNumber + 2) * 5 ) [makes it different from functions]
#*Events: follow function rules + { -eg state_entry(){
#*If/Loop: follows grouping rules with a space before group, and trailing { -eg if (TRUE){
#*loops, if/else, events, states, functions: "{" goes on the same line as the calling body, "}" after the last entry, and are ALWAYS used (even where optional) [for readability & debugging]
Note:
Apparently Strife and I disagree about placing "{" on the same line as the originating
section, so for the sake of not fighting over edits, they will be on the line following the
origin for WIKI examples... it's a matter of personal taste and practice for me, so I'll
let it go =) [however I cannot forgive the changing of comment formatting =P]
#General WhiteSpace:
#*blank line between event [easier to read]
#*blank line between sections of code doing different things [groups like actions]
#*tabs are 2 spaces, to reduce wrapping for nested items. any items inside a loop, if/else, event, state, or function recieves a tab [saves wrapping, eaiser to read/debug]
#Special Cases:
#*Long tests/function calls: wrap each variable/container to the next line with level spacing -eg see below [easier to read, less sloppy than built in wrapping]
<pre>
//--// this is an example script //--//


string  cSTR_TITLE = "example script" //-- something to tell the user later
== [and again] ==
integer  vgIntTotalTouches = 0;
-
== [digs the grave a little deeper] ==
-


string vfStrFunctionExample( key vKeyOwner ){
== Abuse ==
  return llKey2Name( vKeyOwner );
}


default{
How are you reporting the abuse? Email? Not really keen on logging in just to file an abuse report on [[Talk:Float2Hex]]. -- '''[[User:Strife_Onizuka|Strife]]''' <sup><small>([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])</small></sup> 11:15, 25 May 2012 (PDT)
  state_entry(){
    llOwnerSay( "Hi, " + vfStrFunctionExample( llGetOwner() ) );
  }


  touch_start( integer vIntTouchCount ){
* Abuse reports for [[Bug_Tracker#How_do_I_report_abuse_on_the_Bug_Tracker.3F|JIRA]] and the wiki can only be created inworld by using the AR tool. With Rand gone there isn´t much administration of the wiki left but maybe sending an email to Lexie or Jeremy could help too. (Sorry for invading your talk page Void...) --[[File:Torb.jpg|25px]] [[User:Torben Trautman|Torben]] 12:13, 25 May 2012 (PDT)
    do{
      //-- below is the example of wrapping functions parameters
      llSay( 0,
            cSTR_TITLE + " has been touched "          //-- this is an example of
                        + (string)(++vgIntTotalTouches)  //-- string wrapping, always
                        + " times" );                    //-- has + in the front
    }while (--vIntTouchCount > -1);
  }


  changed( integer vBitChanged ){
I was in the position of being unable to log inworld at the time, so with a little coaxing I managed it through live chat (I wish I was aware of an email). and yes I'm aware of the efforts gone to to find bugs.... ::shrug:: I've been meaning to do a code review and they actually managed to find a bug on one of mine (wrong function used)... the fix is simple enough but I'm thinking I can actually do it faster, so I'm going to play with it awhile before updating. I could wish other people were so diligent in reporting bugs =D <br/>-- '''[[User:Void_Singer|Void]]''' <sup><small>([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])</small></sup> 14:22, 25 May 2012 (PDT)
    if (vBitChanged & CHANGED_OWNER){
      state vsReset
    }
  }
}


state vsReset{
:I tried using llParseStringKeepNulls instead of the inner llParseString2List but it failed spectacularly when dealing with empty strings. I would have suggested the fix otherwise. I suspect your other "Last" function on the page is similarly effected with this edge case. You may want to look at [[TightList]] and steal it's deliminator selection code. -- '''[[User:Strife_Onizuka|Strife]]''' <sup><small>([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])</small></sup> 21:36, 25 May 2012 (PDT)
  state_entry(){
    llSay( 0, "New Owner " + vfStrFunctionExample( llGetOwner() ) + " detected; reseting" );
    llResetScript();
  }
}
</pre>


= Coding Practices Part 2 (optimizations) =
::Originally they were linked on the llListFindList page, but I pulled them from there when I realized there was a fatal flaw in the versions I had been using inworld... they can't handle null string elements... it didn't come up in the original application and I don't know how I managed to bork the copy that I placed in the wiki, only that I forgot to rework and annotate them here... but it's why they were never pushed out to their own pages like the other functions. I'll repost working versions when I've got time to grab from inworld (but currently inworld is limited to at home, and I'm waiting on a tech to fix a line noise issue there). probably not until next weekend unless someone wants to test the one or two versions I've got locally for the behavior of (llParseString2List( "", [""], [] ) == []) and (llParseString2List( "", ["", ""], [] ) == []) ... assuming one is true the function should work (I tweaked out a few refs and calcs in the list length calculations too)<br/>-- '''[[User:Void_Singer|Void]]''' <sup><small>([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])</small></sup> 13:43, 28 May 2012 (PDT)
This is a list of current coding optimizations and "hacks" I use in LSL and in examples
They are all [[LSL_Script_Efficiency#How_Fast_Does_That_Code_Run|tested]] personally
# when testing a function that returns -1 on NOT_FOUND
#* use (~test_function) -[eg. if (~llSubStringIndex( "abcdef", "t")){
#* instead of (test_function != -1) -[eg. if (llSubStringIndex( "abcdef", "t") != -1){
#* because it runs faster -[(!~test_function) also works for FOUND
# when testing a list for a specific single entry
#* use llListFindList( vLstBase, (list)"test" )
#* instead of llListFindList( vLstBase, ["test"] )
#* because it runs faster -[eg. if (llListFindList( vLstBase, (list)"test" )){
# when incrementing counters or variables
#* use (++vIntCount)
#* instead of (vIntCount++) or (vIntCount += 1) or (vIntCount = vIntCount + 1)
#* because it runs faster
# [[LSL_Script_Efficiency|Other Useful Optimizations]]


= Comments: =
:I misread your earlier statment as "failed spectacularly when dealing with empty ''lists''" instead of strings.. mea culpa. as noted that was a known issue and I've annotated the optimized and working updates to them. in the case of findLast version of llListFindList, I'm thinking of just replacing it altogether with the list reverse functions (since they'll support all types correctly), but I like that there's a thinner/faster solution for strings, even with the limits. tight list might be good for the general case, was just looking for something a little lighter for the specific case as an optimization.<br/>-- '''[[User:Void_Singer|Void]]''' <sup><small>([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])</small></sup> 20:11, 3 June 2012 (PDT)
== Sample Comment ==
Please leave all comments here, (format below)
<pre>== Comment Title ==
this is my comment


~~~~ <-- will be replaced by User Name + Time Stamp automatically</pre>
== Great minds :p ==
Thanks =)
 
We were thinking the same thing at the same time. Crazy madness. -- '''[[User:Strife_Onizuka|Strife]]''' <sup><small>([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])</small></sup> 23:47, 25 July 2012 (PDT)
 
== Dead Links ==
Void, there are a few Wiki pages that refer to a blanked page of yours e.g. in https://wiki.secondlife.com/wiki/LlOverMyLand
 
Can you delete the dead references? Or I'm happy to.  [[User:Omei Qunhua|Omei Qunhua]] 14:00, 28 December 2012 (PST)


[[User:Void Singer|Void Singer]] 21:59, 16 October 2007 (PDT)
: Thanks for the catch, I deleted the bad ref and updated the comments to include the missing details. script compile unchecked.<br/>-- '''[[User:Void_Singer|Void]]''' <sup><small>([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])</small></sup> 16:04, 29 December 2012 (PST)

Latest revision as of 16:04, 29 December 2012

Comments:

Question2.JPG Comment Format

=== Topic === <-- this line is optional
{{message}} this is my comment
~~~~ <-- will be replaced by User Name + Time Stamp automatically

Question2.JPG welcome all to my User Talk page. Feel Free to leave a message below, and thanks for stopping by! --Void Singer 05:54, 20 November 2007 (PST)

Advanced Visitor Greeter

Question2.JPG Void. Not had a detailed look, but it would appear that the call to llRegionSayTo has too many parameters ... looks like the edit from oct has broken it ...? Kimm Paulino 13:52, 15 February 2012 (PST)

Good catch, thank you, I've corrected it. was a bad update from the previous function.
-- Void (talk|contribs) 05:33, 16 February 2012 (PST)

LandMark Teleport Script

Question2.JPG Hello Void! Just wanted to know where I'd put the landmarks and positions in the script and in what format. When you state min. 3 linked prims, what does this mean? Sorry, new to all this. I've noticed most teleporters are of "Sit" type and I need to teleport to a location about 2700m from ground level. Any feedback is appreciated. Thank you HDBadBoy Afterthought 11:59, 6 September 2011 (PDT)

Question2.JPG the Landmark Teleport script uses the map window to send teleport locations, it work much like the favorite locations bar on V2+ (except for others if you set it out).... no special format is needed for the landmarks, but if you rename them then the hover text it generates for them will use the new name. as for the 3 prims, in the instructions you'll note that the script itself goes in the root, and you need two more with the name "next" and "prev" which will be buttons for the script to change landmarks.... although it's important to mention that this is NOT the ideal script for teleport locations on the same region. for that I suggest a PosJump type of script, which gives you the type of immediate "sit" style action most users expect for local teleports.
-- Void (talk|contribs) 04:45, 7 September 2011 (PDT)


Re: Formatting [topic added by Void due to page reordering]

Question2.JPGIt looks well thought out. I'm pretty laid back about style as long as it's consistent. The only thing I put my foot down on is tabs being 4 spaces. All a matter of preference thou. I find prefixing variables with anything other then a letter to indicate type is overkill. I write my LSL as ESL (which is LSL passed through a C precompiler) and I reserve all uppercase lettered names for ESL macro's and defines. -- Strife Onizuka 03:09, 3 November 2007 (PDT)

Question2.JPGAmazing. I've been programming for 25 years and have developed a style that chooses the opposite of most of Void's rules. Why is it that these questions lead to such equally satisfactory results in competent programming organizations that are so different. I suppose that it's similar to the reason that Spanish isn't the same as French.

I'll go Strife one further, though, and put my particular foot down about the insane (to me) verbosity of prefixing variables, function names, etc. with garbage characters that serve no useful purpose I can see, and is constantly bonking the reader who has to read through several largely irrelevant or self-evident characters to get to the important part - what the variable is. It's like getting tapped on the side of the head with a pencil every time I trip over one of the darn things. Is this another sad legacy of Microsoft? I'd never seen such a thing before I had to start writing Windows code. And I'll note, I work in RL in an environment where we have several hundred thousand lines of legacy code I have to refer to regularly, (and a couple of legacy programmers) that use "Hungarian" notation like this, and after 10 years of reading it I STILL get tapped every time I see one.

I do have one possibly pertinent point, though. I had been ambivalent about where the brace at the opening of a block goes for a couple years, having programmed in environments for most of my time where they were to be on a (wasteful) line of their own. After spending some time in Java, where the convention tends to be 'on the same line' I was still uncertain I had an opinion, except that I really don't like the effect that mixing the styles has. (That happens with templates, copy/paste, etc.) However, a few weeks ago when working on some poor code (mine) that was too long and nested too deeply I spent quite a while tracking down a missing opening brace. I realized that had it been on its own line I'd have seen it almost immediately. Given modern monitor resolutions and sizes, I don't think the vertical height saved is worth the obviousness that it exists.

So there, finally the definitive answer to the "same line or different line" question.

Ah, the style wars, long shall they rage.

In the end, as both you and Strife observe, it is all personal preference as modified by the need to be consistent with those you work with. Thanks, much, for taking the time to write it down. I should do it too if I care so much I guess. --RJ Thibaud 12:25, 23 December 2007 (PST)

RE: style etc

Question2.JPG heh, thanks for reading it at least, I'm not fanatical about it, each person develops their own style, and to be honest I only adapted the style I normally use for lsl, from my other coding projects, so it's prone to updates (a few of which I've yet to add in). The particular style I use is geared towards maximum understanding of the code for those new to scripting/programming so they can more easily find their way through code. But as noted, for an experienced coder it can be a bit like 'duh I know that'. Coming from an enviroment with lots of new coders though, I tend to keep it up for their benefit more than my own. The opening brace debate is long running with me, and I do realize the pro's and cons, but have gotten myself in the habit of expecting open braces on the same line, and visually reading the statement (if, do, etc) and the indent as opening the statement and even briefly played with inlining the closing statement (but found it interfered with the visual nesting effect sometimes).

I mostly provided the example style as something to explain, rather than recommend, because I was bored enough to write it one day, and had been asked a few times about it. I have found that prefixing of some kind tends to avoid collisions with developing languages like lsl, as I noticed happened once or twice when people named constants or variables that later became LSL constants, and I've discouraged a few people from using llFunctionName for that and other reasons (like people that see the call and try to use it elsewhere). I'ts all good though, whatever gets the job done and works as expected. Void Singer 13:35, 25 December 2007 (PST)

0x80000000 X_X

Yep I forgot about 0x80000000. The limit however accepts 2038 and then overflows. So I wrote a version that detects overflows and accepts the entire integer range. It should be noted that if you get clever on it, and give it a year before 1970 but have the final date fall in or after 1970 it will have a fit. Likewise for years after 1969 but the final dates fall before 1970. Could turn off the overflow detection for centrally located years but that's more work. But it will parse [2100,12,13,23,59, -2147483648] and [1845, 1, 1, 0, 0, 2147483647] properly... i think. =^_^= -- Strife (talk|contribs) 06:28, 20 January 2010 (UTC)

Question2.JPG I'll take a look in a bit, and I do like the integer division and bit shift solution in the unix2stamp, much cleaner... in the other, subtracting out 68 less to make the entire range positive... I like that part, shouldve done it from the start (it was converted from a quickie 1970+ version that I think argent did) although I had capped the dates to provide symmetry with the opposite function (since it's much easier to cap that one on a particular day, and 19 days on the edge seemed a small loss, vs detecting up to the last available second)... haven't checked the leap day / month detection in the loop replacement but I'll assume it's good until I double check. ps, I appreciate the fixes (always something to be learned) but can we separate out revisions that are more than corrections or order changes... it makes it harder to compare versions side by side (as the wiki only gives changed lines)... not complaining, I appreciate the feedback... PPS bad cabbit you didn't test to be sure? =)
-- Void (talk|contribs) 23:37, 20 January 2010 (UTC)
As I was reading the code, I was like "this code is so evil I think it is something I must have done in a past life". I really enjoy niggling away at code like this, reducing it to it's bare essentials. With that loop, once I saw that the sister function shared it, it made sense why you used it, symmetry. Yeah I agree with you about the comparisons being easier but it all sort of rolled out all at once; it didn't help that I pushed allot of the adjustment math through multiplications and divides. P.S. This version I posted I did check (in LSLEditor, with only minor mods, casting the bools to ints), I wanted to make sure I didn't screw up the math somewhere. P.S.S. I was considering replacing the (i * 30) with (i << 5) - (i << 1) cause it would be theoretically faster to execute but I didn't because it would probably take longer to setup the registers. P.S.S.S. I really enjoyed the coding (It's a great piece of code) but I forgot about everything else I was supposed to be doing yesterday; the secretary of my Physical Therapist was nonplussed that I hadn't called to cancel. *sigh* P.S^4 I was thinking I would work on the sister function, see if the loop can be eliminated altogether. Could do it with a list. A tree of if's would be better but more expensive. I think instead I'll trick out Float2Hex to use my super evil Int-Base64-Hex converter. -- Strife (talk|contribs) 03:47, 21 January 2010 (UTC)
Question2.JPGwell I'm glad I could give you something fun to play with, though I am sorry it interfered with your RL schedule (such is the nature of our passions eh?) still haven't had a chance to poke at it... I'm barely fitting forum posts in between RL concerns =/ stupid RL, always demanding I do things like work and eat and sleep... meh
-- Void (talk|contribs) 16:47, 21 January 2010 (UTC)
Question2.JPGUpdate: looking at it, the month calc doesn't look right, as it would include the current month and looks to be off by a day for some months... after fiddling with it, I came up with this... <lsl>//rtn =

86400 * (//y -= 1902

(int)(y*365.25 + 0.25) - 24837 + // (y>>2)*1461 + (int)((y&3)*365.375) - 24837 +
//m -= 1
m*30 +(m-(m<7)>>1) + (m<2) - ((y&3)>0)*(m>1) +
//d -= 1
d) +

h + m + s</lsl> check me on that but I think that's right for the symmetry capped version. shouldn't flow unless it's fed bad m/d/h/n/s, which I could force cap with llAbs(x%#) to prevent, so that even purposely malformed dates would fall in the +/-2145916800 range.

Interesting solution. Hadn't thought to use a typecast. That is a great simplification. The problem was probably caused by the right shift, as -1 >> 1 == -1, not the same as -1 / 2 == 0. -- Strife (talk|contribs) 20:17, 24 January 2010 (UTC)
Question2.JPG I did finally figure out that the extra months says were being subtracted out of the year calc, but had to abandon that for protection of missing months. I did note "&& ((vIntYear - 100) % 200)" was overkill, since those dates would fall outside the full valid range anyhow.
"1+(d-(5+(y==4))/30" is as far as I got on loop replacement for the sister function, too hard to calculate a variable cutoff for a variable number based on that number... I may test whether an if structure will be smaller or faster.. or maybe a string or list with cutoff dates.. not as elegent as I'd have liked but ::shrug:: whatever works.
-- Void (talk|contribs) 00:01, 25 January 2010 (UTC)

References to forum threads

Question2.JPGThe references to these threads: http://forums.secondlife.com/showthread.php?t=108960 and http://forums.secondlife.com/showthread.php?t=109571 in the caveat on throttling on the llHTTPRequest page are now broken. Did your archive project manage to catch any of theses? If so is it possible to distill the relevant info from them and add it to the page? Pete Olihenge 10:18, 16 February 2010 (UTC) PS: I mean if you can give me access to the text of those threads, I can have a go at making a précis.

Question2.JPGI'll take a look today, I didn't archive them by their thread ID's but rather by their page titles (or part thereof), but the links should still be in the page in print view, so I'll run text search and see if anything turns up... Gromlocks case probably won't be helped by self throttling, but I did think about that when he posted.
-- Void (talk|contribs) 15:56, 16 February 2010 (UTC)

oh gods, you didn't just spider the forums? -- Strife (talk|contribs) 17:08, 16 February 2010 (UTC)
@Strife: I know, but with the load it was experiencing (probably from unthrottled spider requests =P), the fact that I didn't have anything on hand to do it with, and I wanted relevant description on the file names it was faster to just do a quick link rewrite to get the print view, and grab the pages manually.... it's only about 23*40 pages or so.... I just went after the most valuable stuff to cut down on chatter, so library scripts, a few posts I had bookmarked, and stickies.... what can I say, I was really busy doing other stuff too, and the archiving was what I was doing in between.... unfortunately I'm going to need to do a parser for the broken bbcode, because you'rs won't work on print view pages, even after adding the local url and setting fileIsGreasable... c'est la vie
PS. when you have a chance, can you show me what I might change in Template:void-box so that when clicking edit on the container in a page I get the content of the box to edit, instead of the template page? my wiki foo is weak. I love the layout / ease of use, but would like to make it more functional so I don't have to do full page edits for just a single box (plus then others can use it easier too)
-- Void (talk|contribs) 23:07, 16 February 2010 (UTC)

Question2.JPG sorry Pete, it's not in there, unfortunately the wiki pages don't have something similar (though it's the same setup as a notecard reader which there are examples of)
-- Void (talk|contribs) 23:25, 16 February 2010 (UTC)

As to fixing the template... I haven't ever found a solution. It was the original reason LSL documents had section editing turned off (now the templates are so complex that edit links don't make sense). Shoot, I nearly forgot I need to make a template for Operators. -- Strife (talk|contribs) 06:16, 17 February 2010 (UTC)

Question2.JPG Note to self: fix those links when the forum archives come online. Hmm, that page is a bit... forbidding? Pete Olihenge 07:32, 17 February 2010 (UTC)

RE: list format to Unix timestamp

Question2.JPG hello. I'm using for over a year your u2StampUnixInt function and I have found a bug. If I submit at your function a time superior at 2010 2 28 with 0h00 (example [2010,3,14,0,0,0]) the day is additionned of 1 day. Elenia Boucher 19:58, 14 March 2010 (UTC)

Question2.JPG Thanks for that Elenia I found the bug, and posted the corrected change (there was a bad transposed leap year calculation)... should work fine now, and again, thank you
-- Void (talk|contribs) 06:39, 17 March 2010 (UTC)

nPose wiki page

Hi, Void. I've been trying to contact you via the blogorum messaging system, but it claims you don't exist! (I've stared a jira about that about that http://jira.secondlife.com/browse/WEB-1622).

Anyway, Nandana Singh has asked me to help with the admin and distribution for nPose, and I'd like to take up your suggestion of posting the code in the wiki as well as continuing to distribute it in world via the GridShout system. I'm going to need some help setting up the pages, though, and I'm wondering if you could assist me with this some time over the next week or so.

I'll watch this page, though maybe you'll have better luck with the messaging system than have I. Or you could reach me via SLU.

Innula Zenovka 12:11, 28 April 2010 (UTC)

Hi Inunla, more than happy to help, I've setup an easy to edit basis on a sub page of Nandana's user page, with a link to and from her main user page, and can add another link to the library once it's all in place. if you have any trouble getting it working right, just paste plain text of the information that needs to go the page below the existing content (PS use the edit tab at the top of the page to add content, the in-page edit links can't be made to work, and apparently can't be removed just for templates).
as for the problem with messaging me on the blogorums, use a period instead of a space in my name and it should work, although I often miss them for days =X
-- Void (talk|contribs) 09:11, 29 April 2010 (UTC)

Re: Weekday from ( Y, M, D ) format

Question2.JPG This item may be of relevance and/or interest; the author claims the algorithm to be accurate for any date. I came across it via the llGetTimestamp page in the old waka . Pete Olihenge 02:27, 31 July 2010 (UTC)

Mind your own business?

[Childish Rant posted by Kira Komarov (who wasn't even bold enough to sign their own edit) removed]

Kira Komarov (here I signed it) =))

Question2.JPGThanks for stopping by to log your opinion, it's been noted and categorically dismissed exactly the way you chose to dismiss the the agreement on every single edit you added to this wiki. you have no authority to ignore or rewrite that agreement. only LL does. My statements are within the letter of the law. if you don't like them then may I kindly suggest you go piss up rope, because I'm really not interested in your misplaced ravings, here or anywhere else.

P.S. and just so that you know, I've copied every last one of those pages and images, in accordance with the license of this wiki... not because I personally have any particular use for them, but just to annoy you. please feel free to direct any future ravings and/or threats you may wish to make or imply to spam@lindenlab.com so they can get a good laugh too.
-- Void (talk|contribs) 02:19, 24 May 2012 (PDT)

[further childish antics and harassment by Kira Komarov removed and reported for abuse]

Like I said, not interested
-- Void (talk|contribs) 04:30, 24 May 2012 (PDT)

[and again]

-

[digs the grave a little deeper]

-

Abuse

How are you reporting the abuse? Email? Not really keen on logging in just to file an abuse report on Talk:Float2Hex. -- Strife (talk|contribs) 11:15, 25 May 2012 (PDT)

  • Abuse reports for JIRA and the wiki can only be created inworld by using the AR tool. With Rand gone there isn´t much administration of the wiki left but maybe sending an email to Lexie or Jeremy could help too. (Sorry for invading your talk page Void...) --Torb.jpg Torben 12:13, 25 May 2012 (PDT)

I was in the position of being unable to log inworld at the time, so with a little coaxing I managed it through live chat (I wish I was aware of an email). and yes I'm aware of the efforts gone to to find bugs.... ::shrug:: I've been meaning to do a code review and they actually managed to find a bug on one of mine (wrong function used)... the fix is simple enough but I'm thinking I can actually do it faster, so I'm going to play with it awhile before updating. I could wish other people were so diligent in reporting bugs =D
-- Void (talk|contribs) 14:22, 25 May 2012 (PDT)

I tried using llParseStringKeepNulls instead of the inner llParseString2List but it failed spectacularly when dealing with empty strings. I would have suggested the fix otherwise. I suspect your other "Last" function on the page is similarly effected with this edge case. You may want to look at TightList and steal it's deliminator selection code. -- Strife (talk|contribs) 21:36, 25 May 2012 (PDT)
Originally they were linked on the llListFindList page, but I pulled them from there when I realized there was a fatal flaw in the versions I had been using inworld... they can't handle null string elements... it didn't come up in the original application and I don't know how I managed to bork the copy that I placed in the wiki, only that I forgot to rework and annotate them here... but it's why they were never pushed out to their own pages like the other functions. I'll repost working versions when I've got time to grab from inworld (but currently inworld is limited to at home, and I'm waiting on a tech to fix a line noise issue there). probably not until next weekend unless someone wants to test the one or two versions I've got locally for the behavior of (llParseString2List( "", ["•"], [] ) == []) and (llParseString2List( "", ["", "•"], [] ) == []) ... assuming one is true the function should work (I tweaked out a few refs and calcs in the list length calculations too)
-- Void (talk|contribs) 13:43, 28 May 2012 (PDT)
I misread your earlier statment as "failed spectacularly when dealing with empty lists" instead of strings.. mea culpa. as noted that was a known issue and I've annotated the optimized and working updates to them. in the case of findLast version of llListFindList, I'm thinking of just replacing it altogether with the list reverse functions (since they'll support all types correctly), but I like that there's a thinner/faster solution for strings, even with the limits. tight list might be good for the general case, was just looking for something a little lighter for the specific case as an optimization.
-- Void (talk|contribs) 20:11, 3 June 2012 (PDT)

Great minds :p

We were thinking the same thing at the same time. Crazy madness. -- Strife (talk|contribs) 23:47, 25 July 2012 (PDT)

Dead Links

Void, there are a few Wiki pages that refer to a blanked page of yours e.g. in https://wiki.secondlife.com/wiki/LlOverMyLand

Can you delete the dead references? Or I'm happy to. Omei Qunhua 14:00, 28 December 2012 (PST)

Thanks for the catch, I deleted the bad ref and updated the comments to include the missing details. script compile unchecked.
-- Void (talk|contribs) 16:04, 29 December 2012 (PST)