javascript - MySQL query, PHP, infinite text and memory optimisation? -


i working on artistic project event. we're using a.i learning custom datasets made 2 pesonal libraries , we're using output sending data (generated texts) on mysql database , function datas, organized id, database when changes occurs. want set web publishing a.i perform writing happening during exhibition - write x words every x hours - hence why fancy design important. result used paper publishing.

i'm using generated text testing our wip website i'm experiencing memory issue. after awhile, page slowing down computer, , happen on low end configuration. there way optimise ?

here's test website : http://82.223.18.239/

and here's actual code :

<html xmlns="http://www.w3.org/1999/xhtml"       xmlns:fb="http://ogp.me/ns/fb#">                     .,,.    ..                   z$$$$$b c$$$l                ,,$$$$$$$f,,"?$$                .,,,           ,c" z$$$$$$$$",$$$c`f .          ,c$$$$,.          ,$" d$$$$$$p",d$$$$$b'f3$ccc,,cc$$$$$$$$$$$c         4$f 4$$$pf",c$$$?$$$$" $c$$$$$$$$$$$$$$$$$$$".         $pl 4$$zc$'$$pld$$$$$p 3$$$$$$$$$$$$$$$$$$$$$$f         $ l '$$$$p,$$$"" d$$ : ?$$$$$$$$$$$$$$$$$$$$$p          j$l d$p",$$$l,-,$$$b;h $$$$$$$$$$$$$$$$$$$p",c          ?$$.$ '$$$$$$$$$$$$c;f $$$$$$$$$$$$$$$$?5,c$$$          `$$'."?,"l$$$$$$$$ :/,d$$$$$l"$$$$$$$$$$$$$$$"           "$b"$cc,"$$$$$$$$cr,$$$$$$$?b,"?$$$$$$$$$$p"             "?$$$$c`$$$bk""=d$$p??",r= ??$c,."""",,  `l c ,         f?$-"$$f <!'; nnmm",;<!!; ?$$$$$p"  k`b$,f          "";;" <!!' ,mmmm";!!!!' - $$p"   3$fb$    =nnnnd>`',;!!>',nmmmm ;!!!!><$$c,    "$ $   <>"mmmmmn'''' ,nmmmm  <!!!!! d$$$$$c,     $c"    `-,`tc)mmmmmmmmmmmm >`!!!!!;,"?$$$$$bc    ,$$    ,cb,`<, )mmmmmmmmmmm !;,````     ""c3$$$,    $$$f ,c$$$$p'<> )l.,cc,,"tme`!!!!!!   ,c$$$$$$$$p   <$$$$ $$$$f  ``   b,`c77?9hcc,,,,,ccd$$$$$$pf""   3$$$$ $$p"        `4n,"""""""""""??""".,,,       .,,xn,,.   4$$$$cp"            `"4mmmmmmmp",==~",;;,.  -=mmmmmmmmmmm=    $$p"                    ""_r='".df:!!!!!!!!!;, """"~=<    `                      ,xp" xmmmmm <!!!!!!!!!!!>                      _,em"",dfjmmmmmmm.`!!!!!!!!!!!!;                   ,nmmp",dmmmlmmmmmmmmme`!!!!!!!!!!!!>               ,emmmmp",mmmmmmmmmmmmmmmmme`!!!!!!!!!!!!>             emmmmmm",dmmmmmmmmmmmmmmmmmmmr`!!!!!!!!!!!!          ,dmmmmmmp',mmmmmmmmmmmmmmmmmmmmmm !!!!!!!!!!!!!        ,dmmmmmmmp dmmmmmmmmmmmmmmmmmmmmmmm !!!!!!!!!!!!!      ,mmmmmmmmm" dmmmmmmmmmmmmmmmmmmmmmmmm !!!!!!!!!!!>!    emmmmmmmmmmp mmmmmmmmmmmmmmmmmmmmmmmmmp !!!!!!!!!!!;!  emmmmmmmmmmmm dmmmmmmmmmmmmmmmmmmmmmmmmm ;!!!!!!!!!' !' "4mmmmmmmmmmm'ummmmmmmmmmmmmmmmmmmmmmmmm> !!!!!!!!!',!! ;!> ;,"mmmmm>;mmmmmmmmmmmmmmmmmmmmmmmmmm <!!!!!!!' ,!!' !! <!!>,"4mm ,c ;;;;,.""tmmmmmmmmmmmmmm>;!!!!!!' ,!!', ! <!!!!!!:." " <!!!!!!!!!:.""4mmmmmmmmm !!!!!! ,!!! ;!!,           . 4,  <!!!!!!!!!!! <!!!!!!!!!!!!!!:..""""tt";!!!! ,<!!!  !!!!>     .,zc$$$c", ;!!!!!!!!!!!';!!!!!!!!!!!!!!!!!!!!!!!!:!!! ,!!!!! ;>'!!!!!>"$$$$$p???l ", !!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!'',!!!!!! ;!!> <!!!!>"$$"      ?p`b !!!!!!!!!!! ,`'''!!!!!!!!!!!!!!!!!!!!',<!!!!!!!> !!!!> !!!!! ?         -$e !!!!!!!!!!! <<',;;,``<!!!!!!!!!!!!!(;!!!!!!!!!!  !!!!! `!!!!! `<!!!!!!!!!!> '``!!!>;`'!!!!!!!!!!!!!!!!!!!!!!!  !!!!!>'''`    ``'''''!! `'dc,,zcc`;,``'!!!!!!!!!!!!!!!!!!!> !!!!!'               ,$$$$$$$b`<!>;, ``''!!!!!!!!!!!!!> ```              ,$$$$$$$$$f   ````       ```````             ,$$$$$$$$"             $$$$$$p"           ,$$$$$p"          ,$$$$" "$c-, , '$$$f  "$$c?,%,4$f   `?$c"c'4"      4c`b        "   <head>  <title>i city of habits</title> <meta name="description" content="✊🏻✊✊🏼✊✊🏽✊✊🏾✊✊🏿✊✊🏻✊✊🏼✊✊✊🏻✊✊🏼✊✊🏽✊✊🏾"> <meta name="keywords" content="text, machine happening, art, artist, mathieu, mathieu arbez, mathieu hermoso, hermoso, ceel mogami de haas, mogami, de haas, ceel mogami, avital ronell, ronell, robert ashley, perfect lives, electric speech, visual art, books"> <meta property="og:image" content="http://82.223.18.239/2.jpg" /> <meta property="og:site_name" content="i city of habits" /> <meta property="og:locale" content="en_us" /> <meta name="twitter:card" content="summary" /> <meta name="twitter:title" content="i city of habits"> <meta name="twitter:url" content="http://82.223.18.239"> <meta name="twitter:description" content="✊🏻✊✊🏼✊✊🏽✊✊🏾✊✊🏿✊✊🏻✊✊🏼✊✊✊🏻✊✊🏼✊✊🏽✊✊🏾"> <meta name="twitter:image" content="http://82.223.18.239/2.jpg">     <div id="header"></div>    <div id="body"></div>    <div id="footer"></div>    <div id="mytable"> <div>     <script type = "text/javascript" src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>      <style type="text/css">           #mytable{             width:"90%";               height:"100%";            min-width:250px;            white-space: pre-wrap;            word-wrap:break-word;            position:absolute;            border:solid 0px;            top:-500px;            left:320px;            right:320px;            margin-right:-14p;            bottom:0px;            font-size:103px;            font-family:"times new roman", times, serif;            text-align:left                   }           #body{             width:"90%";             height:"100%";              }           #footer{             height:"0px";                }            ::-webkit-scrollbar {display: none;}       </style>   </head>  <body>    <mytable>      <script type="text/javascript">           var skip = 0;         function get_data(index) {             $.ajax({                 url : 'http://82.223.18.239/getdata.php',                 type : 'post',                 data: ({"skip":skip}),                 success : function(data) {                      if(data && data.trim()!='') {                         skip = skip+1;                         showtext("#mytable", data, 0, 20);                     }                     else {                         settimeout(function () { get_data(skip); }, 30000);                     }                 },                 error : function(request,error)                 {                     alert("request error : "+json.stringify(request));                 }              });         }          function showtext(target, message, index, interval) {                if (index < message.length) {                 $(target).append(message[index++]);                 settimeout(function () { showtext(target, message, index, interval); }, interval);                  $('#mytable').css('overflow', 'hidden').bind('domnodeinserted', function () {                 this.scrolltop = this.scrollheight;                                                                                            });                                           }             else if (navigator.useragent.tolowercase().indexof('firefox') > -1){                 get_data(skip);                 $('#mytable').css('overflow', 'hidden')                  }              else if (/msie 9/i.test(navigator.useragent) || /rv:11.0/i.test(navigator.useragent)){                 get_data(skip);                 $('#mytable').css('overflow', 'hidden').css('-ms-overflow-style', 'none')                  }              else if (/msie 10/i.test(navigator.useragent)){                 get_data(skip);                 $('#mytable').css('overflow', 'hidden').css('-ms-overflow-style', 'none')                  }              else if (/edge\/\d./i.test(navigator.useragent)){                 get_data(skip);                 $('#mytable').css('overflow', 'hidden').css('-ms-overflow-style', 'none')                  }                  else {                     get_data(skip);                     $('#mytable').css('overflow', 'scroll')                 }         }          //var period = 10000; //note: period passed in milliseconds         get_data(skip);         //setinterval(page_refresh, period);           </script>      </mytable> </body>  <footer>      <script language="javascript">     var message = new array();     message[0] = ""     var reps = 2;     var speed = 666;      var p = message.length;     var t = "";     var c = 0;     var mc = 0;     var s = 0;     var st = null;     if (reps < 1) reps = 1;     function doit() {     t = message[mc];     a();     }     function a() {     s++;     if (s > 8) { s = 1;}     if (s == 1) { document.title = '✊🏻✊✊🏼✊✊🏽✊✊🏾✊✊🏿✊✊🏻✊✊🏼✊✊✊🏻✊✊🏼✊✊🏽✊✊🏾'+t+'✊🏻✊✊🏼✊✊🏽✊✊🏾✊✊🏿✊✊🏻✊✊🏼✊✊🏽✊✊🏾✊✊'; }     if (s == 2) { document.title = '☠️☠️☠️☠️☠️☠️☠️☠️☠️☠️☠️☠️☠️☠️☠️☠️☠'+t+'☠️☠️☠️☠️☠️☠️☠️☠️☠️☠️☠️☠️☠️☠️☠️☠️☠️☠️'; }     if (s == 3) { document.title = '🌍🌎🌍🌎🌍🌎🌏🌍🌎🌍🌎🌍🌎🌏🌍🌎🌍🌎🌍🌎🌏'+t+'✊🏻✊✊🏼✊✊🏽✊✊🏾✊✊🏿✊✊🏻✊✊🏼✊✊'; }     if (s == 4) { document.title = '✊🏻✊✊🏼✊✊🏽✊✊🏾✊✊🏿✊✊🏻✊✊🏼✊✊🏽✊✊🏾✊✊'+t+'⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔'; }     if (s == 5) { document.title = 'πŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”Œ'+t+'πŸ› πŸ› πŸ› πŸ› πŸ› πŸ› πŸ› πŸ› πŸ› πŸ› πŸ› πŸ› πŸ› πŸ› πŸ› πŸ› πŸ› πŸ› πŸ› πŸ› '; }     if (s == 6) { document.title = 'πŸ’£πŸ’£πŸ’£πŸ’£πŸ’£πŸ’£πŸ’£πŸ’£πŸ’£πŸ’£πŸ’£πŸ’£πŸ’£πŸ’£πŸ’£πŸ’£πŸ’£πŸ’£πŸ’£πŸ’£'+t+'πŸ––πŸ––πŸΏπŸ––πŸ––πŸΌπŸ––πŸΎπŸ––πŸΌπŸ––πŸΏπŸ––πŸ––πŸΌπŸ––πŸΎπŸ––πŸ––πŸΏπŸ––πŸ––πŸΌπŸ––πŸΎπŸ––πŸΌ'; }     if (s == 7) { document.title = 'πŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”Œ'+t+'πŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”ŒπŸ”Œ'; }     if (s == 8) { document.title = '✊🏻✊✊🏼✊✊🏽✊✊🏾✊✊🏿✊✊🏻✊✊🏼✊✊🏽✊✊🏾✊✊🏿'+t+'⏳⏳⏳⏳⏳⏳⏳⏳⏳⏳⏳⏳⏳⏳⏳⏳⏳⏳⏳⏳⏳'; }if (c < (8 * reps)) {     st = settimeout("a()", speed);     c++;     }     else {     c = 0;     s = 0;     mc++;     if(mc > p - 1) mc = 0;     st = null;     doit();        }     }     doit();      (function() {       var template = '✊☔☁☁☁☠⛔☁☁☁⏳☔⚠☁☁⛔⏳☠☁☁☁☁☁πŸ’£✊🏾'.split(''),         len = template.length,         chars, string, i, j, k,         pushorhash = typeof window.history.pushstate === 'function',        increase = function(n) {         return n < len - 1 ? n + 1 : 0;       },        update = function() {         chars = [];         j = k;          (i=0; i<len; i++) {           j = increase(j);           chars[i] = template[j];         }          string = ['/', chars.join(''), '/'].join('');         k = increase(k);          if (pushorhash) {           window.history.pushstate(null, null, string);         } else {           window.document.location.hash = string;         }          settimeout(update, 1000);       };        update();     })();     </script>      </script>          <script type="text/javascript">          function pageload()         {          alert('how you, hello, take role9̿');          }          pageload();       </script>    </footer> 

and functions datas , show text

function get_data(index) {             $.ajax({                 url : 'http://82.223.18.239/getdata.php',                 type : 'post',                 data: ({"skip":skip}),                 success : function(data) {                      if(data && data.trim()!='') {                         skip = skip+1;                         showtext("#mytable", data, 0, 20);                     }                     else {                         settimeout(function () { get_data(skip); }, 30000);                     }                 },                 error : function(request,error)                 {                     alert("request error : "+json.stringify(request));                 }              });         }          function showtext(target, message, index, interval) {                if (index < message.length) {                 $(target).append(message[index++]);                 settimeout(function () { showtext(target, message, index, interval); }, interval);                  $('#mytable').css('overflow', 'hidden').bind('domnodeinserted', function () {                 this.scrolltop = this.scrollheight;                                                                                            });                                           }             else if (navigator.useragent.tolowercase().indexof('firefox') > -1){                 get_data(skip);                 $('#mytable').css('overflow', 'hidden')                  }              else if (/msie 9/i.test(navigator.useragent) || /rv:11.0/i.test(navigator.useragent)){                 get_data(skip);                 $('#mytable').css('overflow', 'hidden').css('-ms-overflow-style', 'none')                  }              else if (/msie 10/i.test(navigator.useragent)){                 get_data(skip);                 $('#mytable').css('overflow', 'hidden').css('-ms-overflow-style', 'none')                  }              else if (/edge\/\d./i.test(navigator.useragent)){                 get_data(skip);                 $('#mytable').css('overflow', 'hidden').css('-ms-overflow-style', 'none')                  }                  else {                     get_data(skip);                     $('#mytable').css('overflow', 'scroll')                 }         } 


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -