Wikipedia:Reference desk/Archives/Computing/2010 April 14

From Wikipedia, the free encyclopedia
Computing desk
< April 13 << Mar | April | May >> April 15 >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


April 14[edit]

Setting up an external image editor[edit]

I need to change the background of many images from here and would like to use (Windows) IrfanView as the external image editor. Studied the Mediawiki installation instructions extensively, but something is missing. Selected the default external editor on My Preferences, and added this to my monobook.js on the Commons:

 addOnloadHook(function() {
    var editTab = document.getElementById("ca-edit");
    if (!editTab) return;
    var editURL = editTab.getElementsByTagName("a")[0].href;
    addPortletLink("p-cactions", editURL + "&externaledit=true", "EE", "ca-exted", "External editor", "");
 });
 

Whenever I try to edit an image like this, I get the following (index.php) in my text editor and no image.

[Process]
Type=Edit text
Engine=MediaWiki
Script=http://commons.wikimedia.org/w/index.php
Server=http://commons.wikimedia.org
Path=/w
Special namespace=Special

[File] Extension=wiki URL=http://commons.wikimedia.org/w/index.php?title=File:TPSMV1P112.jpg&action=edit&internaledit=true

I am using FF 3.6.3 on Win XP SP3 and frankly, I am lost. Can someone help me through this? Ineuw talk page on en.ws 00:33, 14 April 2010 (UTC)[reply]

Latex: 2 Questions[edit]

  1. How can I force headers, footers and pagenumbers to be displayed on chapter title pages? I'm using report document class and fancyhdr package. I've tried putting \pagestyle{fancy} before and after \chapter{XX}
  2. How can I stop toc and tofigures pages from displaying pagenumbers? I've tried putting \pagestyle{empty} before and after \tableofcontents.

59.93.41.156 (talk) 03:04, 14 April 2010 (UTC)[reply]

I'm not a LaTeX user myself, but a friend of mine suggested checking out http://www.ctan.org/tex-archive/macros/latex/contrib/fancyhdr/fancyhdr.pdf for your first issue, while the second one can be solved with
\pagestyle{fancy}
\fancyhead[L]{}
\fancyhead[R]{}
\fancyhead[C]{}
\fancyfoot[L]{}
\fancyfoot[R]{}
\fancyfoot[C]{}

(according to her, that is). -- 78.43.60.58 (talk) 20:46, 15 April 2010 (UTC)[reply]

Disown child processes without forking[edit]

In POSIX, is there any way for a parent process to disown its children without changing its own pid (as happens if we fork and continue only as the child), or to disown some of its children but not all? NeonMerlin 03:10, 14 April 2010 (UTC)[reply]

No. --Sean 16:04, 14 April 2010 (UTC)[reply]

Python: Filtering with inequalities[edit]

In Python, is there a way to use "filter" with an inequality as the function? More specifically, is there a (very brief) way to use "filter" to pluck, for example, all items less than 5 out of a list? --Lucas Brown 03:46, 14 April 2010 (UTC)[reply]

The lambda keyword is probably as brief as it can get:
newlist = filter(lambda x: x<5, oldlist)
98.226.122.10 (talk) 04:05, 14 April 2010 (UTC)[reply]

Why didn't I think of that? Anyway, that should do nicely--thanks! --Lucas Brown 19:17, 14 April 2010 (UTC)[reply]

Python has list comprehensions --194.197.235.240 (talk) 06:00, 14 April 2010 (UTC)[reply]
...thus: newlist = [x for x in oldlist if x < 5]. Filter is fine if you have a pre-built (and possibly complex) test function, but I think list comprehensions are easier to construct and more intuitive for simple comparisons. Gandalf61 (talk) 14:30, 14 April 2010 (UTC)[reply]

I'm doing stuff with time comparisons, and I've already implemented the process with list comprehensions. --Lucas Brown 19:17, 14 April 2010 (UTC)[reply]

Can using a laptop on a bumpy road damage it?[edit]

My company-issued laptop's hard disk failed this morning. It's a brand known for low-quality and correlation does not imply causation, but still I wonder: these past 2 months I've been using it for programming during the 30 minute company bus rides to and from work. The roads around here are awful, and it's a steady stream of bumps and jitters. How resistant are today's laptops to this sort of thing? It's certainly not a normal working environment, but it's not so bumpy as to prevent me from being productive... 59.46.38.107 (talk) 06:19, 14 April 2010 (UTC)[reply]

I certainly would prefer a solid state drive for that application. StuRat (talk) 06:26, 14 April 2010 (UTC)[reply]
This is the sort of thing that probably affects the mean time to failure; so if you ran hundreds of test cases with laptops in a bus and compared the failure rate to laptops not used in a bumpy bus, you'd probably notice a trend. The extent to which that trend decreases the expected lifetime for a single laptop depends on how severe the mechanical stresses from the bumps are, but it is a real and known effect that shaking reduces the lifetime of a hard-disk drive and increases the chance of catastrophic failure. If you know the laptop make and model, or the hard-disk type, we might be able to dig up some mechanical stress test reports. Also, as StuRat has suggested, a solid-state drive is less likely to fail because of mechanical jostling - and many laptop hard-drives can be replaced with SSDs, so this may be an option if you're concerned. After hard-disks, the next most likely mechanical failure trouble spot for laptops tends to be the monitor backlight or the screen itself. Nimur (talk) 14:28, 14 April 2010 (UTC)[reply]
Rest the laptop on a cushion on your knee (assuming you arnet driveing).--BandUser (talk) 17:29, 14 April 2010 (UTC)[reply]

VBScript and JavaScript[edit]

Is the software to write VBScript and JavaScript applications free? Or is it similar to CSS where you get the basic software free, notepad/notepad++, and then have to pay for more advanced software such as DreamWeaver?

Thanks --195.49.180.89 (talk) 10:57, 14 April 2010 (UTC)[reply]

You can write JavaScript, CSS, and HTML just fine with notepad++, and doing so is a perfectly reasonable way of working. You never need a web development program like DreamWeaver; while some people find such programs easy and productive to use others find them restrictive and the websites they produce amateurish. Large websites are almost always generated by programs that its maintainers have written (using languages like PHP, Java, and Python) rather than built either with a text editor or a website builder like DreamWeaver. If I can suggest one free tool for you, the Firefox extension Firebug allows you to edit and debug everything you've discussed fine, and many other related web creating things to boot. -- Finlay McWalterTalk 12:50, 14 April 2010 (UTC)[reply]
You do not have to pay for DreamWeaver. People choose to purchase DreamWeaver to avoid typing out what they want - and too often to avoid learning HTML, CSS, and JavaScript. I write a lot of JavaScript, CSS, and HTML and have never used anything even similar to DreamWeaver. -- kainaw 12:53, 14 April 2010 (UTC)[reply]
I'm in the same boat but it's worth remembering that this knowledge did not come for free. It takes an immense amount of time to become fluent in HTML, CSS, and Javascript to the point where you can easily read other's code and can easily write your own to accomplish your tasks. If you multiplied that time by even a conservative wage, you're talking a huge amount of money that you've invested in it—far more than the cost of buying a Dreamweaver license. I've had people ask me, "how do I learn these so I can do the same things you can do?" and I really don't have a helpful answer ("play around with it for, I don't know, five years, and by then you'll probably be at the same level I am"). Dreamweaver can be a useful way for people to jump into web design without trying to learn all the basics first, much less learn how the basics of the code interface with their ideas of good design (which is a somewhat different question). I don't use Dreamweaver and have never had the need for it, but I understand that not everybody wants to take the more tedious (and potentially less promising) route, especially if their full-time occupation does not involve web design. Some people honestly do just want to buy their fish a day at a time and not learn how to become a fisherman; I don't think that's necessarily a bad choice depending on their situation. I only wish applications like Dreamweaver and etc. played better with hand-written code. --Mr.98 (talk) 14:25, 14 April 2010 (UTC)[reply]
The notepad approach to web design is long and tedious but you can make anything with it once you are good at it. The Dreamweaver approach is to have a program that abstracts away a lot of the underlying code (but not all of it) in exchange for you getting to design things in a more "visual" fashion. (Instead of typing in the name of the font you want, and changing its size and styling, and then saving and viewing the page in a browser, you can just select the font properties the same way you would in, say, Microsoft Word, and see what that looks like immediately). On a Computing board you are almost universally going to get people who prefer doing it the slow and hard way—it's something of a systemic bias, because that's how self-professed "Computer" people do things. There are advantages to doing it that way—you have better control over what you make, and can do certain tasks a lot quicker, once you know how to do them. And that's the rub: it takes a lot of time to get good at hand-coding things. Dreamweaver and related products let you jump over a lot of the technical stuff, but at the cost of things generally looking less fine-tuned and often with more buggy or problematic code. Suffice to say, you don't need Dreamweaver to do Javascript or CSS or HTML. Most sites are not made with anything like Dreamweaver—they are just hand-coded in notepad or other development products. But it takes a lot of time to learn how to do that well. --Mr.98 (talk) 14:31, 14 April 2010 (UTC)[reply]
My favorite VBScript and JavaScript editor is Visual Studio. There is a free version just for web applications that you can download called Visual Web Developer Express. The code hinting for JS and VBS is much better inside Visual Studio and Visual Web Developer than in Dreamweaver. It's also a bit easier to learn than DW. I use PrimalScript for administration scripts. But you're just writing JS and VBS for web development, try Visual Web Developer.--Chmod 777 (talk) 20:19, 14 April 2010 (UTC)[reply]

Cryptography: Password entry method[edit]

I'm looking for more information on a method of password entry where a user doesn't have to remember an alphanumeric string as a password, instead they remember a pattern. A user picks a pattern from a grid, thus:

1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16

So in this case their password would be 1, 2, 6, 10, 11. The next time they log on they might get:

4 8 3 15
1 13 2 16
14 9 7 12
5 11 10 6

And their password would be 4, 8, 13, 9, 7. Has anyone seen this before? --Rixxin (talk) 12:26, 14 April 2010 (UTC)[reply]

Something similar is mentioned in Password#Alternatives_to_passwords_for_access_control. However, these systems are not very practical.
In this case, the underlying numbers would be irrelevant; the password is still the thing that the person remembers. (It doesn't have any security implications that there's a different format for transmitting it from time to time, because the user and the attacker both get to know what that format is.) I believe that graphical passwords like this aren't used because they don't carry enough information. On a 4x4 grid (assuming order matters), the number of possible length-5 passwords is only about half a million. There are three times as massing length-4 passwords that use only lowercase letters and numbers. Also your example password is contiguous (which makes it a lot easier to remember). There are fewer than 16*4*3*3*3=1728 contiguous length-5 passwords possible, which is an extremely small space.
Essentially, text-based passwords sit in a sweet spot of being possible to remember and reconstruct accurately, while still covering a large possible range.
It is possible to use 2D art to identify objects to humans. If you see a different image than the one you're used to, you know that something is up:
The key fingerprint is:
c6:b1:78:d6:fc:0f:eb:6e:3d:47:0d:4b:f9:c2:9c:0d paul@saffron 
The key's randomart image is:
+--[ RSA 2048]----+
|                 |
|                 |
|        .      . |
|       o =    E  |
|      . S o  + B.|
|       +   .  * =|
|            o. o |
|            .+o .|
|           ++ .o |
+-----------------+
Paul (Stansifer) 14:20, 14 April 2010 (UTC)[reply]
Pull-down menus are used at http://languagetesting.info/mail/email.php. -- Wavelength (talk) 23:18, 14 April 2010 (UTC)[reply]

Internet Connections window crashes[edit]

After a fresh install of WinXP on my rig, I tried to set up an internet connection thru my LAN (as I've done in the past). However, upon attempting to open the network connections window Explorer crashes, and upon attemting the New Connections Wizard it crashes. What the heck is going on? —Jeremy (v^_^v Dittobori) 15:16, 14 April 2010 (UTC)[reply]

Seems to be a problem with the installation. I would suggest reformatting your hard drive and reinstalling the operating system. If possible, try using another Windows XP disc. And when you say windows Explorer crashes are you referring to the explorer.exe process and have you tried rerunning the process? 174.22.229.237 (talk) 22:59, 15 April 2010 (UTC)[reply]

Getting Quicktime onto my Mac[edit]

I've got an iMac which I keep offline, and a PC which is online. The version of Quicktime on my Mac needs updating so I was going to copy over the application file from my PC, which has been recently updated. I assumed this would work. But then I looked at the two 'Quicktime Player' files on both machines and the one on my PC is just 1.7MB and the older one (2007) on my Mac is 24MB. This seems like quite a difference in size and made me think that it's not going to be as easy as just copying the application file over. Any thoughts how I should get a new QT on my Mac? —Preceding unsigned comment added by 91.111.76.107 (talk) 16:19, 14 April 2010 (UTC)[reply]

You would need to copy the Quicktime files from another Mac. The PC's files would be different because they are written and compiled for a Windows environment. Also, with Quicktime on the Mac you are updating several core components of the operating system while on the PC you are updating the player and a few plugins. On OS X, Quicktime components are scattered all over and finding all the files you need to update is no trivial task. Connecting to a network temporarily or downloading the Quicktime installer for Mac from Apple's website would be the way to update. From the PC, go to apple.com/quicktime, find the download link, and find a small link titled "Get QuickTime for Macintosh." Caltsar (talk) 17:14, 14 April 2010 (UTC)[reply]

Linux group root?[edit]

On Linux, is there any way to allow a non-root user to perform actions as root if they only affect his own group? I'm thinking, in particular, of the following commands and corresponding system calls: adduser, deluser, moduser, passwd, chown, chmod, su, sudo, kill, renice +. NeonMerlin 17:11, 14 April 2010 (UTC)[reply]

Those are inherently rooty actions. I wonder if what you really want is virtual servers for the different groups. 66.127.52.47 (talk) 21:31, 14 April 2010 (UTC)[reply]

vpython related error[edit]

window xp is installed on my computer at derive d:vpython was installed on my computer.by deleting some files or otherwise ,it does not work properly.if i uninstall python25 ,and vpython from my computer and then install both first python 25 and vpython on D:\python25 .installation becomes successful but programmes does not work,for examle bounce.py does not work properly by giving this message : raise Runtime Error,"Neither numeric ,nor numarray could not be found." —Preceding unsigned comment added by 119.154.110.243 (talk) 17:21, 14 April 2010 (UTC)[reply]

Python/TI-BASIC: indirections[edit]

TI-BASIC (the dialects of BASIC used on the TI graphing calculators has what they call an "indirection." It work as follows: a be a string (let's say that a="b"), and let x be a variable storing any value (let's say that x=1). Then we can store the contents of x as a variable whose name is the string in a with the command x --> #a--i.e., after executing that command, a variable b would be created (if it didn't already exist) with 1 as its contents.

To take another example, consider the following TI-BASIC code:

:abcde(l)
:Prgm
:Local t, n
:dim(l) --> n
:For t,1,n
:l[t] --> #"a"&str(t)
:EndFor
:EndPrgm

After executing abcde({2,3,5,7,11,13}), the variables a1, a2, a3, a4, a5, and a6 would be created (if they didn't already exist) and a1=2, a2=3, a3=5, a4=7, a5=11, and a6=13. After all that explanation, my actual question is rather disappointingly short: is there a similar feature in Python? --Lucas Brown 20:33, 14 April 2010 (UTC)[reply]

You can do something like that by monkeying with the globals() dict, but it's generally not a good idea, and doesn't work for locals() at all. Just using a regular dict is usually the way to go.
Python 2.6.4 (r264:75706, Dec  7 2009, 18:45:15)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> a = 'b'
>>> x = 1
>>> globals()[a] = x
>>> b
1

Winston365 (talk) 21:25, 14 April 2010 (UTC)[reply]

What you probably want are arrays, if you are interested in storing things by number, or dicts (called hash tables in other languages), if you're interested in storing things by name:
arr = [2,3,5,7,11,13]
#after this, arr[0] equals 2, arr[1] equals 3, and so on.
dt = {'wp': 'wikipedia.org', 'gg': 'google.com'}
#after this, dt['wp'] equals 'wikipedia.org', etc.
The # operator in TI-BASIC is an example of reflection. Reflection is very powerful, but (a) it's almost always possible to do what you want without reflection, and (b) it makes it very unclear what you're doing. I seem to remember (I last programmed in TI-BASIC a long time ago) that TI-BASIC was weird in that you sometimes needed # to do some things. Paul (Stansifer) 01:17, 15 April 2010 (UTC)[reply]
TI-BASIC is pretty weird... But you don't need the # to do some things. They can be done other ways, but # has a way of making some processes a lot simpler to write. --Lucas Brown 21:15, 18 April 2010 (UTC)[reply]
Replace "almost always" with always, as long as your remaining language is still Turing-complete. Of course it may be a lot more complex without reflection. --Stephan Schulz (talk) 12:37, 16 April 2010 (UTC)[reply]

Thanks for the help! --Lucas Brown 21:15, 18 April 2010 (UTC)[reply]

Purchasing a Motherboard[edit]

Before purchasing a motherboard what should be known to make a decision? I know the question isn't very specific but I would like to know what motherboard details I should be researching before I decide to purchase a motherboard. (Sorry if this question was asked before I could not find a similar question in the archives.) 174.22.229.237 (talk) 21:11, 14 April 2010 (UTC)[reply]

What kind of CPU do you want to plug in? This will narrow your choice. What size will fit in your case? How much memory, disk drive connectors, slots, USB, firewire (maximum growth potential)? Memory technology? Do you want built in video or sound, or will you supply your own cards? Graeme Bartlett (talk) 21:24, 14 April 2010 (UTC)[reply]
I agree on all counts with Graeme Bartlett, and would add customer support as a criterion. How quickly do they respond to e-mail requests for help? At least one motherboard manufacturer has a terrible reputation in this area. (Maybe all of them do, for all I know.) Another issue that may be something for you to consider is how much overclocking support the motherboard features. Comet Tuttle (talk) 21:34, 14 April 2010 (UTC)[reply]
Hang out on a site like anandtech.com for a while and get a sense of what brands are good and bad. For a low end system, building up from a motherboard instead of getting a mini all-in-one isn't really worth it any more. For higher end, you have to have a sense of what features you want, since boards go off in different directions. 66.127.52.47 (talk) 21:35, 14 April 2010 (UTC)[reply]

[edit]

File:Misplaced WP logo.jpg

My WP logo is covering the article names. Why doesn't the WP logo appear in its correct location?--478jjjz (talk) 21:44, 14 April 2010 (UTC)[reply]

Does this happen when you're logged out? Does it happen when you're logged in, but using a different browser (Firefox, Chrome, Safari, Opera)? Does it happen when you're logged in on a different computer? -- Finlay McWalterTalk 21:51, 14 April 2010 (UTC)[reply]
Internet explorer is a poor excuse for a browser. There is probably some incompatible .css being used by Wikipedia that every browser except IE can handle. 82.43.89.71 (talk) 21:55, 14 April 2010 (UTC)[reply]
I am using Internet Explorer 8; my OS is Windows Vista. This happens on my computer whether I am logged in or out of Wikipedia. I don't like using other Web browsers.--478jjjz (talk) 21:58, 14 April 2010 (UTC)[reply]
Does anyone have a solution that doesn't involve stopping the use of Internet Explorer 8?--478jjjz (talk) 23:04, 14 April 2010 (UTC)[reply]
I didn't suggest you stop using IE. I asked you to see what happens on another browser. I asked you to try another machine. You may have a wonky toolbar installed in IE, or an odd security setting (a firewall or adblocker or something) on that machine. -- Finlay McWalterTalk 23:14, 14 April 2010 (UTC)[reply]
Do you see that button to the right of the address bar? It looks like a piece of paper that's been torn in half. Press that button and it should reload the page in "Compatability mode." (If you don't know what I mean by address bar, I'm referring to the box with the address of the web page your visiting. It's near the top of the screen above the Google toolbar.)--Chmod 777 (talk) 23:11, 14 April 2010 (UTC)[reply]
I followed your instructions and my problem has been resolved. Thank you very much.--478jjjz (talk) 23:15, 14 April 2010 (UTC)[reply]

Pings[edit]

If I ping a server every 10 seconds for an extended period, say for example google.com or wikipedia.org, will the server admins get angry over that? Will it cause any problems for them / would they implement countermeasures to stop the pings? Could I get in trouble for it? 82.43.89.71 (talk) 21:54, 14 April 2010 (UTC)[reply]

Google.com and Wikipedia.org are made up of many different servers. It's not a one-server-per-domain setup. People perform 34,000 searches on Google per second, so I sincerely doubt they would notice a single ping every ten seconds. You would need perhaps 20 different computers all pinging Google once every 100 milliseconds or so to take down a single Google or Wikipedia server. Even if their intrusion-detection system generated an alert, I doubt the admins would care. And even if they cared, they'd probably just move on, because server admins are very busy people.--Chmod 777 (talk) 22:29, 14 April 2010 (UTC)[reply]
Thank you
Really just 20 in "20 different computers all pinging Google once every 100 milliseconds or so to take down a single Google or Wikipedia server"? I'd think a single server could handle more like 20,000 such simple pings per second. How did you arrive at the "20" figure? 84.153.207.171 (talk) 11:49, 15 April 2010 (UTC)[reply]
This is how I arrived at the figure. And you? How did you arrive at the 20,000 figure?--Chmod 777 (talk) 17:55, 15 April 2010 (UTC)[reply]
You could get autoblocked by an IDS system without any human admins ever knowing or caring. A ping every 10 seconds might not trigger such a thing, but a high volume flood would be taken as a denial of service attack or click fraud and provoke an automated response. That probably happens 1000's of times a day on a site like Google. 66.127.52.47 (talk) 02:12, 16 April 2010 (UTC)[reply]
Exactly - you would need massive amounts of packets in a very short time before anyone would consider it a Ping flood. In most cases, there are simple scripts on the server (like DDoS deflate) that stop this. Simply put, it monitors incoming request, and if it is determined to be excessive, your IP will simply be blocked automatically, usually for a short term. Beyond this, there is no need for human intervention. Avicennasis @ 16:44, 16 April 2010 (UTC)[reply]

Download games on iPad?[edit]

I was wondering if you can download games from online on the iPad and play them? —Preceding unsigned comment added by Toon1334 (talkcontribs) 22:44, 14 April 2010 (UTC)[reply]

Only those sold/distributed through the App Store and need to individually be approved by Apple for content. You can't just download any game off the internet and run it on the iPad. The iPad also does not support Flash games unless they are compiled specially for the iPad and distributed via the App Store. It's a much more constrained application environment than a personal computer (regular Macs do not put any such restrictions on you and you can run whatever you want on them). But about the same as an iPhone. --Mr.98 (talk) 00:26, 15 April 2010 (UTC)[reply]