Jump to content

MikeD

Member
  • Posts

    216
  • Joined

  • Last visited

Reputation Activity

  1. Funny
    MikeD got a reaction from slippers_ in The under 100 line challenge!   
    The usefulness of this program is very debatable, but here it is: https://gist.github.com/migueldferreira/e634a8c80bb4af5c258b
     
    It's a love calculator that gives you a percentage of the love one person feels for another based on their first name! Silly childhood games!
  2. Funny
    MikeD got a reaction from samuelhnrq in The under 100 line challenge!   
    The usefulness of this program is very debatable, but here it is: https://gist.github.com/migueldferreira/e634a8c80bb4af5c258b
     
    It's a love calculator that gives you a percentage of the love one person feels for another based on their first name! Silly childhood games!
  3. Like
    MikeD got a reaction from XRaYdeR in The under 100 line challenge!   
    The usefulness of this program is very debatable, but here it is: https://gist.github.com/migueldferreira/e634a8c80bb4af5c258b
     
    It's a love calculator that gives you a percentage of the love one person feels for another based on their first name! Silly childhood games!
  4. Like
    MikeD got a reaction from marcelom17 in The under 100 line challenge!   
    The usefulness of this program is very debatable, but here it is: https://gist.github.com/migueldferreira/e634a8c80bb4af5c258b
     
    It's a love calculator that gives you a percentage of the love one person feels for another based on their first name! Silly childhood games!
  5. Like
    MikeD reacted to DigitalHermit in Anyone else agree that Eclipse is a terrible IDE?   
    screw IDEs.. I used vim to write C...
  6. Like
    MikeD reacted to wolfsinner in [Problem Solving #6/7] Solving the N-Puzzle   
    The example input takes ~2.5 seconds. Input 1 takes ~7 seconds, Input 2 takes ~14 seconds, and Input 3 takes ~5 seconds.
     
    It is not a perfect solution, and could be improved significantly but it did the job. I used the A* search algorithm with the following heuristic: the sum of the Manhattan Distance of each piece from its current position to its desired position. It's a typical solution to the problem. A* is a simple algorithm that is used to solve a bunch of seemingly complex problems in acceptable time.
    If you guys want to read more about it, a great book is the one @MikeD mentioned. It's called Artificial Intelligence: A Modern Approach. 
     
    BTW, what solution are you going for? I've noticed you solved the C <= 3 version, but missed the 15-Puzzle one. What results are you getting for the 15-Puzzle?
     
    EDIT: @gauvinic, sorry, yes, it is as fizzlesticks said.
  7. Like
    MikeD got a reaction from wolfsinner in [Problem Solving #6/7] Solving the N-Puzzle   
    I looked at the picture and, even before reading anything, immediately thought "Artificial Intelligence".
    And sure enough that is the exact picture that appears on the book we used in that class!
     
    When I have the time I'll study that again and give the problem a go.
  8. Like
    MikeD reacted to Nuluvius in (C#) goto and labeled statements   
    Agreed. You should endeavour to NEVER use goto at all, it is extremely bad form... there are exceptions to this but they are generally not found in higher level languages.
  9. Like
    MikeD got a reaction from wolfsinner in Problem Solving - Index   
    Boas!
    Well, then, I look forward to solving it (after submitting a few incorrect answers and spending hours figuring out why)!
    Until the last problem I thought the test cases were provided by the MIUP judges after the competition. How do you come up with them? Is it random or do you spend some time designing tests for the corner cases?
     
    Yeah, I once tried to set up mooshak (a few years ago, out of curiosity since some of my classes used that for project submission) but I ended up just looking at some of the files because it was too bothersome to set up apache! But it shouldn't be hard to do, even to change the interface. And yes, many people have already worked on its security features.
     
    As  for the learning problems, yes, I was thinking about some projects like enterprise applications or even simple games to teach architecture, abstraction and other software engineering techniques. But the evaluation of some of those types of projects are more focused on the quality of code rather than whether it passes all tests or not...
    Still, I'll probably take some of those algorithms lessons 'cause, like I said before, I already forgot many of them and could always use some more problem solving practice!
     
    I got stuck on the 3rd problem and then had to leave so I could only do the rest now. Better late than never!
  10. Like
    MikeD got a reaction from wolfsinner in Problem Solving - Index   
    How's everything going? Do you have an estimate on when the new gateway or the next problems will be up?
    I mean, you made it through summer, don't die on us now!!
    By the way, since many people occasionally make mistakes when entering the results into the website perhaps you could move to something like mooshak for automatic evaluation (if that's not what you are already looking at)?
     
    When I read "learning problems" I immediately thought developing applications or games as if it was a project for a class (kinda like starting by defining data types, develop logic for each aspect of the app and link it all together). However it seems to be more like taking a step-by-step approach at problems similar to the ones we've been solving, right? If so, would there be room for the first kind as well?
     
    I'd very much like to help out with the problems, but I'm afraid I won't have much time in the foreseeable future between my dissertation and starting work.
     

  11. Like
    MikeD got a reaction from darth_bubbles in Java problem.   
    Yeah, ever since I changed my default language from Java to Python I've been spoiled in some ways! (arg[len(arg)-1] is so much better!)
  12. Like
    MikeD got a reaction from darth_bubbles in Java problem.   
    1) Instead of arg.toLowerCase() == "whatever" do arg.toLowerCase().equals("whatever") otherwise there may be errors since == will compare references and not the actual content. Sometimes it works because it assigns the same object to the same string literals but not necessarily ( http://stackoverflow.com/a/513839
     
    2) switch(arg.length() - 1) will search the cases for a number, not a character, you probably want something like switch(arg[arg.length() - 1]) (something like that)
  13. Like
    MikeD reacted to helping in adblock users are questionable   
    If they received no ad revenue, they might not even take that much of a hit because they likely don't even rely on it [citation needed]
     
    Why do you seem to think YouTube is a place for production values anyway? It was never originally designed to sustain people making videos.
    YouTube isn't made for people to making a living off of it, people just happen to do it anyway.
  14. Like
    MikeD reacted to helping in adblock users are questionable   
    what's wrong is when you get spammed by ads up the wazoo
    have you ever tried listening to a youtube playlist without Adblock? You probably won't make it through 5 songs without breaking something.
     
    Nobody has to turn off adblock if they don't want to. It's their freedom to choose if they want to be served ads or not.
    You can correct me if I'm wrong, but nowhere in the YouTube agreement does it state that you must not have adblocking software to receive free content. The selling point to the user is that it was free all along, the marketing gimmick of paying with pupils isn't inherently a part of it.
     
    YouTube is regarded as free without strings (unless there was some amendment, I'm unaware) what software I happen to run shouldn't be an issue.
    On the internet "free" is usually a misapplication of the word and concept, but I'm still holding YouTube to that standard regardless.
  15. Like
    MikeD got a reaction from TheYoungEnthusiast in Apparently Facebook runs on 60+ Million lines of Code   
    I don't understand why you all think an F-35 or even a space shuttle should have more lines of code than facebook or any other website.
     
    In an aircraft or any other mission critical equipment where lives may be in danger (e.g. medical devices) you want a real-time system with extremely efficient code and no clutter. Just the bare minimum to perform the required tasks with extremely high precision. And you need to mathematically prove the correctness of most, if not all, algorithms if you want to send a space shuttle to outer space without it exploding mid-air because some value was losing precision throughout the calculations. The less code you have the less bugs you have to deal with.
     
    In facebook you are expecting the backend to manage your selfies and an array of other media types across several servers spread throughout the world in a secure fashion and to have a nice frontend to post your thoughts and upload your pictures and whatnot. Not to mention mobile apps, the code that goes into linking several platforms (you could upload pictures by sending them in an email to a specific facebook address not long ago, I believe), security, reliability, load-balancing algorithms for your data, advertisement, games (API's that enable these) and a slew of other "details" that need to be managed.
    And that's not counting each user's html page, otherwise the figure would be much higher (several orders of magnitude; besides, pages load dynamically, they are not static) but they should be counting (and probably are) the frontend (HTML templates, CSS, javascript, ...) that is needed to render those pages.
  16. Like
    MikeD got a reaction from Vypa in Apparently Facebook runs on 60+ Million lines of Code   
    I don't understand why you all think an F-35 or even a space shuttle should have more lines of code than facebook or any other website.
     
    In an aircraft or any other mission critical equipment where lives may be in danger (e.g. medical devices) you want a real-time system with extremely efficient code and no clutter. Just the bare minimum to perform the required tasks with extremely high precision. And you need to mathematically prove the correctness of most, if not all, algorithms if you want to send a space shuttle to outer space without it exploding mid-air because some value was losing precision throughout the calculations. The less code you have the less bugs you have to deal with.
     
    In facebook you are expecting the backend to manage your selfies and an array of other media types across several servers spread throughout the world in a secure fashion and to have a nice frontend to post your thoughts and upload your pictures and whatnot. Not to mention mobile apps, the code that goes into linking several platforms (you could upload pictures by sending them in an email to a specific facebook address not long ago, I believe), security, reliability, load-balancing algorithms for your data, advertisement, games (API's that enable these) and a slew of other "details" that need to be managed.
    And that's not counting each user's html page, otherwise the figure would be much higher (several orders of magnitude; besides, pages load dynamically, they are not static) but they should be counting (and probably are) the frontend (HTML templates, CSS, javascript, ...) that is needed to render those pages.
  17. Like
    MikeD got a reaction from TheGuyNL in How can I get the total number of cases in a switch statement as an integer?   
    Why not just using an array whose elements contain a method that carries out the desired operation?
    That way you can always add more and can get the number of elements in the array.
     
    As an added bonus you no longer need to change the original method.
  18. Like
    MikeD got a reaction from LukeTim in How can I get the total number of cases in a switch statement as an integer?   
    Why not just using an array whose elements contain a method that carries out the desired operation?
    That way you can always add more and can get the number of elements in the array.
     
    As an added bonus you no longer need to change the original method.
  19. Like
    MikeD got a reaction from Epis in Apparently Facebook runs on 60+ Million lines of Code   
    I don't understand why you all think an F-35 or even a space shuttle should have more lines of code than facebook or any other website.
     
    In an aircraft or any other mission critical equipment where lives may be in danger (e.g. medical devices) you want a real-time system with extremely efficient code and no clutter. Just the bare minimum to perform the required tasks with extremely high precision. And you need to mathematically prove the correctness of most, if not all, algorithms if you want to send a space shuttle to outer space without it exploding mid-air because some value was losing precision throughout the calculations. The less code you have the less bugs you have to deal with.
     
    In facebook you are expecting the backend to manage your selfies and an array of other media types across several servers spread throughout the world in a secure fashion and to have a nice frontend to post your thoughts and upload your pictures and whatnot. Not to mention mobile apps, the code that goes into linking several platforms (you could upload pictures by sending them in an email to a specific facebook address not long ago, I believe), security, reliability, load-balancing algorithms for your data, advertisement, games (API's that enable these) and a slew of other "details" that need to be managed.
    And that's not counting each user's html page, otherwise the figure would be much higher (several orders of magnitude; besides, pages load dynamically, they are not static) but they should be counting (and probably are) the frontend (HTML templates, CSS, javascript, ...) that is needed to render those pages.
  20. Like
    MikeD got a reaction from Jade in Apparently Facebook runs on 60+ Million lines of Code   
    I don't understand why you all think an F-35 or even a space shuttle should have more lines of code than facebook or any other website.
     
    In an aircraft or any other mission critical equipment where lives may be in danger (e.g. medical devices) you want a real-time system with extremely efficient code and no clutter. Just the bare minimum to perform the required tasks with extremely high precision. And you need to mathematically prove the correctness of most, if not all, algorithms if you want to send a space shuttle to outer space without it exploding mid-air because some value was losing precision throughout the calculations. The less code you have the less bugs you have to deal with.
     
    In facebook you are expecting the backend to manage your selfies and an array of other media types across several servers spread throughout the world in a secure fashion and to have a nice frontend to post your thoughts and upload your pictures and whatnot. Not to mention mobile apps, the code that goes into linking several platforms (you could upload pictures by sending them in an email to a specific facebook address not long ago, I believe), security, reliability, load-balancing algorithms for your data, advertisement, games (API's that enable these) and a slew of other "details" that need to be managed.
    And that's not counting each user's html page, otherwise the figure would be much higher (several orders of magnitude; besides, pages load dynamically, they are not static) but they should be counting (and probably are) the frontend (HTML templates, CSS, javascript, ...) that is needed to render those pages.
  21. Like
    MikeD got a reaction from terrytek in Apparently Facebook runs on 60+ Million lines of Code   
    I don't understand why you all think an F-35 or even a space shuttle should have more lines of code than facebook or any other website.
     
    In an aircraft or any other mission critical equipment where lives may be in danger (e.g. medical devices) you want a real-time system with extremely efficient code and no clutter. Just the bare minimum to perform the required tasks with extremely high precision. And you need to mathematically prove the correctness of most, if not all, algorithms if you want to send a space shuttle to outer space without it exploding mid-air because some value was losing precision throughout the calculations. The less code you have the less bugs you have to deal with.
     
    In facebook you are expecting the backend to manage your selfies and an array of other media types across several servers spread throughout the world in a secure fashion and to have a nice frontend to post your thoughts and upload your pictures and whatnot. Not to mention mobile apps, the code that goes into linking several platforms (you could upload pictures by sending them in an email to a specific facebook address not long ago, I believe), security, reliability, load-balancing algorithms for your data, advertisement, games (API's that enable these) and a slew of other "details" that need to be managed.
    And that's not counting each user's html page, otherwise the figure would be much higher (several orders of magnitude; besides, pages load dynamically, they are not static) but they should be counting (and probably are) the frontend (HTML templates, CSS, javascript, ...) that is needed to render those pages.
  22. Like
    MikeD got a reaction from SirPaul in Apparently Facebook runs on 60+ Million lines of Code   
    I don't understand why you all think an F-35 or even a space shuttle should have more lines of code than facebook or any other website.
     
    In an aircraft or any other mission critical equipment where lives may be in danger (e.g. medical devices) you want a real-time system with extremely efficient code and no clutter. Just the bare minimum to perform the required tasks with extremely high precision. And you need to mathematically prove the correctness of most, if not all, algorithms if you want to send a space shuttle to outer space without it exploding mid-air because some value was losing precision throughout the calculations. The less code you have the less bugs you have to deal with.
     
    In facebook you are expecting the backend to manage your selfies and an array of other media types across several servers spread throughout the world in a secure fashion and to have a nice frontend to post your thoughts and upload your pictures and whatnot. Not to mention mobile apps, the code that goes into linking several platforms (you could upload pictures by sending them in an email to a specific facebook address not long ago, I believe), security, reliability, load-balancing algorithms for your data, advertisement, games (API's that enable these) and a slew of other "details" that need to be managed.
    And that's not counting each user's html page, otherwise the figure would be much higher (several orders of magnitude; besides, pages load dynamically, they are not static) but they should be counting (and probably are) the frontend (HTML templates, CSS, javascript, ...) that is needed to render those pages.
  23. Like
    MikeD got a reaction from Ciccioo in Apparently Facebook runs on 60+ Million lines of Code   
    I don't understand why you all think an F-35 or even a space shuttle should have more lines of code than facebook or any other website.
     
    In an aircraft or any other mission critical equipment where lives may be in danger (e.g. medical devices) you want a real-time system with extremely efficient code and no clutter. Just the bare minimum to perform the required tasks with extremely high precision. And you need to mathematically prove the correctness of most, if not all, algorithms if you want to send a space shuttle to outer space without it exploding mid-air because some value was losing precision throughout the calculations. The less code you have the less bugs you have to deal with.
     
    In facebook you are expecting the backend to manage your selfies and an array of other media types across several servers spread throughout the world in a secure fashion and to have a nice frontend to post your thoughts and upload your pictures and whatnot. Not to mention mobile apps, the code that goes into linking several platforms (you could upload pictures by sending them in an email to a specific facebook address not long ago, I believe), security, reliability, load-balancing algorithms for your data, advertisement, games (API's that enable these) and a slew of other "details" that need to be managed.
    And that's not counting each user's html page, otherwise the figure would be much higher (several orders of magnitude; besides, pages load dynamically, they are not static) but they should be counting (and probably are) the frontend (HTML templates, CSS, javascript, ...) that is needed to render those pages.
  24. Like
    MikeD got a reaction from AustinB in The under 100 line challenge!   
    The usefulness of this program is very debatable, but here it is: https://gist.github.com/migueldferreira/e634a8c80bb4af5c258b
     
    It's a love calculator that gives you a percentage of the love one person feels for another based on their first name! Silly childhood games!
  25. Like
    MikeD got a reaction from LAwLz in Linus called adblock users scummy   
    I know there are lots of Youtubers using ads alone. Like I said, I don't think they should (more on that later).
    I believe someone else on this thread already said this: TV and radio have it figured out because there's no way (I think) of knowing if people actually watched the ad or not so these companies always get payed (depending on the share during that time period I suppose). YouTube (and the rest of the internet) is risky because you know exactly how many saw and/or clicked it. Which doesn't legitimize, in my opinion, ads as a source of revenue (ads at all).
    Forgive me (and point it out) if any of that information is wrong.
    Besides, most media outlets rely on other sources of income: paid journals and magazines, contests (the "call this number for 60 cents and enter to win this prize" (which makes a lot more money than I initially thought)), tax payer money (for publicly owned broadcasters), paid events, etc. And most are organized in groups where income from several events/mediums/products will finance (most of) the business.
    There is even a holding that belongs to the Portuguese Catholic Church responsible for 4 or 5 radio stations (2 of them among the most listened to (they mostly have pop music throughout the day!)). I wouldn't be surprised if some of the offerings to St. Jude (the patron saint of desperate cases and lost causes) ended up paying for Miley Cyrus's Wrecking Ball...
     
    And if the way of the future is to make a living off of ads then why not consider my earlier contribution of placing ads all over classrooms,  hospitals, clinics, even surgery rooms? They sure get a lot of visitors. Suddenly there's no salary, only ad revenue.
    "This lung transplant is brought to you by: XPTO tobacco. It's the best!", said the free defibrillator before charging. (Ohhhhh, I'd love to see this in a Futurama episode... I mean, they have already incorporated ads into Nixon's speeches...)
    And maybe I could live on that mansion after all... Granted, the walls are covered in ads but, whatever. It gives an artsy feel.
    Heck, why don't we all quit our jobs and become youtubers? Apparently there is an abundant interest in videos of cats, fake yelling sheep (or funny animal situations of any kind), game playing, among many other exciting things. Why wouldn't we all be able to go to our grandparent's, make a 6 second montage of a chicken scaring a rottweiler and get insta-famous? Lots of ad cash await...
    The risk is exactly that people producing quality content are competing with "funny". And funny wins most of the time. At least on radio and TV they pay you X (fixed + depending on share/rating) for a Y minute spot.
     
    We don't know, nor will we find out, whether or not people would be willing to pay for product reviews, will we now, since they are already freely available.
    However, people do pay to learn. And they also pay to have things done for them, like 25$ to assemble the computer parts they just bought.
    If you publish a video and say "Click here to watch for free, with ads or over there to pay <more or less amount of money I would have gotten from said ads> and watch ad free", maybe I'd rather pay. The same with Google services: "pay 5$ a month for these services (+ x$ for additional obscure ones) and never watch a Google ad again".
    Perhaps it's just me with my "ads are evil" theory.
    And yes, many content creators wouldn't make it. And that's related to the perceived value of their content. If ads ceased to exist and Google did in fact put a price on their services I bet most people would pay since they have settled in that ecosystem. Would most people pay to watch someone play games all day? Probably not. Would they pay to watch Linus teach them how to assemble a computer and to be able to chose better the next time they shop for parts? I would think so. Many people are monthly contributors here on the forum already, paying up to 25$ (?) a month to support LMG in exchange for no banners and a sub-forum. Lynda.com teaches you, for a price, how to do lots of things that you could learn elsewhere for free and they aren't out of business.
     
    But ads exist, and they keep most of the content out there free. And that's why I am faced with the following choices:
    1) Stop using any website/service that benefits from ads (yes, that basically includes all of Google and any webpage that has ads);
    2) Stop using AdBlock everywhere, enjoy all the free services, be subjected to the will of advertisers and not complain when a video of a cat earns it's owner more than a teacher/surgeon/whatever earns in a year;
    3) Keep using AdBlock and enjoying all the free services as a way of protesting the ad-centric business model, acknowledging, though, the hypocrisy in those actions (I don't really care for this one);
    4) Pay for the services I want to use without ads. Oh wait... I don't have an option...
    4) Not living on this planet anymore!
     
    Besides, so far this whole argument has been about how LMG makes most of its money from ads and sponsors and such. And even in a world without ads companies still need images, videos, reviews and that sort of stuff for their products, even if it's to show on their stores or web pages.
    Furthermore, when visiting LMG's "what we do" page, one can see that they are addressing companies that want to "deliver a message" about their products.
    We have seen some of those products, mainly for their client Func.
    My question at this point is: if ad revenue is so important that it's worth using the word scummy to classify AdBlock users (I wasn't even offended, the "ummy" at the end made it sound not so bad!) what happened to LMG's main business?
    Perhaps they could support The WAN Show and Techquickie and other videos without all the ads if their core business was more mature...?
     
    P.S.: Apologies for any lack of sense. It's rather late...! Feel free to call me out on any such thing.
    P.P.S.: Some people are trying to get this thread closed ("/thread"). Why? Why wouldn't you want healthy discussion to proceed? I am interested in the topic and I'm not talking to myself (much, yet!)... I just don't get it...
×