Jump to content

Wikipedia:Reference desk/Computing: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Hubydane (talk | contribs)
Line 428: Line 428:


= November 25 =
= November 25 =

== Running Windows via External Hard Drive ==

I am going to be running Windows on my Mac via an installation on an external hard drive. My question is... Could I use the hard drive I already have (stores my iTunes, videos, that sort of thing) for my Mac, and install the bootable Windows on a partition of it, without causing any errors? Cheers. [[User:Hubydane|Hubydane]] ([[User talk:Hubydane|talk]]) 10:17, 25 November 2014 (UTC)

Revision as of 10:17, 25 November 2014

Welcome to the computing section
of the Wikipedia reference desk.
Select a section:
Want a faster answer?

Main page: Help searching Wikipedia

   

How can I get my question answered?

  • Select the section of the desk that best fits the general topic of your question (see the navigation column to the right).
  • Post your question to only one section, providing a short header that gives the topic of your question.
  • Type '~~~~' (that is, four tilde characters) at the end – this signs and dates your contribution so we know who wrote what and when.
  • Don't post personal contact information – it will be removed. Any answers will be provided here.
  • Please be as specific as possible, and include all relevant context – the usefulness of answers may depend on the context.
  • Note:
    • We don't answer (and may remove) questions that require medical diagnosis or legal advice.
    • We don't answer requests for opinions, predictions or debate.
    • We don't do your homework for you, though we'll help you past the stuck point.
    • We don't conduct original research or provide a free source of ideas, but we'll help you find information you need.



How do I answer a question?

Main page: Wikipedia:Reference desk/Guidelines

  • The best answers address the question directly, and back up facts with wikilinks and links to sources. Do not edit others' comments and do not give any medical or legal advice.
See also:


November 20

Dates of 'Friend requests' in Facebook

How can I get this data, which is of basic nature, with respect to when these requests were sent to me ? Strange they've left this basic issue in a childish condition. I've raised this question there ('Help Community'), already, with no answers, as yet. BentzyCo (talk) 01:23, 20 November 2014 (UTC)[reply]

SO BASIC, BUT YET, SO COMPLICATED. Why designed so ? BentzyCo (talk) 06:43, 21 November 2014 (UTC)[reply]
The main point is that it is not in Facebook's interest to give you full access to that kind of data. It is in their interest to keep you on the site as long as possible, so that you see the most advertisements. As the saying goes, if the online service is free, you are not the customer, you are the product. You may have slightly more information available if you download your FB content, as described here [1]. SemanticMantis (talk) 20:28, 21 November 2014 (UTC)[reply]

Looking for an IEEE paper

I'm looking for the paper: A classification of CASE technology by A. Fuggetta. Here is a link to where the paper can be found:

http://ieeexplore.ieee.org/xpl/login.jsp?tp=&arnumber=247645&url=http%3A%2F%2Fieeexplore.ieee.org%2Fiel1%2F2%2F6338%2F00247645.pdf%3Farnumber%3D247645

I created a user ID on the IEEE site but without an institutional ID they make you pay for to download the paper. I need the paper to edit this article: Computer aided software engineering It's used as one of the primary references for many of the fundamental claims in the article. I think all the claims are true and probably backed up by the paper but want to be sure and also want to expand and edit the article to address the concerns in the tags. Also, on the Talk page of that article people have mentioned the idea of creating new articles that distinguish different subdomains of CASE (e.g. upper CASE vs. lower CASE) and I think this paper would be an excellent source if we do that. --MadScientistX11 (talk) 17:31, 20 November 2014 (UTC)[reply]

The place to ask for this is WP:REX. If you don't get any help there you can ask me on my talk page. SemanticMantis (talk) 20:08, 20 November 2014 (UTC)[reply]

In Python, where does the return output go, if you don't care about it?

In

   plt.plot(X, P, '-', color='grey')
   a = plt.plot(X, P, 'o', color=col[L])

from File:Poisson_pmf.svg. I see that both lines perform an action, but the second returns a value that gets used further. Where does the return value of the first go to? Does it just silently disappear without any side-effects? And would that be a problem, if you get really lots of these dismissed values? --Senteni (talk) 17:40, 20 November 2014 (UTC)[reply]

I don't know - but I know that this question goes on the computer reference desk. AndyTheGrump (talk) 17:46, 20 November 2014 (UTC)[reply]
The answer is pretty ... uh, "heavy...": the answer to these sorts of questions might not be very accessible to new programmers. How much do you know about compiler theory, and how much do you want to learn?
Both statements contain Python expressions and the latter statement is also an assignment statement. An assignment statement causes the interpreter to bind a value to a name. If the value is not bound, it is up to the Python interpreter environment to determine its scope and persistence behavior. In CPython (the most common implementation of Python), that value is stored in a reference-counted dictionary, and because it is unbound, it will be re-collected by the Python memory manager "very soon." In CPython, that garbage collection occurs when the value goes out of scope (which is, in a sense, a less memory-optimized sequence compared to the behavior of most compiled machine-code, in which an intermediate unbound value will cease to exist as soon as the CPU micro-architecture wants to re-use its hardware storage). Python's interpreter is, in a sense, a virtual machine; and the data-persistence of intermediate values is completely controlled by the software-implementation of the interpreter.
More to the point, "who cares" about how Python code interplays with the microarchitecture of compiled code? Well, you'll care if you ever try to embed the Python interpreter into your own code! Suppose you wanted to make a game, and you choose to implement the game in C code, but you want to permit the higher-level game logic to take the form of a Python script. Suddenly, the performance and data-persistence of the interpreted script can make a big difference! (As an actual example, Firaxis embedded Python into Civilization 4 and performance reviewers were not kind).
If you're into this stuff, the book you want is: Computer Organization and Design: The Hardware/Software Interface. Read that one over the course of a year; and then grab a copy of the CPython source and your favorite processor reference manual...
Nimur (talk) 18:20, 20 November 2014 (UTC)[reply]
Ignoring the return value of a function that returns one is an OK thing to do in every programming language I know (which is a LOT!). I don't know (in detail) how this works in Python - but in good old fashioned C, the "return" statement inside of a function placed the result into Register R0 (on most machine architectures) - and if you assigned that result to a variable in the calling code, it would copy R0 into that variable...if you didn't do the assignment, then R0 would eventually get overwritten. In most languages, the cost of ignoring a returned value is exactly zero. Now, admittedly, because Python is a garbage-collected language, if you create some kind of data structure - then the ONLY remaining reference to it is passed into a return statement - which is then ignored - then there will be no references left to that structure and it'll eventually be garbage-collected. There are administrative overheads to doing that - but the costs aren't really in ignoring the 'return' so much as creating something unnecessarily and then having it destroyed again. For example, if you saved the returned value in a variable, then destroyed the variable - the cost would be the same as ignoring it.
SteveBaker (talk) 19:27, 21 November 2014 (UTC)[reply]
The important point in this example is not whether the visible code does something with the return value or not. Rather, we know that the return value (or at least something very closely related to it) does not just go away because matplotlib is retaining a reference to it. (It must be, since it writes (a representation of) it to disk later!) This sort of magic background reference causes confusion precisely because it disrupts our understanding of what data is going where when we read the code. (For an extreme version of this idea, see Law of Demeter.) --Tardis (talk) 04:11, 23 November 2014 (UTC)[reply]


The standard CPython interpreter compiles to intermediate bytecode and uses a stack machine to do the processing. You can actually use the dis module to look at the bytecode [2]:
   def fun1(p):
       return 4

   def fun2():
       fun1(5)

   import dis
   dis.dis(fun1)
     2           0 LOAD_CONST               1 (4)
                 3 RETURN_VALUE        
   dis.dis(fun2)
     2           0 LOAD_GLOBAL              0 (fun1)
                 3 LOAD_CONST               1 (5)
                 6 CALL_FUNCTION            1
                 9 POP_TOP             
                10 LOAD_CONST               0 (None)
                13 RETURN_VALUE        
The LOAD_* opcodes place a value on the stack. RETURN_VALUE says to return the value on the top of the stack to the caller (which will see it as the top of the stack). Note that if we're not using the return value, the CALL_FUNCTION opcode is immediately followed by a POP_TOP opcode, which removes a value from the top of the stack and discards it. This is generally what happens with ignored return values, even for other languages/interpreters/compilers. The function itself normally is written such that it places the return value in an appropriate place (on the stack, in a register) so a single function can be used both with and without looking at the return value. If a function ignores a return value, it's normally up to the calling function to remove/delete/overwrite/ignore/discard the returned value. - By the way, the bytecode/stack machine implementation is for the regular CPython interpreter itself. Other Python implementations have different ways of handling it. The Python language itself just says that the reference/binding is discarded. (Keep in mind how Python thinks about objects and variables [3]: there can be multiple bindings to the same object, and the object will exist until all the references to it disappear.) -- 160.129.138.186 (talk) 20:37, 24 November 2014 (UTC)[reply]

VCARD file syntax for obsolete and emergency contacts "not to be normally used"

I'm trying to understand the syntax and approach used with Vcard, when handling obsolete and emergency contact data. In the real world, obsolete contact data can be important - but it can also be very important to ensure it is clearly not to be used.

Example: Contact "Jane" has used the following 5 phone numbers -

  • 123-1000, main home phone number (voice service)
  • 456-1000, cellphone (voice, text services, preferred contact)
  • 876-1000, a previous phone number, before she moved out of her old home. This is never to be called, even by accident, as it's obsolete, but deleting it would mean that all call history to and from that number would no longer be identified with Jane. Her 'ex' also still lives at that number so it's important to recognize it, if it ever rings and even if it's never used.
  • 765-1000, another previous phone number, now reallocated by the telco to unconnected subscribers, but likewise if it's deleted then old and important records related to that contact number won't be linked to Jane.
  • 333-1000, her medical emergency contact service for some condition Jane may have. Never to be called except in emergency as they charge $150 per call on each occasion used.

I'm trying to understand what provision VCard includes, or how VCard entries are structured, to reflect that very often, numbers need to be "on file" for a contact even though "obsolete" or "emergency", and how a number of this kind is represented in a typical handset's Vcard if it's needed but never normally to be actually dialed. In particular how one tags a number if it must be recognized but also mustn't be allowed to be dialed even accidentally. FT2 (Talk | email) 23:24, 20 November 2014 (UTC)[reply]


November 21

VPN Protocol

When I use public WiFI I always connect to a VPN. I either use OpenVPN or L2TP/IPSEC PSK. Which one would be less likely or harder to block? Also, sometimes I cannot access Google services while on OpenVPN TCP443. Why? I can access Google services on UDP1194 or L2TP/IPSEC PSK, but sometimes not TCP443. pcfan500 (talk) 06:58, 21 November 2014 (UTC)[reply]

List of numbers sorted by bit count

(If this question is more appropriate for RD/Math, please feel free to move it.)

I need to generate a list of numbers from zero to 2^n - 1 (where n is likely to be beween about 3 and about 20) sorted by the number of "1" bits in their binary representation. For example, for n = 4:

0   [0000]
1   [0001]
2   [0010]
4   [0100]
8   [1000]
3   [0011]
5   [0101]
6   [0110]
9   [1001]
10  [1010]
12  [1100]
7   [0111]
11  [1011]
13  [1101]
14  [1110]
15  [1111]

Is there a name for this sort of sequence, and (more importantly) is there an easy way of calculating it? Tevildo (talk) 13:20, 21 November 2014 (UTC)[reply]

Interesting question. I don't know of a name. To "calculate" the list, I think you would have to generate the items in ascending sequence by binary numeric value. Count the "1" bits for each and prepend that, as:
00 [0000]
01 [0001]
01 [0010]
02 [0011]
01 [0100]
02 [0101]
02 [0110]
03 [0111]
01 [1000]
And then you would sort the list into ascending sequence. If you don't have an easy way to sort a list, that's another problem. ‑‑Mandruss  14:09, 21 November 2014 (UTC)[reply]
That would work, but the question then becomes "How do I count the bits?" Something like:
int bitCount = 0;
int mask = 1;
for (int i = 0; i < n; i++)
{
    if (mask & x) bitCount++;
    mask <<= 1;
}

seems rather inefficient (is it O(2^n)? I know little about the theoretical side of things) for larger values of n. Tevildo (talk) 14:27, 21 November 2014 (UTC)[reply]

That will have to wait for someone who knows C++, if that's what that is. Maybe the language provides some function that returns the number of "1" bits in a value; that would simplify coding but might not necessarily save execution time; either way, each bit has to be tested individually at machine level. ‑‑Mandruss  14:31, 21 November 2014 (UTC)[reply]
I've used the bit-counting in a program that generated all the combinations for kakuro puzzles; it displayed on each line, the number of digits (bit-count), sum, and list of digits. I used the Unix program sort to sort by bit-count, and then the sum. If you use quick-sort then its O(n log n). CS Miller (talk) 14:47, 21 November 2014 (UTC)[reply]


Just last week this came up! I found a great page with several variants of software algorithms for counting bits set. And, if you're running on ARM (or running on the latest Intel processors), there are single-machine-instructions for this: population count. Find first set has been around for thirty years on i386, but population-count (bit counting) just appeared recently (in the Core architecture extensions to SSE4.2). Nimur (talk)
That's exactly what I need, thanks. I see Brian Kernighan worked how to do it in two lines, so I'll follow his example. The rest of the page will certainly come in useful again! Tevildo (talk) 16:07, 21 November 2014 (UTC)[reply]
The fastest way I know for a 32 bit word is:
 n = (n & 0x55555555) + ((n & 0xaaaaaaaa) >> 1);
 n = (n & 0x33333333) + ((n & 0xcccccccc) >> 2);
 n = (n & 0x0f0f0f0f) + ((n & 0xf0f0f0f0) >> 4);
 n = (n & 0x00ff00ff) + ((n & 0xff00ff00) >> 8);
 n = (n & 0x0000ffff) + ((n & 0xffff0000) >> 16);
Kernighan's approach is much faster for words with not many bits set - but is much slower than my approach for words with large numbers of bits set. SteveBaker (talk) 19:01, 21 November 2014 (UTC)[reply]
That shouldn't be a major problem - the basic structure of the code is (now) something like:
for (int bitCount = 1; bitCount < n; bitCount++)
{
    int[] numList = GetNumbersWithBitCount(bitCount);
    foreach (int thisNum in numList)
    {
        if (DoThings(thisNum))
        {
           //  Success!  Exit the loop and go on to the next section of the code
        }
    }
 }
 //  Failure.  Go home and go to bed.

Hopefully, we'll get the success condition well before we get to 20 bits, so we should only need to use the shorter runs. But we do need to cover all eventualities. Tevildo (talk) 20:04, 21 November 2014 (UTC)[reply]

(For the curious) - Steve's method is "Counting bits set, in parallel" from Nimur's link. Tevildo (talk) 20:14, 21 November 2014 (UTC)[reply]

URL and browser weirdness

My library's online catalogue is located at http://pilot.passhe.edu:8007. If you go to the full URL on my computer and on a library computer, everything works fine. If you go to pilot.passhe.edu:8007 on the library computers, it works just as well, but my computer refuses to go there and instead brings up a box: "Do you want this website to open an app on your computer?" Click the "OK" option and I get another box, "No apps are installed to open this type of link." This is completely different from what I get when leaving off the URL from most sites, e.g. en.wikipedia.org/wiki/Wikipedia:Reference_desk/Computing works just as well as http://en.wikipedia.org/wiki/Wikipedia:Reference_desk/Computing. What's the difference? Library computer is running IE9 in Windows 7, while my computer has IE11 in Windows 8.1. Nyttend (talk) 16:17, 21 November 2014 (UTC)[reply]

It definitely sounds like an IE11 bug - and to be honest, pretty much everyone here is thinking "Wow! You're still using Internet Explorer?!?". There are two slightly unusual things going on with this URL. One is that ':8007' bit on the end - which is setting the port number that the http daemon is listening on to something non-standard...the other is that this URL does a redirect to "pilot.passhe.edu:8007/cgi-bin/Pwebrecon.cgi?DB=local&PAGE=First" - which is technically a ".cgi" file. CGI is used for applications running on the server, not on the client - so that shouldn't be a problem here. But I bet that either IE11 or Win8.1 is thinking that this file extension is being handled by a local application, then discovering that you don't have the local application installed. I'm not a big Windows user - but I know that somewhere you can set which applications handle which file types on the desktop - and I'd bet that somehow one of them is set up to handle ".cgi" files. Getting rid of that file association (if it exists) might maybe fix this...but I'd give it only a one in three chance of working.
There probably isn't anything that can be done about this interesting quirk/bug - other than to say: "Don't Use Internet Explorer". SteveBaker (talk) 19:16, 21 November 2014 (UTC)[reply]
Just a quick note, the :8007 is necessary, because http://pilot.passhe.edu goes to a directory for the libraries within and partnering with the Pennsylvania State System of Higher Education. Not sure how we became #8007, but it's not just some weirdness that can easily be omitted. Nyttend (talk) 23:05, 21 November 2014 (UTC)[reply]
Fair enough; the server-side engineers opted to use the TCP port to allow one server to serve different content for several different services. They could have used some other scheme - like domain name virtualization or URL rewriting (mod_rewrite) to share the top-level hardware among several sub-allocated web sites.
Maybe I'm just trying to be more optimistic than Steve, but perhaps instead of boycotting the product, you could file a formal bug-report against Internet Explorer. I bet some folks on their software team would like to know that they're mis-behaving when they encounter what appears to be a perfectly legal URL.
As a last note: are you explicitly typing "http://" before the rest of the URL? Port 8007 is non-standard (but perfectly legal) for HTTP, and by explicitly typing the protocol prefix, "http://", you are helping the software identify that this address should be retrieved in the web-browser as normal hypertext.
Nimur (talk) 23:20, 21 November 2014 (UTC)[reply]
Nyttend already knows using the http:// prefix works, but was asking why leaving off the http:// doesn't work for this address. Nimur's "helping the software identify" statement links to URI scheme, which I also think is what's going on. Here's a little more information about that:
The http or https part of an address is called the URI scheme. Other URI schemes are possible and they can cause special actions in other programs. For example, if an e-mail program is installed, a mailto: link can open a new message window. If an IRC chat program is installed, an irc: link can open a chat room. Some programs even install their own unofficial URI schemes on your computer. When you install AOL Instant Messenger, then aim: links can open message windows.
When you put pilot.passhe.edu:8007 in the address box, I think Internet Explorer 11 is interpreting the part before the colon as a URI scheme. It's searching for an app to handle that type of address, but it can't find one. Other browsers seem to recognize pilot.passhe.edu is a domain name and interpret the address using the default http URI scheme.
(Note: When I tested my Internet Explorer 11, I found that you must disable searching from the address box to get the app prompts Nyttend describes. If searching from the address box is enabled, putting pilot.passhe.edu:8007 in the address box brings up search results instead.)
--Bavi H (talk) 05:11, 22 November 2014 (UTC)[reply]
I can't boycott the product: I work at the library, so boycotting the product would mean I couldn't help students find books by navigating said product :-) And yes, I have disabled searching through the address bar. I typically navigate Wikipedia by changing URLs (if I'm at the Main Page, I'll come here by deleting "Main_Page" and adding "WP:RDC"), and if searching through the address bar is enabled, it constantly searches the web for Wikipedia URLs instead of taking me to those URLs. Nyttend (talk) 06:06, 22 November 2014 (UTC)[reply]
I'm not really sure why it works on your library computer/IE9, but I think IE has had similar behaviour for a while. See e.g. [4] discussing IE8. I don't use IE much, but this quirk or a similar quirk is something I think I've encounter before, primarily because I sometimes use IE when trying to access local or LAN HTTP servers not on port 80 (e.g. SABnzbd+ and some firewalls/routers) for a variety of reasons and I sometimes use the form of IP:port (sometimes hostname including localhost:port).

While I don't think there's any harm reporting this to Microsoft and suggesting you'd prefer different behaviour, I'm not sure that they'll change it, I find it unlikely they aren't aware some people would prefer it different and I'm guessing that they've chosen this way for whatever reason and it'll be difficult to change their minds.

Note in particular, I have strong doubts about SteveBaker's claims this is a bug. It's likely more accurate to call it a quirk or simply different behaviour from the majority of browsers. From my reading of URI scheme which seems to follow the RFC, it sounds like pilot.passhe.edu is a perfectly valid scheme name (a silly one perhaps, but probably valid). I presume 8007 could be a valid path. So unless there's some other specific RFC or standard that says you should intepret pilot.passhe.edu:8007 as meaning http://pilot.passhe.edu:8007, it seems anyone is entitled to interpret it as an absolute URI with pilot.passhe.edu as the scheme name.

From the end user POV, I do feel it makes more sense to intepret it as intended to be http (or perhaps https) without the scheme name specified since it's likely tha's far more commonly intended, particularly if there's nothing registered to handle the scheme name pilot.passhe.edu so all that can be said is we don't know what to do with that scheme name. Even more so when pilot.passhe.edu is a valid path for HTTP (which together with HTTPS is what 99.99% of URI even those directly entered in to the browser probably are) and further http://pilot.passhe.edu:8007 works. But it's difficult to call this a bug per se when it seems both are quite legitimate intepretations.

I also wonder whether other browsers are definitely better in all cases. For example, if you do have something registered to handle pilot.passhe.edu, will the browser intepret pilot.passhe.edu:8007 as meaning you want the scheme name pilot.passhe.edu or will it still interpret it as wanting http://pilot.passhe.edu:8007? If it does the later (and it's not so simple which is better for the user in that case), how about (again if you have something registered to handle passhe.edu) passhe.edu:8007 which doesn't work if you intepret it as wanting http://passhe.edu:8007. In that case, it would seem definite that it's better to intepret it as passhe.edu as the scheme name, or at most once http://passhe.edu:8007 doesn't work, intepret passhe.edu as the scheme name and pass the path to it (unless perhaps the browser knows 8007 is an invalid path for that scheme name), but I wonder if they really do that.

Definitely in the case of browsers like Chrome without a search tab where the URI bar is supposed to be the search tab, I know they will often not intepret this as you as wanting to search for passhe.edu:8007 even though http://passhe.edu:8007 doesn't work, but that's another kettle of fish entirely. As we get more and more generic TLDs I imagine this is going to get more complicated. How should you intepret video.protocol for example? What about the apparently real world example xmlrpc.beep/xmlrpc.beeps (it doesn't sounds like anyone wants .beep/.beeps yet though)?

P.S. One advantage with this sort of different interpretations stuff is it can reveal ambiguity. I don't see much chance of the standards being changes to fix this, but it does suggest to it's fairly wise for anyone to consider whether using a different service port, particularly when there's any chance someone may enter the URI manually, is the best idea, rather than the alternatives like Nimur mentioned.

Nil Einne (talk) 08:33, 22 November 2014 (UTC)[reply]

November 22

How to set Firefox's default zoom level

Mac user. Minor issue. How do I set Firefox's default zoom level to a smaller size than 100%, say 80% (i.e., what I get when I click ⌘ Cmd+0)?--Fuhghettaboutit (talk) 15:18, 22 November 2014 (UTC)[reply]

There are several addons that do that, here's one of them. KonveyorBelt 04:51, 23 November 2014 (UTC)[reply]

Kindle vs. Kindle App

If I can read Kindle books on any device with the Kindle App, why would I want a Kindle?

It's easier to read in bright sunlight than a phone screen. Dbfirs 16:52, 22 November 2014 (UTC)[reply]
Specifically, it uses an Electronic paper display that works by reflecting incoming light rather than by glowing with a back-light. So no matter how bright the light shining on it, it's always crisp and legible. I find the Kindle's display much more like reading a paper book than a conventional tablet computer - it's hard to describe. The downside is that you can't read it in the dark. For a while I had one of those clip-on LED reading lights...but eventually I wound up using a tablet to read in bed at night and the Kindle to read in the daytime.
The other nice thing about the Kindle is that is uses almost zero battery power until you turn a page or something. You can read for hours a day and go for weeks or maybe even a month between recharges! The downside of that is that redrawing the display is relatively slow...plenty fast enough to do "page turning" - but relatively useless for interactive stuff - so surfing the web using the Kindle is painful.
The early Kindles also had a cellular networking feature - which was provided for free by Amazon. That meant that you didn't need WiFi and you didn't have to pay a cell-phone charge to get online. You could literally surf the web and download books *anywhere* for free. I don't think Amazon still offer that...but I could be wrong. My kindle is a really old one.
I also like the large, dedicated page-turn buttons. Much nicer than swiping the screen.
The Kindle is a really wonderful device if all you want to do is read books. Otherwise, get a regular tablet - they work just fine so long as you're not trying to read in direct sunlight and you can do a LOT more with them.
SteveBaker (talk) 17:57, 22 November 2014 (UTC)[reply]
"Modern" Kindles come with WiFi or optional cellular plan. The Kindle Paperwhite also has built-in screen illumination to augment environmental lighting (but no big buttons anymore). I prefer them for reading to a laptop because they are about the size and weight of a book, and I can easily read on one sitting anywhere (even in economy class ;-), standing, or even lying down. Great for novels, not so great for scientific texts. --Stephan Schulz (talk) 07:05, 24 November 2014 (UTC)[reply]
Not just Kindles, most other ereader variants now have screen illumination/front or side lit variants. That said, physical page turning buttons have also gone out the window with the move to touch screens in most cases. Personally I think this is dumb, but there's only two or so touch variants with physical page turning buttons (including the expensive new Kindle Voyage which has something similar). Even for those which are still using infrared touch and so don't generally have problems with any gloves, there are still cases when such buttons may be useful.

Note that "reading a paper book than a conventional tablet computer" is perhaps key here. The nature of eink like displays means even with the front lighting variants, they still don't quite look the same when the front light is on such as in the dark, as tablets using LCD or AMOLED displays (even high PPI ones which IMO do come a bit closer). Remember, even without builtin illumination there are a variety of ways you can light the display which people using physical books have been doing for a long time (which may not be so efficient and may sometimes annoy others, but may also be preferred by the person reading). To be clear while many people don't mind or even prefer reading on an LCD or AMOLED display (and definitely with a self illuminating display), some do dislike reading for long strectches on such LCD or AMOLED displays or find it causes eyestrain etc.

Note also despite the phablet craze, most phones are still smaller than the average sized eink reader (including all modern Kindles) although are generally smaller than most tablets (there are tablets which are similar sized as well as some readers which are closed to tablet size, but the point is you may or may not prefer the 6" form factor for novel ereading and you also may or may not prefer it for tablets or phones so these may not coincide and so if you can afford the ereader and it fits in to your lifestyle there's a reason why someone may want one as per the original question).

Note that beyond the refresh rate (although this is low, bear in mind in many devices the rate is also reduced by the slow rendering time), while eink can produce sharp crisp text, the low number of grey scales and other factors means it doesn't tend to do well with graphics. Many are also somewhat low res compared to the high PPIs now seen in tablets.

And we are talking grey scale, attempts to produce colour eink like displays don't seem to have been that successful so far, contrast seems to be one factor although the earlier mentioned limitations also reduce the utility of such displays when it comes to colour (since you'd want to do more than just have non black text).

Nil Einne (talk) 11:46, 24 November 2014 (UTC)[reply]

Arm chips

Do Apple and Qualcomm wtc pay patent fees to ARM to use SOC architecture or do they actually buy ARMS SOCs? 90.192.116.60 (talk) 17:29, 22 November 2014 (UTC)[reply]

It's complicated! ARM publishes a how-to Buying Guide that explains all the different things they sell, including intellectual property licenses and what they call a "foundry program" partnership. ARM doesn't have a semiconductor fabrication plant, but they know people who do and can help client companies figure that out detail. Nimur (talk) 17:57, 22 November 2014 (UTC)[reply]

MediaWiki getting the user's name in a template.

In MediaWiki (*not* Wikipedia) - is there a way to get the current user's name to insert as a parameter for a template?

I kinda expected to see it as one of the "magic words" - but for some reason it's either not there - or I am misunderstanding it.

Obviously, the four-tilde thing can do it...but I don't think I can abuse that to get what I need because it's expanded when an edit is committed and I want something more dynamic.

If not, is there an extension that adds that capability?

SteveBaker (talk) 18:01, 22 November 2014 (UTC)[reply]

$wgUser->getName() : see the User class reference.
...Are you writing PHP code or Wiki markup code for this template?Nimur (talk) 18:13, 22 November 2014 (UTC)[reply]
Markup. It's easy in PHP.
I discovered the "MyVariables" extension that adds {{CURRENTUSERNAME}} - I'm a little surprised it's not in the core MediaWiki package. ..but I guess if someone had to go to all the trouble to add an extension to do it, there probably isn't any mechanism in the core software. I wonder why not? SteveBaker (talk) 04:58, 23 November 2014 (UTC)[reply]

Printer is connected to the network but (I think) does not receive print requests

My office has 3 HP compaq dc7900 computers with Vista, all connected via network to an HP LaserJet P2050 printer. Each computer reads the printer (it shows up as Ready under Printers) but when I attempt to print from two of them the printer shows no sign of receiving the request, and about a minute later the printer status on the computer marks it as Error. I have just unchecked the SNMP box from the configuration port, as previously the printer was being read as offline. I don't know if that's relevant but thought it polite to mention.)

The printer is capable of printing Demo/test pages from itself without queue problems, which makes me think the problem is between the computer connecting to the printer. The third computer is capable of printing from the printer perfectly. What would be some good steps for me to try? I've already tried clearing printer spools and turning every relevant machine off and on again. 50.54.39.26 (talk) 18:17, 22 November 2014 (UTC)[reply]

Colors turn red after reboot and MS Visual C++

Whenever I restart my computer (Asus i7 64bit laptop with windows 7 and nvidia geforce gtx 670m) it changes from my last color calibration to a redder shade, so that whites become pink. This happens noticeably, within a fraction of a second after the desktop appears, and the icons load. In other words, the color is being actively changed from the previous setting by something that is loading on restart. I can fix this temporarily by going to the control panel and recalibrating the colors, but it's maddening to have to do this without fail on every restart.

This behavior only started about four months after I got the computer, it had been fine until then, and I did not install anything myself at that time that I believe would have caused the problem.

But, on checking my installed programs, I see I have a full 10 versions of Microsoft Visual C++ 2008 (and 2005) Redistributables, and I see that the earliest version of this shows an install date of four months after I got the computer in 2012. On the same and the following day I seem to have received a full system update with over 20 programs from MS, ASUS, Atheros, Intel, VIA technologies, Cyberlink, Synaptics, eCareme, etc.

Oh, and I just updated my nvidia driver, but the shift to red is still occurring.

(1) Is it possible the shift to red is being caused by a version of this MS Visual program? Is there some other likely source for the problem?

And

(2) Do I need all ten versions on my computer? Can I uninstall nine or at least some of them? Would I just keep the latest version? Or are they components that have to be kept?

Thanks. μηδείς (talk) 22:35, 22 November 2014 (UTC)[reply]

1) It is possible. Open task manager as soon as the computer turns to red shift, without starting anything up, and see what programs are running in the background.
2) Probably not, if each version is standalone. But if each update only adds a few files, then it is likely that it depends on the old versions as a base, so keep it. KonveyorBelt 23:51, 22 November 2014 (UTC)[reply]
Okay, I just rebooted (thank God for SSI) and checked task manager and nothing was running. I noticed the change to red happens just after the four note windows jingle ends, but before the icons appear for items pinned to my task bar. Looking at the Visual installations, most of them are about 256KB, but the first two are 11MB and 13MB. One has x64 next to it, and the other has x86 after the name. I have a 64 bit OS. Am I just totally barking up the wrong tree suspecting Visual might be the source of the problem? μηδείς (talk) 00:09, 23 November 2014 (UTC)[reply]
Check and see if the x64 has the same files or modifications thereof of the x86 version. If it does, it is standalone and the x86 can be deleted. As for the "updates", they are not standalone and the big x64 file, which I'm guessing is the base, needs to be kept. KonveyorBelt 04:47, 23 November 2014 (UTC)[reply]
  • The red remains I deleted all the Visual x86 files without a hitch, but the change from my prior calibration to a very red tinted one remains when I boot up. Any other suggestions? I can take a screenshot of the programs that were installed on those two days. μηδείς (talk) 05:04, 23 November 2014 (UTC)[reply]
I spent an hour digging around various forums, but there doesn't appear to be any issues like yours that I can see a clear applicable fix for - it is highly unlikely that c++ had anything to do with it. What setting do you have in the Nvida control panel? (There's usually an icon to enter it in the little box of icons by the clock on the lower right [forget the name of them]). You should have an option to force colour management to be done through that; which may solve your problem. If that doesn't work, or you don't have such options in your case, it would be helpful to have the list of installed programs and any other info you might have handy. Since it is happening after windows boots, it doesn't sound like it is a hardware issue -- does it happen immediately upon going into windows or is there a delay? (I'll look around more tonight after a nap, I'm sure someone has had the same problem somewhere, or something like it, hopefully I'll have some more information for you).Phoenixia1177 (talk) 23:22, 23 November 2014 (UTC)[reply]
Thanks. The list of programs is long, I'll see if I can get a screenshot uploaded for commentary. I'll also check the Nvidia settings, although this will probably take me until later tonight. As for when the change occurs, my wallpaper appears first, in the old "good" calibration, then the icons appear on my desktop, then I hear the four-note windows signature micro-jingle then the screen reddens, and finally the items pinned to my taskbar appear. This is all from appearance of desktop to appearance of taskbar items happening within a fraction of a second, but the color change is obvious if you are paying attention. μηδείς (talk) 18:42, 24 November 2014 (UTC)[reply]
If you have an Asus, check these out: [5], [6]; it is related to a program that comes with their devices that gets set to something screwy - even if you don't have an Asus, you may have something similar, so might be worth a glance. This [7] explains how to keep your calibration setting, which might help - though, if there is another programming doing it, I'm not sure what "wins" out in that situation, so it may not be of use. Sadly, that's all I have without digging through a list of startup programs. If you download hijackthis and follow this, [8], you can get a list of startup programs - that would be a good place to start - if you want to post a full log from the program in a hat on my user page, I can go through that and see if there is anything telling, too.Phoenixia1177 (talk) 07:54, 25 November 2014 (UTC)[reply]

November 23

What games would a laptop with these specs run ?


System Information


Time of this report: 11/17/2014, 20:26:47 Machine name: DIGITAL-PC Operating System: Windows 7 Édition Intégrale 32-bit (6.1, Build 7600) (7600.win7_gdr.130318-1532) Language: French (Regional Setting: French) System Manufacturer: Hewlett-Packard System Model: HP Pavilion g6 Notebook PC BIOS: InsydeH2O Version 03.72.32F.24 Processor: Intel(R) Pentium(R) CPU B960 @ 2.20GHz (2 CPUs), ~2.2GHz Memory: 4096MB RAM Available OS Memory: 932MB RAM Page File: 1109MB used, 847MB available Windows Dir: C:\Windows DirectX Version: DirectX 11 DX Setup Parameters: Not found User DPI Setting: Using System DPI System DPI Setting: 96 DPI (100 percent) DWM DPI Scaling: Disabled DxDiag Version: 6.01.7600.16385 32bit Unicode — Preceding unsigned comment added by 197.0.73.27 (talkcontribs)

Intel HD graphics will run most modern games well as long as you turn down the graphics to low settings. KonveyorBelt 18:26, 23 November 2014 (UTC)[reply]
You could play League of Legends at about 40-50fps on medium-low. You might squeak by playing Counter Strike: Global Offensive at 40fps on low settings. Like Konveyor Belt said, you'll be able to play most modern games, although some (Like DayZ and Civ III) will not run smoothly at all. I used to have a desktop with those specs and that's what I could get by with. 184.16.206.204 (talk) 22:13, 23 November 2014 (UTC)[reply]

Question about Facebook spamming

Lately, I have seen very many instances of Facebook of spam comments appearing in posts, all advertising free points for online games. The thing is, they all appear as comments of one single poster, namely a page called "I don't smoke!", which I follow because I don't smoke, and advocate not smoking to everyone else too, but for some reason that particular page never posts about actually not smoking, but just things in general. The spam posts are always under legit-sounding user names, and when I click on the profile link, the profile seems legit enough. What is happening here? Are they legit profiles somehow hacked or fake profiles? Why is this only happening on posts made by "I don't smoke!"? JIP | Talk 19:25, 23 November 2014 (UTC)[reply]

I can't do the searching because I'm at work, but i'm certain I have seen a setting that allows facebook to use your profile to post ads like this. It's not a "hack", it's what facebook does. I was once lying beside my wife in bed on ipad while she was just reading a book and facebook posted on my time line, from my wife's account, that she liked American express. She wasn't even online. eventually we worked out that around a year previously she like some random travel page because they were having some give away at the time, in the fine print, she also gave the page the right to post as her profile random crap on other people's timelines. Just retelling the story makes me want to delete my facebook account.. I am at the point where I would actually pay for a service if it wasn't so dodgy and scammy. Vespine (talk) 21:41, 23 November 2014 (UTC)[reply]

Regin spyware article?

Which article covers this? Hcobb (talk) 19:29, 23 November 2014 (UTC)[reply]

This Regin (virus) is the Wikipedia article on it, it looks like it was created the same time as you posted; there is nothing there, really, as of yet. It appears that this news just came out, so that's not surprising.Phoenixia1177 (talk) 22:53, 23 November 2014 (UTC)[reply]

November 24

Determine subtree height in a binary tree is O(n) or O(1)?

AVL tree is of binary trees. When inserting a node into an AVL tree, the rotation balancing the tree needs tree height info. of some subtrees. In this implementation, the tree height is defined as:

/*  The function Compute the "height" of a tree. Height is the
    number of nodes along the longest path from the root node
    down to the farthest leaf node.*/
int height(struct node* node)
{
   /* base case tree is empty */
   if(node == NULL)
       return 0;
 
   /* If tree is not empty then height = 1 + max of left
      height and right heights */
   return 1 + max(height(node->left), height(node->right));
}

It is actually a recursive function which actually traverse the entire subtree to just find out the subtree height, if I understand correctly.

My questions are:

(1) Is the complexity of function height() O(n) where n is the number of nodes in the subtree?
(2) Since insertion operation of AVL tree is O(log n), does it mean finding subtree height like function height() does doesn't slow down the insertion and result in an overall O(n) insertion complexity?
(3) Does it help to add a treeHeight member to the node structure like this:
/* A binary tree node has data, pointer to left child
   and a pointer to right child */
struct node
{
    int data;
    struct node* left;
    struct node* right;
    int treeHeight; /* ***** add this to keep track tree height to prevent tree traversal everytime the tree height is queried ***** */
};

so we can calculate tree height in constant time O(1) by:

node->treeHeight = 1+ max(node->left->treeHeight, node->right->treeHeight);

sort of like Dynamic programming method to find out shortest path in a graph? -- Justin545 (talk) 04:22, 24 November 2014 (UTC)[reply]

The implementation you show is for determining the height of a given tree, which structure is unknown. Specifically it is not an AVL tree. In no way it is 'a definition' of a tree height. So it has nothing to do with AVL handling complexity.
Furthermore AVL trees do not need the exact height, it's sufficient to know whether both subtrees are equal height or which of them is higher. See AVL tree article for more details. --CiaPan (talk) 06:04, 24 November 2014 (UTC)[reply]

finding files in Win 8.1

The upfront search facility is no help with finding files by name on my laptop. Am I missing something? How do I find a file if I don't know where it is in the folders structure? --Halcatalyst (talk) 04:28, 24 November 2014 (UTC)[reply]

What is the oldest activie linux distro when you count also forks?

Wikipedia say slackware is the oldest active linux distro. Doest this count also forks of some other distro? If no, the answer to the question is still slackware?

Softlanding Linux System from May 1992 begat Slackware as a fork and could be considered the oldest founder of any currently active Linux distribution. SLS also inspired the creation of Debian as an alternative distribution. --Mark viking (talk) 21:33, 24 November 2014 (UTC)[reply]

Website to block an ISP

I know that ISP's are the one's that normally block websites, but is it possible to do it the other way around? I get far too many hits on my website from my company, that it's creepy. On Google Analytics, the ISP is displayed as my company's name -- e.g. "Wikipedia". I would like to block all hits from a service provider that identifies itself, for this example, as Wikipedia. The problem is, I host my website through a host (Wix) that makes website design/publication easy, but limits the code I can put on it. As far as I'm aware, all I can use is HTML code. Is there anyway I can block a ISP with that? If not, at least something equally creepy for them back, like a message that comes up saying "Hello someone from Wikipedia [for example], you're visit has been logged", for further example. Thanks 92.237.191.99 (talk) 18:37, 24 November 2014 (UTC)[reply]

No, really, the only thing your server knows is the IP address...which you might be able to correlate with an actual business address. However, I don't think there is a way to get that information in pure HTML/JavaScript. In Javascript, you can get the Referrer of the current document:
  var x = document.referrer;
...and the result will be the URL of the webpage where the person clicked in order to get to your page. If everyone at your company is clicking some internal website to get to yours - then that might actually work. However, the privacy issues surrounding this "referrer" information are kinda nasty - so many browsers and web-intermediaries scrub that information - so it will certainly not be reliable.
However, it's possible that your web service provider allows PHP scripting in your web pages...and if so, then you can do it in PHP by comparing $_SERVER['REMOTE_ADDR'] with the address range of your company and generates an appropriate response if there is a match,
SteveBaker (talk) 21:00, 24 November 2014 (UTC)[reply]

What can a .SCR file do?

I received an .SCR file from a friend a few minutes ago via Steam. I knew full well that his account was hijacked and it was not him who sent me that file. I have dealt with many malware in my time (.exe, .com, .vbs, .bat), but this is the first time I encountered a .SCR extension. The context menu showed 2 options: Test and Install, with the former being default. No administrative privilege was required, meaning it could not make change to important system folders. In a moment of curiosity and being over-confident, I gave it a Test to see what it could do. It showed an image in Windows Photo Viewer to fool me (as expected), but actually ran as a background process (out of my expectation), and I killed it.

My friend told me that his account was hijacked and all his virtual items had been lost, because of that .SCR file. I don't know how he "used" it (Test or Install, but likely Test since it is the default). I've checked my system and found no unusual startup application and running process, and I am 99% sure I am safe. But I still want to know what .SCR files can do in term of malicious activities (maybe recording keystrokes I guess). I am sure it cannot do everything like an .exe because it is not designed for that purpose. -- Livy (talk) 19:16, 24 November 2014 (UTC)[reply]

.SCR is the extension for a Windows screensaver program (the .SCR extension allows the little program that lets you choose which screensaver to run to know it's suitable to work as a screensaver). But it's really absolutely the same as a .EXE - it's a fully fledged unsandboxed executable with full permissions (hmm, I confess I'm not sure that's true on later Windows, but it certainly was the case at least as far as XP). So it can do anything that an .EXE can do - if it genuinely wasn't from your Steam friend, you should surely assume you're infected with professional-grade malware, and take appropriate steps. -- Finlay McWalterTalk 19:22, 24 November 2014 (UTC)[reply]
Worse than I thought. As far as I know executable files like .gadget can execute malicious code, but they are somewhat limited by their extension (some Gadgets require external .exe running in the background for full features because they cannot do everything). I knew it was a screen saver file, that's why I was confident and gave it a Test. In the worst case, I still highly doubt its ability without administrative privilege. -- Livy (talk) 19:37, 24 November 2014 (UTC)[reply]

I don't normally comment on this help desk, but it's really quite dangerous to run a .scr file just to see 'how much damage it would do'. In this instance, you saw the process and terminated it. That's fine. But most malware adds itself to some sort of startup mechanism so when you restart, it will restart that malware. I'm glad that you checked for this, but sometimes they can be sophisticated little buggers and do stuff even more surreptitiously. Might I suggest that if you're planning to do this in the future, use Sandboxie? Tutelary (talk) 19:46, 24 November 2014 (UTC)[reply]

It was my bad, I know. There were several years when I lived without any antivirus. It was XP time, with zillions of malware but I never got infected (except for infection via Windows XP network exploits, which was out of my control). I have been always confident of what I do since then. But this time, it was a moment of silliness. I considered it a casual screen saver with malicious code, and underestimated its capability. It is Windows after all, where any programs can do anything. I'll send that .SCR file to Microsoft so that they can analyze and add it to the next definition (I am using MSE). They are not very active recently like they were before though. -- Livy (talk) 20:09, 24 November 2014 (UTC)[reply]
If you really want to mess them up, upload it to Virustotal. They upload it and distribute it to all the major AVs. So it'll be caught a lot more. They -hate- people who upload it there, as it distributes their sample and makes it less likely to infect people. Tutelary (talk) 21:45, 24 November 2014 (UTC)[reply]

Is there a tool to translate messy HTML into a structured format?

Becoming interested in web page development, I started out with a WYSIWYG program. As I went along, I found I had to learn a little HTML to resolve certain types of error. Later I did learn HTML. I thought it might be fun to to start out with a fairly complicated web page and try to make it more intelligible and also tighten it up: the code I'm dealing with works, but it is loaded with extraneous junk which I believe the WYSIWYG program put in, because no human being could possibly have made it that messy.

Taking a whole page into account is more complicated than looking around for simple bugs. But I have "translated" a very messy, somewhat complex, page of HTML into a structured format. Hey, it wasn't that easy! I frequently got lost and confused. Age, I guess. But I've enjoyed doing it; it takes me back to my programming days long time ago, when we had low-level code and structure was immensely important, at least to me.

I wonder: Do any tools exist to translate HTML into a structured format? I wouldn't buy it, but I'd be interested in knowing how it works. --Halcatalyst (talk) 22:29, 24 November 2014 (UTC)[reply]

There is HTML Tidy. --  Gadget850 talk 01:25, 25 November 2014 (UTC)[reply]
This is one of a general class of things called "pretty printers" - if you Google "pretty-print html" then "HTML Tidy" comes up first - but there are lots of others. Add in the XML pretty-printers (which may or may not do a decent job with HTML) and you have a bunch of other options. Additionally, many text editors (vim and emacs, for starters) have options to automatically beautify HTML.
Another idea is to use Chrome for viewing your file, then open up the developer tools and view your code in the "Elements" tab....or use Firefox and use the Web Developer/Web Console/Inspector tool. Both of these can fold up the code and nicely indent it with color coding for reserved words, tags, attributes, etc.
Thank you. I looked at the Chrome "Elements" tool and it looks like they take it <...> by <...>, which is great for serious debugging, though not for what I'm doing. I looked at the wiki reference you gave and found these
Examples of fixes it can make to bad HTML:
Straighten mixed-up tags
Fix missing or mismatched end tags
Add missing items (some tags, quotes, ...)
Report proprietary HTML extensions
Change layout of markup to predefined style
Transform characters from some encodings into HTML entities
Since I'm mostly in it for the learning, I will take these as my goals. Basically, I want to gtake this one page I'm working with to include CSS and reach full HTML status.
By the way... in looking at the "Elements" rendition of my page, I saw two things that aren't visible to me in Notebook or in the source code KomPozer offers: #Shadow-root and &webkit-keyframes. What are these? --Halcatalyst (talk) 05:10, 25 November 2014 (UTC)[reply]

November 25

Running Windows via External Hard Drive

I am going to be running Windows on my Mac via an installation on an external hard drive. My question is... Could I use the hard drive I already have (stores my iTunes, videos, that sort of thing) for my Mac, and install the bootable Windows on a partition of it, without causing any errors? Cheers. Hubydane (talk) 10:17, 25 November 2014 (UTC)[reply]