Jump to content

Wikipedia:Reference desk/Archives/Computing/2008 December 2

From Wikipedia, the free encyclopedia
Computing desk
< December 1 << Nov | December | Jan >> December 3 >
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.


December 2

[edit]

DeviantArt's Drop Shadow

[edit]

How does DeviantArt [[1]] give each their image thumbnails a drop shadow? What specific chunk of code is responsible for this effect?

Acceptable (talk) 03:11, 2 December 2008 (UTC)[reply]

Perhaps the CSS? bibliomaniac15 03:47, 2 December 2008 (UTC)[reply]
It is possible that the shadow effect is the result of borders placed around the images with a color slightly darker than the background. It also appears that the top, left, right, and bottom borders are different widths. Looking at the page source, each of the images is nested inside three span elements with class names "tt-a", "tt-w", and "shadow". I tried looking in the .css file located here for an entry with some combination of "span.tt-a", "span.tt-w", "span.shadow" and "img" qualifiers, but was not able to locate the specific lines which set those shadows. However, it is a big .css file, so I might have missed something. -- Tcncv (talk) 04:20, 2 December 2008 (UTC)[reply]
I am by no means an expert on CSS or web-design, but here's what I think is happening: if you look at the code for an image, you can see that each image is surrounded by this span-tag (or some variation of it):
So that's what I think it's doing: it's simply using the image at the URL as the background for the span, and since the span is slightly larger than the image, the shadow "leaks" out around the edges. It's really very clever. Belisarius (talk) 12:33, 2 December 2008 (UTC)[reply]
The image is dynamically generated - you can have a fiddle with the URL to generate different shadows. The format is [blur size (0-200)]-[opacity (0-1)]/[width (0-5000)]/[height (0-5000)]/[small|small2].png — Matt Eason (Talk &#149; Contribs) 15:18, 2 December 2008 (UTC)[reply]

Decompile PDF to LaTeX

[edit]

Hi, I had a paper that I wrote in LaTeX and compiled to PDF. But then I lost the original LaTeX source, but still have the PDF file. Does there exist any tools out there to somehow "reverse engineer" the PDF (knowing that it was compiled from LaTeX) back to the LaTeX source, or even approximately? Thanx --128.97.245.152 (talk) 06:58, 2 December 2008 (UTC)[reply]

I'm fairly certain there's not. I think the best option you have is to simply select all the text, copy it and paste it in a new document. It's a terrible solution though (you lose all the formatting and if you have equations and things it will be tricky). Belisarius (talk) 12:40, 2 December 2008 (UTC)[reply]
You have several options. You can use pdftk (a free program) to uncompress the PDF to plain-text PDF. It's a command-line tool. PDF is similar to PostScript, so it's very wordy and complex. You could then do a find-and-replace on the text, replacing the PDF keywords with LaTeX ones, but it'd be tough. Another option is opening the file in Adobe Acrobat Professional (available as a free trial) and saving it to another format, like RTF (Rich Text Format). RTF is very similar to LaTeX, and you can open an RTF file in OpenOffice.org's Writer (also free) and then export it as a LaTeX file.--Rjnt (talk) 13:40, 2 December 2008 (UTC)[reply]

Sharing an internet connection between a windows box and an ubuntu box

[edit]

For Christmas, I'm going to be spending some time in my vacation-house, and I have some questions about setting up a good internet connection there.

See, it's in a pretty rural area, so the wire-based internet connection options are not very good. It does, however, for some reason have very good 3G coverage, so I've used one of those dongles that you plug into a USB-port that lets you surf using HSDPA (one of these). Here's the issue, though: I have two computers there, one Windows XP-box and one Linux-box (Ubuntu, specifically). I much prefer to use the Ubuntu one, but setting up the dongle to work with it is an enormous pain in the ass, I gave up trying after like two hours of trying to get it to work. And even if I could get it to work, I would also really like both computers to be connected to the internet at the same time.

So here's what I'm thinking: I know windows xp has this internet connection sharing thing, where it would act as a bridge and let other computers on the same LAN use its internet connection. I would really like to get that working with Ubuntu. How would I do it? I have a router there (a Linksys WRT54GL with the fancy custom DD-WRT firmware), so I can easily set up the computers to be in a LAN. The Windows part should be pretty easy, right? I mean, you just use the wizard it has and tell it to turn on internet connection sharing? But how would I convince Ubuntu to use the Windows machine as a bridge to the internet? Do I turn off DHCP on the Ubuntu and configure the standard gateway manually to use the Windows machine? Can I somehow configure the router to route its packets through the windows machine?

I should point out that as I am not there currently, I can't test it out right now. But I'd really appriciate any advice any of you smart people can give me. Cheers! Belisarius (talk) 12:18, 2 December 2008 (UTC)[reply]

If I remember correctly, the Windows Internet connection sharing actually acts as a router already. So you wouldn't need another one. You can just connect the two computers using a crossover cable, or connect them both to a switch or something. Also, it is interesting that the dongle that you linked to actually says that it works well with Linux. --71.106.183.17 (talk) 19:48, 2 December 2008 (UTC)[reply]
Huh. That's very interesting. How about this: could I connect the network port on the windows machine directly into the WAN port on the router and then connect to my router using wi-fi? If the connection sharing thing in Windows really does act like a router, it should work, right? That'd give me wireless around the house. I'm no fan of Microsoft (I'm a Linux-hippie, fer chrissakes!), but you have to give them props on that Internet Connection Sharing thing. That's real easy to set up.
As for the dongle issue, yes, there are functioning drivers for it for Linux, but that doesn't make it easy to use. The dongle I have is specifically made to be easy to use with windows, so in addition to being an HSDPA modem, it's also a virtual cd emulator. Why, you ask? So that when you plug it in, you can easily access the software needed to run it. The downside is that when you plug it in, Ubuntu doesn't see anything but the cd-emulator, so you have to do some hacking to actually disable that part. And then, since there's only software for windows on it, you have to use deep voodoo to make all the configurations right (you have to enter some super-weird init string to make it work). Even if you do get everything to work, it's still incredibly buggy. It would take an annoyingly long time to connect (like, minutes), if it even connected at all. I guess the phone company and the manufacturer couldn't be bothered to develop some simple software to just make it work on linux. Belisarius (talk) 00:06, 3 December 2008 (UTC)[reply]

firefox and excel

[edit]

1)i have firefox and IE latest version installed in my pc (win xp prof).. i just reformatted it ...and used the net yesterday without any anti virus installed... now, a virus is here which would not let me open firefox by any means... it commands the user to use IE... and IE is having no problem .... also, the machine is running slow a bit.what would be the first step i should take now ?

2)my 2nd problem is : how do i plot a - O.D vs time graph using excel 2000 ? I don't want to have separate graphs for series 1 (time-x-axis) and series 2 (O.D - y axis), but a single line of graph combining the two values.

1)You may as well reinstall operating system again, otherwise use an antivirus program to clean the machine. Graeme Bartlett (talk) 20:08, 2 December 2008 (UTC)[reply]
2)Use XY scatter chart. Graeme Bartlett (talk) 20:06, 2 December 2008 (UTC)[reply]

thank you very much. i got the graph.. will reformat the system again.. —Preceding unsigned comment added by 59.93.211.90 (talk) 18:55, 4 December 2008 (UTC)[reply]

And this time, please secure the system. It will save you a lot of headaches in the future....--Xp54321 (Hello!Contribs) 03:53, 8 December 2008 (UTC)[reply]

VirtualBox with Windows 98 problems

[edit]

I am trying to install Windows 98 on Sun xVM VirtualBox 2.2 and it will only work up to the "Setup is detecting and installing any Plug and Play hardware you may have." message. It then remains on this screen in excess of 5 hours. I only have 256 MB of RAM allotted to this virtual machine and only 256 MB available to my host machine. I have no plug and play hardware attached to my computer; all of it requires a driver to be installed. I am thinking of three different solutions to this problem:


1) Get more RAM for my Host machine (4 GB) and allot 2 GB to the VM.
2) Unplug all non-Plug and Play hardware from my Host machine before installing Windows.
3) Tweak settings of my VM to allot more RAM to my VM and temporarily disable non-Plug and Play hardware connected to my computer.


Any help at all would be appreciated.
(PS: I am doing this to play old Windows 98-specific games that no longer work on XP)


 Buffered Input Output 14:05, 2 December 2008 (UTC)[reply]

This sounds like a plug and play problem rather than a shortage of memory. 256meg is generous for windows 98. Probably the VM will be interfering. Graeme Bartlett (talk) 19:54, 2 December 2008 (UTC)[reply]

Setting up wireless but have different laptop/router brands

[edit]

Hi, can I set up a wireless network when my router is Dell but my laptop is Toshiba?

Yes (as long as you have a wireless network card in your laptop, which you almost certainly do if it was made in the last few years) — Matt Eason (Talk &#149; Contribs) 15:06, 2 December 2008 (UTC)[reply]

MCSE or CCNA which is better....Who is paid more? is it CCNA candidate or MSCE candidate? which will help me to earn more?

Which would be better?

[edit]

Hi please help me out I'm really confused........Is it MCSE or CCNA is best to be done for more earnings?

Your earnings will depend how good you are and how quickly you get a good reputation and get promoted. Either qualification could prove that you can learn something. It is best to pick what you are interested in so that you have more motivation. If you like Microsoft and their operating systems you know what to pick. If you are interested in sticking things together then pick the CCNA. Graeme Bartlett (talk) 19:50, 2 December 2008 (UTC)[reply]

Really simple bash(?) script

[edit]

Hi all,

On my Mac OS X terminal (using bash), I frequently need to curl a xml file from a url, format it with xmllint, and then pipe it to bbedit, my text editor. The command I use is

curl http://blahblahblah.xml | xmllint --format - | bbedit

How could I easily transform this into a single command, so that I could write, say,

xmlcurl http://blahblahblah.xml

? Thanks for any suggestions! — Sam 63.138.152.238 (talk) 17:20, 2 December 2008 (UTC)[reply]

#!/bin/bash
curl $1 | xmllint --format - | bbedit

Graeme Bartlett (talk) 19:43, 2 December 2008 (UTC)[reply]

Character encoding question

[edit]

Suppose a Unicode text file is sent off to someone who edits it. What could cause it to come back still in Unicode (I think), but unreadable. And is the information lost? Here are the original and edited files if you are interested in seeing what happened. Louis Waweru  Talk  18:37, 2 December 2008 (UTC)[reply]

the editor will have to support unicode. Older or simpler editor programs may not support it, or smart Alec editor programs may convert it to some other format. Graeme Bartlett (talk) 19:40, 2 December 2008 (UTC)[reply]
And some of the info might be lost, if it converts multiple characters into the same character. StuRat (talk) 22:37, 2 December 2008 (UTC)[reply]
There seem to be several problems, the most immediately noticeable being that while the second file identifies (BOM) itself as UTF-16LE but encodes some, but not all, of the bytes as UTF-16BE. See Endianness. Bendono (talk) 23:44, 2 December 2008 (UTC)[reply]
Ugh, I think I can actually see what you are describing Bendono when I open a copy as Unicode (Big-endian) and another as Unicode. Both preserve either some English or some Japanese. Going to go ahead stop trying to rescue this file. I will try to find out what text editor was used and how it was saved. Is there a "best practice" for Unicode files? When saving files in Notepad the options are Unicode, Unicode (Big-endian), and UTF-8. I usually go with the first. In the .NET Framework you can also chose which type of Unicode format to use (there are a few more options) but I again go with the plain "Unicode". Is that the safest one? Louis Waweru  Talk  00:06, 3 December 2008 (UTC)[reply]
All of the Unicode encodings are created equal. The only differences are in file size and software support. You may pick an optimal encoding if you know in advance what type of data your file will contain. Since your file uses both English and Japanese, then I would recommend either UTF-16LE or UTF-16BE. Modern Windows OSes use UTF-16LE internally, but the conversion between both is trial. Please note that the endianness needs to be constant for the whole file, though. UTF-8 is interpreted as a sequence of bytes so endianness does not matter (although it may optionally have a BOM). (Whatever created that second file seems to have, among other things, endianness issues.) Pick an encoding that suits your needs and software support. Take a look at this for some more info. Bendono (talk) 01:59, 3 December 2008 (UTC)[reply]

Memory for a 2006 Macbook Pro

[edit]

What type of memory should I buy for a 15" Macbook Pro I purchased new in late May 2006? (By this, I mean it was the only Macbook Pro model available at the Apple store at the time). Obviously, they'd like me to purchase Apple retail memory, so they make it difficult to find the equivalent memory from other sellers. For some context: I'm trying to play the new World of Warcraft expansion and, even on the lowest settings, I get an extremely low framerate. (older game content runs fine, at higher settings, at 30fps, as do instances) --Sarcasticninja (talk) 18:42, 2 December 2008 (UTC)[reply]

Go to this page on the Apple Store and look up your model. But it looks like all the 15" Macbook Pros use 667MHz DDR2 PC2-5300 SO_DIMM. I have no idea what most of that means, but it should be enough to buy the right memory from some other store. --Allen (talk) 23:38, 2 December 2008 (UTC)[reply]

what is the best degree for making money in computing (UK) ?

[edit]

Say I wanted to change into a computing job , what would be the best degree for me to do as a mature student...

I can't speak specifically for the UK, but in Canada, Computer Science and Electrical Engineering are the only typical university degree programs that would apply specifically to a job in Computers. If I were you, though (depending on how 'mature' you are!:) ) I would consider a pursuing a professional designation rather than an undergraduate degree. Microsoft Certified Professionals are still a widely-accepted standard. I'm sure there are other networking and programming designations as well. My point is just that degrees are long and boring. You may want to pursue a specific skill.NByz (talk) 00:28, 3 December 2008 (UTC)[reply]
Electronic Publishing (with a minor in Criminal Justice, so you can stay one step ahead of the Treasury Department authorities). :-) StuRat (talk) 18:24, 3 December 2008 (UTC)[reply]

Defragging

[edit]

I'm using WinXPsp3. How good is the disk defragmenter that came with Windows? Is it worth it to install a different program? My Windows drive is about 20GB, if that affects anything. Matt Deres (talk) 22:25, 2 December 2008 (UTC)[reply]

Some of the programs you buy are definitely better. For example, PerfectDisk not only defragments the drive but also puts the most-commonly accessed data where it's more accessible. PerfectDisk also doesn't need 15% free space like the Windows defragmenter. Finally, it defragments system files by running once at boot time. When I had a smaller drive, I never had 15% free space, but it'd still reduce fragmentation to around 0%. ;) Also, Diskeeper defragments your drive in real time, that is, as you modify files.--Rjnt (talk) 00:33, 3 December 2008 (UTC)[reply]
PerfectDisk seems to have a 30-day trial, so it's definitely an option, but a free use one would obviously have an advantage. Are any of them particularly good? Any really poor ones? Matt Deres (talk) 04:18, 3 December 2008 (UTC)[reply]
I've always trusted Norton Utilities to do mission critical jobs like these and they haven't let me down yet - and I'm talking over 15 years here. Sandman30s (talk) 14:49, 3 December 2008 (UTC)[reply]

Poor USB HD performance on Mac

[edit]

I ran across this story [2] comparing file copy speeds via USB 2.0 on Mac and Windows. Just curious if anyone might have an idea why USB hard drive performance is so terrible on Mac OS X. --70.167.58.6 (talk) 23:23, 2 December 2008 (UTC)[reply]

The Mac was using HPFS and the PC was using NTFS, compeltely different file systems. Basically the reason is that IBM and Microsoft were creating a file system together, but disagreed over a number of important factors, so they split and we ended up with HPFS and NTFS. NTFS is clearly faster on every system I have ever seen (I believe HPFS requires an extra seek every time it has to find a new sector). Few people like to admit this because it implies microsoft made the right decision ;-) ----Dacium (talk) 02:53, 3 December 2008 (UTC)[reply]
I suspect that the mac was using HFS Plus and not HPFS+. But that article mentions "HPFS+" which I can only assume is a typo. It makes the whole article suspect. -- JSBillings 23:13, 5 December 2008 (UTC)[reply]