Wikipedia:Reference desk/Archives/Computing/2007 September 27

Computing desk
< September 26 << Aug | September | Oct >> September 28 >
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.


September 27

edit

The little server that couldn't....

edit

I just installed EasyPHP (that is, MySQL, PHP and Apache) to try to run a few silly web things. It works fine if I type in "localhost", but I wanted an address I could remember so I used No-IP.com to get one of those mysillylittleserver.no-ip.com but when I tried to connect to it nothing happened. Figuring that they might be slow to update their DNS database, I connected directly to my IP, but that didn't work either! Figuring that maybe my ISP is blocking port 80 (although I doubt it) I changed the port, still didn't work. Figuring that maybe the Windows firewall is cockblocking me (pardon my French) I turned that off (and btw, I did both of the last things at the same time, to make sure that not both were happening), and now that that doesn't work either I'm just about out of ideas. I mean, the server works, if I use 127.0.0.1 or localhost (which is the same, I guess), it's all peachy, but not when I connect directly to my public IP, nada. Ohh, and I don't have a router, so it's not a NAT thing. My ISP couldn't possibly filter all incoming HTTP requests, could they? I mean, they're very nice, they let me bittorrent all I want and they don't do any shaping. Help appriciated. --Oskar 03:29, 27 September 2007 (UTC)[reply]

  • First, are you sure that you are not behind a NAT router? (broadband modems and stuff often have them built in) Go to the command prompt and do "ipconfig"; what does the IP say?
  • Do you have another software firewall or anything like that?
  • Check your Apache config to make sure that it isn't just listening on localhost
  • Portscan yourself (with nmap or something like that) to see if your port 80 is responding at all
--Spoon! 04:22, 27 September 2007 (UTC)[reply]
Aha! The httpd.conf file contained the line "Listen 127.0.0.1:80" and when I removed that the firewall (I started it again because apparently it wasn't the problem) perked right up and asked for permission for Apache. Now it seems to work fine! Thanks! Ohh, and you couldn't just test going to xxx and see what happens, just so I can be sure it's working? Don't worry, there's nothing bad on there, just a test message :P Thanks, again! --Oskar 05:05, 27 September 2007 (UTC) Not necessary, I got confirmation elsewhere --Oskar 05:30, 27 September 2007 (UTC)[reply]

usecase

edit

sir please give me any sample project that contains USECASE diagrams.iam doing a project so i want to have a glance of any project.i read usecase diagrams topic but i had a doubt.so please provide a sample project with usecase diagrams —Preceding unsigned comment added by 219.64.121.42 (talk) 04:00, 27 September 2007 (UTC)[reply]

Note the second suggestion before posting a question. Do your own homework. Whispering 17:05, 27 September 2007 (UTC)[reply]
The original questioner asked for (documentations of) sample projects with use case diagrams, not use case diagrams created for his/her project. I don't see anything wrong with that.
A use case diagram is nothing more than a diagrammatic "catalog" of the use cases that define the expected behavior of a system. It shows, diagrammatically, what actors participate in what use cases, as well as relationships among use cases. For more examples of use case diagrams, do a Google Image Search on "use case diagram". --71.175.68.224 12:52, 28 September 2007 (UTC)[reply]

HTTP in the file system

edit

I'd like to have HTTP access through the ordinary file system so that I can reach, for example, the Wikipedia main page as /http/en.wikipedia.org/wiki/Main_Page. What would be the standard way to do this? And why doesn't such a useful thing come preinstalled in distros? (Cause it doesn't, right?) —Bromskloss 09:58, 27 September 2007 (UTC)[reply]

There's nothing exactly like that (that I know of), but there's a FUSE module for http called httpfs. Unfortunately, as far as I can tell, it only binds a particular URI to a file, and doesn't provide a browsable directory structure. This is probably because most web sites aren't very much like a directory, it is difficult to translate a page full of links into a directory full of files. There are protocols like WebDAV that give you the ability to use http or https to serve a filesystem, but that's not what you're asking for. -- JSBillings 12:11, 27 September 2007 (UTC)[reply]
I can't expect file listings, of course. The httpfs you mentioned, is it only used for mounting disk images or can I use it to access any file? A quick search revealed that there are at least experimental things that do what I look for, but I was wondering if there was some software that was generally preferred. (Like you usually use Apache whenever you need a web server.) —Bromskloss 13:23, 27 September 2007 (UTC)[reply]
Well if you can't list directories and can't write to files, then the filesystem is pretty useless. For reading HTTP files you could always just use wget or curl. Seeing your original post, if you wanted to edit Wikipedia articles, there is a WikipediaFS. --Spoon! 16:29, 27 September 2007 (UTC)[reply]
The main appeal I'd think would be easy access for the shell; you have a handler available for every resource on the internet --frotht 18:24, 27 September 2007 (UTC)[reply]

internet and proxy

edit

If I wana find my pcs "proxy server" by using CMD and this fomular:
c:\>reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer
! REG.EXE VERSION 3.0
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings
ProxyServer REG_SZ yourproxyhere:port
c:\>

What EXACTLY do I type in the "C:\>" Screen? Thanks!!! Hyper Girl 10:32, 27 September 2007 (UTC)[reply]

The first line you have written? :) Splintercellguy 13:44, 27 September 2007 (UTC)[reply]
I all I get is "bad command or filename" If this isn't the way then how can I see the pcs proxy settings via the CMD prompt? Hyper Girl 11:32, 28 September 2007 (UTC)[reply]
Doesn't "ipconfig /all" help? Astronaut 12:08, 28 September 2007 (UTC)[reply]
What version of Windows are you running? "reg" is only standard on XP and Vista, although our Windows Registry article indicates that it is downloadable for other versions (see the Command line editing section). --LarryMac | Talk 13:28, 28 September 2007 (UTC)[reply]
YES!! Thank you sooo much Astronaut!! Thank you thank you thank you! Hyper Girl 15:18, 28 September 2007 (UTC)[reply]

Generic Macro in Excel

edit

Can anyone explain how to construct a Macro in Excel which will work anywhere on the spreadsheet and does NOT use cell addresses. In Quattro Pro a Macro can be written which will look like this:

{editcopy}{right 4}{down 3}{editpaste}

This will copy the contents of a cell from its present location to a position 4 cells to the right and 3 cells down and will work anywhere the cursor is placed. —Preceding unsigned comment added by 155.238.8.15 (talk) 11:32, 27 September 2007 (UTC)[reply]

Use the offset function...So you just do offset(1,0) and it will offset 1 down and 0 acroos (or possibly the other way round). If you have it set on 'activecell.offset' it will be based on whichever cell the cursor is in. Here's a brief example (http://j-walk.com/ss//excel/tips/tip20.htm)ny156uk 19:27, 27 September 2007 (UTC)[reply]
Sorry just thought might be worthwhile trying to reconstruct what you've done. It would go something like this (warning syntax may be wrong as i'm not near a copy of excel to check and memory is poor)...

Dim answer as string

Activecell.value = answer

Activecell.offeset(4,3).value = answer

You probably don't need to do the whole assigning a string/mentiong .value and can word it with...activecell.offest(4,3).value = activecell.value but not sure if that works. ny156uk 19:30, 27 September 2007 (UTC)[reply]

CustomValidator on ASP.NET being ignored

edit

I am trying to use a CustomValidator on an ASP.NET page, however it is not working correctly. Here is a simplified version of the source code:

ASP:

Please input a date:
<asp:TextBox runat="server" ID="txtDate" Text=""/>
<asp:CustomValidator runat="server" ID="dateValidator" ControlToValidate="txtDate" OnServerValidate="dateValidator_ServerValidate" ErrorMessage="Invalid date"/>

C#:

protected void dateValidator_ServerValidate(object sender, ServerValidationEventArgs args)
{
  try
  {
    DateTime.Parse(args.Value);
  }
  catch (Exception)
  {
    args.IsValid = false;
  }
}

The problem is, the validator doesn't work. Its value is being ignored, and the page posts happily back to the server even if I enter something like "31.09.2007" in the text box. When I set a breakpoint inside the exception catching block in the debugger, I can see that the code is being called, and it correctly sets the result as invalid. However, ASP.NET merrily ignores this. "Normal" validators that don't need custom code, such as RegexValidator, work correctly. What the heck is wrong here? JIP | Talk 15:24, 27 September 2007 (UTC)[reply]

I'm not a C#/.net guy so I'm going to just speculate as an outsider here: Item one: Try eliminating everything except args.IsValid=false in the source code and see if that causes all validations to fail. If so, the next question is whether DateTime.Parse() throws an exception when it has an invalid value. As a final note, you want to be more careful in what exception you're going to catch. Catching Exception means that you'll catch every error. As a matter of good style, you want to catch the most specific exception possible. Donald Hosek 16:09, 28 September 2007 (UTC)[reply]
It turned out that the Ajax Control Toolkit CalendarExtender, which I had omitted above for simplicity, was actually the problem. The validation was being done correctly, but the CalendarExtender insisted on using its SelectedDate property, which overwrote the validation result. I set the property to null and now it works. JIP | Talk 17:38, 28 September 2007 (UTC)[reply]

Still about ASP.NET...

edit

My colleague at work is also having trouble with ASP.NET. His problem is about server-side includes.

This code works fine:

Hello user, it is now <%= DateTime.Now.ToString() %>

This doesn't:

Hello user, it is now <asp:Literal runat="server" ID="litNow" Text="<%= DateTime.Now.ToString() %>"/>

In the latter case, the server shows the actual C# source code in the ASP.NET literal instead of running it and displaying its output. I seem to remember that with JSP, which ASP.NET is obviously plagiarised based on, it should work just like that. JIP | Talk 16:57, 27 September 2007 (UTC)[reply]

When you program with microsoft languages, you should be expecting this kind of crap. If that's the behavior of the system, that's how it's "supposed to work"- microsoft just standardizes any bugs rather than fixing them. Why not use a real web programming language? Try perl if you're familiar with *nix, PHP if you're new to web scripting (I find PHP very refreshing after battling through weird low-level operations in C, but of course it's not nearly as efficient. But LOL look at asp.net, now that's just a joke for efficiency), or C++ through CGI for easier porting from C# --frotht 17:19, 27 September 2007 (UTC)[reply]
I will be telling my colleague that. But it's unlikely that a company with almost 100 employees, which has been a Microsoft Gold Certified Partner for two years running, will suddenly turn to other platforms. At home, I wouldn't touch Microsoft products with a 10-metre pole. But at work, it's a different issue. JIP | Talk 17:23, 27 September 2007 (UTC)[reply]
Maybe just stick with telling him the 2nd part ;) "What's wrong with you, just switch to X" is fine on the internet but I'd be wary of using it in real life. o_o Anyway, what's the appeal of being a "gold partner"? Is the software cheaper? News flash, free software is free D: --frotht 18:22, 27 September 2007 (UTC)[reply]
Yeesh, I don't know the answer on this, but an anti-Microsoft diatribe is not especially useful (and this comment comes from a guy who's an Apple fanboy). Why use dot net? How about the fact that it's a lot easier to find good C#/.net programmers than perl or PHP programmers. I'd add that PHP is loaded with all sorts of grotesque inefficiencies, not least of which is the lack of a real array type (the thing that looks like an array is always treated as a hash). I suspect that the problem here is that the way to handle the programmatic aspect of the literal call here is to use the DateTime.Now.ToString() call in the underlying class rather than trying to put that in the view layer. Donald Hosek 18:54, 27 September 2007 (UTC)[reply]

Mac OS X in October

edit

According to [1], and its source [2] it is releasing in October. Do we have any update on it from Apple? --Click me! write to me 17:11, 27 September 2007 (UTC) Update: Source has expired. --Click me! write to me 17:13, 27 September 2007 (UTC)[reply]

Apparently it's "sometime in october" with no specific word on what particular day --frotht 17:22, 27 September 2007 (UTC)[reply]
Isn't it always the 24th "just 'cause"?
Atlant 18:59, 27 September 2007 (UTC)[reply]

Thanks. User:Kushal_one ```` 69.150.163.1 19:23, 27 September 2007 (UTC)[reply]

Any more takers? --KushalClick me! write to me 22:19, 1 October 2007 (UTC)[reply]

Page Creator

edit

Hey people. I was just wondering on Google Page Creator, how would one create a page and just have the PAGE? You know like no title or anything at the bottom or nothing. Just the page?Jk31213 19:02, 27 September 2007 (UTC)[reply]

Is this a real Virus?

edit

I am getting an error message from McAfee antivirus as:

BO:Writable BO:Heap

and when I checked the buffer overflow log file it has following message:

Blocked by Buffer Overflow Protection COMP\user C:\WINDOWS\Explorer.EXE:KERNEL32.GetProcAddress BO:Writable BO:Heap

I scanned the computer (in normal as well as in safe mode) with McAfee but it didn't find anything. Is there any way to fix this? I'm using Win XP SP2 Pro. 202.168.50.40 22:20, 27 September 2007 (UTC)[reply]

Sounds like a problem with Windows. IIRC, unless you have a rootkit Windows should detect a modified explorer.exe and replace it automatically. --frotht 19:04, 29 September 2007 (UTC)[reply]

LaTeX

edit

I'm writing a document in LaTeX, with TeXnicCenter. When I build the file to pdf, the margins are all huge, but I can't find out how to decrease them. Any help...? MHDIV ɪŋglɪʃnɜː(r)d(Suggestion?|wanna chat?) 21:13, 27 September 2007 (UTC)[reply]

Try \usepackage{fullpage}. —Keenan Pepper 02:57, 28 September 2007 (UTC)[reply]

That works, but not perfectly, the margins are still quite large, is there any way to manually alter the margins? MHDIV ɪŋglɪʃnɜː(r)d(Suggestion?|wanna chat?) 16:29, 28 September 2007 (UTC)[reply]

I've had good results using the following in the preamble:
\topmargin-20mm
\textheight240mm 
\textwidth190mm
\oddsidemargin-10mm
\evensidemargin-20mm
The result is that the text fills almost the entire page on the pdf, and is in fact out of the "printable area". Using these can also make it so your text is wider than the page and runs off. Experiment with different number values to get your desired results. BTW in my expample page I used the article documentclass. Man It's So Loud In Here 18:46, 28 September 2007 (UTC)[reply]
The other thing to consider is that LaTeX is designed to prepare documents in a formal manner, and that the best results are usually to leave its typesetting decisions alone. If you're constantly trying to tweak it to make it "look better", then it's probaby not the right tool for your task. — Timotab Timothy (not Tim dagnabbit!) 19:14, 28 September 2007 (UTC)[reply]
I don't really agree with the above comment (sorry if this discussion is out of place). I like LaTeX specifically because I want to be able to tweak every single aspect of page design and layout and was tired of WYSIWYG word processors doing it for me. A good part of why I use LaTeX over for math-heavy papers is how good it looks, and I'm always trying to make it look perfect. Maybe I'm using it for the wrong reasons, or this is just a difference of opinion. Man It's So Loud In Here 19:37, 28 September 2007 (UTC)[reply]
Try the standard geometry package. Also make sure that your paper size is set correctly; I've had trouble with LaTeX preparing for letter paper while dvips was thining of A4. --Tardis 02:35, 29 September 2007 (UTC)[reply]

Tripod for taking pictures of documents

edit

I have a digital camera with a standard tripod mount. I'd like to get a tripod which would make it easy to take top-down pictures of document (and maybe, if such a thing is possible, have a light built into it, so I don't have to worry about the poor lighting available in the archives where I work). Anybody have a clue where I can find such a thing? Googling "tripod documents" "mini tripod", etc. didn't really pull up things that looked like they would work for this sort of thing. --24.147.86.187 22:33, 27 September 2007 (UTC)[reply]

Try "copy stand" -- I think you'll find what you're looking for.
Atlant 22:57, 27 September 2007 (UTC)[reply]
Cool, thanks. --24.147.86.187 13:17, 28 September 2007 (UTC)[reply]