Jump to content

Wikipedia:Reference desk/Archives/Computing/2011 September 16

From Wikipedia, the free encyclopedia
Computing desk
< September 15 << Aug | September | Oct >> September 17 >
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 16

[edit]

rotate an image

[edit]

Hi. I have a ppm file and wish to rotate it by any angle (ie any angle, not just multiples of 90 degrees). I want the pixels to be in the same place but the image to be rotated. I don't care about edge effects. But I want to do it gazillions of times, quickly. I also need to scale the image by shrinking it about its center (again, edge effects don't matter: areas that originate from outside the original image can just be black, no probs). Is there a C or C++ library of routines to help me do this, or do I have to write it all from scratch? Robinh (talk) 08:44, 16 September 2011 (UTC)[reply]

You can use Imagemagick: convert -rotate 13 -resize 50% in.ppm out.ppm will rotate by 13 degrees clockwise and downscale by 50%. If you need to drive the whole process from C you can use imagemagick's c library libmagick. Other libraries should work too - an example of rotation using cairo is here, for example. -- Finlay McWalterTalk 11:50, 16 September 2011 (UTC)[reply]
Thanks for this. It works, but I didn't get the speedup I was hoping for. How do I make convert give an ascii file instead of the binary it gives? cheers, Robinh (talk) 09:42, 18 September 2011 (UTC)[reply]
Add -compress none to the list of options to make an ASCII ppm. But this file will be more than twice the size of its binary equivalent, so your file write will be slower, not faster. -- Finlay McWalterTalk 10:26, 18 September 2011 (UTC)[reply]
got it. thank you!
Resolved
Robinh (talk) 19:52, 18 September 2011 (UTC)[reply]
For what it's worth, ImageMagick has an API that can be used in C or other languages -- if you wanted to go to the trouble, you could write a single program to process large numbers of files with startup and shutdown costs. Looie496 (talk) 20:10, 18 September 2011 (UTC)[reply]

Analog And Digital Signals

[edit]

What is the basic difference between them as well as the exact definition of each?? — Preceding unsigned comment added by Encyc lover (talkcontribs) 09:25, 16 September 2011 (UTC)[reply]

Analog signal and Digital signals are the Wikipedia pages about these. If this is too complex, there's a simpler description of analog signals [here]. Basically, an analog signal is continuously variable, while a digital signal has a certain number of different levels or "steps"; this means a digital signal only encodes an approximate value. Computers, being digital devices, can only handle digital signals. If you have further questions, please ask. --Colapeninsula (talk) 12:38, 16 September 2011 (UTC)[reply]
Not to confuse the issue too much, but there are analog computers :) SemanticMantis (talk) 15:05, 16 September 2011 (UTC)[reply]

Google is getting too "smart"---what can I do about it?

[edit]

I have been trying to find old news items on Google, in the way it has been possible to do in the past. I tried with google.co.uk and google.com, switched to "News" and then to "Archives" and expected to find mostly English results, but would in fact welcome results in any languages available.

But the only results I get are in Swedish. OK, I live in Sweden and Google knows this, but I am not looking for Swedish results primarily.

If I search for, say, "Margaret Thatcher" or "Richard Nixon" I expect to get results mostly in English and mostly from UK and US sources, respectively. That is the way the Google News Archive search used to behave. I searched for some topic and, unless I intentionally added a language filter, I got results in all languages but mostly in the most relevant languages and in the news sources represented in Google's News Archives. I could get hits from US newspapers from the 1800s when searching for certain things, thanks to the availability of these in Google's news archives.

That is all gone now. Despite my use of google.com or google.co.uk (rather than google.se), Google seems to assume that I only want hits in Swedish. I see no way in the "advanced search" page to filter by language to get results in English or some other language. (I think there used to be, but I may may be wrong.)

This is not the only way in which Google is getting annoyingly arrogant and presumptuous. Its constant changing of my search terms or showing me results for something other than what I searched for is another. Google used to meekly suggest alternative searches, which was very helpful when I was uncertain about the exact spelling or name of something or someone. It has now gone past that into simply assuming that I have no freaking idea what I really want and ignoring my real search term. Increasingly, I find myself having to making a second search simply to get Google to search for what I originally asked for.

Sorry for the rant. Getting to the actual question: how do I get back the good old Google? Is there any workaround for getting search results in English when this is what I want, or in any other language for that matter?

This is the URL I get for my news archives search result for "Margaret Thatcher", starting from google.co.uk. All the hits are in Swedish and from Swedish sources. Could someone in the UK check to see if you get different results when you put this URL into your browser? If you get the same Swedish results I get, there is presumably some element in the URL that controls language. Which is it? — Preceding unsigned comment added by Nonsensical username (talkcontribs) 10:37, 16 September 2011 (UTC)[reply]

No, I get results in English if I click your link. There is an circular icon in the top right of the page with eight protuberances (representing the tentacles of the Google octopus). If you click on this you will reach the preferences page, and can set a "search language". When I tried to select Swedish this way (to try and achieve the opposite of what you want), I made the following observations: Firstly, although I could select "Swedish" I was not allowed to de-select "English". Secondly, on returning to the search page, a new option appeared in the toolbar on the left, where one chooses whether to search the whole web or search locally, called "custom". Thirdly, clicking this option made bugger all difference and the results were still all in English. Still, it's something to try. Update: I tried searching for Margaret Thatcher politiker. This returns mostly German results without "Swedish" selected in the preferences, and mostly Swedish results if it is selected, so I think it works a bit. Clicking the "custom" option still seems to change nothing at all.  Card Zero  (talk) 11:16, 16 September 2011 (UTC)[reply]

I found an advanced news search page with the option to specify which country you want hits from, but when I tried it did not appear to work. 82.43.90.142 (talk) 12:17, 16 September 2011 (UTC)[reply]

I'm getting a bit annoyed with the way Google substitutes search terms as well. If you're looking for information about, say, an illustrator with a fairly common name, you would expect a search of "Joe Bloggs" illustrator to target him quite accurately, but as well as pages with "Joe Bloggs" and "illustrator" you also get pages with "Joe Bloggs" and "artist", and as well as visual artists, musicians and actors are often called artists as well, so it hardly narrows the search at all. It's getting to the point where you have to put every single word in quotes, or it'll drown what you want in all sorts of stuff you don't. --Nicknack009 (talk) 12:27, 16 September 2011 (UTC)[reply]
@OP: Maybe you will find the solution if you take a look at the section: Control personalized predictions a bit down on this Goggle help page (entitled: Autocomplete: Explore Google Search - Web Search Help).
--Seren-dipper (talk) 12:29, 16 September 2011 (UTC)[reply]
I've got the impression from similar situations, that adding a plus character before the search term tends to suppress fuzzy matching like substituting "illustrator" with "artist". For me (located in Norway), the link above that searched for Margaret Thatcher on google.co.uk resulted in links in English only (at least for the first couple of pages), whereas a search on google.no results in a mixture of some results in English, some in Norwegian. To bias the results more towards results in Norwegian, I searched for "Jens Stoltenberg" on google.no. In the first page, all but one of the results were in Norwegian. A trick I've used to get results in the target language, is to add a common word from the target language preceded by a plus character. Searching for "Jens Stoltenberg" +that on google.no yields results in English, and is far more effective than adding a language requirement on the advanced search page. The problems discussed in this thread illustrate what is called the Search engine filter bubble. An interesting search engine that has as a goal to avoid such biases, as well to protect your privacy, is DuckDuckGo, which may be of interest to the OP. --NorwegianBlue talk 15:36, 16 September 2011 (UTC)[reply]
I noticed that if I select a language in normal google search, then switch to a news search google tries the search in the selected language. Also you could insert "&lr=lang_en" (english) in the url and I would guess this would work. (You are right that there is no language selection in news search) — Preceding unsigned comment added by 83.100.239.6 (talk) 23:11, 16 September 2011 (UTC)[reply]

OP here: Thanks for all the replies! Here is something I should probably have thought about before: today I checked Google's search behaviour with a couple of alternative browsers (I usully use Firefox, but tested IE and Chrome) and it turned out that they didn't have this issue. I guessed it might be some cookie saved by Firefox and cleared all cookies---and voilà, now the problem is gone! (I still don't know which cookie created the problem, but I'll worry about that if it reappears.) --Nonsensical username (talk) 17:07, 17 September 2011 (UTC)[reply]

Program to activate Hibernation in Windows7

[edit]
Resolved

I have a programmable key on the front of a computer. I would like to make it invoke hibernation mode.
Is there some standard Windows7 program, maybe somewhere under C:\Windows, that will activate hibernation?
-- 46.15.251.168 (talk) 11:53, 16 September 2011 (UTC)[reply]

Custom things like that require the manufacturer's program. For example, if you have an HP computer with a custom button on it, you need the HP settings program to set it. -- kainaw 11:58, 16 September 2011 (UTC)[reply]
The manufacturer's program only lets me assign a filename to the button, so my question still stands: Which file, on a computer with Windows7, will activate hibernation?
--46.15.251.168 (talk) 12:08, 16 September 2011 (UTC)[reply]
I found a VBscript which triggers hibernation via a series of simulated keystrokes:
If you create Hibernate.vbs containing:
       set WshShell = CreateObject("WScript.Shell")
       WshShell.SendKeys "^{ESC}uh{ENTER}" 
 Card Zero  (talk) 12:10, 16 September 2011 (UTC)[reply]
That is the key sequence for Windows XP: I don't think it will work for Windows 7, as requested by the questioner. AndrewWTaylor (talk) 12:30, 16 September 2011 (UTC)[reply]
Do the following:
-- Finlay McWalterTalk 12:22, 16 September 2011 (UTC)[reply]
If you don't want to use F11, but the special key on the front of your computer, you need to figure out its key code. A description of how to do this for AutoHotKey is here. It sounds like you may have a program that already binds that key, in which case you don't need AutoHotKey, and can have that program just run shutdown /h itself. If it won't, you might need to remove that program to make the special key detectable to ordinary programs (that hook the keyboard) like AutoHotKey. -- Finlay McWalterTalk 12:46, 16 September 2011 (UTC)[reply]
Thank you all! It turn out that a simple file shortcut did the trick (instant hibernation) when I set it to target: C:\Windows\System32\shutdown.exe /h
-- (OP) 89.8.227.104 (talk) 15:44, 16 September 2011 (UTC)[reply]

Win7 recently opened programs

[edit]

Why do some programs not populate the automatically updated list in the Windows 7 start menu, but others do? It also looks like there is some sort of hidden selection criteria that favors Microsoft-affiliated programs, putting them towards the top with much fewer executions. I've tried using my friend Google, but most of the results are forum requests for how to disable it or refresh it and all that, and none about how it actually behaves. —Akrabbimtalk 14:01, 16 September 2011 (UTC)[reply]

[1] claims at least in XP there's no priority given to Microsoft (or any vendors) applications and the code was reviewed by US? government appointed regulators. In any case, I don't know how well it is documented how items are chosen. According to someone here [2], MSDN in fact claims an item is not reordered once it appears in the MRU/MFU list. This doesn't concur with my experience in Windows 7 Ultimate and I think Windows Vista. Perhaps it was the way things were in Windows XP. Perhaps Ultimate users are considered smart enough to not get confused by reorderign of the items in the list. Perhaps Microsoft planned to do that, then they realised things would be just as confusing when things drop on and off (as they wouldn't necessarily be from the bottom in that case). The MSDN article might give some clue and perhaps it's clear it doesn't apply to Windows 7 Ultimate but if not, then it does highlight the fact the documentation may not be great.
You can use [3] to see the info MS has stored on the programs you use although if you go thru that and his? other related posts it's clearly he's largely reversed enginered the info since it isn't documented. [4] mentions an important although perhaps obvious point, MS likely doesn't want programs manipulating their order. [5] does mention there are some poison words (largely to avoid things like installers and helper apps showing up) although the associated KB article seems to be gone, and also mentions Vista has some more tricks to stop unwanted programs appearing.
Nil Einne (talk) 00:39, 17 September 2011 (UTC)[reply]

Apartment Door Openers

[edit]

At a friend's condo building there is a console in the lobby. Keying a three digit code there rings the telephone in his unit through some kind of interface. He and I can talk through this "hybrid system" using either his wall phone or his portable wireless phone. However the important feature of "press 6 to release the building door lock to let me in" only works at the wall phone.

One theory is that the portable phones do not have enough power to trigger the door release. Another is that they only send a brief tone when the 6 key is pressed and held, whereas the hard-wired phone sends a tone as long as the key is held.

Does anyone know a way around this problem? It is a real problem for him due to limited mobility. Thanks, Wanderer57 (talk) 19:24, 16 September 2011 (UTC)[reply]

You can test the theory that the wireless phone's DTMF tone is too brief by putting the dtmf 6 tone on a media player and playing that through the wireless phone. That sample is nice and long, so if its a DTMF detector on the other end that will open it. It's not certain that the lock works by DTMF detection, but (with some filtering to prevent the person on the stoop opening it) it's a reasonable way someone would consider for implementing this. Failing that, try an ordinary wired phone (not the special condo phone) and see if that opens it (I'd imagine it would work, or not work, just like the wireless phone). It may, however, be that the existing wire line phone is special, and does some (non telephone standard) in or out-of-band signalling. -- Finlay McWalterTalk 20:16, 16 September 2011 (UTC)[reply]
Oh, and make sure the wireless phone is set for tone dialling (DTMF) and not pulse dialling. There's often a little switch on the base. -- Finlay McWalterTalk 20:17, 16 September 2011 (UTC)[reply]
I've seen some systems like this with phones with extra wiring to activate the door opening. The ones I saw used a RJ14 connector with the phone line wiring working as usual, and a 'second phone line' used to activate the door opener. If this setup's like that, the phone plug into the intercom phone would have four metal contacts on it (where usually you'd have only two). Of course, seeing four contacts rather than two doesn't mean the system's like that, but two is cheaper, so that's what you'd expect to see. Nevard (talk) 06:07, 17 September 2011 (UTC)[reply]