Jump to content

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

From Wikipedia, the free encyclopedia
Computing desk
< April 15 << Mar | April | May >> April 17 >
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 16

[edit]

Testing HTML/CSS/Javascript code

[edit]

In the creation of a new website built on one's own server, can the amateur website starter test out his or her written code before publicizing the website, and if so, how can it be done in Notepad? Can people write Javascript code in Notepad? What about inserting media files into the website? How do people insert Java applets into the source code? 140.254.136.149 (talk) 13:59, 16 April 2015 (UTC)[reply]

If you are not doing anything server-side (cgi-bin, or server-side includes) etc, then place the HTML, JS, CSS, Java objects in a directory, and use the file:// protocol to open the HTML file. Or drag the starting HTML file into your browser, which might be easier. You can edit in Notepad, but a syntax highlighting editor will be better. On this note, if you are using Microsoft Windows, then Visual Web Developer Express is a free download. IIS Express, Microsoft's webserver is also free; it is limited to 4 connections at once, but that's fine for home testing. LongHairedFop (talk) 14:56, 16 April 2015 (UTC)[reply]


Chrome update volume 2

[edit]

Referring to this question, the computer has been fixed and Chrome is working fine. I won't even bother to ask what went wrong and how that compares to information I was given.— Vchimpanzee • talk • contributions • 14:11, 16 April 2015 (UTC)[reply]

Windows program vs. Linux one-liner

[edit]

The Linux Command web-site claims that in Linux you can discover how much space the directories are occupying by simply typing:

du -s * | sort -nr > $HOME/user_space_report.txt

while in Windows an engineer need to spend almost one full-day developing a C++ program to perform the same task.

Is this case still valid? Are there many situations at all were a Linux one-liner could perform the same task that could only be matched by a Windows program? --Llaanngg (talk) 17:08, 16 April 2015 (UTC)[reply]

In all honesty, I don't understand why it's so fashionable to try to mock Windows. In this specific instance, all the claim has done is demonstrate that its author does not know how to use Group Policy Management, Microsoft Management Console, Logical Disk Manager, or any of a wide variety of other Windows utilities. In other words, the "expert" who proffered this "tidbit of wisdom" is decidedly not an expert for an entire category of very popular software.
Windows is not trying to be Linux: it is foolish to think that the very same command (or even the same general style of workflow) is applicable to both systems. However, Windows does have advanced file system quota management, and this sort of tool is used by millions of home-, business-, and enterprise deployed customers.
(And while we are nitpicking: neither du nor sort are actually part of Linux. Most users get du from GNU CoreUtils; most users get sort from GNU Core Utils also. Some of us get these tools from elsewhere, du and sort, the lineage of which traces to either BSD or GNU. These tools can, and do, run on Windows: gnuwin32 and cygwin are two examples. The GNU CoreUtil tools were not authored, nor are they presently maintained, as part of the Linux project. There is a common tendency among some users to conflate everything that is good about computers with "linux" - even though that is largely a misinformed viewpoint. See GNU/Linux naming controversy for some history).
Nimur (talk) 17:46, 16 April 2015 (UTC)[reply]
I'd say the "case is still valid" in that an expert with a good toolkit can (in almost any environment) usually outperform the inexperienced programmer who is apt to take an inefficient approach and/or reinvent the wheel. Happens all the time. —Steve Summit (talk) 19:30, 16 April 2015 (UTC)[reply]
I think you (and Nimur) may have missed that this guy was running "a Linux-like command line environment for [the legacy OS]", specifically Cygwin (according to the link). Linux was never involved in this anecdote at all.
Writing an equivalent of du -s * | sort -nr in pure C++ (without shelling out) would take maybe 10 minutes. I hope the C++ program the engineer wrote did a bit more than that. Otherwise they should maybe have hired a different engineer. -- BenRG (talk) 04:03, 17 April 2015 (UTC)[reply]
Yes, but the author of the page wrote a textbook called The Linux Command Line - when what he really describes is the bash (shell). The bash shell is not Linux. It existed before linux; it runs on dozens of other operating systems. A book that primarily trains users in bash should be appropriately titled. Our OP may do well to switch to a better book series written by a more open-minded, well-informed author. I recommend the O'Reilly bash Cookbook or Learning the bash Shell for new users. There is also excellent free documentation: GNU bash documentation. Nimur (talk) 14:24, 17 April 2015 (UTC)[reply]