Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

JacobFW

Member
  • Content Count

    546
  • Joined

  • Last visited

Reputation Activity

  1. Agree
    JacobFW got a reaction from gabrielcarvfer in ALWAYS Avoid Global Variables?   
    I agree with @tarfeef101   This is a good case of "Learn the rules before you break them"
     
    Speaking from experience though I will say this is a very, very good rule to follow.  Because global variables can be modified by any other code, this can lead to some extremely infuriating intermittent errors that can be a nightmare to solve.  So it is best to just go ahead and get in the habit of not using them, until you come across a situation where you need them.
  2. Agree
    JacobFW got a reaction from Radium_Angel in The Best Gaming Laptop. Period.   
    Question for LTT.  In the last few years laptop manufacturers have adopted Apple's practice of riveting the effing keyboards to the laptop frame.  So if anything happens to the keyboard (which are usually one of the first/easiest pieces of a laptop to be damaged) it becomes a freaking nightmare to replace, and usually just ends up with you having to get a brand new laptop.  What used to be a $30, 15 minute fix you could do yourself now essentially totals your laptop.
     
    I would just really like to know why LTT has not been calling manufacturers out on this? Linus has spent years complaining (rightfully imo) in nearly laptop review about the atrocious webcams & microphones included in laptops, but I can't think of any reviews he's brought this up in.
  3. Agree
    JacobFW reacted to tarfeef101 in ALWAYS Avoid Global Variables?   
    I'll assume this is a question. 

    A good rule when you encounter these "universal rules" in programming, I think, is this:
    do your absolute best to follow them unless you understand why people say that, and why they could be wrong People often say "don't use switch statements" or (especially this one) "don't use goto". However, both have their legitimate uses, and are the best solution in some cases. If you can say why that is the case, then feel free to use them. If you can't, then probably don't. 
     
     
    There are definitely times when writing js code that I have used globals, and definitely times I technically could have, but avoided doing so in favour of a better solution. But, I'm also a CS graduate, and have been working professionally in software development for some time, so I sincerely hope I'd be able to make those determinations 😄

    I will also say this: those rules mostly apply to writing "real" code, when making applications you plan to actually run and do something productive. If you're just playing around trying to learn, don't stress about it. It's much better to keep progressing in your learning experience and commit a couple faux-pas than to run into one, get stumped, and quit.
  4. Like
    JacobFW got a reaction from techismylife in what is the difference between dom representation and raw html document?   
    So I think there's actually at least two different questions that need to be answered for this to make sense
     
    1)  How is the webpage you view and interact with generated, both initially and as you use it?
    2)  Is the DOM just a parsed version of the HTML text or is there more to it than that?
     
    1)  One thing you'll notice on most pages is that if you go into the Inspect Element viewer, and compare that to the HTML when you go to View Source, you'll see that while they may have a little in common, there's still usually vast differences between them (technically they could be the same, but that's fairly uncommon as we're about to see).  When you request to go to a page, your browser will download the initial html (which is what you see under View Source).  In that HTML however are usually script tags, which contains code the browser will execute.  In many sites this code will then finalize the web page that you'll see and interact with, and setup handlers for what happens when you, the user, clicks on certain buttons, or interact with various parts of the pages.  You have to remember that HTML doesn't really "do" anything.  It's more of schematic, that describes how the page should be constructed (think back to old sites from the 90's/early 2000's).  If you click on a button to go to a certain menu or submit an order, it's the script code that runs in the background on your browser, modifying the web page that you see to respond to your requests.
     
    When you click on Inspect Element, you're viewing all the changes to the web page that have taken place up to that point, starting with the browser downloading the initial source, running the initial scripts, and any other changes the scripts have made up to that point based on how you've interacted with the page.
     
    2)  The HTML (both what's loaded at the start and what the script code has modified as time has gone on) does govern the overall structure of the DOM, but there is more to it in that.  First and foremost what you have to understand is the DOM is essentially a specialized database, which is designed both to aid the render engine as it creates what you see in the browser, and to allow script to interact with it quickly and easily.  The data in the HTML is parsed and stored in the DOM's internal format, but then the DOM also has the ability to store extra data along with that.  Additionally you can store handlers along with that data, so that if say, the user clicks on this element, it should execute a certain piece of code which the developer can specify, or if say the mouse hovers over a certain box or button, it should show a small tooltip which gives a description of what that's for.
     
    TBH I feel like this is a case where reading the theory/description of what is happening might just confuse you more.  I would suggest reading some tutorials on Javascript & JQuery, and play around with it yourself.  I think it will make a lot more sense once you see how it works when you use it yourself.
     
     
     
  5. Agree
    JacobFW got a reaction from Jisagi in Html page won't go live   
    Best bet would be to find an introductory tutorial for node.js which shows you how to return a file based on an http request.
    This one may be of some help to you
    https://www.tutorialspoint.com/serving-html-pages-from-node-js
     
     
  6. Agree
    JacobFW reacted to kelvinhall05 in Why the Perseverance Rover computer is so "outdated"   
    Absolutely wonderful video from criminaly underrated channel...can almost guarantee basically the same thing applies to Perseverance.
     
  7. Like
    JacobFW got a reaction from shaz2sxy in What is Multithreaded file copy?   
    Let's say you have a 10gb file you want to copy.
    Your program will initialize a certain number of threads (lets say 10 in this case).
    Essentially what we'll do is divide the file into fixed size chunks, and we'll assign a thread to copy each chunk.  To be clear, we won't actually move data around to divide it, just give it different start and end bounds in the file. So the thread that copies the first chunk will get the bounds 0-99mb, thread 2 will get 100-199mb, thread 3 will get 200-299mb, etc.
    For Spinning Drives, a multithreaded copy is probably going to be slower due to it having to move the read head around, which is the slowest part of any read/write operation (could be wrong; if so please correct me).  For SSDs however multithreaded copy can be very helpful.
     
    DMA does help to speed up this process but it isn't a substitute for multithreaded file copy. 
    To see why let's take a high level look at copying data from one machine to another.
     
    Source Drive -> Local Memory -> Send over Network -> Remote Memory -> Remote Drive.
     
    Not at first glance you might think "okay, that's pretty straightforward, how are you actually improving on that?"
    Well the issue here is the local memory.  When you do a read operation what you're basically doing is providing a memory buffer where you need the data, the file, and the number of bytes you want.  Prior to DMA, when the data was first read from the drive into memory, it didn't get copied into that buffer.  Instead it got copied into another buffer, then into another buffer, then another one, and possibly only then into the buffer you provided (but there could be more buffers).  This same process would then happen in reverse if you were writing data, and pretty much the same thing would happen when sending data over the network (only difference is the data ends up in the NIC rather than the drive).  All this copying of course makes the process much slower.
     
    DMA simply cuts out as many of those unnecessary copies and buffers as possible, and instead lets memory devices access the direct memory the calling program/device needs the data to end up in.
     
     
     
     
     
     
     
     
  8. Like
    JacobFW got a reaction from Electronics Wizardy in What is Multithreaded file copy?   
    Let's say you have a 10gb file you want to copy.
    Your program will initialize a certain number of threads (lets say 10 in this case).
    Essentially what we'll do is divide the file into fixed size chunks, and we'll assign a thread to copy each chunk.  To be clear, we won't actually move data around to divide it, just give it different start and end bounds in the file. So the thread that copies the first chunk will get the bounds 0-99mb, thread 2 will get 100-199mb, thread 3 will get 200-299mb, etc.
    For Spinning Drives, a multithreaded copy is probably going to be slower due to it having to move the read head around, which is the slowest part of any read/write operation (could be wrong; if so please correct me).  For SSDs however multithreaded copy can be very helpful.
     
    DMA does help to speed up this process but it isn't a substitute for multithreaded file copy. 
    To see why let's take a high level look at copying data from one machine to another.
     
    Source Drive -> Local Memory -> Send over Network -> Remote Memory -> Remote Drive.
     
    Not at first glance you might think "okay, that's pretty straightforward, how are you actually improving on that?"
    Well the issue here is the local memory.  When you do a read operation what you're basically doing is providing a memory buffer where you need the data, the file, and the number of bytes you want.  Prior to DMA, when the data was first read from the drive into memory, it didn't get copied into that buffer.  Instead it got copied into another buffer, then into another buffer, then another one, and possibly only then into the buffer you provided (but there could be more buffers).  This same process would then happen in reverse if you were writing data, and pretty much the same thing would happen when sending data over the network (only difference is the data ends up in the NIC rather than the drive).  All this copying of course makes the process much slower.
     
    DMA simply cuts out as many of those unnecessary copies and buffers as possible, and instead lets memory devices access the direct memory the calling program/device needs the data to end up in.
     
     
     
     
     
     
     
     
  9. Like
    JacobFW got a reaction from itswillum in NASA Releases Footage of Perseverance's Landing   
    Summary
    NASA has released the full video showing the descent and landing of Perseverance on Mars.  Need I say more?
     
     
     
  10. Like
    JacobFW got a reaction from 19_blackie_73 in NASA Releases Footage of Perseverance's Landing   
    Summary
    NASA has released the full video showing the descent and landing of Perseverance on Mars.  Need I say more?
     
     
     
  11. Like
    JacobFW got a reaction from soldier_ph in NASA Releases Footage of Perseverance's Landing   
    Summary
    NASA has released the full video showing the descent and landing of Perseverance on Mars.  Need I say more?
     
     
     
  12. Like
    JacobFW got a reaction from wamred in NASA Releases Footage of Perseverance's Landing   
    Summary
    NASA has released the full video showing the descent and landing of Perseverance on Mars.  Need I say more?
     
     
     
  13. Like
    JacobFW got a reaction from bmx6454 in NASA Releases Footage of Perseverance's Landing   
    Summary
    NASA has released the full video showing the descent and landing of Perseverance on Mars.  Need I say more?
     
     
     
  14. Like
    JacobFW got a reaction from Delicieuxz in Will decompiling source code accurately be easy with future tech?   
    Short answer is no.  Source code is intentionally meant for people.  The naming schemes, indentation, comments, etc.  All are meant to make it easier for a developer to look at the code and have an idea of what problem the code is trying to solve.  Machine code is meant to be easy for the cpu to execute, not for a person to read.
     
    Don't get me wrong; yeah, some sort of AI could absolutely guess at the source code looked like based on the machine code, but you're still not going to have the naming schemes, you're not going to have the comments, and no matter how good the AI is, it will always be a guess.
    And even assuming you had an AI that could recreate 90%+ of the source code, why the f*@# are you wasting an AI on something like that?????
     
    Modern Vintage Gamer has a great video on how the source code for Diablo was reconstructed.  The only way they were able to do it was because of excess information left in the commercial versions.
     
  15. Like
    JacobFW got a reaction from Alexeygridnev1993 in any valid (cheap or free) alternative to matlab?   
    I'd recommend learning Python.  Has some amazing numerical libraries these days, and since it's a general purpose language, you have a lot more flexibility in terms of what you can do.
     
    And it being free never hurts either.
  16. Agree
    JacobFW got a reaction from shadow_ray in any valid (cheap or free) alternative to matlab?   
    I'd recommend learning Python.  Has some amazing numerical libraries these days, and since it's a general purpose language, you have a lot more flexibility in terms of what you can do.
     
    And it being free never hurts either.
  17. Funny
    JacobFW got a reaction from Dat Guy in any valid (cheap or free) alternative to matlab?   
    I'd recommend learning Python.  Has some amazing numerical libraries these days, and since it's a general purpose language, you have a lot more flexibility in terms of what you can do.
     
    And it being free never hurts either.
  18. Like
    JacobFW got a reaction from AvMaverick in RIP Tyler   
    RIP Tyler.  This year just keeps taking so much.
  19. Like
    JacobFW got a reaction from wkdpaul in RIP Tyler   
    RIP Tyler.  This year just keeps taking so much.
  20. Agree
    JacobFW reacted to SlashedM in anddddddddd that's the last time I buy a Samsung TV   
    ARC for me no matter what TV has been a pain for me, but yeah I think the problem with Samsung is that the smart TV functions are on at the same time, so it kinda craps for me as well, and recently been worse than usual.
  21. Like
    JacobFW got a reaction from PlayStation 2 in anddddddddd that's the last time I buy a Samsung TV   
    So, a little backstory.  Earlier this year I decided to upgrade my entertainment center.  I got a 65" Samsung TV (~$500) and a Vizio 5.1 Surround Sound System (~$250).  Nothing super fancy by any means, but a decent upgrade from what I had before.  The surround sound system in particular I was really looking forward to, and made sure the TV was compatible with it.
    So, get it setup.  Have my HTPC hooked up, Switch & Blu Ray player.  Find out about ARC, and get that setup, so everything can play through the sound system without needing a bunch of wires.......
     
    Except ARC is really flaky, and I can't get it to work reliably.  If I switch sources, sometimes the sound will switch right away, sometimes it switches after a few minutes, and sometimes it never switches, and even switching back to the previous source won't work, and I have to turn the tv off, power off the speakers and back on, then turn the tv back on for the sound to work again.
     
    Just a bit irritating as you can imagine.
     
    But, then I realized yesterday that the TV has optical out for audio, and the speakers has optical audio in.  PERFECT!!!  I can just have video & audio go into the TV, and then output the audio to the speaker system.  And it works!  So far none of the same issues with the audio not switching when the video does like I was having with ARC.  Great...................
     
     
    except surround sound no longer works.  And so I've spent the last several hours playing around with it and researching it.
     
    Turns out, Samsung only supports anything better than stereo if it's with ARC, over the TV tuner, or using one of the built in apps in the TV.
    Apart from that.... Samsung's response is a giant FU.
     
    So, definitely going to be awhile before I get anything to do with my entertainment system from Samsung.
     
     
     
  22. Agree
    JacobFW got a reaction from RorzNZ in Youtube Ads - I Kind of Miss Cable   
    #FirstWorldIssue I know; just need to do some venting.
     
    A lot of ranting I want to do, but I'll start it off by asking if anyone else is just losing their damn mind from Youtube's ads lately?  It just feels like over the last year (even prior to Covid) that they've just been getting worse and worse.  Roughly a year ago I started having this issue where I would only get one ad the entire day.  And no, I don't mean they would only play a single ad every 24 hours; I mean whatever the first ad I saw that day, every single ad spot would be the exact same ad, over, and over, and over, and over.....  Went on for about 3 months before that finally went away.
    Also realized lately that the short & creative ads that I always praised and pointed out as one of the reasons why Youtube did advertising better have been replaced with ads that are pretty much the same as ads you would see on TV, only instead of actually having a commercial break, they just come out of the middle of no where.
    Also noticed that Youtube has broken the promise they made several years ago to have the volume of the ad match that of the video it's in. 
     
    Then of course at the end of July, YouTube force enabled a bunch of additional ads.
    And finally here in the US it is of course election season, Youtube drops variety in exchange for the same political ads over and over again.
     
    And to answer the smart@$$'s reading this (who am I kidding, they didn't make it this far but still responded anyway) and wondering why I don't have Youtube premium,it's because I don't think it's going to matter.  It seems pretty clear that Youtube is going the same business route as cable companies, and so it probably won't be long until even if you are paying a monthly premium, you'll still have to endure ads.
     
     
  23. Like
    JacobFW got a reaction from samuelhnrq in What's the best javascript framework?   
    Would recommend sticking with native javascript, but I will admit that it's somewhat dependent on exactly how "simple" your "simple" website actually is.
     
    One thing to bear in mind though is that if later on down the line you decide that some upgrades are needed to your code that turns your "simple" site to a much more complicated one which would be better written in a js framework, this may involve a complete rewrite of your existing simple site.  To be fair though, that might actually be better for you in the long term.  I've had plenty of projects that started out simple, then later on required additional features, and while trying to figure out how to modify my existing code I'll have a realization and go
    "Damn, if only i had done ______ when I originally wrote this, it would make these modifications much easier and give me a lot more flexibility in the future if any additional changes are needed."
    Then inevitably the question becomes, should I rewrite the existing code, or try to force fit a solution into it?  And I've had too many occasions where I chose the second option (or had to deal with someone else who chose the second option) and depleted regretted it later on, because once you have to revisit code to add upgrades to it, I can guaran-damn-tee you that you will have to do it again, and again, and again.  And if your code isn't setup to better suit the more complicated structure, you'll just cheap polishing that turd over and over with each new change, and each new change becomes harder to write, and harder to debug.
     
    So no, I don't think that starting off with regular js and then later on rewriting it for a framework is a bad thing, and in fact might just save your mental health.
     
     
  24. Like
    JacobFW got a reaction from motz in What's the best javascript framework?   
    Would recommend sticking with native javascript, but I will admit that it's somewhat dependent on exactly how "simple" your "simple" website actually is.
     
    One thing to bear in mind though is that if later on down the line you decide that some upgrades are needed to your code that turns your "simple" site to a much more complicated one which would be better written in a js framework, this may involve a complete rewrite of your existing simple site.  To be fair though, that might actually be better for you in the long term.  I've had plenty of projects that started out simple, then later on required additional features, and while trying to figure out how to modify my existing code I'll have a realization and go
    "Damn, if only i had done ______ when I originally wrote this, it would make these modifications much easier and give me a lot more flexibility in the future if any additional changes are needed."
    Then inevitably the question becomes, should I rewrite the existing code, or try to force fit a solution into it?  And I've had too many occasions where I chose the second option (or had to deal with someone else who chose the second option) and depleted regretted it later on, because once you have to revisit code to add upgrades to it, I can guaran-damn-tee you that you will have to do it again, and again, and again.  And if your code isn't setup to better suit the more complicated structure, you'll just cheap polishing that turd over and over with each new change, and each new change becomes harder to write, and harder to debug.
     
    So no, I don't think that starting off with regular js and then later on rewriting it for a framework is a bad thing, and in fact might just save your mental health.
     
     
  25. Agree
    JacobFW reacted to WereCatf in How are CPU instruction set extension compatibilities handled when running an executable?   
    Indeed. As I've mentioned before in other threads, popular applications like e.g. VLC and FFmpeg, do this. They can be statically compiled for specific CPU-specs with just a simple flag given to the configure-script, but almost no one actually uses the option nowadays.
×