Wikipedia:Reference desk/Archives/Computing/2010 March 29

From Wikipedia, the free encyclopedia
Computing desk
< March 28 << Feb | March | Apr >> March 30 >
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 29[edit]

Media Player mess[edit]

I was customizing Media Player (skins and art) and then it hang up. Now I can't open it and an endless loop of media player stopped working, microsoft sync stopped working and microsoft windows is working on the problem or something. Anyways, is there a way for me to reload Media player to its default setting or some sort of safe mode to work with. Note that I don't have access to this computer's vista cd's/dvd's.--121.54.2.188 (talk) 01:05, 29 March 2010 (UTC)[reply]

I believe you can download a fresh copy, for free, from Microsoft, without any requirement to prove you have a legal copy of Windows. So, you could uninstall the mess you have and give that a try: [1]. StuRat (talk) 01:17, 29 March 2010 (UTC)[reply]
Ah okay. I'll just ask for the serial number from our tech guy. (hehe I just reread the without any requirement part) --121.54.2.188 (talk) 01:23, 29 March 2010 (UTC)[reply]
Although I suspect that they only give it away for free because it's crap. I use PowerDVD, myself, for viewing movies. StuRat (talk) 01:30, 29 March 2010 (UTC)[reply]

Java Applet Problem[edit]

So i am writing this code to draw little vehicle shapes, and i wanted to do something extra and add the java logo to the cargo area of my trucks.... but when i add the code that is supposed to do it, the java console complains that it doesnt have security access to the image file. It happens both on windows vista and on the linux server. Why?

--- Code below

  • NOTE: I have removed the rest of my code except the part which should apply to this problem

---

import java.awt.*;
import javax.swing.*;
import java.io.*;
import java.awt.image.*;
import javax.imageio.*;

public class Hw2_3 extends JApplet
{
        public int x = 100;
        public int y = 100;
        public int x2 = 200;
        public int y2 = 200;
        public void paint(Graphics g)
        {
                Graphics2D g2d = (Graphics2D)g;
                //Java logo on cargo space
                BufferedImage img = null;
                try
                {
                        img = ImageIO.read(new File("java_logo.jpg"));
                }
                catch (IOException e) { }
                g2d.drawImage(img,x2 + 50, y2 + 10, 40, 30, null);

        }

}

---

Thanks for any help!

137.81.112.175 (talk) 01:15, 29 March 2010 (UTC)[reply]

It has been LONG time since I did applets, but I can point you in the right direction.
Originally applets had no capability at all to read a file; they were a tag in a browser, they run on the client, and reading a file implied they could read arbitrary information from the disk -- word and excel documents, your Quicken info, etc. So part of their "sandbox" was that they could not read any file information from the local machine at all.
Since then, Java has grown to have "trusted applets", i.e., applets which are signed and therefore can be allowed some capabilities on the local machine. The user is prompted when the applet runs to determine whether he wants this particular applet to have the enumerated privileges (such as reading files). Look this up under "trusted applet" to do what you say you want to do.
However, I'm not sure that's what you really want to do. It appears to me you want to read a file of your own; that won't be on the local machine, that will be on the server. Look into reading resources (Class.getResourceAsStream()) instead of files, and put the Java logo file into the jar that contains your classes instead. Then it gets downloaded with your classes, and doesn't have to be put somewhere on the local machine.

Ralphcook (talk) 03:18, 29 March 2010 (UTC)[reply]


Actually, the file named is on the local machine, in the same directory as the class file and the container HTML. 137.81.112.175 (talk) 03:26, 29 March 2010 (UTC)[reply]

Additionally, im trying to use getResourceAsStream, but the compiler complains. I dont think im implementing it properly. 137.81.112.175 (talk) 03:51, 29 March 2010 (UTC)[reply]

Yay, i got the input stream to work, but now g.drawImage doesnt support the signature involving an input stream, it wants type "File" :( back where i started!

Hw2_3.java:48: cannot find symbol
symbol  : method drawImage(java.io.InputStream,int,int,int,int,<nulltype>)
location: class java.awt.Graphics2D

137.81.112.175 (talk) 04:07, 29 March 2010 (UTC)[reply]

My new code:

import java.awt.*;
import java.awt.Graphics;
import javax.swing.*;
import java.lang.ClassLoader;
import java.io.InputStream;
import javax.imageio.*;
import java.io.*;
public class Hw2_3 extends JApplet
{
        public int x = 100;
        public int y = 100;
        public int x2 = 200;
        public int y2 = 200;
        public void paint(Graphics g)
        {
                Graphics2D g2d = (Graphics2D)g;
                //Java logo on cargo space
                Image image = null;
                try
                {
                        InputStream is = new BufferedInputStream(new FileInputStream("java_logo.jpg"));
                        image = ImageIO.read(is);
                }
                catch (IOException e) { }
                g2d.drawImage(image, x2 + 50, y2 + 10, 40, 30, null);

        }

}

Still having the permission problem! —Preceding unsigned comment added by 137.81.112.175 (talk) 04:46, 29 March 2010 (UTC)[reply]


Have you read and understood the security limitations related to Applets? File Access by Applets in the official Basic Java Tutorial from Sun Microsystems explains very explicitly: An applet has no access to local system resources unless it is specifically granted the access. So, you have a few options: if you are running the applet locally, you can use a Policy File, as explained here; if you are distributing over the web, you can learn how to use a Java Security Manager by reading about Permissions in Java and then use that to request permission for file access; or you can move the image/file you want to access to a "non-local" storage, such as inside the .JAR file that your applet is distributed in. This is explained in the introduction to Java Resources, and here is a code snippet for reading a file from inside the applet's JAR file. Probably the best method (if you can use Java Swing) is to create a JApplet and use getResource() - as described in the Swing Applet icon tutorial. Swing JApplets are available in all modern Java implementations since Java 1.2. Nimur (talk) 16:11, 29 March 2010 (UTC)[reply]

Firefox tab placement[edit]

In the new version of Firefox, "open in new tab" creates a tab immediately to the right of the 'parent' tab. Most of the time, though, the old behavior – opening at the far right of all tabs – is more convenient to my peculiar habits. Is there a way to get the old behavior back? —Tamfang (talk) 04:14, 29 March 2010 (UTC)[reply]

Set browser.tabs.insertRelatedAfterCurrent to false in about:config [not so peculiar :) ] ¦ Reisio (talk) 04:22, 29 March 2010 (UTC)[reply]
Gracias. —Tamfang (talk) 06:30, 29 March 2010 (UTC)[reply]
Good to be reminded about about:config. I found the new tab behavior weird at first, but think I'll come to like it. --Stephan Schulz (talk) 09:33, 29 March 2010 (UTC)[reply]
I found it pretty disorienting and promptly disabled it, though this type of behavior is less problematic with vertical tabs, since each set of "child" tabs can easily be indented. ¦ Reisio (talk) 13:21, 29 March 2010 (UTC)[reply]
I've actually generally preferred this behaviour since I first encountered it in IE7. In fact the inability to do it in Firefox was one of the things which kept me on IE7 for a while but I eventually got annoyed enough with IE's annoying high likelihood of losing my comment if I clicked back as well as becoming fond enough of the magic search (or whatever it's called) in FF that I switched back. It can get confusing at times when you're switching between tabs but on the whole I generally prefer it Nil Einne (talk) 07:27, 30 March 2010 (UTC)[reply]

software crossover[edit]

is there any win app that would do what a passive crossover does? I mean band separation and things... —Preceding unsigned comment added by 80.83.239.4 (talk) 08:25, 29 March 2010 (UTC)[reply]

You can set Audacity ([2]) to provide various filters - although not in real time, if that's what you're looking for. --Phil Holmes (talk) 09:26, 29 March 2010 (UTC)[reply]
Real-time audio processing on a standard personal computer is non-trivial. Even fast computers invariably have long latencies because their audio driver subsystems are so complicated. ASIO and its ilk are designed to provide near-real-time latency, but in practice, the latencies are often upwards of a quarter-second (unsuitable for audio processing/effects). Nimur (talk) 21:58, 29 March 2010 (UTC)[reply]

i mean seriously there seems to be no app that would accomplish any of what i need cept that fucking foobar2000 plug in that is as buggy as hell.

USB networking[edit]

Is it possible to connect two PCs using a USB cable such that one PC appears like an external flash drive to the other? If so, what software (preferably free) would help achieve this? The kind of thing I have in mind is a function like my cell phone which offers a "USB drive mode" when I connect it to my PC. Astronaut (talk) 10:53, 29 March 2010 (UTC)[reply]

Not just with that. USB is a master-and-slave configuration (not a peer-peer configuration, like ethernet or RS232). The host controller chip in your PC isn't capable of being a client to another PC's host. You can buy a cable that has a little chip inside that makes this work, like this one. It's not just a function of wiring (so you couldn't just build a cable) - that chip has to rewrite the wire protocol so that each host thinks it's talking to a client and not another host. -- Finlay McWalterTalk 11:06, 29 March 2010 (UTC)[reply]
The cheapest solution for what you are seeking is to get a "crossover" Ethernet cable and plug it directly from one computer's Ethernet port to the other computer's Ethernet port, and turn on file sharing on the computer whose hard disk you want to share. This will surely be far more of a hassle than the excellent plug-and-play activity of using a USB drive, but it will work. Comet Tuttle (talk) 17:38, 29 March 2010 (UTC)[reply]
Presuming your PC is running Windows: see Direct cable connection and Windows Easy Transfer. ---— Gadget850 (Ed) talk 17:50, 29 March 2010 (UTC)[reply]
By the by, nowadays you can use a normal Ethernet cable and it will just work - there is no need to get a special crossover cable. It doesn't work if your computers can't do gigabit ethernet with automatic crossover, but just about any computer built in the last few years supports it out of the box. 85.156.60.7 (talk) 18:59, 30 March 2010 (UTC)[reply]

Battlefield Bad Company 2[edit]

Is it possible to download and play a demo for the above game? —Preceding unsigned comment added by 86.182.32.19 (talk) 14:43, 29 March 2010 (UTC)[reply]

Apparently. --Mr.98 (talk) 15:04, 29 March 2010 (UTC)[reply]
No, thats Battlefield 2, not Battlefield Bad Company 2
Sorry about that. The distinction initially confused me. --Mr.98 (talk) 22:16, 29 March 2010 (UTC)[reply]
The PS3 demo was available for download, but apparently the demo ended in February. Nimur (talk) 16:22, 29 March 2010 (UTC)[reply]


I've found with many games that there normally is a demo, but it is usually made unavailable once the main game comes out. Chevymontecarlo. 06:44, 30 March 2010 (UTC)[reply]

Does that mean once the game is out no one can play it, or only people that have already downloaded it can play it? —Preceding unsigned comment added by 86.180.54.122 (talk) 12:46, 31 March 2010 (UTC)[reply]

Often, if the main game is out the demo version is often removed and made unavailable for download, but if you already have the demo it might not work and may prompt you to buy the full version. This does not happen with all games though. Some demos in the Playstation Store for PSP are still available for download even though the main game has been out 7-8 months. Hope this helps. Chevymontecarlo. 10:41, 1 April 2010 (UTC)[reply]

Unicode graphic[edit]

In this question you are trusted not to meddle in my sandbox. On that understanding, click on this editing window and then without changing anything, click on Show preview. My question is why does the previewed line-and-circle graphic not look like what was entered? I used graphic characters alt-219 alt-220 and alt-223 which are little black blocks. Cuddlyable3 (talk) 16:22, 29 March 2010 (UTC)[reply]

I think that the "fixed width" glyphs for some of these unusual unicode characters are not actually of constant pixel-width. Unicode.org explains some display-problems related to monospace fonts. The recommended solution is to use a variable-width font for unusual glyphs so that you can at least read the characters. I would disrecommend using extended unicode character glyphs for complex ascii art - because many different rendering engines and text encodings will produce very unusual results. A key point to note is that you must specify both "monospace font" (as you have, with the PRE tag), but you also need to specify a character encoding (which you have not - my browser uses my over-ridden default, UTF-8, but most people use "auto-detect", or parse the specification from the HTTP GET response from the mediawiki server). You can't really know WHAT character encoding an end-user is going to display in; all you can do is "recommend" one; so it's best to avoid using such features for glyph-art. Nimur (talk) 16:28, 29 March 2010 (UTC)[reply]

It's because the line-height and font-size in the editing area don't match; this is even more noticeable if you're using the Beta skin & CSS. ¦ Reisio (talk) 00:01, 30 March 2010 (UTC)[reply]

Thank you for the responses so far. If you see what I see (IE v.8, Vista) something major happens at the right half of the circle (scroll down). Below the circle the diagonal line has recovered. Cuddlyable3 (talk) 18:17, 30 March 2010 (UTC)[reply]

Hrmmm? Screenshot? I think you're probably just describing what has already been commented on, but now you've made me somewhat doubtful. :p ¦ Reisio (talk) 11:50, 31 March 2010 (UTC)[reply]

I am describing the difference between what is in the editing window and in the preview. Reisio why do you hum about a screenshot when the question says what to look at? Please explain the difference if you can, or suggest how to obtain the intended graphic. Cuddlyable3 (talk) 19:45, 31 March 2010 (UTC)[reply]

I'm asking for a screenshot illustrating the discrepancy you're describing, because you didn't seem satisfied with the response I gave about what I saw when I looked at what your question said to look at. ¦ Reisio (talk) 20:08, 31 March 2010 (UTC)[reply]

linux poster software[edit]

I've been asked to make a scientific poster, size A0 and it needs to contain a mixture of graphics and text. I was wondering if anyone had any recommendations for software i could use?--82.26.227.101 (talk) 17:11, 29 March 2010 (UTC)[reply]

You can use LaTeX with the a0poster style, or beamer, or a combination of both. There are many useful links out on the InterWebs: [3], [4], [5], [6]. My private tip is to get a good tool for the pretty pictures - I use Keynote (software) on the Mac, because it generates excellent PDF that can be included into LaTeX. --Stephan Schulz (talk) 17:31, 29 March 2010 (UTC)[reply]
Sorry if this is less than helpful, but the Windows tool for the job would presumably be Adobe Illustrator. Comet Tuttle (talk) 17:36, 29 March 2010 (UTC)[reply]
It depends partly on what you're familiar with, and also on how much text (and how you'd want the text laid out). OpenOffice.org's Write program (and its adjunct Draw) can do a lot, as can Scribus (which is strictly a desktop publishing system, but which is pretty flexible too). Illustrator's counterpart Inkscape is very good at line graphics but its text support is pretty rudimentary. All of these should author PDFs (which is what I'd expect you'd be sending to the printing company) reasonably well. -- Finlay McWalterTalk 18:05, 29 March 2010 (UTC)[reply]
I agree. I would say Scribus is best if you want full control of layout, but OpenOffice.org Writer for something that is easy to use quickly but does not give you the complex layout options. -- Q Chris (talk) 18:20, 29 March 2010 (UTC)[reply]
If you have access to it, Microsoft Publisher is easy enough than my mother can make halfway-nice looking things with it (I just noted that the headline contained "linux", d'oh). Inkscape is powerful for graphics but has bad text/font support, and any software like that has a pretty steep learning curve if you aren't familiar with it (Illustrator and Indesign included—probably Scribus as well). --Mr.98 (talk) 22:24, 29 March 2010 (UTC)[reply]
You might also want to consider how you would print something as large as A0. Some software supports splitting your image up into smaller A4 or A3 sheets, but you might prefer a professional printer who would have their own requirements on acceptable file formats for their printing equipment (ie. you might find yourself restricted to only supplying the printer with Adobe Illustrator format). Astronaut (talk) 13:19, 30 March 2010 (UTC)[reply]
At least he is doing it under Linux. Windows XP and below uses a "master value" of 1440 (the maximum DPI) and it represents the width and length with a a 16 bit unsigned binary number, the max is 65535. 65535 / 1440 = 45.5", the max length and width, which is just smaller than A0. This might be fixed under Vista/Win 7, but I haven't looked at this in ages. ---— Gadget850 (Ed) talk 13:35, 30 March 2010 (UTC)[reply]
Yeah, you'll probably need to go to a print shop. But every one of those I have used (and there have been a few at this point), can take PDFs no problem. So that shouldn't be a huge limitation, as whatever you have should be outputable or convertable into PDF one way or another. --Mr.98 (talk) 13:59, 30 March 2010 (UTC)[reply]
It seems that the type of PDFs that print shops use are not just any old PDF though. See PDF/X for more details. -- Q Chris (talk) 12:57, 31 March 2010 (UTC)[reply]

CDG file to CD-R[edit]

Hi I recently downloaded some karaoke songs in CDG format. I was told that I would need to buy blank CDG discs but another website I found said CDG discs do not exist. Can I burn these CDG files to a blank CD-R disc? If I do so will the words still come up when used in karaoke? Thanks. —Preceding unsigned comment added by 86.146.24.84 (talk) 17:16, 29 March 2010 (UTC)[reply]

The relevant article is CD+G, and yes, you should be able to burn the format to a conventional recordable CD-R disc. You will need software that understands the CD+G format; our article has links that can point you in the right direction. Nimur (talk) 21:32, 29 March 2010 (UTC)[reply]

Couldn't access half the web sites I tried[edit]

While at a library with Firefox, I kept getting a message that the web site could not be found. I got the same error message that appears when the Internet is down entirely, though that wasn't the case. Some sites I got into were very slow, as if I was on dial-up, which I wasn't. For maybe half the web sites I tried, the problem cleared up eventually, but for others it never did. I haven't had the problem at home with Internet Explorer 8, though I also limit the sites I go to at home a great deal. Wikipedia was one of the sites that worked in both places.Vchimpanzee · talk · contributions · 20:05, 29 March 2010 (UTC)[reply]

That sounds more like a buggy proxy server than anything else; it is also possible that the library is intentionally censoring certain websites (or possibly reverse-censorship, via "whitelist-only" access to certain websites). Unfortunately, it's impossible to diagnose based on the information you've provided. Nimur (talk) 21:30, 29 March 2010 (UTC)[reply]

Maybe the librarys DNS resolution was bad. —Preceding unsigned comment added by 82.43.91.194 (talk) 22:25, 29 March 2010 (UTC)[reply]

The library was not censoring. The people who worked there were frustrated by it. I can only provide information that I know. What is DNS resolution?Vchimpanzee · talk · contributions · 13:32, 30 March 2010 (UTC)[reply]
DNS is the Domain Name System. It is the specific technology which translates a human-readable web address, like "wikipedia.org" into a computer-understandable network destination, the IP address like "208.80.152.2". (In this sense, it's like a phone-book that translates a name into a number). When there is an error in the DNS system, sometimes because of bad network configuration or a server failure somewhere, the result is sluggish performance. Because DNS systems often have "backup" schemes (as explained in the article), this type of failure can result in certain sites working while others fail; or a site that works only after three or four attempts to load it. Many other networking problems can produce similar symptoms, but DNS configuration is a common trouble-area in certain network configurations. Nimur (talk) 16:18, 30 March 2010 (UTC)[reply]
I don't know if this means anything, but there were tornadoes in the area the night before.Vchimpanzee · talk · contributions · 17:41, 30 March 2010 (UTC)[reply]
I'm back at that library and all seems normal now. I haven't asked if they know what happened.Vchimpanzee · talk · contributions · 22:22, 30 March 2010 (UTC)[reply]

Important Resource Removed from Circuit Board page[edit]

I am writing to inform you that an important resource was removed from the circuit board page (http://en.wikipedia.org/wiki/Circuit_boards). It has served as an important resource for the printed circuit board industry on Wikipedia for the past two and 1/2 years. I built that to serve as a resource and it has continued to be posted as resource on Wikipedia for over 2 years. Please review the historical records and you will see how far back that listing has been posted.

Suddenly, it was removed and I've tried several times to add it again but it doesn't appear to stay up. The only reason I can think of for it to be removed is that the web site was updated and the page was pointing to the old site. Or it was recommended by a searcher that I add (Printed Circuit Boards) after PCB to make it clearer as to what the glossary was describing.

I'm bummed because the listing has been up for so long and I've since done research on your content guidelines (since it's been so long since I've logged into my wikipedia account) and I guess this was not the right thing to do. I feel awful because it is such a great resource.

I hope you consider adding this listing back to the page as it was before. Here is where it was listed (and the old listing):

Please feel free to contact me via my account if you need to further discuss. I will make it a point to review the information before making any changes or updates.

PCB Universe (talk) 20:22, 29 March 2010 (UTC)PCB Universe[reply]


It seems that an edit war is taking place. User:HumphreyW is removing the link because it is a commercial site; this seems like an invalid reason to remove the link; WP:EL does not forbid commercial sites anyway. However, the appropriate place to address this issue is the article talk page. Nimur (talk) 21:25, 29 March 2010 (UTC)[reply]
The link looks OK to me, but I doubt the information is so unique that it is unavailable from elsewhere. One other problem might be your clear conflict of interest and we only have your word that it is "an important resource for the printed circuit board industry" - try not to make it sound like you are seeking visitors to your website. Anyway, as Nimur pointed out, the place to make your case is on the article talk page. Astronaut (talk) 13:11, 30 March 2010 (UTC)[reply]

bash help requested[edit]

I have a number of nested directories full of pdfs (e.g. pdf/dir1, pdf/dir2, pdf/dir1/dir2 etc.). They go down a couple levels deep (maybe as many as 3?). What I'd like to do is use bash and pdftk in order to generate a large report of all of the page counts for each pdf.

pdftk's report function uses the following syntax: pdftk mydoc.pdf dump_data output report.txt. It can only take one pdf file as the input and it produces one txt file as the output.

Ideally I'd like to be able to run a single line in bash that would run this on all pdfs in the directory structure, and then append all of the output in one large txt file. (Then I can run a script to extract all of the pagecount data specifically and add it up.) Is this possible? I am not very bash fluent though I know you can do for/each types of constructs with it. Preferably this would not create a million report.txt files either—it would just add them to an ever growing master file.

(The end goal is to know the total page count for all pdfs in the directory structure, so if there is an easier way that I am not thinking of, I'm all ears! There are hundreds of pdfs so any method that relies on me manually opening files one-by-one is not an option.) --Mr.98 (talk) 22:13, 29 March 2010 (UTC)[reply]

find -type f -name "*.pdf" -exec pdftk {} dump_data output - &> report.txt \;
-- Finlay McWalterTalk 22:23, 29 March 2010 (UTC)[reply]

exif[edit]

where can i get a freeware program to manage/edit exif data, etc? —Preceding unsigned comment added by 86.144.124.51 (talk) 22:21, 29 March 2010 (UTC)[reply]

Imagemagick's identify program will display the EXIF data. To help you with editing, you'll have to tell us which OS you're using, and whether you're willing do download any of the mystery-meat freeware programs Google finds when you search for "exif editor" - personally I'd have great concerns about doing so. -- Finlay McWalterTalk 22:26, 29 March 2010 (UTC)[reply]
I haven't used it, and don't vouch for it, but this looks promising. It apparently allow you to edit some, but not all, of the EXIF header info. -- Finlay McWalterTalk 22:37, 29 March 2010 (UTC)[reply]