Jump to content

Wikipedia:Reference desk/Archives/Computing/2008 March 20

From Wikipedia, the free encyclopedia
Computing desk
< March 19 << Feb | March | Apr >> March 21 >
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 20

[edit]

How would I get this on my iPod?

[edit]

It was pointed out to me by a friend. Anyways, I managed to wrestle out the .swf, but iTunes rejects that format. What do I do? Thnx! Yamakiri TC § 03-20-2008 • 10:59:22 PS I'm NOT a furry.

Search google for "swf to m4v" which returns this program: Flash to Video Encoder. That program isn't free but if you play with those search terms you may come up with something that works (like converting the flash file to mpeg or whatnot then to iPod's preferred format).--droptone (talk) 11:50, 20 March 2008 (UTC)[reply]
There's a program called iSquint that you can use to convert FLV files to MP4 for the iPod. It is free and wonderful. --Captain Ref Desk (talk) 12:53, 20 March 2008 (UTC)[reply]
SUPER will convert between most file formats, including swf and iPod video. --jjron (talk) 14:51, 21 March 2008 (UTC)[reply]
Rendering swf shows to rasterized video is re dic u lous ly sticky business and I seriously doubt SUPER can do it. I've done it once to convert this to a stupid mpeg 1 or whatever DreamScene requires.. it was 2 hours of grueling ffmpeg/mencoder chaining, and I had to try half a dozen shareware swf renderer/capturers before I found one that works. And I can't help but notice that the filename is caramelldansen.. you can get a higher quality version here. It's the speedycake remix (the original is molasses slow and cake is a cool guy) and you'll have to hack around with the web page to find a di did it for you. :D\=< (talk) 05:40, 22 March 2008 (UTC)[reply]

JPEG "fool you" screen

[edit]

I'm looking for a simple Windows program that can load a JPG image to fullscreen when double-clicked, similar to a boss key.

Here's one. --grawity talk / PGP 17:01, 20 March 2008 (UTC)[reply]

Power point-losing narration

[edit]

I have many slides with narration embedded in the presentation. When I went into some slides to change the narration I deleted each by highliting the small speaker on the slide and put new narration on the slide. When I go to the very next slide that follows the slide with the changed narration the narration on that slide is gone. This has happened with every slide that follows a slide that I changed narration on. I have searched everywhere for an answer. Any help would be greatly appreciated. Thanks. 76.188.26.251 (talk) 13:09, 20 March 2008 (UTC)[reply]

I don't suppose it's possible you had narrations spanning more than one slide, and when you deleted the narration from the first slide, it consequently deleted it from those following as well? --jjron (talk) 14:54, 21 March 2008 (UTC)[reply]

Wikipedia error message

[edit]

I am, as of yesterday, getting a Wikipedia generated error message every time I go to my watchlist: "You seem to be using the javascript-enhanced watchlist, which is incompatible with the category watchlist script at present; please uninstall it." What changed that this is happening, is there anything I can do to stop getting the error message short of uninstalling and what happens if I keep both, i.e., one or both won't function? Something else? --Fuhghettaboutit (talk) 13:19, 20 March 2008 (UTC)[reply]

You might want to ask the help desk or the village pump technical, they might have a better idea of what's specifically the problem with those scripts :D\=< (talk) 16:37, 20 March 2008 (UTC)[reply]

CSS question

[edit]

I have some text that I'd like to be in a box that will resize to contain the text no matter what the user does to resize or shrink the text. Basic stuff, a table could do it in a second. But I can't seem to get the CSS to work out.

Here's the relevant CSS: #menus { width: 150px; padding: 0px; margin: 0px; margin-top: 20px; margin-left: 180px; padding-left: 10px; padding-top: 10px; padding-bottom: 10px; }

"menus" is just a div with some text in it. My problem is that if I don't set the "width" property, it'll go all the way over the right edge of the screen. If I do the set the "width" property, it'll only fit when the text is a specific size—if I use "enlarge text size" or "decrease text size" in the browser then it won't fit.

What should I do here to make it behave properly? Ideally I'd like it to act like a table cell—with the borders expanding only as needed to fit the contents, and resizing with the content automatically. --Captain Ref Desk (talk) 14:38, 20 March 2008 (UTC)[reply]

A partial solution (not as precise as the table solution you describe) is to specify the width in ems rather than px (e.g. width: 10em;) as that varies with the text size (you'll have to experiment a bit to find a reasonable baseline, depending on the font you're using, and indeed if the browser has do to font-substitution to render the page then this will throw your calculation off a bit). -- Finlay McWalter | Talk 14:45, 20 March 2008 (UTC)[reply]
That works pretty well. Thanks! --Captain Ref Desk (talk) 14:58, 20 March 2008 (UTC)[reply]

syscalls from assembly PARTIE DEUX

[edit]

I asked this at the bottom of the last question, but it was archived away off the page. The answer to his question was that to do a syscall you have to load up values into EAX and EBX and trigger an interrupt to trap into the kernel. My question is.. if the kernel is reading those values out, part of it must be written in assembly / machine language since AFAIK it's impossible to read values off registers from C. Wouldn't that spawnkill all chance of easy portability? How does the ultimate of portables NetBSD handle this problem? Also, I thought most of the Linux kernel was written in C.. how does that assembly part of the kernel call C functions? Is there some entry point function that's specially compiled to always be in the same location in memory? :D\=< (talk) 16:36, 20 March 2008 (UTC)[reply]

1) yes, all kernels have at least a little bit of assembly language to glue things together, 2) it doesn't kill portability because it's only a small portion of the kernel, 3) I dunno, 4) Linux is indeed mostly written in C. You can call C functions from assembly as long as you use the right calling conventions, 5) I'm not sure what you mean, but you do set up interrupt vectors to tell the CPU where to trap to when the syscall implementation does the "int 80" or whatever. See [1]. FYI:
# cd /usr/src/linux
# find -name '*.[ch]' | xargs cat | wc -l
6181926
# find -name '*.[sS]' | xargs cat | wc -l
250175
# find arch/ppc/ -name '*.[sS]' | xargs cat | wc -l
13240
--Sean 16:50, 20 March 2008 (UTC)[reply]
(edit conflict) It's up to a given operating system how it handles syscalls, and even within a single operating system, the method can vary from hardware architecture to hardware architecture. Typically, in modern operating systems, a syscall looks just like an ordinary subroutine call (for that architecture) except that somewhere along the way, the processor switches from "User" mode to "Kernel"/"Supervisor"/"Executive" mode. Within that more-protected "inner" mode, the executive then validates all the user's parameters to make sure they're consistent and not trying to cheat the various system protections, and it then executes the call.
Atlant (talk) 16:54, 20 March 2008 (UTC)[reply]
That perfectly answered my questions, thanks :D\=< (talk) 16:54, 20 March 2008 (UTC)[reply]
  • part of it must be written in assembly / machine language - yes, the part of it that catches and dispatches the syscall is - see http://www.win.tue.nl/~aeb/linux/lk/lk-4.html
  • it's impossible to read values off registers from C - impossible in normal C (but then systems programmers never write in normal C, they're always messing with platform and environment specific stuff) - the Linux kernel could have done this with asm embedded in C (which gcc allows) or with compiler extensions that do allow C to refer to a specific register. I'm more familiar with MIPS, where most C compilers allow you to refer to special variables like __r1 which refers to CPU register 1 (MIPS registers have much saner names than Intel)
  • Wouldn't that spawnkill all chance of easy portability? - indeed, the file in question is architecture specific. But then the SYSCALL mechanism itself is architecture specific. While on x86 you call INT x80, on other architectures you call BRK, or just deliberately exectute an instruction you know you're not allowed to (they're all the same - they force a CPU fault which dumps execution into a kernel-space handler).
  • Also, I thought most of the Linux kernel was written in C - most of it is, but it's impossible to do absolutely everything in C. In addition to syscalls you generally have to have the first few instructions in ASM (to set the CPU up, as CPUs start with everything either undefined or downright turned off). And there's often stuff to do with handling CPU exceptions, coprocessor conditions, and manipulating the registers (and stack) of user-mode programs (both when spawning and when doing a context switch)
  • How does the ultimate of portables NetBSD handle - the same way everyone else does, they have an architecture (and platform, and board) specific module which does all the non-portable stuff. Calling a kernel "portable" really just means there's very little in this, with most code in the platform-independent section
  • how does that assembly part of the kernel call C functions - assembly and C can call one another easily - both compile down to object modules (ELF or whatever) with unresolved external symbols - symbols that are then resolved (in a manner almost identical to that in an application's compile) by the linker. The only real complexity is that you need to specifically worry about calling convention (how parameters are passed).
  • Is there some entry point function that's specially compiled to always be in the same location in memory - depending on the architecture interrupts are handled via a hardware table (I think this is how Intel works), which is initialised by the OS (it fills it with hooks for each of the prevailing event handlers). The same is true for other non-interrupt event handlers (like memory exception etc.). The only thing that is absolutely fixed in memory is the address to which a booting CPU jumps (which for your desktop computer is a real-mode address inside the flash BIOS). In practice BIOSes enforce a fixed memory map on the (real mode) code that they load from disk (or whatever) - that's generally GRUB or LILO or OBP or whatever. If you want to know "how do I get a piece of code to be located at a specific numbered address" then you have the compiler put it in a special section and then tell the linker (and often a bespoke locator to resolve outstanding fixups) to put it at a special address. And all that is architecture specific (and board-specific, although in the case of PCs all boards work the same).
-- Finlay McWalter | Talk 17:07, 20 March 2008 (UTC)[reply]

Make document open when I visit a page

[edit]

Is it possible to make a word file I have saved on my computer open automatically every time I visit a certain webpage or open firefox (the former is preferred) and, if so, how is it done? Thanks in advance, George D. Watson (Dendodge).TalkHelp 18:01, 20 March 2008 (UTC)[reply]

I'm not sure I quite understand your question. Do you want a local file to open (in MS Word), whenever you visit www.example.com? --LarryMac | Talk 19:43, 20 March 2008 (UTC)[reply]
Yes please, sorry if i wasn't clear enough. George D. Watson (Dendodge).TalkHelp 19:47, 20 March 2008 (UTC)[reply]
OK, well one way I can think of to do this is make a small HTML/Javascipt file that you keep locally and make a bookmark. I'll have to work out the details, but basically instead of typing in www.example.com in the address bar, you'd use the bookmark to load the local file, which would have an "window.onload" action to open the Word doc and then link to example.com. Hmmmmm. There might be better options, but I'll work on the javascript until somebody smarter comes along. --LarryMac | Talk 19:55, 20 March 2008 (UTC)[reply]
Do you have control of the content of that website? x42bn6 Talk Mess 05:10, 21 March 2008 (UTC)[reply]
No, I know how to do it on sites I have control over but I need someting to open when I visit the Wikipedia main page. George D. Watson (Dendodge).TalkHelp 11:55, 21 March 2008 (UTC)[reply]
You'd probably need a Firefox Addon because I don't believe it's possible to capture that event by default. I can't think of an addon that does this job but I'll look for one. x42bn6 Talk Mess 17:47, 21 March 2008 (UTC)[reply]
You could probably do it using Greasemonkey, if you can do it with JS.
If you can do it with remotely loaded JS on sites you have control over, and you're after having it on Wikipedia, then you might be able to do it using MediaWiki's user JS support as well - see meta:Help:User_style#JavaScript or Wikipedia:WikiProject User scripts for some starting points to how that works. - IMSoP (talk) 21:13, 23 March 2008 (UTC)[reply]

World of Warcrack

[edit]

Do the people in the World of Warcraft adverts really play it? Vitriol (talk) 19:27, 20 March 2008 (UTC)[reply]

You mean the celebrities like Mr. T, William Shatner, and Verne Troyer?--droptone (talk) 20:00, 20 March 2008 (UTC)[reply]
Yeah. Vitriol (talk) 00:44, 21 March 2008 (UTC)[reply]
Are you kidding? No way :D\=< (talk) 04:40, 21 March 2008 (UTC)[reply]
How can we know? How can you say for certain whether someone you don't personally know plays it or not? Does WoW have a public list of players? Uh, no. It's possible, though. Certainly, if I had a product that I wanted Mr. T or Captain Kirk to help advertise, I'd give him a free toaster/plant/whateverIsell. It wouldn't cost me very much, and it may help. "Gee, not only does he do their ads, but he really does keep that stupid plant in his kitchen. I guess it really does help with warts!" -SandyJax (talk) 13:39, 21 March 2008 (UTC)[reply]
Play suggests an ongoing action, not something they tried once. And sorry, there's no way William Shatner and Mr. T play wow. :D\=< (talk) 16:05, 21 March 2008 (UTC)[reply]

(and was the title misspelt on purpose?) -SandyJax (talk) 13:39, 21 March 2008 (UTC)[reply]

Probably. :D\=< (talk) 17:11, 21 March 2008 (UTC)[reply]

SIMULATION IN COMPUTER GRAPHICS

[edit]

I wanna know that what is simulation graphics. I have searched on internet and found that simulation means virtuality but how it is concerned with computer Graphics.117.99.6.238 (talk) 20:42, 20 March 2008 (UTC)[reply]

Simulation is making something look like it's there when it's not. It's hard to explain really. A roller-coaster simulator makes it look (to you) like you're riding a roller-coaster when you're really sat in an arcade somewhere. George D. Watson (Dendodge).TalkHelp 20:45, 20 March 2008 (UTC)[reply]
(simple)Virtual reality. – i123Pie biocontribs 07:57, 21 March 2008 (UTC)[reply]

Data type as parameter in C#

[edit]

Can the functions below be replaced by a single function that takes uint or double (or any other type or class with the Parse function and < > operators) as a fourth parameter? NeonMerlin 21:56, 20 March 2008 (UTC)[reply]

static uint PromptUInteger(uint minimum, uint maximum, string prompt)
        {
            uint input;
            while (true)
            {
                Console.Out.Write(prompt);
                try {
                    input = uint.Parse(Console.In.ReadLine()); // will throw an exception if the input can't be parsed as a uint
                    if (input < minimum || input > maximum)
                        throw new Exception(); // also throw an exception if it's out of range
                    break; // if we've gotten this far, we can exit the loop
                } catch (Exception e) { // but if we did throw an exception...
                    Console.Out.WriteLine("Please enter an integer between {0} and {1}.", minimum, maximum); // report incorrect input
                }
            }
            return input;
        }
static double PromptDouble(double minimum, double maximum, string prompt)
        {
            double input;
            while (true)
            {
                Console.Out.Write(prompt);
                try
                {
                    input = double.Parse(Console.In.ReadLine()); // will throw an exception if the input can't be parsed as a double
                    if (input < minimum || input > maximum)
                        throw new Exception(); // also throw an exception if it's out of range
                    break; // if we've gotten this far, we can exit the loop
                }
                catch (Exception e)
                { // but if we did throw an exception...
                    Console.Out.WriteLine("Please enter a decimal number between {0} and {1}.", minimum, maximum); // report incorrect input
                }
            }
            return input;
        }

irritating IE6 css problem

[edit]

Here's my CSS:

body {
	background-color: black;
}

#main-content {
	background: url("images/myimage.jpg") no-repeat;
	background-attachment: fixed;
}

And here's my HTML:

<body id="main-content" leftmargin="0" topmargin="0" bottommargin="0" rightmargin="0" marginwidth="0" marginheight="0">
	<div id="content">
	Blah blah
	</div>
</body>

Goal is to display a fixed background image as part of the BODY attribute but have it be flexible so that I can just use one stylesheet with different IDs assigned to the body tag.

In Firefox and Safari, it works fine. But in IE6, it only works fine with the div with the id of "content" is totally empty. Does not work at all when there is something in it — just displays as a black background.

Any thoughts? I know IE6 is deprecated but sadly it is still a major player on the browser market. I'd rather not do some sort of browser-specific workaround but if there is a better way to do it that IE6 will like...? --Captain Ref Desk (talk) 23:05, 20 March 2008 (UTC)[reply]

Did you try explicitly doing
#content { background-color: transparent; }
in the CSS? Also, I don't design websites for a living or anything, but I can't stand the idea of websites being redesigned around Internet Explorer. If perfectly legal CSS doesn't work on non-standards-compliant browsers, then that is their problem for using a browser that incorrectly displays webpages. It'll be no surprise to them when everything looks like crap because IE incorrectly renders pages and they're doing it to themselves. Dump the stupid users still using IE and make the internet a better place :D\=< (talk) 02:40, 21 March 2008 (UTC)[reply]
I can't stand to redesign around IE either, and deeply resent Microsoft's apathy towards adhering to web standards, but unfortunately we do not always have the luxury to look lousy to 25% of all web clients. This isn't an instance where we have the ability to set the terms—in fact, the concerns of the designer are only paramount in the smallest and most insignificant sorts of sites. Unfortunately the bottom line—in this case, "will it render adequately on most machines?"—matters more than the technical considerations, though I'm eager to accomplish this with fewest hacks as possible (because a page littered with hacks and workarounds often ends up being rather unstable as well). "That is their problem" is pretty inconsistent with "the customer is always right," and depending on the purpose at hand, it's my job to mitigate their problem as much as possible (at the very least by making things fail gracefully).
But I'll give the transparent bit a try, thanks for the suggestion. --Captain Ref Desk (talk) 16:08, 21 March 2008 (UTC)[reply]
Update: Whattaja know—that little fix seems to have made it work out fine. Thanks for the suggestion! --Captain Ref Desk (talk) 16:19, 21 March 2008 (UTC)[reply]

By the way, anyone read this? Kushal 22:32, 23 March 2008 (UTC)[reply]

good article. the thing is, as observed before, most folks don't buy a computer for the hardware, that's just to run the OS; and they don't buy it for the OS, that's just to run the apps; and nowadays they don't buy it for the browser app, that's just to see the webpage. so, if somebody's crappy buggy myspace page breaks the perfectly functional browser in the perfectly functional OS on the perfectly functional hardware, they'll still take it back. Gzuckier (talk) 19:31, 24 March 2008 (UTC)[reply]