Jump to content

Wikipedia:Reference desk/Archives/Computing/2016 February 12

From Wikipedia, the free encyclopedia
Computing desk
< February 11 << Jan | February | Mar >> February 13 >
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.


February 12

[edit]

Can we include regular expressions on transitions in finite automata?

[edit]

It's clear that we can include Regular Expressions on transitions in G-NFA's to convert an NFA into regular expression.I would like to know if we can include regular expressions on transitions in DFA's and NFA's to check whether a string is accepted.Is this possible or could anyone tell why this isn't possible.JUSTIN JOHNS (talk) 07:20, 12 February 2016 (UTC)[reply]

Proving that finite automata are a regular language is a common homework problem in discrete mathematics. At least I remember doing that. Because finite automata are regular, you can use a regular expression to define a specific automata. You can also use an automata to represent a regular expression. Quick google brings up these lecture notes on the topic. 209.149.115.90 (talk) 15:20, 12 February 2016 (UTC)[reply]

Yeah that's very true.JUSTIN JOHNS (talk) 06:33, 15 February 2016 (UTC)[reply]

OFFLINE DICTIONARY FOR A GALAXY TAB3V

[edit]

Could you recommend a good offline English-English dictionary for a galaxy tab 3v? There are so many. But what you recommend ? Thank you.175.157.48.158 (talk) 09:15, 12 February 2016 (UTC)[reply]

www.

[edit]

Some URLs work fine whether you add www. or not; http://google.com and http://www.google.com take you to the same place. However, this isn't always the case; http://www.co.athensoh.org, formerly the official website of Athens County, Ohio, is a 404 error, so I've had to replace it with the current URL, http://co.athensoh.org, and I've previously seen websites (can't think of a URL now) where www. is required, and omitting it produces an error. Why do some URLs care about the www. and others don't? Is it a setting specified by the webmaster and/or some other technical person running the website (and if so, what benefit is there to requiring one and disallowing the other, instead of accepting both), or is there some other reason? I didn't see anything relevant in URL or hostname, and I don't know what else to call this topic. Nyttend (talk) 14:53, 12 February 2016 (UTC)[reply]

First, you need to separate the domain name from the host name. In your examples, google.com is a domain name. athensoh.org is a domain name. wikipedia.org is another domain name. Notice that the domain name is a string of letters followed by .com, .org., .net, .mil. .edu, etc... (ignoring the country-specific codes because they work the same and no point in confusing things). Everything before the domain name is a hostname. For www.google.com, www is a hostname. For www.co.athensoh.org, www.co is a hostname. The domain name is managed by the owner of the website. The hostname allows the owner to have more than one server. You can point a.mydomain.com to one server and b.mydomain.com to another server. You can point www.mydomain.com to one server and mydomain.com (the empty hostname) to another server. For web-based organizations, it is common to make the empty hostname point to the webserver. So, www.google.com points to the webserver and google.com also points to the webserver. But, it doesn't have to be that way. I can point mydomain.com to a server that doesn't respond at all and www.mydomain.com to my webserver. So, as for why it works, it is because the domain managers set it up to work that way. When it doesn't work, it is because the domain managers set it up to not work that way. 209.149.115.90 (talk) 15:16, 12 February 2016 (UTC)[reply]
This is not necessarily true – there is no strict and definite distinction between a domain and a server name. In general, any usable 'domain name' is just a string of characters, which gets resolved by the Domain Name System (DNS) to an IP address in the net. The structure of a dot-separated chain of names reflects the hierachical structure of DNS servers' responsibility, so that no server needs to know the whole Internet for the service to work. There are some conventions regarding the meaning of the first and last segments of the domain name, but they are just conventions. Nothing (except your net services provider obeying the convention) prevents you from setting up a HTTP server and assigning its IP address to a service name in a high-level domain name, like www.gov.country – see www.gov.nu for example. One can even assign an address to the highest-level domain itself – see gov.ru or mil.ru. On the other hand one can set-up multiple services on the same machine and assign several names the same IP address. One may also serve different services under the same domain name (and, consequently, the same IP address), because clients to specific popular services make connections through different well-known ports. On the third hand ;) it's possible to assign a pool of addresses to serve very popular domains worldwide (e.g. Google's).
So you answer to the question asked is true, although the explanation is incomplete: some servers respond for both variants of their domain names because their owners took care to register both full and shortened name of their HTTP server in DNS (which may cost some additional money), and some do not because their owners saved money as they don't think users would care to type the www prefix. --CiaPan (talk) 09:07, 15 February 2016 (UTC)[reply]
You may notice on television commercials, print ads, etc., that retailers tend to be moving away from the "www" and just going with the domain name. I believe it's just for sake of simplicity. Justin15w (talk) 15:33, 12 February 2016 (UTC)[reply]
Recall that the Internet and the World Wide Web are not the same thing. Nowadays, all people use is a Web browser and email—and the email is frequently through a browser too. (Other protocols are certainly relevant (SSH, BGP, DHCP, and innumerable game protocols), but not in the minds of the public.) When it was introduced, "www.mit.edu" meant "the machine at MIT that handles HTTP requests", since many people would be more interested in news.mit.edu or ftp.mit.edu or so. Now the convention is that that machine is "the default" mit.edu, and anything else (e.g., ftp.gnu.org) must be qualified. --Tardis (talk) 16:35, 12 February 2016 (UTC)[reply]
When I set up a new website with my internet service provider, I use a handy tool they provide rather than doing it manually. That tool gives me a whole bunch of options to deal with the www thing:
  • Redirect www.xxx to xxx
  • Redirect xxx to www.xxx
  • Allow only xxx
  • Allow only www.xxx
  • Have www.xxx point to a different page than xxx
Personally, my view is that www is kinda obsolete for most members of the public, so I elect to redirect www.xxx to xxx on grounds that this saves most people from having to go through a redirection step. But it's up to the individual site owner to decide what they want to do with it.
In modern server setups, the original idea that (for example) images.google.com is an identifiable, individual computer that's different from the one that handles (say) www.google.com is far, FAR from the truth of what's going on! Firstly, there is no way that one server could handle all of the www.google.com traffic - so there are multiple physical computers handling those requests. And from a load balancing perspective, I doubt that images.google.com is a different set of physical servers than the ones that handle www.google.com. So the prefix might as well be a suffix - and indeed images.google.com gets you to the same exact page as www.google.com/images.
The URL prefix is fast becoming something of an anachronism for most websites out there. That's not to say that some behind-the-times server setups won't be outdated. Athens County Ohio only has 64,000 residents - and I doubt that with such a tiny tax base, they have much of an IT department running their web site - or much funding to keep it up to date with modern trends. So this is exactly the kind of website that might be stuck in the 1990's way of doing things.
SteveBaker (talk) 18:06, 13 February 2016 (UTC)[reply]
SteveBaker correctly describes several concepts that are further explained in our articles:
The combination of these technologies make it very difficult to identify which physical hardware actually hosts any specific resource. All the many sub-elements of a modern webpage can be simultaneously hosted by many distinct hardware systems; or, many different webpages maybe hosted on one hardware; it is a many-to-many mapping of software-resources onto hardware hosts.
Nimur (talk) 17:17, 15 February 2016 (UTC)[reply]

Wordpress plugins

[edit]

I have 2 Wordpress plugins, Read More Right Here and WP EasyScroll Posts. Both work fine, but they aren't compatible with eachother. In order to make them compatible I need to call Read More Right Here's JavaScript function after WP EasyScroll Posts has finished loading the new posts. Normally this should be easy, but for some reason I can't get it to work. The Quixotic Potato (talk) 15:44, 12 February 2016 (UTC)[reply]

A problem with spam emails

[edit]

I'm a BT customer and am wondering if anyone else has recently been having problems with spam emails from an address purporting to be from BT. Over the last twenty four hours or so I have received around thirty emails claiming to be from organisations as diverse as ASDA, Sky Vegas Casino, Argos and even Bathing Solutions, but all originating from the same address, bt.comteam@bt.com. They consist of apparently genuine advertisements, and I have forwarded a selection on to BT as to me this is obviously the work of hackers. It's really starting to irritate me and I'd like to block the address, but I don't know whether that is an address used for genuine BT correspondences. Can anyone tell me if the email address is one used by BT at all, or would I be same to block it. Thanks, 109.154.219.120 (talk) 15:49, 12 February 2016 (UTC)[reply]

It took me a bit of digging, but "BT" is British Telecommunications. Nyttend (talk) 16:12, 12 February 2016 (UTC)[reply]
I've been having a similar problem and just came to this discussion through Google, although until it was pointed out here I hadn't noticed they were all coming from the same source. You can report stuff like this to abuse@bt.com for them to investigate. I just attached a handful of stuff to an email and sent it to them. As for the address, I don't whether bt.comteam is one of their official correspondences, but perhaps someone else can shed light on that. This is Paul (talk) 13:16, 13 February 2016 (UTC)[reply]
I gruess one computer having You email address stored is or was infected with malware, reading out addressbooks to grab email addresses for abuse it as a spam target. Do not open mails from senders You do not know and disable displaying embedded pictures. Those pictures, sometimes a single pixel transparent small, are located on a webserver and downloaded if not disabled to load them. The URL of the one pixel or other picture is unique like a individual hash. Retrieving it marks the smap email a read to send more to this email address. --Hans Haase (有问题吗) 15:46, 16 February 2016 (UTC)[reply]

Windows 10 Upgrade

[edit]

I have reserved my copy of win10 with the app in October. When will it update? -Aryan ( है?) 10:38, 15 February 2016 (UTC)[reply]

It will not update until You klick to update it now. You also can download an ISO file of Win 10 an reinstall Your computer from this DVD, You created from the ISO file. Backup all Your data on external device first before You reinstall YOur computer. Using Windows 10 as an Upgrade, You need to have a Win 7 oder 8 license. See the Microsoft page for more information. --Hans Haase (有问题吗) 15:35, 16 February 2016 (UTC)[reply]

Can we generate an infinite number of commands in the usual programming languages?

[edit]

In the same way that we can generate an infinite number of sentences in a natural language (this is only restricted by our memory), is there a limitation of the number of commands (or expressions, or whatever) that can be expressed in a mainstream programming language? Or can we expand a recursive expression as long as we wish? --Llaanngg (talk) 17:31, 12 February 2016 (UTC)[reply]

You are entering into a semantic argument. I could infinitely place a function as a parameter for another function as a(a(a(a(a(a(a(a(a(a)))))))))). However, you have to semantically define the language. Is the language anything that a human can dream up or is the language defined as what can be parsed? If it is what can be parsed, the parser will have limitations as to the number of recursive function calls and length of text it can parse as a single statement. 209.149.115.90 (talk) 17:49, 12 February 2016 (UTC)[reply]
I mean a real language, not just one that could exist. Is there any limitation for C, Java and the like, besides the obvious limitation of memory and time (in the same way as humans are limited). --Llaanngg (talk) 17:51, 12 February 2016 (UTC)[reply]
Neither C nor Java specify a maximum program length: refer to the standardization documents. For example, the Java 7 (SE) language specification or the The C Programming Language book outline which limitations exist on valid source code, and they do not specify a maximum input length. A handful of other, perhaps less universally-known, formally-specified programming languages do specify explicit maximum input length for source code. I can think of a few vendor-specific variants of BASIC or tcl (VAL3 immediately springs to mind) where the user manual explicitly expresses some limitation on source code length. We could quibble about whether these are "language" or "implementation" limitations, but you probably get the idea. Nimur (talk) 17:59, 12 February 2016 (UTC)[reply]
I'm not sure I follow what you're asking, but it's pretty trivial to generate an infinite number of different statements in any programming language. In fact it's easier than in a natural language, since there are only a finite number of words in a natural language, but there are an infinite number of tokens that can be used in a programming language. As a trivial example, in C, there are an infinite number of statements of the form "a=a+1;", "a=a+2;", a=a+3", etc. In real life you can of course only have a finite number of these in any one program due to memory constraints. Mnudelman (talk) 21:09, 12 February 2016 (UTC)[reply]
The example you mention is also valid for natural languages: "sum one plus one", "sum one plus two", ... and so on. I'd say that any language that can mention infinite numbers is necessarily infinite. --Scicurious (talk) 21:17, 12 February 2016 (UTC)[reply]
Well, it's arguable if there is really a word for every integer. Is there a name for Graham's Number (other than "Graham's Number")? I suppose you can just call it "a million million million million ..." and keep it up until the heat death of the universe. Of course the same is true if you tried to express it as a decimal number in a program. Mnudelman (talk) 21:40, 12 February 2016 (UTC)[reply]
I am pretty sure there is no name for every integer, but there is always a form of referring to each verbally. I don't know whether using formalized mathematical terminology would imply that you are not using natural language anymore. Scicurious (talk) 23:08, 12 February 2016 (UTC)[reply]
You don't need a name for every integer: you can also write "a=1+1+1+1"; etc. with as many repetitions of +1 as you like, and the same in natural language. --76.69.45.64 (talk) 23:49, 12 February 2016 (UTC)[reply]
That's the point. If you can expand something like 1+1+1+1+... or one plus one plus one ... you can generate a sentence as long as you want. Scicurious (talk) 13:45, 13 February 2016 (UTC)[reply]
Well, mathematically you can construct any number of different programs, but not infinitely many. There are infinitely many legal programs in many programming languages, but they cannot all be generated before the heat death of the universe. But neither can an infinite number of natural language sentences. --Stephan Schulz (talk) 22:43, 14 February 2016 (UTC)[reply]