Wikipedia:Reference desk/Archives/Computing/2009 February 24

From Wikipedia, the free encyclopedia
Jump to: navigation, search
Computing desk
< February 23 << Jan | February | Mar >> February 25 >
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.

February 24[edit]

Proxy question[edit]

Is it possible to use a proxy server (the type that hides one's IP address) on a Java applet that accesses the Internet (This one was the first example I found) so as to hide one's IP address? I've just been wondering about that lately, so don't feel obliged to give a detailed answer. Bart133 t c @ How's my driving? 00:25, 24 February 2009 (UTC)

Any and all connections can be routed or tunneled through a proxy—given the correct proxy. Simple "free" web proxies may not support the necessary ports for your application (though with the source code it is possible to modify the ports used, but such modifications would be required at the other end of the connection as well). – 74  05:15, 24 February 2009 (UTC)

Online cryptography tool[edit]

I seem to recall that there is a website that does what I want, I just can't remember what it's called or find it with google or anything else. I want to make a series of webpages publically available online, with some of them being "secret", meaning that the pages are still visible but that the text is gibberish and only people who know a particular string of characters are able to translate it into its intended meaning. For this purpose, perfect security is not really necessary. (talk) 03:14, 24 February 2009 (UTC)

If your web server is Apache, you can use .htaccess to allow only the people who know a password to get into certain directories. The blog host Typepad will pasword-protect an entire blog. Google Docs lets you create password-protected online documents. EdJohnston (talk) 03:39, 24 February 2009 (UTC)

This site will encrypt your html code and prompt for a password when someone tried to view the page. SN0WKITT3N 12:12, 24 February 2009 (UTC)

The above site seems to be buggy. I tried using it to encrypt the html, <p>Hello world!</p> using password "google". The resulting encrypted html (?) contained, among other things, the code: orig = unescape("%3Cp%3EHello%20world%21%3C/p%3E");. Not very well obfuscated. -- Tcncv (talk) 01:12, 25 February 2009 (UTC)
I believe you have to include the entire page source, for example
  <meta content="text/html; charset=ISO-8859-1"
Hello world!
for it to work correctly SN0WKITT3N 10:35, 25 February 2009 (UTC)
The instructions do say that it can't encode short text - it does seem to work for longer strings. I wouldn't use JavaScript for securing pages, but it depends on the OP's definition of 'perfect'. — Matt Eason (TalkContribs) 20:13, 25 February 2009 (UTC)

gmail explosion[edit]

I accidentally pressed some key combination that has caused my gmail to appear extremely zoomed in. It only occurs when I am logged in, so it is not a browser issue. I poked around settings a bit and couldn't find anything. Help? --Shaggorama (talk) 05:32, 24 February 2009 (UTC)

Perhaps try holding CTRL and scrolling your mouse's scroll wheel? Useight (talk) 06:55, 24 February 2009 (UTC)
Yup, that resolved the issue. Thanks for the speedy reply. --Shaggorama (talk) 10:42, 24 February 2009 (UTC)
Pressing Ctrl + 0 will return your zoom level back to default. Zunaid 17:05, 27 February 2009 (UTC)

C++ - pointer to a class function[edit]

I was trying something in C++ the other day (I'm quite confident in C, and just figured out enough with C++ to start making classes with their own methods). At one point I really wanted to take a pointer to a function belonging to an instance of a class I'd written (i.e. write a class C with a function f; create an instance I of that class C; try to take a pointer to I.f), but the compiler specifically told me I couldn't do this (I forget the exact wording) so I gave up and went back to C.

Is there a good reason why it's not possible to take a pointer like this?

Rawling4851 11:59, 24 February 2009 (UTC)

You mean something like this?
#include <cstdlib>
class C
	void f();
void C::f()
int main( void )
	void (C::*fp)() = &C::f;
	C I;
Regards, Bendono (talk) 12:39, 24 February 2009 (UTC)
You should be aware that method pointers are not real pointers, and that whatever it is you're trying to do with them is probably better done with polymorphism. In C you have no choice but to use a lot of function pointers, but in C++ that's not true at all. Here's some more information. --Sean 13:50, 24 February 2009 (UTC)
Just as a rough idea: I was trying to implement an SP Network, using classes to define an S box, P box and the network itself. The S Box and P Box classes had public methods for both the forwards (encryption) and backwards (decryption) substitution/permutation, as well as an array actually defining the substitution/permutation. I wanted an SP Network instance to store and use pointers to these functions rather than to an instance itself, since the network acts in the same manner whether it is encrypting or decrypting. However, trying to take a pointer (e.g. just trying to compile "&(mySBox.encrypt);", let alone storing or using the reference) of course results in a compile error. ((unsigned|Rawling|16:18, 24 February 2009 (UTC)}}
Explaining Bendono's example: In C terms, an object can be thought of as (essentially) a struct, and the object's methods are function pointers that are bound to the instance of the struct. In C, Bendono's example class above would (essentially) look like this...
struct C { void (*f)(struct C *so); } where 'so' is a pointer to (what would be) C++'s 'self'.
A simple void (*func)() = I.f will fail because the namespace and number/type of arguments are not the same. You need to at least preserve binding, as Bendono's example does.
But (as Sean points out) C.f is non-static, so I.*fp does not necessarily reflect the physical address of the function you will be calling. -- Fullstop (talk) 18:15, 24 February 2009 (UTC)
I have to say that the desire for this kind of thing is highly symptomatic of the thought processes of someone who is transitioning from C to C++ and hasn't quite 'grokked' it yet. The sorts of reasons why you tend to need pointers to functions in C are erased by the inheritance and virtual functions in C++. For example - when you are doing sorting in C using the 'qsort' library function, you have to provide a pointer to a function that compares two of your objects. In C++, it's much more likely that you'd have sorting built into the class - and that you'd change the comparison function by overloading "operator>=" in a derived class. The kinds of situations where your C-like brain is telling you that you'd really like this pointer-to-member-function thing is exactly the time you need to "unlearn" that and try to aquire a C++ mindset. Don't worry though - I'll come to you eventually and you'll see just how much more elegant C++ is. It's not just C with a few extra goodies - it's an entirely different way of thinking that happens to share much of the same language syntax. SteveBaker (talk) 03:39, 25 February 2009 (UTC)
Still, it would be nice to be able to have a signal handler be a (method of a) C++ object; the standard workaround with a global variable is ugly, and you can't dynamically generate a (true) function that knows the implicit parameter so as to add it to the call. As they say, objects are just a poor man's closures... it's not entirely crazy to want them, even if you get confused in the process! --Tardis (talk) 17:46, 26 February 2009 (UTC)

Rocket Dock Stack Docklet[edit]

How do I configure the Stack Docklet on Rocket Dock to open the folder I want? All of the websites I have looked at don't tell me anything, and the only video-screenshot I can find is of a teenage guy mumbling away to himself.--KageTora (talk) 16:02, 24 February 2009 (UTC)

Instant messaging program for server[edit]

Hello folks. I’m in need of an instant messaging program (hopefully a free one) that will work on our server. We remotely connect into our server, so an IM program on the local is not feasible. The program would need to run on Windows Server 2003 Standard SP2. Something that would not require folks to sign up for an account would be helpful. Any thoughts would be appreciated. Cheers! Rangermike (talk) 18:04, 24 February 2009 (UTC)

There are some messenger services related to the OS, but maybe Trillian is more what you're looking for? — Ched (talk) 13:34, 25 February 2009 (UTC)

Another program that can read MS Backup format[edit]

Is there another program that can read/write an MS Backup format tape? I have to jump through hoops just to get it to recognize that a tape has been inserted, and trying to use it is driving me nuts. The tape and drive are recognized under another format's program, but as this tape has existing sets on it, I'd rather not "reformat" the tape... Thanks in advance! ArakunemTalk 22:20, 24 February 2009 (UTC)

MediaWiki Extension on Wikipedia for Editbox[edit]

This is sort of a subtle detail which I have noticed. I am running my own MediaWiki for internal use, and there is a particular feature which I notice is installed on Wikipedia, but is not installed on my MediaWiki. Here is the behavior I notice. If I am editing a section on Wikipedia, and then I accidentally use that browser-tab to navigate to a new page before submitting my edit, I can simply click "back" on my browser, and my un-saved edit is still in the textbox, allowing me to safely resubmit without losing work. On my private MediaWiki server, this is not the case - navigating back reloads the original text, leaving my uncommitted edit lost into the ether (this is awfully frustrating). So, is there a setting I need to change, or a MediaWiki extension that I should install, or should I just be more careful not to accidentally browse away? Nimur (talk) 22:21, 24 February 2009 (UTC)

You might want to ask at the village pump. Astronaut (talk) 23:34, 24 February 2009 (UTC)
In dire situations along those lines, doing a:
strings /proc/kcore > edit.txt
under Linux has saved my skin. Obviously being able to just press "back" is better. --Sean 00:49, 25 February 2009 (UTC)
This is technically a "feature" of your browser; Wikipedia doesn't supply the text for the edit boxes (unless you've already submitted them with the "preview" function). There are, however, server settings that can change how a user's browser behaves, such as HTTP headers, which can tell the browser how long the page content is valid and whether to cache it. Another option is to change your browser; some are significantly better about supporting the back button with forms than others (in my experience, Opera has never lost the contents of a textbox). – 74  01:23, 25 February 2009 (UTC)
I have not made any browser settings for saving forms. I use Firefox for both my wiki and Wikipedia and I get different behaviors, so it must be a server-side setting. What would I need to do to change the HTTP headers you mention? Is this a setting in Apache's configuration, instead of MediaWiki? I scanned my server's HTTP headers; it looks like the cache-control parameters are identical to the Wikipedia cache-control (except that Wikipedia has the Squid proxy/caches, but that shouldn't matter). Nimur (talk) 05:49, 25 February 2009 (UTC)
Further investigation is pointing to some javascript somewhere in Wikipedia which is not present in my personal wiki server. There's a lot of places that could be including such a script - user-profile, skin, etc.; or it could be a newer version of wikibits.js or something... If I track this down, I'll post a solution. MediaWiki is a complicated machine... Nimur (talk) 06:21, 25 February 2009 (UTC)
I was running a much older MediaWiki version than I realized (1.12.0). This feature has been added (something related to default server-side ajax and/or javascript includes). Upgrading to MediaWiki newer than Version 1.13.1 has solved the issue. Nimur (talk) 06:28, 25 February 2009 (UTC)