Added: 1 year ago
From: kjlg74
Views: 2,572
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (34)

Sign In or Sign Up now to post a comment!
  • That's how I would like my classes to be: simple and interesting. I finally understood semaphores, so thank you for that! :)

  • Just 1 question: Why mutex for counters? What would happen if there were not mutex for counter access??

  • I took a programming class in highschool, so im glad I can understand some 60% of this, interesting stuff.

    You keep making good vids, but I keep slacking on the one I wanted to do. I already made a real-life 3-D version of the evolved virtual worm like 2 months ago! I just dont know were to start with the video editing. Should I play music? Should I get a mic and voice over?(rhetorical). I want to finish it sometime soon.

  • @tostrong4you Thanks a lot!

    60% sounds about right. I don't imagine a high school programming class discusses thread synchronization - so the mutex and semaphore stuff probably seemed a little odd.

    You built a 3D model of the end-over-end worm?! That's pretty AWESOME :D

    I can't wait to see that! Very cool!

  • I'm fairly weak on programming, what are semaphore mutex variable types? or are those something specific to the function?

  • @Zetimenvec Even if you were a strong programmer, you'd never encounter mutexes and semaphores outside of thread synchronization - and even then, there are other synchronization mechanisms one might use instead.

    You can think of a semaphore as a special kind of integer. The only thing you can do with it is increment it or decrement it (you can't even look inside to see its current value). If you decrement it and the result is negative, you (the thread) block. (continued)

  • @kjlg74 ..and if you increment it while there are thread(s) blocked on it, one of those threads will be unblocked and allowed to continue running.

    Decrementing is often called "waiting" because you might block, and incrementing is often called "signaling".

    A mutex is really just a semaphore with a maximum positive value of 1

    It's too much to explain in YT comments, but it's quite interesting stuff. Check out the PDF Downey book (see video desc). I highly recommend it :)

  • @kjlg74 Some languages actually have semaphores as built-in primitive data types. Java has them, but you need to import them from java.util.concurrent

  • Where does Santa's wife come into this equation....does she have to dress as an elf or don some antlers to get some attention?

  • @Wysiwygnuttyjo51 Oh no, nothing like that. When I talked about Santa "sleeping", I just forgot to mention who with ;P

  • I watched this slightly drunk with added jetlag I now think I know slightly more about computers!

  • @Dullbedsitblogger If even a non-programmer can get something from this, I must be doing something right.

    I should get my students drunk next time I teach this - maybe it helps! :D

  • Well that would be the first programmable xmas video I've seen!

    The surface problem of having time constraints involved in one particulate individual is a real world problem. Using a figure such as santa has demonstrated this problem great! You know santa isn't real btw hhahaha?

  • @TradieTrev Thanks, TradieTrev!

    You're right, similar problems crop up in the "real" world too. Now if only humans could be given simple instructions and be replied upon to follow them, :P

    (come to think of it, computers can't necessarily be relied upon for that either, lol)

    Santa not real? Like I said to MrStripyHead, Santa is real, he just retired to a mansion in Noosa to moon cameras and sell drugs and hookers! Except this Santa likes it when you're naughty.

  • i hate to tell you this, but santa isnt real, therefor there isnt really any problem at all :P

  • @MrStripyHead Oh he's real alright! But he retired to a mansion in Noosa where he moons cameras and sells drugs and hookers on the side ;)

  • I'm taking a class in java script right now, and the pseudo code in this video is eerily similar. Are all programming languages roughly similar to java script? if so, then I am going to love programming.

  • @belliebum12 Oh no, programming languages can differ quite a lot from one another, unfortunately, although there are groups of languages that all feel like variations on one another (C, C++, Java, C#, Objective-C for example). Try googling to find the "99 bottles of beer" website. It has the same computer program written in hundreds of different languages - lots of variety in there!

  • if they are zero,he executes them back(that is what i thought you would say XD)

    and by the way is this a programming language for videogames or other computer languages and i would also like the name of it if you would like to inform me about it

  • @videonfan Thanks!

    This isn't written in any existing programming language. It's very common in computer science to explain an algorithm this way. It's called "pseudocode" - but pseudocode isn't a language. There are no rules or textbooks for it.. Basically, when you write pseudocode, you can have it look any way you want, as long as the result will be easily understood by other programmers. I find a lot of people write pseudocode that tends to look vaguely like C, C++, or Java.

  • @kjlg74

    ah,i see.thanks for informing me!

  • Is the programming language COMIT ? ho-ho-ho ;-)

  • @RevDevilin LOL :D Damn! Had I known about that language, I might have tried to use it.

  • Might be a dumb question but I am just getting into computer science and was just wondering what language is this?

  • @fcdog555 It's a good question, actually. It's no language in particular. It's very common in computer science to express algorithms like that. When you do, it's called "pseudocode". Basically, anything goes when writing pseudocode as long as it would be clearly understood by other programmers.

  • @kjlg74 hmmmm I see. Yeah I'm teach java to myself and saw it looked familiar but nothing like java at the same time ha.

    thanks though.

    I will have to look into pseudocode.

    and as a just so you know thing, it was your evolution program (and the first movie tron) that got me interested into programming:D

    keep making the good videos!

  • @fcdog555 Ha! Thanks! I'm honored :)

    Java is a good language to learn. It's widely used and not as nasty as C++ can be. Once you're comfortable with it, though, you'll be able to pick up C++ easily - they have an extremely similar way of expressing things.

    Thread synchronization can be a little weird though, especially if you're only just starting to learn programming. Probably best to save that 'til you're more comfortable programming. The Downey book is a fun way to learn that stuff, though.

  • @kjlg74 Okay thanks for the advice! I was thinking about getting into C++ eventually.

    But I am considering getting a degree in computer science (this or astrobiology), so do you have any more advice for a young novice lad like myself:D haha

  • @fcdog555 Astrobiology? That's pretty cool!

    Advice, eh? Hmmm... my advice is to do as much programming as you can, in your spare time. Lots of coding. Just code stuff for fun - 2D graphics are a good area for that. It's easy to come up with something fun to try out, there's not a whole lot you need to know ahead of time (google Java 2D), and it's easy to go from very simple stuff to very complex stuff. (continued)

  • @kjlg74 Learning a bit of assembly language at some point will give you a better feel for what's going on "under the hood", so to speak, and sheds some light on why some strange things in programming are they way they are.

    Hmmm... nothing else in particular comes to mind right now - probably just too late at night :P

  • I didn't know this problem... thanks for sharing the solution.

    The problem I have found concerning Santa is, because he is also known as Saint Nicholas, and someone is called Saint only after his death...

  • @newcoleco LOL :D I'd never even thought of that before - makes sense though. We should just call him Claus of Nicholas until we're sure he's dead :P

    Thanks, though. Glad you enjoyed it :) Downey's "Little book of semaphores" is full of fun problems like this.

  • @kjlg74 Typo: "Claus of Nicholas" should be "Claus OR Nicholas"

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more