Jump to content

Wikipedia:Reference desk/Computing: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Line 357: Line 357:
Performing Hadamrad on the first qubit yields <math> |0\rangle(|a\rangle+|b\rangle) </math>.
Performing Hadamrad on the first qubit yields <math> |0\rangle(|a\rangle+|b\rangle) </math>.


Performing Hadamrad on the first qubit, again, yields <math> (|0\rangle+|1\rangle)(|a\rangle+|b\rangle) </math>.
Performing Hadamrad on the first qubit, again, yields <math> (|0\rangle+|1\rangle)(|a\rangle+|b\rangle) \ne |x\rangle </math>.


But Hadamard is self-inverse (=the inverse of iteslf), so this is probably wrong... I guess the result of the first time we performed Hadamrd is not what I wrote above. So, what is the correct result? [[Special:Contributions/31.154.92.193|31.154.92.193]] ([[User talk:31.154.92.193|talk]]) 17:33, 20 October 2015 (UTC)
But Hadamard is self-inverse (=the inverse of iteslf), so this is probably wrong... I guess the result of the first time we performed Hadamrd is not what I wrote above. So, what is the correct result? [[Special:Contributions/31.154.92.193|31.154.92.193]] ([[User talk:31.154.92.193|talk]]) 17:33, 20 October 2015 (UTC)

Revision as of 17:35, 20 October 2015

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:


October 15

Why block ssh?

I'm visiting an institution that is preventing me from making outbound ssh connections using their network. The IT rationale here seems arbitrary and capricious, but I don't know if there might be a shred of a good reason in this case. Can anyone give me a brief overview of why it might be considered a security risk to allow me to use the institutional network to connect via ssh to any other computer? My limited understanding was that out ssh was widely considered fairly secure and had few risks. Thanks, SemanticMantis (talk) 14:24, 15 October 2015 (UTC)[reply]

The rationale is one of using a whitelist - blocking everything and only permitting certain pre-approved network protocols. The problem with this approach is that it blocks many non-malicious programs, as well. This is to say nothing of the efficacy of the technique: in principle, malicious software can use any TCP port.
If the administrator intentionally wants you to use "only" web browsers and email, they'll probably open up standard ports for HTTP, HTTPS, TLS IMAP and SMTP, and so on; and block everything else. Port 22 is probably not singled out; it's just collateral damage.
Does this improve security? Well, it prevents some malicious software activity, at the expense of annoying a small number of users... that's a tradeoff that the network administrator has decided to make.
If you want to be really savvy, set up your home base to proxy SSL over HTTP (or just host an SSL server on port 80). That will get you through a lot of the annoying firewalls, at the expense of "standards-compliance." This will only work around the problem if the firewall's block is based on TCP port; a modern firewall can be much more sophisticated. Here are instructions from haax.se (the same group who provide us with cURL and other great free software): SSH Through or Over Proxy.
Nimur (talk) 15:39, 15 October 2015 (UTC)[reply]
Thanks @Nimur: I'm familiar with whitelist paradigm, but I get the sense that SSH is specifically blocked. I don't really want to out my institutional affiliations here, but an old (2004) internal audit I found online includes "..an internal webserver used by the laboratory... had five security holes, including FTP, SSH, HTTP..." Now I know at least vaguely why unsecured FTP and HTTP can be "security holes", but I was surprised to see SSH on that list. Thanks for the workaround suggestions, I think they would work for me in principle, but not until I can physically get back the other machine and set up the appropriate stuff :-/ SemanticMantis (talk) 17:41, 15 October 2015 (UTC)[reply]
I've hit this problem twice myself and I'm both a computer science professor and an old curmudgeon. So, I pester the hell out of the kids who run the IT department with little more than a Microsoft and Cisco certification until they can give me a real answer. The answer both times was that they are a Microsoft shop. They use Windows. Windows doesn't come with SSH. So, if I am trying to use SSH, I am using a program that I added to the computer, which is not allowed. So, I'm in violation of their computer use policy. They shouldn't allow a protocol that isn't allowed to be used. The reality is that SSH is very secure. Yes - old versions of SSH aren't secure now because computers have advanced. But, current versions of SSH are secure. I am hesitant to note another issue because it implies that the people you are working with are dishonest. They may be doing traffic monitoring - nasty deep packet stuff. Many organizations are doing it now. If you encrypt your traffic, they can't spy on you. So, they ban attempts to encrypt traffic. That also means that they decrypt SSL traffic by using a man-in-the-middle against everyone on the network. I do work for an organization like that and I told them that I refuse to use any computer that they will be inspecting in that way (I also blocked their fake registrar to keep my computer from blindly accepting their fake certificates). Being a major asshole, my refusal to work went high above IT and administration decided that they needed my work more than they needed IT to spy on me. I really kind of which I would have been allowed to pocket my 1/3 up front pay and walk away without doing the work though. 199.15.144.250 (talk) 19:03, 15 October 2015 (UTC)[reply]
Doesn't this old curmudgeon remember that it was Bill Gates who invented the computer!, discovered the internet!!, created the bestest software in the whole universe!!!, made computers safe from male-ware and viruses!!!! You may have bought your computer and own it but only Microsoft is competent enough to control how you use it, and ... Oh going to have to break off here, as my psychiatric nurse is telling me its time for my next dose of medication My apologies for writing this with a green crayon but they won't let me have anything sharp on this ward.--Aspro (talk) 22:31, 15 October 2015 (UTC)[reply]
Privacy is great and all, but not when you are trying to run a company, say the finance sector. When you are looking after billions of dollars that belongs to your customers, you really don't want anyone to be able to do anything without at least "some" oversight. I work for such a company and we do all the above, man in the middle, SSL inspection, email filtering, DLP, etc... We also investigate about a dozen cases of misconduct, up to and including fraud and embezzlement every month. (If you've ever worked for a company with almost 6 figures of employees, this won't be shocking). If there is any secret back door or place to hide in the network, no matter how "well intentioned" it might be, if it can be used to commit illegal activity, you must assume it will be used to commit illegal activity, otherwise you're just a sucker waiting to get fleeced. You can argue that your privacy is more important to you, but in reality you have no reason to do anything "private" on company computers anyway, it's NOT "your" computer, it's NOT "your" network connection. You want to do something private, bring a tablet to work. Vespine (talk) 03:15, 16 October 2015 (UTC)[reply]
It isn't always about personal privacy. I work with medical data. There is a legal privacy involved. IT guys are not authorized to see patient data. So, the act of decrypting patient data that is encrypted specifically to keep people from seeing it is a security risk, not a security benefit. It is a complicated issue. It is not black and white. 199.15.144.250 (talk) 15:30, 16 October 2015 (UTC)[reply]
I was not suggesting it was just about personal privacy, even client banking data is highly confidential of course you don't want every "IT guy" seeing it. I'm an IT guy and I'm not authorized to view any of it, but that does not mean there are not other checks and procedures in place to ensure it is appropriate and that it can't be used for nefarious purposes. or that there isn't a legal/security/ audit/ compliance team that IS authorized to view it. What you are talking about is a completely different issue. Vespine (talk) 00:09, 20 October 2015 (UTC)[reply]

There are tons of botnet machines on the Internet that constantly try to brute force SSH logins. If you have a public IP address, just monitor incoming traffic and you'll see fairly regular new connection attempts on port 22. They're just doing dictionary attacks with common username/password combinations, to try to get into poorly secured machines, take them over, and add them to the botnet. For network administrators this means it often seems like a good idea to just cut off SSH traffic entirely, to avoid the headache of trying to ensure every machine on your network has strong passwords for user accounts. This often happens for other protocols, like IRC, which have a reputation for being used for malicious activity. Only computer nerds like us care about any of those protocols anyway; the vast majority of users only want Facebook and e-mail. None of this has anything to do with SSH itself being insecure, which seems to be what you've assumed. --71.119.131.184 (talk) 05:28, 16 October 2015 (UTC)[reply]

So does running the SSH daemon on an obscure port help to ameliorate this threat? Or do the brute force attacks generally first scan all ports for openings? I ask because I have a couple Linux machines running on random port numbers. Justin15w (talk) 18:25, 16 October 2015 (UTC)[reply]
That gets into portscanning. If you run SSH on port 12345 and when I connect it says "Hello There! I'm a happy SSH service!" then I know it is SSH. The number of available ports is limited, so it won't take long to scan all of them. Most SSH (and other service) configuration files have options to remove any sort of service identification. Then, the client has to try to login on every port that connects. To slow them down more, you can add honeypot ports that say "Hello There! I'm a very old unpatched SSH server!" and let them pound on it for a while. (note: SSH doesn't actually respond with Hello There - but all services respond predictably from given input). 199.15.144.250 (talk) 18:50, 16 October 2015 (UTC)[reply]
It depends. Some only probe common ports; some attempt a full port scan. Using a nonstandard port can cut down on malicious login attempts, but it isn't any kind of ironclad security, and it adds the annoyance that any legitimate user needs to know the port number and pass it to their SSH client. An alternative option is to use something like DenyHosts to lock addresses out after a certain number of failed logins. Or, disallow password login and require public key login instead, which makes brute-forcing impossible. But of course, the tradeoff with all of these methods is added inconvenience to legitimate users. --71.119.131.184 (talk) 01:48, 18 October 2015 (UTC)[reply]

which partition editor recognize exfat filesystem

gparted and easeus failMahfuzur rahman shourov (talk) 14:46, 15 October 2015 (UTC)[reply]

software that will input strings and output one string at random

OP want make program where input example:Nimur, YX-1000A, SemanticMantis so on then hit a button that make one name show in dialog box. OP want code in VB6 format. Request because hobby and forgot syntax semantics.Mahfuzur rahman shourov (talk) 15:59, 15 October 2015 (UTC)[reply]

This is Wikipedia's reference desk: our core objective is to help make a better free encyclopedia by directing contributors to reliable sources. If you wish to commission custom software, this is not the place to do it. If you need help finding information about Visual Basic, our article is a good place to start. Nimur (talk) 16:07, 15 October 2015 (UTC)[reply]

OP saw people share code on IRC, OP think refdesk help share codeMahfuzur rahman shourov (talk) 16:12, 15 October 2015 (UTC)[reply]

motd (Unix) --Hans Haase (有问题吗) 16:50, 15 October 2015 (UTC)[reply]

what is the highest available build (software+setting+tweak) for compressing black and white images

OP browsing doujin collection, saw sizesMahfuzur rahman shourov (talk) 17:33, 15 October 2015 (UTC)[reply]

I'm not sure I understand the question, but JBIG2 is probably the best black-and-white image compression method in wide use. Both PDF and DjVu use it. -- BenRG (talk) 07:59, 17 October 2015 (UTC)[reply]

SQL problem: row not found either with IN or with NOT IN

I ran to a problem today at work. I have an SQL query in the following style:

select id from my_object where id not in (select id from my_object where /* some conditions go here */) and /* other conditions go here */;

The query was supposed to return at least one row, but it didn't return anything. Then I replaced the not in operator before the subquery with in, but it still didn't return anything. Only when I removed the subquery altogether did it return the row I wanted. How is it possible it didn't return anything either with in or with not in? I ran the subquery by itself, and it returned over 23 thousand rows, but the row I wanted was not there, just like it was supposed to, because the main query is intended to return only rows the subquery doesn't return.

But why is the subquery not working with either operator? What could possibly be the reason? JIP | Talk 18:40, 15 October 2015 (UTC)[reply]

If you are using Oracle, it could be the happy way in which NULLs are treated. You can get something that neither "in" nor "not in". For example: select 1 from dual where 1 in (null); -- returns nothing. Try the opposite: select 1 from dual where 1 not in (null); -- returns nothing. So, if your subquery only returns records with null ID, you will be neither in and not in at the same time. 199.15.144.250 (talk) 18:53, 15 October 2015 (UTC)[reply]
No, I know for a fact that the subquery is only returning rows with non-null ID. JIP | Talk 20:20, 15 October 2015 (UTC)[reply]
On second thought, it might be worth investigating. The data model is such that the subquery is not supposed to ever return nulls. But some glitch in the software might have resulted in null values having being stored anyway. I will try to add an extra condition id is not null to the subquery when I get back to work tomorrow morning. JIP | Talk 20:26, 15 October 2015 (UTC)[reply]
And this turned out to work. Thanks for your help, 199.15.144.250. JIP | Talk 08:01, 16 October 2015 (UTC)[reply]
Great! When in Oracle, always blame the nulls until you can prove it is something else. 199.15.144.250 (talk) 11:36, 16 October 2015 (UTC)[reply]

October 16

MS Outlook question

This is probably right in front of me, so I'm sorry if this is simple.

In MS Outlook, I have my sent mail set up to go to a folder called "Sent 2015" folder. But when it does that, it shows as being unread. Obviously, it was read since I sent it. So, how do I fix it so that it doesn't automatically show as unread? This is MS Outlook ver. 14. Thanks, Dismas|(talk) 14:16, 16 October 2015 (UTC)[reply]

Sounds like it sends a copy rather than the original, and correctly reports that the copy is unread. Is there a choice to send the original rather than making a copy ? StuRat (talk) 02:14, 17 October 2015 (UTC)[reply]
If I'm understanding the account settings pane correctly, I am sending the original to that folder. Dismas|(talk) 03:18, 18 October 2015 (UTC)[reply]
OK, one other thought, is the target folder on a different physical disk ? I've seen a problem before where it can't move a document to another disk, but instead considers it a copy. This seems to have to do with each disk having it's own index, so you can't just change the index to point to a new location, but actually have to create a new index entry on the new disk. StuRat (talk) 19:08, 19 October 2015 (UTC)[reply]
Nope. Same disk. This is just a laptop with a single drive. Dismas|(talk) 12:49, 20 October 2015 (UTC)[reply]

how to calculate number of ipv6 addresses in a range

example:182.48. or FFF.DE.AB. so onMahfuzur rahman shourov (talk) 17:02, 16 October 2015 (UTC)[reply]

See Classless Inter-Domain Routing. Tevildo (talk) 21:57, 16 October 2015 (UTC)[reply]

which windows registry entries define which font to be used for a particular plane of unicode

example:font a for latin, font b for arabic, font c for hangul so onMahfuzur rahman shourov (talk) 17:21, 16 October 2015 (UTC) @StuRat, Bavi H, Tamfang, SemanticMantis, BenRG, and Nimur:mentioning as many users i can because NEED ANSWER, NOT silence.103.245.205.158 (talk) 06:15, 17 October 2015 (UTC)[reply]

problem scenerio:default font choice of windows as per unicode plane is unsatisfactory, OP found software that can change default font for devnagari plane ->https://www.omicronlab.com/tools/font-fixer.html OP seek way to manually edit for all planesMahfuzur rahman shourov (talk) 06:42, 17 October 2015 (UTC)[reply]

I think Windows programs like Notepad use some system setting to choose the font if a character isn't available in the current font the program is using. I found some discussion about how Windows 7 does that in this Super User question:
The answers talk about looking in a text file c:\windows\fonts\GlobalUserInterface.CompositeFont (or GlobalMonospace, GlobalSansSerif, or GlobalSerif), searching for a matching Unicode codepoint number range in that file, getting the list of fonts specified, then using a font viewer like Character Map or BabelMap to find the first font in the list that actually has the character you want. If you want to change the fonts used, maybe you can back up the text file, then try editing it. Note: Windows sometimes protects certain operating system files from being changed. I didn't try editing my CompositeFont file, so I don't know if it actually works. --Bavi H (talk) 15:09, 17 October 2015 (UTC)[reply]
User:Mahfuzur rahman shourov:
With respect, it doesn't seem like you are putting any effort into searching for answers; and I fear that even if we provide proper answers, they may be beyond your comprehension. Windows Registry entries do not have anything to do with fonts and character sets. See, for example, Character Sets Used By Fonts for an introduction. You seem to totally misunderstand how text and fonts work on Windows (or any other common system).
While calling out individual contributors by name may draw our attention - at least, the first few times you do it - if you continue this trend (and continue to demonstrate that you're not putting forth any constructive effort), many editors (including myself) will begin to simply ignore you. If you believe that you are entitled to an answer, you've come to the wrong place; and if you think you can mask your identity by hopping between IPs or user-names, you underestimate our perceptive abilities.
We volunteer our time because we find these topics interesting, and because we enjoy finding resources and helping others. If you ask ill-considered questions and then demand our attention, you decrease the probability that any of us will volunteer our efforts to help you. Eventually, your contributions will be considered "disruptive," and you will be blocked. Consider this the first, last, and friendliest warning that you will receive. Nimur (talk) 17:11, 17 October 2015 (UTC)[reply]

@Nimur:it your choice answer or not. veiled threat along "if you think....ip username hop" bad form, bad behave. not want mention, say nice, do not mention suffice. OP think strong on AGF. people not forced to answer, never said shouldMahfuzur rahman shourov (talk) 17:22, 17 October 2015 (UTC)[reply]

Javascript date object

This short codepiece:

var month = new Date;

document.write("This month is" + " " + month.getMonth() + "
");

Brings me the result "This month is 9". I guess it's because in JS we start to count from 0 instead of 1... Well I tried to write +1 right after getMonth() but then I got 91; I also tried to right +1 before month.getMonth and than I got 19... :| Well, Is there any way, without using arguments, to make the result 10?... Because indeed we are in the ten month of this year... :) Ben, Ben-Yeudith (talk) 18:17, 16 October 2015 (UTC)[reply]

Order of operations. String+Number = String. So, you are trying String+Number+Number, which turns into String+Number. You can use parenthesis to force the order you want as String+(Number+Number). 199.15.144.250 (talk) 18:36, 16 October 2015 (UTC)[reply]
(ec)It's happening because the various elements you're collecting together with + in the argument to document.write are evaluated left-to-right. So first you take a string "This month is" and add a space to it, making another string. Then you're taking that string and adding the integer 9 (produced by month.getMonth()) to it. Javascript "promotes" that integer 9 to a string "9", and appends it, producing the string "This month is 9". Then you're adding another integer 1 to that; again using + with a string and an integer promotes both arguments to strings, so 1 becomes "1". So the resulting string is "This month is 91" - the result you're getting. To fix this, you want to do integer arithmetic on the 9 and 1, which means you want to to that before the 9 gets turned into a string. Use parentheses for this. So say document.write("This month is" + " " + (month.getMonth()+1)); and you'll get the 10 you want. -- Finlay McWalterTalk 18:38, 16 October 2015 (UTC)[reply]

Book reader

I'm looking for a USB camera on a stand that is capable of displaying book pages (real, printed books), or other documents, on a screen. Something like a USB microscope [1] would be ideal, but all the ones I've looked at start at something too big like 20X magnification or something, much too much X to get a whole page in the frame. SpinningSpark 23:32, 16 October 2015 (UTC)[reply]

Try searching on "document camera". -- ToE 23:57, 16 October 2015 (UTC)[reply]
I knew they had a name! They use them all the time in schools, but until you provided that link I couldn't remember that it is "visualiser". Thanks. Old age really stuffs up the memory. SpinningSpark 00:21, 17 October 2015 (UTC)[reply]
They make a version that displays an entire page at a time at low magnification, but they are rather expensive. My local library for the blind (and, in this case, visually impaired) has one, so you might look for one near you. StuRat (talk) 02:12, 17 October 2015 (UTC)[reply]

October 17

Control F "find" not working in Google Chrome

Windows 7, Google Chrome. When I bring the previous search back up by typing CONTROL F, it appears with the previous search term, but the search up and down arrows are grayed out. If I retype the same search term, it works correctly. Any idea why this happens ? StuRat (talk) 02:09, 17 October 2015 (UTC)[reply]

wi-fi accelerator

Can you point me to a hardware or software wi-fi accelerator that would work with the computer I just bought and have found out is really slow?

This is the computer.

The router is a Netgear NETGEAR24. Thanks,Halcatalyst (talk) 02:11, 17 October 2015 (UTC)[reply]

Does it make any difference if you bring the computer close to the router? Have you tried making a wired connection and comparing the speed? You need to determine where the delay is occurring. Do you have other devices transmitting on the same frequency and causing dropped packets? If you are a long way from the router, then a Wireless repeater might be a solution. Dbfirs 08:40, 17 October 2015 (UTC)[reply]
I recently bought a similar (if rather inferior) Lenovo laptop ([2]). Hardware wise the laptop, including its wifi, is perfectly good, and I have no problems doing all kinds of things like streaming HD video over ssh or smb over the wifi, or playing Terraria. But good lord, it came with an astonishingly large amount of adware, trialware and other preinstalled junk. Had I intended to continue running Windows on it, I'd have had to do some major crapware removal. Do that. -- Finlay McWalterTalk 09:59, 17 October 2015 (UTC)[reply]
Yes, if the computer is slow in general, then Finlay's solution is the one to go for. I'd assumed that it was only wi-fi that was slow. Windows might be making your internet appear slow because it is busy downloading updates for all the bloatware. Dbfirs 12:52, 17 October 2015 (UTC)[reply]
Slow Wi-Fi connections are overwhelmingly caused by radio interference. Wi-Fi uses unlicensed radio frequency bands, which means anything is allowed to spew out emissions in those frequency ranges. The first thing you want to try is changing Wi-Fi channels. If you don't know how, look at the documentation for your router and computer, or just plug "wi-fi change channel" along with the device name into a search engine. You also might want to look at "channel auto select" if your devices support it. If that doesn't do anything, try the other suggestions given above. Rule 1 of troubleshooting is to isolate the problem. Basically it's unlikely buying some gizmo will do anything. The only major exception is if the two devices are very far apart, in which case a wireless repeater would probably help. --71.119.131.184 (talk) 22:30, 17 October 2015 (UTC)[reply]
I don't know if I would entirely agree with the last two statements. It's true you should first try other things, in particular determining precisely what sort of problem you actually having (e.g. what sort of speed are you getting to the router and what sort of latency, having a wired device connected to the router, if that's possible is a great help here) is and trying to work out what's causing it. As part of that, you probably should try things like changing channel and moving the router away from possible sources of interference (like most other wireless devices and also USB3 devices) or just moving it in general. You should get an idea of how many other wifi signals there are and what channel they're using in your locale to help you.

But after having done all that, you may find your router is just not very good. From my experience and from a lot of what I've read, with some cheap routers, particularly those ISPs give away, their wifi signal is not very good. The reach can be quite poor, so that even in relatively close locations you may get a fairly poor connection even without much interference. They can also have weird software issues which may need regular restarts to fix.

If you have such a router, looking for a better one is definitely an option which could significantly improve performance, and there are sites like SmallNetBuilder with decent reviews of routers. Buying a repeater in such a case may not help so much. (I'm presuming Wireless repeater is meant here, rather than another AP with a wired connection to the router.)

Netgear products aren't given away so much AFAIK, and some of them aren't bad, however they make enough that you could still have one which is a poor AP.

I would also note, as part of the earlier analysis, you should look at whether your AP is even well matched to your situation. Netgear24 doesn't seem to be the model name for any Netgear product, so I'm not sure what it is. But if you're still stuck with a g device, moving to n would often be worth it. (ac probably less so IMO at the moment, even if your device is ac.)

Since distances weren't mentioned, it's also worth considering whether 5ghz is likely to be a good option. If you're in the same room as the router, it probably is (although if you're in the same room, either you have unrealistic expectations when you call it "really slow" or there's probably some other problem) so if you have single band of selectable dual band, it's probably worth looking at a simultaneous dual band device if you want those sort of speeds (most likely for a LAN, since for most people their internet connection won't be fast enough). In a few cases like with a small apartment and with all devices supporting, perhaps 5ghz only is all you need, so either change the router to 5ghz if it's selectable, or consider a new one if it 2.4ghz only.

Nil Einne (talk) 10:14, 18 October 2015 (UTC)[reply]

Just checking in. That you all for your comments. Current status: the restore was only partially successful. The cookies aren't there and none of the the web sites recognize me any more, so I'm re-restoring. It took 30 hours the first time. Coincidentally, my email service is acting strange: sometimes it lets me me in and sometimes not. They said they will call within 48 hours. That means I have email off and on. Halcatalyst (talk) 17:10, 18 October 2015 (UTC)[reply]

Skype And Line Breaks

How do I get line breaks within the same message on Skype, if I want to send a poem, for example? If I use Enter, it just sends the line I have just written. Is there some other way? 82.35.216.24 (talk) 08:25, 17 October 2015 (UTC)[reply]

I don't use Skype messaging, so I don't know, but would suggest trying Shift-Enter. This often has the desired effect.--Phil Holmes (talk) 15:57, 17 October 2015 (UTC)[reply]
Thanks, that works.
Resolved

October 18

Unitary transformation

Is there any unitary transformation that satisfies:  ? 185.32.179.137 (talk) 05:25, 18 October 2015 (UTC)[reply]

Seems that it's only Hadamard on the second qubit... 185.32.179.137 (talk) 05:41, 18 October 2015 (UTC)[reply]

Laptop hard drive passes CHKDSK and all SeaTools tests except long generic

If a laptop hard drive (Hitachi, in this case) passes CHKDSK without a hitch, as well as all tests in the SeaTools program (S.M.A.R.T check, short drive self check, short generic) except for long generic, does this still mean that the hard drive is close to failure? Also, if a hard drive occasionally makes a low-volume but still noticeable "grinding" noise, is it close to failure? For reference, the laptop in question once hanged and showed a Windows 8 BSOD saying that a "Kernel Data Inpage Error" occurred, then after restarting showed an "operating system not found" error, although it worked fine again after another restart. Narutolovehinata5 tccsdnew 06:43, 18 October 2015 (UTC)[reply]

Are all these the same hard drive? If so, yes, it's living on borrowed time. Random system freezes and the BIOS not finding a bootable disk fall firmly into the realm of Things That Shouldn't Ever Happen. Add random drive noises and drive test failures, and your drive is basically telling you with alarms and flashing lights that it's about to die. --71.119.131.184 (talk) 09:40, 18 October 2015 (UTC)[reply]
The thing is, the system freeze/"operating system not found error" only ever happened once. What I don't get is that as I mentioned previously it failed a Long Generic test but passed all the other tests and the CHKDSK did not find any bad sectors. Also, I've noticed that the hard disk sometimes makes read/write noises, particularly if I plug the laptop to a power adapter or remove it. Narutolovehinata5 tccsdnew 10:08, 18 October 2015 (UTC)[reply]
It generally worth looking at the log of whatever tool you're using and seeing precisely why the long generic test failed. (If you're tool doesn't have one, look for a better tool. IIRC, both WD & Seagate tools definitely have logs.) It's also often worth using Speedfan's online SMART comparison to try and get an idea of how your HD is faring, or at least some tool which can give more info about it if you don't know what you're looking at (for example, does the HD have any reallocate sectors). Speedfan also makes it easy to keep a record if you keep copy of the URL somewhere for future comparison. However with everything else mentioned, I agree with the IP the HD sounds to be on borrowed time. Nil Einne (talk) 10:27, 18 October 2015 (UTC)[reply]
@Nil Einne: Unfortunately, SeaTools for Windows (which is what I'm using) doesn't really give a full log: while it does give a log, it only shows which tests have passed or failed, not the actual test results. What is really strange is that the only test it failed is the Long Generic test; all other tests (SMART, SDT, Short Generic) passed, while a CHKDSK showed that there were no bad sectors. Looking online, it seems that normally, if a drive is close to failure, it would fail most if not all the tests rather than just one (i.e. a failing HDD would fail not just the long generic test but also generally the SMART and SDT tests as well). What could be the problem given it failed just the Long Generic test and not any of the other tests? Narutolovehinata5 tccsdnew 12:39, 18 October 2015 (UTC)[reply]
I don't think the results are as surprising as you test. Short generic and SDT only test a small proportion of the disk so could easily miss whatever it is causing the problem. You only get a SMART failure if one of the values has fallen below the manufacturers set limits, you can have disks which are clearly on their death door, without a SMART trip. (I think our article may say something similar.) CHKDSK will only report bad sectors if the HD has ran out of spare sectors to reassign failing ones to. As for the log, I thought even Seatools for Windows will provide more info, but I could be mistaken. Are you looking at the actual log file (normally stored in the Seatools program directory IIRC), rather than simply what Seatools is showing, in case it is hiding something? Nil Einne (talk) 02:14, 19 October 2015 (UTC)[reply]

An update: I downloaded a program called SpeedFan to check the actual SMART data. The "Uncorrectable Sector Count" attribute shows up as "000000000000" or 0, "Current Pending Sector Count" (which shows up as a warning) gives a value of "000000000008" or 8, and "Reallocated Event Count" gives "00000000000D" or 13. Is this bad? Narutolovehinata5 tccsdnew 19:04, 18 October 2015 (UTC)[reply]

One could argue that any value different from 0 is bad, otoh, the disk may run for years without developing more bad sectors. Comes down to how valuable your data is, whether you take backups, and whether you can afford a sudden failure (do you use the laptop for your job?).
According to this, the long test will fail "if a bad sector is detected on an internal drive". Passing the SMART test only means none of the values have reached the treshold value. As I understand it, "short generic" tests the inner, outer, and some random sectors of the disk, only the "long generic" tests all sectors. CHKDSK not finding any bad sectors may be because (depending on the mode or parameters used) it only tests the file system or because it doesn't actually test the physical sectors: bad sectors will have been reallocated by the disk itself, so Chkdsk isn't aware of them.
The grinding noises you sometimes hear could be windows programs like indexing running in the background. Whether the "operating system not found" was a hardware or software/BIOS problem, I'm not sure...
You have to weigh the trouble and cost of replacing the disk versus the cost of a disk failure and loss of data. If you prefer to be safe rather than sorry, you replace it. Ssscienccce (talk) 21:45, 18 October 2015 (UTC)[reply]
I see Ssscienccce has already said much of what I said above. One thing I will add is my assumption when you said "grinding" noises is you meant noises you have not heard before. Modern hard disks can sometimes make some fairly weird noises in normal operation which can be difficult for someone not experience with the particular hard disk model to know are normal, but if you suddenly get new noises you've never heard before, that's usually a bad sign. Also, while it's impossible to be certain that the "operating system not found" error wasn't due to some other hardware or software problem, when taken with the other things the most likely possibility is it was related to hard disk problems.

At the very least, you should run a fix all long [3], to ensure all pending sectors are reallocated. Any data in these sectors is basically unrecoverable anyway except perhaps if you're willing to spend thousands of dollars. There's a slight chance fix all long may kill the hard disk for good, then again so could chkdsk or a long generic. Once you've run fix all long, try rerunning a long generic again, I think it will probably pass then. If it doesn't you can try running fix all long again. However I would take that as another sign the hard disk is really dying. If fix all long fixes everything and a long generic passes, at a minimum you'd still want to keep an eye on the reallocated sectors, and probably rerun a long generic after a few weeks.

I presume you already have a backup of all important data (as you should even if the hard disk wasn't showing signs of having problems). So the main issues would be whether you want to keep running with the risk the hard disk may fail and you'd need to replace it at a less opportune time (i.e. you really need the computer and don't have time to replace the hard disk). And also the greater difficulties replacing the hard disk if it does fail (currently you could likely simply clone the disk on to another, and the system should work, if it fails, you can't). Plus the loss of any replaceable data you felt wasn't worth backing up (downloads for example).

Nil Einne (talk) 02:27, 19 October 2015 (UTC)[reply]

@Nil Einne: @Ssscienccce: There are a few things I need to clarify. First, I never listened to the hard disk before so I have no idea if the grinding noise is normal or not, although observing it now there are times when occasionally it stops. Second, I don't back up files, for the simple reason that I don't have an external hard disk: the drive I'm talking about is the laptop's built-in drive. Next, for some reason (perhaps because of what was previously mentioned), when I open SeaTools, the option to "Fix All" simply doesn't appear. Then, the hard drive itself (as well as the laptop, which is a Sony Vaio) is less than three years old (which as far as I know isn't exactly old for these kinds of things; my previous laptop, a Toshiba, was still working albeit very slowly when I replaced it, even though it was almost five years old). The laptop itself sometimes suddenly turns off (with a clicking noise from the laptop) when plugged in a certain way, although a technician told me it appears to be because of an unrelated electrical error. Finally, the aforementioned BSOD occurred while I was using Windows Media Player; at first, the laptop suddenly slowed down, which initially I attributed to Chrome, which lead me to close tabs, but the slow down did not stop and after a few minutes it showed the BSOD. Since then, WMP has worked fine, but that lead me to become worried about the hard drive. Narutolovehinata5 tccsdnew 03:37, 19 October 2015 (UTC)[reply]
If you don't have any backups, and you have anything on your computer you can't afford to lose, you really need to start right now. I'm not sure what magnitude of data you're talking about. If it's really small, then perhaps a free online service will be fine like Microsoft Onedrive or Google Drive. (You should normally have two backups in different locations, at least one which isn't online, but since you have none at the moment, starting with one will leave you in a far better position than you are now.) Alternatively a USB key or similar. If it's more then you may need an external or portable drive. (If you're doing that, I would add ultra important files like assignments, encrypted financial records and at least any photos which are improtant somewhere else, perhaps online.) Perhaps an external drive isn't easy to afford in your circumstances, but it would be better to start with some backup now rather than deal with whatever problems the laptop has. Worst case scenario, if you still have the other laptop you could store data there. Now if there's really nothing you care about on the laptop, then I guess you don't have to worry about backups but in the modern digital age, I would be a bit surprised by that. (16 years or so ago, some of my friends would semiregularly just format their whole hard disk and reinstall windows, but that was a different age.)

As to the hard disk, 3 years isn't very long, but it also isn't that short. A hard disk dying within 3 years definitely isn't that abnormal although probably more die in the first year than the 3rd year. About the noise, while it's somewhat understandable you may have never paid much attention before and while it's possible the recent problems have made you more sensitive to noises, the fact you notice it now does suggest it could be new.

As to the crash, none of what you've said leading up to the crash or the crash itself would be unexpected if there was a hard disk problem but nor does it intrisicly suggest one. (I'm presuming you didn't hear funny noises at the time since you would have said.) However, even without the other weirdness with the hard disk, while there are other reasons the operating system won't be found, I would suspect the most likely reason would be that the hard disk was temporarily missing due to problems.

As for "fix all" not appearing, it's mostly irrelevant whether or not you have an external drive. The most likely reason why it's not appearing is because you're using the wrong tool. Are you sure your hard disk is Seagate (including any made by those they purchased, like Samsung)? If your hard disk is Western Digital or Toshiba (or any of the brands they own), you should be using a tool from that manufacturer. (A search of the drives model number should tell you who made it.) Some tools won't even start if you don't have a drive from that manufacturer (this is when the prescense of a external drive may matter), but others may start but not offer all features (this will often also be the case if it starts because you have an external drive of theirs). I don't think Western Digital has a "fix all" in their tool (at least I don't remember one), but it's possible their extended test works in a different way. (I was under the impression these were generic SMART tests, but I've also seen some stuff suggesting WD's tool may reallocate sectors during the extended test.) I've never used Toshiba's tool so I don't know what it's like. At the very least, I would run all non write tests from the tool provided by your manufacturer. The best way to ensure reallocation of all sectors is normally to write zeroes for the whole disk but that will also erase everything. If the bad sectors don't have any data assigned, you could always use some tool which will erase all blank space.

Nil Einne (talk) 04:56, 19 October 2015 (UTC)[reply]

October 19

x86 Real Mode huge pointer normalization code

Hi all, the Intel Memory Model#Pointer sizes has the following:

---

Huge pointers are essentially far pointers, but are (mostly) normalized every time they are modified so that they have the highest possible segment for that address. This is very slow but allows the pointer to point to multiple segments, and allows for accurate pointer comparisons, as if the platform were a flat memory model: It forbids the aliasing of memory as described above, so two huge pointers that reference the same memory location are always equal.

     LES BX,dword ptr [reg]
     MOV AX,word ptr ES:[BX]
     ADD BX,2
     TEST BX,0FFF0h
     JZ lbl
     SUB BX,10h
     MOV DX,ES
     INC DX
     MOV ES,DX
lbl: MOV DX,word ptr ES:[BX]

---

Can someone explain this code?

This is how I'm stepping through the code, I've added comments with my question (why?):

     LES BX,dword ptr [reg]                        ; load BX general register with contents of ES segment register to see where it is pointing to              
     MOV AX,word ptr ES:[BX]                       ; move the 16-bit value at address found in ES:[BX] into general register AX - why?
     ADD BX,2                                      ; add 2 to BX - why?
     TEST BX,0FFF0h                                ; do an AND on BX to see if it contains 0FFF0h - why do this? what does adding 2 above do?
     JZ lbl                                        ; so if the above TEST gives a zero, then it jumps to lbl...
     SUB BX,10h                                    ; if not, then subtract 16 from BX - why?
     MOV DX,ES                                     ; move ES into DX to allow for increment
     INC DX                                        ; increment - why?
     MOV ES,DX                                     ; move DX back into ES - complete increment of ES segment register
lbl: MOV DX,word ptr ES:[BX]                       ; move the contents of ES:[BX] into DX - why?

I realize this is quite historical, but I'd like to update the article with a bit more of an explanation about the normalisation process. - Letsbefiends (talk) 01:17, 19 October 2015 (UTC)[reply]

This entire operation is designed to prevent pointer aliasing. To understand this, you've got to spend some time to really grok the virtual memory segmentation model in canonical i386-mode.
A few take-away concepts:
  • The memory segmentation model is intentionally designed to allow overlaps - multiple ways to point at the same physical address.
  • Whenever ES is used, you're assuming a convention (e.g. one that is usually enforced by your compiler).
  • The purpose of this code pattern is to ensure a "normalized" address - in other words, to put the address in a standard form.
  • Any two addresses that are placed in this "standard form" are guaranteed not to overlap.
The code above is re-calculating a (possibly different, guaranteed-unique) pointer. As long as all subsequent uses of the pointer (and the segment registers) follow normal conventions, this ensures that no two pointers can overlap (e.g. no aliasing).
All the bit-wise math (the addition and the bitwise-AND) is just a glorified alignment check.
(Also: I think your comment misrepresents what the LES instruction does - you might want to review the i386 instruction set. LES loads ES and BX with a pointer from memory).
Nimur (talk) 01:57, 19 October 2015 (UTC)[reply]
This code does the same thing as the previous two code samples in the article: it loads DX:AX from the address pointed to by reg. That's the reason for "MOV AX,word ptr ES:[BX]" and "MOV DX,word ptr ES:[BX]". Presumably later code would use those loaded values. "ADD BX,2" adds 2 to the pointer because that's where DX is ultimately going to be loaded from. The subsequent instructions (except the last one) re-normalize the huge pointer. When you load from seg:[ofs], the computed address is 16×seg+ofs. By definition, huge pointers have ofs < 16 (or, equivalently, (ofs & 0xFFF0) == 0). If the offset is between 16 and 31, subtracting 16 (=10h) from the offset and adding 1 to the segment gives you the same effective address but now with an offset that falls in the correct range.
In reality, I doubt that any compiler would generate this code. There is no need to normalize this pointer because it is never stored anywhere or compared with anything. The realistic code would be the same as for the far pointer case, so this is a bad example. -- BenRG (talk) 02:36, 19 October 2015 (UTC)[reply]
My x86 assembly language is a bit rusty, but I can explain most of the code. It seems to be performing an auto-increment after retrieving the value referenced by the pointer. Something like the C code fragment int ax = *(ptr++);. The pointer is presumed to already be normalized, so the code only needs to handle the adjustment after the increment.
     LES BX,dword ptr [reg]                        ; Load the pointer (segment & offset) into ES & BX
     MOV AX,word ptr ES:[BX]                       ; Get the 16-bit value referenced by that pointer (presumably for some later use)
     ADD BX,2                                      ; Increment the offset part of the pointer (by the size of the referenced value, in this case 2 bytes)
     TEST BX,0FFF0h                                ; Is the offset >= 16 (15 is the max normalized value for offset)
     JZ lbl                                        ; If not, skip the re-normalization
     SUB BX,10h                                    ; Reduce offset by 16
     MOV DX,ES                                     ; (move ES into DX to allow for increment)
     INC DX                                        ; Increase segment value by 1 (a 16 byte shift in the memory it refrences)
     MOV ES,DX                                     ; (move DX back into ES - complete increment of ES segment register)
lbl: MOV DX,word ptr ES:[BX]                       ; ??? Not sure about this. ???
Logically, I would expect that last line to save the updated pointer (ES & BX) back to its original location, but this doesn't look right to me. Perhaps someone else can explain. -- Tom N talk/contrib 04:32, 19 October 2015 (UTC)[reply]
As I said above, this code does the same thing as the previous two code samples in Intel Memory Model#Pointer sizes: it loads DX:AX from the address pointed to by reg (without changing reg). It could actually be replaced by the previous code sample (LES BX,[reg]; MOV AX,ES:[BX]; MOV DX,ES:[BX+2]) with no change in behavior, if reg contains a normalized huge pointer. -- BenRG (talk) 16:52, 19 October 2015 (UTC)[reply]

Significance of polarizer in LCD displays

I would like to know why we use Polarizer in LCD.I have googled to find out the answer but most of the answers tells "it(LCD) uses polarizers to make the screen dark and bright".Why couldn't we make screen dark and bright without using polarizers.Even if they use polarizer why LCD's have two polarizers instead of one polarizer?Also I still can't get what really happens in polarization.Could anyone help me.JUSTIN JOHNS (talk) 05:34, 19 October 2015 (UTC)[reply]

How do you plan to block the light (make the screen dark) without the polarisers? As our article explains, the first polariser is one direction (perhaps vertical) and the second polariser is generally perpendicular (so horizontal if the other is vertical). Therefore under normal circumstances, the very little light will make it through the second polariser, as the vertically (or whatever) polarised light coming from the first filter, is blocked by the second filter. However the light crystals in the LCD can be adjusted to induce rotation of polarisation of the light. Therefore the vertically polarised light coming from the first filter, can be rotated to become horizontally polarised and will pass through the second filter which has the same polarisation as this light has now, instead of being blocked by it. As per my first sentence, I'm not sure how you're proposing to block the light without the polarisers, since the whole point is that the light crystals can be used to rotate the polarisation of the light. You also need two filters since you need to light to be polarised initially otherwise it won't be properly blocked by the "second" filter. Instead, you'd just be polarising the light. Well, unless your source is capable of generating polarised light without a filter, then you won't need the first one. P.S. Some understanding of what a polariser is and does is probably essential to understanding this, I haven't read, it but I'm sure our article provides sufficient info. P.P.S. I just noticed you said you don't really get what happens in polarisation, but that seems fairly unspecific. What part of our Polarization (waves) article is confusing you? Nil Einne (talk) 06:20, 19 October 2015 (UTC)[reply]

That's a good explanation.Do you mean that polarization tells about the ways in which light's component travels?Or does it only tells about the electric field components as stated in the definition of polarization.To be honest can we make the screen dark without passing any light?Is there use of both the magnetic and electric component of light?Is one better than the other?JUSTIN JOHNS (talk) 08:33, 19 October 2015 (UTC)[reply]

The electric field and magnetic field are ar right angles, so if you turn one, you also turn the other. And if you block an electrically polarised wave, then the magnetism at right angles will also be blocked. If you could make the light polarised to start with then the first filter would not be needed. With laser diodes this would be possible. But if you use a grid of LEDs you can just turn them on and off anyway and no LCD is needed. Graeme Bartlett (talk) 09:32, 19 October 2015 (UTC)[reply]

Do you mean to say that while sending a light wave through a polarizer both of it's components are blocked?Could you tell me what happens in polarized sunglasses?If you have said that "if you block an electrically polarised wave, then the magnetism at right angles will also be blocked" then which component of light wave are we seeing through polarized sunglasses?Or did you just mention about an electrically polarized wave but not light?JUSTIN JOHNS (talk) 05:25, 20 October 2015 (UTC)[reply]

Is there any Source-to-source compiler that compiles Javascript to Java?

731Butai (talk) 07:21, 19 October 2015 (UTC)[reply]

Probably no more than when you asked last month. Rojomoke (talk) 08:46, 19 October 2015 (UTC)[reply]
I was hoping I could reach more eyeballs by re-asking. There's no rule against re-asking questions. 731Butai (talk) 09:43, 19 October 2015 (UTC)[reply]
I feel that the problem here is the unfounded belief that JavaScript and Java are somehow related. JavaScript and Java have nothing to do with one another. The syntax is radically different between the two. Once you get past the trivial assignment of simple variables, the entire concept of how classes and methods are defined would need to be radically rewritten. So, there isn't a simple "Rewrite my program for me in a completely different programming language" tool. 199.15.144.250 (talk) 11:32, 19 October 2015 (UTC)[reply]
I just checked a little feasibility of this... JavaScript syntax has a lot more functionality than Java syntax - let alone the issues with variations in syntax from web browser to web browser. So, there is a lot of syntax in JavaScript that simply doesn't exist in Java. The best you could do is get a Java JavaScript interpreter (a JavaScript interpreter written in Java) and feed the JavaScript into it. 199.15.144.250 (talk) 15:32, 19 October 2015 (UTC)[reply]
Unlikely for any general use. Java is a strongly typed language; every object has all its possible methods known at compile time. JavaScript is dynamically typed, and you can even add methods and fields to "types" (if there are such things in JS) during runtime. Variables have little or no types - a variable can happily hold a string at one point, and a float or integer at another. The differences in type systems alone make any "source to source compiler" to be just an interpreter in disguise. 91.155.193.199 (talk) 19:15, 19 October 2015 (UTC)[reply]
There are compilers from many high level languages to C. They can do far more than just feed the source code into an interpreter: consider Stalin (Scheme implementation) for example. There is at least one compiler from JavaScript to Java VM .class files (Rhino). There's no reason a compiler from JavaScript to Java source code couldn't exist. -- BenRG (talk) 19:28, 19 October 2015 (UTC)[reply]
There are two kinds of conceptually very different language-to-language translators. One kind makes language X programs run under language Y's runtime. The other kind makes X programs look like they were written in language Y. The OP appears to want the second kind - not just to run X under Y, but actually transform X into sensible Y code. The two are quite different requirements. He explicitly does not want JavaScript running under Java, he wants JavaScript source code turned into Java source code. Not just mechanical execution of one code under the other's environment, but source code level translation. Which is unlikely to happen. 91.155.193.199 (talk) 22:45, 19 October 2015 (UTC)[reply]
No, you're wrong. I want the first kind. 731Butai (talk) 01:57, 20 October 2015 (UTC)[reply]
If you want a source-to-object compiler, why did you ask for a source-to-source compiler? This is computer science. You get what you ask for, not what you think you might mean. 199.15.144.250 (talk) 13:14, 20 October 2015 (UTC)[reply]
To try to avoid possible X-Y problems, I will ask: why are you interested in a JavaScript-to-Java compiler? Is there a task you're trying to accomplish, and if so, what is it? --71.119.131.184 (talk) 19:52, 19 October 2015 (UTC)[reply]
Thanks for linking to the X-Y Problem wiki. There is a lot of wisdom scattered across the rest of GreyCat's Bash Wiki web page. The wise reader would spend some time perusing it, especially if the reader plans to write some fancy new scripts to do a thing. Nimur (talk) 21:23, 19 October 2015 (UTC) [reply]
I'm trying to port a small Javascript library into Java. Roughly half of the code, the performance critical half, will be hand-ported. Machine translating the non-critical half would save me some time. The resultant Java code doesn't have to look nice or human readable. Hell, it doesn't even have to compile, since I'll be manually rewriting it anyways. I'm just trying to minimizing as much of the boring syntax translation as possible so I can focus on the actual performance enhancing part. 731Butai (talk) 02:03, 20 October 2015 (UTC)[reply]

Problems with mp3 USB player

Hello. I'm having problems with my mp3 player (USB stick). I can upload up to 70-100 songs and it plays them in chronological order, but when I add some more, they appear somewhere else, among the old tracks. I always just copied some of the songs which had already been on the player so their names changed to »nameofthefile – copy«. After songs started to play chronologicaly (by the time created), I just added new ones and erased the ones that had »copy« in their name… I usually had to make 20-50 copies, but now there is not enough memory left to do this again. Is there any other way I could fix this problem? Thank you in advance. Atacamadesert12 (talk) 20:16, 19 October 2015 (UTC)[reply]

Password-based access

In our earliest days, we didn't have a system of user rights: administrative actions could be taken by any user who possessed a specific password, and apparently you'd be prompted to enter the password if you wanted to perform such an action. The current system is an example of what's termed role-based access control. Is there a comparable term for the original system? Password-based access control isn't an article. Nyttend (talk) 22:23, 19 October 2015 (UTC)[reply]

In our earliest days, there wasn't such a thing as Privilege. But Access control list, and their precursors were probably first developed during the days of the earliest Time-sharing mutli-user computers, at least as early as the 60s. Delving that deeply into computer history, things start getting very "hazy", a lot of computing concepts, particularly to do with networking and programming were not figured out yet and might not have formal "titles", but computers were already quite sophisticated by the very early 70s with the development of unix. So, I "think" your faulty assumption is that some "password based" access control method existed before what we recognize today as "the current user based permissions", which is, just by the way NOT synonymous with RBAC. RBAC is a newer concept, it's a framework of how to delegate permissions within a service. A core concept of RBAC is that a single user can not be given privilege to a resource, only a group can be given privilege to a resource, the user has to be a member of the group (known as a "role group"). That a user logs onto a computer and has access or does not have access to perform some task or access some resource predates RBAC by decades. Possibly you might find File system permissions interesting also. Vespine (talk) 03:17, 20 October 2015 (UTC)[reply]
Note that even in that article, they just call it "traditional unix permissions", because it does not have a more "specific" name. I guess that comes down to the fact that when unix was being developed, how you implemented permissions wasn't really a "THING" that needed a separate fancy name. It was just a part of the operating system that needed to be developed. Vespine (talk) 03:23, 20 October 2015 (UTC)[reply]
There definitely was such a system; see [4], the oldest revision of nost:Wiki Administrators from May 2001, just four months after the website was created. Registered users could perform actions not available to people not using accounts, and people with the administrative password could do more; just look for "There are actually two separate levels of special access" on that page. See WP:DEAL, the current version of which is the spot from which my question arose; that's where I discovered the "Role-based access control" phrase. Nyttend (talk) 04:49, 20 October 2015 (UTC)[reply]

Computer printer comms

Why cant my old Dell 2400 running XP talk to my new HP ENVY 5530 printer? Ive tried installing it, uninstalling it, reinstalling it, using the disk the printer came with, getting the computer to recognize printer with PnP. The printer appears in Control panel and it seems to be set up OK. Still can I get it it print anything ---- NO!!! Not a damn thing. Ive been thro the troubleshooter about 10 times now. Any suggestions?--213.205.252.131 (talk) 23:00, 19 October 2015 (UTC)[reply]

The drivers support XP so it's not anything obvious... Does PnP pick the printer up correctly? Have you tried sending a "test print" from the printer settings? Have you tried unplugging all your other USB devices? Have you tried network print? Do you have a wifi network you could connect the printer to? Have you tried to use the printer with any other device? Vespine (talk) 23:52, 19 October 2015 (UTC)[reply]
The most annoying way printers fail is no error, but nothing ever prints either. I usually try the printer on another PC and/or another printer on that PC, when that happens. StuRat (talk) 00:02, 20 October 2015 (UTC)[reply]

October 20

iterating over a square matrix, one square frame at a time

Hello,

I have a square matrix of size N (N is odd). I want to iterate over the matrix, one "square frame", or ring, at a time, from the outmost ring, to the innermost ring ( which contains only one element). How can I do it efficiently?

for example in the following matrix:

the innermost ring is 13, the next ring is 7, 8, 9, 12, 14, 17, 18, 19, etc.

I need to to do it as a part of a homework question: I was given a matrix in which all the numbers in a given ring are bigger than all the numbers in the more inner rings. I should write a function that given a number n says if n is in the matrix (1) or not (0). The answer I thought of is the following: iterate over all rings, from the outmost to the innermost; if n is in the current ring, stop and return 1. For each ring also check if n is smaller than all numbers in this ring; if n is not found in the current ring and n is not smaller than all numbers in the ring, return 0; else, continue to the more inner ring. If after iterating all rings the numbers wasn't found, return 0. Does it make sense?

Thanks. 31.154.144.146 (talk) 06:29, 20 October 2015 (UTC)[reply]

The algorithm you describe is much more complicated than simple scanning the whole array row by row and checking each element against the given number. And it is not a bit faster, on average. --CiaPan (talk) 11:02, 20 October 2015 (UTC)[reply]
Hint: you usually don't need to check all numbers in all rings. Suppose N>6, and your number is 500; and you find that is 800, then 500 certainly is not in rings containig or (because numbers in that two rings are bigger than 800). --CiaPan (talk) 10:06, 20 October 2015 (UTC)[reply]
The JPEG algorithm's entropy coding stage iterates over a square matrix in this zig-zag sequence.
A common trick in such problems is to re-sequence the matrix - in other words, there is no reason you need to store the matrix such that (x,y) pairs are sequentially rastered. For example, look how JPEG iterates over a transformed block after its quantization stage. In another example, in the case of the finite difference time domain model for solving the wave equation, an efficient implementation may alternate through a matrix using square sub-blocks, iterated in a checkerboard-style sequence. Nothing mandates that you store or iterate your matrix elements in any specific order, provided that you know how to obtain the coefficient at any row and column. That may require a simple conversion from standard coordinates into the index in your custom data structure.
All of these tricks are used because reordering can improve performance for some specific calculation, much like pre-sorting a list yields good efficiency for search algorithms on that list. If you think about your problem, you're essentially trying to sort the elements of a matrix, which implies that you want a mapping of these matrix elements into a single (1-D) sequence. I'm sure if you draw a picture, you'll see how you can conceptually traverse the "rings" of your matrix... and then you just need to deduce an equation that represents that traversal.
Nimur (talk) 14:07, 20 October 2015 (UTC)[reply]
Thank you all for the answers! However, I haven't succeeded to find a solution yet, as I am in the very beginning of an introductory CS course, and had not tackled such problems before (we have just started discussing simple sorting algorithms). Can you please give me another hint/recommended way of working towards the solution? Thanks, 31.154.144.146 (talk) 16:24, 20 October 2015 (UTC)[reply]
Size N array with elements ai,j i and j being the row and column (I assume the index starts at 1, could be zero, depends on the programming language; ai,j is a[i,j]). There are (N+1)/2 rings, and you search for a value equal to n:
You can use binary search algorithm to find the right ring, but lets keep it simple, simply test one value of each ring until you find a ring with a value smaller than n:
For i=1 to (N+1)/2: if ai,i<=n then ....
Once the test is true, you know that n could be in either ring i or the previous ring i-1. Test all values in ring i: if you find n, return(1); If none found: test ring i-1. If none found there, return(0).
(you could also test if any value in ring i is larger than n, if that's the case you won't need to test ring i-1 because they'll all be larger as well, but I wouldn't bother, makes the program more complex, without gaining anything)
Ring i is a square with corners at coordinates i and N-i+1. For testing the values, it's easiest imo to test 4 values (one on each side of the square) at the same time. For example:
For p=i to N-i:
if (ai,p==n OR aN-i+1,p==n OR ap,i==n OR ap,N-i+1==n) then return(1)
Make sure your code works for all cases: for example: if a1,1<n, only ring 1 has to be tested, there's no ring zero. Ssscienccce (talk) 17:32, 20 October 2015 (UTC)[reply]

Hadamrd Gate

Assuming we have .

Performing Hadamrad on the first qubit yields .

Performing Hadamrad on the first qubit, again, yields .

But Hadamard is self-inverse (=the inverse of iteslf), so this is probably wrong... I guess the result of the first time we performed Hadamrd is not what I wrote above. So, what is the correct result? 31.154.92.193 (talk) 17:33, 20 October 2015 (UTC)[reply]