Jump to content

PAEz

Member
  • Posts

    18
  • Joined

  • Last visited

Everything posted by PAEz

  1. @mips1911 Just wanted to say thanks for pointing out Magpie! Had no idea it existed and now I can get full fullscreen in an old game Warblade! So happy, thanks!
  2. This article might be of interest.... https://dev.to/donghyukjacobjang/how-to-prevent-xss-attacks-when-using-dangerouslysetinnerhtml-in-react-1464
  3. Here's a stackoverflow answer to that question..... https://stackoverflow.com/questions/23985018/simple-css-animation-loop-fading-in-out-loading-text ...its always nice to see it doing what you wanted, so I copied one of the examples and changed it to an image.... http://plnkr.co/edit/l2GoxgobXTtxSZe5otxX?p=preview https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Animations
  4. I got curious. Their website says to contact their support for help adding a file type...coulda just given some docs. Anyway, for a file signature its prolly ... 46 4C 68 64 with an offset of 0. http://fileformats.archiveteam.org/wiki/Raw_FL_Studio_Project But if you can Id do what Radium_Angel said and get the lot and then find them yourself, to be on the safe side. Im sure theres some binary file searcher out there that could search for files that start with that, which is FLhd in ascii. So even findstr on windows could kinda do it with a search string of ^FLhd
  5. The idea that you cant do something in a particular language is usually wrong. C# is perfectly capable at getting those specs. OpenHardwareMonitor https://openhardwaremonitor.org/ https://github.com/openhardwaremonitor/openhardwaremonitor Complete hardware monitoring app written in C#. https://www.codeproject.com/Articles/1115618/CPU-Temperature-System-Information Project written in C# using the dll from OpenHadwareMonitor. Could be a good place for you to start. Use what ever language you like the look of. C, C++, C#, Delphi (so nice to hear its still being used;), JS, woteva could all get the job done. I avoided all Cs when I first started coz I couldnt handle the look of the code, all those squiggles and wotnot put me off, so I went with pascal/delphi. But then my bad memory stopped me from getting my head around all the oop stuff, never stopped me from making LOTS of utils for myself tho. Now I ONLY do JS coz it was nice and simple for my bad memory (no enforced systems helped me alot). Now JS is getting a lot more to it but my ground knowledge is so complete now its not proving a problem. Seriously, just pick what ever you feel comfortable with they all have their plus and minus and once you learn one learning another isnt that bad, they all kinda relate.
  6. let element = document.querySelector("#add-to-cart[data-id='1']" This will select the element you described. The #add-to-cart will select an element with the ID of add-to-cart and the [data-id='1'] says with an attribute of data-id that equals "1". https://www.w3.org/TR/selectors-3/ https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector https://jsfiddle.net/yrdzbhaf/ EDIT: OH, and if you have more than one element with an id of add-to-cart then that should really be a class. ID is meant to identify a single element, otherwise it should be a class. So more correct would be a class of add-to-cart and then use the ID to distinguish which one.
  7. There's soooooo many things that do this. Not saying dont do it, hell no its a fantastic exercise and I learnt alot making a thingy like this once. But just saying. Every time you see JSX it gets converted to something like this and many other things have this approach minus the jsx. One great example to look at is Mithril..... https://mithril.js.org/#hello-world ...I picked Mithril because its great and most its docs show the none JSX versions but there is a jsx transpiler if you want to look at it.
  8. Im assuming you wanted to swap two html elements in the DOM... <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta http-equiv="X-UA-Compatible" content="ie=edge" /> <style> h3 { margin-top: 0px; margin-bottom: 0px; } </style> <title>Swapping Two HTML Elements</title> </head> <body> <h3>0</h3> <h3>1</h3> <h3>2</h3> <h3>3</h3> <h3>4</h3> <h3>5</h3> <h3>6</h3> <h3>7</h3> <h3>8</h3> <h3>9</h3> <button id="button">Click</button> <script> // https://linustechtips.com/main/topic/1037144-js-basic-issue/ // https://stackoverflow.com/questions/9732624/how-to-swap-dom-child-nodes-in-javascript button.addEventListener("click", function() { let headers = document.querySelectorAll("h3"); headers[9].parentNode.insertBefore(headers[9], headers[0]); }); </script> </body> </html> https://codesandbox.io/s/myqz0w1mqp If this isnt what you wanted then please edit the codesandbox to reflect you problem so we can help you better.
  9. @Erik Sieghart I get the speed thing.... https://jsperf.com/array-prototype-slice-call-vs-slice-call/12 But I dont understand why it would affect stack space and cant find anything on it. Would you have any links I could read? I have a little understanding of stack stuff but not this. Unless you meant the recursion thing, which makes sense.
  10. Cant you just target the next page link, Im assuming you targeted the individual links. Something like this.... {"_id":"tryagain","startUrl":["https://www.transfermarkt.com/transfers/transfertagedetail/statistik/top/land_id_zu/0/land_id_ab/0/leihe//datum/2019-01-31"],"selectors":[{"id":"nextpage","type":"SelectorLink","parentSelectors":["_root","nextpage"],"selector":"li.naechste-seite a","multiple":false,"delay":0},{"id":"data","type":"SelectorText","parentSelectors":["_root","nextpage"],"selector":"td.hauptlink","multiple":true,"regex":"","delay":0}]} This got all 43 pages of the target link. If you want more help feel free to post your sitemap and Ill have a look at it.
  11. Your test on that test site is flawed, you should have declared the array.prototype function in the setup. Right now its doing it ever test which will slow it down alot. And pre declaring the function and not as an argument can speed things up a bit aswell. http://jsben.ch/3H35T (function() { // Generate the test array with random strings let arr = []; for (let i = 0; i < 100000; i++) { arr[i] = Math.random().toString(36).substring(2, 3 + Math.floor(Math.random() * 9)); } Array.prototype.loop = function(func) { let l = this.length; for (let i = 0; i < l; i++) { func(this[i]); } } const add = (x)=>o += x; let o = ''; var loop; console.time(loop = 'Loop - for -') for (let i of arr) { add(i); } console.timeEnd(loop); o = ''; console.time(loop = 'Loop - prototype -') arr.loop(add); console.timeEnd(loop); // console.log(o) console.log('Array length', arr.length); } )(); One browser is faster at one and the other the other...hehe, this is the point where people tell you that micro benchimarking is a fools game and most of the time its just best to write code thats easiest to read, debug, test, blah, blah. And most of the time they're right.
  12. If your using a modern browser you could also have used 'includes'.... if(mois[i].includes('r')) https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes
  13. Just make sure that the constant x is declared in a function (the one that does the calc) and isnt defined as a global variable (scope kept to the function) so that they cant change its value from the console.
×