Wikipedia:Reference desk/Archives/Computing/2009 April 20

= April 20 =

Base classes (C#)
I have a handle management class called Win32Handle (written in C#) and specialized derived classes for objects like job objects, processes, threads, etc. In Win32Handle I want to have a Duplicate method which all derived classes will inherit. The problem is, instead of the Duplicate method returning a Win32Handle I want it to return a specialized class instance. For example:

ProcessHandle ph = ...; ProcessHandle ph2 = ph.Duplicate(ProcessAccess.Terminate);

instead of:

ProcessHandle ph = ...; Win32Handle ph2 = ph.Duplicate((int)ProcessAccess.Terminate);

How can I do this? --wj32 t/c 02:49, 20 April 2009 (UTC)


 * You could make your Win32Handle class be generic Win32Handle. Then redefine Duplicate to return a T. 124.214.131.55 (talk) 04:59, 20 April 2009 (UTC)


 * Great, that works! Thanks a lot! I didn't try this before because using D the compiler just segfaulted. --wj32 t/c 06:25, 20 April 2009 (UTC)


 * This is called the curiously recurring template pattern. -- BenRG (talk) 01:02, 21 April 2009 (UTC)
 * Thanks for the link. I think D (although I am not using it right now) may have some problems with this pattern... --wj32 t/c 04:21, 21 April 2009 (UTC)
 * You may want to post this question to the newsgroup "microsoft.public.dotnet.languages.csharp" instead. Quite possibly you will get a better answer. That's not to say that there's anything wrong with 124.214.131.55's answer (I couldn't tell). decltype (talk) 05:51, 20 April 2009 (UTC)

Time Travel
What is your current advances on time travel? —Preceding unsigned comment added by 64.30.106.235 (talk) 05:48, 20 April 2009 (UTC)


 * Take a peek at the article on time travel. Going forwards works pretty well. (Or, given that this is the computing reference desk, you didn't mean time capsule did you?) 88.112.62.225 (talk) 06:47, 20 April 2009 (UTC)

I have formulated a way to travel forward in time about an hour every 3600 seconds! Gunrun (talk) 08:09, 20 April 2009 (UTC)


 * and each of that second must be at least as fast as (1/5.39124)*1044 tp manya (talk) 05:03, 21 April 2009 (UTC)


 * It would be better to ask this question on the Science Ref Desk - since it has nothing to do with computers. Sadly, the answer there will be just the same - you can't go back in time - and going forwards is mundane. SteveBaker (talk) 21:15, 21 April 2009 (UTC)


 * Going forward isn't always mundane. It's possible to go forward in time at an accelerated rate, by moving at high speeds, such as those which are a substantial portion of the speed of light.  See Time_dilation.  Just don't plan on going back in time to where you started. StuRat (talk) 18:39, 23 April 2009 (UTC)
 * Travelling fast is pretty mundane. There is nothing qualitatively different about travelling at relativistic speeds compared to walking down to the shops. There is nothing that one would think of as a special time machine invention involved. --Tango (talk) 18:49, 23 April 2009 (UTC)


 * "Mundane" is in the eye of the beholder. Sure it doesn't break any laws of physics, but nothing ever does. If you left Earth, and returned a week later to find that humans were extinct and had been replaced by talking chimps, you wouldn't find that mundane. You would think "Wow. Time travel is amazing." APL (talk) 19:50, 23 April 2009 (UTC)

TrueCrypt's security
Why does everybody (internet forums, wikipedia, etc) believe that TrueCrypt is really secure? How should a skeptical proceed to test this assertion?--80.58.205.37 (talk) 10:23, 20 April 2009 (UTC)


 * Mostly because it is open-source for public scrutiny, and the rationale for all the security design considerations are very well documented, and it uses well-known ciphers. As opposed to proprietary software who claim to be secure because of their "amazing 4096-byte parallel matrix" closed-source cipher. decltype (talk) 11:00, 20 April 2009 (UTC)


 * If the ciphers are secure, and the implementation is straightforward, then it should be secure. As for someone skeptical, consult paranoid security experts — unless you have a deep understanding of both computer programming and cryptography you're not going to be able to come up with a meaningful way to test it yourself. ---98.217.14.211 (talk) 13:05, 20 April 2009 (UTC)

Type of DC socket in a HP laptop
The laptop shows it is powered only when the power plug is inserted and kept at certain angle. I did some research on the internet and found out that the problem lies in the socket in the laptop. One of the tests was to remove the battery and see if the laptop goes off if the angle is slightly changed. HP's website unfortunately does not have a manual for this model (ze5700). I have never opened this laptop before, if the socket is soldered to the mother board I cannot replace it anyway, so i won't open it in that case. If the socket is of non-soldered type, perhaps I can buy one and replace it. ( is it a generic part? or i have to order it from HP?). Can you please say which type of socket this laptop posseses?. —Preceding unsigned comment added by 131.220.46.24 (talk) 10:47, 20 April 2009 (UTC)
 * I've never seen your exact model so I accept I could very well be wrong, but I've personally never seen a non-soldered power socket on a laptop motherboard. Soldering is simply the quickest/easiest/cheapest way for them to do it and I would assume that yours is the same too. I also doubt that your socket is faulty, the socket itself doesn't really have anything in it that can break, but from you're describing the problem sounds like part of the solder connecting the socket to the motherboard has come off and you only get a proper connection when you angle it a certain way forcing the connection. Whilst you could try getting it repaired under warranty (if it's still valid?) it's not really a manufacturing defect and it's only really the sort of thing that can happen if it's dropped or knocked whilst the lead is in and I'm afraid finding someone to try and resolder it is probably the only solution. Even then it might not work very well though, we had a Dell laptop that we tried to fix for this problem and it just kept breaking again and in the end we had to get the user another laptop. I appreciate my entire post is an assumption on your laptop, but I hope it's of some help. ZX81  talk  11:26, 20 April 2009 (UTC)


 * There are really two kinds of problem - one is that the socket is bent inside and only makes contact when you bias the plug in that particular way. The other is that one of the solder joints that holds the socket to the circuit board has cracked and is only making intermittent contact.  If you are lucky - and it's the first of those things then perhaps you can gently bend the connector back to where it makes good contact.  It's usually the bigger strip of metal that contacts the outside of the plug rather than the thin one that goes up the center of the plug.  However, in likelyhood - you'll have to either replace it or re-solder it - and that amounts to the same thing in the end.  If you can find a local computer repair store, they should be able to do it while you wait...but how much that's gonna cost is anyone's guess.  Anyone who can solder can do this...and learning to solder isn't that hard  (I'm self-taught - and I'm a klutz - but I can do stuff like this easily).  Fry's have low-budget soldering irons for $10 and solder for $5 - so perhaps this is time for you to learn!  It's such a simple job that if you happen to live near Round Rock, Texas - I'll do it for you for free.  In the unlikely case that the socket is literally broken (I think that's unlikely) then you'll first need to remove the old one - and that's a bit harder...you need a way to remove the old solder first and that requires another tool called a 'solder pump' - which will probably set you back another $15.  No matter what, you've obviously got to get it fixed - so that's that.  SteveBaker (talk) 21:11, 21 April 2009 (UTC)

kezboard trouble
to get y i have to tzpe z and vice versa. close square brackets comes up as equals. how do i fix it_ cannot find the tilde.

I think you are mapped to a german keyboard. If you are using windows xp, click the "DE" icon in your task bar (near the clock) and select EN to change it. If that is not the case, perhaps there are other errors. —Preceding unsigned comment added by 131.220.46.24 (talk) 11:28, 20 April 2009 (UTC)


 * Try Alt+Shift. --Andreas Rejbrand (talk) 11:33, 20 April 2009 (UTC)


 * Still in XP, if you go to the control panel, click Regional And Language options, and make sure the Standards and Formats is selected as the English of your nationality. Livewireo (talk) 21:27, 20 April 2009 (UTC)

How to count characters on Wikipedia articles
Hello, is there any tool which can be used to count the length of a Wikipedia article in characters (i.e., not in bytes)? Thanks for your help! --Leptictidium (mt) 16:21, 20 April 2009 (UTC)
 * Add this to your monobook:

importScript('User:Dr_pda/prosesize.js');
 * In the toolbox on the left there should be a new link ("Page size"); click that. GARDEN  16:47, 20 April 2009 (UTC)

Port Forwarding
I'm looking for information on how to forward ports on the Ambit DOCSIS cable modem. —Preceding unsigned comment added by Shadowclouds6635 (talk • contribs) 18:21, 20 April 2009 (UTC)


 * You might be able to change the settings by going to this page, but it looks like your model allows your ISP to disable settings from their end, so it might not be possible.
 * Also you can try using username: admin password: cableroot and see if that shows more options. These are just internet rumors, so don't take my word for anything. Indeterminate (talk) 19:22, 20 April 2009 (UTC)


 * hmm, I came across a similar thing about the ISP rewriting the firmware or something, to prevent port forwarding. I've phoned and asked them and they say they do not prevent port forwarding, so I'm at a loss as to what to do. The link you provide doesn't work, and there are no options for changing settings at the router login page. Are there standard unblocked ports already forwarded which I could use? Like 80 or something? I'm trying to let my friend connect to my server from her computer. Shadowclouds6635 (talk) 19:30, 20 April 2009 (UTC)


 * From your response it seems that what's probably going on is that your ISP is blocking port 80 (or 25, or whatever else) for their own reasons (viruses, to create price discrimination, some other reason). If your cable modem is a level 2 device (what I'd expect), then port forwarding is irrelevant. You might be more interested in figuring out how to port forward on the IP device connected to your modem (router or computer). If your cable modem is a combined router and modem, then access the router portion of the modem and setup the settings as the other responses and your instructions suggest. In many cases cable modem configurations are not accessible (legally) by the user. But a cable modem at its most basic level won't be doing TCP level restrictions. Anything doing that is more than a simple cable modem (which is certainly possible). What ISP is this? Shadowjams (talk) 08:11, 21 April 2009 (UTC)
 * Virgin Media. The port I wish to forward is 5800, so my friend should just have to type my ip address such as xx.xxx.xxx.xxx:5800 to connect. I've added the exception in the Windows firewall, I just can't think of what else to do. There are no changeable options in the modem page, even after I log into it with the password, it just lists the version number of the modem, downstream and upstream info. Thank you for helping me. Shadowclouds6635 (talk) 08:47, 21 April 2009 (UTC)
 * Bump Shadowclouds6635 (talk) 09:05, 22 April 2009 (UTC)
 * Bump Shadowclouds6635 (talk) 12:11, 23 April 2009 (UTC)
 * I don't mean to sound like a jerk, but please don't bump your help request. It says at the very top of this page that it might take several days for someone to reply (and that's assuming anyone knows the answer) and it certainly won't "bump" it back to the top like it would on a forum. Regarding your actual problem, I assume if you're using port 5800 then you're trying to configure VNC's web access so try opening port 5900 as well. 5900 is VNC's (default) data port and I can't remember if you need to open that for the the web access to work, but it's worth trying. Other than that Virgin Media might be blocking port 5800 (I don't know) so to test that, configure VNC to run on a different port and see if you have the same problem. ZX81  talk  14:28, 23 April 2009 (UTC)
 * Based on what I infer from forums posts about your modem, it sounds like the ISP can restrict what the modem can and can't do. I'd consider dropping the lease in favor of something like this, or one of these. If that's not an option, contact me again. —  C M B J   16:39, 23 April 2009 (UTC)
 * Based on what I infer from forums posts about your modem, it sounds like the ISP can restrict what the modem can and can't do. I'd consider dropping the lease in favor of something like this, or one of these. If that's not an option, contact me again. —  C M B J   16:39, 23 April 2009 (UTC)

MicroSd and MicroSDHC compatibility?
I have a Toshiba TS705 see and it has a card slot microSD (TransFlash). Can I put a 4GB microSDHC into it?--212.79.145.190 (talk) 18:58, 20 April 2009 (UTC)


 * Well, you can put it in, and it shouldn't break anything, but it might not work. SDHC is backwards compatible with SD, meaning that SD will work in SDHC readers  , but SDHC won't work in SD-only readers. It sounds like the TS705 might be SD-only, but I can't find any definitive specs. Indeterminate (talk) 19:11, 20 April 2009 (UTC)


 * I am thinking about buying it, and I cannot test it without buying it... :(--212.79.145.190 (talk) 19:15, 20 April 2009 (UTC)
 * MicroSDHC Might be an intresting read.. if your intrested in that sort of thing. If you do buy one get it from Fry's Electronics, They have a relaxed return policy. – Elliott (Talk|Cont)   19:18, 20 April 2009 (UTC)


 * According to the Toshiba Europe site, it supports up to 512MB microSD, so I don't think it has microSDHC. --Wirbelwind ヴィルヴェルヴィント (talk) 15:40, 21 April 2009 (UTC)


 * In the meantime, I tried it with a SDHC card and it didn't work. :( On the other hand, it do works with a 1GB microSD. Anyway, having 1GB is enough. --85.137.179.58 (talk) 18:47, 21 April 2009 (UTC)

From a Wikimedia sound file to Itunes
How would I copy a Wikimedia file to Itunes, or make an audio CD from it? It is easy to play a w=Wikimedia sound file, but (using Windows XP) I do not see how to save it on my computer or import it into another application. An example is. The closest I see when I click on the file is "Open link," and "save link" which does not save the file as such so that some application such as Itunes or Audacity could burn a CD of it. Thanks. Edison (talk) 19:23, 20 April 2009 (UTC)

This google search might be of some help. – Elliott (Talk|Cont)   19:33, 20 April 2009 (UTC)
 * When I say "save target as" on your example above, I get an 18M ogg file saved. You can import this file into any number of converters or burners... it works with Nero to make an audio cd. Sandman30s (talk) 20:35, 20 April 2009 (UTC)
 * Save the file to your desktop and see if iTunes can open it. It may be able to convert it to a format it can burn (.ACC). Livewireo (talk) 21:24, 20 April 2009 (UTC)

Restore image within VBox
This is an interesting question too which i am not sure there is an answer. I have 2 laptops, the firstlaptop is running windows XP Pro. The secondlaptop (of different design than the first) is running Ubuntu 8.10. The second laptop has VBox OSE installed. My goal is to take am image of the first laptop and restore that image on a virtual hard drive within a virtual environment ran by VBox. The only problem i am encountering is that when i try to start up that virtual environment i get a Blue screen of death shortly after HAL loads. Is there anyway i can prepare the first laptop to function in a virtual environment? Or is there a way i can change VBox to emulate the hardware found on the first laptop? Or is there any other ways that i can get this to work? Not only would i like it to work when i restore an image from another computer but i would also like it to work when i map a hard drive from another computer using VBox's built in raw disk utility (as i am encountering the same problem with the BSoD and what-not). Any advice / links / URLs / hugs and/or cookies (chocolate chip please) would be very useful and/or appreciated. Thank you. – Elliott (Talk|Cont)   20:49, 20 April 2009 (UTC)
 * In an attempt to clareify, here is a copy of what I said on the Talk page.

''
 * I supose that is where my problem lies. My inability to relay the right question. My question is about taking a running system; a home computer for instance, And take an image of that hard drive with a program like R-Drive. Then using R-Drive's bootable CD to boot up a another computer, and restore the image taken on this other computer. The only problem is this 'other' computer is really VBox. And since this 'other' computer is searching, reaching, trying to feel for what it's world was not moments before, and not finding it's hardware, it's world, it falls in to a state of Kernel panic. My question is how to i tell the computer, the OS, that it's world, it hardware, what it has known to be true and what it has relied on for it's life, is about to change in every way, to prepare it to be plunged in to darkness. How do i give it a flicker of light to rely on? Something to grasp and hold on to. – Elliott (Talk|Cont)   17:03, 24 April 2009 (UTC)

''

digital camera
My digital camera is pretty new. it used batteries really fast, like needs new batteries every 5-10 pictures. is there something wrong? Wikivanda199 (talk) 22:24, 20 April 2009 (UTC)


 * What kind of batteries does it use? Are you using the recommended ones? There might be a low-power setting you can switch it to, which could help. --Tango (talk) 22:31, 20 April 2009 (UTC)


 * How much time passes between pictures? What kind of camera is it(make / model)? – Elliott  (Talk|Cont)   22:45, 20 April 2009 (UTC)


 * Most cameras use rechargable, special batteries, but some cheaper models use standard, non-rechargable AA(A) batteries. I believe that cameras using standard AA(A) batteries will require quite frequent battery replacement, but certainly (unless it is a really cheap camera!) not as often as every 5-10 pictures. --Andreas Rejbrand (talk) 07:50, 21 April 2009 (UTC)


 * Not convinced by the AA perspective. I have a Pentax K100D, not exactly an expensive camera but not cheap either. It takes AAs and it can take around 500-700 shots with them. Certainly the proprietary battery-packs that some cameras take aren't 'better' than normal batteries, they're just designed so you have to use their replacements instead of normal batteries. Most dSLR cameras i've seen take AA batteries. 194.221.133.226 (talk) 15:07, 21 April 2009 (UTC)


 * Scratch that last comment - seems that's more just because i'm a Pentax lens only so only really looked at Pentax. Seems Nikon and Canon use their own batteries. 194.221.133.226 (talk) 15:11, 21 April 2009 (UTC)


 * Cameras that use AA batteries work with NiMH rechargeable AA batteries. The non-rechargeable batteries you're thinking of are alkaline batteries, which are available in AA size. Plenty of expensive cameras use AA batteries and plenty of cheap cameras use proprietary batteries. My Canon PowerShot SX100 gets hundreds of shots on a pair of AA rechargeables. There's no way a camera could only get 5–10 shots on a single charge (regardless of battery type) unless there were long periods of standby between the shots. It's not even physically possible to drain a battery that fast. -- BenRG (talk) 15:40, 21 April 2009 (UTC)


 * Provide some more details. What kind of batteries (AA, AAA, proprietary?) and what type (lithium, alkaline, NiMh)? What's the camera brand and model? Anything else strange? Shadowjams (talk) 08:04, 21 April 2009 (UTC)


 * Yeah - there is something very odd going on here. If you put a new set of disposable batteries into the camera - turned it on and pressed the shutter button five to ten times over (say) 20 seconds - and then found that the batteries were dead - they'd be so hot, you'd burn yourself touching them!  You simply can't discharge a battery that fast without it getting insanely hot.  In fact, they might even get so hot that the chemicals inside might boil and then the battery would explode!   Since none of these terrible things have happened to you (presumably), there must be something else going on.   So either you're talking about taking a picture, leaving the camera turned on for 20 minutes, taking another picture, waiting 20 minutes and so on (in which case, just remember to turn the camera off when you're done using it)...or, possibly, you have rechargeable batteries that aren't properly charged - which suggests that they are either duds or the charger isn't working or something).  Dead batteries will sometimes "come back to life" after a few minutes of recovery time - then die again shortly afterwards - so if your charger were completely dead (or not plugged in or something) then you might take the rechargeables - think that you're charging them (when really you aren't) and because they've rested for a while, you get a few more shots out of them before they die again.  However, after you've repeated this procedure a few times, they'll die and stay dead.  So this kinda fits the possibility that you have a dead battery charger.  I suppose another possibility is that you aren't letting them charge for long enough. SteveBaker (talk) 20:37, 21 April 2009 (UTC)


 * I had this experience once when the only AA cells I could buy where the non alkaline "heavy duty". These hardly lasted for 20 pictures, when normally 100 or 200 pictures come off alkaline cells. Are you using fresh alkaline cells? Graeme Bartlett (talk) 20:56, 21 April 2009 (UTC)

These are AA batteries. It usually takes 20 minutes for me to take the 10 pictures and it is on for most of that. All the pictures are in macro mode if that makes a diff. The camerea is a Nikon L18 coolpix. Wikivanda199 (talk) 12:12, 23 April 2009 (UTC)


 * Are they rechargeable batteries ? I have rechargeable AA batteries which are several years old, and they don't hold much of a charge any more.  5-10 shots with the flash on is about what I'd expect.  Perhaps they gave you some old rechargeable batteries with the camera ? StuRat (talk) 18:34, 23 April 2009 (UTC)

Take the camera back to where you got it. I'm actually in the middle of a similar situation (my camera is older, but one day it just started burning through batteries at a rate similar to the OP's). I talked to my sister, who used to work at a camera shop, and she said that it's not unheard of for cameras to suddenly fail in this way. I have no idea if there's a fix for it (she didn't think so, but was unsure). I'm using this breakdown as an excuse to get a dSLR, but if your unit is still under warranty, you should have someone fix/replace it if you can. Matt Deres (talk) 20:37, 23 April 2009 (UTC)