Jump to content

Wikipedia:Reference desk/Archives/Computing/2012 September 11

From Wikipedia, the free encyclopedia
Computing desk
< September 10 << Aug | September | Oct >> September 12 >
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.


September 11[edit]

processing power vs clock speed[edit]

Hello, from the System/34 article: Clock speed of the CPUs inside a System/34 was fixed at 1 MHz for the MSP and 4 MHz for the CSP. In today's PC-based world, the S/34 was the computational equivalent of a 16 to 20 MHz intel 80386 microprocessor. How is this (same processing power at a fraction of the clock speed) possible? Thanks in advance, Asmrulz (talk) 00:46, 11 September 2012 (UTC)[reply]

One thing different is that it was a 16-bit system. Thus, it sends half as much data in the same time as a 32-bit system with the same clock rate and 1/4th as much as a 64-bit system. However, that would seem to lower the 1 MHz speed to 0.5 or 0.25 MHz equivalent, so something else must be going on. StuRat (talk) 00:52, 11 September 2012 (UTC)[reply]
That's a horrible article, with no citations. I'd support deleting the article and starting over.
As far as your question goes, I've never heard about control and main store on System/34. But I am familiar with how the terms were used on System/370 and System/390. Most or all of these systems were microprogrammed. Also, IBM didn't like to use anthromorphic language in any publications made available to customers, so what today is called memory was called "store" or "storage". The main store was the main memory, as with modern microprocessors. The control store held the microcode. Since the central processing unit used the microcode to interpret the instructions from the main store, it was necessary for the microcode to be retrieved at a faster rate (4 MHz) than the instructions and data from the main store (1 MHz). Jc3s5h (talk) 01:09, 11 September 2012 (UTC)[reply]
The article originally said (in July 2005):
In today's PC-based world, think of the S/34 as having the processor equivalent of two 20 MHz 486s
This was changed the following month, by User:Jessemckay, to read "... two 10 MHz 386s" and considerably later to the current version.
I agree the comparison seems dubious. I'll ask Jessemckay to comment here.-gadfium 02:35, 11 September 2012 (UTC)[reply]

7z and wikimedia dumps[edit]

I was astounded at the size savings between bz2 and 7z when compressing the Wikimedia dumps. The entire history bz2'd is around 450 GB while the 7z one is about 60 GB. That difference astounded me. Because the XML with the full history is not a series of deltas, but actually the entire page revision, I suspect 7z is doing some sort of processing to find the large blocks of identical text? One clue is the explanation from meta wikimedia says the 7z advantage is only on the full history dump, which indicates there's some advantage between full revisions (that's lost when you just dump current versions of the pages). But it seemed to me that the blocksize the compression works on would be far smaller than the span between two identical article revisions. Anyone who could shed some light on why 7z is so much better in this context would help. Thanks. Shadowjams (talk) 01:20, 11 September 2012 (UTC)[reply]

From the Lempel–Ziv–Markov chain algorithm article lead-paragraph, and its reference page, the 7z algorithm uses a dictionary whose size is up to 4 GB. That is considerably larger than some competitors, and is a probable factor. Nimur (talk) 01:47, 11 September 2012 (UTC)[reply]
bz2, 7z, and gz all look for repeated blocks of text, but 7z looks much further back. I don't think the window is anything like 4gb though, since the decompressor doesn't use nearly that much memory. 67.119.15.30 (talk) 04:44, 11 September 2012 (UTC)[reply]
Bzip2 divides the data into blocks of at most 900KB which are compressed independently. All other widely used compression algorithms are Lempel-Ziv variants using a sliding window. If there are N very similar page revisions each of length L, Bzip2 will re-encode the whole page text N·L/900KB times, while a sliding-window algorithm will encode it only once if the window is larger than L. -- BenRG (talk) 05:37, 11 September 2012 (UTC)[reply]
Thank you. I guess the sliding window answer makes sense for serialized data like this. My only follow up question is how the dictionary (which I gather is essentially the sliding window) does this work without using such a large amount of memory (4GB apparently). Tell me if this is correct: because the dictionary is not stored in memory and instead the index is, and it is accessed directly from the original file. Shadowjams (talk) 17:13, 11 September 2012 (UTC)[reply]
LZMA may support a 4GB window, but that would require 4GB RAM to decompress and a lot more than that (20GB?) to compress. I grabbed one of the smaller 7z dump files (3 GB uncompressed, 23 MB compressed!) and it uses method LZMA:24, which I think indicates a 16MB window (224 bytes). The gains from a larger window would probably be small since the longest article is less than 1MB. -- BenRG (talk) 19:09, 11 September 2012 (UTC)[reply]
According to the User manual, memory for compressing is 11 times dictionary size, memory for decompressing is close to value of dictionary size (limited table provided: dict - comp - dec: 64k-3M-3M; 1M-10M-3M; 16M-186M-18M; 32M-376M-34M ) Ssscienccce (talk) 19:50, 11 September 2012 (UTC)[reply]
…and the "ultra" (maximum compression preset) uses a 32M dictionary. Bonus points if you figure out how xz -9 compares. :) ¦ Reisio (talk) 01:37, 12 September 2012 (UTC)[reply]
I don't know what the user manual says but the 64 bit Windows GUI version seems to use a 64MB dictionary for the ultra preset, for both LZMA and LZMA2. You can select up to 1024MB, but of course you need something like 10-11GB for compressing. Nil Einne (talk) 05:22, 12 September 2012 (UTC)[reply]
That does sound right. My guess is something generated by a server is using p7zip, but I've no idea really (plus it's configurable, so could be anything, heh). :) ¦ Reisio (talk) 05:57, 12 September 2012 (UTC)[reply]
BTW I had a look at the en wiki dump [1] and it seems the dump isn't even in one file anyway. They are different size so I presume not multipart 7z but rather just compressed seperately Nil Einne (talk) 05:54, 13 September 2012 (UTC)[reply]

How to activate the text to-speech voice: "Hazel" in Microsoft Narrator?[edit]

Hello! :-)
(Windows7 Ultimate 64bit). I believe that I have (a legitimate copy of) the text-to-speech voice named: "Hazel" in a folder named: "TTS_MS_en-GB_Hazel_10.0" which contains the following 5 files:

Hazel.APM 4429KB

Hazel.INI 1KB
HazelT.UDT 2KB
License.rtf 130KB

MSTTSLocenGB.dat 5504KB

Into which folder do I have to put these files? to make "Hazel" replace or become an alternative to the default voice named:
"Microsoft Anna - English (United States)" ?
Which is shown at:
Control Panel --> Ease of Access --> Speech Recognition --> Text to Speech.
I would like "Hazel" to be the standard voice when I start Microsoft Narrator(v.6.1):
Start --> All Programs --> Accessories --> Ease of Access --> Narrator
Or at least to be listed as an option inside Narrator
( --> Preferences --> Voice Settings --> Select Voice )
--89.9.196.12 (talk) 02:51, 11 September 2012 (UTC)[reply]

Someone texting and calling using my number?[edit]

I have a Droid Incredible smartphone with Verizon. A friend of mine (on my contact list) received several calls from my number (he reported that the caller was breathing heavily into the phone but did not say anything) and then received a inflammatory text message from my number (I am also on his contact list). However, I did not send these texts and had my phone on me the whole time, so it was impossible for anyone to gain physical access to my phone.

Is is possible that someone is possibly "hacking" my phone and using my phone number to dial/text others? If so, is there anyway I can prevent this?

Thanks Acceptable (talk) 06:35, 11 September 2012 (UTC)[reply]

More likely spoofing the apparent number, which is not as easy as spoofing the "From:" in mail but not impossible. —Tamfang (talk) 07:15, 11 September 2012 (UTC)[reply]
See Caller ID spoofing. I agree with Tamfang that this likely didn't involve your phone. Instead, they fished your info off your friend's phone. StuRat (talk) 07:17, 11 September 2012 (UTC)[reply]
Verizon allows you to block spammy callers. If you're receiving harassing calls, you can contact Verizon, who may be able to help. That may be in order here anyway, since the number is apparently being spoofed. Nimur (talk) 16:45, 11 September 2012 (UTC)[reply]
If I call Verizon, would they be able to tell me the true phone number of the person who called me? Even if that person is using some third-party app or website to spoof their caller ID? Acceptable (talk) 01:58, 13 September 2012 (UTC)[reply]

Linux commands: Unzipping selectively bunch of files in linux, deleting all but two types of file[edit]

If you have a series of zip files, all containing pdf files and other stuff, how do you unzip all pdfs from all files into a directory?

How do you delete, for example, all files that are not *.txt or *.jpg files? Is there a rm 'whether txt not jpg' way of doing it? OsmanRF34 (talk) 13:48, 11 September 2012 (UTC)[reply]

If the zip file has nested directories, use "find". Otherwise just "mkdir savedir; mv *.txt *.jpg savedir" and delete anything left over. 67.119.15.30 (talk) 16:22, 11 September 2012 (UTC)[reply]
That is: for i in *zip; do unzip "$i" -d foo; done && find foo/ -iname '*.pdf' -exec mv {} foo/ \; && find foo/ -not -iname '*.pdf' -delete (just be careful about how & where you run the one with -delete :p) ¦ Reisio (talk) 01:53, 12 September 2012 (UTC)[reply]
(ec) There's probably a fancy way of doing this on a single line, but I think it is logically easier to move the files you want to keep to another directory, delete the rest, then move the kept files back again. You can do the same with a bunch of files you extracted from a series of zip files. Astronaut (talk) 16:26, 11 September 2012 (UTC)[reply]
Agreed. If you wanted to do it without moving files, you'd make a list of all files, pipe it to a command that removes the files you want to keep, then apply that shortened list to the delete command. StuRat (talk) 16:31, 11 September 2012 (UTC)[reply]
A quick-and-dirty Python script:
#!/usr/bin/python
import zipfile, os.path
def unzip_some_files(filename, extlist, destination='.'):
    zf = zipfile.ZipFile(filename)
    for n in zf.infolist():
        if os.path.splitext(n.filename.lower())[1][1:] in extlist:
            zf.extract(n,destination)

unzip_some_files('foo.zip',['txt','jpg'], destination='dest')
-- Finlay McWalterTalk 19:53, 11 September 2012 (UTC)[reply]
A quick-and-ugly command:
mkdir tmpzip unzipped && for var in ls *.zip; do unzip $var -d tmpzip; done && mv tmpzip/*.jpg unzipped && mv tmpzip/*.txt unzipped && rm -r tmpzip
At the end you'll have all your .jpg and .txt files in the unzipped directory. ListCheck (talk) 21:16, 11 September 2012 (UTC)[reply]

Power Control Center ?[edit]

I have one of these: [2], and would like to buy more, but with additional features.

Description:

It plugs into an outlet, and has 5 outlets on it, just like a power strip, and also has a surge protection feature. However, unlike a surge protector, each outgoing outlet is controlled by an individual on/off switch on the device, in addition to a switch to turn them all off at once.

Additional features desired:

1) Additional outlets. The more the better.
2) Instead of just on/off switches, I'd also like dimmer switches which vary the voltage (and not the old type that burns out quickly or gets hot/wastes energy).
3) Battery backup. Ideally, I'd like some outlets to have the battery backup feature, such as those running electronics, but not others, like those running a space heater, air conditioner, or refrigerator.

Anyone know of any devices like this ?

I don't think you'll find one device that has all these features in one, and if you do it might be overly gimmicky. Dimmer switches are NOT a common feature on anything AC except a light switch, what would you need dimmer switches for? Maybe you'd be better off with a variable power supply? Battery backup is just another word for UPS, they aren't cheap for a half decent one and I probably wouldn't reccomend one with a lot of "frills". Personally it sounds like you'd be better off sourcing 2 or 3 different devices for the specific features you are after, rather then one frankenstein. Vespine (talk) 22:25, 11 September 2012 (UTC)[reply]
Uses for dimmer switches:
A) Halogen and incandescent lights (used in winter only).
B) Electric fans (summer only).
C) Electric space heaters (winter only).
These devices often come with their own power control systems, but, in the case of halogen lights, the dimmer switch often fails, and in the other two cases the switches have 3 positions, rather than continuously variable controls. I also don't want to have to walk across the room every time I want to change the settings. StuRat (talk) 22:34, 11 September 2012 (UTC)[reply]
As far as UPS/battery backup, I just want enough time to close down what I'm working on on the computer, not to run for hours or days on it. StuRat (talk) 22:36, 11 September 2012 (UTC)[reply]
I don't think it's typically a great idea to dim just anything off an AC circuit, so I'm not sure you'll find something like a power conditioner with a dimmer on a regular power socket, by default. Some devices can be dimmed safely and efficiently, like maybe the fan, but other things, like halogen bulbs (which are designed to run above a certain temperature which is only maintained at something like >85% power rating), don't take to dimming very well, significantly lowering their efficency and life.. My recomendation is separate line dimmers for anything you specifially want dimmed, and a little UPS for your PC and the power conditioner for everything else. If you want it all in one unit, some duct tape might do the job ;) Vespine (talk) 04:48, 12 September 2012 (UTC)[reply]
I've already got wires all over the place, I was hoping to reduce the trip hazard, rather than increase it. In this room I have a TV, DVD player, digital converter box, mini fridge, 2 fans, a stereo, an intercom, 3 floor lamps, computer, PC, monitor, printer, external hard drive, cup warmer, 2 sets of speakers (one for TV and one for PC), microwave oven, clock, answering machine, and window A/C unit. That's 23 items with enough cords for a double-dutch tournament, not counting the numerous extension cords and power strips. StuRat (talk) 05:05, 12 September 2012 (UTC)[reply]
Wow, lol, that IS a lot of stuff... I wasn't questioning your "need" for such a device :) I just highly doubt one actually exists with ALL those features, I'll happily be proven wrong if someone has seen one for sale. Of course, if you have any friends that are into electronics... Because such a device wouldn't be too hard to build for anyone with minimal experience with mains voltage electronics, the only part I'd even need to research would be the UPS part since I've never built one before, but even if you bought a little UPS unit as the starting point and then just added everything else you wanted into a custom enclosure, it would be a piece of cake. Vespine (talk) 05:50, 12 September 2012 (UTC)[reply]
Apparently I'm not the only person to want such a thing. I found a homemade power control center made by a Brit. Type "Bespoke Dimmer Control Box" into Google image search to find it. StuRat (talk) 07:16, 12 September 2012 (UTC)[reply]

UPDATE: I just ordered 3 of these dimmer switches: [3]. Hopefully I can wire these in with my existing power control box. Still no UPS, though. StuRat (talk) 08:16, 12 September 2012 (UTC)[reply]

A standard light dimmer is not suitable for a fan - the solid state electronics are designed for a constant resistive load, and an electric motor can cause all sorts of issues. Fan dimmers can dim a light and have the extra bits thrown in needed to make sure a fan motor will run fine. Here is some information on the options: [4]. 209.131.76.183 (talk) 11:58, 12 September 2012 (UTC)[reply]
Is the model I bought a light dimmer ? It is the slide type, and they do call it a dimmer, but don't give the disclaimer that it's just for resistive loads, not inductive loads, as another model did. Also, 2 of the reviews are from people saying they are using it for fans, and it's working well for them. StuRat (talk) 12:22, 12 September 2012 (UTC)[reply]
The manufacturer's description only mentioned lights, and not other applications. It also says "Use with incandescent and halogen bulbs only", but I don't think standard CFLs work right on any sort of dimmer, so I could see putting that warning on a fan dimmer too. I wouldn't have bought it to use with a fan based on just the description, but if people in the reviews are using it for fans, that is a good sign. 209.131.76.183 (talk) 15:09, 12 September 2012 (UTC)[reply]
OK, good, I'll try it out that way then. The other two I had in mind for a halogen floor lamp and space heater (both in winter only). StuRat (talk) 20:42, 12 September 2012 (UTC)[reply]
Space heaters often require power in the vicinity of 1000 watts; the dimmer StuRat linked to was only rated for 500 watts. Of course the right approach is to hire an electrician to install sufficient outlets so there is always an outlet near each device, and at the same time, install an electric heater with a thermostat to turn it on and off as needed to achieve the required temperature. Jc3s5h (talk) 14:02, 13 September 2012 (UTC)[reply]
Yea, but that's thousands of dollars, versus the $30 I spent on the 3 dimmer switches (and I used my credit card reward points for that, so it's "free"). The space heater has low, medium, and high settings, which I guess are 500, 1000, and 1500 watts. I never use it above low, since it gets hot enough to burn you on medium or high. Actually, I'd like even less than low, which is where the dimmer switch comes in. StuRat (talk) 04:56, 14 September 2012 (UTC)[reply]