Jump to content

  • Log In with Google      Sign In   
  • Create Account


Can programming screw my computer


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
22 replies to this topic

#21 Bacterius   Crossbones+   -  Reputation: 8532

Like
0Likes
Like

Posted 05 November 2013 - 01:22 AM


the really bad command(That wintertime were probably refering to) would be rm-rf /*
/ is the root directory on a *nix system so everything (included mounted secondary or external harddrives) will have their files deleted (assuming your user has the right to actually delete all files).

 

It's worth noting that this command is infamous enough that in most Linux distributions you will find that the rm utility now features a built-in failsafe which will either ask you if you really intended to erase your entire system, or will outright forbid it without being passed some awkward flag (e.g. --no-preserve-root). So it can be hard to do it accidentally these days on recent operating systems.


The slowsort algorithm is a perfect illustration of the multiply and surrender paradigm, which is perhaps the single most important paradigm in the development of reluctant algorithms. The basic multiply and surrender strategy consists in replacing the problem at hand by two or more subproblems, each slightly simpler than the original, and continue multiplying subproblems and subsubproblems recursively in this fashion as long as possible. At some point the subproblems will all become so simple that their solution can no longer be postponed, and we will have to surrender. Experience shows that, in most cases, by the time this point is reached the total work will be substantially higher than what could have been wasted by a more direct approach.

 

- Pessimal Algorithms and Simplexity Analysis


Sponsor:

#22 Karsten_   Members   -  Reputation: 1576

Like
0Likes
Like

Posted 05 November 2013 - 03:58 AM

Even if the current user does not have root access, it still recurses down and wipes out your home directory and any mounted memory sticks (more of a poke in the eye rather than a punch in the face but still not pleasant ;))

Most programming languages provide their own file handling system so it is rare that you would need to call "rm" using system(). This means that it is very unlikely that a developer does this by accident.

Edited by Karsten_, 05 November 2013 - 03:59 AM.

Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.


#23 Kurai Tsubasa   Members   -  Reputation: 203

Like
0Likes
Like

Posted 05 November 2013 - 04:04 AM

Even if the current user does not have root access, it still recurses down and wipes out your home directory and any mounted memory sticks (more of a poke in the eye rather than a punch in the face but still not pleasant ;))

Most programming languages provide their own file handling system so it is rare that you would need to call "rm" using system(). This means that it is very unlikely that a developer does this by accident.

 

 

 

 

 

 

Good programs only run and use resources when they are used. Sadly there are more and more bad programs with autoupdaters uselessly phoning home every few seconds the whole time your computer runs or preloaders that are supposed to make a single bloated program start a tiny bit faster (in the rare case you would want to use it) in expense of always slowing down booting and all other programs.

 

As for the danger. There are stupid things you can do like making an "rm -rf *" shell script, but normally your computer should survive.tongue.png

 

What is "rm -rf *" it is a code to deleting system?blink.png

 

it is a unix/linux command, rm is the remove file command. (similar to the "del" command in DOS and the windows command prompt), -rf are flags, r is for recursive (remove subdirectories and their content as well) and -f is for force (no yes/no promts, just do it) and * means all files in the current directory.

 

the really bad command(That wintertime were probably refering to) would be rm-rf /*

/ is the root directory on a *nix system so everything (included mounted secondary or external harddrives) will have their files deleted (assuming your user has the right to actually delete all files).

 

 

 

 


the really bad command(That wintertime were probably refering to) would be rm-rf /*
/ is the root directory on a *nix system so everything (included mounted secondary or external harddrives) will have their files deleted (assuming your user has the right to actually delete all files).

 

It's worth noting that this command is infamous enough that in most Linux distributions you will find that the rm utility now features a built-in failsafe which will either ask you if you really intended to erase your entire system, or will outright forbid it without being passed some awkward flag (e.g. --no-preserve-root). So it can be hard to do it accidentally these days on recent operating systems.

 

Wew,Thank you for the explaination ^^






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS