Jump to content

Wikipedia:Reference desk/Archives/Computing/2007 May 31

From Wikipedia, the free encyclopedia
Computing desk
< May 30 << Apr | May | Jun >> June 1 >
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.


May 31

[edit]

Matlab: Using function as matrix

[edit]

I have a matrix A, whose elements Aij are given by a function f(i,j), where i = 1:N and j = 1:N. N is extremely large. I want to use the matrix A without having to store it in memory. However, I want to be able to use all built-in matrix operators and functions like inverse, transpose, *, etc on the matrix. Is it possible to create an object that appears to be a matrix to functions like inv, but do not store any elements? Any requested element A(i,j) could be created on the fly by evaluating the function f(i,j). For example, if N = 2, and f(i,j) is i*j, the matrix A will be [1 2; 2 4]. However, instead of storing this matrix, the object actually does i*j every time Aij is required. deeptrivia (talk) 00:19, 31 May 2007 (UTC)[reply]

I don't know Matlab, so I'm speaking theoretically here. You may be able to store a matrix defined by a function without storing all its values, but you won't be able to get away with having its inverse or it's transpose in this way. (Think about it. Matlab would have to do work on its values, and would hence store a matrix as an array of values, not by referring to a function. It's not that clever).
You would have to manually look at how you'd define the inverse/transpose/etc in terms of the function and use that.
I haven't worked with matlab in a few years, but I don't understand exatcly what you are trying to do. I don't believe the in-built functions will work on anything that isn't a matrix per se, but can't you just have a function with a return value of a matrix being i*j, and call that function when you need your data?--GTPoompt 12:19, 31 May 2007 (UTC)[reply]
I don't know Matlab either, but I'd like to point out that in general it's possible to actually perform operations in this indirect fashion, if you have some variety of function objects available. Then transpose(matrix_adapter(f,m,n)) (where matrix_adapter(f,m,n)[i,j] -> f(i,j); that is, when you attempt to index a matrix_adapter object, it calls its first argument as a function with the provided indices) would yield matrix_adapter(transpose_adapter(f),n,m) where transpose_adapter(f)(i,j) -> f(j,i). In other words, you write down a function and a size to represent a matrix, and then perform operations on that matrix by making a new "matrix" which uses a suitably-modified function.
Of course, this doesn't work for inverse, since it doesn't depend only on local values of f; there you'd have to say something like inverse_adapter(m)[i,j] -> linear_solve(m,basis(j,dim(m)))[i] where basis(i,n) yields a vector of length n with its ith element 1 and all others 0. This tactic performs the minimum amount of work needed to determine the element requested, but should be enhanced with memoization if it is expected that many requests will be made to the same inverse_adapter. This can get very complicated very quickly, but in principle allows you to solve problems with little computation actually required but a lot implied at first glance. However, it's all but useless if you're going to take the inverse of the result and store that; you'll at most save yourself a factor of 2 in memory (since inv(A) takes as much memory as A itself). --Tardis 16:17, 31 May 2007 (UTC)[reply]

Outlook support forum

[edit]

Can anyone recommend a good one? Light development/advanced end user-focused? Anchoress 00:23, 31 May 2007 (UTC)[reply]

Need help with ISO images

[edit]

Hello I recently created an ISO of my CD Diablo. I used alcohol 120 to make the ISO. Then I used Daemon tools to mount the image, but when I try to run the game it says insert CD into disc drive. I've tried registry editing, changing HKEY_CURRENT_USER\Software\Blizzard Entertainment\Archives\DiabloCD to E:\ (the virtual disk drive that the image is mounted on), but it doesn't help. Any tips anyone? Thanks.--0rrAvenger 04:49, 31 May 2007 (UTC)[reply]

Try getting a no-cd patch? I know we're not allowed to advocate software piracy but I think it's one legitimate use of sites that host hacked exe files, such as game copy world dot com, that site is useless unless you own the media anyway. I buy and play so may games that swapping CDs every time i want to play became a pain years ago. Vespine 04:54, 31 May 2007 (UTC)[reply]
That site says "No-CD & Fixed Executables/Images for this game are not available @ GameCopyWorld." But there's plenty of porn ;0.--0rrAvenger 04:59, 31 May 2007 (UTC)[reply]
There should certainly be a no-cd patch on www.megagames.com. It is perfectly OK to get a no-cd patch if you own the game. In that way you save on wear-and-tear of your original, which most companies do not replace for free if damaged. Sandman30s 07:41, 31 May 2007 (UTC)[reply]
Ok... but it won't let me download the one I need (v1.08). I can't believe I have to go through all this trouble just to play this game.. pfft.--0rrAvenger 08:51, 31 May 2007 (UTC)[reply]
Erm, sorry about that, hope yr not too offended, most sites like that you have to ignore the banners, should have warned you… Umm, the fact that it doesn't have the game might be because it's old:( Sorry, that's about all I could think of. Vespine 05:32, 31 May 2007 (UTC)[reply]

Did you install the game from the mounted ISO? If not, try that. →Ollie (talkcontribs) 09:01, 31 May 2007 (UTC)[reply]

Yes.--0rrAvenger 09:02, 31 May 2007 (UTC)[reply]
Make sure you have the latest version of Daemon Tools, unmount anything in the virtual drive, disable the virtual drive, re-enable it, turn on ll the emulation options (SecurROM especially), and then remount your .iso. If it doesn't autostart, explore the iso (using Windows Explorer), and click the .exe on the .iso. Neil () 10:34, 31 May 2007 (UTC)[reply]
It seems aparent that your Diablo CD has a software anti-piracy protection - although I didn't know they implemented such a technology around the time of Diablo - although you may have bought a re-release or something. If the virtual drive mounting doesn't work, then i'm afraid you'll have to look into a No CD Key. If you have trouble finding on the net, then try some torrent search engines like torrentspy.com Rfwoolf 12:33, 31 May 2007 (UTC)[reply]

Try mounting with alcohol 120. I've had this game working from an ISO myself, so it can be done. →Ollie (talkcontribs) 14:20, 31 May 2007 (UTC)[reply]


Update

[edit]

I downloaded another copy of Diablo, and it worked! And to be honest, I just killed Diablo 20 mins ago with a Rogue with maxed out stats... haha. Thanks for all your help everyone.--0rrAvenger 08:36, 1 June 2007 (UTC)[reply]

Unknown File Type

[edit]

How can you convert or watch an unknown file type?

203.122.76.122 06:35, 31 May 2007 (UTC)[reply]

By identifying the type of file it is? Try file (Unix), or if you don't use Unix, try it online at http://www.iconv.com/file.htmKeenan Pepper 06:59, 31 May 2007 (UTC)[reply]
If by "watch" you mean video file, Try AVIcodec (free). It can help you identify what codecs in Windows you need to play an unknown file. -wizzard2k (CTD) 07:40, 31 May 2007 (UTC)[reply]

When I tried the websites none of them worked.

203.122.76.152 07:19, 1 June 2007 (UTC)[reply]

Explain. What did you expect them to do, and what did they do instead? —Keenan Pepper 06:39, 2 June 2007 (UTC)[reply]

I expected http://www.iconv.com/file.htm to identify the unknown file and a new window was popped up and it showed that it couldn't display the webpage. http://avicodec.duby.info/ AVIcodec had corrupted files.

203.88.245.194 06:52, 3 June 2007 (UTC)[reply]

HP-UX

[edit]

please send me info on hp-ux. i want the details of operating system and its file system. it may be in any format.

Have you read HP-UX and VERITAS File System? —Keenan Pepper 06:56, 31 May 2007 (UTC)[reply]

Mac OS X Screen Scrolling

[edit]

For some reason, my iMac is acting strangely. It is as if the display area is too big for the screen. When I move the mouse to different parts of the screen, it scrolls, to show areas of the display it couldn't fit in. It's really annoying! The display size is the same, and I can't think what's changed; the entire screen is scrolling depending on the mouse location. Any help would be greatly appreciated! --Fadders 09:49, 31 May 2007 (UTC)

Doesn't matter! Worked it out! --Fadders 09:51, 31 May 2007 (UTC)
For other people with this problem, hold control and "scroll out" using the scroll weel on you mouse.

Browser Safe Colors

[edit]

Hello. Windows has 256 colours in its palette, leaving 40 of them for graphic interface elements. Macintosh has 256 colours, too. In the browser safe colour palette, there are 216 colours in common between the two operating systems. Therefore, Macintosh has 40 colours different from Windows. If that is the case, what are the 40 colours in Macintosh used for? Thanks. --Mayfare 15:35, 31 May 2007 (UTC)[reply]

There are various explanations for the missing colors, however the one I believe is most accurate is here. It states that when designing Netscape, Windows 3.x claimed the first and last 10 of the 256, Netscape took 13 for its logo, leaving 223 undithered colors available. 216 Is the nearest perfect cube (see the color cube on that page) below 223. In summary, 216 was chosen as "safest" not necessarily because all the other colors were in use. -wizzard2k (CTD) 16:53, 31 May 2007 (UTC)[reply]
See Web-safe_colors#Web-safe_colors. --antilivedT | C | G 05:14, 1 June 2007 (UTC)[reply]

LG shine predictive text problem

[edit]

I have recently purchased an LG shine and when sending a text message i use the predictive text function. Today I added the word "yot" to my dictionary and now whenever i try to type "you" it automatically comes up as "yot" which has become an annoyance!! I tried adding "you" but as it was there and "yot" wasnt when i added it, "yot" still comes up first! Christopher

Showing Someone Their IP Address Inside A Webpage

[edit]

I once saw someone go to a page in Wikipedia, and it brought up their IP address along with a message that told them not to consider vandalism (they may have attempted to edit a page that had been previously vandalised). Can someone tell me please what the lines of code and the language are to be able to bring up an IP address like this on a page?

Thanks very much, Chris.

82.3.145.0 17:38, 31 May 2007 (UTC)[reply]

Usually that's done by a simple CGI script. The web server receives that information from the receiving host in the HTTP request. The server then stores that in one of the environment variables, REMOTE_ADDR. You can access this variable with any webpage scripting language (Perl is a common one for CGI, PHP has methods to access it as well, which is what Wikipedia uses). If the webserver supports Server Side Includes, you can simply encode it right into the webpage with some code like this: <!--#echo var="REMOTE_ADDR" -->. You can see more variables here. -wizzard2k (CTD) 18:01, 31 May 2007 (UTC)[reply]
In PHP, it'd be <?PHP echo $_SERVER['REMOTE_ADDR']; ?>. JoshHolloway 18:33, 31 May 2007 (UTC)[reply]
It seems like what the anon is asking about is this page: MediaWiki:Anoneditwarning and this special page: Special:Mytalk--VectorPotentialTalk 18:33, 31 May 2007 (UTC)[reply]
Or not--VectorPotentialTalk 18:44, 31 May 2007 (UTC)[reply]

That is genius! I just pasted <!--#echo var="REMOTE_ADDR" --> in and saved my page as shtml and it worked. Thanks very much Wizard person.

Outsourcing

[edit]

Almost all of us are against Outsourcing. So why can't that outsourcing be completely banned?

I wouldn't say almost all of us, there's a fair amount of people that support outsourcing. It's beneficial to companies and thus the government, and it would be hard to control. To a point, it would make international companies almost impossible. -- Phoeba WrightOBJECTION! 19:22, 31 May 2007 (UTC)[reply]
Why be against it? I like buying low-cost products & services. So if a company wants to get their stuff done some place where it is cheaper, I say more power to them. --Tugbug 20:28, 31 May 2007 (UTC)[reply]
Banning outsourcing makes no more sense than banning imports. Was the computer you used to type this question made in the country you're living in, or did you buy it from a company that outsourced its construction? --TotoBaggins 21:22, 31 May 2007 (UTC)[reply]
Not to mention the components themselves. ASUS is from Taiwan, last I checked, and they're widely considered one of the best companies for computer parts. I'd be surprised if you could find a computer without any parts manufactured in southeast asia -- Phoeba WrightOBJECTION! 22:38, 31 May 2007 (UTC)[reply]
To ban outsourcing would require a ban on movement of jobs from one nation to another, any nation that did this would soon notice that international firms will stop setting up jobs in that country as they won't be able to move work/remove roles as freely as they can in other countries. Additionally the movement of labour to that which is 'best value' (i.e. lowest cost without a significant reduction in quality) will always occur, and whilst laws trying to prevent this may happen the key is really in consumer choice. If enough consumers do not like this policy of moving labour to other nations (which is usually in order to remain competive/maintain profits and keep the business profitable) then firms will exist that do not do this and make it publically known. In the uk a firm called Nationwide have all Uk call-centres and etc. etc. and it features prominently in their advertising. Whether or not it leads to an increase in custom i'm not sure, but as a 'consumer choice' it means people banking in the Uk can take that option into consideration. Outsourcing is a perfectly sensible thing in many areas, it helps reduce costs while keeping service, it helps free resource of staff to continue in more complex processes that cannot be offshored, it allows the place with low staff retention to move to areas where staff are more likely to remain in the firm. It can be very valuable for business. Unfortunately the general employed public has not fully got used to the flexible marketplace when it comes to employment. ny156uk 23:06, 31 May 2007 (UTC)[reply]

Multiple gateways on a network

[edit]

I've tried to find this out for the last several hours, and I can't figure it out at all. Here's the problem:

I have two gateways (both Cisco 2801), one is a T1 point to point with another network, it's all setup, works fine. The other is a gateway to the internet, regular internet T1. The problem is I can only route packets for each foreign network if my gateway is set to each router. I can only ping the opposite router from my gateway, but nothing past it.

How can I fix this problem? What are my options, especially the least expensive one.

Also, the computers cannot have more than one gateway or any crazy router settings, only the basic settings that most computers support.

Thank you! -Anthonysenn 19:01, 31 May 2007 (UTC)[reply]

Each machine should have a default route to the the internet T1, and an explicit route to the network on the other link. On unix-like systems you would do something like route add default gw "ip of gateway" for the default route and route add -net "network definition" gw "ip of ptp gateway" Edit: you could also give one of the gateways a route to to the other one. FOr instance add the route to the other network to the internet gateway(or vice versa). Then you wouldn't need the explicit network route on each host. --Diletante 19:10, 31 May 2007 (UTC)[reply]
Uh, no, I'm pretty sure the route in Linux and Linux alone uses that syntax.
One option is to add the redistribute connected line in the config on your point to point routers. Basically, each router needs to know what network is connected directly to it for the routing protocol to function properly. The Internet gateway needs to know that 0.0.0.0 is connected to it, but it should have a higher metric value than the one you're using on your point to point network. Without seeing the configs I'd have a hard time troubleshooting it, but here's an example of some cisco config lines for a 3 router setup with one internet connection. (changethe 0.0.0.0 route on the first router to 172.16.17.0 255.255.255.0 if that network has its own internet, or doesn't want internet):

p2prouter1 (no local internet connection):
interface Serial0/0
ip address 172.16.16.5 255.255.255.252

interface FastEthernet0/0
ip address 172.16.15.254 255.255.255.0

ip default-gateway 172.16.16.6

ip route 0.0.0.0 0.0.0.0 Serial0/0 10
ip route 172.16.15.0 255.255.255.0 FastEthernet0/0 5
p2prouter2 (has local internet connection on other router):
interface Serial0/0
ip address 172.16.16.6 255.255.255.252

interface FastEthernet0/0
ip address 172.16.17.253 255.255.255.0

ip default-gateway 172.16.17.254

ip route 172.16.15.0 255.255.255.0 Serial0/0 10
ip route 0.0.0.0 0.0.0.0 FastEthernet0/0 15
ip route 172.16.17.0 255.255.255.0 FastEthernet0/0 5
gateway router:
interface Serial0/0:
ip address AAA.BBB.CCC.DDD FFF.FFF.FFF.GGG
ip nat outside

interface FastEthernet0/0:
ip address 172.16.17.254 255.255.255.0
ip nat inside

ip route 0.0.0.0 0.0.0.0 Serial0/0 20
ip route 172.16.17.0 255.255.255.0 FastEthernet0/0 5

ip nat inside source list 1 interface Serial0/0 overload
access-list 1 permit 172.16.0.0 0.0.255.255
-wizzard2k (CTD) 20:34, 31 May 2007 (UTC)[reply]

My point in the above example was that if the routers know what's going on, the computer's don't have to. Obviously you'd probably need to adjust the ip addresses to fit, and you probably do not need to change the far side p2p router, it was just shown for completeness. -wizzard2k (CTD) 20:39, 31 May 2007 (UTC)[reply]

I figured out a solution; temporarily i set it up to re-route everything that needs to go to the Point-to-Point gateway from my internet gateway back to the other gateway. I'm going to settle with a Cisco 1811 to have my local network route between the two others, it's the cheapest one i could find with two wan ports. Thanks for the help you guys -Anthonysenn

Press a key vs. press any key

[edit]

Why couldn't the confusion intermittently caused by keyboards' lack of an "any key" be solved by changing the prompt to "Press a key to continue," given that a keyboard does have an A key? NeonMerlin 23:04, 31 May 2007 (UTC)[reply]

Because it could be seen to imply that there was a particular (unspecified) key that should be pressed, or that different keys would have different effects? Just a guess. --Tardis 23:31, 31 May 2007 (UTC)[reply]
Well they did change it to a specific key - "Press the enter key to continue". And the enter/return key is much bigger than the "a" key, even on the old computers. JoshHolloway 00:04, 1 June 2007 (UTC)[reply]
Also, there is no documentation that I've ever seen of anyone actually hunting for an "any key" on the keyboard. Sure, Homer Simpson had trouble. Other comic strip characters have had trouble. A few idiots in movies. But, what about a real computer user? All we have is an urban legend that it may have happened at some point. It is more likely that a couple geeks looked at the prompt and said it would be funny if some dumb person couldn't find the any key. Then, the joke grew into one of those "I know a guy he knew a guy who knew someone who couldn't find the any key." --Kainaw (talk) 00:12, 1 June 2007 (UTC)[reply]
Alternatively we could just add an "any" key. --24.147.86.187 00:15, 1 June 2007 (UTC)[reply]