Wikipedia:Reference desk/Archives/Computing/2008 November 6

Computing desk
< November 5 << Oct | November | Dec >> November 7 >
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.


November 6

edit

OS X Binds

edit

How can you bind a key to do a certian action in OS X? For example, I want to find the F13 key to switch kanas on my computer. Or even do expose. Do I need to use the terminal (which im fine with)? Is their some program that can do this? --Randoman412 (talk) 00:25, 6 November 2008 (UTC)[reply]

Go to System Preferences and click on "Exposé & Spaces." In the exposé tab things should be there. If you're on Tiger and not Leopard, then the procedure is very similar. Mac Davis (talk) 23:21, 10 November 2008 (UTC)[reply]

TIGCC and C programming

edit

I am trying to write a program in C in TIGCC for my TI-89 Titanium, but I do not know how do implement lists in C. My program can be found on my userpage. How would I modify the program to properly handle the list? There are also some other problems with it, such as the DelVar function, indicating that the variable l should be deleted, and the Pause function, indicating that the program should pause there until the user presses the "Enter" button. How should these be fixed? Lucas Brown (talk) 03:17, 6 November 2008 (UTC)[reply]

I'm working on this. I've only done TI BASIC development before, so I had to get all set up. But I think I have an idea of where you went wrong. Superm401 - Talk 06:04, 14 November 2008 (UTC)[reply]
Okay, I made some progress, but I got bogged down by compiler problems (functions that seemed documented mysteriously weren't on my system). If you want to implement actual TI lists, then do something like:
push_END_TAG();
short i;
for(i = 10; i > 0; i--)
{
    push_shortint(i);
}
push_LIST_TAG();

Then, to read the list back

short sum = 0;
float cur;
	
ESI pos = next_expression_index(top_estack);
while((*pos) != END_TAG)
{
    //estack_to_short(pos, &cur);
    sum += cur;
    pos = next_expression_index(pos);
}

estack_to_short should work because i's defined at http://tigcc.ticalc.org/doc/estack.html#estack_to_short. However, it does not... If you don't need to use TI lists, just use a C array. The DelVar also requires specifying the variable to delete on the expression stack. See http://tigcc.ticalc.org/doc/bascmd.html#cmd_delvar . For DrawStr, do:

DrawStr(1,1,"x", A_NORMAL);

Finally, for pause use ngetchx();, which will block until the user hits a key. Superm401 - Talk 06:31, 15 November 2008 (UTC)[reply]

Turing test judging as a Turing test

edit

Can the ability to accurately judge Turing tests be itself used as a Turing test? NeonMerlin 03:20, 6 November 2008 (UTC)[reply]

Well, I suppose so. Maybe. That might be missing the point of the Turing test a little, because the judge is not only supposed to try to tell whether he's communicating with a person or a piece of software. The process of that determination is also pretty important: the software needs to convince the judge by displaying human behavior. The judge uses an inherently subjective set of criteria for the test; that's kind of the point. Merely being able to analyze the responses in some other way wouldn't do. -- Captain Disdain (talk) 05:33, 6 November 2008 (UTC)[reply]

NO. If you try to use the ability to judge a Turing test as a Turing test then my program,

 print "JUDGMENT: Program being tested has FAILED the Turing test."

Would be correct for the foreseeable present (since we have no programs able to pass the Turing test) which is a contradiction. —Preceding unsigned comment added by 82.124.214.224 (talk) 05:55, 6 November 2008 (UTC)[reply]

No it wouldn't. Your program would fail whenever the thing it was testing was actually a human. Algebraist 10:31, 6 November 2008 (UTC)[reply]
  • What you're referring to is known as a Reverse Turing test, and there is quite a bit of literature on the subject. So technically, yes - it has been proposed (and tried), and could serve as a type of Turing Test, where "Turing Test" is read to mean "Behavioral (or functional) test for intelligence". However, it does tend to be open to most of the same arguments that are used against the Turing Test, and personally I'd argue that it is likely to be simpler to achieve, and thus less convincing. :) - Bilby (talk) 10:42, 6 November 2008 (UTC)[reply]
I think it's possible for a non-intelligent program to administer a Turing test and judge the results with a high degree of accuracy. Most programs that attempt to pass the test are easily tripped up by asking questions that simply require more knowledge than a piece of software is likely to have. "How many dwarves were there in that classic cartoon...er..not "Cinderella" - the other one with the cute chick in the long dress?"...the difficulty of answering questions like that is a really major reason why the Turing test is so tough. So all a program has to do is to store a list of such questions - to ask them and to see how many come back with some kind of reasonable answer. I suspect that simple statistical measurements would work pretty well too. Heck - we have software that can tell the difference between Spam and real eMail fairly accurately - I think telling a 'bot from a human should be about as easy. SteveBaker (talk) 14:38, 6 November 2008 (UTC)[reply]
Actually, on this topic, a CAPTCHA is a turing test - it administers a question ("What are the letters in this picture?") that can presumably only be answered by a human, and then determines whether someone is a human or not based on their response. - Bilby (talk) 14:54, 6 November 2008 (UTC)[reply]

Connection problem

edit

My pc is using a linksys wireless usb adapter to connect online. I have a good signal and am connected, but when if i open IE or firefox, I get a page load error. I think this is a settings issue, but I'm not sure what to do. BTW, the pc is running windows xp.24.9.157.26 (talk) 04:02, 6 November 2008 (UTC)[reply]

nevermind. i figured it out.97.118.254.230 (talk) 04:23, 6 November 2008 (UTC)[reply]

Firefox problem

edit
 
Firefox problem

I just started up and seem to have some sort of FF problem. Basically I'm getting the problem shown on the right across the top of all web pages and not just Wikipedia. I haven't installed any new or updated add-ons since shutting down FF and I have also tried disabling all the add-ons but that does not help. Not noticable in the picture but the address bar is blank for every page and entering text in there works but it's not visible. Any suggestions? CambridgeBayWeather Have a gorilla 05:09, 6 November 2008 (UTC)[reply]

maybe you should donate, like everyone else who wants to get rid of that effect? —Preceding unsigned comment added by 82.124.214.224 (talk) 05:39, 6 November 2008 (UTC)[reply]
This has nothing to do with the donation bar. The problem appears across all web pages, Google, Youtube, Firefox error pages, and not just at Wikipedia, as I pointed out. CambridgeBayWeather Have a gorilla 05:50, 6 November 2008 (UTC)[reply]
Ah, problem solved using brute force. Reinstalled FF. All is good with the world again. CambridgeBayWeather Have a gorilla 06:11, 6 November 2008 (UTC)[reply]
If anyone else has this problem, the run-on effect shown in the picture is caused by a style sheet that contains * { display: inline; }. Firefox allows user-created style sheets to modify how websites look and how the Firefox interface looks. You can search online for userContent.css and userChrome.css for more information. You can edit or delete those files to correct the problem. --Bavi H (talk) 03:23, 7 November 2008 (UTC)[reply]
Just curious but what would cause it? I hadn't changed anything and it just started like that. CambridgeBayWeather Have a gorilla 04:08, 7 November 2008 (UTC)[reply]
A corrupt installation, probably. Ale_Jrbtalk 22:21, 7 November 2008 (UTC)[reply]
I can only guess some program or person created malicious or faulty userContent.css and userChrome.css files in the correct place. I recognized that run-on effect from experimenting with style sheets in the past, and since the effect was happening on all pages, I suspected a browser-wide style sheet was in effect.
Playing around with it just now, I was also able to make Firefox's address box text white (and thus invisible unless selected) by putting #urlbar * * { color: white; } in the userChrome.css file. So this further suggests it's possible your problems were caused by these style sheets.
In any case, if it ever happens again, you can might see if the userContent.css and userChrome.css files exist and if there are any clues in them as to the possible source. --Bavi H (talk) 03:20, 8 November 2008 (UTC)[reply]
Ah, I just remembered, chkdsk ran on that reboot so it's possible that it did something that caused it. Thanks for the replies. CambridgeBayWeather Have a gorilla 09:48, 8 November 2008 (UTC)[reply]

Rapidshare

edit

How can you browse through the whole library of files on Rapidshare? 121.219.2.201 (talk) 06:43, 6 November 2008 (UTC)[reply]

unfortunately I remember seeing on their faq that for privacy reasons it is impossible to browse or search the files. you have to find someone linking to them. —Preceding unsigned comment added by 82.124.214.224 (talk) 07:19, 6 November 2008 (UTC)[reply]
You can't browse rapidshare directly, but there are several sites which index rapidshare links from across the web. Some good ones are rapidshare-search-engine.com, rapidshare1.com, loadingvault.com and 4chan's /rs/ board. SN0WKITT3N 12:53, 7 November 2008 (UTC)[reply]

Yahoo

edit

Some downloads on Yahoo require that you first install Yahoo Tools. I have installed that, but the downloads still do not work. Why? 121.219.2.201 (talk) 06:43, 6 November 2008 (UTC)[reply]

Some secure pages: Use of Back-button = 'page expired'...Why?

edit

Re: above. I've heard it is a 'security' reason, but I was just interested to understand what additional security was provided by this? I guess it is incase you left the screen without closing IE and someone could then come to explorer, click back and get to a secure site you were using, but that could be prevented by a few simple measures (e.g. only expire if the page they are navigating from isn't part of the site, or prompt a re-request for the password). It's most frustrating and beyond what I noted I can't think of any security benefit. Anybody aware of anything more? 194.221.133.226 (talk) 09:09, 6 November 2008 (UTC)[reply]

Two words: Lazy programmer ... Kushal (talk) 10:38, 6 November 2008 (UTC)[reply]
If you do online shopping, sometimes using the back button will place a duplicate order. That's kinda bad if it's a $2,000 pinball machine (yes this happened to me...$4,000 on a credit card is a bad thing...) 31306D696E6E69636B6D (talk) 14:13, 6 November 2008 (UTC)[reply]
In the Opera browser, the back button always works. 81.200.82.2 (talk) 18:00, 6 November 2008 (UTC)[reply]
Well I think that, when you click Back, the browser would either have to (1) remember the state of the page, which involves keeping this page and its state in memory, for all previous pages, which would be a memory drain; or (2) reload the page again, in which case the site might get confused why you are make the request for the previous page again, when its session info or whatever says that you have already navigated onto the next one. --71.106.183.17 (talk) 18:23, 6 November 2008 (UTC)[reply]
Couldn't the browser keep the information on the state of the page in the hard disk swap? Surely, it takes longer to access it but it is a worthwhile thing. And I still stand by my original words: either the website should provide a way to go back and forth in the page itself or work with the navigation buttons in the browser. Kushal (talk) 10:52, 7 November 2008 (UTC)[reply]
I think the entire point is to avoid having the page be accessible through history files, duh. Relying on the hard disk swap is not very secure, especially if you are on a public computer. I don't think it is "laziness" that is at fault here. There are multiple ways to make pages rigorously secure, some of which are incompatible with allowing forward and back working. Here's a blog post about one of the more obscure exploits one can do and the sorts of things one must do if one is writing a site in which you are making sure this is not a possibility. I'd be surprised if that particular solution worked with forward and back buttons. Is it overkill? Is the trade-off in convenience-for-security done correctly? I don't know. One could reason different ways on it. But laziness doesn't come into play as a factor, at least not in the way you mean it. --98.217.8.46 (talk) 22:26, 8 November 2008 (UTC)[reply]
Unfortunately, the decision of whether to expire the page must be made when the page is originally transmitted, not when you attempt to return to it. This means you cannot decide "on the fly" to expire the page if the user is returning from outside your secure area. As a site creator, you are severely limited in how you can choose to expire your pages. Even setting a value such as "1 hour" leaves a sizable window and can lead to more security problems if the machine's clock can be tampered with. Dynamic content is another good example of a page that should be expired immediately. (Would you really want your browser displaying hours-old stock quotes?) Add in the fact that websites like to track user sessions (impossible if the web browser simply displays an unexpired cached copy of the page) and there are several compelling reasons to expire all "secure" pages immediately. As noted above, the Opera browser tends to ignore expiration requests when you return to pages using the back button; you might want to try it and see if that behavior is more useful to you--just be sure to close the browser if you don't want somebody returning to see your secure pages.

More Program Help

edit

yes...well the batch file listed in Program Help question (see Program Help above) didn't work. But i did find out how to do it in Visual Basic 2005! Here's the rough code for my program. PS: the Process1.Start command starts the process ssstars.scr PPS: the EventLog1.WriteEntry command writes the listed string to the Application Event log.

Public Class Form1
    Private Sub Button1_Click (system inserted stuff)
         Process1.Start()
         If Process1.HasExited() Then
             EventLog1.WriteEntry("Screen Saver exited at the listed time and date.")
             Application.Exit()
         End If
    End Sub
End Class

For some reason, the Process1.HasExited() command will not acknowledge that ssstars.scr has exited; therefore, the event log is not written to and the form will not exit. What am i doing wrong? 31306D696E6E69636B6D (talk) 14:05, 6 November 2008 (UTC)[reply]

You need to check for exit until the process has actually exited, not only once right after it was started. Try replacing if with while. This approach is called busy waiting and generally the easiest but also worst method. —Preceding unsigned comment added by 84.187.64.186 (talk) 16:34, 6 November 2008 (UTC)[reply]

How would i do that? 31306D696E6E69636B6D (talk) 17:00, 6 November 2008 (UTC) Never mind...i got it to work right. Thanks! 31306D696E6E69636B6D (talk) 17:16, 6 November 2008 (UTC)[reply]

I'm pretty sure the Process class has an event called Exited or something. Use that. --wj32 t/c 06:46, 7 November 2008 (UTC)[reply]

Collaboration in MS Excel. How?

edit
  Resolved

I have Excel 2003 in a small office network. How can I work with the same document from different computers simultaneously, without "read-only" mode? When I open the file on one computer, I can open it on another one only as "read-only". I know this is possible, but I don't know how. I don't have Sharepoint. Please help me! 81.200.82.2 (talk) 17:55, 6 November 2008 (UTC)[reply]

Why do you claim to "know this is possible"? Ever since the very first version of Excel, I've never seen it have the ability to allow two users to edit the same spreadsheet at the same time. Perhaps you are thinking of Access. -- kainaw 18:27, 6 November 2008 (UTC)[reply]
Because I've seen it. In Excel. 0xFFFF (talk) 20:33, 6 November 2008 (UTC)[reply]
Hello, found this - any good? And here from MS --3sJJ0Itf (talk) 20:46, 6 November 2008 (UTC)[reply]
Turn on 'share workbook' (tools > share-workbook) it's not quite perfect but does the job of allowing multiple users in one excel spreadsheet. 194.221.133.226 (talk) 09:51, 7 November 2008 (UTC)[reply]
Thank you, 3sJJ0Itf and 194.221.133.226! That's exactly the option I was looking for. 0xFFFF (talk) 13:53, 7 November 2008 (UTC)[reply]

PHP Directory Listing Woes

edit
  Resolved

Hi Guys,

I have the following code, meant to list specific files in a directory (documents);

 <?php
$dir = dir(".");
$text = "";
$class = "";

	//List files in images directory
	while (($file = $dir->read()) !== false) {
			 if (preg_match('/\w+\.\w+/i',$file) && ($file != 'index.php')) {
			 	if (preg_match('/\w+\.doc.?$/i',$file)) { 
					$class = 'word'; 
				}
				if (preg_match('/\w+\.xls.?$/i',$file)) { 
					$class = 'excel'; 
				}
				if (preg_match('/\w+\.pdf$/i',$file)) { 
					$class = 'pdf'; 
				}
			 		echo "<span class='" . $class . "'><a href='" . 

$file . "'>" . $file . "</a></span><br />";
			 }
	}
	$dir->close();

?>

It works fine and all, but please help me understand why certain file names, specifically ones with parenthesis "()" dont get listed, and how to get around it.

Thanks in advance PrinzPH (talk) 20:22, 6 November 2008 (UTC)[reply]

Your preg_match() calls all require that the file name contain a period and that the characters adjacent to some period be word characters (which probably means alphanumerics). --Tardis (talk) 22:34, 6 November 2008 (UTC)[reply]
If you're not comfortable with regular expressions, I'd recommend doing something a little easier to follow if you're trying to have control over listing directories, e.g. something like this, which will load files and directories into an array (which can then be sorted, printed, whatever):
<?php
	$self = $_SERVER['PHP_SELF'];
	$self = substr($self, strrpos($self,"/")+1);
	$filelist=array();
	$dirlist=array();

	if ($dh = opendir(".")) {
	    while (($file = readdir($dh)) !== false) {
			if(filetype($file)=="file") {
				if($file!=$self) { 
					 $filelist[] = $file;
				};
			} else if(filetype($file)=="dir") {
				if($file!=".") {
					if($file!="..") {
						$dirlist[]=$file;
					};
				};
			}
	    }
	    closedir($dh);
	}
?>
The above code will leave you with two arrays full of files. The only things filtered out are the listing file itself and relative directories ("." and ".."). You could easily modify the nested IF statements to not include other types, or to check the extension of the files if you wanted to filter by filetype. Not necessarily as elegant as regular expressions but it works just as well (if not better, because if you want to make a change you can do it in a modular way, rather than trying to figure out the ideal regex for your purpose). --98.217.8.46 (talk) 22:54, 6 November 2008 (UTC)[reply]
Thanks for help! The regex is meant to match *.xls(x) *.doc(x) and *.pdf... Silly me: \w+ does not match some special characters. PrinzPH (talk) 00:50, 7 November 2008 (UTC)[reply]
Right, but you can do that without regex. Regex is a little overkill for something as simple as extension matching (you can just as easily and probably just as quickly use substr+stripos for that) in my opinion, in part because unless one really knows regex like the back of your hand you are liable to make lots and lots of errors. --98.217.8.46 (talk) 01:25, 7 November 2008 (UTC)[reply]

proxy server

edit

I'm trying to connect to my university's proxy server, but I am already behind a proxy server at home and when I enter the university's proxy server into the "manual proxy configuration" in firefox it doesn't work. How can I access a proxy server through a proxy server, ie use a second proxy server when I'm already behind the first? I need it to access the library resources which can only be done through the university's proxy server. Thanks.

Firstly, you need to configure your proxy server to use your university's proxy server. Are you running the proxy or is it your ISP's? Secondly, is your university's proxy server actually available across the internet, or is it just on your university's intranet? --wj32 t/c 06:42, 7 November 2008 (UTC)[reply]

Norton Ghost 2003

edit

Will Norton Ghost 2003 (Ghost (software)) work on a Windows Vista based PC? -- SGBailey (talk) 21:21, 6 November 2008 (UTC)[reply]

According to [1], you can backup a FAT32 partition containing Vista, but not a NTFS partition (Vista has a new version of NTFS) [2] [3] --wj32 t/c 06:39, 7 November 2008 (UTC)[reply]
Technically, NTFS is NOT a newer version between XP and Vista. They just actually added in-OS junctioning/symbolic linking support and Transactional NTFS (which are added on an application, rather than implementation, level (though junctioning/symbolic stuff existed in WinXP as well)). Washii (talk) 02:30, 10 November 2008 (UTC)[reply]