Wikipedia:Reference desk/Archives/Computing/2011 January 13

From Wikipedia, the free encyclopedia
Computing desk
< January 12 << Dec | January | Feb >> January 14 >
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.


January 13[edit]

distinguish sound files[edit]

I know I already asked this, but I'm hoping there might be someone here today who has an answer.

I have sound files from field recordings that I recently found are not identical to their back-up copies despite having the same time stamp. (I discovered this when I scanned my comp for duplicate files.) I'm afraid that some program I used to listen to them may have made changes, though I never saved anything. This won't matter if it's metadata, but I wonder if some got slightly corrupted. I need to send copies to various archives, and am not sure which copy to rely on. Is there any free/shareware out there that will show me where the differences are? — kwami (talk) 22:59, 5 January 2011 (UTC)

As I mentioned before, if you can checksum the files, you can establish exactly-identical files. Similarly, checksumming the data portions of the files but excluding the metadata could establish exactly-identical audio data. For "almost identical" audio, the situation is much harder. This could be the case if the mp3 or file were transcoded - even if there is no perceptible change in audio quality.
Both Audacity and GNU Octave can plot, display, visualize, and manipulate audio files from standard formats. You can load audio files in Octave with auload:
% Example GNU Octave script to load and compare two WAV files:
[data1,fs1] = auload("file1.wav");
[data2,fs2] = auload("file2.wav");

% Check that the sampling rate and file sizes are identical
assert(fs1,fs2);
assert(size(data1), size(data2));

%Plot the residual error between the two audio signals
resid = data2-data1;
plot(resid);
If the audio is identical, the residual should be exactly zero; if the audio files are similar, the residual should be small. You can use ffmpeg to convert mp3 to wav files before diffing them. (I've thought about diffing the compressed data; but arguably, it is really best to decode it first, and then perform comparisons. It is best to diff an uncompressed waveform decoded by a standard tool - ffmpeg - because different decoders may produce different waveforms from the same mp3 data. Any tool that reverses the lossless coding of an mp3 must apply interpolations and to some extent, an heuristic algorithm. By using a standard tool like ffmpeg up front, we avoid hassles and get a uniform waveform). You can convert files from mp3 to wav easily using this command:
ffmpeg -i file.mp3 file.wav
If you are familiar with more sophisticated audio signal processing, you can design a program to check if the audio has been "trivially" altered, such as changing the volume, adding or removing a delay, and so on, using xcorr and other more complex audio processing. Unfortunately, because sampled audio is complicated, there is not an easier way to determine "almost" identical files. You could also investigate using a binary diff tool, but I have never found those to be very helpful. You could also wrap these conversions and comparisons into an Octave or other script. Nimur (talk) 23:30, 12 January 2011 (UTC)[reply]
As mentioned compression changes are more difficult to detect, but one potential (it a little work intensive) solution to other concerns would be to load both into a program like Goldwave (and I presume Audacity would have a similar capability), which will show the exact waveform. First check the attributes of the file for bit-rate, length, ect. then zoom in to a reasonable view that allows you to visually compare. It would be easy to do the things mentioned by Nimur (if the volume was increased, the peaks will be higher, a delay or echo will result in slightly shifted peaks or echo spikes. It might be a worthwhile way to quickly see if anything has been done 65.29.47.55 (talk) 22:13, 13 January 2011 (UTC)[reply]
Thank you, Nimur and anon! I'll try this out. I have .wav files which have not been intentionally altered since they were recorded (Marantz digital recorder); all I have done is transfer them from one drive to another, and play them with programs like SoundForge and PRAAT. — kwami (talk) 23:57, 13 January 2011 (UTC)[reply]

Big files and Fraps![edit]

Hi, I use a program called "Fraps" to record and save videos of games that I play. I store the videos on my hard drive to later edit and upload to youtube. The only problem is that the video files end up way too large and they take up over 200 gigs on my hard drive. What are some programs that will help me scale down the size of the files without losing the high quality of the videos? What is the best program for this and whats the best free program for this?(I might be willing to pay some cash if the free programs prove to be too infective). I'd really appreciate some help and thank you for your time. :) (Ahalol123 (talk) 00:10, 13 January 2011 (UTC))[reply]

If you have money, Adobe Premiere will do this. Whether or not you have money, the free program VLC media player will do this, too. Of course, compression comes at a cost. You can tweak the video compression settings as you like to choose the tradeoffs between quality and file size — the higher the quality, the higher the file size will be. In your shoes, I would try several of the VLC settings using the highest quality compression settings possible and I think you'll be pleased. Comet Tuttle (talk) 00:17, 13 January 2011 (UTC)[reply]

Converting the video to XviD or h264 or something similar will drastically reduce the filesize. See Avidemux, Handbrake, MEncoder and Category:Free_video_conversion_software 82.44.55.25 (talk) 00:20, 13 January 2011 (UTC)[reply]

Thanks for all the help! I really appreciate it! My computer already has Adobe premiere installed, so money isn't really a problem. I'll try out both and see how good they work because I'm only really looking for the most efficient and quick program to use as I have a lot of files. Thanks again for the support! (Ahalol123 (talk) 00:30, 13 January 2011 (UTC))[reply]

Depending on what version of Premiere you are running, you may want to be sure to choose "Adobe Video Encoder" (or a similar item under the File menu) rather than "Save As" or "Export" — the former gives you the flexibility and codec options you'd expect. Comet Tuttle (talk) 22:44, 13 January 2011 (UTC)[reply]
FFMPEG, and the user-friendly version provided with the WinFF user-interface, are free software. FFMPEG supports conversion to and from almost all major formats. It is the core video engine used in almost all free and commercial (in modified form) video processors and players; so using FFMPEG nearly guarantees compatibility with most video players. Nimur (talk) 01:01, 13 January 2011 (UTC)[reply]

There's a lot of suggestions here, which one is the best? Thanks again for all the help. (Ahalol123 (talk) 02:15, 14 January 2011 (UTC))[reply]

I'm pretty sure every program listed above (excluding Adobe and maybe mencoder) uses FFMPEG "under the hood." So, you'll get the same results. HandBrake, WinFF, and so forth do have some value-add, being a bit easier to use (ffmpeg is a command-line tool); so it's a matter of your preference. In my opinion, the command-line interface is very easy to use; here are instructions for starters. Nimur (talk) 04:44, 14 January 2011 (UTC)[reply]

I tried using VLC media player and Virtualdub but I couldn't figure out how to do it properly, and then I used WinFF like you said but it took an extremly long time to compress and I was wondering if there's anyway to make it automatically compress another video after its done with one. (Ahalol123 (talk) 20:41, 15 January 2011 (UTC))[reply]

Being a command line, you can type several lines together into a script file (end in .bat) and then execute that. Video encoding takes plenty of CPU, so you will need to pick te options that make the best use of your cpu's instruction set. If you have multiple disk drives put your output on a different disk from the input. Graeme Bartlett (talk) 21:07, 15 January 2011 (UTC)[reply]

I only understood like 1/5 of what you just said, LOL. (Ahalol123 (talk) 21:55, 15 January 2011 (UTC))[reply]

Graeme was explaining that video processing normally takes a long time. It can take anywhere from several minutes to many hours to process "normal-sized" videos on moderately-powerful computers. If you want to squeeze a bit more performance, you can follow those suggestions, but it's probably not going to make a huge difference. Nimur (talk) 17:54, 16 January 2011 (UTC)[reply]

Flash 8 (ActionScript 2.0) question[edit]

Another question because of my complete n00bness! So, on the first frame:

stop();
var a:Number;
var c:Number;

On a button (I called it 'hello') in the same frame:

on(release){
	a = (c) * (3);
	gotoAndStop(2);
}

There is a textbox in the same frame with the variable c. You can input text in it (I don't know the exact name for this kind of boxes because I'm using the Chinese version.)

On frame 2, there's a textbox (which is able to display variables, but you can't input anything into it), and its variable is a.

What went wrong? Thanks Kayau Voting IS evil 10:48, 13 January 2011 (UTC)[reply]

What is not behaving the way you expect it to? I see your code, but I don't see what you are expecting it to do. --Mr.98 (talk) 14:45, 13 January 2011 (UTC)[reply]
Make sure the input text box has an instance name. (In the example below, I named it txtInput. Then, try something like this:
on(release)
{
	c = txtInput.text;
	a = (c) * (3);
	gotoAndStop(2);
 }
Then, add a text field to the second frame, make it dynamic (not static), and give it an instance name. In the example below, I called it txtOut:
stop();
txtOut.text = a;

--Best Dog Ever (talk) 19:22, 13 January 2011 (UTC)[reply]

Thanks! (BTW, it's for the same game that I asked about last year. Yeah, I still haven't finished it.) Kayau Voting IS evil 13:40, 14 January 2011 (UTC)[reply]

Copy (file differences)[edit]

If I have a 10GB file and change one tiny part of it, to copy the modified file to a backup drive with Windows 7 requires that the entire 10GB be copied. Is there a way to copy just the new changes of the file, similar to how DropBox only uploads the changed parts and not the entire file? 82.44.55.25 (talk) 14:56, 13 January 2011 (UTC)[reply]

If the file is in a human-readable text format, then the diff program can extract the differences, and the patch program to reapply them to the original. These are standard UNIX tools, and should be available on MacOS. There are ports to MS-Windows, including the cygwin and mingw toolsets. BTW, I've taken the liberty of clarifying the question's title CS Miller (talk) 15:27, 13 January 2011 (UTC)[reply]
This is delta encoding; the standard tool I know for it is rsync (the article lists Windows implementations). --Tardis (talk) 15:30, 13 January 2011 (UTC)[reply]
The problem is that file systems keep track of when each file was last modified, but not of which parts were modified when. Therefore, you would have to read the old file in its entirety to figure out which parts had changed, and that will take about as long as blindly writing over the whole thing. Rsync saves time when the bottleneck is a slow network connection, rather than the disk. It still reads the whole file, but it uses CRCs to compare the old and new data without sending it over the network. -- BenRG (talk) 23:23, 13 January 2011 (UTC)[reply]

Developing Native iPhone applications on Windows[edit]

I know that there are ways of writing iPhone applications on Windows and I was wondering how I could set up a native build environment on Windows that can compile to current (iOS 3.x and iOS 4.x) versions of iOS. iOS devices use an ARM architecture and GCC and LLVM/Clang can compile to ARM instructions sets so how would I go about using one of these to compile an iOS app into an IPA file (a ZIP file that contains the app payload for iTunes? Please, save any comments about how iOS SDK is only for the Mac or how the Apple won't allow apps developed with third-party tools because I couldn't care less about Apple's rules. --Melab±1 16:39, 13 January 2011 (UTC)[reply]

Because Apple iPhone's system architecture is proprietary, and nobody has yet reverse-engineered it, writing software for their phone without their SDK will be much more complicated than merely compiling for the CPU. (GCC can trivially cross-compile for many architectures). Compiling valid machine-code for their CPU is step one. But you also need to know what addresses and interface protocols they use for at least the following: their boot sequence; their nonvolatile storage; their video output interface; and their user-input interface. As I understand the iPhone and iPod products, they also have hardware signed executables - so you will have to learn that system and either bypass or spoof it. To accomplish these tasks, you could assume whatever you like about those systems, and perform a trial-and-error compile cycle, but if you are incorrect, you may compile a perfectly functional and valid executable that is not able to do anything on the iPhone. You probably also will want to reverse engineer their network stack, their peripheral devices, and presumably any hardware accelerators that reside on- and off-chip on the phone. Apple doesn't publish what memory-mapping, CPU instruction extensions, or other unknown mechanisms are used to perform those interfaces, so you will have to "guess", based on any information you can glean from their official development environment. Nimur (talk) 17:32, 13 January 2011 (UTC)[reply]

200 Apple[edit]

This link returns the http status code "HTTP/1.1 200 Apple". List of HTTP status codes does not list this, nor can I find any information via google on what "200 Apple" is about 82.44.55.25 (talk) 19:44, 13 January 2011 (UTC)[reply]

In HTTP, like several other Internet protocols, the text after the 3-digit code doesn't have any strict meaning. It's just there to make the response more human-readable. A server can use the generic "OK" or something more informative. This "Apple" probably just means that some Apple software is being used on the server. Whatever it is, it's meaningless to the HTTP client. See RFC 2616 section 6.1.1 67.162.90.113 (talk) 20:23, 13 January 2011 (UTC)[reply]
It's informational as .113 says. Apparently it's put out by systems running WebObjects, which is weird because there's also a "X-Powered-By: ASP.NET" header there. --Sean 20:54, 13 January 2011 (UTC)[reply]

remove duplicate lines[edit]

I have a text file with lets say a million lines in it, but many are duplicates. How, on Windows 7, could I automatically remove the duplicate lines leaving only one instance of each? 82.44.55.25 (talk) 20:07, 13 January 2011 (UTC)[reply]

http://www.netikka.net/tsneti/info/tscmd097.htm ¦ Reisio (talk) 20:24, 13 January 2011 (UTC)[reply]
1. Install ActivePerl. 2. Run this:
perl -ne 'print unless $saw{$_}++' input.txt > output.txt
Done. --Sean 20:59, 13 January 2011 (UTC)[reply]

Twitter Terms of Service[edit]

In their official Terms of Service, Twitter states: "We may not monitor or control the Content posted via the Services and, we cannot take responsibility for such Content." I am confused about the phrase "we may not..." Does this mean they are not permitted to monitor or control the content, due to some legal obligation? (Wiretap legislation comes to mind). Or, does this merely mean that they might not choose to monitor or control content, depending on their mood? Nimur (talk) 21:09, 13 January 2011 (UTC)[reply]

I think they mean the latter; it's their get-out clause when their service is misused in some way, or when a kid posts a suicide note or something. -- Finlay McWalterTalk 21:17, 13 January 2011 (UTC)[reply]
Yes, I would read it as the latter. Think about it: how likely is it that a company would ban themselves from "monitoring" the content on their own service? "Monitoring" might mean as little as "a guy looks at a post once in a while". Comet Tuttle (talk) 22:42, 13 January 2011 (UTC)[reply]
I understand (although I may be wrong) that it operates in a similar way to facebook in that regard - They don't employ people to monitor all facebook posts/updates, but they do have a team to respond to notifications about spam posts/users or innapropriate content. This system relies on users of the service (in this case twitter) reporting the content/post/update - Facebook has a 'flag' button to report such content, twitter allows you report spam-users. You may have already read this, but if you haven't, it gives a little insight into how they deal with problem users Darigan (talk) 15:11, 14 January 2011 (UTC)[reply]
(Above unsigned post not added by me.) In concurrence with CT and FM, I'd say basically it's way of covering both their bases. It's a disclaimer they don't normally monitor, so aren't responsible for content. But they also don't want to suggest they never monitor, since they may very well do so in some cases and don't want people taking their statement as a guarantee they don't monitor (and trying to sue them if they do). As unsigned says, as with many services they almost definitely primarily rely on users reporting problems. Nil Einne (talk) 14:41, 14 January 2011 (UTC)[reply]
The post above Nil Einne's was mine, forgot to sign it, sorry all (just added sig now) Darigan (talk) 15:11, 14 January 2011 (UTC)[reply]

Screen saver with own pictures[edit]

I want to make someone (who uses Windows XP) a screen saver with own pictures. I know that Windows XP allows you to use any pictures with a Windows screen saver... but I'd rather use something else as long as it's a) free, b) add-free, c) easy-to-use / -install (and ultimately de-install!), d) doesn't bog down the system, and e) small. Does software like that exist?

(The background is that I got from that person a screen saver as a present years ago when Windows didn't yet offer the built-in saver. Now I'd like to "return" the present, a little tongue-in-cheek of course, but I'd rather not just copy pictures onto the person's computer saying "Hey, use those with your own software!" On the other hand we both know of course that Windows offers the service for free and with decent quality, so it shouldn't be any worse than that.) Thanks a lot, Thanks for answering (talk) 22:49, 13 January 2011 (UTC)[reply]

Running out of memory when using IE on YouTube[edit]

If I run through several videos in a YouTube Playlist while using IE, eventually my computer stops running videos because IE (I'm using IE 8) fills up all of the available memory. I can look at Task Manager and see that iexplore.exe is huge, and I have to kill IE and restart to continue watching videos. This does not seem to be happening with Firefox, though I don't normally use Firefox to watch YouTube videos. Is there something I can do to get IE to release its used memory, or is this just a problem that I'll have to deal with by using Firefox on YouTube all the time? (I already use Firefox for Wikipedia because IE takes eons to display history pages in WP). Corvus cornixtalk 23:53, 13 January 2011 (UTC)[reply]

You might consider using Google Chrome Frame, which works inside IE. You could likely then get even further performance boosts by joining the YouTube trial which uses natively supported WebM video playback instead of Flash-embedded playback. …or you could just stop using IE. :p ¦ Reisio (talk) 01:38, 14 January 2011 (UTC)[reply]
Either close down browser tabs you don't need (each of the tabs is a separate Internet Explorer process, using up a lot of memory), use a more memory-efficient browser, or install more memory. 118.96.158.185 (talk) 01:38, 14 January 2011 (UTC)[reply]
The reason why I prefer IE over Firefox is that my RealPlayer is configured to download videos when using IE, but not when using Firefox. Corvus cornixtalk 02:20, 14 January 2011 (UTC)[reply]
Wha? ¦ Reisio (talk) 02:32, 14 January 2011 (UTC)[reply]
??? Corvus cornixtalk 03:03, 14 January 2011 (UTC)[reply]
I'm betting that Reisio is wondering why anyone would use RealPlayer. Go ahead and read the article to see what I mean. Dismas|(talk) 03:20, 14 January 2011 (UTC)[reply]
Because it lets me download videos direct from the video screen. Of course, they're in .flv format, but then I can convert them for my video MP3 player. Corvus cornixtalk 03:24, 14 January 2011 (UTC)[reply]
Did you know that you can cut out a step by doing all of that in Firefox? Dismas|(talk) 03:54, 14 January 2011 (UTC)[reply]
Thanks, that was good to know, but RealPlayer lets me download videos from other sites as well. Corvus cornixtalk 04:18, 14 January 2011 (UTC)[reply]
How about this add-on instead? Or you can try upgrading RealPlayer and/or Firefox. I have both RealPlayer SP 12 and Firefox 3.6 installed, and that version of RealPlayer claims to support "Web Download & Recording" on Firefox (it has the options to enable the feature, but I never actually used that feature). 118.96.158.185 (talk) 04:51, 14 January 2011 (UTC)[reply]
Hah. Thanks. I didn't know about that. I didn't have to do any configuring to get it to work with IE. Cheers. Corvus cornixtalk 05:21, 14 January 2011 (UTC)[reply]