Wikipedia:Reference desk/Archives/Computing/2009 March 12

From Wikipedia, the free encyclopedia
Computing desk
< March 11 << Feb | March | Apr >> March 13 >
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.


March 12[edit]

Hibernation Mode[edit]

Is it bad for your PC to be always kept in hibernation mode, and never shut down ecxept only about once or twice in a month?? La Alquimista 06:36, 12 March 2009 (UTC)[reply]

Bad as in likely to damage something? No. Bad as in potential instability and possible OS errors? Maybe. Basically, if you don't experience significant problems doing so then there's no real reason not to. – 74  08:17, 12 March 2009 (UTC)[reply]
It will not harm anything directly by being in hibernation mode. But inevitable program errors can become increasingly problematic the longer a computer goes without restarting. These problems will be things like software/OS crashes, not physical computer damage. Also, in modern desktop OSes, programs that are assumed to be closed may continue to run or maintain pieces of themselves in RAM (memory, not to be confused with hard drive space), which may over time contribute to higher memory usage. You should also be aware that hibernation mode (opposed to "suspend" mode) writes data to your hard-drive, which means that anything you have open may be recorded on your hard-drive at one point or another.
As a very general rule, perhaps you should consider fully shutting down your computer on a regular basis. Perhaps once a week (although you could go much longer or much shorter). Shadowjams (talk) 09:30, 12 March 2009 (UTC)[reply]
Applications will not stay resident in memory unless they're supposed to stay resident in memory (ie., if I quit Firefox, it's gone), and even then there shouldn't be any higher memory usage over time unless it leaks memory or has some funky memory fragmentation issues. Something is wrong with your software if 'inevitable errors' pile up and cause issues over time, especially considering that you're essentially forced to reboot occasionally for updates regardless; if you're having issues like this, you should reevaluate what you've chosen to install. -- Consumed Crustacean (talk) 00:54, 13 March 2009 (UTC)[reply]
You're absolutely right, programs shouldn't leave threads running, or leak memory, but this is a simple fact of life in any moderately complex OS. Particularly if this user's running a windows OS, these things happen. Even firefox will have issues from time-to-time. Telling a user to uninstall teh offending software is not a realistic option. Shadowjams (talk) 19:24, 13 March 2009 (UTC)[reply]
No, it isn't a "simple fact of life in any moderately complex OS". Firefox will not even do that. At worst, Firefox suffers from memory fragmentation leading to a larger memory footprint than it ought to have. As soon as you close it, however, the OS frees all associated memory and the problem goes away. Uninstalling the offending software is absolutely the appropriate solution, unless it's a driver or something similar from their OEM. This isn't Windows 98, memory doesn't just disappear into the ether. -- Consumed Crustacean (talk) 03:03, 14 March 2009 (UTC)[reply]
This is a silly digression, and I appreciate your restraint, but there have been historically, and perhaps still are, memory leaks in many well developed programs, even in firefox (which is generally very reliable). There is ample evidence here, here, for a past bug, here, for if the user's not actually closing firefox, and another past issue. Or, perhaps it's a browser plug-in. It's up to the user to decide whether or not an occasional reset is better than foregoing a useful program. Shadowjams (talk) 11:21, 15 March 2009 (UTC)[reply]
I am well aware of issues with Firefox 2 (and 3 with crappy extensions). You must realize that a 'memory leak' does not mean the memory has vanished. It means that memory has been allocated for the program, the reference to that memory has been lost by the program (or at least no longer used), but the memory has not been deallocated. That deallocation is brought about by the OS when the process is terminated. Again, no need to reboot the system, only the application need be. The only time memory leaks are a system-wide issue is when something that isn't typically terminated, such as a system service, is leaking memory. And if that's happening, and it's not necessary for system operation (ie. something installed by the OEM), then it is appropriate it nix it. It's pretty rare these days, especially compared to performance and memory issues caused by malware. -- Consumed Crustacean (talk) 00:04, 18 March 2009 (UTC)[reply]
Hibernation simply pages out everything and shuts down your computer. It's that simple. You can unplug your computer if you want, unlike with "sleep" which puts your computer in a low power state. The only problems that may occur are with programs that depend on time - timer programs? --wj32 t/c 10:01, 12 March 2009 (UTC)[reply]
On my Dell M1330 laptop, with 2GB RAM, it takes longer both to go into and to restore from hibernation than it does to make a clean shutdown and restart. So I only hibernate if I have to power off the laptop while doing something I can't save. Your mileage may vary, but I imagine copying 2GB of data to and from the hard drive takes quite a while on any PC.
Also, hibernation can't keep a server session alive, so when you power on again you'll find yourself logged out of most websites you were using. Your data will be lost unless you copied it into a Notepad window before hibernating. — FIRE!in a crowded theatre... 18:42, 12 March 2009 (UTC)[reply]
Well no wonder my computer has been acting unusually slow lately. The only time I bother to turn off my computer is when it freezes and I have no choice but to restart it or if I click Turn Off Computer by accident. I'm glad I read this thread, because it's a question I've been pondering myself. --Whip it! Now whip it good! 21:19, 12 March 2009 (UTC)[reply]
That should not be happening even on Windows unless you're using ME/9x. I never do a full shutdown or restart of my Windows box unless I've patched something and need to do so. No issues. You've probably got some crappy or malicious software installed. -- Consumed Crustacean (talk) 00:48, 13 March 2009 (UTC)[reply]

Extract the constant term from a polynomial, with Maple9[edit]

Hi, excuse this naive question. I'm doing a computation with Maple9. As a result I have a huge trigonometric polynomial, and I want to extract the constant term. As a mathematician, I would just integrate over [-pi, pi], but this can not be the right answer. How can I just make it find the constant term? Thanks --131.114.72.215 (talk) 14:15, 12 March 2009 (UTC)[reply]

You might try asking at the math desk if you don't have any luck here. --Sean 17:59, 12 March 2009 (UTC)[reply]

Security Software[edit]

I just bought a new Dell Inspiron 1525 and it came with Trend Micro Internet Security and I have Windows Defender on it, too. Reason is that I have installed Stumble Upon and now I'm addicted. But I don't want to leave myself vulnerable. Is this enough security? I think I might be missing something. --Emyn ned (talk) 14:44, 12 March 2009 (UTC)[reply]

Make sure that the internet gateway (DSL router, cable box, etc.) that you're using to access the internet (assuming you're doing so at home) has a firewall and that the firewall is enabled (with as few inbound ports open as possible; ideally none). If you're using a wireless connection to it, make sure the connection is secure (and uses WPA, not the earlier and much less secure kind). Have a spyware scanner (like Spybot Search and Destroy) and run it occasionally. Many people (myself included) will recommend that you use a browser other than Internet Explorer (such as firefox, safari, opera, or google chrome). If you do choose to run IE, adding the Yahoo! toolbar (which can catch some fishing and spyware sites) is a good idea. Always make sure your Windows Update is up to date, and that browser plugins (particularly Adobe Flash and Adobe Acrobat Reader) are up to date. 87.115.143.223 (talk) 15:42, 12 March 2009 (UTC)[reply]

yes, I use Firefox but I don't have any Spybot Search and Destroy. How do you know if I am using WPA? My landlord has the wireless connection set up and I am allowed to use it for free. --Emyn ned (talk) 15:48, 12 March 2009 (UTC)[reply]

You can get SD&D via the Spybot - Search & Destroy article; it's very good (and free). If you double-click on the little icon that appears when you wirelessly connect, you should get a little box that gives some details of the wireless connection (I don't have a windows machine to hand right now to confirm). I think it says "secure connection" or "WPA secure connection" or something like that. If you didn't have to enter a security code the first time you connected to the wireless then the connection is "open", and thus unsecured. If that's the case you should talk to said landlord and suggest enabling WPA security - that way only people he approves can access his network (and not Joe Pederast across the street). 87.115.143.223 (talk) 15:55, 12 March 2009 (UTC)[reply]

finding pixel with RGB in visual basic or visual C++[edit]

is there some code in visual basic or in visual C++ with which i could find a pixel with a specific color values(red, green, blue) at a particular Y- coordinate or X- coordinate? please post that fully.--harish (talk) 15:42, 12 March 2009 (UTC)[reply]

A pixel in what - in an image, on the screen, on a video? 87.115.143.223 (talk) 15:43, 12 March 2009 (UTC)[reply]
In Java, the AWT Robot can do this, either by creating a BufferedImage of the screen (allowing you access to a "copy" of that screenshot), or by returning the current color of the pixel at the mouse-coordinate. The AWT Robot can get screen information from anywhere rendered by the operating system (not just in the Java application window(s)). There's probably an equivalent feature in .NET Framework or Visual C++. Nimur (talk) 17:01, 12 March 2009 (UTC)[reply]
This article describes the WinAPI calls that capture the screen in VisualC++ (I guess they're also exposed to VB by the same names). 87.115.143.223 (talk) 17:22, 12 March 2009 (UTC)[reply]
Sure, just use GetPixel and get a handle to the whole screen. (Replace with another HDC if you need something more specific.) Here is a quick sample:
#include <cstdlib>
#include <iostream>
#include <windows.h>

int main( int argc, char* argv[] )
{
	if (argc != 3)
	{
		return EXIT_FAILURE;
	}

	int x = ::atoi( argv[0] );
	int y = ::atoi( argv[1] );

	HDC hdc = ::GetDC( 0 );
	COLORREF color = ::GetPixel( hdc, x, y );

	::ReleaseDC( 0, hdc );

	BYTE red   = GetRValue( color );
	BYTE green = GetGValue( color );
	BYTE blue  = GetBValue( color );

	std::cout << "Red: "     << (unsigned int) red
		  << ", Green: " << (unsigned int) green
		  << ", Blue: "  << (unsigned int) blue
		  << std::endl;

	return EXIT_SUCCESS;
}
Regards, Bendono (talk) 18:01, 12 March 2009 (UTC)[reply]

Why does YouTube add black vertical black bars to my (windows movie maker) videos?[edit]

I create them is WMM and when their uploaded no less than two different types of bars. The one outer ones are YouTube and the inner ones are WMM... How can I avoid them both? --217.227.127.109 (talk) 19:02, 12 March 2009 (UTC)[reply]

It sounds like you are not correctly setting the aspect ratio when you save the video. It also sounds like you are making this mistake twice, in both Windows Movie Maker and also during the upload step. What aspect ratio is the original video? Make sure you use that value all the way through the process. Nimur (talk) 19:08, 12 March 2009 (UTC)[reply]

it create them videos to convert to flash and that alters them s —Preceding unsigned comment added by 194.80.240.66 (talk) 13:07, 13 March 2009 (UTC)[reply]

Make sure you are either creating your videos with a 4:3 aspect ratio (most people make their videos with a resolution of 640x480 or 320x240, which is the size of old youtube videos), or a widescreen 1280x720 16:9 aspect ratio if you want to fill up the whole box. If you make a video in 4:3 you'll still get the black bars on the sides, but you shouldn't be getting two sets of black bars; that's because you didn't fill up the frame properly before you exported in movie maker. 210.254.117.186 (talk) 14:52, 15 March 2009 (UTC)[reply]