{"id":278,"date":"2025-08-22T09:49:07","date_gmt":"2025-08-22T09:49:07","guid":{"rendered":"https:\/\/bioskinetics.com.au\/?page_id=278"},"modified":"2025-09-27T09:21:44","modified_gmt":"2025-09-27T09:21:44","slug":"defragtracker","status":"publish","type":"page","link":"https:\/\/bioskinetics.com.au\/?page_id=278","title":{"rendered":"Global Hard Drive Defrag Tracker"},"content":{"rendered":"\n<!-- Global Hard Drive Defrag Tracker \u2014 Street Map + OS Legend (no external JS libs) -->\n<iframe\n  title=\"Global Hard Drive Defrag Tracker\"\n  sandbox=\"allow-scripts allow-same-origin allow-popups allow-forms\"\n  style=\"width:100%;max-width:1280px;height:1680px;border:0;border-radius:16px;display:block;margin:0 auto;\"\n  srcdoc='\n<!DOCTYPE html><html lang=\"en\"><head>\n<meta charset=\"utf-8\"\/><meta name=\"viewport\" content=\"width=device-width,initial-scale=1\"\/>\n<title>Global Hard Drive Defrag Tracker \u2014 Street Map<\/title>\n<style>\n  :root{--bg:#0b1020;--card:#141a2f;--ink:#eaf1ff;--muted:#9bb0d1;--good:#22c55e;--warn:#f59e0b;--bad:#ef4444}\n  *{box-sizing:border-box} body{margin:0;font-family:system-ui,Segoe UI,Inter,Roboto,Arial;background:#0b1020;color:var(--ink)}\n  header{text-align:center;padding:28px 16px 10px}\n  h1{margin:0 0 6px;font-size:clamp(26px,4.8vw,42px)} p.sub{margin:0;color:var(--muted)}\n  .wrap{max-width:1280px;margin:0 auto;padding:16px}\n  .grid{display:grid;gap:16px;grid-template-columns:1.25fr .95fr} @media (max-width:1020px){.grid{grid-template-columns:1fr}}\n  .card{background:linear-gradient(180deg,#182045,#121733);border:1px solid #283159;border-radius:16px;overflow:hidden;box-shadow:0 14px 40px rgba(0,0,0,.35)}\n  .card h2{margin:0;padding:14px 16px;border-bottom:1px solid #283159;font-size:18px}\n  .card .body{padding:16px}\n  \/* MAP *\/\n  #mapWrap{position:relative;height:560px;min-height:420px}\n  #tilePane{position:absolute;inset:0;overflow:hidden;background:#0a1025}\n  #overlay{position:absolute;inset:0;display:block;pointer-events:none}\n  #attrib{position:absolute;right:8px;bottom:6px;font:12px\/1.2 system-ui,Segoe UI,Inter,Roboto,Arial;color:#b8c5e0;background:rgba(10,16,37,.7);padding:4px 6px;border-radius:6px;border:1px solid #24305a}\n  #attrib a{color:#cfe4ff;text-decoration:none}\n  .row{display:flex;gap:10px;flex-wrap:wrap;align-items:center}\n  .btn{display:inline-flex;align-items:center;gap:8px;padding:10px 14px;border-radius:12px;border:1px solid #2b3a6b;background:#0f1538;color:#eaf1ff;cursor:pointer}\n  .legend{display:flex;gap:8px;align-items:center;font-size:12px;color:#9bb0d1}\n  .badge{padding:2px 8px;border-radius:999px;border:1px solid #24305a;background:#10163a}\n  .stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}\n  .stat{padding:12px;border:1px solid #283159;background:#10163a;border-radius:12px;text-align:center}\n  .stat .k{font-size:22px;font-weight:700}\n  .scroll{max-height:410px;overflow:auto;border-radius:12px}\n  table{width:100%;border-collapse:collapse;font-size:14px}\n  th,td{border-bottom:1px solid #283159;padding:8px 6px;text-align:left;white-space:nowrap}\n  th.sticky{position:sticky;top:0;background:#151b3a;z-index:1}\n  canvas.chart{display:block;width:100%;height:220px}\n\n  \/* OS pie legend *\/\n  .legend-key{\n    display:flex; gap:10px; flex-wrap:wrap; margin-top:6px;\n    font-size:12px; color:#cfe4ff; align-items:center\n  }\n  .legend-key .item{\n    display:inline-flex; align-items:center; gap:6px;\n    padding:4px 6px; border:1px solid #283159; background:#10163a; border-radius:8px\n  }\n  .legend-key .swatch{ width:10px; height:10px; border-radius:2px; display:inline-block }\n<\/style>\n<\/head><body>\n<header>\n  <h1>Global Hard Drive Defrag Tracker<\/h1>\n  <p class=\"sub\">World street map (OpenStreetMap tiles) with live simulated activity. Drag to pan, scroll to zoom.<\/p>\n<\/header>\n\n<div class=\"wrap\"><div class=\"grid\">\n  <!-- MAP -->\n  <section class=\"card\">\n    <h2>Live Defrag Map<\/h2>\n    <div class=\"body\">\n      <div id=\"mapWrap\">\n        <div id=\"tilePane\"><\/div>\n        <canvas id=\"overlay\"><\/canvas>\n        <div id=\"attrib\">\u00a9 <a href=\"https:\/\/www.openstreetmap.org\/copyright\" target=\"_blank\" rel=\"noopener\">OpenStreetMap<\/a> contributors<\/div>\n      <\/div>\n      <div class=\"row\" style=\"margin-top:10px;justify-content:space-between\">\n        <div class=\"legend\"><span class=\"badge\">Dots<\/span><span>Green: running \u00b7 Gold: paused \u00b7 Red: completed<\/span><\/div>\n        <div class=\"row\">\n          <button class=\"btn\" id=\"btnRefresh\" type=\"button\">Refresh<\/button>\n          <button class=\"btn\" id=\"btnLocate\" type=\"button\">My Area<\/button>\n        <\/div>\n      <\/div>\n    <\/div>\n  <\/section>\n\n  <!-- GLOBAL STATS -->\n  <section class=\"card\">\n    <h2>Global Snapshot<\/h2>\n    <div class=\"body\">\n      <div class=\"stats\">\n        <div class=\"stat\"><div class=\"k\" id=\"kSessions\">\u2013<\/div><div class=\"muted\">Active Sessions<\/div><\/div>\n        <div class=\"stat\"><div class=\"k\" id=\"kDriveSize\">\u2013<\/div><div class=\"muted\">Combined Drive Size<\/div><\/div>\n        <div class=\"stat\"><div class=\"k\" id=\"kTodayDefragged\">\u2013<\/div><div class=\"muted\">Defragmented Today<\/div><\/div>\n        <div class=\"stat\"><div class=\"k\" id=\"kAvgCompletion\">\u2013<\/div><div class=\"muted\">Avg Completion<\/div><\/div>\n      <\/div>\n      <div style=\"margin-top:12px\"><canvas id=\"trend24h\" class=\"chart\"><\/canvas>\n        <p class=\"muted\" style=\"font-size:12px\">Simulated timeline; updates frequently.<\/p><\/div>\n    <\/div>\n  <\/section>\n\n  <!-- LEADERBOARD -->\n  <section class=\"card\">\n    <h2>Leaderboard \u2014 Top Countries<\/h2>\n    <div class=\"body\"><div class=\"scroll\">\n      <table id=\"leaderTable\"><thead><tr>\n        <th class=\"sticky\">Country<\/th><th class=\"sticky\">Active<\/th><th class=\"sticky\">Total Drive Size<\/th><th class=\"sticky\">Avg %<\/th><th class=\"sticky\">ETA (country)<\/th>\n      <\/tr><\/thead><tbody><\/tbody><\/table>\n    <\/div><\/div>\n  <\/section>\n\n  <!-- COUNTRY PANEL -->\n  <section class=\"card\">\n    <h2>Country Panel \u2014 Live<\/h2>\n    <div class=\"body\">\n      <div class=\"row\" style=\"gap:8px;margin-bottom:8px\">\n        <span class=\"badge\" id=\"cpName\">\u2013<\/span>\n        <span class=\"badge\">Active: <b id=\"cpActive\">\u2013<\/b><\/span>\n        <span class=\"badge\">Avg %: <b id=\"cpAvgPct\">\u2013<\/b><\/span>\n        <span class=\"badge\">ETA: <b id=\"cpETA\">\u2013<\/b><\/span>\n        <span class=\"badge\">Combined: <b id=\"cpCombined\">\u2013<\/b><\/span>\n        <span class=\"badge\">Density: <b id=\"cpDensity\">\u2013<\/b><\/span>\n      <\/div>\n      <div class=\"row\" style=\"gap:16px;align-items:flex-start\">\n        <div style=\"flex:1;min-width:260px\"><canvas id=\"cpLine\" class=\"chart\"><\/canvas><p class=\"muted\" style=\"font-size:12px\">Avg progress over time<\/p><\/div>\n        <div style=\"flex:1;min-width:220px\"><canvas id=\"cpHist\" class=\"chart\"><\/canvas><p class=\"muted\" style=\"font-size:12px\">Speed distribution (MB\/s)<\/p><\/div>\n        <div style=\"flex:0.8;min-width:200px\">\n          <canvas id=\"cpPie\" class=\"chart\"><\/canvas>\n          <!-- OS Share legend -->\n          <div id=\"osLegend\" class=\"legend-key\" aria-label=\"OS Share Legend\">\n            <span class=\"item\"><span class=\"swatch\" style=\"background:#3b82f6\"><\/span>Windows<\/span>\n            <span class=\"item\"><span class=\"swatch\" style=\"background:#22c55e\"><\/span>Linux<\/span>\n            <span class=\"item\"><span class=\"swatch\" style=\"background:#f59e0b\"><\/span>macOS<\/span>\n          <\/div>\n          <p class=\"muted\" style=\"font-size:12px;margin-top:6px\">OS share across active sessions<\/p>\n        <\/div>\n      <\/div>\n    <\/div>\n  <\/section>\n<\/div><\/div>\n\n<script>\n\/* ===== Utilities ===== *\/\nconst $=id=>document.getElementById(id), clamp=(n,a,b)=>Math.max(a,Math.min(b,n)), rand=(a,b)=>Math.random()*(b-a)+a;\nconst fmtETA=m=>m<90?Math.max(1,Math.round(m))+\" min\":(m\/60).toFixed(1)+\" h\", fmtTB=x=>x>=1024?(x\/1024).toFixed(1)+\" PB\":x.toFixed(1)+\" TB\", fmtPB=x=>x>=1024?(x\/1024).toFixed(1)+\" EB\":x.toFixed(1)+\" PB\";\n\n\/* ===== Minimal Slippy Map (OSM raster tiles) ===== *\/\nclass MiniOSM {\n  constructor(el){\n    this.wrap=el;\n    this.pane=el.querySelector(\"#tilePane\");\n    this.overlay=el.querySelector(\"#overlay\");\n    this.ctx=this.overlay.getContext(\"2d\");\n    this.w=this.h=0;\n    this.tileSize=256;\n    this.zoom=3;                    \/\/ integer zoom (2..18)\n    this.center=[20,0];             \/\/ [lat, lon]\n    this.drag=false; this.lx=0; this.ly=0;\n    this.tiles=new Map();           \/\/ key => <img>\n    this._bind();\n    this.resize();\n    this.renderTiles();\n  }\n  osmURL(z,x,y){ const sub=\"abc\"[(x+y)%3]; return \"https:\/\/\"+sub+\".tile.openstreetmap.org\/\"+z+\"\/\"+x+\"\/\"+y+\".png\"; }\n  latLonToPoint(lat, lon, z){\n    const ts=this.tileSize, n=Math.pow(2,z);\n    const x=(lon+180)\/360*n*ts;\n    const latRad=lat*Math.PI\/180;\n    const y=(1 - Math.log(Math.tan(latRad)+1\/Math.cos(latRad))\/Math.PI)\/2 * n * ts;\n    return [x,y];\n  }\n  pointToLatLon(x,y,z){\n    const ts=this.tileSize, n=Math.pow(2,z);\n    const lon = x\/(ts*n)*360 - 180;\n    const yy = Math.PI * (1 - 2*y\/(ts*n));\n    const lat = (180\/Math.PI) * Math.atan(0.5*(Math.exp(yy)-Math.exp(-yy)));\n    return [lat, lon];\n  }\n  centerPx(){ return this.latLonToPoint(this.center[0], this.center[1], this.zoom); }\n  resize(){\n    const dpr=window.devicePixelRatio||1;\n    const r=this.wrap.getBoundingClientRect();\n    this.w=r.width; this.h=r.height;\n    this.overlay.width=this.w*dpr; this.overlay.height=this.h*dpr;\n    this.ctx.setTransform(dpr,0,0,dpr,0,0);\n    this.renderTiles();\n  }\n  renderTiles(){\n    const [cx,cy]=this.centerPx();\n    const left=cx - this.w\/2, top=cy - this.h\/2;\n    const ts=this.tileSize, z=this.zoom, n=Math.pow(2,z);\n    const xStart=Math.floor(left\/ts), xEnd=Math.floor((left+this.w)\/ts);\n    const yStart=Math.floor(top\/ts),  yEnd=Math.floor((top+this.h)\/ts);\n    const need=new Set();\n\n    for(let ty=yStart; ty<=yEnd; ty++){\n      if(ty<0 || ty>=n) continue;\n      for(let tx=xStart; tx<=xEnd; tx++){\n        let x = ((tx % n)+n)%n; \/\/ wrap X\n        const key=z+\"\/\"+x+\"\/\"+ty;\n        need.add(key);\n        let img=this.tiles.get(key);\n        if(!img){\n          img=new Image();\n          img.decoding=\"async\";\n          img.referrerPolicy=\"no-referrer\";\n          img.src=this.osmURL(z,x,ty);\n          this.tiles.set(key,img);\n        }\n        const px=tx*ts - left;\n        const py=ty*ts - top;\n        img.style.position=\"absolute\";\n        img.style.left=px+\"px\";\n        img.style.top=py+\"px\";\n        img.style.width=ts+\"px\";\n        img.style.height=ts+\"px\";\n        if(!img.parentNode) this.pane.appendChild(img);\n      }\n    }\n    \/\/ prune\n    [...this.tiles.keys()].forEach(k=>{\n      if(!need.has(k)){\n        const img=this.tiles.get(k);\n        if(img && img.parentNode) this.pane.removeChild(img);\n        this.tiles.delete(k);\n      }\n    });\n  }\n  drawDots(points){\n    const ctx=this.ctx;\n    ctx.clearRect(0,0,this.w,this.h);\n    const [cx,cy]=this.centerPx();\n    const left=cx - this.w\/2, top=cy - this.h\/2;\n    \/\/ glow\n    for(const p of points){\n      const [xw,yw]=this.latLonToPoint(p.lat, p.lng, this.zoom);\n      const x=xw-left, y=yw-top;\n      const col=p.status===\"Running\"?\"#22c55e\":p.status===\"Paused\"?\"#f59e0b\":\"#ef4444\";\n      const g=ctx.createRadialGradient(x,y,0,x,y,12); g.addColorStop(0,col+\"80\"); g.addColorStop(1,\"rgba(0,0,0,0)\");\n      ctx.fillStyle=g; ctx.beginPath(); ctx.arc(x,y,12,0,Math.PI*2); ctx.fill();\n    }\n    \/\/ dots\n    for(const p of points){\n      const [xw,yw]=this.latLonToPoint(p.lat, p.lng, this.zoom);\n      const x=xw-left, y=yw-top;\n      ctx.fillStyle=p.status===\"Running\"?\"#22c55e\":p.status===\"Paused\"?\"#f59e0b\":\"#ef4444\";\n      ctx.beginPath(); ctx.arc(x,y,3,0,Math.PI*2); ctx.fill();\n    }\n  }\n  _bind(){\n    \/\/ drag\n    this.wrap.addEventListener(\"mousedown\",e=>{this.drag=true; this.lx=e.clientX; this.ly=e.clientY;});\n    addEventListener(\"mouseup\",()=>this.drag=false);\n    addEventListener(\"mousemove\",e=>{\n      if(!this.drag) return;\n      const dx=e.clientX-this.lx, dy=e.clientY-this.ly;\n      this.lx=e.clientX; this.ly=e.clientY;\n      const [cx,cy]=this.centerPx();\n      const newCx=cx - dx, newCy=cy - dy;               \/\/ move map with drag\n      const ll=this.pointToLatLon(newCx, newCy, this.zoom);\n      this.center=[ll[0], ll[1]];\n      this.renderTiles(); this.drawDots(window.SESS||[]);\n    });\n    \/\/ zoom\n    this.wrap.addEventListener(\"wheel\",e=>{\n      e.preventDefault();\n      const dir = e.deltaY>0 ? -1 : 1;\n      const newZ = clamp(this.zoom + dir, 2, 18);\n      if(newZ===this.zoom) return;\n      const rect=this.wrap.getBoundingClientRect();\n      const px=e.clientX-rect.left, py=e.clientY-rect.top;\n      const [cx,cy]=this.centerPx();\n      const worldX = (cx - this.w\/2) + px;\n      const worldY = (cy - this.h\/2) + py;\n      const [lat,lon]=this.pointToLatLon(worldX, worldY, this.zoom);\n      this.zoom = newZ;\n      const [nx,ny]=this.latLonToPoint(lat,lon,this.zoom);\n      const left = nx - px, top = ny - py;\n      const centerX = left + this.w\/2, centerY = top + this.h\/2;\n      const ll2=this.pointToLatLon(centerX, centerY, this.zoom);\n      this.center=[ll2[0], ll2[1]];\n      this.renderTiles(); this.drawDots(window.SESS||[]);\n    }, {passive:false});\n    \/\/ resize\n    addEventListener(\"resize\", ()=>{ this.resize(); this.drawDots(window.SESS||[]); });\n  }\n}\n\n\/* ===== Simulated data ===== *\/\nconst CITIES=[\n{city:\"New York\",country:\"United States\",lat:40.7128,lng:-74.006,pop:18900000},\n{city:\"Los Angeles\",country:\"United States\",lat:34.0522,lng:-118.2437,pop:12500000},\n{city:\"Chicago\",country:\"United States\",lat:41.8781,lng:-87.6298,pop:9150000},\n{city:\"Mexico City\",country:\"Mexico\",lat:19.4326,lng:-99.1332,pop:21500000},\n{city:\"S\u00e3o Paulo\",country:\"Brazil\",lat:-23.5505,lng:-46.6333,pop:22000000},\n{city:\"Buenos Aires\",country:\"Argentina\",lat:-34.6037,lng:-58.3816,pop:15000000},\n{city:\"Toronto\",country:\"Canada\",lat:43.65107,lng:-79.347015,pop:6500000},\n{city:\"Bogot\u00e1\",country:\"Colombia\",lat:4.711,lng:-74.0721,pop:10000000},\n{city:\"London\",country:\"United Kingdom\",lat:51.5072,lng:-0.1276,pop:14900000},\n{city:\"Paris\",country:\"France\",lat:48.8566,lng:2.3522,pop:11000000},\n{city:\"Berlin\",country:\"Germany\",lat:52.52,lng:13.405,pop:6000000},\n{city:\"Madrid\",country:\"Spain\",lat:40.4168,lng:-3.7038,pop:6500000},\n{city:\"Rome\",country:\"Italy\",lat:41.9028,lng:12.4964,pop:4300000},\n{city:\"Istanbul\",country:\"Turkey\",lat:41.0082,lng:28.9784,pop:15500000},\n{city:\"Cairo\",country:\"Egypt\",lat:30.0444,lng:31.2357,pop:20000000},\n{city:\"Lagos\",country:\"Nigeria\",lat:6.5244,lng:3.3792,pop:15000000},\n{city:\"Johannesburg\",country:\"South Africa\",lat:-26.2041,lng:28.0473,pop:5500000},\n{city:\"Riyadh\",country:\"Saudi Arabia\",lat:24.7136,lng:46.6753,pop:7500000},\n{city:\"Dubai\",country:\"United Arab Emirates\",lat:25.276987,lng:55.296249,pop:3500000},\n{city:\"Tokyo\",country:\"Japan\",lat:35.6762,lng:139.6503,pop:37500000},\n{city:\"Osaka\",country:\"Japan\",lat:34.6937,lng:135.5023,pop:19000000},\n{city:\"Seoul\",country:\"South Korea\",lat:37.5665,lng:126.978,pop:23000000},\n{city:\"Beijing\",country:\"China\",lat:39.9042,lng:116.4074,pop:21000000},\n{city:\"Shanghai\",country:\"China\",lat:31.2304,lng:121.4737,pop:27000000},\n{city:\"Shenzhen\",country:\"China\",lat:22.5431,lng:114.0579,pop:15000000},\n{city:\"Bangkok\",country:\"Thailand\",lat:13.7563,lng:100.5018,pop:10500000},\n{city:\"Delhi\",country:\"India\",lat:28.6139,lng:77.209,pop:32000000},\n{city:\"Mumbai\",country:\"India\",lat:19.076,lng:72.8777,pop:25000000},\n{city:\"Bengaluru\",country:\"India\",lat:12.9716,lng:77.5946,pop:13000000},\n{city:\"Jakarta\",country:\"Indonesia\",lat:-6.2088,lng:106.8456,pop:34000000},\n{city:\"Manila\",country:\"Philippines\",lat:14.5995,lng:120.9842,pop:24000000},\n{city:\"Karachi\",country:\"Pakistan\",lat:24.8607,lng:67.0011,pop:16000000},\n{city:\"Dhaka\",country:\"Bangladesh\",lat:23.8103,lng:90.4125,pop:22000000},\n{city:\"Sydney\",country:\"Australia\",lat:-33.8688,lng:151.2093,pop:5300000},\n{city:\"Melbourne\",country:\"Australia\",lat:-37.8136,lng:144.9631,pop:5300000},\n{city:\"Auckland\",country:\"New Zealand\",lat:-36.8485,lng:174.7633,pop:1700000}\n];\nconst COUNTRIES=[...new Set(CITIES.map(c=>c.country))].map(name=>{const cs=CITIES.filter(c=>c.country===name);const lat=cs.reduce((a,c)=>a+c.lat,0)\/cs.length;const lng=cs.reduce((a,c)=>a+c.lng,0)\/cs.length;const pop=cs.reduce((a,c)=>a+c.pop,0);return{name,lat,lng,pop:Math.max(pop,1_000_000)};});\n\nfunction kmOffset(lat,kmN,kmE){const dLat=kmN\/111.32;const dLng=kmE\/(111.32*Math.cos(lat*Math.PI\/180));return [lat + dLat, dLng];}\nfunction sampleInDiskKm(lat,lng,rKm){const r=rKm*Math.sqrt(Math.random());const t=Math.random()*Math.PI*2;const [la,dLng]=kmOffset(lat,r*Math.sin(t),r*Math.cos(t));return [la,lng + dLng];}\nfunction poissonAround(lat,lng,rKm,minKm,count,tries=40){const pts=[];let a=0;while(pts.length<count&#038;&#038;a<count*tries){a++;const [la,lo]=sampleInDiskKm(lat,lng,rKm);let ok=true;for(const p of pts){const dx=(la-p[0])*111.32,dy=(lo-p[1])*111.32*Math.cos(lat*Math.PI\/180);if(Math.sqrt(dx*dx+dy*dy)<minKm){ok=false;break}}if(ok)pts.push([la,lo]);}return pts;}\nfunction sessionAt(lat,lng,country,force){const os=Math.random()<0.68?\"Windows\":(Math.random()<0.2?\"Linux\":\"macOS\");const st=Math.random()<0.6?\"SSD\":(Math.random()<0.85?\"HDD\":\"Hybrid\");const sizeTB=Math.random()<0.6?rand(0.5,2):Math.random()<0.9?rand(2,8):rand(8,24);const used=rand(35,92);const frag=used\/100*(st===\"HDD\"?1:st===\"Hybrid\"?0.7:0.5);const p0=rand(1,99);const progress=Math.max(1,Math.min(99.9,p0+Math.sin(Date.now()\/2.5e4)*5));let speed=(st===\"SSD\"?rand(120,280):st===\"Hybrid\"?rand(80,160):rand(40,120))*(1-frag*0.2);const workMB=sizeTB*1024*1024*frag*0.25;const minutes=Math.max(0.5,(workMB\/(speed||60))*((100-progress)\/100)\/60);const status=force || (progress>98?(Math.random()<0.4?\"Completed\":\"Running\"):(Math.random()<0.08?\"Paused\":\"Running\"));return{device:Math.random().toString(36).slice(2,8)+\"-\"+Math.random().toString(36).slice(2,8),os,storage:st,sizeTB,usedPct:used,progress:+progress.toFixed(1),speedMBs:Math.round(speed),etaMin:Math.round(minutes*60),status,country,lat,lng};}\nfunction enforceCity(city,s){const r=clamp(10+Math.log10(city.pop\/1e6)*6,10,28),m=clamp(0.9+Math.log10(city.pop\/1e6)*0.5,1.0,2.2);const pts=poissonAround(city.lat,city.lng,r*0.6,m,6);[\"Running\",\"Running\",\"Completed\",\"Completed\",\"Completed\",\"Paused\"].forEach((st,i)=>{const p=pts[i]||sampleInDiskKm(city.lat,city.lng,r*0.6);s.push(sessionAt(p[0],p[1],city.country,st));});return{rKm:r,mKm:m};}\nfunction towns(city){const n=clamp(Math.round(city.pop\/6_000_000),2,6), out=[];for(let i=0;i<n;i++){const R=rand(6,14), a=Math.random()*Math.PI*2;const [la,dLng]=kmOffset(city.lat,R*Math.sin(a),R*Math.cos(a));out.push({lat:la,lng:city.lng+dLng,country:city.country});}return out;}\nfunction enforceTown(t,s){const pts=poissonAround(t.lat,t.lng,3.5,0.7,3);[\"Running\",\"Completed\",\"Paused\"].forEach((st,i)=>{const p=pts[i]||sampleInDiskKm(t.lat,t.lng,3.5);s.push(sessionAt(p[0],p[1],t.country,st));});}\nfunction genSessions(){const s=[];for(const c of CITIES){const cfg=enforceCity(c,s);towns(c).forEach(t=>enforceTown(t,s));const extra=clamp(Math.round(c.pop\/1_300_000),10,90);poissonAround(c.lat,c.lng,cfg.rKm,cfg.mKm,extra).forEach(p=>s.push(sessionAt(p[0],p[1],c.country)));}return s;}\nfunction aggregateByCountry(s){const m=new Map();for(const x of s){if(!m.has(x.country))m.set(x.country,{country:x.country,active:0,combinedTB:0,progressSum:0,etaWeighted:0,os:{Windows:0,Linux:0,macOS:0},speeds:[],pop:(COUNTRIES.find(c=>c.name===x.country)||{}).pop||1});const r=m.get(x.country);if(x.status!==\"Completed\")r.active++;r.combinedTB+=x.sizeTB;r.progressSum+=x.progress;r.etaWeighted+=x.etaMin*((100-x.progress)\/100);r.os[x.os]++;r.speeds.push(x.speedMBs);}return[...m.values()].map(r=>({...r,avgPct:+(r.progressSum\/Math.max(1,r.active)).toFixed(1),etaCountryMin:Math.round(r.etaWeighted\/Math.max(1,r.active)),density:+(r.active\/(r.pop\/1_000_000)).toFixed(2)}));}\nfunction globalMetrics(s,agg){const active=s.filter(x=>x.status!==\"Completed\").length,combinedPB=s.reduce((a,x)=>a+x.sizeTB,0)\/1024,todayPB=s.reduce((a,x)=>a+(x.progress\/100)*x.sizeTB,0)\/1024*0.15,avg=s.reduce((a,x)=>a+x.progress,0)\/Math.max(1,s.length);const leaderboard=[...agg].sort((a,b)=>(b.combinedTB*b.avgPct)-(a.combinedTB*a.avgPct)).slice(0,10);return{active,combinedPB,todayPB,avgCompletion:avg,leaderboard};}\n\n\/* ===== Tiny charts ===== *\/\nfunction prepCanvas(id){const c=$(id),d=window.devicePixelRatio||1;if(!c)return null;const r=c.getBoundingClientRect();c.width=r.width*d;c.height=r.height*d;const x=c.getContext(\"2d\");x.setTransform(d,0,0,d,0,0);x.clearRect(0,0,r.width,r.height);return{x,w:r.width,h:r.height};}\nfunction drawLine(id,series,color){const C=prepCanvas(id);if(!C)return;const {x,w,h}=C,p=12;const mn=Math.min(...series),mx=Math.max(...series)||1;const sx=i=>p+(w-2*p)*i\/(series.length-1);const sy=v=>p+(h-2*p)*(1-(v-mn)\/(mx-mn));x.beginPath();x.lineWidth=2;x.strokeStyle=color;series.forEach((v,i)=>{const X=sx(i),Y=sy(v);i?x.lineTo(X,Y):x.moveTo(X,Y)});x.stroke();}\nfunction drawHist(id,vals,b=12,color){const C=prepCanvas(id);if(!C)return;const {x,w,h}=C,p=16;const mn=Math.min(...vals),mx=Math.max(...vals);const st=(mx-mn)\/b||1;const cnt=new Array(b).fill(0);vals.forEach(v=>{let i=Math.floor((v-mn)\/st);if(i>=b)i=b-1;cnt[i]++});const mxc=Math.max(...cnt,1);const bw=(w-2*p)\/b-4;cnt.forEach((ct,i)=>{const X=p+i*((w-2*p)\/b);const bh=(h-2*p)*(ct\/mxc);x.fillStyle=color;x.fillRect(X,h-p-bh,bw,bh)})}\nfunction drawPie(id,parts){const C=prepCanvas(id);if(!C)return;const {x,w,h}=C;const r=Math.min(w,h)\/2-12;const cx=w\/2,cy=h\/2;let a0=-Math.PI\/2;parts.forEach(p=>{const a1=a0+(p.value||0)*Math.PI*2;x.beginPath();x.moveTo(cx,cy);x.arc(cx,cy,r,a0,a1);x.closePath();x.fillStyle=p.color;x.fill();a0=a1});}\n\n\/* ===== UI & Loop ===== *\/\nfunction fillTable(agg){const tb=document.querySelector(\"#leaderTable tbody\");tb.innerHTML=\"\";agg.slice().sort((a,b)=>b.combinedTB-a.combinedTB).forEach(r=>{const tr=document.createElement(\"tr\");tr.className=\"click\";tr.innerHTML=\"<td>\"+r.country+\"<\/td><td>\"+r.active+\"<\/td><td>\"+fmtTB(r.combinedTB)+\"<\/td><td>\"+r.avgPct+\"%<\/td><td>\"+fmtETA(r.etaCountryMin)+\"<\/td>\";tr.onclick=()=>selectCountry(r);tb.appendChild(tr);});}\nfunction updateCards(m){$(\"kSessions\").textContent=m.active.toLocaleString();$(\"kDriveSize\").textContent=fmtPB(m.combinedPB);$(\"kTodayDefragged\").textContent=fmtPB(m.todayPB);$(\"kAvgCompletion\").textContent=Math.round(m.avgCompletion)+\"%\";}\n\nconst HIST={};\nfunction selectCountry(r){\n  $(\"cpName\").textContent=r.country;\n  $(\"cpActive\").textContent=r.active.toLocaleString();\n  $(\"cpAvgPct\").textContent=r.avgPct+\"%\";\n  $(\"cpETA\").textContent=fmtETA(r.etaCountryMin);\n  $(\"cpCombined\").textContent=fmtTB(r.combinedTB);\n  $(\"cpDensity\").textContent=r.density+\" per M\";\n  if(!HIST[r.country])HIST[r.country]=[];\n  HIST[r.country].push(r.avgPct); if(HIST[r.country].length>100)HIST[r.country].shift();\n  drawLine(\"cpLine\",HIST[r.country],\"#7dd3fc\");\n  drawHist(\"cpHist\",r.speeds||[60,90,120,150,180],12,\"#a7f3d0\");\n\n  \/\/ Pie & legend\n  const t=r.os||{Windows:2, Linux:1, macOS:1};\n  const total=(t.Windows||0)+(t.Linux||0)+(t.macOS||0) || 1;\n  drawPie(\"cpPie\",[\n    {value:(t.Windows||0)\/total,color:\"#3b82f6\"},\n    {value:(t.Linux||0)\/total,color:\"#22c55e\"},\n    {value:(t.macOS||0)\/total,color:\"#f59e0b\"}\n  ]);\n  const pct=v=>Math.round((v\/total)*100);\n  const legend=$(\"osLegend\");\n  if(legend){\n    legend.innerHTML = `\n      <span class=\"item\"><span class=\"swatch\" style=\"background:#3b82f6\"><\/span>Windows ${pct(t.Windows||0)}%<\/span>\n      <span class=\"item\"><span class=\"swatch\" style=\"background:#22c55e\"><\/span>Linux ${pct(t.Linux||0)}%<\/span>\n      <span class=\"item\"><span class=\"swatch\" style=\"background:#f59e0b\"><\/span>macOS ${pct(t.macOS||0)}%<\/span>\n    `;\n  }\n}\n\n\/* boot + loop *\/\nlet MAP, SESS=[], AGG=[], METRICS={}, tick=0;\nfunction render(full=true){\n  tick++;\n  if(full){\n    SESS=genSessions();\n    AGG=aggregateByCountry(SESS);\n    METRICS=globalMetrics(SESS,AGG);\n    MAP.drawDots(SESS);\n    fillTable(AGG); updateCards(METRICS);\n    const trend=Array.from({length:48},(_,i)=>80+Math.sin((tick+i)\/6)*20+(i%12===0?Math.random()*24:0)); drawLine(\"trend24h\",trend,\"#6ee7ff\");\n    const top=METRICS.leaderboard[0]||AGG[0]; if(top) selectCountry(top);\n  } else {\n    SESS.forEach(s=>{ s.progress = Math.max(1, Math.min(99.9, s.progress + Math.sin(Date.now()\/2.5e4)*0.3)); });\n    MAP.drawDots(SESS);\n  }\n}\nfunction boot(){\n  MAP=new MiniOSM(document.getElementById(\"mapWrap\"));\n  document.getElementById(\"btnRefresh\").addEventListener(\"click\", ()=>render(true));\n  document.getElementById(\"btnLocate\").addEventListener(\"click\", ()=>{\n    if(!navigator.geolocation) return;\n    navigator.geolocation.getCurrentPosition(pos=>{\n      MAP.center=[pos.coords.latitude, pos.coords.longitude];\n      MAP.zoom = Math.max(MAP.zoom, 8);\n      MAP.renderTiles(); MAP.drawDots(SESS);\n    });\n  });\n  render(true);\n  setInterval(()=>render(false), 350);   \/\/ animate glow\n  setInterval(()=>render(true), 4000);   \/\/ refresh data\n}\ndocument.addEventListener(\"DOMContentLoaded\", boot);\n<\/script>\n<\/body><\/html>\n&#8216;>\n<\/iframe>\n\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"blank-slate-template.php","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_glsr_average":0,"_glsr_ranking":0,"_glsr_reviews":0,"footnotes":""},"class_list":["post-278","page","type-page","status-publish","hentry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/bioskinetics.com.au\/index.php?rest_route=\/wp\/v2\/pages\/278","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bioskinetics.com.au\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/bioskinetics.com.au\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/bioskinetics.com.au\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bioskinetics.com.au\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=278"}],"version-history":[{"count":5,"href":"https:\/\/bioskinetics.com.au\/index.php?rest_route=\/wp\/v2\/pages\/278\/revisions"}],"predecessor-version":[{"id":312,"href":"https:\/\/bioskinetics.com.au\/index.php?rest_route=\/wp\/v2\/pages\/278\/revisions\/312"}],"wp:attachment":[{"href":"https:\/\/bioskinetics.com.au\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=278"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}