Wikipedia:Reference desk/Archives/Computing/2011 July 26

From Wikipedia, the free encyclopedia
Computing desk
< July 25 << Jun | July | Aug >> July 27 >
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.


July 26[edit]

privacy & google maps street view[edit]

Looking at

this street view on Google Maps, I just see some ordinary boring houses; then I click on the white arrow to move further in the direction at the right side of the picture and see this ordinary-looking house, and click on the arrow again, and there's nothing unexpected; and so on, but then this one starts to show something different, and here something's definitely not in focus, and similarly here, and here, that's coming to an end, but not quite yet, and the next building is not concealed, but we're not past all that yet, and now we've moved on, and we're back to normal here.

Is this

  • a problem with focus; or
  • done deliberately for the sake of privacy because whoever lives there demanded it; or
  • something else? Michael Hardy (talk) 01:34, 26 July 2011 (UTC)[reply]
Quite a few Germans didn't want their houses on Streetview: http://searchenginewatch.com/article/2050481/244000-Germans-Demand-Removal-of-Google-Street-View-Imagery Unilynx (talk) 05:13, 26 July 2011 (UTC)[reply]
I see. Some time last year I noticed that I could get street views for a city in Spain (I don't remember which one) and for some parts of Hamburg but not others. I thought that more of Hamburg is now visible in this way than was a year ago, and the article you link to seems to confirm that. Michael Hardy (talk) 15:04, 26 July 2011 (UTC)[reply]
The Streisand effect may be of interest to you as well. Dismas|(talk) 05:28, 26 July 2011 (UTC)[reply]

Reliable Power Supply Unit[edit]

I'm planning on building a computer that requires 280W of power (actually more like 200W, but I like to be conservative). I'll be using this computer at a site with unreliable power produced by a small generator. I desperately need a reliable power supply unit that won't fail under larger-than-normal fluctuations in the amplitude, frequency, etc. of the input power. Can anyone recommend a PSU that has comprehensive protections built-in, and that produces a nice, clean output voltage despite "dirty" input power? --140.180.16.144 (talk) 05:24, 26 July 2011 (UTC)[reply]

Such a job (which is often called "power conditioning") is often done with an external uninterruptible power supply. You can find small single-PC versions (which also give a couple of minutes of uptime in a total power failure mode) for a very modest fee. A few companies produce PC PSUs with built-in UPS functionality, but unless you're very short of space indeed, I'd go with a simple external one. -- Finlay McWalterTalk 11:24, 26 July 2011 (UTC)[reply]
You'll want to pay attention to the offline / line-interactive / online distinction in uninterruptible power supply. Offline is the cheap and ubiquitous device, but does nothing to power fluctuations. Line-interactive can help with power fluctuations as long as they are not too rapid; these UPSes exist for the consumer market, but you'll need to pay attention that you buy one of these rather than an offline one. Online is the best for dirty input power, but these tend to be high end, high power professional devices - I have never seen a home/small office model for sale (not that I have looked very hard.) 88.112.59.31 (talk) 15:28, 26 July 2011 (UTC)[reply]

Pulling up a nickname history on IRC[edit]

I was told that /who is the command to pull up the history of all usernames used on a hostmask. I tried that on my own; didn't work. (Someone else managed to succeed on that one, however.)

It should say "Nicknames seen on (hostmask): (list of all nicknames.)"

What exactly is the command that I type to get this? Is it even a "/who?" --70.179.165.67 (talk) 05:30, 26 July 2011 (UTC)[reply]

I think you might be able to get this information with /whowas. Avicennasis @ 06:12, 24 Tamuz 5771 / 26 July 2011 (UTC)

Webpage with multiple scrollbars and no frames[edit]

Hi! I'd like to create a webpage which looks like this: http://i.imgur.com/iDoLl.png

I can't use frames(I'll be using AJAX on the site so more reason to have everything in one page because content on one page influences others. What's the cleanest way to do something like this?

A website which does something similar would be Google Reader. I'm a total noob with HTML and I'm not sure how they accomplished that.

Thanks! — Preceding unsigned comment added by Legolas52 (talkcontribs) 05:51, 26 July 2011 (UTC)[reply]

You just create a DIV element of a certain size, and then you specify overflow:scroll in its CSS style, and the browser will add scrollbars as necessary. The browser tries to avoid much horizontal scroll, so if you want more than a trivial mount of that, you need a horizontal object that is sufficiently wiiiiiiiiiiiiiiiiiiiiiiiide to force the internal "pane" to be wider than the DIV.
-- Finlay McWalterTalk 11:12, 26 July 2011 (UTC)[reply]
Yes, Mcwalter is correct. Read about the Overflow property here TheGrimme (talk) 13:10, 26 July 2011 (UTC)[reply]
But, some browsers do not support scroll overflow. I see truncated content in the above example, viewing this page on an iPad in Safari (though, if I know it is truncated, I can swipe to scroll it). On the other hand, I can zoom content on the iPad in ways that conventional browsers cannot, so I do not strictly "need" scrollbars on my divs. (If Finlay's CSS had not specified size in this way, I could have zoomed into the div). Use caution designing your webpage user interface, because it may be viewed on many different types of systems, browsers, and devices. The page will not always appear as you intended. Strict interpretation of the W3C guidelines for CSS overflow indicate this issue: if the user agent supports scrolling. Consider using overflow=auto to allow each browser to decide its layout for itself. Nimur (talk) 15:04, 26 July 2011 (UTC)[reply]
Additional discussion of the issue at StackOverflow - though I do not advocate all the solutions suggested there. I am philosophically predisposed to disrecommend JavaScript or JQuery for this purpose, as it amounts to browser-sniffing. Nimur (talk) 15:09, 26 July 2011 (UTC)[reply]

Is this sentence correct?[edit]

Moved to Wikipedia:Reference desk/Language#Is this sentence correct? as a far more suited desk for this question Nil Einne (talk) 09:43, 26 July 2011 (UTC)[reply]

Matrix multiplication in php using foreach loop[edit]

Please can u help me for multiplying two 3x3 matrices in php using foreach loop. — Preceding unsigned comment added by 14.97.130.154 (talk) 15:03, 26 July 2011 (UTC)[reply]

Please do your own homework.
Welcome to Wikipedia. Your question appears to be a homework question. I apologize if this is a misinterpretation, but it is our aim here not to do people's homework for them, but to merely aid them in doing it themselves. Letting someone else do your homework does not help you learn nearly as much as doing it yourself. Please attempt to solve the problem or answer the question yourself first. If you need help with a specific part of your homework, feel free to tell us where you are stuck and ask for help. If you need help grasping the concept of a problem, by all means let us know. AndrewWTaylor (talk) 15:05, 26 July 2011 (UTC)[reply]
<?php
$a=array(0=>array(1,2,3),1=>array(4,5,6),2=>array(7,8,9));
$b=array(0=>array(9,5,4),1=>array(8,6,7),2=>array(5,4,7));
$c=array();
echo "a=";
print_r($a);
echo "<br>b=";
print_r($b);
foreach($a as $row=>$rowarray) 
{       
        foreach($rowarray as $col=>$val) 
        {
                $c[$row][$col]+=($a[$row][$col]*$b[$col][$row]); 
        } 
}
echo "<br> product=";
print_r($c)
?>

here is what i have tried but it is not working properly please help me out. — Preceding unsigned comment added by 14.97.130.154 (talk) 15:09, 26 July 2011 (UTC)[reply]

The formula for matrix multiplication is . Your code implements a completely different formula. Looie496 (talk) 17:33, 26 July 2011 (UTC)[reply]
Matrix multiplication is performed by using a for loop inside of a for loop, not two foreach loops. You can make a mess of the code to force it into two foreach loops, but that would be rather idiotic. You end up with a slew if if-else statements that you wouldn't need if you just use for loops. -- kainaw 18:01, 26 July 2011 (UTC)[reply]
Note that our two foreach loops worked fine for matrix addition, because the matrix sizes must be identical. Matrix multiplication, though, can use matrices of difference sizes, so it definitely won't work for that. --Mr.98 (talk) 19:46, 26 July 2011 (UTC)[reply]

Update[edit]

Regarding my post here on July 17th with the heading "Malicious program in my computer" : the problem is solved. Surfcanyon seems to have been the culprit. After deleting its last remnants from my registry, the problem magically went away. A big thanks to those who gave advice to rid me of my problem—whether it helped or not, it was very much appreciated. Hooray! Hamamelis (talk) 16:02, 26 July 2011 (UTC)[reply]

For reference, the question was previously asked on 7/17: Wikipedia:Reference desk/Archives/Computing/2011 July 17#Malicious program in my computerAkrabbimtalk 16:18, 26 July 2011 (UTC)[reply]

Another rsync question[edit]

When using rsync on a Fedora Linux system, can I do an identical folder move on both the source and the destination file systems (i.e. move the same folder from the same original place to the same new place) with a simple mv command and will rsync be happy with that, or will it mess up some kind of rsync configuration, meaning I would have to first move the folder on the source file system and then do a complete rsync update operation with the "delete files not present on source" option? JIP | Talk 16:35, 26 July 2011 (UTC)[reply]

Yes, providing the move on both ends produces identical results, rsync shouldn't need to do further work. rsync isn't like (many) version control systems - it doesn't keep around a persistent idea of what the remote filesystem should look like between runs. Note that, in some circumstances, people really do use a VCS to maintain a remote image, because (many) VCSs do have a concept of "move", which (as your question underlines) rsync doesn't. -- Finlay McWalterTalk 16:54, 26 July 2011 (UTC)[reply]
Great! The reason I'm asking is that I'm planning to move all my digital photo folders to a different subfolder, within the same file system. The move operation itself will only take a few seconds, but if I have to make rsync first copy the folder to the new location and then delete it from the old one, it will take hours, if not days. JIP | Talk 17:01, 26 July 2011 (UTC)[reply]

What could be causing wrong characters to appear?[edit]

I have a feeling if I go to the Village Pump with this they'll say it's the computer, not Wikipedia. But something is seriously wrong with this computer (not the one I'm using now, but a different one at the same library). In addition to being slow, it did this. The version on the right is what I actually typed. What happened on the left I don't know.Vchimpanzee · talk · contributions · 17:23, 26 July 2011 (UTC)[reply]

Malfunctioning keyboard. Looie496 (talk) 17:26, 26 July 2011 (UTC)[reply]
Well, I typed the correct characters and they did fine the next time.Vchimpanzee · talk · contributions · 17:46, 26 July 2011 (UTC)[reply]
A working keyboard but with the incorrect country defined in the PC's keyboard driver? For example, the "#" on a UK keyboard is close to the "[" and "]" characters on a US keyboard. Astronaut (talk) 12:52, 27 July 2011 (UTC)[reply]
I do know the characters appeared correctly when I retyped them. That computer had numerous problems (I'll report back if I find out more about what was wrong with it), though, and I gave it up. There's no reason for a UK keyboard as I am in the United States, and although the college has students from other countries, there's no reason it would have any UK keyboards.Vchimpanzee · talk · contributions · 18:25, 27 July 2011 (UTC)[reply]
Not specifically a UK keyboard, but I can imagine a foreign visitor to the library modifying the keyboard to whatever their language is and thinking it would make it easier for them to use; instead the PC just gets confused. However, as it seems to be magically correct sometimes I would suspect a faulty keyboard (or driver). If that particular PC has numerous faults, tell the library staff and go pick a different one. After all, you are not technical support for the library and I suspect there is some 'terms of use' posted somewhere that explicitly says visitors shouldn't mess with the computers' settings. Astronaut (talk) 16:44, 28 July 2011 (UTC)[reply]

C# questions[edit]

I've seen people in my company use constructs like these in C#:

object a = from list where (condition) select (field);
foreach (var a in list)

What exact benefit do these constructs give in favour of the following?

object a = list.Where((condition)).Select((field));
foreach (T a in list)

(assuming list is of type IEnumerable<T>)? JIP | Talk 18:54, 26 July 2011 (UTC)[reply]

They are syntactically equivalent. In the documentation, these keywords are calld "LINQ (Language-Integrated Query)" and are intended to be "easily-learned patterns for querying and updating data." Furthermore, it allows the programmer to use identical syntax for analogous queries to SQL, XML, and C# objects. In a sense, the intent was to promote data-querying from its status as a library function-call to a first-class language syntax construct. Nimur (talk) 19:20, 26 July 2011 (UTC)[reply]