Jump to content

Miranda Umino

Resident
  • Posts

    390
  • Joined

  • Last visited

Everything posted by Miranda Umino

  1. When you say "i want to change dinamically a picture on a prim" it may depend how ( what action ) it changes. If you want just a kind of diaporama or a carousel , you may use llSetPrimMediaParams, llGetPrimMediaParam & llClearPrimMedia. There are many pictures host services who can display for a diaporama with the pictures you have uploaded on their site . For instance , you may use flicker , pick up the url of your diaporama , for instance http://www.flickr.com/photos/hathuyanna/show/with/4444861729 and put it on the media on prim. Flicker diaporama is nice because the menu goes away when your cursor is not above the picture after a moment If you use LSL , you could swap from a diaporama to an another with an action of the user . For instance . Link your board with some prims who , by touch , will change the URL of the board . Either load the url only when there is an avatar nearby and clear the media when nobody is nearby , tested by a sensor Check http://wiki.secondlife.com/wiki/LlSetPrimMediaParams for more informations You may use too the URL of a PNG but it s static not dynamic . Weirdly the URL of a TGA or a JP2 will display the binary of the picture , but not the picture itself . An other way is to use a dynamical page as PHP or JSP page , who will generate a picture on the fly . Probably you will need to tune with the sizes of the texture ( not of the prim ) and maybe the offsets
  2. Even for POST method , there is a limit in the size of the body , but generally it s huge compared to the limit size of URLs For instance , for an apache web server the limits is delared in the parameter LimitRequestBody inside your config file httpd.cond Check the other parameters too : #LimitRequestLine: Limit on bytes in Request-Line (Method+URI+HTTP-version). #Maximum value set by DEFAULT_LIMIT_REQUEST_LINE in httpd.h to 8190KB #LimitRequestFieldsize: Limit on bytes in any one header field. #Maximum value set by DEFAULT_LIMIT_REQUEST_FIELDSIZE in httpd.h to 8190KB #LimitRequestBody: Limit on bytes in Request-Line. #LimitRequestFields: Limit on number of request header fields. The application server can limit too the size of requests. For instance , for a php application server , the limit is declared inside your php.ini config file with these parameters upload_max_filesize = 2M post_max_size = 2M Check your host web server hosting documentation to know the limits Anyway , you will be limited by the size of your string inside the LSL script , so 64 kb in mono with a 16bit character size . So 32 kb less the side code of your script and the size of other datas you use For the max number of connections actives , you should check too your httpd.conf file if you are using apache . It s easy to modify but is often difficult to tune correctly For instance , for apache web server you may check this directive MaxKeepAliveRequests for statics MaxClients for dynamics Nevertheless , there are many other directives you should check too A simple common configuration in local may handle 400 active requests if you answer some static documents ( images , for instance ) but around 50 active requests only for dynamic documents ( php , jsp asp .. ) without to have a time out . To go back to the 1st post , 50 connections per minute is easily handled . 50 connections per seconds could fail . It can depend how fast you generate the answer If you are using a database you should check too the configuration of your database . Generally , each database has got a pool of connections . If you are using this pool of connections it s fine , but you will be limited by the size of the pool . If you don t use this pool of connection inside your php , jsp, asp page , and create some connection inside the page , you will fail to timeout quickly .
  3. :matte-motes-big-grin-squint: void , my bad .. i was tired ...
  4. This code below costs many creation of lists .. Let s cross fingers that the garbage collector works well list ListReplaceIntegerElementByIndex(list l , integer index , integer value){ return llList2List( l , 0, index -1 ) + (list)value + llList2List( l , index +1 , -1 );}default{ state_entry() { // displays Object: 10, 20, 30, 40, 1000, 60, 70, 80, 90 llOwnerSay(llList2CSV( ListReplaceElementByIndex( [ 10, 20, 30, 40, 50, 60, 70, 80, 90 ], 4, 1000))); }}
  5. So , detecting viewer is probably useless .. Positions of HUDS can depend of the screen resolution, of the resolution window in graphical preferences , maybe your viewport too and maybe other some different configuration settings
  6. Hi , i ve got a problem of memory in a script and i don t understand what it happens . I am very glad that in the Snack sims the function llGetUsedMemory has been released . So , i ve wanted to test my scripts It s a simple script who allocates some memory every time and it frees the old memory when i ve reached an amount of memory when i write the function FIFO_free_memory with the line "llOwnerSay("free called");" commented , the script reaches a stack heap error collision when i write the function FIFO_free_memory with the line "llOwnerSay("free called");" uncommented , the script runs until i stop it in touching a second time list l ; // it s my FIFO list , i will add some elements on it .. and when i reach too much memory , i will delete the first elements inputed integer i =0; // a counter to know how many allocations i have done integer start; // a boolean to start and stop the script // Function to free the memory list FIFO_free_memory(list l) { // i am allocating 7 per 7 elements each time . So i m deleteing the 7 firsts elements //llOwnerSay("free called"); return llDeleteSubList(l, 0, 6) ; } list FIFO_add_memory( list l) { // i add 7 elements ( the firsts are just to make grow teh memory faster . The counter at the end will inform me which element i ve reached return l + [ llGetKey(), llGetOwner(),llGetKey(), llGetOwner(), llGetKey(), llGetOwner(), i++ ]; } default { state_entry() { // initialize start start = TRUE; } touch_start(integer total_number) { // the first time i touch the prim i run the timer // the second time i stop the script and restart it to be sure to have not clean memory between two runs if (start) { start = FALSE ; llSetTimerEvent(0.25); } else llResetScript(); } timer() { // i display the memory used and the top of the stack llOwnerSay("Timer Memory used =" + (string)llGetUsedMemory() + " SP="+(string)llGetFreeMemory() ); // if i ve used more 40kbytes , i start to desallocate before to allocate if ( llGetUsedMemory() > 40000 ) { l = FIFO_free_memory(l); // i display number elements in the list the 1st value of the counter and the last value of the counter llOwnerSay("Number elements =" + (string)llGetListLength(l)+ " 1st=" + llList2String(l,6) + " last="+llList2String(l,-1) ); } l = FIFO_add_memory(l); } } When the script runs without stack heap error collision , it displays ... ... [18:43] Object: Timer Memory used =37792 SP=27744 [18:43] Object: Timer Memory used =38420 SP=27116 [18:43] Object: Timer Memory used =39048 SP=26488 [18:43] Object: Timer Memory used =39676 SP=25860 [18:43] Object: Timer Memory used =40304 SP=25232 [18:43] Object: free called [18:43] Object: Number elements =364 1st=1 last=52 [18:43] Object: Timer Memory used =40352 SP=25232 [18:43] Object: free called [18:43] Object: Number elements =364 1st=2 last=53 [18:43] Object: Timer Memory used =40304 SP=25232 [18:43] Object: free called [18:43] Object: Number elements =364 1st=3 last=54 [18:43] Object: Timer Memory used =40304 SP=25232 [18:43] Object: free called [18:43] Object: Number elements =364 1st=4 last=55 [18:43] Object: Timer Memory used =40304 SP=25232 [18:43] Object: free called [18:43] Object: Number elements =364 1st=5 last=56 [18:43] Object: Timer Memory used =40304 SP=25232 [18:43] Object: free called ... ... and so on , it continues without break When it s stopped by a stack heap error collision i ve displayed [18:47] Object: Timer Memory used =37164 SP=28372 [18:47] Object: Timer Memory used =37792 SP=27744 [18:47] Object: Timer Memory used =38420 SP=27116 [18:47] Object: Timer Memory used =39048 SP=26488 [18:47] Object: Timer Memory used =39676 SP=25860 [18:47] Object: Timer Memory used =40304 SP=25232 [18:47] Object: Number elements =364 1st=1 last=52 [18:47] Object: Timer Memory used =40352 SP=25232 and one stack heap error collisiion there
  7. So, use the preprocessor of your C compiler . There exists a C preprocessor/compiler in every architectures even not-AMD/Intel
  8. Ugly and probably useless The better way is to use the preprocessor of some alternative viewers to develop. For the final distribution to the customers , the code preprocessed can be generated to work in any viewer. To add the optimiser will remove the functions declared but not called . It s a thing impossible to do with the ugly trick in the precedent posts The description of preprocessor is here http://wiki.secondlife.com/w/index.php?title=User:Toy_Wylie/Phoenix/Preprocessor&diff=1033262&oldid=prev chapter 5 Including files has one disadvantage though. You will get the complete contents of the file, if you need it or not. But the Phoenix LSL Preprocessor uses an optimizing technique, which only keeps the things you really used in your code and removes all global functions and variables you didn't reference in your script. This makes sure that your scripts don't get burdened with a lot of unused code. You can enable or disable this functionality in the script editor's "Advanced" menu.
×
×
  • Create New...