Wikipedia:Reference desk/Archives/Computing/2015 November 2

= November 2 =

JPEG compression question
When I save a JPEG in Photoshop Elements, it asks me for the amount of compression. There is a selection or quality (up to "maximum") and a number. You can change either one. If you select Maximum, the number defaults to 10, but you can change the number up to 12. Does turning it to 12 get more quality than 10? Bubba73 You talkin' to me? 02:15, 2 November 2015 (UTC)
 * I don't know the answer - but you can find out. Save an image at 10 and then save the same image under a different name at 12.  Look at the size of the files - if the '12' file is larger than the '10' file, then it's almost certain that the 12 file has better quality...if the files are the same size - then almost certainly they are identical. SteveBaker (talk) 04:46, 2 November 2015 (UTC)


 * The "12" files are larger. Bubba73 You talkin' to me? 04:48, 2 November 2015 (UTC)


 * Here's a nice analysis of "quality" setting for jpegs. Here's another that focuses on the blocking and how it interacts with the "quality". These approaches are rather empirical, but you can also look into the technical specs to determine what's going on from first principles . In short, 10 is a default near-max, because in general increasing the value to 12 won't help much, but in some certain cases it may. SemanticMantis (talk) 15:58, 2 November 2015 (UTC)


 * Thanks, this answers my question:

''“0-100” is really “0-12” — Lightroom maps the 101 points in its 0-100 quality scale to only 13 different quality outputs. Setting the Lightroom quality to 70, for example, results in the exact same output as setting it to 76, or anything in between. 7 is the same as zero, and 93 is the same as 100. The full mappings are shown in the examples below.''

''Those familiar with Photoshop will recognize 13 as the number of quality settings in Photoshop's Save-as-JPEG option (with 0 being “Low quality”, up through 12 being “Maximum Quality”). I haven't tested whether these are indeed the same except for the numeric scale presented to the user, but I suspect they are.''

But I still wonder why if you select "maximum quality", it defaults to 10 instead of 12. Bubba73 You talkin' to me? 16:04, 2 November 2015 (UTC)

Syntax for Regular Expressions doesn't carry over to CFG's
Why does this Article on Syntax Analysis(P.28) says that "Syntax for Regular expression doesn't carry over to Context-free grammar?I have this doubt because even though they say "we can't use * or | in Context Free Grammar" they have used it as shown in the article.Does this mean we can use it in Context Free Grammar?JUSTIN JOHNS (talk) 08:44, 2 November 2015 (UTC)
 * Well, regular expressions and formal grammars are two different formalisms. A frequent convention is to use the vertical bar | in grammars as a short-hand for alternative productions with the same left hand side. This is similar to the use of the vertical bar is some versions of regular expressions to denote alternatives. The author of the Stanford slides is trying to make sure that the students understand that you cannot use arbitrary regular expressions as right hand sides of grammars (which would result in an effectively infinite set of productions, and really mess parsing theory up). That's why he is stressing the point in the slides. --Stephan Schulz (talk) 11:58, 2 November 2015 (UTC)
 * I don't think it would mess anything up. There's no theoretical reason why the CFG notation forces you to name every node and the RE notation doesn't. "A → B (C | D)" would unambiguously have the same meaning as "A → B A'; A' → C | D" where A' is a fresh name. "A → B*" could mean "A → AB | ε" or "A → BA | ε", but the only difference between those is the parse tree, and there's no fundamental reason why we care about parse trees for CFGs and not for REs. -- BenRG (talk) 17:25, 2 November 2015 (UTC)
 * You get into trouble when you allow the Kleene star. Without the Kleene, the language described by the RE is finite, and you can always expand the rules. But if you allow the Kleene star, that expansion becomes infinite. In an formal grammar, only a finite set of productions is allowed. But what is more, typically nothing but | and maybe implicit concatenation is allowed. A confounding factor is that one example in the slides it uses "*" as a terminal symbol, not an operator. --Stephan Schulz (talk) 18:11, 2 November 2015 (UTC)

Yeah you're right that's really confounding.Thanks for clearing my doubt.I've mistaken the "*" as an operator rather than a terminal symbol which the author of slides actually meant to be.Also can we use parenthesis in formal grammars?JUSTIN JOHNS (talk) 06:41, 3 November 2015 (UTC)
 * A Ben has pointed out above, you probably could, but I've never seen it done in any texts or papers. Since parenthesised expressions are one prime example of a language that context-free grammars can describe and that REs cannot, you'll see '(' and ')" rather often as terminals. Again in the Stanford slides, the author explicitly excludes them: "Cannot use *, |, or parentheses." (page 24ff), just after he introduced "|" in a similar but different role (abbreviating sets of rules with the same LHS into one rule). --Stephan Schulz (talk) 08:22, 3 November 2015 (UTC)

Yeah that's right.It might be for precedence.JUSTIN JOHNS (talk) 08:50, 4 November 2015 (UTC)

How do you get onto the internet (world wide web) of a foreign country?
Let's say that I wanted to get onto the internet (world wide web) of a foreign country. How do I do that? Does the computer somehow "read" my IP Address and "know" that I am in the USA? And therefore it connects me to only USA websites? Or is something else going on? For example, I have typed in a lot of Spanish words in the Google search, thinking that maybe that will take me to some Spanish country's websites. But, it merely took me to the USA websites, translated into Spanish language. So, hypothetically, let's say that I want a search term like "most popular TV shows" (or whatever). But I want the results from, say, the websites of France. How would I get that? If I type in "most popular TV shows", that will take me to USA sites. If I type in "most popular TV shows, French or France", that still doesn't help. What does one need to do? Thanks! — Preceding unsigned comment added by 2602:252:D13:6D70:F186:6FAE:7FE0:7883 (talk) 09:21, 2 November 2015 (UTC)
 * If you already know what you want to see, just type its addressinto the browsers address bar. If you are looking things up, consider using a search engine based in the country of interest. As I check, I just entered www.google.fr into my address bar and TV ce soir into the search box and I got lots of French sites. -- SGBailey (talk) 09:39, 2 November 2015 (UTC)


 * You can limit your Google search to Spanish websites by adding the site:.es search operator to the search term. Rojomoke (talk)


 * I'm pretty sure you can tell google to give you results in a language other than the one it's guessed is yours. —Steve Summit (talk) 11:33, 2 November 2015 (UTC)

"google.com/ncr" takes to main google site without region redirect. use site:.fr/.se/.de/.countrycode tld to search country-specificMahfuzur rahman shourov (talk) 15:47, 2 November 2015 (UTC)


 * The Internet is one global network. For instance, here's the website portal of the French government. This is the same website you would get if you were in France. But, you were on the right track. What is happening in your scenario is Google is guessing you are in the U.S., and deciding to show you only English-language results. They are doing this based on your IP address and most likely some other factors. For instance, Web browsers usually send HTTP headers that include a list of requested languages for content. And, if you've used Google before, and your browser keeps cookies, Google tracks your searches to build a profile of you. Based on this, Google shows you the results it thinks you'll be most interested in. Remember, Google is a for-profit business whose goal is to show you ads. They want you to keep using their search engine so you will see their ads, so Google has invested a ton of resources in trying to predict what you're most interested in. --71.119.131.184 (talk) 22:02, 2 November 2015 (UTC)

So where do I find the various codes? Someone above said that "es" was Spanish. Another person above said that "fr" is France. Where do I find those codes? Thanks. 2602:252:D13:6D70:D4BE:FEEC:EC9C:DA2 (talk) 04:38, 3 November 2015 (UTC)
 * Please see List of Internet top-level domains, specifically the section § Country code top-level domains. -- ToE 05:02, 3 November 2015 (UTC)

It's still not working. I am not exactly sure what I am supposed to be typing in and where? So, say I want to search a topic like "gardening", and I want the French websites for that topic. What do I type exactly? And where? Do I have to go to Google for France (google.com.fr)? Or do I just type the search words "gardening" with the additional "site:.fr"? I am confused. What should I be doing exactly? Thanks. — Preceding unsigned comment added by 2602:252:D13:6D70:186C:D475:39EF:E0EC (talk) 19:00, 3 November 2015 (UTC)


 * It looks like you can restrict your search to a certain language on the "Advanced Search" page.
 * Now, google likes to keep the Advanced Search page pretty well hidden -- indeed I thought they'd gotten rid of it a while ago -- but just now I discovered it hiding on the Settings menu in the lower right-hand corner. —Steve Summit (talk) 21:29, 3 November 2015 (UTC)


 * But also, typing  works. Note that that will find pages on sites registered with a .fr country top level domain. That does not guarantee French language, and it also does not guarantee that the server is physically in France. Indeed, if you search for an English word, you will still get a lot of English language pages. But try   after you have selected francais as one of your languages under Settings->Languages->Search Results. Also keep in mind that Google is not the internet, but only a convenient way to find certain pages in the World Wide Web, which runs on top of the internet. You can use the Web without Google (try DuckDuckGo or Bing).  --Stephan Schulz (talk) 22:22, 3 November 2015 (UTC)

Thanks. — Preceding unsigned comment added by 2602:252:D13:6D70:2133:96D1:E52:1192 (talk) 19:52, 7 November 2015 (UTC)

Inexplicable DHCP activity
I noticed some strange DHCP activity in my router's "security log":

11/01/2015 23:08:53 DHCP Client: [WAN]Receive Ack from 172.19.57.129,Lease time=86400

11/01/2015 23:08:53 DHCP Client: [WAN]Send Request, Request IP=68.97.47.54 <-- (my WAN IP)

11/01/2015 23:08:53 DHCP Client: [WAN]Receive Offer from 172.19.57.129

(The log entries are in reverse chronological sequence; read bottom up) These days, I tend to get a little paranoid when I see unexplained activity in my system. When I tried to geolocate 172.19.57.129, it said it's a private IP address, which, according to this page, means an address on my local network. If that's true, it's the first such address I've seen that wasn't in the range 192.168.2.x. And I don't know how to interpret this since the log entries say "WAN". I need to know what this might be, and if I should be concerned about it. 68.97.47.54 (talk) 09:22, 2 November 2015 (UTC)
 * The mystery IP is your internet provider's DHCP server. Essentially, your computer is actually a member of 3 networks - your home network (handled by your router, using the 192.168.2.X IP range), the Internet (using the whole range of public IPs), and your ISP's network (using the 172.16.0.0/12 block).  If everything is going fine, you barely see the ISP's network, but for your computer to interact with the Internet, it needs to get a global IP address.  The global IP is given out by the DHCP server of the ISP's network, which is what you're seeing here.  A rough translation of the conversation would be:
 * (ISP DHCP server): "Hey, want an IP address so you can keep using the Internet?"
 * (Your router): "Sure, I'd like the address 68.97.47.54 if possible"
 * (ISP DHCP server): "OK, you're now registered with that address. This will last for 86400s, and once that expires we'll do this again."
 * MChesterMC (talk) 10:42, 2 November 2015 (UTC)
 * Makes sense, and thanks for the English translation. 68.97.47.54 (talk) 04:53, 3 November 2015 (UTC)

How to stop disable and uninstall the IIS (Internet information service) in Windows 10 home edition?
My instructions where to go to MSconfig via the Search\Run box, there to "Services" and then disable it, but, unfortunately, I didn't find there such a service "IIS" or "Internet information service"; What is the right way to finally remove it in WIN10 so I could finally using port80 and not alternative ports for WAMP? Thanks. Ben-Yeudith (talk) 13:00, 2 November 2015 (UTC)


 * I'm fairly sure that this is under the "Change or Remove Windows Features" dialog in the Control Panel. I'm not at a Win10 computer right now so I can't double-check it for you, but searching the Start Menu for "windows features" brings it up in Windows 7. In that window there'll be a box for IIS, uncheck it and IIS should be removed. 67.133.155.66 (talk) 13:45, 2 November 2015 (UTC)


 * Thanks, it was under "Control panel" > "Programs and features" > "Turn windows features on or off" (I needed to use the search box a bit to find that). Ben-Yeudith (talk) 17:07, 2 November 2015 (UTC)

difference
W8 v W7 64bit.? Also do you need 64bit ram?31.55.64.143 (talk) 20:47, 2 November 2015 (UTC)
 * There are a few differences between 32-bit and 64-bit operating systems (some are listed at 64-bit computing). You don't need special RAM to run a 64-bit version of Windows, but you will need a 64-bit processor. clpo13(talk) 22:05, 2 November 2015 (UTC)
 * Hey look, we have articles on both Windows 7 and Windows 8. There is no such thing as "64-bit RAM". You do need a 64-bit processor to run a 64-bit version of Windows, but all x86 processors released in the last decade have 64-bit support, so you don't need to think about it unless you're planning to use some pretty old hardware. --71.119.131.184 (talk) 22:12, 2 November 2015 (UTC)
 * That isn't necessarily true of low-end hardware. The Intel Atom Z2580, released in Q2 of 2013, is 32-bit only. I don't know if anyone runs Windows on it, though. -- BenRG (talk) 06:44, 3 November 2015 (UTC)
 * Oh hey, I stand corrected. Intel Atom says some but not all support 64-bit, and you can run Windows on the Atom. But yeah, I think few individuals are buying bare Atom systems and installing Windows on them. --71.119.131.184 (talk) 06:50, 3 November 2015 (UTC)
 * I think there were definitely people running Windows on the Atom systems on Netbooks and Nettops. They only had a niche market but were there. Besides CPU support issues, there were also driver issues e.g. Intel Atom (CPU) . Nowadays of course there are the HDMI dongle sized mini computers and people also try WIndows on these. Intel's support for Windows 64 bit on their lowed end systems has always been a bit weird, their Bay Trail CPUs aimed at the tablet market lacked drivers for always on standby in the early days meaning all of these were 32 bit Windows, and generally 2GB although I think LPDDR3 RAM chip sizes in the early days made 4GB difficult anyway. (You could of course run 4GB on Windows 32 bit, but the limitations meant I don't think this was likely with the tablets. Not that the Bay Trail WIndows tablets were ever that popular, but they were at least more popular than the ARM/Windows RT ones) Nil Einne (talk) 07:19, 3 November 2015 (UTC)
 * I know about the existence of Atom netbooks. I worded my statement very carefully: "individuals buying bare Atom systems", i.e., bare metal. It sounds like the original poster is building their own PC and installing Windows on it, which is why they're asking about required hardware. If they're buying a finished system, they don't need to care about RAM or CPU support for the OS, as that's the job of the system manufacturer. --71.119.131.184 (talk) 19:29, 4 November 2015 (UTC)
 * Right but although my comment was in reply to you, it also mentioned the general issues with Atom systems and 64 bit Windows, and these problems apply to both netbooks (which you didn't mention, but which are relevant to the OP and which evidentally do use the D2550 mentioned by BenRG (http://www.aliexpress .com/item/14-Netbook-PC-Ultra-Thin-Intel-Atom-D2500-D2550-Dual-Core-1-86Ghz-4GB-RAM-500GB/1410107355.html) and to any other system with an Atom. I also mentioned Nettops besides Netbooks. Nettops may be finished systems, or they may be bare metal or they may be even less (e.g. just a mobo with CPU and possibly RAM). People have bought them for a variety of reasons, general systems, downloads computers (i.e. for most people torrent boxes), probably even some seeding boxes, car computers and a bunch of other uses I can't think of offhand. Probably some even used them for media computers, even though they often weren't that good for it. Only the car one and perhaps the seed box is most likely not going to be using Windows (or if it did, probably one of the embedded versions). People may suggest another OS for download computers, but most people seem to choose Windows, because it's what they're familiar with and what the programs they use work on. Also, your later statement isn't true. In fact it isn't that uncommon for a system including laptops sold to the everday consumer for everyday use in some parts of the developing world to come with no OS or more likely FreeDOS to reduce cost. Particularly cheap systems which in the developing world would generally have ultra low end hardware (i.e. Atoms). Although far from exclusively, e.g. here is a 4th gen Core i3 with FreeDOS  and here is a 5th gen i.e. Broadwell Core i7  (I think the 5500U ) . It shouldn't surprise anyone with a bit of knowledge to realise no one is going to be using FreeDOS on these long term. Sometimes Linux may be installed on these systems (and very occasionally something else like some BSD variant or OS X), but I'm pretty sure more commonly Windows without a proper licence. Also, if your system came with 32 bit Windows (perhaps Windows Vista or even XP), and you want to upgrade, you probably want to consider what version of Windows to install, like the OP is doing.  Note that your specific earliest comment (to which I was also partly replying to as part of the thread) was "but all x86 processors released in the last decade have 64-bit support, so you don't need to think about it unless you're planning to use some pretty old hardware", which seemed to imply both old and new systems. "New" is also relative here. If someone buys a refurbished system, that may be new to them, but if it's 4 years old, it seems it could have a CPU which will have problems with 64 bit Windows. The OP is evidentally from the UK (and possibly a troll, but I digress), so probably this isn't that likely, since you can easily get a Core 2 Duo for I guess GBP40 or less (based on prices here in NZ). But unless the OP mentions where they live, it's not always necessary to check such info and resonable to give general answers particularly in a case like this (as opposed to something which is highly specific to the geographical location). And such systems often don't come with an OS, having been wiped.  In other words, the assumption that someone who buys or bought a system doesn't need to consider whether their system supports 64 bit Windows is flawed.  Note that the statement "do you need 64bit ram", doesn't have to mean "what RAM should I buy" but could easily mean "do I have to worry about whether my RAM will work with 64 bit Windows"? And in fact, given the OP's limited knowledge, there's a fair chance they weren't building their own system, so may very well be doing one of the others. I.E. Upgrading the OS on an existing system or installing Windows on a new or refurbished system they just acquired. Given the additional details of the UK, it's probable this isn't an Atom, but it can't be ruled out entirely, particularly in the first case and in any case no one mentioned the OP being in the UK until I did.  My ultimate point is that just because it's Atom, doesn't mean no one was installing Windows on it, it's likely a fair few people were (whether or not it was a sensible choice).  Nil Einne (talk) 14:51, 5 November 2015 (UTC)

xargs file-per-line option?
When the  program reads filenames from its standard input, by default it parses each whitespace-separated "word" as a distinct filename. It also has an option  which causes it to use null bytes on its input as filename separators. I thought there was another option to use newline as the separator, but lately I haven't been able to find it. (It would be a really nice option, and IMO it should be the default, but that's a rant for another day.) —Steve Summit (talk) 23:26, 2 November 2015 (UTC)


 * Answering my own question, you can use, but unfortunately it's not available in all versions. —Steve Summit (talk) 23:27, 2 November 2015 (UTC)


 * Unix pathnames can contain newlines (or any character except NUL, hence the motivation for the addition of -0 in some xargs implementations), so that doesn't make it any safer for handling pathnames. If you can't use xargs -0 with null-delimited input, use something else, like find(1), shell globs and loops, or your favorite scripting language. Here is a good starting point if you need help. --71.119.131.184 (talk) 06:45, 3 November 2015 (UTC)


 * You could of course write tr '\n' '\0' | xargs -0, but I agree with 71.119.131.184 that it's risky to use anything except \0. -- BenRG (talk) 06:51, 3 November 2015 (UTC)


 * Thanks, both. I do know about newlines in filenames (in fact ~/tmp currently contains two such files, for use in testing the script I'm writing).  What I'm angling for is a compromise: xargs in its default mode is useless (it can't even handle space characters in filenames, which are ridiculously common today), while xargs -0 is nearly impossible to use in a general way, because "list of filenames separated by null characters" is such an unusual datatype, supported in an ad-hoc way by only a tiny handful of programs.  Instead, I'm going to use "list of filenames, exactly one per line", and I'm willing to discard (i.e. not be able to handle) filenames containing newlines.
 * tr '\n' '\0' | xargs -0 is a nice idea, and I wish I'd thought of it myself. Thank you.  (One must beware, though, that it won't work with non-GNU versions of tr, which maddeningly cannot handle, and IIRC Posix does not even require them to handle, null characters.) —Steve Summit (talk) 14:33, 5 November 2015 (UTC)
 * This is still insecure if you're getting the pathnames from the filesystem. You can't just use find -exec or shell globs? Both are available on every POSIX system. --71.119.131.184 (talk) 01:21, 6 November 2015 (UTC)
 * Uh oh, it looks like the glove has been thrown, and there's a suggestion that I have a complacent attitude towards security. So I guess I'd better defend my honor.
 * Several points:
 * I did not ask, "How can I list and process arbitrary filenames securely?" The question was merely, "Does xargs have a line-at-a-time option?", and that question has been answered.
 * There seems to be an assumption that I'm writing some variation on
 * (which would indeed be insecure), and it's asked why I can't write
 * or
 * instead. But neither of those will work for me, because what I'm actually doing is along the lines of
 * and trying to pass null-separated filename lists around during all of that "more processing" is, well, out of the question.
 * The script in question involves selecting files for backup. So the worst that can happen is that a file whose name contains a newline doesn't get backed up, and/or that some other file gets backed up twice.
 * The backups are of my personal computer that no one else ever uses. And I never create files with newlines in their names. (Well, hardly ever; as I mentioned I've just recently created a few for testing, as part of this exercise.)
 * This is where I say something like "So I don't care about security", and you come back with "But you must care about security! It's because so many people say 'I don't care about security' that there are so many badly insecure systems in the world!".  And you'd be right, except that
 * I simplified the pipeline up in step two. I am, in fact, using -print0 up front:
 * , and the first steps in "a bunch more processing" are to (a) filter out (and noisily warn about) any filenames containing <tt>\n</tt>, and (b) convert the rest from separated-by-<tt>\0</tt> to separated-by-<tt>\n</tt> so that all the rest of the processing can use the more convenient (much more convenient!) representation.
 * The backups are of my personal computer that no one else ever uses. And I never create files with newlines in their names. (Well, hardly ever; as I mentioned I've just recently created a few for testing, as part of this exercise.)
 * This is where I say something like "So I don't care about security", and you come back with "But you must care about security! It's because so many people say 'I don't care about security' that there are so many badly insecure systems in the world!".  And you'd be right, except that
 * I simplified the pipeline up in step two. I am, in fact, using <tt>-print0</tt> up front:
 * , and the first steps in "a bunch more processing" are to (a) filter out (and noisily warn about) any filenames containing <tt>\n</tt>, and (b) convert the rest from separated-by-<tt>\0</tt> to separated-by-<tt>\n</tt> so that all the rest of the processing can use the more convenient (much more convenient!) representation.
 * , and the first steps in "a bunch more processing" are to (a) filter out (and noisily warn about) any filenames containing <tt>\n</tt>, and (b) convert the rest from separated-by-<tt>\0</tt> to separated-by-<tt>\n</tt> so that all the rest of the processing can use the more convenient (much more convenient!) representation.


 * So can we finish up with the lectures about <tt>xargs</tt> and newline security now? :-) —Steve Summit (talk) 15:21, 6 November 2015 (UTC)