Jump to content

Wikipedia:Reference desk/Archives/Computing/2008 October 27

From Wikipedia, the free encyclopedia
Computing desk
< October 26 << Sep | October | Nov >> October 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.


October 27

[edit]

Program to stitch PNG files (frames) into a movie.

[edit]

I used pymol to make a series of PNG files. The PNG files need to be put together to make a movie, using an external program. What free tools are available to do this? --Seans Potato Business 00:07, 27 October 2008 (UTC)[reply]

I know that convert can string multiple gifs into an animated gif as well as convert png to gif. I'm sure it can do a lot more. I couldn't easily find the wikipedia article for convert. -- kainaw 03:45, 27 October 2008 (UTC)[reply]
It's ImageMagick. Graeme Bartlett (talk) 03:47, 27 October 2008 (UTC)[reply]
I was going to add a note on convert, but you beat me to it. -- kainaw 04:01, 27 October 2008 (UTC)[reply]
That was the first place for me to look too! Perhaps you can make the entry look a bit better. Under unix the command starts with lower case "c" so it looks strange starting the sentence with a lower case convert. Graeme Bartlett (talk) 05:35, 27 October 2008 (UTC)[reply]
I've used VirtualDub for this sort of thing in the past. I'm not sure I recommend it though, it's a bit rough. APL (talk) 05:12, 27 October 2008 (UTC)[reply]
I use this mplayer command to make timelapses, works with png or jpeg (or anything else mplayer can read): mencoder "mf://*.JPG" -vf scale=640:480 -o mjpeg2.avi -of lavf -ovc lavc -lavcopts vcodec=mjpeg -lavfopts format=avi -mf fps=15 Polvi (talk) 05:51, 27 October 2008 (UTC)[reply]
I use mencoder too - but it's a tough tool to use well. It's a command-line tool with an utterly insane number of options. This makes it extremely powerful - but painful to get right. SteveBaker (talk) 12:23, 27 October 2008 (UTC)[reply]
Quicktime Player Pro can also do this. --70.167.58.6 (talk) 14:25, 28 October 2008 (UTC)[reply]

Search engine indexing

[edit]

Approximately how long does it take a search engine to update its search results? For example, if I mark my userpage with __NOINDEX__, approximately how long does it take for this to take effect? -- penubag  (talk) 01:50, 27 October 2008 (UTC)[reply]

This is nothing more than an anecdote. It is not a theory based on data. When I make a change to kainaw.com, I see updates to the main search engines within 3 days. Usually, it happens in 24 hours, but has taken longer from time to time. -- kainaw 03:47, 27 October 2008 (UTC)[reply]
About three days and my userpage will stop appearing on Google? Alright, thanks for the info.-- penubag  (talk) 04:05, 27 October 2008 (UTC)[reply]
No - it's much more complex than that. Most search engines check 'important' pages more often than unimportant ones. Also, after you delete your page, it'll continue to be in Googles "cache" for a while afterwards. So, for fast-changing and popular news sites, Google may update in only hours...but for a rarely-visited and low-scoring (ie unimportant) page, it may be weeks before Google gets around to re-checking it.SteveBaker (talk) 12:22, 27 October 2008 (UTC)[reply]
If you're in a hurry, you can request urgent removal of your page from Google. They don't make any guarantees, but at least it'll give their searchbot a hint that your page might need revisiting. Then again, I wouldn't be surprised if they were monitoring Wikipedia's RecentChanges feed anyway. —Ilmari Karonen (talk) 15:35, 27 October 2008 (UTC)[reply]
ugh, if Wikipedia is updated a lot, why hasn't __NOINDEX__ taken effect yet? I would ask Google to take down my page, but other search engines are going to still have it up, as well as all the millions of Wikipedia mirrors sites.-- penubag  (talk) 10:56, 28 October 2008 (UTC)[reply]
Aside from anything else - you should be using the {{NOINDEX}} template...but I doubt that'll make much difference. At any rate - Google doesn't do ranking based on the entire website - it does it page-by-page - so your user page may well be so unimportant that it won't get re-examined for ages. OTOH, the Wikipedia front page probably gets re-checked every 30 minutes or something. SteveBaker (talk) 19:51, 28 October 2008 (UTC)[reply]
Ah, I see. If it's going to be ages, I might as well ask them to take it down. -- penubag  (talk) 03:28, 29 October 2008 (UTC)[reply]

A PROBLEM IN C++ [COMPUTER PROGRAM]

[edit]

2 4 5 1 7 6 3 8 THE QUESTION IS TO FIND THE NO. OF CYCLES IN IT. FOR EG: THE FIRST NO. IS 2 SO THE 2ND NO. IS VISITED AND AGAIN THE 4TH NO. IS VISITED WHICH IS 1.AGAIN THE 1ST NO. IS VISITED. SO THE 1ST CYCLE IS ::::2 4 5 1 ONE CONDITION:: ONCE A PLACE IS ALREADY VISITED IT CANNOT BE VISITED AGAIN LIKE 4 AND I CANNOT BE VISITED AGAIN

PROBLEM:: I HAVE DONE THE PROGRAM BUT THE OUTPUT IS NOT CORRECT

#include<iostream.h>
#include<conio.h>

void main()
{
 int a[20],temp[10];
 a[0]='\0',temp[0]='\0';
 int cycle=0,pos=0,t=0,i=1,j=0,k=0,n,m;
 cout<<"Enter no. of array elements::::";
 cin>>n;
 cout<<"Enter the array elements"<<endl;
 for(i=1;i<=n;i++)
 {
  cin>>a[i];
 }

 while(i<=n)
 {
  if(a[i]==i)
	cout<<a[i];
  cycle++;

  a[i]=pos;

  if(a[pos]>pos)
  {
	temp[t++]=a[pos];
	pos=a[pos];
  }
  else
  {
   temp[t++]=a[pos];
	k=a[pos];

	cout<<"cycle"<<endl;
	for(j=k;j<pos;j++)
	{
	 cout<<a[j]<<" ";
	}

	cycle++;
  }

  a[pos]='\0';
  pos=0;
  k=0;

  i++;
  for(m=0;m<t;m++)
  {
	if(a[i]==temp[m])
	 i++;
  }
 }
 temp[0]='\0';
 cout<<"No. of cycles"<<cycle;
}

Well...

#include<iostream.h>
#include<conio.h>

void main()
{
 int a[20],temp[10];

It's a bad idea to use 'magic constants' like 20 and 10 - you need to give them names and declare them as 'const int'.

 a[0]='\0',temp[0]='\0';

Why '\0' and not just 0 ? The notation '\0' means "a character whose ASCII code is zero" - why are you using a character to initialise an integer?

 int cycle=0,pos=0,t=0,i=1,j=0,k=0,n,m;
 cout<<"Enter no. of array elements::::";
 cin>>n;

What happens if the user doesn't type in a valid number? You need to test for illegal entries and re-ask.

 cout<<"Enter the array elements"<<endl;
 for(i=1;i<=n;i++)
 {
  cin>>a[i];
 }
  • You also need to check that the user actually entered a valid number each time around the loop.
  • You need to be careful that the user doesn't enter a number bigger than 20 because you'll overflow the array 'a' and probably crash your program.
  • Arrays in C start with an index of zero...not one - so 'int a[20];' declares an array with 20 elements starting at a[0] and running up to a[19]. Your loop runs from 1..n. It should be 'for(i=0;i<n;i++)'
 while(i<=n)
 {

When the loop (above) finishes, 'i' will always be equal to 'n+1' - so this 'while' loop will never execute. I have no clue what you're trying to do here (because the question you started with is written so confusingly)...but whatever your goal, this will never achieve it. Probably you really need another for loop just like the one you used to read in the data.

  if(a[i]==i)
	cout<<a[i];
  cycle++;

  a[i]=pos;

  if(a[pos]>pos)
  {
	temp[t++]=a[pos];
	pos=a[pos];
  }
  else
  {
   temp[t++]=a[pos];
	k=a[pos];

Because 'temp[t++]=a[pos]' happens whether or not 'a[pos]>pos' - you should move this statement up above the 'if' statement to save code.

Around about here - I pretty much gave up trying to help you. This code is almost impossible to follow because you have not given your variables meaningful names and there are no comments telling us what's going on. Because your statement of the problem is hard to understand, I can't tell whether what you need to do is what you are actually doing...so I can't tell whether this is right or wrong. However, the profusion of little adjustments of indices and the use of arrays that start at different indices speaks of poor grasp of the algorithm you're trying to implement. I think you should start off by writing down what the program is going to do in English before you write a single line of C code. Break it down into steps and use that English as comments when you actually start writing the code. Make your variable names meaningful - and don't re-use them for multiple jobs.

Also - this is clearly a homework problem - and we're not allowed to do your homework for you. SteveBaker (talk) 12:17, 27 October 2008 (UTC)[reply]

As SteveBaker says, give meaningful names to variables. "n" is bad, something like "length_of_input" or "size_of_array" is better.
It may help to write the problem in pseudocode (human-readable made-up code) first - not only will this make writing the program easier, but the person marking the problem will give you more marks for making it easier to follow your logic.
As I understand the problem, you need to read in a list of integers. Starting at the first element in the list, use the value of that element as the index of the next element. If that index has already been visited, then stop (otherwise we'll go round in a circle). For that, I'd use the following pseudocode:
int read_integer_from_user() {
   /* you could use sprintf for this */
}
int main(argc, argv) {
   int values[max_size_of_array]; // a list of values we want to work with
   int visited_how_many_times[max_size_of_array]; // how many times we've been to each index
   for (each value in visited_how_many_times) { set value = 0 }
   
   size_of_input = read_integer_from_user()
   if (size_of_input < 1 || size_of_input >= max_size_of_array) { error }
   for (i = 0; i < size_of_input; i++) {
      values[i] = read_integer_from_user()
   }
   
   current_element_index = 0 // start at first element in the list
   while (1) { // this is an infinite loop - leave it using "break"  
      if (current_element_index < 0 || current_element_index >= size_of_input) { error }
      if (visited_how_many_times[current_element_index] > 0) {
         // we've been here before, lets get out of the loop
         break
      } else {
         visited_how_many_times[current_element_index] += 1
      }
      print "index=", current_element, "value=", values[current_element]
      // the element value is the next index, starting at 1 (our arrays start at zero, so minus 1)
      current_element = values[current_element] - 1
   }
   
   print "the end" // done!
}
I would make read_integer_from_user a function, as you use the same code several times. max_size_of_array could be done with #define max_size_of_array 20 --h2g2bob (talk) 15:55, 27 October 2008 (UTC)[reply]
It isn't clear from the original post whether the task is to detect if any cycles exist (I think this is what H2G2Bob has done) or if it is to count the total number of cycles. In that case I would extend H2G2Bob's pseudo-code to perform the following, by iterating the starting point:
...

for (array_starting_index = 0; array_starting_index <max_size_of_array; array_starting_index++) {
   current_element_index = array_starting_index // start at first element in the list


   // after detecting presence of a cycle, iterate through all members of that cycle
     ...
   // Record and sort those members in some convenient way
     ...
   }

// We now have several lists of cycles and we must check which ones are unique
//  If they are sorted, establishing uniqueness should be easy, so remove duplicate cycle records
//  Count number of unique cycles
...

Now this code can check whether every index in the array is a member of a cycle; it also checks for disjoint cycles. I think that is what the program is expected to return or print at the end. Nimur (talk) 17:18, 3 November 2008 (UTC)[reply]

Logging Program

[edit]

I am looking to have a website for people to sign in and out of study hours. It would have to log their IP address as well as the time in order to match it up to a place on campus. The user would be able to enter in the time to log out, but that time can be no later than the current time. Also, the user would be able to sign in at any time, to check their total time logged. A safety would probably need to be built in so that if they sign in from another location while they are "checked in" an alert pops up both to the user, as well as in the log.

The basic idea is to have a log sheet on the internet that matches times with locations that can be retrieved by the administrator. Is this possible? And, if so, would it be cheap? --omnipotence407 (talk) 15:53, 27 October 2008 (UTC)[reply]

I don't understand all of this question, especially this bit:
"The user would be able to enter in the time to log out, but that time can be no later than the current time."
By any chance do you mean: "that time must be later than the current time"? CBHA (talk) 16:07, 27 October 2008 (UTC)[reply]
I am also confused by the question. If students are using an on-line application to study then surely the application will log usage information ? On the other hand, if the students could be studying from textbooks etc. and are just signing in and out on a honour system, so you have no way of verifying that they really did spend this time studying, then why not just ask them to keep a record their study time and send a weekly e-mail; the administrator could manually log study time into a spreadsheet or simple database. Gandalf61 (talk) 16:35, 27 October 2008 (UTC)[reply]

It would be based on the honor system, but with a need to verify location. There isn't an online study application, it is merely a combined log sheet for multiple locations that can checked at whatever time the administrator sees fit. The time thing is so they can put down a time earlier than the present in case they need to sign out if they forgot to when they left, however, they cannot sign out in advance.--omnipotence407 (talk) 19:19, 27 October 2008 (UTC)[reply]

Depending on your network setup, the user's IP address may or may not have any geographic significance. You can easily obtain the IP address via an API call from a variety of web development programming environments, but you will need to check with your local networking people to find out if that will be a meaningful value to determine geographic location.
For example, in PHP, you can use $_SERVER['REMOTE_ADDR'];, see [1]. Nimur (talk) 17:25, 3 November 2008 (UTC)[reply]

Norton Antivirus question

[edit]

Sometimes when I'm using the computer, Norton Antivirus (ver 12.8.0.4) starts a disk scan.

I would like to be able to pause or stop the scan and have it restart later when the computer is not being used.

I realize this is something the software maker should answer but in my experience they make it difficult to ask a question, much less get an answer. That is why I'm asking here.

Thanks, CBHA (talk) 16:01, 27 October 2008 (UTC)[reply]

Don't use Nortan, use a free antivius like Clamwin --78.150.149.70 (talk) 17:15, 27 October 2008 (UTC)[reply]
Ignoring the rather unhelpful comment above, I can't say if this is 100% correct but most antivirus suites allow you to specify what time your regular scan occurs (3am is a common time) - check the settings. Exxolon (talk) 19:24, 27 October 2008 (UTC)[reply]

Video and audio editing

[edit]

I'd like to ask a few questions (couldn't find the right software to start with... by searching and googling)

1) is there any specific software that helps with video editing - cutting, merging...etc?

2) is there any software that can convert video to audio (e.g. to extract what is being said in a film and save it as an .mp3 file)?

I'd prefer free software, but any suggestions are welcome.--123.203.44.97 (talk) 17:00, 27 October 2008 (UTC)[reply]

  1. The two most widely used video-editing programs are Final Cut Pro and Avid. These are what all the pro's use when putting together a movie. As for free versions, I've heard decent things about Cinelerra, but I can't testify to it personally. See also List of video editing software
  2. There's lots of tools to do this, ffmpeg being perhaps the most famous. It is, however, command-line, so it's a little tricky to do. I'm fairly certain that Avidemux can do this pretty easily. Belisarius (talk) 17:27, 27 October 2008 (UTC)[reply]
I would use VirtualDub (combined with CCCP) for the second one, but I don't know if VirtualDub can handle the first one. --wj32 t/c 05:24, 28 October 2008 (UTC)[reply]
mplayer can do it too - but it's also a fairly ikky command line monster. SteveBaker (talk) 19:32, 28 October 2008 (UTC)[reply]
For Q#1, I've found that good ol' Windows Movie Maker is the easiest - it can do everything that all the other free ones can do, but its already on your computer (or, if u have a mac, iMovie is the best vid editor by far for that platform). 75.66.48.112 (talk) 04:47, 30 October 2008 (UTC) flaminglawyerc 04:50, 30 October 2008 (UTC) (forgot to sign in)[reply]

MSN on outlook

[edit]

I made an email address of <user>@msn.com using the MSN explorer. Now i want to use this email address on Outlook or Thunderbird. I cannot find settings. Can anyone help? I've not paid for any MSN service. —Preceding unsigned comment added by Muhammad Hamza (talkcontribs) 17:57, 27 October 2008 (UTC)[reply]

This page from Mozillazine gives some help about setting up MSN Mail accounts which support POP messaging. Microsoft says that POP accounts are not available for free accounts. Try one of the other email websites! --h2g2bob (talk) 21:40, 27 October 2008 (UTC)[reply]

Converting .SWF video into h264 .M4V or Quicktime?

[edit]

I have a SWF that only contains video. Is there a way I can convert it into something my iPod or PS3 can handle? --70.167.58.6 (talk) 21:27, 27 October 2008 (UTC)[reply]

Use iSquint. --98.217.8.46 (talk) 01:00, 28 October 2008 (UTC)[reply]

Recommendations for a good Mac forum to join

[edit]

I have the feeling I'll be needing expert specialized knowledge soon... Does anyone have recommendations for a forum on Macs? I have an old Mac system (OS X 10.2) on an old Mac G4 (AGP graphics), so am looking for a board with lots of users with experience with different types of software and hardware. Also a high-traffic site so I would be more likely to get my question answered. Not that I won't ask the fine people here (see my next question), but I've been looking to join a good Mac forum anyway. TresÁrboles (talk) 22:29, 27 October 2008 (UTC)[reply]

I've found the Forums at Macrumors.com to be excellent--very active, with knowledable and helpful people.--Zerozal (talk) 13:44, 28 October 2008 (UTC)[reply]
Thanks for the suggestion; I'll check them out. TresÁrboles (talk) 19:48, 29 October 2008 (UTC)[reply]

I disabled services I shouldn't have and can't start them again...

[edit]

Under windows 2000, I disabled and stopped services that I thought was extraneous but my computer is weird now, skype doesn't work, etc. so I want to start them again, but it's not possible...any hints? Thanks.

Please give more details. How is it not possible? --wj32 t/c 05:33, 28 October 2008 (UTC)[reply]

Startup prob on Mac!

[edit]

I think my disk drive may be failing. The background is: icons starting disappearing on one of my partitions. After some fiddling around with opening and closing the window, and trying to list them out in Terminal with ls, and trying to find them using the Search files, some of them reappeared, but I know a lot of files are still missing. The weird thing is the ls command in Terminal won't even show the files that have reappeared, at least not if you only do an "ls" or "ls -al" (I also tried with sudo so permissions are not the problem). Using wildcards also won't work, e.g. "ls myfile*". But you can find them if you specifically name the full filename, e.g. "ls myfile.txt". Crazy! Anyway, that has been the situation for some days while I just left the Mac on (which I normally do), afraid to restart it -- I half thought a restart would fix things, and half thought it would entrench the screwiness. Well, unfortunately things were taken out of my hands, when we had a power outage at the house. When I powered back up, the disk icon for that disk partition was missing. Using the Disk Tool showed it was not mounted. (All the four other partitions of the actual 120GB hard disk were mounted.) I went to the Disk First Aid tab and ran repair (which I have never done before but it looked like an appropriate thing to do). It gave some message about corrupted nodes I think and then redoing a tree, and then said it was repaired. I then tried to mount the partition, but it didn't work. I think I then tried to run a Verify and then another Repair, and then I restarted the Mac.

Eep. After a long time, it finally got to the gray Apple logo startup screen where it continued to spin its wheels, and then it stopped and gave up. Now there is text in the upper left hand corner: "sh-2.05a#"

HELP!

(I just googled this, and it looks like it's the prompt for the UNIX monitor. I have a bit of UNIX admin experience, but still don't know how best to proceed.)

The operating system is OS X 10.2 and the Mac is a G4 (AGP). Yes, it's very old in computer years (8+ in human years)!

Please help if you can! Or recommend a good place to ask (see my previous question)! Thanks in advance! TresÁrboles (talk) 22:57, 27 October 2008 (UTC)[reply]

It's possible that you are in the openfirmware prompt (the BIOS commandline for mac), try typing boot or mac-boot and see if that does anything. Check to see if you can view the invisible files with this command prompt, its unlikely, but a software module loaded when mac os x starts up is corrupted and is inhibiting your ability to view your files. If not, it looks like a good option would be to copy all the files you can to a backup disk using that command prompt then try reinstalling Mac OS X (it's possible that this is a software problem). If the reinstall doesn't work, then I'm not sure what else will help. Foxy Loxy Pounce! 23:19, 27 October 2008 (UTC)[reply]
O.K., I'll have to sleep on this first and do more research... I may want to see how I can change my startup drive to the smaller (original 20G) drive... but it has Mac OS 9 on it. TresÁrboles (talk) 05:16, 28 October 2008 (UTC)[reply]
If you are having serious hard drive problems (and it sounds like you are), I would recommend getting DiskWarrior. It costs money but it's way more powerful than the free Mac harddrive tools. It can work some miracles. In any case, keep in mind that your goal at this point is just to get it working again, so you can get everything you need off of it. Even in things work perfectly after this episode you probably will want to get a new hard disk just to be safe. --98.217.8.46 (talk) 00:59, 28 October 2008 (UTC)[reply]
Is DiskWarrior O.K. for my version of OS X? By the way, I've been spoiled by my Macs. I'm a Mac owner since 1984 and while the original didn't have a hard drive, I have never had any sort of problem with my Quadra 650 from 1993-2000, and my G4 from 2000 until now (even with herds of dust bunnies around). I don't know what was inside my Quadra, but the G4 came with a 20G Western Digital drive, and that's why I got a Western Digital brand for the second (ut primary in usage) drive (I forget when - maybe 4-5 years ago?) TresÁrboles (talk) 05:16, 28 October 2008 (UTC)[reply]
Current versions of DiskWarrior do not support 10.2, but according to their requirements page you can contact them and buy earlier versions. --98.217.8.46 (talk) 00:35, 29 October 2008 (UTC)[reply]
Thanks for the tip! TresÁrboles (talk) 19:49, 29 October 2008 (UTC)[reply]