Wikipedia:Reference desk/Archives/Computing/2007 November 4

= November 4 =

Safari
I foolishly downloaded a new beta version of this onto my Apply Powerbook G4 and it is causing troubles. Can anyone please advise how I can delete this and return to the original pre-installed stable version. Thanks in anticipation.--88.109.95.158 00:48, 4 November 2007 (UTC)
 * See this page — Matt Eason (Talk &#149; Contribs) 10:47, 4 November 2007 (UTC)


 * Thanks for this Matt, but still can't find the uninstaller programme despite the hints given. Any more ideas please?--88.109.95.158 14:09, 4 November 2007 (UTC)


 * Sorry, I can't check myself because I'm not on a Mac. Can you find /Library/Application Support/Apple/.SafariBetaArchive.tar.gz via the Terminal? The thread that post links to also suggests downloading the beta again and finding the uninstaller in the DMG. — Matt Eason (Talk &#149; Contribs) 15:37, 4 November 2007 (UTC)


 * Looked at that but there is no /.SafariBetaArchive.tar.gz nor could I find this on the hard disc anywhere via 'Spotlight'..ah well.....--88.109.95.158 16:29, 4 November 2007 (UTC)

Can't you just download Safari 3? It's not in beta anymore, I'm using it. —Preceding unsigned comment added by 71.195.124.101 (talk) 16:40, 4 November 2007 (UTC)
 * It is still in Public Beta, according to Apple's website. --24.147.86.187 16:00, 5 November 2007 (UTC)


 * According to, minimum system requirements are Mac OS X Tiger 10.4.9 or later, and a minimum 256 MB memory. Safari 3 works on Apple PowerPC G4 processor.

Let us know how it goes ...

--Kushalt 22:52, 4 November 2007 (UTC)


 * Thanks for this but looking at Mac Downloads today the only mention of Safari is "Safari3 Beta". !  Where do I find Safari3 please?--88.109.95.158 07:02, 5 November 2007 (UTC)

Good question! According to Safari (web browser), "a final version was included as the default browser in Mac OS X v10.3" This does not make sense. Why is a public beta still available (unless it is a Perpetual beta)? Kushalt 04:23, 7 November 2007 (UTC)
 * What about it doesn't make sense? It's in public beta. It is not out of it yet. It's marked as public beta because there are probably bugs still being worked out. This is not uncommon. --24.147.86.187 01:29, 8 November 2007 (UTC)


 * That's fine and large, but it still does not help me out of dilemma !!--88.109.95.158 08:10, 8 November 2007 (UTC)

Backup
I am doing a fresh install of Mac OS X v10.5 Leopard on my computer. I am trying to copy my iLife 06 apps on an external USB hard drive (FAT32) so I can install them on Leopard, however I am unsure if this is possible. If so, is it sufficient to back up just the apps, or do I need to backup other things (i.e. preference files).

Thanks, — Curran  (talk 01:02, 4 November 2007 (UTC)


 * Along with the .app files, you should backup the library files. Check for individual application names in \Library\Application Support\ and \User\Library\Application Support\. If there are obvious preferences files located in \Library\Preferences\ then it is a good idea to save those too, as they might contain your registration data, etc. Oter than those spots, though, there isn't a lot else that needs to be backed up. --24.147.86.187 14:42, 6 November 2007 (UTC)

Java Virtual Machine/API
I was wondering if someone could explain or point me towards an explanation of the following:

''Suppose I write a small Java program which includes the API's found in JFC,AWT,Swing, etc. I write it to create a window, and draw a line on it, or something similar. I compile it and run it, and lo there's my window with a line.

Now, if I run the same program from a terminal when there is no X server, the JVM throws me an error message saying that the Java program is trying to use the X window system, but it's not available. Fair enough!

My Java program is just a string of byte-codes and operands, right? which in theory are restricted to the memory and stack inside the JVM, like a brain in a jar in a mad scientist's lab. '' I'd like to understand how the JVM recognizes that the brain wants to access something outside the jar, ex the graphics API of the host system, or the sound system of the host, or even to send out a stream of text like 'hello world'.

For example, is there a special opcode that means, 'JVM, take this address and do something with it'

Thanks,

--Duomillia 03:15, 4 November 2007 (UTC)
 * Well all of the JVMs for each platform know how the platform works- the linux JVM knows where to look to check if the x server is running -- ⁪ffroth 05:39, 4 November 2007 (UTC)
 * (ec) A Java program is basically a bunch of opcodes that must be run through a virtual machine, and is restricted to the memory and stack inside it, right. However, you must remember that there are many implementations of the virtual machine, basically one per operative system. In other words, the dudes at Sun (and at other places like the FSF) need to create one virtual machine that understand the Java opcodes per operative system. You cannot install the virtual machine for Windows in Linux, nor the one for OSX under Windows. Therefore, we can assume that, while all virtual machines interpret the opcodes in the same way, their implementation varies depending on the operative system. So, the Java program may have an opcode that says "draw a point", and all virtual machines understand that opcode as to "draw a point". However, the Windows implementation of the virtual machine will use a Windows API function to draw that point, while the Linux virtual machine will use an X API function to draw it.
 * Yes, there are some opcodes that are translated as "JVM, take this value and multiply it for this one, leaving the result in this variable", or "JVM, call this function with this parameter, and deposit the result in this variable". I don't think the opcodes refer to memory addresses directly, but instead to pseudo-variables. After all, you have a JVM that should take care of all that, and the only way it could really implement all their runtime checks (like not accessing an array out of bounds) if it the JVM had the ability of arranging variables the way it wants.
 * I am sure all these details are covered in the Virtual Machine Specification. However, if you really want to know, you will have to read it all ;-) -- ReyBrujo 05:45, 4 November 2007 (UTC)


 * Many of the standard libraries (like the graphics library) use the Java Native Interface to communicate with native code that can access the underlying system. --Spoon! 10:25, 4 November 2007 (UTC)


 * More specifically, here's what really happens. When you make swing calls those eventually translate to AWT calls (and also to Java2D calls, but those work within the context of windows create by AWT).  Newly made (technically newly displayed) AWT components try to create something called their AWT-peer; for every (displayed) AWT component there should be an AWT peer object - the peer object is a platform-specific java object which (by means of JNI or a similar java-to-native interface) creates a component using the native windowing system.  So there's a different peerset (bunch of native peers) for each windowing system.  Usually most platforms only have one peerset available, but there's no reason why it couldn't have more - for example Java on OS-X could have both a Cocoa peerset and an X peerset (I don't know if it does, but that would a reasonable thing for a full Java distribution to supply).  Now how does the platform-independent java component code know which peerset objects to create, you might ask.  Peers are all created using an instance (a singleton) of the java.awt.Toolkit class. That singleton in turn is created by code in the Toolkit class, which loads the correct peer toolkit subclass by checking a config string and loading the class it gives.  The native toolkit is trusted code in a sealed, signed package (so the SecurityManager lets it make native calls and load libraries). -- Finlay McWalter | Talk 16:13, 4 November 2007 (UTC)


 * Actually, I should correct myself. The toolkit stuff, above, pertains to rather older implementations of JavaSE, where one could only address one display device. Later JavaSE implementations allow you to address multiple displays, and there's no logical reason why those all have to implement the same peerset (I've not looked at the relevant code for years, so they may very well allow that, and that would mean the toolkit object is no longer a singleton). -- Finlay McWalter | Talk 16:40, 4 November 2007 (UTC)

So, if I understand it, when in my hello_world.class I use system.out.println, it calls the class system which in its own code has a JNI that takes my string of characters and prints it to the standard output. Which means that if someone wants to port a JVM to a new system, they have to rewrite the JNI code in all of the java class standard libraries to suit the new platform.

Follow up question, how does the JVM know to transfer control from the java bytecode to native code? Is there a special opcode for that? --Duomillia 01:09, 5 November 2007 (UTC)
 * There should be, yes. In assembler, you have code like:
 * So, in Java there should be an opcode that tells the VM to invoke a determined function. Whether that determined function calls another Java function or a native one, it should be transparent for the caller. -- ReyBrujo 01:43, 5 November 2007 (UTC)
 * While Java bytecode has many of the features you'd expect to find in an ordinary assembly language, it does differ from them in some ways. One is that all Java bytecode programs are divided into methods, each of which is mostly self-contained; in particular, each method lives in its own address space.  The only way for one method to call another is by a specific opcode for this purpose.  This is a fairly high-level operation: the calling method simply supplies the name of the class and the method it wants to call, and the JVM internally does all the work of locating and (if necessary) loading the class in question, checking that the calling code is allowed to call that method, obtaining a lock if the method is synchronized and so on.  As it happens, some methods may be marked as "native": these look like perfectly ordinary methods to the caller, but they're not actually written in bytecode at all.  Instead, when they're called, the JVM simply passes control to a native subroutine that does whatever the method is supposed to do.  The way in which such methods are implemented may be JVM-specific, but the Java Native Interface mentioned above is one possibility.  —Ilmari Karonen (talk) 05:00, 5 November 2007 (UTC)
 * While Java bytecode has many of the features you'd expect to find in an ordinary assembly language, it does differ from them in some ways. One is that all Java bytecode programs are divided into methods, each of which is mostly self-contained; in particular, each method lives in its own address space.  The only way for one method to call another is by a specific opcode for this purpose.  This is a fairly high-level operation: the calling method simply supplies the name of the class and the method it wants to call, and the JVM internally does all the work of locating and (if necessary) loading the class in question, checking that the calling code is allowed to call that method, obtaining a lock if the method is synchronized and so on.  As it happens, some methods may be marked as "native": these look like perfectly ordinary methods to the caller, but they're not actually written in bytecode at all.  Instead, when they're called, the JVM simply passes control to a native subroutine that does whatever the method is supposed to do.  The way in which such methods are implemented may be JVM-specific, but the Java Native Interface mentioned above is one possibility.  —Ilmari Karonen (talk) 05:00, 5 November 2007 (UTC)

New nVidia GPU power consumptions.
I'm considering getting one of the following nVidia GPU units,

1. 8800GT

2. 8800GTS (320mb)

3. 8800GTS (640mb)

4. 8800GTX

and I'd would like to know, how much power, in watts, do each of them take up idle, and under a full load?

Dryir Lent 05:56, 4 November 2007 (UTC)


 * "G80 core can peak at 145.5 Watts with 116.6 on average during gameplay," apparently. Our article says 145 for the GTX. FiggyBee 08:51, 4 November 2007 (UTC)
 * That's just the core though - the ram and the cooling fan will add to that. SteveBaker 16:33, 4 November 2007 (UTC)

Actually I was hoping to get answers on the new G92 cores, although I should have been more specific I suppose. 75.164.208.153 22:10, 4 November 2007 (UTC)


 * The G92s use slightly less power. See  - "the 8800GT (G92) consumes the least power, very much due to its smaller die". FiggyBee 22:19, 4 November 2007 (UTC)

Posting a picture online
How do you post pictures online? Also, how do you store pictures on your computer? Can you store old pictures on your computer or do they have to be on a disc? And what special equipment, if any, is needed to scan, store and post pictures? —Preceding unsigned comment added by 63.237.114.10 (talk) 07:44, 4 November 2007 (UTC)


 * We can post pictures online by uploading them to a web server (basically a high end computer that is always connected to the Internet). Flickr, Picasa are two good services which have free as well as paid-for services. --Kushalt 20:16, 4 November 2007 (UTC)


 * Most of the time, we store pictures on a computer by saving it on the hard disk drive. --Kushalt 20:16, 4 November 2007 (UTC)


 * It depends what you mean by a disk. Some people call flash drives by the name of flash disk. If you mean a circular optical disk, then no. The pictures do not need to be on a CD or a DVD. --Kushalt 20:16, 4 November 2007 (UTC)


 * Please see Image scanner for more details on this question. --Kushalt 20:16, 4 November 2007 (UTC)

Hope that helps! --Kushalt 20:16, 4 November 2007 (UTC)

mp3 players with radios
Why don't mp3 players have AM radio stations? They only have FM stations. —Preceding unsigned comment added by 121.218.52.137 (talk) 11:40, 4 November 2007 (UTC)


 * Because AM radio need a large antenna due to their larger wavelength, and they can't fit one in one of today's minuscule MP3 players. --antilivedT 19:09, 4 November 2007 (UTC)


 * Yep, AM radio needs either a (relatively) bulky Loop antenna, or a *very* long wire. FM radio only needs a shortish wire - portable players use the headphone cable as the FM antenna. FiggyBee 21:38, 4 November 2007 (UTC)


 * So that is the reason why FM won't play without headphones? --Kushalt 22:42, 4 November 2007 (UTC)

What kind of player is this? The headphones might have the antenna in them. —Preceding unsigned comment added by 71.195.124.101 (talk) 23:35, 4 November 2007 (UTC)
 * They frequently do, most peoples phone radios will not operate without the headphones inserted for this very reason.  Lanfear's Bane |  t  10:29, 5 November 2007 (UTC)

patitioning a hard drive
can making a disk partition corrupt data on you hard drive? if so, how do you avoid it?

P.S.-Can you install Ubuntu on an existing partition?--67.84.12.248 20:38, 4 November 2007 (UTC)
 * It can be tricky to figure out the process of repartitioning (and you may lose data trying to figure it out) but losing data isn't a necessary part of the process. I've performed half a dozen repartitionings on my current computer with no problems at all. There used to be problems with resizing NTFS partitions but now gparted and its ilk can easily do it, without prior defragmentation, with zero risk. Also no you can't install ubuntu on an existing partition unless it's linux-compatible (fat, ext, reiserfs, xfs), and even then I think you lose all your data on that partition. -- ⁪ffroth 20:45, 4 November 2007 (UTC)

(Froth will kindly correct me if I am wrong) If your current partition is empty, you can install Ubuntu on it. Ubuntu will format your partition to ext3. --Kushalt 22:34, 4 November 2007 (UTC)

glgears
Is their a port of glgears for mac? I'd like to use it to compare ppc emulation against native intel code. —Preceding unsigned comment added by 71.195.124.101 (talk) 23:41, 4 November 2007 (UTC)
 * There's a '/usr/X11R6/bin/glxgears' on my Mac, however, it uses X11.app. -- JSBillings  03:15, 5 November 2007 (UTC)
 * Using that particular program will test only the performance of the OpenGL interface to your graphics card under the emulation versus the real thing. The actual CPU time required is near zero if the graphics card is being used for rendering - and if graphics hardware is not used in the emulation, you won't be measuring the relative performance to the emulator versus the native code so much as software OpenGL rendering versus hardware rendering.  At any rate, I thought glgears used GLUT - that being the case, if you download 'freeglut' ( http://freeglut.sf.net ), you should be able to compile it for native MacOSX without X11. SteveBaker 05:05, 5 November 2007 (UTC)


 * GlGears is entirely useless as a benchmark - it doesn't test any of the stuff you care about for any modern application (bendy windows, direct-video-access, transparency, shaders, textures, lighting, geometry handing, etc.). Worse, many drivers clamp the framerate: so on Linux I get far higher GLGears framerates using the software Mesa driver (which of course doesn't really do real stuff very quickly) than with the NVIDIA driver (which does games, compix, etc. very nicely). There's more rant on similar lines here.  Of course this begs the question - if GLGears isn't a decent modern cross-platform GL benchmark, what is? The Lunchbox of Dooom 13:01, 5 November 2007 (UTC)


 * To answer my own question, Piglit (and the Glean tests it includes) seems to at least be an attempt at a GL benchmark; I don't know how well its results will correlate with the actual game/fancy-window performance. And what Steve said above will still be true - most of the work is being done in the GL subsystem. -- The Lunchbox of Dooom 13:08, 5 November 2007 (UTC)


 * Yep - I agree. The load that glgears imposes on even a software renderer is nowhere near high enough.  The fact that no part of the image is textured or fogged is a huge matter.  Software rendering can actually be quite fast on flat-shaded stuff - it doesn't start to really show it's lack of performance until you have really complex per-pixel operations going on.   These days, any graphics card test that doesn't pummel the shaders hard is a bad test - which means that anything that'll run on OpenGL 1.xx is a useless test of graphics performance.  I would take a look at the latest graphics and CPU reviews out there and see what the reviewers are using.  IMHO, the only valid test is to run the kinds of applications you actually want to run...and I strongly suspect that won't be glgears! SteveBaker 19:09, 5 November 2007 (UTC)