Wikipedia:Reference desk/Archives/Computing/2012 April 13

Source: Wikipedia, the free encyclopedia.
<
Computing
Computing desk
< April 12 << Mar | April | May >> April 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.


April 13

Extraction of Files from .zip Archive on CLI in SLED11SP2

Hello!

  I need to extract files from a .zip archive on a computer running SuSE Linux Enterprise Desktop 11 Service Pack 2. I would like to do this from the CLI (so that I can do this in shell scripts in future), and need to know what is the command and syntax to use.

  Thank you to all RefDeskers! Vickreman.Chettiar 09:51, 13 April 2012 (UTC)[reply]

unzip path/to/archive.zip or unzip path/to/archive.zip -d path/to/dir/to/unzip/to (dir can be non-existant). If you don't have the unzip package (fairly unlikely), you'll need to install it first. ¦
Reisio (talk) 12:54, 13 April 2012 (UTC)[reply
]

site icons in browser tabs

What I mean is the small square icons that appear at the left side of tabs in a browser. For example, Wikipedia has its stylized "W." If a site offers no icon, a dotted square is displayed. How could I use this feature on my web site? --Halcatalyst (talk) 00:45, 13 April 2012 (UTC)[reply]

It looks like you need a file named "favicon.ico" on your web server root. See Favicon RudolfRed (talk) 01:11, 13 April 2012 (UTC)[reply]

Well, see

Reisio (talk) 12:56, 13 April 2012 (UTC)[reply
]

Simple Java animation

In Java, I have a button. After I press the button, I want the button to turn red for 1 second, then turn green. I tried changing the color's button to red, waiting for 1 second (Thread.sleep), calling repaint(), changing it back to green, and calling repeat() again inside the button's mouse event listener. However, what happens is that the button does nothing for 1 second, and then turns green; for some reason, the button is never red.

How do I fix this? This should be the most basic aspect of doing an animation in Java, yet I can't find the information anywhere. --140.180.3.182 (talk) 06:52, 13 April 2012 (UTC)[reply]

Don't call thread.sleep() in an event handler, because you're blocking the event loop. If you're using Swing, use a Swing Timer to schedule a repaint. If you're just using AWT, create your own thread that sleeps, calls repaint, sleeps, etc. -- Finlay McWalterTalk 08:15, 13 April 2012 (UTC)[reply]

Windows 7

Will an emachines 3038 run windows 7?--92.29.200.88 (talk) 09:32, 13 April 2012 (UTC)[reply]

Just googled it, unable to find anything. you can check the minimum requirements of Windows 7 on the article here. Mrlittleirish 09:58, 13 April 2012 (UTC)[reply]

Probably, but if you'd like to know what Microsoft has to say about it, use their Windows 7 Upgrade Advisor. ¦

Reisio (talk) 12:57, 13 April 2012 (UTC)[reply
]

map tag

I'm wondering how can you use map tag with the usemap attribute. You need to know the coordinates of the image. so my problem is exactly that how do people can do the shapes already knowing all the coordinates? is there a program for that??? thanks. 12:54, 13 April 2012 (UTC) — Preceding unsigned comment added by 190.60.93.218 (talk)

Most graphics editors (Photoshop, GIMP, etc.) will give you x and y coordinates you can use for simple rectangular areas, though just using CSS is by far superior for simple rectangular areas. For complex shapes there are lots of applications for helping you get the coords. The best application by far was
Reisio (talk) 13:00, 13 April 2012 (UTC)[reply
]

Awesome! though I was wondering if there is one that supports png, and if also allowed circular and pol coordinates.. but I think I can handle it... Thanks. 190.60.93.218 (talk) 15:05, 13 April 2012 (UTC)[reply]

They should all support PNG at this point, and ImageReady should as well, but all you really need from them is the HTML with the coords (and the HTML they spit out is usually awful, so really just the part with the coordinates), you don't actually have to use any image they spit out, you can just use your original image (or a variety of it in any format you like) as long as it's the same dimensions and alignment. All you should need them for is complex polygons — rectangles and circles should be a simple matter of knowing what x/y coordinates you want them at (and then preferably using CSS instead of an image map). ¦
Reisio (talk) 15:19, 13 April 2012 (UTC)[reply
]

RSS reader that syncs between computer and iOS without Google Reader

Is there such thing? As in a cross-platform RSS reader that deletes stories that I deleted from my feed on my iPad as well when I do so on my computer? I know it's possible from Google Reader, but I don't use this interface for reading on my desktop, as I prefer specialised programs. Even so, I don't think Google Reader syncs the actual messages in feed inboxes. However, it's already possible for e-mail. 96.21.250.92 (talk) 15:40, 13 April 2012 (UTC)[reply]

If I understand you correctly, that feature is built in to Safari. Use the Reading List. "Whenever you come across something interesting on the web, save it to Reading List. iCloud keeps your Reading List up to date on all your devices, including your iPhone, iPad, and iPod touch." On your Mac, use the RSS Unread Indicator - "Choose “Highlight unread articles” in Safari RSS preferences, and Safari will distinguish between read and unread articles, highlighting items you haven’t read." Does that help? Nimur (talk) 18:29, 13 April 2012 (UTC)[reply]
NetNewsWire and Reeder both sync with Google Reader and both work on iOS and OS X. I don't remember any desktop RSS readers for Windows that sync with Google Reader off the top of head, but I know they exist. 206.131.39.6 (talk) 15:34, 16 April 2012 (UTC)[reply]

My desktop runs on Windows. From what I've seen, most RSS readers seem to only sync the feeds per se, not their content, or maybe I'm wrong. 96.21.250.92 (talk) 21:56, 17 April 2012 (UTC)[reply]

unicode and alt code

How can I type in unicode directly from a keyboard? And, is there any list of alt code that I can check easily? Thanks for answering!Naiveandsilly (talk) 15:57, 13 April 2012 (UTC)[reply]

Unicode input -- Finlay McWalterTalk 16:07, 13 April 2012 (UTC)[reply]

How about the second question about list of alt code? Thanks! ––Naiveandsilly (talk) 06:20, 14 April 2012 (UTC)[reply]

http://alt-codes.org/list/ - Cucumber Mike (talk) 11:38, 14 April 2012 (UTC)[reply]
Without knowing what kind of characters you are looking for, a fairly complete list can also be found here Plane (Unicode). Since you intend to use the alt-codes on a keyboard you would however have to transform these hex numbers into decimal numbers first. -Laniala (talk) 13:14, 14 April 2012 (UTC)[reply]


Thanks for helping. It seemsthis isn't a comprehensive one.--Naiveandsilly (talk) 07:27, 15 April 2012 (UTC)[reply]

iPad/iPhone

Can I use either charger for either of the above please?--85.211.216.235 (talk) 19:21, 13 April 2012 (UTC)[reply]

Almost, but not quite. If you have an iPad charger, you're fine with both. However, an iPhone charger will only charge the iPad slowly if at all (Trickle charging may be a relevant article). Sources: http://terrywhite.com/techblog/charging-your-ipad-what-you-should-know/ https://discussions.apple.com/thread/2580579?start=0&tstart=0 - Cucumber Mike (talk) —Preceding undated comment added 19:53, 13 April 2012 (UTC).[reply]
Thanks for this and the link.--85.211.216.235 (talk) 06:18, 14 April 2012 (UTC)[reply]

greasemonkey javascript

Resolved

In greasemonkey javascript, I want to automatically open all links on a page which contain &number= into new tabs. I know almost nothing about javascript. So far I have found the following code with google;

GM_openInTab("http://www.google.com/");

This opens http://www.google.com/ in a new tab. Now I just need to find a way to parse a page for links and feed them into GM_openInTab. I have no idea how to do this. Any help would be greatly appreciated. Thank you! 82.45.62.107 (talk) 20:55, 13 April 2012 (UTC)[reply]

It seems like doing this might open so many tabs it takes down your browser and maybe computer, so I'd add a limit to the number it opens. StuRat (talk) 05:16, 14 April 2012 (UTC)[reply]
The page has at most 50 links which match &number= so it shouldn't be a problem. I've opened 200 tabs before and been okay 82.45.62.107 (talk) 10:26, 14 April 2012 (UTC)[reply]
It makes matters much easier if you can post a link to the page(s) in question. 87.115.132.208 (talk) 10:46, 14 April 2012 (UTC)[reply]
The links are like this in the html
Extended content
<a href="?mode=page&number=1"> 1 </a><br>
<a href="?mode=page&letter=a"> a </a><br>
<a href="?mode=page&number=2"> 2 </a><br>
<a href="?mode=page&letter=b"> b </a><br>
<a href="?mode=page&number=3"> 3 </a><br>
<a href="?mode=page&letter=c"> c </a><br>
<a href="?mode=page&number=4"> 4 </a><br>
<a href="?mode=page&letter=d"> d </a><br>
<a href="?mode=page&number=5"> 5 </a><br>
<a href="?mode=page&letter=e"> e </a><br>
<a href="?mode=page&number=6"> 6 </a><br>
<a href="?mode=page&letter=f"> f </a><br>
I only want to open the &number= ones into new tabs. 82.45.62.107 (talk) 12:02, 14 April 2012 (UTC)[reply]
Try this:
// ==UserScript==
// @name           opennumberlinks
// @namespace      http://foohost
// @description    Open all links on the page (in new tabs) where the link contains "&number="
// @include        http://foohost/index.html
// ==/UserScript==
var elems = document.getElementsByTagName("a");
for (var e in elems) {
    var s = elems[e].href;
    if (s.indexOf("&number=") !== -1) {
        GM_openInTab(s);
    }
}
You'll need to change the @namespace and @include lines as necessary. -- Finlay McWalterTalk 17:28, 14 April 2012 (UTC)[reply]
Thank you! I tested it and it doesn't seem to work though, the error console in Firefox says "Error: s has no properties". I'm not sure what this means 82.45.62.107 (talk) 18:36, 14 April 2012 (UTC)[reply]
It works okay in the example you gave. If you can't link to the real thing, I'm afraid you'll either have to teach yourself Javascript, or hire someone who already can. -- Finlay McWalterTalk 19:32, 14 April 2012 (UTC)[reply]
I understand. Thank you for the help anyway. 82.45.62.107 (talk) 20:32, 14 April 2012 (UTC)[reply]
I just worked out what the problem was; I am using an old version of Greasemonkey and GM_openInTab wasn't introduced until a later version. It works perfectly on the current versions. Thank you very much for your help! 82.45.62.107 (talk) 20:36, 14 April 2012 (UTC)[reply]