Wikipedia:Reference desk/Archives/Computing/2012 August 22

From Wikipedia, the free encyclopedia
Computing desk
< August 21 << Jul | August | Sep >> August 23 >
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.


August 22[edit]

IPsec server question[edit]

I'm trying to setup an ipsec system as follows but the documentation is maddening and most walk-through guides I've found differ from exactly what I'm trying to do (and are low on explanation). So, my first, simplest question is, can I setup a tunnel mode, pre-shared key, where a remote client behind a NAT can connect to the server using l2tp/ipsec? The server is also behind a NAT (I cannot change this; although port-fowarding is available). When the tunnel is established all client traffic should go through the server machine, including traffic to/from outside the server's subnet. Is this configuration possible with ipsec/l2tp?

Most of the guides I'm looking at envision either one or two of the endpoints as having a public IP, and then allowing secure access to the subnet behind it which is a slightly different configuration. I'm using openswan under linux right now, although that detail shouldn't affect this question. Shadowjams (talk) 01:09, 22 August 2012 (UTC)[reply]

Hmmm... I feel lonely. Shadowjams (talk) 23:18, 24 August 2012 (UTC)[reply]

All Audio out of sync[edit]

Hey last night suddenly all movie files (.mkv, .avi etc.) that previously worked fine suddenly had their audio out of sync to varying degrees, sometimes by as much as a minute or more.

I assumed that perhaps the CPU was doing a heap of work or perhaps the HDD was being written/read to by something else slowing it down but both of these theories were proved wrong when I copied the files across the network and two other computers had the same problem.

Nobody else on the internet seems to have ever had this problem and i'm straight up confused.

they're all running win7 with avast antavirus, using windows media player or VLC for playback, and connected by shared drives on the homegroup. --Benjamint 04:20, 22 August 2012 (UTC)[reply]

That is a very odd issue. I doubt that all of those files were changed. As a preliminary question, can you go and look at the modified dates on the files and see if they were modified around the time you started noticing the problem? I strongly doubt it's an issue with the individual files. The next step would be to copy an example over so there's no network issues, and see if you have the same problem. Also, check the version of VLC you are currently running, and if you can, when it last updated. Shadowjams (talk) 07:09, 22 August 2012 (UTC)[reply]


The VLC version was 1.1.11 untill i manually updated to 2.0.2 while trying to fix it. It's not only a few files, it's all files stored locally on all three machines now regardless of age or how long they've been there. virus? I'm totally flummoxed. -Benjamint 08:05, 22 August 2012 (UTC)[reply]
Well it's not magic — something relevant is common to each machine, be it a shared software update, badware (not heard of anything of this nature), or something else you've left out. I assume you've watched a video on some other unaffected computer to at least prove to yourself that you aren't going mad or have some medical condition? A decent second opinion on badware can be had by using ClamAV from a booted [http://www.sysresccd.org/Sysresccd-manual-en_How_to_install_SystemRescueCd_on_an_USB-stick#B.29_Recommended_USB_installation_method_from_Windows SystemRescueCD image. ¦ Reisio (talk) 13:46, 22 August 2012 (UTC)[reply]
(EC) You didn't mention whether you're using the same speaker setup (including amplifier etc) for all 3 computers. I would be surprised that it would cause such a long delay, particularly an apparently inconsistent run but definitely if you using the same setup and it's digital at any stage, I could try something else. Also when you say the files are stored locally, do you mean they've always been on the other machines (i.e. it's a problem that has occured in files that were in 3 different machines, not in files that were in 1 machine but you copied elsewhere to test)? And were they all shared over the network? Does the sync problem being as soon as you start the video or later? If it beings as soon as you start the video (I'm presuming you mean the audio takes a while to start), have you tried making sound via non video files, e.g. music files, games, OS built in sound test and seeing if that's delayed as well? Nil Einne (talk) 17:12, 22 August 2012 (UTC)[reply]

Pressing "J" or "K" while a file is playing will change the audio sync. Perhaps you pressed them accidentally on all three machines while using another program which required the use of those keys? You can check the audio desynchronization settings at Tools -> Preferences -> Show settings -> all -> Audio -> Audio desynchronization compensation. 92.233.64.26 (talk) 17:17, 22 August 2012 (UTC)[reply]

FTP Desktop Shortcut[edit]

Resolved

One of my translation agents wants me to use ftp for file transfer, rather than giving me a server to log in to, or sending files by email. However, the ftp address is in an email which will end up being buried sooner or later. I tried to add a desktop shortcut (as this is a regular agent), but I just ended up with a Firefox shortcut, rather than the usual Win7 ftp window, which is what I wanted (the Win7 ftp window doesn't update loads of addons everytime you load it, causing you to close lots of tabs). Is there a way to do this? KägeTorä - (影虎) (TALK) 07:13, 22 August 2012 (UTC)[reply]

Doesn't matter. I've done it. KägeTorä - (影虎) (TALK) 07:50, 22 August 2012 (UTC)[reply]

Java Question[edit]

Given the following statement, using the condition operator in Java, how is the initial boolean statement interpreted? Is it 'if c is equal to a and a is less than b'?

Thanks. meromorphic [talk to me] 11:53, 22 August 2012 (UTC)[reply]

A single = symbol in java is "becomes equal", an assignment. Double equals (==) is the test for equality. -- Finlay McWalterTalk 12:18, 22 August 2012 (UTC)[reply]
Right. Knowing this, and what the ?: operator is, yields the answer to the question quite easily. --Mr.98 (talk) 12:51, 22 August 2012 (UTC)[reply]
Knowing the relative operator precedence will also clarify things. -- Finlay McWalterTalk 13:42, 22 August 2012 (UTC)[reply]
Ah, I get it now. If a is less than b then c is set equal to a+b. If not, c is set equal to a-b. Thanks. meromorphic [talk to me] 14:53, 22 August 2012 (UTC)[reply]

UTF confusion[edit]

Copy the following text:

  • Mängel

Now place it into the utf-8 decoder. It states that the second character (ä) is an incomplete character in a multibyte sequence, and so it is dropped. This is causing confusion for my bot, because the PHP regular expression doesn't know what to do with the mangled character (yes, this is ironic; no, it is not intentional).

What in the world is going on with that character, and how can I get my regular expression to recognize it short of brute force altering the text? Magog the Ogre (talkedits) 17:02, 22 August 2012 (UTC)[reply]

Nevermind, the answer is far stupider than it appears on the surface: I had part of the regular expression typed in the wrong location. I would still be interested in knowing why this site and the terminal window in Ubuntu consider this character to be incomplete and disregard it. Magog the Ogre (talkedits) 17:21, 22 August 2012 (UTC)[reply]

Because, technically that's not a valid UTF-8 sequence! ä is a perfectly legal character; its unicode code-point isU+x00E4. But it isn't a single byte 0xE4. In many schemes, the byte value 0xE4 will be interpreted as an a-umlaut. In ISO-8859-1, or Windows-1252, 0xE4 is a-umlaut. In Unicode UTF-16, the two-byte 0x00 0xE4 is also a-umlaut. But not in Unicode UTF-8! UTF-8 uses the top bits to indicate start-of-a-multi-byte-sequence, so an 0xE4 as a standalone byte is not a legal UTF-8 character. Any program that's interpreting this text and rendering it properly is not treating it as UTF-8: those programs are heuristically determining that the codestream looks more like a single-byte-encoding (8859, or something like that). The correct UTF-8 mechanism to represent a lower-case a-umlaut ä would be 0xC3 0xA4. Some programs may choose to take a malformed single-byte UTF-8 byte and treat it as the least-significant bits of a UTF-16 two-byte stream; or interpret it as a single byte of ISO-8859-1, or use this as a contextual cue that the entire stream should be reinterpreted as "some other encoding."
For the sake of preserving sanity: don't try to understand copy-paste semantics. There's absolutely no guarantee that copy/paste works in any specific way, unless you've written both the source- and destination- program. Your operating system's clipboard can literally do anything it wants to text that has been copied and pasted. It can be marked up, it can be re-encoded, transcoded; the "text" that you selected might have been an arbitrarily-complex-rich-data-format-with-custom-system-clipboard-routine. The system may "paste" different data depending on the which program is receiving the "paste" call. When you copy, then paste, text, you can not assume that the data is preserved in any way. Nimur (talk) 18:44, 22 August 2012 (UTC)[reply]
They don't; you've confused encoding with decoding. 91.125.242.241 (talk) 18:35, 22 August 2012 (UTC)[reply]
The web site has five modes, none of which do what you seem to want (i.e., treat the Unicode input as UTF-8 and show the encoding of each character). The default "Embedded" mode only accepts ASCII according to the documentation. -- BenRG (talk) 23:59, 23 August 2012 (UTC)[reply]

HTML page break control[edit]

I have a webpage with many bridge hands on it. Each hand is separated by a horizontal rule. If someone prints the page out I would like to have the page breaks in the vicinity of the HR, ideally after, rather than split a table up across a page boundary.

I've tried

<hr align=center width="80%" size=3>

<div style="page-break-inside:avoid">

<h3> Board 21 </h3>

<p> Dealer: N <br> Vulnerability: N/S </p>

<table cellpadding=1 border=0>
  <tr>
    <td width=80>   </td>
    <td width=80> ( 16 ) <br> ♠JT97
        <br><font color=#ff0000>♥</font>A3
        <br><font color=#ff0000>♦</font>AK94
        <br>♣A63 </td>
    <td width=80>   </td>
  </tr>
  <tr>
    <td> ( 6 ) <br> ♠AQ62
        <br><font color=#ff0000>♥</font>864
        <br><font color=#ff0000>♦</font>6532
        <br>♣87 </td>
    <td> <img src="brg_tbl.bmp" width=70 height=70> </td>
    <td> ( 9 ) <br> ♠854
        <br><font color=#ff0000>♥</font>KQJ52
        <br><font color=#ff0000>♦</font>T7
        <br>♣QJ9 </td>
  </tr>
  <tr>
    <td>   </td>
    <td> ( 9 ) <br> ♠K3
        <br><font color=#ff0000>♥</font>T97
        <br><font color=#ff0000>♦</font>QJ8
        <br>♣KT542 </td>
    <td>   </td>
  </tr>
</table>

<p>  </p>

</div>

<hr align=center width="80%" size=3>

But it doesn't appear to work in either IE or Firefox. Any ideas what I should do? --SGBailey (talk) 17:09, 22 August 2012 (UTC)[reply]

Control over where browsers put page-breaks is done using the Paged media CSS options. In your case I think you want page-break-inside:avoid; - but as Comparison of layout engines (Cascading Style Sheets) shows, support for that still isn't very good. While they've been getting better, it's my impression that web browser developers don't prioritise good printing support. -- Finlay McWalterTalk 17:21, 22 August 2012 (UTC)[reply]
page-break-inside:avoid; is what I think I've done in the div. Have I done it wrongly or does it just not work? -- SGBailey (talk) 17:29, 22 August 2012 (UTC)[reply]
(I evidently didn't read your example carefully enough). Try it on just the table. Failing that, break-before and -after are a bit better supported - you can do a bit more formatting for paged media (where you pick the sizes of stuff so they'll fit on a letter/A4 page) and then use break-before and -after to force in pagebreaks - that's really suboptimal, as you're back to doing things in a word-processor-like WYSIWYG model, rather than the smarter way markup should be able to do. But even with those two being somewhat better supported, expect frustration and variability in actual browsers. -- Finlay McWalterTalk 17:44, 22 August 2012 (UTC)[reply]
OK, so I read this as meaning that basically browsers don't support sensible page breaks. Thanks -- SGBailey (talk) 17:49, 22 August 2012 (UTC)[reply]
It's worth trying, and I tend to leave it in even if it doesn't work well (in the hope that browsers catch up). Most web page developers don't give two hoots about printout (happily Wikipedia does print pretty well) and don't even do basic stuff like suppressing navigation controls in printout - so perhaps the browser makers are right to infer from this that no-one cares about printing. -- Finlay McWalterTalk 17:59, 22 August 2012 (UTC)[reply]
I care :-) -- SGBailey (talk) 20:21, 22 August 2012 (UTC)[reply]
I know it is horrid, but if I really really care about the page breaks, is there a better solution than screen capture the relevant lumps and display the page as a series of images? -- SGBailey (talk) 20:24, 22 August 2012 (UTC)[reply]
I should say that page-break-before:auto and page-break-after:auto are supposed to be hints, so do try to see how far they get you. I had one customer who rendered HTML+CSS to PDF with Prince XML, which reportedly has really good paged media support, but I wasn't involved in that myself. It's noteworthy that some sites that do care about print (websudoku, google-maps) still have a "print" button, which produces HTML+CSS optimised for page layouts. That's easier for them (as they're generating content with software) than you. -- Finlay McWalterTalk 20:29, 22 August 2012 (UTC)[reply]
Incidentally, if you put in the proper thead and tfoot tags into the table (which accessibility audit software will yell at you to do anyway, at least for thead), if the table is broken over a page boundary, Firefox at least will re-show the head and foot on the subsequent fragments too (which it should). -- Finlay McWalterTalk 20:44, 22 August 2012 (UTC)[reply]
Given the difficulties in making browsers print the way you want, what about providing a link to a downloadable .pdf prepared to do the same thing? Tom Haythornthwaite 18:33, 23 August 2012 (UTC) — Preceding unsigned comment added by Hayttom (talkcontribs)

GIMP 2.8 questions[edit]

When I upgraded to Fedora 17, I got GIMP 2.8. It works otherwise very nice, but I have some questions:

  1. How bloody hard is it to get a solid 1*1 brush? I want a brush that changes the colour of the single pixel I point my mouse at directly to the colour I'm painting with, and possibly does some minor anti-aliasing for the neighbouring pixels. But all GIMP offers me are huge brushes, the smallest of which is about 10*10 pixels. I have sort-of managed to do this by creating a new spherical brush with the radius set to minimum (0.1) and the hardness set to maximum (1.00) but even that doesn't work quite right.
  2. I closed the toolbox, thinking this would quit GIMP like it used to on Fedora 14. But now it only closed the toolbox and left GIMP running as usual. I brought the toolbox back, but it was missing the brushes dialog. I brought it back too, but now it's in a separate window. The toolbox says "add dockable dialogs here", but how exactly do I do this? I've tried every single mouse gesture I can think of with the brushes window. Do I need to type some magic command or something?
  3. "Save" in GIMP now only works in its own XCF format. To be able to save JPG or PNG images, I need to select "Export" instead, which saves the image, but still leaves GIMP thinking it's unsaved. Is this weird logic somehow by design? What possible use could it be of? Can I somehow make "Save" save in JPG or PNG format like it used to? JIP | Talk 19:02, 22 August 2012 (UTC)[reply]
  1. I can get 1px brushes and pencils fine: I just typed 1 into the size box in the tool option. It's always worked that way, I believe.
  2. You might try single window mode (windows->single_window_mode), which I've wanted forever.
  3. That's deliberate, and not welcomed by everyone. It's discussed here (that reviewer suggests some keyboard shortcuts he thinks will help). This may well be one of those changes that grates for a while, but so does accidentally losing all your layers and stuff, so I expect I'll get used to it. -- Finlay McWalterTalk 20:06, 22 August 2012 (UTC)[reply]

Old PC game from the '90s[edit]

What is it called? Old PC game from the 90's maybe earlier, you play a penguin (?) I think, definately set in a freezer and there are ice cubes and you can push the ice cubes to crush these purple things, and some of the ice cubes have got purple things in them and if you push them the purple things wake up, and you can also electrify the walls of the freezer and stun them, and it's a 2d game, and what was it called and how can I play it again? Thanks Horace Grundle (talk) 19:33, 22 August 2012 (UTC)[reply]

Iceblox? -- Finlay McWalterTalk 20:22, 22 August 2012 (UTC)[reply]
The original was called Pengo (video game), for Sega arcade machines. There's a freeware remake [1]. I remember playing a DOS version.  Card Zero  (talk) 21:34, 22 August 2012 (UTC)[reply]
If you want to play the original arcade game, try MAME (notwithstanding the legalities of owning/downloading the original ROM image of Pengo). Aah now that brings back memories of a misspent youth feeding too many 20c coins into machines! Sandman30s (talk) 13:00, 24 August 2012 (UTC)[reply]

Xine question[edit]

Now that I've upgraded to Fedora 17, I've also installed Xine. But when it starts up, it immediately pops up a message box about an unknown codec. I tried to play a .wav file I had recorded from VICE, but it also gave a message about an unknown codec. Presumably I've only installed the player itself, not any codecs. I just typed yum install xine. How can I install the codecs? I would also like to be able to play the numerous DVDs I've bought fully legally, but can't play with 100% free software thanks to copyright restrictions. I think I have to install xine-lib-extras-nonfree or something, but where can I get it from?

Also, is there any way to convert .wav files to .mp3 files so I could upload them to my Creative Zen Vision W and use it to play Commodore 64 game music when I'm carrying it around? JIP | Talk 19:39, 22 August 2012 (UTC)[reply]

Fedora is different from Ubuntu, which I'm used to, but this talks about additional repositories to yum to get non-free codecs for stuff like DVD. -- Finlay McWalterTalk 20:09, 22 August 2012 (UTC)[reply]
You can encode with sox, audacity, or vlc - they'll probably all need an additional package for the mp3enc -- Finlay McWalterTalk 20:09, 22 August 2012 (UTC)[reply]
LAME. If you'd prefer a GUI frontend, try WinFF, Arista, or HandBrake. ¦ Reisio (talk) 02:01, 23 August 2012 (UTC)[reply]

Varicode ambiguity[edit]

I assume varicode is used for data compression. How does ambiguity not arise when decoding a bit stream without fixed intervals? --Melab±1 21:55, 22 August 2012 (UTC)[reply]

You might have missed the bit that says The space between characters is indicated by a 00 sequence. That sequence doesn't appear in any other varicode. Vespine (talk) 23:05, 22 August 2012 (UTC)[reply]
Thanks. --Melab±1 23:21, 22 August 2012 (UTC)[reply]

Question about incorrect song size information[edit]

Some time ago, I asked a question about a song (a Latin remix of that song to be exact) that I download that was over 3 minutes long (3:48 to be exact) and over 8 MB (8.41 MB to be exact), but according to the “Properties” info, the bit rate was 192 kbps, which obviously didn’t sound right. I saw that there are many download links to this song with this incorrect info. But I found a link to that remix that was over 5 MB according to the song info and 192 kbps. Now, this sounded right and I also found many download links to the song with this info.

Now, not too long ago, I downloaded a music editing software called Sony Acid Pro 7. I decided to put each song, the one with that’s supposedly over 8 MB and the other one that is over 5 MB (5.68 MB to be exact), on each track to check and zoom into the wavelengths of both songs just to compare to see if there was any difference in their qualities by checking out their wavelengths’ size, if there were more or less or breaks in the lines and dots, and if there were more or less details. I found out that everything was exactly the same, which means that the bit rate for the song that said 8.41 MB was right, 192 kbps, but somehow, the size information was wrong.

By the way, I also have another music editing software called Audacity. In Audacity, you can decide at what bit-rate you want to export an audio track. I decided to export the song at 320 kbps to see what the size info would say after I exported it. The info said that at 320 kbps, the size would be around 8.72 MB. This further showed that the bit rate was right, 192 kbps, but that 8.41 MB as its size was incorrect.

So how can a song that is at 192 kbps and at 3:48 in length be 8.41 MB? Why and how is the song size information wrong? What could have gone wrong? Was it the way it was compressed or the way it was produced? Willminator (talk) 23:21, 22 August 2012 (UTC)[reply]

If you're talking about closed source software (Windows Explorer?) then you can pretty much only guess. If you find open source software coming to this conclusion, it's easy to find out why. ¦ Reisio (talk) 02:25, 23 August 2012 (UTC)[reply]
MP3 files can contain embedded artwork. In this case, the 8 megabyte MP3 file has a 3 megabyte image embedded in it. (I used Mp3tag to see it.) --Bavi H (talk) 03:10, 23 August 2012 (UTC)[reply]