Jump to content

Wikipedia:Reference desk/Computing

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 38.111.64.107 (talk) at 12:51, 23 April 2013 (FORTRAN read statement). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
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:


April 18

STEAM Game install problems

I just tried to install the game "Sniper: Ghost Warrior". I entered the 'key code' etc, was told it was installed (after what seemed like an unusually long wait), but my Steam account itself still says "NOT installed". Shut down PC, re-booted, & logged onto Steam again, but still "... not installed"!

2 days ago I 'installed' the game Homefront, and that also is not working. It appears to be stalled in the middle of an update. Nb. Steam defaults to automatically updating, so as soon as you load a game it starts making large downloads.

In addition I already had Metro 2033 installed, and after playing it since installing Homefront that has also changed to "not installed". It gave me message when starting the game about "needing to store Metro files in another format" or words to that effect, perhaps I clicked on the wrong button!

Is this a common problem with 'Steam'?

Any ideas on what to do? --220 of Borg 03:38, 18 April 2013 (UTC)[reply]

What machine are you using? If it's a Windows PC my first move would be to try uninstalling those games via the Windows control panel, if you can.--Shantavira|feed me 07:10, 18 April 2013 (UTC)[reply]
Yes, Microsoft Windows 7 Home Premium (32 Bit) on a Toshiba laptop (Satellite L750 Model PSK2YA-05210), 4 Gb memory and about 150 Gb free HDD space. Uninstalling is certainly something to try, but then I will have to get on the Internet again to install, and I have not had an internet connection at home since 28 February when my ISP Unwired closed down.
(my attempts to get a 'Net connection via a 'Dodo' ISP USB mobile internet device is another long tale of woe in itself. The 'gizmo' works on every PC I have tried it on, except mine!)
/whinge
I have used about 3 Gb (!) of my brothers Internet bandwidth to (so far) for zero result! My experience of installing games needing Steam activation is rapidly losing it's 'novelty'!
I note that it seems some games will not even begin to install if you are not online and logged onto Steam.
/whinge
220 of Borg 11:01, 18 April 2013 (UTC)[reply]
Update: Sniper: Ghost Warrior now says "ready to play!" . Fingers crossed! 220 of Borg 11:03, 18 April 2013 (UTC)[reply]
And 'Sniper' seems to be working! But 'Homefront' needs another 5+ Gb and hours of download to work! 220 of Borg 11:30, 18 April 2013 (UTC)[reply]
No such luck! After disconnecting from 'net, 'Sniper: Ghost Warrior' runs at about 1 frame per seecond (if that). Re-boots didn't help. Very puzzling 220 of Borg 12:01, 24 April 2013 (UTC)[reply]

DOS operating system

I was browsing a local computer store, and was surprised to see that none of the laptops were sold with Windows as the default OS. A small number of laptops had Linux as the OS, but the majority of them were listed with DOS as the OS. As a layperson whose main memories of DOS include a b/w dialogue box that opened when wanting to play computer games in early editions of Windows, DOS to me would seem to be the equivalent of 'no OS'. What exactly would a DOS OS be? Would a person with no programming skills, like me, be able to use it, or would I need to instal a 'proper' OS? V85 (talk) 11:47, 18 April 2013 (UTC)[reply]

It's probably FreeDOS. They don't really anticipate that you'll actually use it, but rather that someone will install a capable modern OS. They're either doing this so they can advertise the machine at a lower price and then add on the cost of whatever Windows OS you want (as a Microsoft Small System Builder, they can probably put on a variety of OEM versions). It's also quite possible that they'd foresee the machines having Linux put on them, but they're not capable of supporting Linux (and don't want all the "this windows program doesn't work" calls it would bring them), so they sell the machine clean and say "caveat installer". -- Finlay McWalterTalk 11:57, 18 April 2013 (UTC)[reply]
caveat installer” is great :) ¦ Reisio (talk) 15:23, 18 April 2013 (UTC)[reply]
Caveat onero ? Is that proper Latin ? StuRat (talk) 16:06, 18 April 2013 (UTC) [reply]
Disk Operating System was an OS; probably MS-DOS. By the time you're working with a DOS window you're now into Windows 3.1 (probably) territory, which is a different OS. Of course people still referred to the window as DOS, but it was a new OS emulating DOS (I'm sure someone could fault me for saying "emulating" here, but i'm speaking generally). Even today with Windows 7 you can pull up a nice black command window that looks an awful lot like DOS. But true DOS... I would be impressed to see someone do something interesting on a modern machine with it running an original version of DOS. Shadowjams (talk) 19:19, 18 April 2013 (UTC)[reply]
Thanks, this helps. (Particularly since it confirmed the point of view I already had. ;-) V85 (talk) 21:07, 19 April 2013 (UTC)[reply]
It's probably enough to verify that the PC works. You can test the keyboard, monitor, printer, hard drives, etc. (although I don't believe DOS used the mouse). You can also check the sizes of the hard drives, etc. StuRat (talk) 21:17, 19 April 2013 (UTC)[reply]
Assuming our article is correct, MS-DOS 4.x had mouse support.--Rockfang (talk) 15:11, 23 April 2013 (UTC)[reply]

address manipulation in assembly language

this is a simple instruction in assembly language.

A 1,901 (2, 15)

1 = accumulator 901 = offset 2 = index register 15 = base register

the addresses contained in the three registers are added and the obtained address contains a value which is then added to the contents of register 1.

my question is: why do we have to go through the pain of adding three addresses to get the required address? why not use the required address directly?

P.S. i have just started studying System Programming from John J. Donovan... so, please go easy on the technical stuff. i'm not that tech-savvy. :P — Preceding unsigned comment added by 117.197.252.4 (talk) 14:29, 18 April 2013 (UTC)[reply]

It's generally very desirable for programs to be relocatable, in other words, written in a way that allows them to run correctly even if they are moved to a different place in the computer's memory space. That's what the mechanism you're showing achieves, if I understand it correctly. Looie496 (talk) 14:54, 18 April 2013 (UTC)[reply]
It looks like you're talking about an x86-like processor. The x86 family (at least in non-64-bit mode) has a segmented memory system. That is, by its intrinsic nature, memory addresses are made up of two words, frequently in two seperate registers, that are added together to get the absolute memory address. Note that for x86s, you can't just use any two registers. The segment address (base register) has to come from one of the segment registers (e.g. CS, DS, SS, ES), whereas the offset address can come from any of the general purpose registers. This allows for the relocatability as mentioned above, as all you have to do to move the program around is change the value in CS, DS, SS, ES, etc., as appropriate. - So why the offset? This makes working with aggregate data structures easier. You just have to load the pointer to the beginning of the data structure, and then you can quickly access data members with different offsets, rather than having an extra ADD/SUB instruction manipulating the address, and potentially leaving it in an unknown, varying state in loops and the like. It's extra conveniences like that which make x86s a CISC architechture, rather than a simpler, but more wordy, RISC. -- 71.35.127.8 (talk) 16:37, 18 April 2013 (UTC)[reply]
Allowing just a displacement and a register is done on some machines. This means more instructions are needed in many cases but the RISC argument was that the machine cycles could be shorter. It hasn't worked out that way the extra logic to deal with the possibility of two registers in forming an address sometimes has in general been found to be worth the bother. Plus the possibility of automatically scaling of the index register for the data size is often desirable as well. Dmcq (talk) 17:50, 18 April 2013 (UTC)[reply]
That instruction would also be valid on the IBM mainframes starting from the 360 range. The thing that RISC machines don't have is the direct add of whats loaded, they only have load or store instructions. The reason for this is that it takes time to loadf or store and one wants to schedule them separately from computations. A compiler will try and stick a few instructions between a load and the use of the loaded register, this makes it much easier to avoid just waiting around for something from store. Also encoding the computation operations would take more space in the instruction if it is already encoding an offset. Dmcq (talk) 11:09, 19 April 2013 (UTC)[reply]

Unix command to output specific text

This one should be pretty simple and I'm 90% sure I've seen it before, but it doesn't yield to searching easily. Suppose I want my bash to simply output "Hello." What should I type for this to occur? Presumably, I could also type command "Hello" > file (where command is the command I'm looking for) to create a file whose contents are "Hello". What's the command? ± Lenoxus (" *** ") 17:02, 18 April 2013 (UTC)[reply]

echo Hello. There are various options and ways to quote, but that's the basics. --Stephan Schulz (talk) 17:04, 18 April 2013 (UTC)[reply]
Thanks! (Somewhere in my mind I thought it was "parrot" -- I should have just looked up "parrot" in a thesaurus!). The man pages should take me from here. ± Lenoxus (" *** ") 17:25, 18 April 2013 (UTC)[reply]
Not that it will matter much, but FYI echo is frequently a shell builtin (type echo), so the technical authority would be help echo. ¦ Reisio (talk) 17:38, 18 April 2013 (UTC)[reply]

InterruptedException in java

Hi !
My doubt is on InterruptedException in java .
I am asking my doubt based on sleep method in java.
When we call interrupt on a thread which is in sleep state then InterruptedException is thrown.
Below are my doubts:
1)Imagine that we have called interrupt method on a thread named Thread1,which has come out from a sleep.
Then will Thread1 throws InterruptedException?
2)Imagine that we have called interrupt method on a thread named Thread2,which will go to sleep.
That means now Thread2 is not in sleep state.
Then will Thread2 throws Interrupted exception?
— Preceding unsigned comment added by Me shankara (talkcontribs) 17:53, 18 April 2013 (UTC)[reply]

The sleep stops as soon as the thread is interrupted. An InterruptedException will only be thrown by methods that are documented as able to throw that exception. Otherwise you need to check the interruption flag using isInterrupted(). See [1] and [2]. 38.111.64.107 (talk) 18:47, 18 April 2013 (UTC)[reply]
If an interrupt arrives while a thread is not blocked or sleeping, the thread's interrupt status is set; attempting to block or sleep with that status set immediately (clears the status and) throws an InterruptedException. (The static method Thread.interrupted() clears the status (and returns it), so it's possible to avoid the exception.) --Tardis (talk) 02:08, 19 April 2013 (UTC)[reply]

3D glasses for Blu Ray

I am interested in getting the 3D versions of The Hobbit and The Life of Pi for my ASUS gaming computer. I have a 3D set and a 3D compatible player. How do I know what glasses to get, since I see hey sell green/magenta, red/cyan, and polarized? Thanks. μηδείς (talk) 19:20, 18 April 2013 (UTC)[reply]

Most 3DTVs use expensive active shutter style glasses, rather than the cheap polarized types used in cinemas, although there are exceptions. Anaglyph glasses (with different coloured lenses) are used for viewing 3D images on a standard 2D screen, and aren't what you're looking for here. To the best of my knowledge, most active shutter TVs use proprietry glasses, so you would need to buy glasses for the specific manufacturer's TV. What is the make and model of your set? AJCham 19:37, 18 April 2013 (UTC)[reply]
It's whatever glasses your TV manufacture uses. I know that Samsung are active-shutter, and most LG are passive polarized. Do a web search for "<manufacture> 3D glasses" to get suitable manufacture's and third-party glasses. CS Miller (talk) 20:08, 18 April 2013 (UTC)[reply]
Thanks, I understand theresponses, but I have no idea how to determine what type of 3d I have. I have an ASUS computer with an NVIDIA Gforce GTX video card. When I type in 3d on the start search box (I have windows 7) it offers me the option of activating 3d but says nothing about active or passive shutter. What should I be looking for and where? μηδείς (talk) 20:33, 18 April 2013 (UTC)[reply]
Nvidia 3D Vision 87.115.151.155 (talk) 20:35, 18 April 2013 (UTC)[reply]
Thanks. Now I have to decide if I want to spend $150 on the glasses just to see what the 3D looks like. Wonder if Sim City comes in 3D. μηδείς (talk) 21:00, 18 April 2013 (UTC)[reply]
If you do get it, make sure you get the 2.0 model, and the full kit (the USB adapter and a pair of glasses); don't just get the glasses, as you need the USB adapter too (it tells the glasses when to change). Some online reviews give the system reasonably marks, but with a 120Hz (vertical refresh) monitor - your laptop probably has a lower vertical rate (the nvidia app you already have in the control panel will show you), which may be flickery when the glasses effectively half it. 87.115.151.155 (talk) 21:24, 18 April 2013 (UTC)[reply]
How exactly would I find out if I have a 60Hz or 120 Hz display? (I can do it on my Mac and have tried with the PC, but am having no luck.) And if I want three sets of glasses do I purchase two satnd-alone glasses and one with USB? Thanks. μηδείς (talk) 22:11, 18 April 2013 (UTC)[reply]
If you didn't explicitly pay for a high frequency monitor, or a super-expensive gaming system, then you probably don't have one. In the windows control panel: "screen resolution", then "advanced settings", and the vertical frequency is shown in the "monitor" tab (maybe). [That's windows 7, I don't know about other versions exactly]. 87.115.151.155 (talk) 22:21, 18 April 2013 (UTC)[reply]
Thanks. It is 60 Hz. Let me repeat my other question. If I want three sets of glasses so I and two others can watch can I buy two stand alone pairs, or do I have to pay for the full set three times? μηδείς (talk) 00:14, 19 April 2013 (UTC)[reply]
It appears from the product literature that you can use any number of the additional glasses (I see them for sale by themselves, without the USB dongle). But I stress that I've no personal experience of this system, and as someone with whom 3D systems don't agree, they all seem like dim flickery migraine-inducing gimmicks. TinyLittleRobot (talk) 07:38, 19 April 2013 (UTC)[reply]
The above postings by 87.115.151.155 were me - I finally remembered my password TinyLittleRobot (talk) 07:47, 19 April 2013 (UTC)[reply]

how elevators talk

I want to know how elevators talk this applies to the us — Preceding unsigned comment added by 75.15.67.222 (talk) 21:14, 18 April 2013 (UTC)[reply]

Elevator control systems usually use one or several programmable logic controllers. These talk together with one another using something like Industrial Ethernet (or one of the proprietary automation protocols listed in that article) or with a simpler system like LonWorks or Ez-LINK. 87.115.151.155 (talk) 21:36, 18 April 2013 (UTC)[reply]
On this topic, is anything known about the "intelligence" of elevators? Specifically in cases where a tall building has multiple elevators, how do they work most efficiently? Ryan Vesey 21:42, 18 April 2013 (UTC)[reply]
A lot of study has been put into this, particularly for very tall buildings. Elevator#Special operating modes lists some of the modes. Elevator companies like to claim tha their controllers for skyscrapers use advanced scheduling algorithms that know the specifics of traffic in that building; some use (or say they do) neural networks or machine learning. As with many real-world scheduling and queueing problems, fairness and efficiency often have to be traded against each other. 87.115.151.155 (talk) 21:48, 18 April 2013 (UTC)[reply]
You might also be asking how elevators talk to people, say when they announce the floor. In this case, a full speech synthesis system isn't required, as it only needs a very small vocabulary. So, the elevator design company can just hire someone with a pleasant voice to say all of the phrases the elevator can say, and record those digitally for later use ("Oh, that must be Otis !"). StuRat (talk) 02:36, 19 April 2013 (UTC)[reply]


April 19

captchas

how are the data-bases of images mapped to strings made? (and whats an "op"?) 70.114.248.114 (talk) 02:40, 19 April 2013 (UTC)[reply]

In here an OP is an original poster (or their original post). So, it's you or your question. StuRat (talk) 02:52, 19 April 2013 (UTC)[reply]
What key input is this CAPTCHA expecting?
Wikipedia's CAPTCHAs are made with mw:Extension:ConfirmEdit. In Internet discussions, "op" means original post or original poster. PrimeHunter (talk) 02:57, 19 April 2013 (UTC)[reply]

The question is an interesting one that is not answered by the CAPTCHA article. If an English word has been taken from a book and distorted so it can't be read by machine, how does the server know what input is correct? What string is mapped to the image I was presented with here? Presumably no human made a conscious decision to require me to type "λόγον" ! Sussexonian (talk) 18:13, 20 April 2013 (UTC)[reply]

From ReCAPTCHA#Operation "Any word that is deciphered differently by both OCR programs or that is not in the English dictionary is marked as "suspicious" and converted into a CAPTCHA. The suspicious word is displayed, out of context, along with a control word already known. The system assumes that if the human types the control word correctly, then the response to the questionable word is accepted as probably valid." Hot Stop (Talk) 18:24, 20 April 2013 (UTC)[reply]
With the exception of ReCAPTCHA, there's no database (images are generated on the fly) and the server simply remembers the text that it used to make the image. -- BenRG 01:12, 21 April 2013 (UTC)

Terminology question

IS there a standard term for the highest level of DNS domain name at which cookie sharing can take place? This would be the highest level that does not appear in the public suffix list, for example within the .co.uk namespace it would be the third level domain, so news.bbc.co.uk and weather.bbc.co.uk can share cookies, but for .com names it is the second level domain, and according to the list for nsw.edu.au it is the forth level domain. Some sites incorrectly refer to this as the second level domain[3] but is there a recognised term for it. The best term that I can come up with is "first level below the effective tld portion of the name", but is there already a recognised term. -- Q Chris (talk) 11:02, 19 April 2013 (UTC)[reply]

relation between interrupt status and sleep method in java

Hi !
--->My doubt Is on relation ship between sleep method and interrupt status flag.
--->I am asking this doubt based on below two programmes.
--->In programme1, I have called sleep method with out clearing interrupt status .Then InterruptedException was thrown.
--->In programme2 ,I have called sleep method after clearing interrupt status flag using interrupted method.
Then InterruptedException was not thrown.
Is there any relation ship between sleep method and interrupt status flag?
Does sleep method throws Interrupted exception based on interrupt status flag?



Programme1:

class even extends Thread {
  public void run() {
    for(int i=10;i<=20;i=i+2) {
      System.out.println(i);
      this.interrupt();
      try {Thread.sleep(1000);}
      catch(InterruptedException ie) {System.out.println("interrupted");
    }
  }
  public static void main(String args[]) {
    even e1=new even();
    e1.start();
  }
}

Output:

10
interrupted
12
interrupted
14
interrupted
16
interrupted
18
interrupted
20
Interrupted


Programme2:

class even extends Thread {
  public void run() {
    for(int i=10;i<=20;i=i+2) {
      System.out.println(i);
      this.interrupt();
      Thread.interrupted();
      try {Thread.sleep(1000);}
      catch(InterruptedException ie) {System.out.println("interrupted");
    }
  }
  public static void main(String args[]) {
    even e1=new even();
    e1.start();
  }
}

Output:

10
12
14
16 	
18
20




— Preceding unsigned comment added by Me shankara (talkcontribs) 15:47, 19 April 2013 (UTC)[reply]

(I reformatted your code (and combined the classes in each case) to be more legible and less long.) I gave the answer to this exact question in answer to your previous question. --Tardis (talk) 16:24, 19 April 2013 (UTC)[reply]
I also remove a few stray HTML markup that was confusing things Astronaut (talk) 16:36, 19 April 2013 (UTC)[reply]
I just love this sort of question and am full of envy of those who have ANY idea as to what it is all about!85.211.192.200 (talk) 21:34, 19 April 2013 (UTC)[reply]
(I moved your comment out of the OP and indented it.) Don't be too envious: it's not that complicated. All these examples are exploring is that a program (in this case, part of a program) can react to a signal in more than one way: by explicitly checking (#2) or by specifying a response that occurs implicitly (#1). --Tardis (talk) 16:51, 20 April 2013 (UTC)[reply]


April 20

Cloud storage

Will cloud storage replace USB sticks? Clover345 (talk) 16:14, 20 April 2013 (UTC)[reply]

Not unless there is a way to guarantee to always be online when the data is needed. Looie496 (talk) 16:36, 20 April 2013 (UTC)[reply]
Also there's the issue of it possibly going away in the cloud, if the company goes bankrupt or you don't access it often enough, etc. Then there's the question of how private such data is. I sure wouldn't want to have account numbers and such there. And there may also be a question of ownership. The fine print might well say if it's on their server, then they own it. StuRat (talk) 18:04, 20 April 2013 (UTC)[reply]

BCD to decimal

I'm trying to make a clock on an Arduino Uno. I have a real time clock where I'm getting data from. Page 11 of the datasheet has the table of values such as seconds, minutes, hours, etc. I'm having trouble with the BCD to decimal conversion though. In my fumblings, I've been able to get the date set on the RTC. The time was set at one point but is now several hours off.

So, I'm trying to display this on an LCD. The time displays fine. Well, I think it does. I haven't watched it for a full 24 hours but I've seen the hours/minutes/seconds tick over like they should during a day. So far I haven't seen anything unusual like more than 60 minutes in an hour. I'm having trouble with the date though. I can't get the numbers to display correctly. For instance, the clock shows that we're on the 25th day of the 16th month. So, here's what I have for the time:

seconds = (((seconds & 0b11110000)>>4)*10 + (seconds & 0b00001111)); // convert BCD to decimal
minutes = (((minutes & 0b11110000)>>4)*10 + (minutes & 0b00001111)); 
hours = (((hours & 0b00100000)>>5)*20 + ((hours & 0b00010000)>>4)*10 + (hours & 0b00001111)); // (24 hour mode)

And here is what I have for the date:

day = (day & 0b00000111); //convert BCD to decimal
date = (((date & 0b00110000)>>4) + (date & 0b00001111)); 
month = (((month & 0b00010000)>>4) + (month & 0b00001111)); 
year = (((year & 0b11110000)>>4) + (year & 0b00001111)); 
 

Can anyone tell me what I'm doing wrong with the conversion? There's obviously something that I'm not getting. Thanks, Dismas|(talk) 16:55, 20 April 2013 (UTC)[reply]

Are you sure you're reading the right registers? You forgot to multiply by 10 in the expressions for date, month, and year, but I don't see how that could give you the output you're seeing. Looie496 (talk) 17:24, 20 April 2013 (UTC)[reply]
Thanks. I was being dim. That got it. Dismas|(talk) 20:30, 20 April 2013 (UTC)[reply]
Resolved

Cyborg-vs-stronger-computer chess

Our article Advanced chess deals with computer-assisted humans playing against other computer-assisted humans. Have any organized matches occurred where a human and a weaker computer face a stronger computer opponent that has no human help? To what extent can the human provide an advantage? NeonMerlin 19:03, 20 April 2013 (UTC)[reply]

Wasn't this question just asked and answered ? StuRat (talk) 20:37, 20 April 2013 (UTC)[reply]
Right here. --Yellow1996 (talk) 18:10, 21 April 2013 (UTC)[reply]
So Neon, how did you come to think of this identical Q so soon after somebody else asked it ? Was this the theme from some recent TV episode or movie ? StuRat (talk) 21:41, 21 April 2013 (UTC)[reply]
It was inspired by this Forbes article's claim that "computers don't play 'human-level' chess" (I'd initially agreed with the Anissimov quote). NeonMerlin 16:45, 22 April 2013 (UTC)[reply]
I see. The person who posted the previous Q on this must have read the same article. StuRat (talk) 21:48, 24 April 2013 (UTC)[reply]
Also worth noting: the archived question doesn't say anything about the human's presence being able to compensate for a hardware handicap. I see it as an interesting extension of the idea of heterogeneous computing. NeonMerlin 00:54, 23 April 2013 (UTC)[reply]

April 21

need a java book

Hi!
I am a beginner of java
Now I am studying multi threading.
I wanted to know relationship between sleep and interrupt status flag".
I have referred so many books before asking this question here.
But I could not find the relation between sleep and interrupt status flag.
Finally I asked that doubt in wikipedia onj april 19 with heading "relation between sleep and interrupt status flag".
Not only that for somany doubts i have asked questions in wikipedia.
I need a book which explains such type of depth topics.
Can u suggest such type of java book?
— Preceding unsigned comment added by Me shankara (talkcontribs) 01:31, 21 April 2013 (UTC)[reply]

string inversion

A few years used a little utility that inverts strings; fed a text file containing

my
brain
hurts

it would output

ym
niarb
struh

which of course could be redirected:

utilitywhosenameiveforgotten sensible.txt > inverted.txt

But I now can't remember what it was called, am surprised not to spot it within GNU Core Utilities, and am not having luck googling for it. Please jog my ageing memory. (Oh, it was and is for GNU/Linux, if this matters.) -- Hoary (talk) 02:31, 21 April 2013 (UTC)[reply]

I think you're looking for "rev". See [4]. I don't know if it comes from GNU or not. My Mac has the BSD version. Another web page I found implies the package on Linux is "util-linux", but that source didn't specify which distro that was for. RudolfRed (talk) 02:40, 21 April 2013 (UTC)[reply]
Yes! And wherever it comes from, it seems that Debian installs it by default. Thank you. (But "Four Completely Useless Linux Commands"? Hmmf! These are definitely not useless.) -- Hoary (talk) 02:49, 21 April 2013 (UTC)[reply]
rev is distributed as part of Linux (in the util-linux folder). tac (the backwards concatenater) is distributed as part of GNU Coreutils. Nimur (talk) 03:47, 21 April 2013 (UTC)[reply]

Odin and Naval network. what are they?

In a meeting that happened between Assange and Google's Eric Schmidt, they mention naval network and Odin along with Tor. What are they referring to? Or is Assange poking fun at Schmidt's apparent lack of understanding? On the linked Wikileaks page 10th. 11th and twelfth fragments of the conversations have these things. Can somebody explain them to me? --Thirdmaneye (talk) 06:36, 21 April 2013 (UTC)[reply]

As our article on Tor (anonymity network) states, Tor was developed out of software created by the U. S. Naval Research Laboratory. I'm not sure about the Odin reference. There are lots of things called Odin, but this may be a joke based on the fact that in Norse mythology Odin was Thor's boss. Looie496 (talk) 22:04, 21 April 2013 (UTC)[reply]

Software to record my voice?

When I study, or learn lines, I like to record myself reading the things I want to memorise, and play them back through headphones while I'm travelling anywhere.

That was fine in the days of cassette recorders, but now what I need is to be able to record my voice on the computer's microphone then save that as an MP3 or similar. I used to subscribe to the upgraded version of RealPlayer, which had that function. But it seems ridiculously expensive when that's the only thing I used it for.

Can anyone recommend some software which does this? Sound quality isn't an issue, within reason, so something free should be fine. AndyJones (talk) 06:55, 21 April 2013 (UTC)[reply]

See List of free software for audio. I like Audacity. I also still use "Messer Memo Session Sound Recorder"which is ancient and simple, but still works. I also use GoldWave (though it's not freeware). Dbfirs 07:22, 21 April 2013 (UTC)[reply]
They also make portable digital voice recorders, which might be easier to use. They fit nicely in a pocket or in a lanyard around your neck, and are quite inexpensive. Many cell phones also have this capability, so check if yours does. StuRat (talk) 18:37, 21 April 2013 (UTC)[reply]

International characters

If support for international characters is required, what should I use?

  • Code page 1252 (ANSI Latin I)

or

  • Unicode

I'm not sure about this. --77.239.46.74 (talk) 10:26, 21 April 2013 (UTC)[reply]

Short answer: Unicode. Unicode covers vastly more characters. Unfortunately it can make life a bit more complicated. That means that sometimes it isn't practical, but if you can, use Unicode. KarlLohmann (talk) 11:59, 21 April 2013 (UTC)[reply]
Ok, sounds to me like both answers are right? That's the point I stuck. It's from a Microsoft exam question and I've to choice between Unicode or Code page 1252. The requirements are just 'support for international characters', so it's hard to decide since both are correct. --77.239.46.74 (talk) 12:09, 21 April 2013 (UTC)[reply]
Basically Windows-1252 is legacy stuff, and you shouldn't use it for new programs unless something forces you to. So the correct answer is clearly Unicode. Looie496 (talk) 15:27, 21 April 2013 (UTC)[reply]
Unicode is the answer they want. Microsoft uses UTF-16 for this, see Unicode in Microsoft Windows Dmcq (talk) 15:32, 21 April 2013 (UTC)[reply]

Ok, if the question comes in the exam, I'll take Unicode, although the exercise answer is "Code page 1252". However, I was in doubt about it, therefore I asked here. Thank you. --77.239.46.74 (talk) 15:49, 21 April 2013 (UTC)[reply]

Might there be some context here? If you were writing something that needed to work with Windows 98 or an earlier version of Windows, you would have to use 1252, because NT was the first version of Windows to support Unicode. Looie496 (talk) 16:01, 21 April 2013 (UTC)[reply]
No nothing. It's just about using the right option in the 'Export Wizard' of SQL 2012. It's even not mentioned where the export file is supposed to import, it's just about the export and the export file should be support international characters. --77.239.46.74 (talk) 16:34, 21 April 2013 (UTC)[reply]
Well, hmmm. First you say "No nothing", and then you proceed to give an important piece of information. This makes it hard to feel confident that you have given all the relevant information even now. The fact that this is SQL 2012 is relevant because (a) Windows-1252 is the default character encoding in SQL Server 2012, and (b) lots of companies run old database software, so it is safer to use a backward-compatible encoding unless it will lose crucial information. But even so, I suspect that there is more information either in the exact wording of the question or in the directions for that section of the test. Looie496 (talk) 21:26, 21 April 2013 (UTC)[reply]
Any modern SQL works perfectly well with unicode strings and that's what one would use for internationalization unless international just means European. You do need to declare the fields as holding unicode strings rather than just strings. I really don't see how code page 1252 comes in to this at all unless it was "if you don't require internationalization" and the "don't" went missing. Or perhaps they want an ANSI file that doesn't support internationalization used for transfer with the unicode characters turned into hex? That just doesn't make a lot of sense to me either. Dmcq (talk) 10:47, 22 April 2013 (UTC)[reply]

SQL: Replay Trace with Extended Events?

Extended Events is suppose to replace the SQL Profiler. There are many advantages to use the Extended Events, see here. The SQL Profiler is even set in deprecated status. However, is Extended Events also able to replay traces it has recorded? With SQL Profile that's possible, but I didn't found any information Extended Events is also able to do that. I'm just wondering because if the SQL Profiler will really be missing in the next version of MSSQL, there is no possibility to replay traces?! --77.239.46.74 (talk) 14:34, 21 April 2013 (UTC)[reply]

Blowing on Video Game cartridges

I recently learned that on the back of most cartridges it is clearly stated "Do not blow on the connectors" - this is news to me. Isn't that what everybody does? I saw this on the back of an N64 cart, by the way. I think this may be the cause of some mysterious losses of save data I have experienced over the years, as I remember blowing on the connectors a lot before my Earthbound save file finally went(and I know it wasn't the battery because I was able to save on a new file afterwards.) Same thing on Mario Party for N64. So my question is: how does blowing on the connectors mess with the save data and lead to corruption/deletion? Thanks! --Yellow1996 (talk) 18:07, 21 April 2013 (UTC)[reply]

Human breath contains moisture, which can gradually increase corrosion and contamination of the pin connectors. You can read more at an article seen here. AzureCitizen (talk) 18:35, 21 April 2013 (UTC)[reply]
Whoa, I read the article - scary stuff! I'll definately never blow on the connectors again. Thank you! :) --Yellow1996 (talk) 01:01, 22 April 2013 (UTC)[reply]

Shift key behaving as a quotation mark key

Ever since I arrived here in France (although it could be a hardware problem), my Left Shift key functions as a quotation mark key (meaning that every time I press the Left Shift key, it instead types ' or "), although my Right Shift key still works properly. Is this a software or hardware problem? If so, is there a quick way to fix it? By the way, my laptop is a Sony Vaio E series laptop, which is only around four months old. The model is SVE141D11L. Narutolovehinata5 tccsdnew 20:03, 21 April 2013 (UTC)[reply]

I'm guessing, but you might want to check whether something has modified the language settings on your computer. In the Control Panel, find "Region and Language" and then "Change Keyboard or Input Method" (maybe different wording, depending on exactly what version of Windows you're using, but there should be a keyboard item in there somewhere), and check to see that it is set to the US keyboard and to English. Looie496 (talk) 03:13, 22 April 2013 (UTC)[reply]
On a proper French keyboard, the top row starts AZERTY (compared to the more usual QWERTY you find in the English world). However, some places use the freaky international english setting with a QWERTY keyboard. In that case, the shift sometimes acts as a dead key for typing things like accents. Astronaut (talk) 19:23, 22 April 2013 (UTC)[reply]

April 22

Pentax sensor cleaning and battery

My Pentax K-x DSLR has a menu option for sensor cleaning, where it raises the shutter so you can clean the sensor. But it will refuse to do this if there is "not enough battery", which it seems to generally define as about 2/3 or less. I'm curious, why does it take so much battery to open the mirror and keep it there when it can open and close it 1000 times (plus process the images captured) on the remaining battery life? -mattbuck (Talk) 02:55, 22 April 2013 (UTC)[reply]

It rather sounds like a spring holds it closed, and it must constantly use energy to hold it open, against the spring. Not a problem when it's only open a fraction of a second, but holding it open for several minutes might drain the battery. StuRat (talk) 04:47, 22 April 2013 (UTC)[reply]

I worked whit the kx once (or the kr)… and don’t remember ever had this problem Is your battery retaining the charge normally? Other thing… don’t remember very well, but I think it not only opens the mirror, it has to shake the sensor too Iskánder Vigoa Pérez (talk) 17:27, 22 April 2013 (UTC)[reply]

FORTRAN read statement

I wrote a program where you navigate a maze. I use the numeric keypad for movements. Unfortunately, after hitting a direction key, you must also hit <Enter> to pass that input to the program and actually move. So:

1) Is there a way to get FORTRAN to work without requiring the <Enter> key for each read statement ? (Any version of Fortran will do.)

2) Is there a way to redefine the keystrokes so that, for example, Numeric Keypad 8 = 8 + <Enter> ? (This is at the Command Prompt for Windows 7.) StuRat (talk) 04:58, 22 April 2013 (UTC)[reply]

to 1) Compaq Visual Fortran (you did say "any version of Fortran") had GETCHARQQ. See [5] (or google the command). Not fluent in Fortran, but if you want to avoid waiting for an Enter key, watching some kind of input queue would be the most logical approach. Also this thread [6] contains some useful hints. GermanJoe (talk) 11:49, 22 April 2013 (UTC)[reply]
Thanks, but your first link is in German. Let me also ask about a 3rd alternative:

3) Is there some type of keylogger program which will add each keystroke to a file, and then close the file, as it's pressed, so my program could read it from the file ? Or, how about adding it to an environment variable ? StuRat (talk) 16:58, 22 April 2013 (UTC)[reply]

I would perhaps try to call 'getc' from the standard C library. Calling non-native functions could certainly be done under VMS, but I'm unsure about other environments. Failing that, you are perhaps looking at directly interacting with your hardware. Astronaut (talk) 19:29, 22 April 2013 (UTC)[reply]
Well, I do have a C compiler (gcc). So you're saying I should write a C program which will call getc and return a single character to the calling program (which will be my FORTRAN program, in this case) ? StuRat (talk) 21:19, 22 April 2013 (UTC)[reply]
I just tried this in C, and the program I wrote also waited for me to hit enter there. Does someone want to provide me a bit of C which doesn't wait for the enter key ?(I figured this part out.) StuRat (talk) 21:44, 22 April 2013 (UTC)[reply]

on Linux, you can do stty -icanon which will turn off "canonical mode" for the terminal which will make it return single chars without waiting for a newline (getchar() will return upon pressing any key, not just Enter). in Windows, I think you could call SetConsoleMode to reset the ENABLE_LINE_INPUT flag (probably from a C wrapper program.) If it's in Windows I think the language's runtime ultimately calls ReadFile or ReadConsole, which are the functions the console mode affects. If however it's the runtime, not the OS, that waits for a new line (kind of like calling fgets() instead of getchar() in C), then I don't know. Regards Asmrulz (talk) 21:52, 22 April 2013 (UTC)[reply]
Are you using Cygwin? Cygwin does emulate a UNIX-like API, so may be it has the terminal i/o stuff as well. I found this: this (second answer from top) (or you can just do system("/usr/bin/stty -icanon"); and then exec() your program (all in Cygwin's shell)) Asmrulz (talk) 22:14, 22 April 2013 (UTC)[reply]

Another approach in Windows might possibly be to use the GetAsyncKeyState function, [7] and check the relevant keys explicitly. The snag with that is that the key presses would still register as input, and eventually fill the buffer. AndyTheGrump (talk) 22:13, 22 April 2013 (UTC)[reply]
and you can't easily pass the keypresses so read to the child process. the idea was to just set the console mode and call the other program Asmrulz (talk) 22:29, 22 April 2013 (UTC)[reply]

I have my solution. I followed the suggestion to use C. Here's the C code, named "getch.c":

#include <stdio.h>
int main()
  { 
    char keystroke;
    FILE *file;
    file = fopen("keystroke.txt","w");
      keystroke = getch();
      fprintf(file,"%c\n",keystroke);
    fclose(file);
    return (0);
  } 

And here are the relevant bits from my FORTRAN program which calls it:

     character*1 KEYSTROKE
             .
             .
             .
     call SYSTEM("getch.exe"  )
     open (unit=10,file="keystroke.txt",action='READ')
       read (10,*) KEYSTROKE
     close (10)

Thanks, everyone ! StuRat (talk) 23:10, 22 April 2013 (UTC)[reply]

Resolved


Can't you eliminate the file altogether though?

"getch.c":

#include <stdio.h>
int main()
  { 
    return (int) getch();
  } 

FORTRAN:

     INT KEYSTROKE
             .
             .
             .
     KEYSTROKE = SYSTEM("getch.exe"  )

(I've not programmed in FORTRAN, I'm not sure of the syntax of the last bit). AndyTheGrump (talk) 02:21, 23 April 2013 (UTC)[reply]

I doubt if it's that simple. FORTRAN and C have a number of incompatibilities, as I recall, such as passing addresses, versus pointers, versus values. Using a file insulates them from having to communicate directly. StuRat (talk) 02:35, 23 April 2013 (UTC)[reply]
AndyTheGrump's solution should work. He is creating a C program that returns the character as an Exit status. When executing the file from FORTRAN, he checks the exit status. The C code is still being executed as a stand-alone executable, this solution just eliminates a bunch of file reading and writing.
However, most compilers allow you to specify a calling convention at a per-function or per-file level. You have a solution that works for you, but it could be an interesting learning experience to figure out how to make the two languages speak to each other. You should be able to build an object file from your FORTRAN source and one from your C source, and then use the linker to create your final executable. 38.111.64.107 (talk) 12:50, 23 April 2013 (UTC)[reply]

Help with Mozilla Thunderbird

For the past week or two, the calendar function of my Mozilla Thunderbird (running under Windows 7) hasn't been working. Every time I open Thunderbird I get the error message: "An error was encountered preparing the calendar located at moz-storage-calendar:// for use. It will not be available." The error code it provides is 0x80570015. Any ideas how I can fix this? I've considered simply reinstalling Thunderbird, but I'm worried if I do that I'll lose all the e-mails currently in my inbox. Can anyone plausibly reassure me that that won't happen if I reinstall? Thanks. Angr (talk) 07:36, 22 April 2013 (UTC)[reply]

If you want to avoid the risk of your emails being destroyed (by a reinstall or anything else) you should regularly be backing up the Thunderbird profile folder. The location of that varies between Windows versions - it's explained at here. Your error sounds like there's a corruption in one of the SQLite database files used to store the calendar info. Deleting the specific calendar file will probably force Lightning to rebuilt it - but obviously that will wipe your calendar out too. You'd probably be better describing this error on the specific support forum, as listed at the Mozilla Calendar FAQ, where people will be familiar with the specifics and hopefully will have a less nuclear solution for you. -- Finlay McWalterTalk 14:58, 22 April 2013 (UTC)[reply]
Thanks for your help! I wound up simply uninstalling the Lightning add-on and then reinstalling it, and now it works again. It even remembered my old appointments. I did also back up my profile too, just to be on the safe side. Angr (talk) 20:44, 22 April 2013 (UTC)[reply]

Difference between two LCD panels

What exactly is the difference between the LG IPS277L and the LG 27EA73LM-P? One difference is that the latter has integrated speakers. Is that the only difference? Is it the same panel, or is there any difference in image quality? --Andreas Rejbrand (talk) 11:20, 22 April 2013 (UTC)[reply]

It seems that the s277l has an IPS panel an dthe 27ea73 has a VA one. Both have a very high price for just a 1080p monitor
and this Dell is beautiful http://www.amazon.com/Dell-927M9-IPS-LED-27-Inch-LED-lit-Monitor/dp/B009H0XQPA/ref=sr_1_1?ie=UTF8&qid=1362155424&sr=8-1&keywords=Dell+S2740L+927M9-IPS-LED+27-Inch+Screen
Iskánder Vigoa Pérez (talk) 17:38, 22 April 2013 (UTC)[reply]
Thank you for your input. Is there any information, or qualified guess, as to which panel has the highest image quality? As for resolution, I certainly do not need more than 1080p in this case. Maybe high price simply means high quality? --Andreas Rejbrand (talk) 19:31, 22 April 2013 (UTC)[reply]

programming using qbasic

what is the effect of the following when using the print statement(give an example of a code to support your answer) 1. if you type PRINT without any variable,or text after it? 2.if text you wnt is to be printed 3.if you want values of the variable to be printed accompanied by text . — Preceding unsigned comment added by 41.223.142.34 (talk) 15:45, 22 April 2013 (UTC)[reply]

The example program in our QBasic article will help you answer two of these questions, and the resources linked from that article will probably answer the third question. Gandalf61 (talk) 15:53, 22 April 2013 (UTC)[reply]
Please do your own homework.
Welcome to the Wikipedia Reference Desk. Your question appears to be a homework question. I apologize if this is a misinterpretation, but it is our aim here not to do people's homework for them, but to merely aid them in doing it themselves. Letting someone else do your homework does not help you learn nearly as much as doing it yourself. Please attempt to solve the problem or answer the question yourself first. If you need help with a specific part of your homework, feel free to tell us where you are stuck and ask for help. If you need help grasping the concept of a problem, by all means let us know. StuRat (talk) 16:50, 22 April 2013 (UTC)[reply]

How do I get rid of this political spam in my e-mail inbox?

I have no idea how long this has been going on or when did this begin occurring, but I do know that the Democratic Party somehow knows my e-mail address and has been sending me spam about Barack Obama and stuff like that. I tried to e-mail them during the re-election campaign about the problem. They never replied, and they never stopped. So, I created a filter in my Outlook Web App inbox. That only raised one problem. All the messages go to my junk folder. I want to know how can I create a filter to automatically delete these messages. They are annoying and also a reason why I am apolitical. Plus, my Outlook Web App inbox is really my academic e-mail inbox for academic/professional purposes. If they had sent me spam through my AOL account, then I wouldn't mind, because I rarely check it. Sneazy (talk) 18:12, 22 April 2013 (UTC)[reply]

I'm not sure what options Outlook has for blocking spam, but here are some common ones:
1) A blacklist. This blocks any mail coming from a particular address. If they always come from the same set of addresses, then this is ideal, as it shouldn't block anything you want.
2) A whitelist. This only allows emails in from a list of addresses you provide. This is far more likely to block good emails, as it's difficult to list every address from which you may ever receive a legit email.
3) Searching for keywords in the title or content, and blocking emails which have those. For example, you could have "Democratic" or "Obama". This might also block legit emails, though, since those terms might occasionally show up in them: "I can't finish my report right now, since I have to fill out some Obamacare health insurance forms." StuRat (talk) 19:12, 22 April 2013 (UTC)[reply]
Double-check that there isn't some sort of unsubscribe link or instructions at the end of the message. Most legitimate mailing lists will make it easy to unsubscribe, but simply replying to the email and asking to be removed might not be the right procedure. 38.111.64.107 (talk) 12:40, 23 April 2013 (UTC)[reply]

silly computer science question

is there something like "lambda assembly"? I mean, lambda calculus is "but" a model of computation as are the register machine and the stack machine, and compilers produce code for the latter two. If there were a computer that ran LISP or something, natively, the way a PC runs x86 assembly, what would its machine language look like and could one make a C compiler that compiled to it and what would its output look like (as opposed to "ordinary" assembly)?
C : register machine : x86 assembly
Java : stack machine(?) : JVM assembly
LISP: lambda machine(?) : ?
Sorry if the question's confused:) Asmrulz (talk) 21:01, 22 April 2013 (UTC)[reply]

Graph reduction machine, for which the "assembly language" is a combinator graph. Lisp machines were actually sold commercially, but I'm not sure that's quite what you're looking for since most dialects of LISP are thoroughly imperative. -- BenRG 21:42, 22 April 2013 (UTC)
Thanks! It's a bit clearer now. An article linked from that article's page was interesting, too Asmrulz (talk) 23:48, 22 April 2013 (UTC)[reply]

Academic research document papers contains mistakes

I thought Academic research documented paper is the most reliable sources. There is four authors who published the abstract research documents are they all reliable predictions or each one have error bars in there. There are four main authors who presented the calculations of death of the solar system [8] [9] Rasio et al. (1996) and [10]. is this possible some of their works to calculate the inner planet's fate can contain lots of mistakes. Do some of these guys likely to make alot of mistakes in their calculation or the best answer is all of everybody including Schroder and Smith's calculations contains some mistake lines. I thought they use computer simulations and solar model to make the calculations. Is this possible computer simulations can produce alot of mistakes or more mistakes than accuracies. Basically what do astronomers put in the computer simulations? After primary sources publish out do people criticise the authors may make some mistakes in their calculations and when editors creates the website, they tend to correct the authors who wrote the primary sources? Is secondary sources mostly summarizes the primary source?--69.226.42.116 (talk) 23:48, 22 April 2013 (UTC)[reply]

Yes, many research papers contain mistakes. If they make a dramatic claim, like the existence of cold fusion, you can bet others will check their work. On the other hand, if they make a claim nobody cares about, then it may very well go unchecked. StuRat (talk) 01:09, 23 April 2013 (UTC)[reply]
If you have a group of papers that make predictions and they arrive at different results, the likely explanation is that the predictions are based on different assumptions. There is almost never enough information available to make perfect predictions, so the only way to do it is to make guesses about the information that is missing. Different people make different guesses. As long as the authors are careful to explain the assumptions they have made, there is nothing wrong about that approach. This is how science works. Looie496 (talk) 02:02, 23 April 2013 (UTC)[reply]
So, basically research paper documents and computer documents basically involves speculations and alot of uncertainty. Is this the same things happening for years. Editors and websites will just check their work and correct what their work according to what they think is right. Do computer simulations involve alot of mistakes? I thought computer simulations looks accurate that is why I thought they don't have that much error bar.--69.233.255.83 (talk) 02:09, 23 April 2013 (UTC)[reply]
Ever heard the phrase "garbage in, garbage out" ? That means the results of the simulation are based on whatever data and assumptions they supplied to the program. For example, if you use a calculator to do some math, you can still make mistakes by entering the wrong numbers, forgetting the decimal point, hitting the wrong buttons, or using it improperly (say taking the hyperbolic cosine when you wanted the regular cosine or log e when you wanted log 10). In most cases, the calculator won't tell you you made a mistake (with a few exceptions, like if you try to divide by zero). StuRat (talk) 02:45, 23 April 2013 (UTC)[reply]
  • Let me try to give a clearer answer. "Mistake" is the wrong word. Think about weather prediction. If the weather report predicts a 90% chance of rain tomorrow, and it doesn't rain, do you say that it made a mistake? No -- weather reports are made using imperfect models, and the data that goes into them is imperfect. Therefore the predictions are imperfect. The same thing happens in every type of science. The requirement for a scientific paper is to accurately report on how the results were obtained. There cannot be a requirement that the results be perfect, or nobody would be able to do any science at all. Looie496 (talk) 04:29, 23 April 2013 (UTC)[reply]
Maybe mistake was a wrong word of choice, but "error" sounds better. So every scientific papers have some threads of errors, could be they neglect an important variables. So every scientific paper will only tell me some accuracies, some speculation guesses will contain some errors.--69.233.255.83 (talk) 05:17, 23 April 2013 (UTC)[reply]

April 23

Smartphones: resistive or capacitive touchscreen

Why does the capacitive touchscreen dominate almost completely the market of smartphones? The resistive touchscreen is cheaper and user-friendlier (you can write on the screen, and women can type with their fingernails on it). I know that the latter can poorer resolution and can be scratched more easily, but this second concern can be deal with. And if I remember well, the PDAs were more oriented toward resistive touchscreen than capacitive screen. OsmanRF34 (talk) 12:38, 23 April 2013 (UTC)[reply]