Jump to content

Wikipedia:Reference desk/Archives/Computing/2012 February 23

From Wikipedia, the free encyclopedia
Computing desk
< February 22 << Jan | February | Mar >> February 24 >
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.


February 23

[edit]

Rigamarole

[edit]

In Windows 7, to connect to my ISP, the procedure is: Control Panel/Network & Internet/ Network & Sharing Centre/"connect to a network"/"connect or disconnect"/click name of ISP/click "connect"/click in window to use the stored userid and password.

I can cope with this rigamarole but it is really a problem for some people who use the computer.

I made a desktop shortcut which goes straight to "Network & Sharing Centre" but that still requires remembering five clicks. Is there a way to bring this down to one or two clicks? Perhaps with a DOS command?

Thanks, Wanderer57 (talk) 03:00, 23 February 2012 (UTC)[reply]

I take it this is a dial-up connection? Does this page help? -- BenRG (talk) 05:24, 23 February 2012 (UTC)[reply]
If this is a wi-fi connection, you should be prompted to "save this connection" and to "start this connection automatically" (I can't remember the exact wording, but it is a simply pop-up with 2 tick boxes). Maybe you don't get that choice if you have previously identified the connection as a public location, rather then a private location. Astronaut (talk) 12:03, 23 February 2012 (UTC)[reply]
Thank you both. The connection is not wireless, it is thru ethernet cable to an ADSL+ modem which uses the telephone line. I guess I complicate things for myself by choosing to turn off the modem when I'm not using it for a while (as a security precaution).
The page link from BenRG does not seem to apply; I don't think my connection is dial-up in the sense used on that page. Wanderer57 (talk) 17:39, 23 February 2012 (UTC)[reply]
I think that rasdial will do what you want. You can make a shortcut on the desktop so it will only take a double-click. Another option would be to buy a cheap non-wifi router (you could probably find one used for $10-$20 in the US) and put it between the modem and your computer. It can be configured to log on for you (zero clicks) and it will also act as a hardware firewall. -- BenRG (talk) 20:57, 23 February 2012 (UTC)[reply]
There is a solution, in general, for rigamarole. Whenever you have a complicated sequence of mouse clicks and/or keystrokes, you can abbreviate them down to a keystroke or two. Simply download a macro utility, and follow the instructions. I've tried many, and my favorite, by a big margin, is called "Macro Express". It's not expensive, and I think older versions are available as freeware. David Spector (user/talk) 20:26, 27 February 2012 (UTC)[reply]

How to express"a textbox is blank" in VB 2005?

[edit]

Like

If (textbox1 is blank or textbox2 is blank) then

...

Else

...

End If

How to express this?--202.117.145.240 (talk) 07:28, 23 February 2012 (UTC)[reply]

If textbox1.Text = "" then
    asdf
Else
    asdf
End If

Στc. 07:35, 23 February 2012 (UTC)[reply]

I don't know Visual Basic at all well, but expanding on the above, you will need to use the 'or' operator. You can also use parentheses to clarify things a bit:
If (textbox1.Text = "") or (textbox2.Text = "") then
    ...
Else
    ...
End If
Logical operators like 'or' and the use of parentheses, are common features of most programming languages, just the specific syntax differs. Astronaut (talk) 11:48, 23 February 2012 (UTC)[reply]
That would work. If you want to count empty spaces as blank, change the textbox1.text calls to Trim(textbox1.Text). --Mr.98 (talk) 12:21, 23 February 2012 (UTC)[reply]

Computing x^y as exp(y*ln(x))

[edit]

I have read that the standard method for raising a number to a power is to use this identity:

x^y = e^(y*ln(x))

I don't understand why. If you do that using floating point, you are making the significand eat information that belongs in the exponent, which makes the algorithm numerically unstable. Isn't this considered a problem in the real world? How is it dealt with? (Please don't speculate; I am perfectly capable of doing that myself. I recognize it and have a good idea of how I would handle it. I just want to know what the standard practice is here.) — Preceding unsigned comment added by 75.40.137.93 (talk) 10:55, 23 February 2012 (UTC)[reply]

Hmm? This is just the definition of real-to-real exponentiation. It has nothing to do with implementation on a physical computer. If you want to know how the exponential function is actually implemented in an FPU, I'm afraid I really don't know, but I'm pretty sure you've made an unjustified leap here. --Trovatore (talk) 11:02, 23 February 2012 (UTC)[reply]
Actual implementations of exponentiation in floating point systems, and the management of error, are discussed at length in Knuth vol2 p461-483 and this paper. -- Finlay McWalterTalk 14:31, 23 February 2012 (UTC)[reply]
That is for raising to a real-valued power. It might be worthwhile to split the expontent into integer and real parts, with the real part < 1.0. But if you want the square root in a program, don't raise it to the 0.5 power if a square root function is available. Bubba73 You talkin' to me? 18:24, 23 February 2012 (UTC)[reply]
fdlibm seems to simply compute exp2(y * log2(x)) in extra precision, though the details are complicated ([1]). -- BenRG (talk) 19:00, 23 February 2012 (UTC)[reply]

One obvious source of numerical inaccuracy is when the exponent is small. Remember for small x, so for example, exp(1e-100) is very close to 1+1e-100, so exp(1e-100)-1 is close to 1e-100, but in floating point, 1+1e-100 is probably the same number as 1.0. Subtracting two almost-equal numbers is a classic source of numerical instability. For this reason the x87 exponentiation instruction is F2XM1 which computes very precisely around x=0. It also has separate log instryctionns FYL2X (= log2(x)) and FYL2XP1 (= log2(x+1)). Other cpu's have similar instructions. As for actually computing transcendentals, I'm no expert but I've heard that modern processors use fairly large interpolation tables, which in the past would have been much more expensive. They also have fast parallel multipliers, so within interpolation bands they can use polynomial approximations which are faster than traditional methods that required a lot more arithmetic operations. Anyway, numerical analysis is an arcane subject a huge amount of which revolves around controlling roundoff errors, so a refdesk answer can only scratch the surface. 67.117.145.9 (talk) 04:57, 24 February 2012 (UTC)[reply]

[edit]

How do I remove the Wikipedia search? I have no idea how it got on my computer. I want to be able to use the regular search engine to search the internet, not Wikipedia — Preceding unsigned comment added by 71.213.36.247 (talk) 16:26, 23 February 2012 (UTC)[reply]

I guess you refer to a search field in your browser. If it has a little triangle then try clicking it. PrimeHunter (talk) 16:49, 23 February 2012 (UTC)[reply]
(ec) Do you mean the Wikipedia.org search addon for Internet Explorer. You probably got it from here. In Internet Explorer, go to the Tools menu and choose 'Manage Add-ons'. That pops up a window with add-on types listed on the left. Click on "Search Providers" to list the currently installed options. It should be obvious from there how to modify the default options. There are probably similar features for other browsers and OS combinations. Astronaut (talk) 16:52, 23 February 2012 (UTC)[reply]
Oh yeah... there's the little arrows that PrimeHunter mentions above (I never noticed them before). They appear in both IE and Firefox and a drop-down list appears with search engines on it. Astronaut (talk) 16:55, 23 February 2012 (UTC)[reply]

Wildcard character in Pywikipedia

[edit]

Hello, what is the wildcard character in the replace.py tool of Pywikipedia? Thanks! Leptictidium (mt) 16:51, 23 February 2012 (UTC)[reply]

Methinks You should go to the Help desk with this one. --Ouro (blah blah) 19:30, 23 February 2012 (UTC)[reply]
Pywikipedia uses regex, or regular expressions, in which the period "." is a wildcard for a single character. For multiple characters, you'd have to pair it with an asterisk, like ".*" If you are not that familiar with regex, you may want to throughly test your parameters in a sandbox before doing live editing. Avicennasis @ 06:59, 1 Adar 5772 / 06:59, 24 February 2012 (UTC)[reply]
[edit]

What's the cl equivalent to, for instance,

   gcc -LthisLibDir -lthisStaticLib example.c

? I know for includes, -I in gcc-speak is /I in cl-speak, but in the documentation for cl, I don't see library path or file stuff, other than /LD which seems to be for making a dll, which I don't want to do. 20.137.18.53 (talk) 19:39, 23 February 2012 (UTC)[reply]

Ok, as for static lib files, it appears that I can just put "thisStaticLib.lib" (without the quotes, of course) at the end after "example.c" That just leaves the question of the equivalent of -LthisLibDir 20.137.18.53 (talk) 19:43, 23 February 2012 (UTC)[reply]
You can pass /link followed by linker options to the compiler. Type link without options to get a list—one of them is /libpath. (Incidentally, the compiler and linker accept options preceded by - instead of / if you prefer that.) -- BenRG (talk) 20:28, 23 February 2012 (UTC)[reply]