Jump to content

Wikipedia:Reference desk/Archives/Computing/2008 December 29

From Wikipedia, the free encyclopedia
Computing desk
< December 28 << Nov | December | Jan >> December 30 >
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.


December 29

[edit]

Borland C++

[edit]

Hi,

What is the command that i can use to get a print out in Borland c++ compiler? —Preceding unsigned comment added by 202.124.160.216 (talk) 12:04, 29 December 2008 (UTC) "[reply]

We can't understand your question. What do you want to print out? --Sean 17:18, 29 December 2008 (UTC)[reply]
If the compiler has a Graphical User Interface (also known as a GUI or Integrated Development Environment or IDE), you can likely use the Print command from the File menu when the window which has what you want to print is open. If you are using a command-line compiler, just open the file you want to print with your favorite text editor, and print it from there. (You do not need a special program to open C or C++ source or header files - any text editor or word processor will do.) If you want to print the output of a command-line compiler to paper, the easiest way is to redirect the output to a file, and then print that text file using your favorite text editor. If those hint don't work for you, you'll need to be more specific, telling us 1) what, exactly, you are trying to print 2) the full name and version of the Borland C++ compiler you are using 3) which operating system you are running it on 4) anything you have tried that hasn't worked. -- 128.104.112.113 (talk) 19:33, 29 December 2008 (UTC)[reply]

Taskbar disappeared

[edit]

I'm running Windows XP on my computer. I had a problem with a virus so I installed a program called Malwarebytes' Anti-Malware. I ran it and allowed it to clean whatever infections it showed on my computer. Trouble is that it might have ended up deleting some files that aren't malware. Now my Windows starts up without a Taskbar, and it also loads a message at startup saying a certain file (MKMKrnl.dll) is missing. The software in question also refuses to load (it gives its own message about some file being missing) but that's the least of my concerns right now. Can someone tell me how to get back my taskbar? --120.138.100.216 (talk) 15:12, 29 December 2008 (UTC)[reply]

Hmm... are you sure this Malwarebytes thing is reputable - it sounds deliberate to me... There'll be a way to get the taskbar back somewhere in the control panel, I'm sure... Try bressing the windows key on your keyboard - that should fix it if it's only temporary and accidental. If nothing else works, either re-install Windows or back-up the files you need onto a memory stick and restore your computer to its factory state. In future, try using programmes that have been recommended by friends or computing magazines - it saves a lot of trouble, trust me. Dendodge TalkContribs 15:23, 29 December 2008 (UTC)[reply]
Pressing the Windows key isn't working. The software, by the way, I got from download.com (it's on the most downloaded list and has gotten mostly good reviews). It did delete the files that I knew to be viruses, but I'm assuming it ended up giving some false positives. Anyway, I need a quick fix for this problem now before my dad gets home. Can you tell me how to get back the taskbar from the Control Panel? —Preceding unsigned comment added by 120.138.100.107 (talk) 15:29, 29 December 2008 (UTC)[reply]
First, Malwarebytes' Anti-Malware is a well regarded tool for dealing with malware. Aside from that, MKMKrnl.dll seems to be part of a virus, so it looks like the infection was not completely removed from your computer. As far as the taskbar, is there any chance it is collapsed? If you place your mouse pointer at the very bottom of the screen and it turns into a double-headed vertical arrow, just press the left mouse button and move up to resize the taskbar. Finally, is there any chance you can use the system restore function to get your computer back to a point prior to the virus problem? --LarryMac | Talk 15:37, 29 December 2008 (UTC)[reply]
Ah, yes, that is what had happened. My taskbar was locked however, which was why I couldn't resize it. Problem is it still doesn't show any of opened windows in it, even after minimising them. Also, does someone have any knowledge about a virus/trojan(?) going by a file called "amvo.exe". I seem to have gotten it from a USB disk-drive and now I can't double-click on any of my disk partitions directly from My Computer (the computer just restarts on its own when I do). It also stopped me from viewing any hidden and system files (though Malwarebytes seems to have solved that problem). --120.138.100.107 (talk) 15:46, 29 December 2008 (UTC)[reply]
A Google search for "amvo.exe" returns thousands of hits; this one might be useful for the links mentioned within the posts. --LarryMac | Talk 17:09, 29 December 2008 (UTC)[reply]

I know this isn't answering your question and probably isn't much help, but I absolutely hate dealing with viruses and trojans that have somehow permeated through the excellent defenses of my system. I find it easier (maybe not for you though!) to save all of my important documents and files onto a flash drive (I use my iPod, because it has a massive hard drive) and just re-install my OS. Clean start. --71.117.36.29 (talk) 20:46, 29 December 2008 (UTC)[reply]

The irony is that that is exactly what I had done in the first place. However, the virus in question spreads through flash drives itself, not something I knew before. So now, not only is my main computer infected (because I re-transfered all my backup through a flash drive) but also my secondary computer (on which I transferred all of my backup through - again - a flash drive)! Anyway, does anyone have a solution for my taskbar problems? It still isn't showing any of the opened programs on it, and its presence seems to be linked to whether the Language Bar is enabled or not.
P.S. Among other problems I've noticed (after my attempts at malware removal) - the audio isn't working, the copy-paste function isn't working and my computer starts up a lot more slowly. I can't even do a System Restore as it either fails to open (the first time I try it) or just shows a blank screen (the second time I try it). --120.138.100.51 (talk) 08:21, 30 December 2008 (UTC)[reply]
P.P.S. Btw, I've found a log file of all the infections removed by the said program. Would uploading here help if anyone would care to show me whether any necessary files were deleted in the process? --120.138.100.51 (talk) 08:28, 30 December 2008 (UTC)[reply]

Well, I have cleaned too many of these amvo.exe viri at my hostel. To start off, boot your pc to safe mode by pressing F8 just before the OS loads till start options appear. Open command prompt. Move to your system directory (mostly c:\windows\system32\). Type attrib -s -h -r amv*.* . Delete all those that appear. There might be more in the system. So, run msconfig.exe and view the startup tab. Uncheck all except the things you are most sure of. Then restart. 117.201.114.148 (talk) 09:16, 30 December 2008 (UTC)[reply]

A simple configuration for processing received emails

[edit]

Right now I use Thunderbird on Ubuntu connecting to a number of external POP and IMAP servers (e.g. gmail). I'd like to enhance my current email system to add smarter processing and filtering of received emails (in particular I'd like to sort the email into several folders, based on several evolving criteria - it's something beyond what Thunderbird's rather basic filter setup can do). I'm a pretty competent Python programmer, so the actual filtering (and if necessary, retrieving the email) isn't difficult - but I don't see a simple way to deliver this email on to Thunderbird (or a similar program).

From looking at various howtos, it seems that I need quite a lot of stuff - fetchmail or getmail to get mail from remote POP/IMAP; an MDA like procmail to filter; a local POP3 server that takes procmail's output and re-presents it as POP (or IMAP); and only then can Thunderbird read the mail. This seems like an awful lot of stuff to set up, for one person reading three email accounts, delivering to one final client, with no need for remote access. I see why this paradigm would be necessary if I were supporting lots of recipients (i.e. hosting my domain's email servers myself), but for this simple task, this seems rather like overkill to me.

[Incidentally I can retrieve the email with getmail and deliver to an mbox inside my thunderbird's own storage, but Thunderbird doesn't see changes, and I guess isn't locking the files properly, as it doesn't anticipate anyone is doing anything nasty behind its back like this].

So my question is - is there a more straightforward way of configuring email fetch/filter/deliver-to-single-client than this? Thanks for your help. 87.114.154.43 (talk) 17:51, 29 December 2008 (UTC)[reply]

You could do everything up to the procmail step, but then use Movemail to get thunderbird to get the local spool. -- JSBillings 04:38, 30 December 2008 (UTC)[reply]

UVa online judge runtime error

[edit]

I solved the first problem of the first volume in the UVa Online Judge in C++. When I compiled it with the compiler and options specified on their page, and ran it on the sample input, it gave the sample output. But when I submit the code, UVa tells me "Runtime error".

  1. Is there some way to get the input for which my program failed, from the online judge?
  2. Could someone look at my code version 3? It uses C++ and STL. I write readable code (Atleast I think so ;-) )

--Masatran (talk) 17:55, 29 December 2008 (UTC)[reply]

Are you sure that "runtime error" isn't being generated by the website? After all, there are no uva challenges running. You could determine that with this. -- Fullstop (talk) 19:52, 29 December 2008 (UTC)[reply]
btw, was your code by any chance intended to demonstrate how not to program?
If you're going to be rude, you should elucidate your superior solution. And sign your posts. --Sean 21:27, 29 December 2008 (UTC)[reply]
I'm not the rude poster, but would say it could use more than the single comment that's currently included. StuRat (talk) 06:26, 30 December 2008 (UTC)[reply]

@Fullstop: The "Runtime error" is not a website error since the webpage is fine. I am not participating in any contest; in UVa, submissions are allowed outside of contests.

@StuRat: I have added comments, etc. Could someone look at my code version 4?

--Masatran (talk) 09:04, 30 December 2008 (UTC)[reply]

I have looked at the code; and one problem I see is that vector_extend() resizes the vector, which in this case just pushes uninitialized integers to the end of the vector. In update(), supposing the vector cycle_length isn't long enough, you extend it to length (cycle.back() + 1); then in the next line, you access cycle_length[cycle.back()], which would be the last element that you pushed on; but it is some uninitialized garbage. This raises a BIG RED FLAG. You cannot possibly have a good reason for accessing an uninitialized value. --71.141.112.60 (talk) 10:43, 30 December 2008 (UTC)[reply]
I read somewhere that C-style realloc() of native arrays extends with garbage values, whereas resize() of STL containers is done with the default data-type value. I don't remember where. Could anyone provide any references on this? --Masatran (talk) 11:51, 30 December 2008 (UTC)[reply]
Yeah but primitive types like "unsigned" don't have a default value (i.e. its default constructor returns an uninitialized value). --71.141.148.143 (talk) 21:29, 30 December 2008 (UTC)[reply]
I searched but could not find any references on this...so I rewrote the code without making the assumption. Thus, my code version 5 --Masatran (talk) 12:33, 30 December 2008 (UTC)[reply]
Regarding the comments, they're a definite improvement. However, I'd like to see more explanation in the header of the program as to it's purpose. It currently says "Collatz conjecture" and lists a web site. However, the program needs to say what it does without reference to a web site. Does it try to prove the conjecture ? Disprove it ? List some numbers in the sequence ? StuRat (talk) 14:39, 30 December 2008 (UTC)[reply]

Missing font support

[edit]

There are many symbols on the internet which I cannot view correctly, and appear as or similar. How can I view these symbols? (Vista Home Premium SP1, FF3). Dendodge TalkContribs 20:40, 29 December 2008 (UTC)[reply]

See Help:Multilingual support. --Sean 21:31, 29 December 2008 (UTC)[reply]

Album/Cover Art

[edit]

I've been trying to re-tag my music library so that the metadata is correct. One of my main goals, however, is to get some cover art for every song I have. I have been using MusicBrainz's Picard tagger to do the job. It *seems* like it is successfully saving the cover art, and I think it is because when I click on a file that supposedly has album art, the art is displayed. The only reason I'm not positive that it is working is that I cannot for the life of me get the album/cover art to show in Songbird! I switched to Songbird a while ago because I absolutely hate iTunes, and Songbird works just great...besides the cover art problem. Because Songbird is not recognizing the cover art, it is not being synced into my iPod. I am embedding the art in the ID3 tag. Any suggestions? Thanks. --71.117.36.29 (talk) 20:43, 29 December 2008 (UTC)[reply]

Slow rotation

[edit]

Last week I was having difficulty with the Internet like never before.

The details are in a section I started last week which no one answered in a short time, so it might not have gotten any responses.

What was different on this occasion was that when I clicked on "Diagnose" and "Repair" the computer went very slowly on both processes. And the circle that normally rotates quickly was rotating very slowly to the left of the name of the page I am going to.

I forget how to find out what version of Explorer I have, but here's the rest of my information, minus what identifies me:

OS Name Microsoft® Windows Vista™ Home Premium Version 6.0.6001 Service Pack 1 Build 6001 Other OS Description Not Available OS Manufacturer Microsoft Corporation System Name System Manufacturer HP-Pavilion System Model KT369AA-ABA a6512p System Type x64-based PC Processor Intel(R) Pentium(R) Dual CPU E2200 @ 2.20GHz, 2200 Mhz, 2 Core(s), 2 Logical Processor(s) BIOS Version/Date American Megatrends Inc. 5.23, 4/21/2008 SMBIOS Version 2.5 Windows Directory C:\Windows System Directory C:\Windows\system32 Boot Device \Device\HarddiskVolume1 Locale United States Hardware Abstraction Layer Version = "6.0.6001.18000" User Name Time Zone Eastern Standard Time Installed Physical Memory (RAM) 4.00 GB Total Physical Memory 3.99 GB Available Physical Memory 2.15 GB Total Virtual Memory 8.18 GB Available Virtual Memory 6.13 GB Page File Space 4.28 GB Page File C:\pagefile.sys Vchimpanzee · talk · contributions · 21:57, 29 December 2008 (UTC)[reply]

Too little information to diagnose. Try flushing your dns cache with ipconfig /flushdns, then releasing with ipconfig /release, and renewing with ipconfig /renew. neuro(talk) 22:50, 29 December 2008 (UTC)[reply]
Looking at your previous post, it sounds like you are using an external dialup modem, probably one that hooks up to your USB port. Is this correct? Who makes the modem? You might indeed want to get a new phone cable, especially if it's as flimsy as a twist-tie. Internally the copper wire may have broken inside the cable; and phone cables are cheap. Long phone cables should work fine (I used a 25-foot phone cable for net access for years) but as a general principle you ought to use the shortest cable that will reach the plug. Tempshill (talk) 16:12, 30 December 2008 (UTC)[reply]

No, it's not a dial-up modem. It was the power cord that was "flimsy as a twist-tie". Siemens makes the modem but it has the phone company's name on it and the phone company provides a manual which isn't worth much. The lights are only explained in the guide to setting up the computer.

The new cord connecting the modem to the phone jack, which has a splitter or filter, depending on who is describing it, is sturdier. The old one wasnt too substantial-looking.

By the way, the available disk space statistics are outdated. I just stored that information in case anyone asked, but the available disk space is pointless.

Neurolysis, I don't understand. The Internet is working fine now, though.Vchimpanzee · talk · contributions · 17:02, 30 December 2008 (UTC)[reply]

Composite video & audio cables for component video connection?

[edit]

Can I use the 3 RCA cables for composite video (yellow) and audio (red & white) to connect the 3 component video connections? I don't own nor can afford a component video cable. The connectors are the same (RCA connectors); and the cables look the same. So it should work, right? Unless there are any physical differences in electrical properties of the cables. --71.141.116.30 (talk) 22:46, 29 December 2008 (UTC)[reply]

Yes, they are the same. -- Fullstop (talk) 23:20, 29 December 2008 (UTC)[reply]
I do this for my HDTV setup, and I use A/B switches that were designed for composite cables. I have to use 2 of the switches (one has the 3 component video cables and one has the 2 audio cables), but the nice thing is not having had to pay $100 for a switch box. They're just cables, you're correct. Tempshill (talk) 16:07, 30 December 2008 (UTC)[reply]

Calculating CPU usage (Solved)

[edit]

There's an API function, GetSystemTimes, that tells you the total time spent by the CPU in three areas: kernel-mode, user-mode and idle time. I'm polling using this function every second and calculating the deltas (differences compared to the previous values) of the three times. How would I calculate the kernel-mode CPU usage (in %) and the user-mode CPU usage using these deltas? I've tried this article at CodeProject but I can't seem to get it working for calculating kernel-mode CPU usage and user-mode CPU usage as opposed to calculating the overall CPU usage. --wj32 t/c 23:07, 29 December 2008 (UTC)[reply]

you need a baseline to compute the percentage of. In other words, you need to know how much wall-clock time has elapsed in your clocking period. You get the latter from GetTickCount(). Then...
for...
FILETIME ftktime, ftutime; /* delta FILETIMEs. Rate=10,000,000 per/sec (100 nanosec resolution) */
DWORD elapsed_msecs; /* delta time from GetTickCount. Rate=1000 per/sec (1 millisec resolution) */
get...
ULONGLONG k_usecs = ((((ULONGLONG)(ftktime.dwHighDateTime))<<32) | ftktime.dwLowDateTime) / 10u;
ULONGLONG u_usecs = ((((ULONGLONG)(ftutime.dwHighDateTime))<<32) | ftutime.dwLowDateTime) / 10u;
DWORD ktime_perc = (DWORD)((k_usecs*10u) / (elapsed_msecs / 10u)); /* same as (k * 100) / elap */
DWORD utime_perc = (DWORD)((u_usecs*10u) / (elapsed_msecs / 10u));
That's off the top of my head, and intentionally unoptimized. ;) Note that none of these counters really have the rated resolutions. QueryPerformanceFrequency() gives you the real resolution. -- Fullstop (talk) 00:05, 30 December 2008 (UTC)[reply]
Thanks. Is there any way to do it just by using the three deltas? In that article there's a formula for doing that, but I'm not sure if it actually works. --wj32 t/c 01:31, 30 December 2008 (UTC)[reply]
elapsed_msecs, ftktime and ftutime are the three you need. elapsed_msecs is from GetTickCount, and the other two from GetSystemTimes (or GetProcessTimes). I might be able to say more if you tell me what you are intend to show (or what you are timing). -- Fullstop (talk) 01:50, 30 December 2008 (UTC)[reply]
Well... if you want to know - I have this project called Process Hacker (written in C#) at SourceForge. I'm making a clone of Process Explorer's System Information window. I have a CPU usage graph that should display the kernel-mode CPU usage (in green) and the user-mode CPU usage (in red).
I'm not actually using GetSystemTimes; I'm using NtQuerySystemInformation with SystemProcessorPerformanceInformation, but it's practically the same. It gives me a struct with IdleTime, KernelTime, UserTime, DpcTime, and InterruptTime. The weird thing is, KernelTime is always very large, almost as large as IdleTime, but UserTime is very small. This happens with both GetSystemTimes and NtQuerySystemInformation. So, I have two questions:
1. Shouldn't IdleTime be a lot bigger than KernelTime and UserTime, and why is UserTime so small compared to KernelTime?
2. How do I calculate the kernel CPU usage and the user CPU usage separately? You've already given me the answer, but is there a way of doing it without using GetTickCount?
--wj32 t/c 03:02, 30 December 2008 (UTC)[reply]
And, by "using the three deltas" I meant the idle time, kernel time, and user time. --wj32 t/c 04:11, 30 December 2008 (UTC)[reply]
I've found a solution! Thanks to this guy's tip:
 // Total all of the CPUs
 //      KernelTime needs to be fixed-up; it includes both idle &
 // true kernel time 
 //  Note that kernel time also includes DpcTime & InterruptTime, but
 // I like this.
.. and thanks so much, Fullstop! --wj32 t/c 07:31, 30 December 2008 (UTC)[reply]

Backdoor Again

[edit]

1. Remember that "backdoor.tidserv" virus I was talking about above? Well, I got rid of it by deleting it manually (or, more accurately, "them" since there were multiple copies of it on the computer) - and by manually, I mean going to their directory, removing them, then deleting them from the Recycle Bin. Is it safe to do it this way? And the search engines are still acting strangely (they take me to random sites instead of the site I want). How can I fix this?

2. There is another virus on the computer called w32.tidserv. Everytime I scan for it, it says it was cleaned by deletion, but when I restart the computer, the damned virus is still there. Could this other virus be the cause of Google's and other search engines' strange behaviour? And can I delete this other one manually?

60.230.124.64 (talk) 23:13, 29 December 2008 (UTC)[reply]

TidServ is a rootkit. I already gave you instructions for removing it; get IceSword and you will be able to delete the rootkit. Also, deleting viruses is definitely safe. Just don't try to unload rootkit drivers while they're running. --wj32 t/c 04:22, 30 December 2008 (UTC)[reply]
Deleting files manually is not sufficient to remove a virus from your system. Most viruses embed parts of themselves in various system files where you won't be able to get at them. Use an antivirus / antimalware program. If your antivirus program claims it cleaned your system but it seems like the virus keeps coming back, then try a different antivirus program as well. Tempshill (talk) 16:03, 30 December 2008 (UTC)[reply]