Jump to content

WanderingFool

Member
  • Posts

    556
  • Joined

  • Last visited

Reputation Activity

  1. Like
    WanderingFool got a reaction from ChineseChef in Samsung's 16TB datacenter SSD   
    The thing to note is moving from the standard 2d gates to a 3D structure requires more initial investment (R&D and building the factories, as they may require new equipment to be built).  So while the initial cost of such products might be higher than consumer grade stuff, the fact the density decreases will have benefits to the consume *down the road*.
     
    The way to look at it is like, what is the major cost of making flash?  It isn't the lithography, but the purified silicon wafers.  So the more you can build out of a single wafer the cheaper things become.  Although someone can correct me if I am wrong.
  2. Like
    WanderingFool reacted to madknight3 in Beginners, please learn to debug your programs   
    Note: This isn't directed towards you if you're a complete beginner who has never started coding yet. Once you get started though, it wont be long before this information is relevant to you so come back after you can start making your own simple programs.
     
    Introduction
     
    We get a lot of topics here where someone posts their code that wont work and is (politely) asking us to fix it. Commonly they wont give us any extra information about the problem. Maybe you've done this yourself or were going to. Please read on.
     
    It's great that there are people on these forums willing to help you out even if you don't do any debugging. However, it's to everyone's benefit, especially your own, if you start learning how to pinpoint and solve your issues yourself. This doesn't mean you'll be able to solve all your own problems, and we're still here for you, but at the very least you'll learn how to provide more information when asking for help.
     
    A large part of programming is writing fresh new code to accomplish a task. Another large part of programming is figuring out why the code you, or someone else, wrote isn't working correctly. This process of identifying and removing errors is known as debugging. Every programmer should start learning to debug early because it's so helpful regardless of your skill level. So after you've went through a few tutorials and learned how to run some simple programs, it's a good time to jump into debugging.
     
    There are 2 places where you can start debugging:
    Using print statements Using a debugging tool In the future it will be useful to get into formal testing but don't worry about that at this stage.
     
    Using Print Statements
     
    Sometimes, no matter how advanced you are, all you need is a quick print statement to solve your issue. And it's a good place for beginners to start because they don't need to learn anything new. You may have already been doing this without knowing what the word "debugging" is and if so, great.
     
    All you need to do is to put print statements in your code that provide you with useful information. There are far too many languages where each language may have multiple options for printing so obviously I can't list them all, but you'll usually learn one way of doing it in your first couple tutorials. Many tutorials start you out with the traditional "Hello World" example so in many cases you learn how to output text to the screen in lesson 1. Here are some examples.
    // JavaSystem.Out.Println("...");// Python 2.7.xprint "..."// Python 3.xprint("...")// C#/VB.NETConsole.WriteLine("...");// Cprintf("...");// C++cout << "...";// PHPecho "...";// etc The point of using print statements for debugging is to help figure out what is actually going on when you run your code. What is in that variable? What does that function return? Did I get the correct input from the user? Does the code enter the if block or the else block? What is happening in that loop? etc
     
    It's a very simple method of debugging but it can still lead you towards your solution.
     
    Using a debugging tool
     
    Debugging tools offer many features and is a lot more useful than print statements in most cases. Essential, you get to pause your program at any line of code while it's running. While it's paused, you can have a look around at things like what value a variable currently holds. You can step through a program line by line, pausing at each line to make sure things are happening correctly or you can stop at only the specific lines you want. Sounds useful right? It'll take a little more work to learn how to use these tools, but once you do it'll make your coding life easier.
     
    If you are using an IDE, like Visual Studio, Eclipse, IntelliJ, Code::Blocks, etc, then they will have a built in debugging tool. If you prefer text editors like Notepad++, Sublime Text 2, etc, they may have a debugging tool, perhaps through an extension, but if not you may be able to download a standalone option. For example GDB is a standalone command line debugger commonly used with C. Many browsers also have developer tools that have debuggers. For example you can debug Javascript inside Chrome and Firefox. 
     
    The best way to learn to use these tools is to look for tutorials for the specific debugger that you use. It's also more likely to be in the language you're using which might make it easier for you to follow. Many debuggers are very similar though so if you learn to use one in say Visual Studio, you can probably then figure out how to use one in another IDE like IntelliJ.
     
    Here are some debugger tutorials for reference but feel free to go out and find your own.
    Visual Studio (1) Code::Blocks (1) Eclipse (1) GDB (1) Chrome (1) If anyone wants to help me add to this list, contact me and I'll add it in. Being an IDE guy, I'm not familiar with many options in the text editor/standalone areas.
     
    Conclusion
     
    So now that you know you should be debugging, when you run into a problem with your code then give it a try. It's perfectly fine if you can't solve your problem yet, we are still here to help. It's the trying and information gathering that will help you learn and become a better programmer. Treat each error as an opportunity to learn something new.
     
    So now that you're more informed, here are the things to post when requesting help:
    Purpose - What is the code supposed to accomplish? Code - The code itself (remember to use these forums [ code ] tags) Error - What is the error message you are receiving when trying to build or run your program? Line of Error - What line is the error message pointing at? Any additional information you think might be useful that you found while debugging. With debugging, even if you can't solve something yourself, you might find that your question becomes more narrow. You'll no longer be asking "Why doesn't my program work?" but instead asking more specific questions.
     
    And even if you're just stuck on the "I can't even get my program to run so I can't debug it" problem, you can still post the first 4 points I mentioned and someone can better help you get things up and running.
     
     
    If you have any questions/comments post below or send me a private message. Happy Coding!
  3. Like
    WanderingFool reacted to madknight3 in Help C++   
    You should be able to solve this with one pass through the input.
    // pseudo-codeCharArray wordToFind; //ex: helloCharArray input; // ehosnsejsllofor each char in wordToFind: find input[x]; // x would start at zero if found: continue looking for input[x+1] on the next character Repeat until word is found or you run out of characters to check
  4. Like
    WanderingFool got a reaction from clementk in Youtube will no longer allow video overlays of sponsor logos and product branding, unless Google is paid by the sponsor   
    I disagree, they do not make money off the video being played.  They make money off the ad being played, and that creates a problem when channels start disabling ads while doing their own sponsor spots.
     
    Remember even though youtube still had ads when google bought it, the ad revenue wasn't enough to make it profitable.
     
    All of that said, I am not sure how I feel about this.  What should google do then?
  5. Like
    WanderingFool got a reaction from Mojo-Jojo in A program to compare these words and find the one with the longest length, and the one with the largest value   
    alphabeta take care in reading your assignment, because the devil is in the details.  Look at the bolded portion of the quote, and underlined portion
     
     

    That means instead of using > in comparing the values, you really need be using >=
  6. Like
    WanderingFool got a reaction from ichihgo in a bit of optimization C++   
    Well without getting too complex into optimization, lets just discuss the simplest ones.
     
    You have a number X, and trying to see how many divisors/factors it has.
    I am going to say X is the number, and D is a divisor.
     
    X = D * N; //Since by definition D has to be multiplied by a whole number N is also a full number
     
    So looking at this formula there is no point in finding D and then later finding N....but lets limit the case by saying only finding D's so that D < N.  So now you are pairing up each D with an N.  So the count should be 2 times the amount of D's you find.  The exception would be when D * D = X, then you can add one.  So with that math said a loop to count the factors could look something like this.
    int targetNum = 123456;int numFactors = 1; //1 will always be a factor so start at 2double sqrtOfTarget = sqrt(targetNum);for(d = 2; d < sqrtOfTarget; d++) { //Notice that I an only going to the sqrt...because anything //beyond sqrtOfTarget will now mean targetNum = d * n; where d > n...so d would have been counted already when d and n were switched if(targetNum%d == 0) numFactors++;}numFactors = numFactors * 2; //To compensate for the matching n's//Now we have a problem when it is a sqrt, ie numbers like 9 as 3 would not have been counted.//Luckily we can do a single check of d to determine thatif(d*d == targetNum) //Since d is now equal to the number closest int above = sqrtofTarget numFactors++;//And presto, numFactors should be the number correct with doing less than half the amount of compares (if I am correct)//So on 100,000,000, instead of doing 100 million compares, you are only doing 10 thousand
  7. Like
    WanderingFool got a reaction from Lexias in Linux Steam bug has the potential to wipe out all files   
    Well it isn't a problem in Linux, it is a problem of using a command that basically assumes you have already run the checks to make sure you aren't about to wipe out stuff you don't need.  To be honest, I would have thought that Steam would be able to have come up with better solutions to uninstalling than just calling the delete all commands *they did a similar approach on windows*.  It is like using the format command on windows to clear a drive...you need to be careful when you use it not to do the wrong drive
  8. Like
    WanderingFool got a reaction from Technous285 in Linux Steam bug has the potential to wipe out all files   
    Perhaps I was a bit too liberal with the delete all command...but when you do cleanup of a program, I would expect that if you do use commands that will recursively wipe a directory that you would at least put in checks to ensure that you aren't cleaning out the wrong folder (or an important folder).  Some methods I have seen in the past was the uninstaller wipes the directories that it has created and then cleans out the top level files...this is more a fine approach to the situation, it prevents the deletion of unwanted data (unless you happened to store stuff in the folder which it created, but that is another issue all-together).  I hope this makes more sense.  Basically I am saying if steam is normally in somewhere like
    C:\pf\steam, it shouldn't just say delete everything in c:\pf\steam, but rather it should have knowledge of the files that should be in the top level directory and delete those, and then delete the files in the sub-folders *although if possible only delete the files that you know were created, but that can be another issue and more complex*.  If they had gone with that approach then worst case scenario you wipe a few folders worth of data and definately no critical data (like entire harddrives worth of data).
     
    The main thing that I have an issue with though is that it has in the comments scary, and yet they took zero precautions to check that they weren't deleting the wrong thing
  9. Like
    WanderingFool reacted to dalekphalm in Canada prohibits installation and/or update software without user consent   
    Could be. It would be interesting to see a digital privacy expert weigh in on this, like Michael Geist.
  10. Like
    WanderingFool got a reaction from LAwLz in World’s first (known) bootkit for OS X can permanently backdoor Macs   
    I believe the biggest issue at the moment is the fact that you are nitpicking on the fact that Apple didn't lie, and you are missing the concept that Apple was intentionally putting out information which they knew would confuse the general consumer into believe that Macs were immune.  The tech-savvy people of course know better, but the reason they don't like it is because they have to deal with the friends and family who "believe" the ads.  I know I had to explain multiple times that they were using wordplay, and as a result I was quoted back the ads that said "doesn't have viruses" and having to correct them (of course then they don't believe you because "Apple wouldn't be allowed to publish false information").  It like a sugar company putting out an ad for sugar and at saying at the end "A healthy way to start the day is a healthy meal", while true they are subtly implying sugar is a morning snack.  Just like how when Apple states "Doesn't get PC Viruses" it is implied that they are position the phrase in such a way that users are led to believe that there won't be viruses.
     
    The thing is context matters and in this case it is about how Apple presented their material.  You keep calling people dumb, but if the majority of people believe something then perhaps it isn't stupidity but rather misinformation has been spread....after all I could likely find something you believe in that is completely false and call you dumb for that, but that doesn't make it true.
  11. Like
    WanderingFool got a reaction from Kukielka in World’s first (known) bootkit for OS X can permanently backdoor Macs   
    So first to contribute to this topic.  This is what is always scary about things like thunderbolt, in order to get the high speed low latency they basically get direct access to the hardware (and if I remember correctly direct access to ram).  This is why it is worse than thing such as badusb.  In the badusb case you would need to still run the exploit code and thus it should be easier to prevent with anti-virus and such.  If I understand this exploit correctly, they would be able to do this basically behind the scenes without the operating system being able to intervene.
     
     
     
    I am sorry, but you are nitpicking at small details without looking at the larger picture...Apple was essentially using word play to trick viewers into believing a falsehood.  If a company makes a commercial saying things like "I don't get the current virus going around" and then continue on the trend with "doesn't get PC viruses", then they are playing into the false idea that macs didn't get viruses.  Yes they aren't technically saying Macs were immune, but frankly that doesn't matter in the grander scheme.  When you advertise you need to do so so the general audience is able to understand what you are stating, and many people misunderstood the concept "doesn't get PC viruses" as more secure and safe.  That doesn't make them stupid either *which is something you claimed earlier*, everyone has gaps in knowledge and back in those days how was a non-techy suppose to understand.
     
    It is sort of like medication commercials, when they list the side-effects they really aren't allowed to use the technical terms.  You never hear things like "side effect may include myocardial infarction" because if they did most people wouldn't understand it.
     
    So ultimately what I am saying is this.  Apple targeted the ads towards people who didn't know about the technical side, and by doing so was falsely advertising as it created a culture of people who believe Macs were virus free (which btw was a good 80% based of the people I had to correct back in the day).  And again that doesn't make the people who believed it stupid
  12. Like
    WanderingFool got a reaction from McMurderMonkey in 007, meet the "Motion Microscope" video processing tool...   
    The only thing about the high frequency camera's is the amount of frame-rate you actually need is pretty high.  Even assuming a lower toned female voice is 165hz, with nyquests theorem you could need at least sample at 330hz...which means a camera that can capture 330 fps.  If you go more of a higher ranged female talking voice of 255hz, you need 510fps on the camera.
  13. Like
    WanderingFool got a reaction from Nuluvius in A weird phenomenon that I can't explain   
    I agree with the other people, the first thing that popped into my mind was that they might have a different font installed that makes it render slightly differently (like a modification of the font the game uses).
     
    Other potential causes:
    Screen resolution (If they have a funky screen res, it might force a slightly different rendering)
    Hardware differences (who knows maybe their video card makes a floating point error and thus shifts it by one)
    Is everything shifted by 1 or 2 pixels or just the text, because if you are capturing the whole screen, maybe something is pushing the game up by 1 pixel
  14. Like
    WanderingFool reacted to Nuluvius in A weird phenomenon that I can't explain   
    My gut feeling right now (without getting into any research) is not if their OS font/DPI (especially the DPI) settings are different on their systems. Run some experiments/conduct some research?
  15. Like
    WanderingFool got a reaction from MatazaNZ in [C#] External Third Party Libraries   
    So this will apply in general and not just to C#.  When you are making use of a third party dll, it must be included with the executable...the exception would be for dlls that get installed with other programs, and are accessible system wide (but in this is a smaller case and likely doesn't apply here).
     
    Essentially there are a few options.  If the third party dll is written in C#, you *might* be able to get the .lib type of file so when you compile you actually compile the code into the exe (Uhm to be honest, I am not sure this is possible in C# though, I have never tried it...but I am use to using C++ at the moment and have done it with that).
     
    Another option would be what you mentioned, an installer that installs the dll along side the exe.
     
    Another option, would be to dynamically load the dll, and make the program check for the dll.  If the dll isn't found then it downloads the dll (or not something I recommend, but have the program contain the dll embedded in it and instead of downloading it, you just copy the dll out of the binary data).
     
    That is all I can think of, I am sure there are other people who will be able to help you out more though.
  16. Like
    WanderingFool got a reaction from jezza39 in Cops can make you unlock your phone if you use your fingerprint to unlock.   
    I believe the important thing to note here is that despite the wording of the article's title and first paragraph, cops can't force you to provide your fingerprint to look at your phone (they still need a court order and maybe even a warrant to do so).
     
    To be honest though, I find it a crazy concept that you are allowed to withhold passwords.  We are entering the age where it is nearly impossible to access certain data without the correct password, and I don't buy the whole "self incriminating" concept.  We live in a digital age, and the fifth amendment just wasn't designed with the concept that things such as passwords might the only key to getting data.
  17. Like
    WanderingFool got a reaction from alpenwasser in Is this considered a bad practice?   
    From what I can see, my personal opinion is that you are all good.
     
    As a note, I am not really sure that really is an anonymous array...as you can easily re-access the arrays *as they are part of the other array*
     
    A more classical example of an anonymous array, which I would say would be a bad practice would be this
    sendBusMessage((byte[]){ 0x3F, 0x05, 0x00, 0x0C, 0x52, 0x01 }); But given that you have set the arrays to a variable, they really aren't classified as anonymous and I would say it is good....the main reason against anonymous arrays would likely be that they are not really readable and not as easy to change *if you are working with a large program*
  18. Like
    WanderingFool got a reaction from Zeruel in Data Structures Homework :D   
    What Ciccioo said about bitwise for function one.
    In case you aren't familiar with bitwise  (n >> 1) == (n / 2) and (n << 1) == n * 2 and you can lookup the bitwise operator & (if you want to be the most efficient)
     
    A few other notes, Stringbuilder in java is a handy class (it is suppose to be more efficient than constantly adding to strings) so I would look it up.
    In terms of building the string and then reversing the string, ask yourself is it necessary?
    Why do
    //Why dobinaryString = binaryString + "1";....[binaryString reverse]//when you can dobinaryString = "1" + binaryString;...[No need to reverse] For function 2, I am sorry it is too early for me to read through it and figure out what you are doing...but I would like to say this.
    While I am aware the problem is (2^n) mod m...there would have been a trick if it were reversed m mod (2^n)...but alas no such luck.
  19. Like
    WanderingFool got a reaction from KingKeith55 in Google bans security and privacy app from Google Play store   
    I have had the internet since dial-up days, and I don't ever remember a time where there were no ads.
     
    Also it can be very dangerous for google to greenlight apps that clearly violate other apps terms of service.  You can do whatever you like in your own app, but the instant it starts affecting other apps revenue I have a problem with it.  The issue is this doesn't just block the malicous tracking ads, but it blocks all ads.  So many developers would be less likely to offer free apps, or you could see an increase in microtransactions.  The thing is, if you don't like ads in an app don't use an app or purchase one of the apps that don't have ads.  All I see this as is Google trying to protect developers from other developers who think that all ads are evil. *it would be different if it still allowed the ads through but broke the tracking features*
     
    In a more extreme case, I ask you this.  Is it right to use an ad blocker if the developer offers an ad free version (but at a cost) and an ad supported version for free?
     
    As a note you mentioned that there are more effective ways to make a living than advertising, feel free to list them...because advertising for apps is from my perspective still one of the most profitable, other than selling them for a cost or micro-transactions (which isn't always practical).
  20. Like
    WanderingFool got a reaction from Ashley in Google bans security and privacy app from Google Play store   
    I have had the internet since dial-up days, and I don't ever remember a time where there were no ads.
     
    Also it can be very dangerous for google to greenlight apps that clearly violate other apps terms of service.  You can do whatever you like in your own app, but the instant it starts affecting other apps revenue I have a problem with it.  The issue is this doesn't just block the malicous tracking ads, but it blocks all ads.  So many developers would be less likely to offer free apps, or you could see an increase in microtransactions.  The thing is, if you don't like ads in an app don't use an app or purchase one of the apps that don't have ads.  All I see this as is Google trying to protect developers from other developers who think that all ads are evil. *it would be different if it still allowed the ads through but broke the tracking features*
     
    In a more extreme case, I ask you this.  Is it right to use an ad blocker if the developer offers an ad free version (but at a cost) and an ad supported version for free?
     
    As a note you mentioned that there are more effective ways to make a living than advertising, feel free to list them...because advertising for apps is from my perspective still one of the most profitable, other than selling them for a cost or micro-transactions (which isn't always practical).
  21. Like
    WanderingFool reacted to MrSuperb in Data Structures Homework :D   
    int a = 0;for( int i = inArray.length - 1; i >= 0; i-- ){ outArray[a++] = inArray[i];} really?
  22. Like
    WanderingFool got a reaction from DoubleY in Twitch starting to scan VoD's audio for copyrighted content.   
    To be fair, it might have nothing to do with Google at all and more of the size of Twitch.  The problem with blaming it on google is they don't even own the company yet....and this sort of implementation likely takes months of testing before the public release *and months of planning before that as well*.  Also they are using a non-google company to do the music search?  If it was really google forcing their hand on Twitch, it would stand to reason that they would more likely use Google's implementation and not outsource to another company
  23. Like
    WanderingFool got a reaction from squirrl in Noob seeking a troubleshoot?   
    Rossyboy I think by correcting the int problem that squirrl mentioned should fix your problem.
     
    The reason being that the issue Squirrl brings up makes dude an incorrect class, and then calling a method from Josh using dude means it can't properly detect the correct class.
     
    With that said if correcting that issue doesn't work, try implementing the ratedance method prior to implementation of the main class (It shouldn't matter, but who knows...you usually don't define classes in cpp files, usually it is in header files and implementation goes in cpp files)
  24. Like
    WanderingFool reacted to squirrl in Noob seeking a troubleshoot?   
    You already declared ch1 and ch2 as int. You don't put a type when calling a method or constructor in this case at least.

    Josh dude(int ch1, int ch2);Should be:
    Josh dude(ch1, ch2);
  25. Like
    WanderingFool reacted to loganryan99 in [Official][Update 8/15] Linus Tech Tips API   
    With the way current LTT notifiers work, they constantly have to reload the index page of the forum and parse the messy HTML and stuff, and download all of the images just to get the notification count. I figured I would make a simple way to fix this.
     
    API URL: https://linustechtips.com/main/page/api.php
     
    This page returns a JSON array with some data about the member currently logged in. Any future LTT addons should use this as it increases speed and reduces bandwidth
    Functionality will be expanded in the future.
     
    Note: When there is no user logged in the display_name value will be set to Guest.
     
    If you're developing an extension outside of a browser, you'll have to figure out a way to send a POST request to the server to log the user in. I'm not even sure this is possible at this point because IPB might have some kind of security for that.
     
    Update 8/14:
    Use this URL: http://linustechtips.com/main/?app=core&module=global&section=login?cm_api=true to process sign in from external apps. You should be able to just display it to the user then save the cookies it gives you somehow. I'll publish my implementation of it when it's ready.
     
    Update 8/15:
    Using this URL: http://linustechtips.com/main/index.php?app=core&module=usercp&tab=core&area=notificationlog&cm_notif_api=true you can get user notifications encoded in JSON.
×