Jump to content

Wikipedia:Reference desk/Computing

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by XPPaul (talk | contribs) at 22:46, 30 April 2012 (→‎Who's censoring this stuff?). 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 25

BIOS INT 10H source of pixel data for characters

When a call to INT 10H comes and the ASCII bits describing, say, the character 'A' are in AL, where exactly in the computer are the bits that describe the pixel formation of the glyph 'A' that INT 10H goes to to get them on the screen? If your answer is that 10H's job ends when it tells the graphics card in language it understands to put 'A' on the screen, my question remains, where exists the pixel data for the most basic of characters before anything so fancy as font files are loaded up? 20.137.18.53 (talk) 12:15, 25 April 2012 (UTC)[reply]

In a "real" PC (in times of yore, before layers of emulation abstracted how so many things worked) there was a character ROM which stored 9x14 pixel bitmaps for each character in code page 437. In the original IBM Monochrome Display Adapter this was a discrete ROM device, over which the card would brook no override. Later cards, with more memory, allowed to to copy this ROM in the the card's own RAM (they were all addressable locations in the host PC's address space) and direct the controller to use that instead (allowing you to alter the appearance of characters). I don't off hand know the memory map involved. -- Finlay McWalterTalk 13:12, 25 April 2012 (UTC)[reply]
Hmm, on further cogitation I don't think that (in early devices) the graphics adapter's ROM or RAM were mapped into the host device's Memory-mapped I/O (because they'd take up too much room). They were later, but I've lost my giant-book-of-graphics-chips of that era, so I don't know the specifics of when. -- Finlay McWalterTalk 13:28, 25 April 2012 (UTC)[reply]
The actual character array (that we might call the screen) was an area of memory in the display adapter's limited RAM. INT 10H calls (which were often implemented by code in the graphics adapter's own expansion ROM) would read and write character codes into this space. Asynchronous to that, the graphics adapter continually generated a stream of pixels as the raster proceeded along and down the screen. As it did so, it would fetch a byte or two from the character map, and would look up the corresponding bitmap data in the character rom, giving actual pixels for it to emit. -- Finlay McWalterTalk 13:17, 25 April 2012 (UTC)[reply]
For some diagrams, this page discusses the character generator circuitry for an early Atari computer; the arrangements (for that part) were much the same in an IBM-MDA. -- Finlay McWalterTalk 13:36, 25 April 2012 (UTC)[reply]

Hi, I'm new to Xcode and can't seem to find out how to add loads of text to the screen, I tried adding it to a label but this seems to have a finite amount of characters it allows to get displayed, I added a scroll bar in the hope that I could view the text which is not displayed, does anyone know how I could add more text to the screen thanks, I am also trying to link to a website with a button but can't seem to do this without leaving the application.84.203.137.50 (talk) 13:43, 25 April 2012 (UTC)[reply]

Gmail Account

Here i got a question regarding gmail account , My question is this, can i delete the digits in my gmail username. Like my username is <redacted>55@gmail.com , i want to delete the 55 in my username,is thid possible. Any help will be greatly appreciated. — Preceding unsigned comment added by 78.86.121.138 (talk) 13:52, 25 April 2012 (UTC)[reply]

You have to create a new account, if the name usman is still available. — Preceding unsigned comment added by 88.8.68.89 (talk) 14:22, 25 April 2012 (UTC)[reply]
And that's a big "if". Likely the reason that number was added was because, without it, that name was already in use. StuRat (talk) 19:02, 25 April 2012 (UTC)[reply]
From Google's help pages: "it's not currently possible to change your Gmail username after you've registered. You can, however, create another Google Account with a different Gmail username." - Cucumber Mike (talk) 14:24, 25 April 2012 (UTC)[reply]
If you do create a new account, it's possible to automatically forward any emails you get from one to the other. So you don't have to check both accounts. And you can change the "from" address of your mail so it reads which ever one you prefer. - Akamad (talk) 23:05, 25 April 2012 (UTC)[reply]
That is possible. I had to do this once as my address was listed once as "dismis" instead of "dismas". So I set up a new account under the first spelling to forward all mail to the second. Dismas|(talk) 01:13, 29 April 2012 (UTC)[reply]

Running process and automatic sleep

If Windows 7 is running a process (like doing a backup) and it's set to get to sleep in a time shorter than that needed to the backup, what would happen? Go to sleep anyway? — Preceding unsigned comment added by 88.8.68.89 (talk) 14:05, 25 April 2012 (UTC)[reply]

Windows provides many ways to let a process know that the system is changing: for example, WM_CLOSE tells a desktop-application style program that it "should please stop running." Other messages exist, including special cases for system hibernation and sleep events. An application programmer may choose to handle these messages, or ignore them. The operating system may decide to wait pleasantly for a response, or it may shut down anyway, depending on the type of shutdown (and the permissions of the person or program who initiated it). For example, read this Microsoft tech note on writing good power-aware applications, which links to an explanation of, e.g., the PBT_APMSUSPEND event, a special message sent to the application "about two seconds" before the machine goes to sleep. (If your application's designer couldn't write the code to save your work - or at least to put it in a consistent, recoverable/resumable state - in under two seconds, you need a better application).
On POSIX-compliant computers, we have two ways to interrupt a process and tell it that it needs to stop running. Loosely speaking, these are SIGTERM, which tells the process "Please terminate, you have a few moments to wrap up." We also have SIGKILL, which doesn't tell the process very much at all: the kernel will kill the process for you.
Ultimately, remember that the operating system's job is to politely mediate requests between many different programs (and potentially, many users); and to politely balance hardware realities (like turning the power off) against software requests (like a program that needs more time to save your work to disk). Good software-engineers use all the information that the system provides so that the program does the right thing without confusing the user. Nimur (talk) 16:44, 25 April 2012 (UTC)[reply]
WM_CLOSE means that the user clicked the X in the upper right corner of the window or did something equivalent like pressing Alt+F4. The application is free to respond however it wants, just as with any other button click or key press. WM_CLOSE is sometimes sent in other ways—for example, when you try to terminate an application in Task Manager, I think it sends WM_CLOSE first and waits a few seconds before resorting to more drastic measures. I don't think this is relevant to the original question, though, which was about whether a backup application can/will prevent the computer from sleeping.
Programs can call SetThreadExecutionState to prevent the system from sleeping. Many don't, though. I don't know of any way to tell except by doing the obvious experiment. -- BenRG (talk) 22:32, 25 April 2012 (UTC)[reply]


April 26

Double OS and double hibernate?

If you have two OSs in one computer, can you put both to hibernate and choose which want you to wake? That would be a kind of GRUB loader. 14:50, 26 April 2012 (UTC) — Preceding unsigned comment added by 88.8.68.89 (talk)

In principle, yes - but it depends on the order of your bootloaders. For example, the Windows bootloader won't give you a choice if you hibernated (presumably to reduce the possibility of making changes 'behind its back' with potentially deletrious consequences on resume) - I've not paid enough attention to notice if any Linux distributions do the same with GRUB. 131.111.255.9 (talk) 16:11, 26 April 2012 (UTC)[reply]

To add to that, you would have to have 2 swap partitions because of hibernation suspending to RAM

Classful networking and CIDR

I more or less know what classful networking and CIDR are. And I know CIDR came after classful and makes use of a subnet mask. So my questions: did subnet masks exist before CIDR or were they introduced for CIDR? If they were introduced for CIDR does this mean the IP protocol had to be changed? If they already existed what were they used for and, again, were any changes needed to be made to the IP protocol?

Thanks and sorry for all the question. Im really just starting networking and I cant help getting caught up in all the details even though I may not need them right now. --TuringMachine17 (talk) 22:47, 26 April 2012 (UTC)[reply]

We have articles on both CIDR and Subnet masks. From what I can tell from the article, they came about at the same time. RudolfRed (talk) 00:41, 27 April 2012 (UTC)[reply]
I saw this yesterday, and was about to answer they were different, but from what our articles suggest, they seem to have come about together. When I hear CIDR I think the notation (/16) but obviously it's broader.
But there's a caveat. While the internet edge routers wouldn't use subnetting like we think about it today, the RFC introducing CIDR talks about subnetting. What's special about CIDR is variable-length subnetting. Whether that difference is meaningful depends on whether or not those early networking devices/stacks respected other subnets before CIDR was contemplated. That I do not know. But the term "subnet" was used to describe the fixed subnets of classes. A class A range could be expressed as a subnet, and that terminology was used back in 1993. Shadowjams (talk) 16:10, 27 April 2012 (UTC)[reply]


April 27

MS-Excel

What is MS-Excel? — Preceding unsigned comment added by Aadya mishra (talkcontribs) 05:14, 27 April 2012 (UTC)[reply]

It means Microsoft Excel. Bubba73 You talkin' to me? 05:37, 27 April 2012 (UTC)[reply]

iPhone Camcorder/iMovie

Why cannot i import camcorder films from my iPhone into iMovie please?--85.211.154.241 (talk) 05:56, 27 April 2012 (UTC)[reply]

Do any of these links help?[1][2][3] If not, it would be useful if you told us the particular problem you are having and the version of iMovie and other software you are using. --Colapeninsula (talk) 09:04, 27 April 2012 (UTC)[reply]


iPhone3 and iMovie 11.--85.211.154.241 (talk) 15:12, 27 April 2012 (UTC)[reply]

Sorry, forgot to thank you for the links, I think that the first one will be helpful. — Preceding unsigned comment added by 85.211.154.241 (talk) 15:18, 27 April 2012 (UTC)[reply]

Leading spaces are stripped out of Access table

I am using Access 2007 and importing data from a .csv file into text fields in a table. Some of the text fields have leading spaces which are needed and I want to keep them but Access strips them all out when the data is imported. How can I stop this happening please? Gurumaister (talk) 07:39, 27 April 2012 (UTC)[reply]

Can you put quotation marks around the individual data items, including the leading spaces? Comma-separated values suggests this. --Colapeninsula (talk) 09:10, 27 April 2012 (UTC)[reply]

Unfortunately, I can't. The .csv is an export of a name and address file from another (non-Access) database so the data comes out without quotation marks. Surely having leading spaces stripped out should be a matter of choice and therefore optional? I am finding it very frustrating. Gurumaister (talk) 13:22, 27 April 2012 (UTC)[reply]

Access handles all unquoted spaces before data as just ignorable whitespace and ignores it. I don't see any way around that with Access's interface. Your options, as I see them, are 1. Have the other database spit out the data in a quoted fashion, or 2. Put together some kind of CSV pre-processor that adds the quotes in for you automatically. (The latter is only a moderately difficult scripting task, as far as scripting tasks go.) --Mr.98 (talk) 14:27, 27 April 2012 (UTC)[reply]
This Python script does that (blindly - even elements without whitespace get quoted anyway). It reads stdin and write stdout. -- Finlay McWalterTalk 14:55, 27 April 2012 (UTC)[reply]
#!/usr/bin/python
import csv,sys
for r in csv.reader(sys.stdin):
    for i in range(0,len(r)):
        r[i] = '"%s"'%r[i]
    print ','.join(r)
Can you get an intermediate file between database 1 and 2 (this is in line with what 98 talks about as a pre-processor)? Shadowjams (talk) 16:02, 27 April 2012 (UTC)[reply]
Can you predict which fields should have leading white-space? If so you can write an update query in Access that re-adds the whitespaces back in as part of either the import routine or a separate query post import of data. ny156uk (talk) 13:52, 28 April 2012 (UTC)[reply]
Presumably the amount of whitespace varies in an unpredictable way, otherwise it would be a simple workaround to just tack on some whitespace. --Mr.98 (talk) 14:41, 28 April 2012 (UTC)[reply]

Python exception fail

Resolved

Why isn't this exception caught?

try:
    j = "rgb".index(instring.pop(0))
    ...
except ValueError,IndexError:
    ...
Traceback (most recent call last):
 File "mug1.py", line 36, in <module>
   j = "rgb".index(instring.pop(0))
IndexError: pop from empty list

I tried unpacking the expression:

    ch = instring.pop(0)
    j = "rgb".index(ch)

but that didn't help. —Tamfang (talk) 19:37, 27 April 2012 (UTC)[reply]

You need parens around ValueError,IndexError to make it a tuple. As it is you're catching ValueError into an object called IndexError. --Sean 19:48, 27 April 2012 (UTC)[reply]
I see. That's a feature I haven't used much. Thanks! —Tamfang (talk) 00:06, 28 April 2012 (UTC)[reply]

April 28

What do we call this character?

The character in question appears between the words in the blockquote:

words‎words‎words

What do we call it? I thought it was a zero-width space, but when I copy/pasted it into a URL (http://en.wikipedia.org/wiki/‎) I was given the invalid title page, so apparently it's an invalid character. Nyttend (talk) 14:09, 28 April 2012 (UTC)[reply]

If your and my respective cuts and pastes preserved it okay, it's unicode U+200E, the left-to-right mark -- Finlay McWalterTalk 14:15, 28 April 2012 (UTC)[reply]
How odd — I encountered it while copy/pasting a few subcategory names into Notepad from Commons:Category:Streets in Bloomington, Indiana. If you copy the name of a street and the number of files in the category (everything from the left bracket before the plus or multiplication sign until the parenthesis after the number of files) and go character by character through the result, you'll find one of these characters immediately following at least some of the category names; I tested it with Adams and Grant Sts, and I expect that there are more. Nyttend (talk) 14:23, 28 April 2012 (UTC)[reply]
It's in the original HTML sent by the server - I imagine Mediawiki puts it there for cases where a category name contains R->L characters, and they want to make sure the (1 C, 25 F) thing gets laid out consistently. -- Finlay McWalterTalk 15:01, 28 April 2012 (UTC)[reply]

Stickers on laptop: remove or not?

And why do they put stickers on laptops at all? XPPaul (talk) 22:38, 28 April 2012 (UTC)[reply]

Assuming you mean stickers that tell you about the manufacturer, specs, etc., they do that as advertising, mainly. As for removing them, that's a personal preference, but beware that they may not remove easily, leaving behind an ugly sticky spot. Anything which removes the slime may also damage a plastic case. StuRat (talk) 22:48, 28 April 2012 (UTC)[reply]
Advertising what for? If you have already bought the laptop... If it's for others to see, they could have put them on a more visible spot... XPPaul (talk) 22:53, 28 April 2012 (UTC)[reply]
Well, there's a limit to what consumers will tolerate, and making your laptop look like an Indy car would put it over that limit. (Although Apple manages to put their logo in a highly visible location, but not in sticker form.) StuRat (talk) 23:05, 28 April 2012 (UTC)[reply]
What stickers? Mine has four. There are two on the front, pretty ones from Intel and Microsoft, telling me what processor and what version of Windows I have. They are pure marketing and could be removed. (But see Stu's warning above re sticky mess.) One on the back contains the serial number (often abbreviated to S/N or similar). This is critical if you ever want warranty service from the manufacturer or its representative, so don't remove that. The other has the national contact phone number of the supplier, for when I want service. Think I'll leave that too. HiLo48 (talk) 22:55, 28 April 2012 (UTC)[reply]
Right, I meant the stickers on the palm-rest. Those on the back are useful and non-obstrusive. XPPaul (talk) 22:58, 28 April 2012 (UTC)[reply]
Well you can remove those, too, and if your laptop is ever stolen it might well put the thief at a disadvantage — what you don't want to do is lose the information... if you want it. :p
Most of them come off alright, and if you didn't know one of the best ways to remove excess adhesive left by a sticker is with the sticker you just removed. The last Windows sticker (IIRC) I removed, though, had an awful gel adhesive that was truly a pain to remove... but it did come off eventually. ¦ Reisio (talk) 23:00, 28 April 2012 (UTC)[reply]
I don't see the disadvantage for a thief if he doesn't know the s/n of a laptop. Quite in contrary: if the thief let's the s/n there, there's a low chance of recovering the laptop. XPPaul (talk) 23:18, 28 April 2012 (UTC)[reply]
Found that a little hard to parse. ¦ Reisio (talk) 08:08, 29 April 2012 (UTC)[reply]
For those who remove the sticker and are left with a stick spot, Orange Power's Sticky Spot & Goo Dissolver is very good at removing residue from stickers. I don't know if it's available outside Australia, but I expect that there are similar products on the market. A Google search for "sticky spot remover" finds a few. (I hate the unnecessary stickers that so many companies insist on putting on things these days, so I usually remove them. the aforementioned product is very good at cleaning up the residue.) Mitch Ames (talk) 01:23, 29 April 2012 (UTC)[reply]
WD40 does the job well too85.211.154.241 (talk) 06:07, 29 April 2012 (UTC)[reply]
...except that it leaves your laptop smelling like an oil refinery. Wintergreen oil leaves it smelling nice, but it might damage some plastics, so test a spot with a Q-tip first. StuRat (talk) 06:20, 29 April 2012 (UTC)[reply]
Perhaps the customer will think How privileged and delighted I am to be using Windows X [where X=Vista or whatever] and how I enjoy this subtle but continuous reminder that I am part of the worldwide community of Windows X users!
I've never quite felt this way myself, but I'd guess that many do, judging by the way they like to tell the world of their delight to buy from, and advertise, "TOMMY HILFIGER" or "DKNY" or "STÜSSY" or whatever.
Even within electronics, there's nothing new about this. Thirty years ago a Sony cassette recorder would announce that it was "SONY" and "STEREO" and (if I remember right) a "TAPECORDER" (or some similar odd Sony coinage that never caught on) and had "DOLBY B NOISE REDUCTION" (or something like that). All presumed terrifically exciting to the adolescent male, I suppose.
My own labels stay on as I can't be bothered to remove them, let alone replace them with labels that name what it is that I've replaced Windows with.
When I bought the computer I'm typing on now, from the online store of one of the best known oligopolists, there were various options (e.g. hard disk capacity), but OS wasn't among them. Any OS I wanted, as long as it was Windows 7. I was allowed to write a message; I therefore wrote "No OS, thanks." Reply: This was not an option. My counter-request: "OK, Windows 7, but no Windows sticky label, thanks." Reply: This was not an option. My guess is that the seal on the top is part of a package deal between the "maker" (i.e. marketer) and Microsoft. -- Hoary (talk) 06:34, 29 April 2012 (UTC)[reply]
My understanding is that the 'intel' stickers (at least) are on the computer because the laptop/computer making company are given a financial incentive by Intel to do so. Apple, apparently, refused the incentive and didn't want the sticker on their machines (http://www.informationweek.com/news/personal-tech/smart-phones/229215275). ny156uk (talk) 07:50, 29 April 2012 (UTC)[reply]

Buy a Mac, they are sticker free.85.211.154.241 (talk) 09:42, 29 April 2012 (UTC)[reply]

The mac it self is one giant sticker. Vespine (talk) 01:46, 30 April 2012 (UTC)[reply]
Apple want people to believe their products are made by Apple, not a collection of various technologies, not reall any different then most computers these days. They don't put Samsung stickers on their iPhones and iPads either even though the processors inside are made by Samsung (admittedly they were designed by apple, but using technology licensed from ARM). Vespine (talk) 01:55, 30 April 2012 (UTC)[reply]

Mac screen not framed in window

I think I must have inadvertently changed my screen viewing options but for the life of me I can't figure out how to get back to regular viewing (I've searched in system preferences everywhere). The problem is this: Until today the dock t the bottom of my imac screen, and the menu bar at the top were always visible. Now, they disappear and only appear when I move my mouse pointer to those areas. Meanwhile, it appears that the entire screen size has magnified, such that icons that were near the top or bottom of the screen and near the edges are now partially or wholly off the screen, and when I move my mouse pointer up the entire screen shifts within the frame. Any help?--108.54.17.230 (talk) 23:15, 28 April 2012 (UTC)[reply]

I don't know about Macs, specifically, but that behavior sounds like what happens when you (or some application you used) set the screen resolution beyond what your monitor or graphics card supports. Try lowering the screen resolution. StuRat (talk) 23:22, 28 April 2012 (UTC)[reply]
I also don't know about Macs, specifically, but I'll answer anyway too. That behavior looks like a universal access feature for seeing impaired, a 'zoom' feature. To turn it off, under System Preferences, go to Universal Access and look for zoom. This feature zooms in on a portion of your screen at greatly increased magnification with a keyboard shortcut. Some people love this, but I find it slightly disorienting.XPPaul (talk) 23:35, 28 April 2012 (UTC)[reply]


Thanks for the answers. Neither is the issue though. In universal access, zoom is set to off. When I lowered the screen resolution, everything became huge, and the icons on my screen, where the usually are, were now all overlapping, so it can't be that either.--108.54.17.230 (talk) 23:57, 28 April 2012 (UTC)[reply]
Sound like you raised the resolution. Go the other way. StuRat (talk) 23:58, 28 April 2012 (UTC)[reply]
No, when you lower the screen resolution everything gets bigger. Try it. I went from 2560 x 1,440 to 1920 x 1200 in the test. By the way, learning from the menus displayed, I checked what the "native screen resolution" for my 27" imac is, using a google search, and the current resolution is the "native".--108.54.17.230 (talk) 00:08, 29 April 2012 (UTC)[reply]
I've also seen this happen when swapping monitors or graphics cards, if the resolution was set to a value the first monitor or graphic card supports, but beyond what the new monitor or card supports. (The graphics card issue could happen without your knowledge, if the premium graphics card goes bad/get's jostled loose and you computer automatically reverts to it's default on-board graphics.) StuRat (talk) 00:02, 29 April 2012 (UTC)[reply]
That might be it. I can tell you this occurred suddenly today, working normally this morning. But it's alwats possible I hit some weird combination of commands while typing earlier. It seems more like a "full screen mode", like your browser does where all the menu bars are hidden and only become visible when you page over them.--108.54.17.230 (talk) 00:08, 29 April 2012 (UTC)[reply]
Try system preferences -> Dock. There's an option there for "Automatically show and hide the dock". There might be a similar option for the menu bar, but I'm not sure where that is. RudolfRed (talk) 01:39, 29 April 2012 (UTC)[reply]
Have you tried rebooting? You might also try the "detect displays" in the Display section of System Preferences — it might be confused as to what kind of monitor you have (which would be pretty unusual). For good measure, you can also try zapping the PRAM. But what you describe does sound like Zoom mode (ctrl+mouse wheel or ctrl+two fingered trackpad), though that ought to have shown up in Universal Access if that was what going on. --Mr.98 (talk) 02:58, 29 April 2012 (UTC)[reply]

This site (http://lixlpixel.org/mac-keyboard-shortcuts/) lists some of the short-cuts for changing the 'zoom' - I know i've accidentally knocked universal-access zoom on and struggled to remove it. The combo I think you need is 'Option + command + asterisk (*)'. The Command key is what some people refler to as the Apple key (it used to have an apple logo on the key much like the Windows key does). ny156uk (talk) 07:55, 29 April 2012 (UTC)[reply]

April 29

Windows' license of a wrecked computer

If I buy a computer with Windows on it, but somehow manage to break it completely, like letting it fall from a cliff (anyway, the computer is not well and running at the hands of a thief, for example). Can I install the Windows that I bought a license from into a new computer? Imagine that I buy a the same model again, but without Windows. XPPaul (talk) 00:26, 29 April 2012 (UTC)[reply]

If you bought a retail version of Windows, then probably yes. If you're asking about reinstalling the preinstalled version from your old computer, probably not. You'll need to read the licence that came with your copy to know for sure. RudolfRed (talk) 01:35, 29 April 2012 (UTC)[reply]
If windows came with the computer then it was most likely an OEM license(our article doesn't mention software?), in which case I believe it technically belongs to that specific laptop, not just the same "model", but the same serial number. You didn't buy a windows license, you bought a computer with a windows license on it. Now what you can do and what you should legally do and what you can or can't get away with are different questions, OEM software is a bit of a can of worms in that regard. Vespine (talk) 02:04, 30 April 2012 (UTC)[reply]

in perl script, regex not recognizing \n, $, /Z

In a perl script, I've been slurping a file, like this:

   open TEXTFILE, "text.txt";
   $content = <TEXTFILE>;                        # slurp text.txt into variable
   close(OUTLINE);

When I use regex to match or substitute within $content, the script simply does not recognize new line characters (\n) or the end of a line.

For example, this does not work:

   $content =~ s/\n\n/\n/;

What it going on? The Transhumanist 02:14, 29 April 2012 (UTC)[reply]

Enable multi-line mode with the flag "m". Also, maybe the file was written on a system that uses \r, see Newline for more information. --LoStrangolatore (talk) 03:28, 29 April 2012 (UTC)[reply]
The /m and /s modifiers only affect the behavior of the . ^ $ characters, none of which appear in this regular expression.
The code fragment you posted will read only the first line from the file, so \n\n will never match. If you slurp the whole file, your substitution will affect only the first appearance of \n\n; if you want to match all of them you need the /g modifier. Also, if you want to collapse any number of consecutive newline characters, you should match \n+ instead of \n\n. Otherwise four newlines will collapse to two. You can slurp the whole file with this weird idiom: $content = do { local $/; <TEXTFILE> };. -- BenRG (talk) 09:14, 29 April 2012 (UTC)[reply]
Two things. First, like Ben says, you're not slurping the whole file, just the first line. Do the local trick with $/ or, more simply, just undef $/;. Second, add the g flag to your regex. Your regex is only doing a single substitution right now, g will make it do it infinitely. Shadowjams (talk) 22:56, 29 April 2012 (UTC)[reply]

Bad network topology question

So I'm watching a sllllloowwww progress bar fill up and am idly wondering what would happen if I were to set up the following:

Wireless router A is connected, wirelessly, to computers B and C, which are both Windows 7 boxes (if it matters). B and C have gotten their IP addresses from router A. I plug in an Ethernet cable from computer B to switch D, and another Ethernet cable from switch D to computer C.

Is the Ethernet cabling just ignored in this case?

What if switch D were a router with DHCP instead of a switch? Would the computers both attempt to get IP addresses for each of their two network connections? What would occur in the case of a file copy from B to C?

Thanks - Comet Tuttle (talk) 04:00, 29 April 2012 (UTC)[reply]

To answer your first question, the wired interfaces of the computers should each be assigned an APIPA address starting with 169.254. The wireless interfaces would each have a private address (often starting with 192.168) given to them by the router. They could use the APIPA address assigned to the wired interface to share files among the computers. It would be useless for anything else except perhaps Internet Connection Sharing, which would be pointless in this case since they both already have a wireless connection to an Internet gateway. The private addresses starting with 192.168 would be used to connect to the Internet, although they can be used to share files locally, as well.
To answer the second question, the computers would have both a wired and wireless IP address, but they would default to sending data over the fastest connection. Wired connections are usually faster than wireless ones, so the wireless IP address would be unused but allocated to each computer nonetheless. See the following page for information about interface metrics in Windows: [4].—Best Dog Ever (talk) 04:46, 29 April 2012 (UTC)[reply]
OK, thanks. Comet Tuttle (talk) 00:49, 30 April 2012 (UTC)[reply]
I had a senario where two devices were configured to give out DHCP on a network, the two computers, in your case B+C both got the same IP address, A gave an IP do B and D gave an IP to C. This caused issues on the network. I would always have just one device configuring DHCP addresses to avoid any issues. MrLittleIrish (talk) © 10:11, 30 April 2012 (UTC)[reply]

April 30

Screen anti-burn-in app ?

I had an idea for an app that could be used to counter screen burn-in on a computer monitor:

1) Establish a link between a cell phone with a video camera and the PC or TV in question.

2) Have the monitor fire each pixel in turn and record it's brightness on the cell phone. This would require a very good camera.

3) Once it has the map of the relative brightness of each pixel (or relative brightness of the RGB components of that pixel), it could then compensate by variably changing the brightness of each pixel in each displayed image. I'm not sure if any graphics card or TV could currently support tweaking each pixel like this, though.

So, is this an idea for the future, perhaps ? It sure would be nice to be able to fix expensive monitors and TVs up, so they are as good as new. StuRat (talk) 00:08, 30 April 2012 (UTC)[reply]

It strikes me, as a non-engineer, that it would require not only a good camera, but really quite controlled conditions for step 2 to work correctly. It doesn't sound like the kind of thing that would be doable by your average television owner unless it was something that was literally strapped to the television and came with its own light source. In the long term I would bet on pixels that don't burn out or are cheap to replace, not repair, but that's just my sense of the trends. --Mr.98 (talk) 00:41, 30 April 2012 (UTC)[reply]
I'm not talking about burnt-out pixels, as there's nothing to be done for them. I'm talking about dimmer pixels. This happened on old CRTs, but also can happen with other technologies. For example, I have various vertical stripes visible on my LCD monitor, which probably has to do with an uneven back-light. StuRat (talk) 00:52, 30 April 2012 (UTC)[reply]
The problem that I can see is that even at full brightness, the burned in pixels will still be dimmer then non burned in pixels. So at best you'll have half a temporary solution if the scene is dark by "overdriving" the burned in pixels, which will also most likely contribute to their even quicker and more substantial demise. Vespine (talk) 01:36, 30 April 2012 (UTC)[reply]
The current thinking seems to lean towards avoiding the problem in the first place. I can see no theoretical reason why your idea would not work (though there would have to be some interactive calibration to ensure that the correct pixels were identified). The problem as I see it is that the control software would have to be built in to the display driver, and this would be very expensive unless it became an international standard. Dbfirs 07:29, 30 April 2012 (UTC)[reply]
Professional imaging monitors, like these Eizo ColorEdge, are factory calibrated and come with equipment for field recalibration. They are expensive compared to consumer-grade monitors or televisions. On their website,myou can see camera-based calibration, and this brochure illustrates the field calibration process. Nimur (talk) 15:59, 30 April 2012 (UTC)[reply]

Windows Movie Maker and MP3s

I am making a video with WMM and importing music to use. I want to use some MP3 files I bought on Amazon.com, but when I try to import them into the project it claims they are corrupted or not supported. WMM supports MP3s, and the files are not corrupted. All my tunes from CDs that I use do not do this. What is the cause and solution? 75.73.226.36 (talk) 02:23, 30 April 2012 (UTC)[reply]

I found a couple of forum posts that suggest converting to WMA before importing into WMM: [5] and [6] RudolfRed (talk) 03:14, 30 April 2012 (UTC)[reply]
It could be that your mp3's are variable bit-rate (VBR) and this is not supported by Moviemaker. You could export them as wav files from your player to use them. Zzubnik (talk) 12:34, 30 April 2012 (UTC)[reply]
I think that's it. According to Amazon, the MP3s are variable bit rate ("when possible"). I found that here: [7]. RudolfRed (talk) 17:17, 30 April 2012 (UTC)[reply]

Why does the IT department need BRMs - are they "worse" than other departments?

Someone pointed out to me that the IT department is the only department in most companies that needs Business Relationship Managers to align its work to the business. On thinking about this, other departments such as Legal, Accounts, etc. are just as capable of talking Jargon among themselves but have no difficulty communicating with the business, ensuring that they are working with the business, guiding the business, and even telling them "no that can't be done". Why is the IT department an exception? Is it to do with the perceptions of the business, some unique relationship between IT and business, or some inability to communicate in IT departments and staff? -- Q Chris (talk) 11:02, 30 April 2012 (UTC)[reply]

The IT department operates differently than many other departments. While Legal, Accounts, Sales, etc will operate on a normal schedule facilitating communication, IT and maintenance need to be running 24/7. Additionally, other departments are designed to work together with information flowing from one department to another in a scheduled manner. IT on the other hand is a department serving the rest of the company. They are on call for any needs that need to be addressed. This leads to IT operating much like a small company inside the larger one. 206.131.39.6 (talk) 15:28, 30 April 2012 (UTC)[reply]
Thanks, that makes sense. I suppose it is like a supplier representative for an external supplier. -- Q Chris (talk) 18:18, 30 April 2012 (UTC)[reply]
I'm reminded of the sitcom The IT Crowd where the computer nerds are incapable of communicating with anyone without insulting them. StuRat (talk) 19:27, 30 April 2012 (UTC) [reply]

Boot Linux from RAM

Is it true that with the following procedure, is is possible to have any distro run entirely in RAM?

  1. create a tmpfs
  2. copy everything under / into the tmpfs
  3. and then execute chroot, or umounts the old filesystem + mounts the tmpfs as /.

Can you confirm this, or I'm missing something? --151.75.46.87 (talk) 12:44, 30 April 2012 (UTC)[reply]

In addition to chroot (which affects the file system), you'd also need the kernel to jump out to the newly updated kernel. This is not a feature of Linux. However, some enthusiasts have created Ksplice, which can be configured to perform something similar to this task (with significant limitations). This can fail for many reasons, and is only designed to splice certain parts of the kernel, but it has been successfully integrated into many versions of free and commercial Linux, including Ubuntu. Nimur (talk) 14:03, 30 April 2012 (UTC)[reply]
Ok, and what about booting from RAM? I know that there are some distros which are configured to boot from RAM automatically, like these ones, but can this be done with any distro, for example by providing an additional login script or such? --151.75.101.147 (talk) 14:10, 30 April 2012 (UTC)[reply]
As I mentioned, Linux does not include any ability for Linux kernel to arbitrarily jump to a different kernel (and, presumably, never to return). Nothing stops you from hacking up some type of kernel module that could do so - after all, Linux is open-source and free software; and a kmod can be dynamically loaded, and still execute in kernel space.. However, kernel modules that execute arbitrary code and steal control from the kernel are categorically defined as either "malware," "security flaws," or just "buggy." As far as "booting from RAM," we're essentially getting into semantics. What does "boot" mean to you? It means something very specific to Linux; and to most peripheral device drivers; so it's moot to talk of "booting" if those peripherals are already initialized. Nimur (talk) 14:18, 30 April 2012 (UTC)[reply]
I'd recommend you read up on, for example, Project Athena, a free and open source software methodology for running Linux and other *nixes, generally in large institutions like universities. The techniques used there - like networking your home and application directories - probably get you 99% of the things you actually care about, (like sandboxing, and being agnostic of what's actually on the machine's hard disk drive) without the hard technical details of actually jumping out of the kernel. Or, consider running a virtual machine, which abstracts the problem. Nimur (talk) 14:23, 30 April 2012 (UTC)[reply]
Maybe I should clarify that my question is related to this article. With Puppy Linux I can umount the medium after boot. However, I'm not able to figure out what kind of technique it uses. But I guess that, whatever it is, it could be applied to any other distro, in principle. So I can't understand why the sentence "Technically, other distributions can be made to boot from RAM as well" is marked as "citation needed". Hence my question. --151.75.101.147 (talk) 14:46, 30 April 2012 (UTC)[reply]
Aha! This clarification helps me understand your question. "Technically," "any" distribution could do anything, so this all-encompassing statement is false. I could build a variant of Linux that queries its boot medium every few microseconds - so it'd require the boot volume to remain present. Puppy Linux, Knoppix, and many similar distributions, have been carefully designed so that they don't require the boot volume - which is the exception, not the norm. Strictly, the Linux kernel itself tends to be pretty small; the kernel can live in RAM on many very-resource-constrained platforms. The peripherals: device drivers, user programs, resources like sound-effects and animations - all of these tend to balloon the system to a larger image, which must either be resident in memory, or accessible from a file system. Many distributions contain so much stuff - not just silly bloated resources, but even system stuff - things like redundant and failsafe copies of graphics drivers for different types of hardware. Many distributions contain X, and also package full-blown desktop managers like Gnome and KDE - that can be huge depending on what's included. So, to be very clear: technically, some distributions can not unmount their boot volume; they rely on system images larger than the available physical memory of their host machine. Knoppix and Puppy and some others are carefully designed around this constraint; and by ensuring that no program attempts to access data outside of the in-memory image, it is safe to unmount or eject the boot volume. There's no "special technique" for that: it's just a regular unmount of a regular volume once the system has guaranteed that it's finished copying needed data to main memory. Nimur (talk) 15:09, 30 April 2012 (UTC)[reply]
Thank you very much! --151.75.101.147 (talk) 15:22, 30 April 2012 (UTC)[reply]
You wouldn't need to jump into a new kernel, as the Linux kernel isn't paging itself - it runs entirely from RAM. Most distributions actually do the reverse of what you describe during the boot: they run from a completely-RAM filesystem (which is decompressed and mounting during boot: initrd). You could change the root back to a tmpfs after logging in using pivot_root. However, you cannot unmount the original filesystem as long as it still has processes running, as the usermode processes usually _are_ pageable and might want to access their data. I'd figure if you boot into bash instead of init (eg. init=/bin/sh on the kernel's command line), you could set up a tmpfs, pivot_root into it, and exec into a shell or init process on the new filesystem, and then unmount the original FS. The pivot_root manpage goes into a bit more detail on switching root filesystems. Unilynx (talk) 17:07, 30 April 2012 (UTC)[reply]

Nested Scrollbars

My problem is a website where there are pages with scrollable areas within scrollable areas within a scrollable window. It looks the same in IE and Chrome so it is not just a quirk of one browser. Of course I don't know that it will behave the same way for everyone.

Here's an example: http://www.durhamregiontransit.com/durham/index.aspx?CategoryID=92&lang=en-CA

A couple of steps are needed to reach the problem page. On the initial page, set "route #" to "401" (as one example) and click "get your route". On the new page that appears, set "time of day" to "all day" and click "get your schedule". Then you see the actual bus schedule and the multiple scrollbars.

I'm sure that this could be coded differently to avoid all these scrollbars. But for a user of the page, is there a way to drill down and get rid of the outer scrollbars?

Also, I wonder if there are worse examples, ie, more than three sets of scrollbars. Thanks, Wanderer57 (talk) 13:20, 30 April 2012 (UTC)[reply]

In Firefox (and surely others) one can right click on the right "content" frame and pick this_frame->show_only_this_frame, and we get only the content (not the navigation to the top and left). No, it's not a very friendly piece of design. -- Finlay McWalterTalk 13:48, 30 April 2012 (UTC)[reply]

Ubuntu + Windows

I have a double boot system, Windows + Ubuntu. When I try to take a look, under Windows, on the Ubuntu partition, I cannot see anything. Where is the installation? (Ubuntu is working). — Preceding unsigned comment added by OsmanRF34 (talkcontribs) 13:53, 30 April 2012 (UTC)[reply]

Windows supports a far smaller set of file systems than Linux. So you probably have your Ubuntu partition under a f.s. that Windows cannot read. See File_system#File_systems_and_operating_systems and Comparison_of_file_systems#Supporting_operating_systems. A solution (IMO it's not worth unless you *really* need it) would be to reformat the Ubuntu partition as FAT32 and then reinstall Ubuntu, but you would lose the advantages of a modern f.s., for example you would have the fragmentation issue, no journaling, etc. --151.75.101.147 (talk) 14:00, 30 April 2012 (UTC)[reply]
I don't know if you can install Ubuntu on a FAT32 partition, even if it's sure that you can mount FAT32 partitions running it. It's also sure that you can install Ubuntu on a NTFS, however, I don't know if that's a good idea either. XPPaul (talk) 20:01, 30 April 2012 (UTC)[reply]
The absolutely easiest solution is to keep all files you need to access from both windows and ubuntu on the filesystem windows is installed on. --145.94.77.43 (talk) 14:35, 30 April 2012 (UTC)[reply]
Sounds as a good advice. OsmanRF34 (talkcontribs) 14:42, 30 April 2012 (UTC)[reply]
Or create a third partition for your personal data. XPPaul (talk) 20:01, 30 April 2012 (UTC)[reply]
Ubuntu is installed on a NTFS partition, which should be accessible for Windows... — Preceding unsigned comment added by OsmanRF34 (talkcontribs) 14:42, 30 April 2012 (UTC)[reply]

Adblock

I got a new google extension called "Adblock", but is it a scam and is it free?--Deathlaser :  Chat  20:05, 30 April 2012 (UTC)[reply]

There are a couple extensions using the Adblock name for Chrome. Adblock Plus is the official port of the extension of the same name that has been used on Firefox for many years, and it definitely reputable, and free. --LarryMac | Talk 20:39, 30 April 2012 (UTC)[reply]
Note that it's not from Google, but for Google (and many others). XPPaul (talk) 21:03, 30 April 2012 (UTC)[reply]
But is it legal.--Deathlaser :  Chat  21:05, 30 April 2012 (UTC)[reply]
We can't answer that question, since the Reference Desk does not give legal advice. In fact, the question seems to be a tricky one for even legal minds to answer - I found articles arguing both sides: Web ad blocking may not be (entirely) legal and Why ad-blockers, ad-skippers and other user-control technologies are legal. - Cucumber Mike (talk) 21:23, 30 April 2012 (UTC)[reply]
Note that they go after developers of adblocks, not against users. XPPaul (talk) 22:04, 30 April 2012 (UTC)[reply]

Who's censoring this stuff?

I'm having a very hard time trying to download the video at http://upload.wikimedia.org/wikipedia/commons/9/9a/Devoirs_de_vacances.ogv (File:Devoirs de vacances.ogv), some kind of wild French silent film involving nuns, sex, and a pet dog. I keep having the downloads quit in the middle - out of 41 MB, I'm getting 688 kb, 7.5 MB, 3.3 MB, 7.7 MB, 7.7 MB. Because I think I've had trouble with some non-porno OGV files before, I'm not entirely sure someone is messing with my download, but certainly I should find out. To begin with - has anyone heard of some kind of censorship within the U.S. that affects something in the middle of a download, not at the beginning? Wnt (talk) 21:35, 30 April 2012 (UTC)[reply]

Its likely just a corrupt file. Youreallycan 21:54, 30 April 2012 (UTC)[reply]
Corrupt file that stops downloading at different places? Which other people on User talk:Jimbo Wales#Wikipedia's hardcore sex films say they're watching? Wnt (talk) 21:58, 30 April 2012 (UTC)[reply]
I just downloaded it - start it at commons and right click in the video - save video - no problemo - I just had a look - it is likely illegal to posses this in the UK and I have deleted it. Youreallycan 21:59, 30 April 2012 (UTC)[reply]
I'm in the U.S., so hopefully if it's legal for Commons... (and I know there are a bunch of folks stalking Jimbo's page who would have tried to make trouble for Commons if it weren't, but it's pretty clear the Miller Test passes it). Problem is, for me the download fails and I don't know why. Wnt (talk) 22:05, 30 April 2012 (UTC)[reply]
Just follow the steps - start the video and then place your mouse pointer over the video and right click save video - Don't use the download link on the page - that didn't work for me either - Youreallycan 22:07, 30 April 2012 (UTC)[reply]
note - I got it from wikipedia so it must be legal will not protect you in a court of law. - Youreallycan 22:10, 30 April 2012 (UTC)[reply]
I'm not looking for another one of our arguments, but a technical explanation. (Though note 70,000 people have viewed it on Reddit) I right-clicked and hit save on the video just like you did, but with those incomplete downloads as the result. I also gave the direct link above for direct comparison. Wnt (talk) 22:12, 30 April 2012 (UTC)[reply]
Viewing it and possing it are two different things in law. Yes, please lets not argue I am only here chatting and helping - http://commons.wikimedia.org/wiki/File:Devoirs_de_vacances.ogv - are you attempting to download iit from the commons location? - Youreallycan 22:15, 30 April 2012 (UTC)[reply]
Viewing it, and having it at a temp directory somewhere, are the same thing. XPPaul (talk) 22:18, 30 April 2012 (UTC)[reply]
Temp directory ... if its temp then its deleted from there - ... hm ... anyway - I take my Father's expensive lawyers legal advice only and err on the side of caution is a constant theme in his replies. - Youreallycan 22:24, 30 April 2012 (UTC)[reply]
Did you ask your Father's expensive lawyers if it was OK to download strange porn from the Internet? And did they really advise you to take care, to delete the temp files? XPPaul (talk) 22:44, 30 April 2012 (UTC)[reply]
(ec)It all comes down to the link at upload.wikimedia.org, no matter where or how you download it. (Unless you get the Pirate Bay torrent at http://thepiratebay.se/torrent/6466352 , that is - no data yet, though) Wnt (talk) 22:19, 30 April 2012 (UTC) (not sure that's the same thing, though!)[reply]
No idea then - it was easy peasy for me - Youreallycan 22:25, 30 April 2012 (UTC)[reply]