Wikipedia:Reference desk/Archives/Computing/2015 April 8

Computing desk
< April 7 << Mar | April | May >> April 9 >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


April 8 edit

Flicker at 1280p edit

Hi, if some elements in a page on IE11 flicker in 1280p but don't in other resolutions, what does it mean? Cheers — Preceding unsigned comment added by 176.12.107.132 (talk) 06:21, 8 April 2015 (UTC)[reply]

I moved your questions to the bottom and added a title. StuRat (talk) 06:46, 8 April 2015 (UTC) [reply]
I would guess that your display uses a lower refresh rate at 1280×1024 resolution (or did you mean 1080p ?). This is quite common with some display technologies. You may also find the flicker is more noticeable with lighter colored pages or pages with more contrast. StuRat (talk) 06:48, 8 April 2015 (UTC)[reply]

Why are these things allowed/a good idea in Unix/Linux? edit

Why are these things allowed/a good idea in Unix/Linux?

Files when in use are not locked. You can delete them. Couldn't that lead to stability problems? Isn't it easier to lock them if needed, and wait to delete them if in use? Isn't the absence of file extensions a security risk? When you run a Linux program, it could perfectly have the extension *.jpg, but be something completely different. Wouldn't that be a less secure option? After all, you could click on something expecting to see a picture, but run a script. Isn't is easier to develop a key-logger for Linux than for Windows, since Linux allows the users to hack the system? — Preceding unsigned comment added by Bickeyboard (talkcontribs) 17:01, 8 April 2015 (UTC)[reply]

Regarding file policy in the Linux kernel: read filesystems/files.txt and filesystems/Locking.txt.
Regarding file extensions: Linux (the kernel) does not concern itself with file extensions. User-space applications may implement their own philosophical design choices with respect to file extensions. For example, your graphical interface might choose not to execute a program if its extension does not end in ".exe" - although out in the wild, you will not find many such user-interfaces in common usage on Linux or Unix systems. Many smart people agree that this type of user-interface enhancement does not actually provide solid security.
If we want to make progress in this discussion, we really need to define terms: what "is" linux, what "is" Unix?
The critical point is that "Linux" in common parlance refers to an absolutely immense spectrum of related technologies, all clustered around the core piece - the linux kernel. A developer, system-administrator, site manager, volunteer group, or corporate distributor may choose to create a "linux distribution" - a group of technologies and softwares bundled together to meet some users' common needs. Those people who create the distribution must make informed choices about policy, security, and default behavior. If you choose to inform yourself about all the inner workings of these details, you may find that your specific Linux system does in fact contain protection (somewhere) against, e.g., a malicious user who installs a key-logger or fakes a file extension. That protection may be robust to certain types of vulnerabilities, and not robust against other types of vulnerabilities. But these details are specific to one individual incarnation of the system: other incarnations of Linux may have different behaviors, different settings, different security policies.
When you also include the phrases "Unix" and "Unix-like", you must also account for an even broader diversity of software technologies. The same take-away message applies: the spectrum of software out there is absolutely vast, and each incarnation is quite different from every other. Consider OS X, which Apple still proudly explains: "It’s built on a rock-solid, time-tested UNIX foundation." To the extent that Mac OS X is Unix, for example, you might investigate its behaviors with respect to file locking or file extensions; but many important parts of OS X are not Unix. In particular, you might read about Security Services. A clever developer who is familiar with Unix programming still wouldn't be able to casually install a keylogger on an instance of OS X: although they might be able to open up bash, compile a Unix-style program, and attempt to access hardware, they will quickly discover that there is more complexity to the system-wide security policy.
Along the same lines: if you were ever to poke around with eCos or INTEGRITY, you might (as a casual user) believe that these operating systems look and feel very much like linux - especially if your familiarity with linux ends at the layer of abstraction provided by the bash shell. But as you dig deeper into these systems, you will discover that (although they are POSIX-compliant systems) they are actually quite unlike Linux: their default behaviors, security policies, and core implementations are quite controlled.
So when you ask "why" these things are allowed: the answer is quite simple. These things are allowed because the spectrum of technologies that we generally call "linux" and "Unix" are built on (mostly) free software. Users and programmers are free to do anything they like : for most of this software, users may freely change, modify, inspect, redistribute, and even sell the software. If you rely on these technologies for security, you are also free to investigate these issues yourself. You are even free to hire a team of experts to do this task for you.
Nimur (talk) 18:08, 8 April 2015 (UTC)[reply]

Note that from the outset, Unix has supported hard links where the same file can have two (or more) directory entries. MS-Windows is derived from DOS, which is derived from CP/M, which don't support hard links (but later versions of MS-Windows do support hard links). When you delete a running program's executable, or an open file in general, then kernel notes this, and will only delete the file's disk blocks when the last on-file directory entry is closed AND the last file handle is close AND the last running instance of the program ends. The kernel handles running executables as having an open handle to themselves. LongHairedFop (talk) 19:14, 8 April 2015 (UTC)[reply]
The Unix model has always (or at least has for a long time) treated files and directory entries as different. Directory entries merely point (link) to files, and removing a directory entry has nothing to do with the file, just like assigning x = null; in Java doesn't affect (and can't be vetoed by) whatever object x formerly pointed to. This philosophy makes sense as long as insecure paths are looked up (and converted to a file handle) exactly once. There have been quite a lot of security problems caused by software looking up the same path more than once, but usually the file is not open in the interim—the most common problem is that the path's meaning changes between a call to stat() and a call to open(). -- BenRG (talk) 20:19, 8 April 2015 (UTC)[reply]
I think this behavior depends on the file system that is used by your *nix. It is possible to build linux with many file systems, and each implements its own paradigm. For example, ext2 and its descendants all use inodes for both files and directories: on Linux/ext2, files and directories are, in effect, represented exactly the same way in the file system. "A directory is a filesystem object and has an inode just like a file. It is a specially formatted file containing records which associate each name with an inode number." Insofar as ext2 was the "original" Linux file system, directories were "historically" treated as ordinary files, at least since circa 1993 - and this is exactly what the developers of the filesystem say! ext4 is journaled, and uses a giant hashtable (and many more small hashtables), so you might now be able to accurately say that "directories" are no longer represented as "ordinary files," but at some point, you will find that your terminology breaks down: we must stop talking about "directories" and "files" and begin talking about inodes, table entries, and paths. There are many many variations of the *nix filesystems, so this is hardly a universally-applicable description. Nimur (talk) 15:39, 9 April 2015 (UTC)[reply]
Yes, directories have inode numbers, but that's not what I was talking about. Instead of a Java local variable think of a field of another object: o.x = null;. Here o is like the parent directory (itself an object), x is like an entry in it, and again whatever object x formerly pointed to is not involved in this assignment and can't prevent it from happening. -- BenRG (talk) 05:08, 11 April 2015 (UTC)[reply]
Yes, you are correct that a file cannot prevent itself from being unlink(3)ed. The file itself is reference counted, which is analogous (but not exactly identical) to object management in the Java runtime. When the file's link count is zero, and when no process has the file open, the file system may reclaim its backing storage.
The unlink man page provides historical details in the rationale section. In ancient incarnations, Unix forbade ordinary users from calling it - ostensibly to ensure that only the superuser (or an equivalently privileged executable) could affect the integrity of the file system.
Nimur (talk) 13:53, 11 April 2015 (UTC)[reply]
Re file extensions, Ubuntu's standard file manager (Nautilus) prioritizes a known file extension over the executable bit. For example, when I copied /usr/bin/xclock to ~/xclock.jpg and double clicked on it, it opened in an image viewer (which complained about being unable to decode it). I think that all other file managers do the same thing, because of the security risk you pointed out. -- BenRG (talk) 21:10, 8 April 2015 (UTC)[reply]

Graphics/amount of gameplay features ratio question. edit

When developing some game, there is some limit on the amount of gameplay features and etc... you can add to it and still make the game be able to be played on a usual good modern pc.
Anyway, someone said to me that making the graphics worse (lets imagine dwarf fortress graphics vs skyrim ones), doenst give room to add more feature and stuff and still make the game playable. So reducing graphics is not a valid method for being able to have an more detailed ..... game.
Is he true?
I mean it sounds strange that if, as some example, I made some Real time strategy full of features with skyrim graphical quality and then before releasing the game, I changed it to have dwarf fortress graphics, I wouldnt have more "room" to add even more features without slowing down the game to an unplayable speed.201.78.195.190 (talk) 19:20, 8 April 2015 (UTC)[reply]

Having advanced graphics doesn't stop a game from having complex gameplay, but it might add exponential work as new animations might be needed. Let's say you decide to add some code to allow non-player characters to smile at the player when things are going well. In a highly graphical game, every NPC animation will need to be tweaked to accommodate this, as a smile affects not just the mouth but the eyes and other parts of the face. In a less graphical game, a smile might be pasted over the blocky mouth area of NPCs with trivial code, and in a roguelike game, the message "[character] smiles at you" might be sufficient. Also, graphics and programming are significantly different skills, and many programmers get satisfaction out of writing very complex roguelike games with no graphics or using a set of tiles. I suspect there are almost more programmers of such games than there are players!-gadfium 19:57, 8 April 2015 (UTC)[reply]
I am not talking about the extra time to make the graphics related stuff that could be used to add more features to the game. But about the % of pc that will be (MAYBE, and that is my question) wasted doing all this graphical stuff, and could instead be used in a case we have an game that have even more features (more npcs, more detailed ai, more stuff....) than it already has right now but we want to play at normal speed.201.78.195.190 (talk) 20:29, 8 April 2015 (UTC)[reply]
Your friend's comment sounds like nonsense to me, and your last sentence sounds reasonable. Dwarf fortress, by the way, can put serious drag on a system, as can minecraft. I'm sure a large DF fort could lag a given system in a way that vanilla Skyrim never could. But there are virtually no limits on gameplay features and design. Consider Nethack, one of the most complicated games ever made - it fits into a tiny amount of disk space, and can run on any computer made since roughly 1985. There are numerous similar examples, but that's probably the most well-known. Now, there are people who complain that ASCII graphics are too limiting, because if you want to have 100 monsters, a bunch of them have to be represented by the same character. But that's not really a limit on complexity, more of a limit on playability. Bottom line is, game play, game mechanics, and game design can be rather independent of graphics and visualization. They are often developed together, but they don't have to be. If you want to discuss these kinds of things, make sure you get familiar with the terminology - e.g. those three articles are about fairly different things. Some of the confusion here might have to do with software architecture - but that is also pretty independent. I believe DCSS is at least somewhat modular these days, and anyone can drop a new monster in to their own version without much hassle. But NH's code and architecture is notoriously convoluted, and that's part of why it hasn't gotten any new features in the past decade. SemanticMantis (talk) 20:05, 8 April 2015 (UTC)[reply]
Depends a lot on what you mean. Replacing one set of textures with a different set of textures should make almost no difference in performance. So, for example, rendering a realistic world versus a stylized fantasy world may make little difference if each world is modeled the same way. That said, the complexity of the models, light sources, and effects can make a big difference. Replacing a detailed landscape with complexly modeled features with a flat landscape and simple box buildings could make a big difference. Changing the level of details in your models is generally not a simple change, but it can make an appreciable difference in performance. The other issue is that a lot of the graphics rendering on modern computers gets handled off to the graphics processing unit (i.e. GPU / graphics card) while most game play logic remains in the central processing unit (CPU). Design and rendering changes that reduce load on the GPU may not offer that much benefit if your goal is to free up cycles in the CPU for game logic. Dragons flight (talk) 23:09, 8 April 2015 (UTC)[reply]

What has Bill Gates done for computer science? edit

What has Bill exactly contributed for computer science? Not as a philanthropist or as a business man, but more as of in a scientist role/inventor. So far I have only found an article of his, named "Bounds for Sorting by Prefix Reversal" and which appears to be the only one. --Senteni (talk) 22:55, 8 April 2015 (UTC)[reply]

Scientist? Can you run that by me again. I don't understand.--Aspro (talk) 23:04, 8 April 2015 (UTC)[reply]
He contributed more by recognizing and using the ideas of others than by his own inventions. StuRat (talk) 23:53, 8 April 2015 (UTC)[reply]
It is well-known that Bill Gates became successful as a businessman, not a programmer. He did not have a reason to write any programs once he began working on what would become Microsoft. That does not mean that he cannot write code. Paul Allen was impressed enough with him to team up with Bill on some projects. 209.149.113.89 (talk) 12:38, 9 April 2015 (UTC)[reply]
Bill Gates was not one of the great programmers, but he did enough deep programming to have a good understanding of the infrastructure that a programmer needs. One of Microsoft's under-appreciated virtues was that it provided a series of very powerful and relatively easy-to-use programming environments, including the Windows API, libraries, and "Visual" development tools. Those tools aren't directly visible to the end user, but they played a tremendous role in the success of the PC. Looie496 (talk) 18:01, 9 April 2015 (UTC)[reply]
He and Paul Allen created what was probably the first microcomputer implementation of the Basic programming language, on the Altair. I once had access to the source code for that (in assembly). It wasn't bad code. --Mark viking (talk) 19:38, 9 April 2015 (UTC)[reply]

microsoft programming edit

what os did microsoft use to code dos and windows (since they couldn't use dos and windows if they weren't made yet)? Spinderlinder (talk) 23:48, 8 April 2015 (UTC)[reply]

Well, firstly, "DOS" was not coded by microsoft, MS-DOS#History explains it a bit. It was a port of an earlier OS called CP/M, which was, I suspect, written in Assembly language. Windows was, and I believe still is mostly written in C, C++ and C#. Vespine (talk) 00:42, 9 April 2015 (UTC)[reply]
All 16 bit versions of MS-Windows (1.0 to 3.11) run on top of MS-DOS, as did Windows 95, 98 and ME (see History_of_Microsoft_Windows). They probably used Microsoft C/C++ running on DOS to create 1.0, and then running on the previous (then current) Windows to create the new one. The Douglas Coupland's book Microserfs is about the creation of Windows NT, which was the first version not to be based on DOS. It has (from what I recall) some technical details about its creation. Also see Bootstrapping#Software_development for the process, in general, of creating new software whose creation is dependant on a previous version of itself. LongHairedFop (talk) 10:43, 9 April 2015 (UTC)[reply]
CP/M was originally written in PL/M. Various websites with additional information are linked from our CP/M article). In particular, the PLM 386 programmer's manual linked from our website (and hosted by the Stanford Linear Accelerator Center) has a beautiful diagram on page 2 and 3, showing all the steps and all the different floppy disks that you needed to turn text source-code into executable program code for an iRMX or DOS operating system on an Intel microcomputer. You can imagine, by extension, that the techniques were similar to build CP/M itself. Nimur (talk) 14:39, 9 April 2015 (UTC)[reply]
If anyone have a PLM386 compiler, please share. Ajithrshenoy (talk) 16:40, 2 March 2016 (UTC)[reply]