Jump to content

Wikipedia:Reference desk/Archives/Computing/2009 November 8

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Scsbot (talk | contribs) at 01:54, 12 November 2009 (edited by robot: archiving November 8). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Computing desk
< November 7 << Oct | November | Dec >> November 9 >
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.


November 8

Show Desktop

On my sister's PC (running Win XP) the "Show Desktop" icon got dragged off the quick start toolbar and onto the desktop. If I try to drag it back onto the quick start menu, I just get a shortcut to something that doesn't work. Is there an easy way to get that icon back on the toolbar so it works as it did at installation? Astronaut (talk) 00:40, 8 November 2009 (UTC)[reply]

If you want a quick alternative, pressing Windows+D shows the desktop. If you can open the quick start folder (possibly there's on option if you right-click on quick start menu?) then you should be able to copy-and-paste the actual shown desktop icon back into the folder. Dragging the icon to the quick start menu while holding one of the modifier keys (Shift? Ctrl?) might also copy the actual icon rather than a link. --h2g2bob (talk) 01:50, 8 November 2009 (UTC)[reply]
The quick start folder is normally (replace my user name with tour own)
C:\Users\Andreas Rejbrand\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch
--Andreas Rejbrand (talk) 02:01, 8 November 2009 (UTC)[reply]

About Group Policy Client service...

I can't log on because of an error, and it shows a message: "Group policy client service failed the logon. Access is denied." I'm using Windows Vista. What should I do ??? Thanks for all of your help. 117.4.141.61 (talk) 01:20, 8 November 2009 (UTC)[reply]

Are you at home or at office?F (talk) 07:30, 8 November 2009 (UTC)[reply]

I'm using Windows Vista Ultimate at home.

Algorithm request

Levenshtein distance gives the distance between two strings. Assume you have one string that is a few thousand characters long. Another string is, say, 10 characters long. The Levenshtein distance you calculate between the two strings is rather high, indicating that the short string is, for the most part, contained somewhere in the long string - but not letter-for-letter. What algorithm is the most efficient for getting the smallest substring from the long string with the minimum Levenshtein distance to the short string? Further example: Imagine that this question, up to this point HERE is the long string. Your short string is "maintainer". You, obviously, want to locate "contained" or maybe just "ntaine" or something around that point in the long string that matches up with the short string. -- kainaw 02:48, 8 November 2009 (UTC)[reply]

I would think that you must iterate the Levenshtein algorithm over the original short-string, and then all successive short-er strings. Note that there is a tradeoff between minimum-distance and largest-possible-short-string. So, you must include some kind of weighting in your objective to account for this. Iterating the distance-search would seem to involve a lot of redundand calculation - you're iterating a sequence of nearly-identical Levenshtein applications with "similar" short-strings. (I'm guessing this redundancy exists based on intuitive reasoning - but I'm not any good at proving it). I would focus my literature search on "iterated Levenshtein" or something along that line of thought. Nimur (talk) 04:13, 8 November 2009 (UTC)[reply]
No need to check the literature! If we roll up our sleeves and dig in, we can probably find a solution ourselves! There's two approaches that come to my mind instantly: first of all, you can brute force that son-of-a-bitch: test the Levenshtein distance for each 10 character substring in the longer string. If the short string is a characters, the long string is b characters, that would be O(a^2) for each edit distance test, which you perform O(b) times, for a computational complexity of O(a^2*b) (assuming b is quite a bit larger than a). I assume you already thought of this plan and dismissed it, as it is quite obvious. Though, lets face it, modern computers are quite fast, your strings are quite short (1000 characters ain't a whole lot) and it's easy to program, so you might just want to go with it.
The second idea is to do a sort-of binary search divide-and-conquer thing: divide the longer string into two strings 500 characters long and find the Levenshtein distance on each half. By comparing the results, you can now make an educated guess in which half the string is. Now you recurse. Take the correct half of the string, divide it into two 250 character pieces and check those two, and so on. When the string is sufficiently small (<30 or so), brute-force to find the right solution.
This is a tricky algorithm to implement: your code needs to be able to interpret the Levenshtein distance by itself, always picking the right half. It also needs to be able to handle if the string "crosses the gap" between the two halves, i.e. it's located at positions 495-505. This can be solved by cleverly dividing the longer strings up (instead of the first half being characters 0-500 and the second 500-1000, it can be 0-510 and 490-100). But if you use this technique and the string does in fact cross the gap, the string will appear in BOTH substrings, so tailor your algorithm to recognize when this happens.
As I said, this is tricky to implement, but it is very fast. Lets make a quick back-of-the-envelope complexity calculation. First, it makes two O(ab/2) (a is the length of the shorter string, b is the length of the longer string) calculations of the Levenshtein distance of the first two halves. Then it recurses, and makes two O(ab/4) tests, then two O(ab/8) tests, and so on and so forth. That is, it's complexity is:
which is equal to
(the sum there converges trivially to 1, obviously). So there you go, the same computational complexity as just making a standard Levenshtein distance search! Ain't divide-and-conquer grand :)
(I should say that this was incredibly back of the envelope, it's entirely possible I made some elemental error in underestimating the complexity. Please forgive me if that is the case) Belisarius (talk) 13:13, 8 November 2009 (UTC)[reply]
Yes - your error is if the maximal match (minimum distance) occurs in a string which overlaps the subdivision boundaries. The method you described does not appear to handle the case that you split across the best-fit substring - in which case, neither half-string will match very well. I am pretty sure this will trip up your method... I'm no expert though. I'm not certain your redundant-inclusion of the boundary conditions is totally effective. Nimur (talk) 23:37, 9 November 2009 (UTC)[reply]

Windows 7 standby mode

Resolved

last night something terrible happened, I went to bed and when I came back to my Windows 7 computer it was in some sort of standby mode. It only took a move of the mouse to bring it back, but this MUST NOT happen again. I've looked for the settings but I can't find them. How do I stop it from going into stand by again? —Preceding unsigned comment added by 82.43.89.85 (talk) 05:32, 8 November 2009 (UTC)[reply]

Is there a reason that Standby mode devastated you so? Go to the Power Options control panel, where you can customize how much time elapses before the computer enters Standby mode or Hibernate mode. You can also turn this feature off. By the way, it's also possible that the computer simply turned the monitor off and was still running at full speed; this, too, is configurable from Power Options. Tempshill (talk) 06:56, 8 November 2009 (UTC)[reply]
It was supposed to be downloading from web and I lost 10 hours of data which I can never get back, and it was completely off not even a buzzing sound just dead until I moved the mouse and this MUST NOT happen again. Thank you for the advice, I will try it but I am concerned that the computer will still enter some sort of low power mode if left without user input for a long time. —Preceding unsigned comment added by 82.43.89.85 (talk) 08:47, 8 November 2009 (UTC)[reply]
If you set it to never go to sleep or hibernate in the power management options, it never will. Don't worry, it works fine. See here for guide. Belisarius (talk) 13:50, 8 November 2009 (UTC)[reply]
I must admit I'm surprised, I'd have though a download program would have kept windows alive. It isn't the sort of thing I do but it sounds like this sort of thing would be a fairly common requirement. Disabling standby is the appropriate approach if one is really desperate but I wouldn't want to have a million people all using up a power station unnecessarily doing it. Dmcq (talk) 14:23, 8 November 2009 (UTC)[reply]
I agree. May I enquire as to what web browser (or download manager) you use? --Andreas Rejbrand (talk) 23:13, 8 November 2009 (UTC)[reply]

Thanks everyone, I did the suggestions and it worked

Booting Linux ISO Inside Virtual Box On Ubuntu

Is it possible to get VirtualBox to boot another OS from USB? The only options I can find are 'Boot from CD/DVD' and 'Floppy', but I have a USB-bootable distro of Slax that I wanted to try out without switching the machine off. --KageTora - SPQW - (影虎) (talk) 09:22, 8 November 2009 (UTC)[reply]

Virtualbox does not support booting from usb. There are several workarounds you could try though, for example creating a .vdh image from your usb drive using WinImage and attaching it to virtualbox as a hard drive. Or you could try attaching the usb drive as a physical disk, see here for how. —Preceding unsigned comment added by .isika (talkcontribs) 12:29, 9 November 2009 (UTC)[reply]

Portable Apps & USB lifespan...

I know that USB flash memory has a limited lifespan based on the number of writes to the hardware. I also know that I have recently completely fallen in love with portable apps. Compared to my previous usage patterns, running XAMPP & Firefox (among other things) off a 4G USB stick is resulting in several orders of magnitude more read/writes per hour. What kind of impact can I reasonably expect this to have on the lifetime of my device? Are there any hard numbers out there? I backup the entire stick daily, so a hardware failure would cost me some cash but no productivity. Just curious about the impacts of such aggressive usage of flash memory on hardware service life... Thanks! 61.189.63.142 (talk) 09:33, 8 November 2009 (UTC)[reply]

I've had several flash drives fail on me. I use them to move video from one computer to another. The main problem seems to be that there's an "index area" which is written to every time any write is made anywhere on the USB drive. Therefore, this index area fails first and then the drive is hosed. I hope they find a way to fix this poor architecture to make them last longer. Perhaps they could use some other type of memory for this index area, which won't fail so quickly. Another option might be to have a movable index area so that this wear occurs move evenly.
One hint, buy the smallest size that will work for your case, even if you need multiple USB drives. A single 64 Gb Flash drive won't last as long as eight 8 Gb flash drives will. StuRat (talk) 14:02, 8 November 2009 (UTC)[reply]
I'm actually a bit surprised there because I was under the understanding that USB flash drives contained Wear levelling hardware to make sure that even if you write to the same "physical" point on the disk (if it was magnetic media) it would be actually be distributed across the entire flash memory. ZX81 talk 16:05, 9 November 2009 (UTC)[reply]
Perhaps they do for the data area. In my experience it always seems to be the boot sector that fails, though. StuRat (talk) 00:16, 10 November 2009 (UTC)[reply]
Wear leveling applies to all sectors equally. (It wouldn't be very useful if it didn't apply to the frequently overwritten metadata sectors.) USB flash drives present a hard-drive-like interface to the computer they're plugged in to, which means it's up to the USB drive to do wear leveling. I don't know what fraction of USB drives actually do it. It's annoyingly hard to find information on this subject. However I think that most/all of them do. When you say the boot sector fails, what do you mean by that? What's the actual failure you're observing? -- BenRG (talk) 02:07, 10 November 2009 (UTC)[reply]
The data contained in the boot sector randomly changes. That is, we look at it once, then look at it again, and it's now different. I've also had them just give a read error. StuRat (talk) 13:29, 10 November 2009 (UTC)[reply]

Buy a pocket external usb hard drive —Preceding unsigned comment added by 82.43.89.85 (talk) 11:10, 9 November 2009 (UTC)[reply]

Is there really a portable USB hard disk drive that can fit in a pocket ? StuRat (talk) 15:37, 9 November 2009 (UTC)[reply]
Yes, loads of them. Here's one
Ultimately I guess that depends how big your pockets are, but I can personally easily fit a 2.5" USB disk in my pockets and I've just tried a 3.5" disk and that fits as well (although it's not exactly comfortable and 3.5" disk would need a power supply as well). ZX81 talk 16:05, 9 November 2009 (UTC)[reply]
"Is that a hard drive in your pocket or..." :-) StuRat (talk) 00:14, 10 November 2009 (UTC)[reply]

How Linux could win in desktop OS war ?

We have to accept that Windows / OSX has very good UI, and more than 90% of people are used to this. Gnome and KDE really sucks when compared to this. So, it is just kernel needs some fix. This fix could be Linux kernel. I have read that windows kernel is closely coupled with it's UI. Still, how difficult it is to replace only windows kernel with linux kernel, or with other kernels like opensolaris, plan9, etc. ? Would this heart / brain transplant operation be worth doing ? Is it legal ? --V4vijayakumar (talk) 12:40, 8 November 2009 (UTC)[reply]

Well, for one the Ubuntu Gnome and KDE Desktops, e.g., are certainly good enough - they don't "really suck". They are different from Windows, but most intermediate and inexperienced users have no trouble adapting. Mac OS X already is a slick GUI on top of a UNIX Kernel (well, actually, a FreeBSD personality running on top of a Mach microkernel). It would probably be possible to retrofit Linux, but it also would be somewhat pointless. --Stephan Schulz (talk) 13:02, 8 November 2009 (UTC)[reply]
I could well envision that there are people for whom "different from Windows" means "really sucks". JIP | Talk 16:07, 8 November 2009 (UTC)[reply]
The reason for Microsoft's dominance is not strictly technical. There is a lot more that goes into why people use Windows and not, say, Linux, than the kernel. --Mr.98 (talk) 13:34, 8 November 2009 (UTC)[reply]
The problem I have with Linux has to do with drivers. Windows pretty much automatically works with most printers, speakers, etc., while Linux does not, making me have to search for and install a driver to run those items. StuRat (talk) 13:58, 8 November 2009 (UTC)[reply]
Have you tried a recent version? Support for older stuff often is better than with Windows. Support for very new hardware may or may not be there, but it is a lot better now than it was a few years ago. Printers, drives, network and WiFi usually work straight out of the box - in fact, most things with published specifications work well. --Stephan Schulz (talk) 14:12, 8 November 2009 (UTC)[reply]
No, I use Skinny Puppy 4.00, and don't want to change to a newer Linux, as it now has all the apps I want on it and I don't want to start over from scratch. StuRat (talk) 14:21, 8 November 2009 (UTC)[reply]
Dare I suggest, StuRat, that if you never update your OS (cough cough Windows 98), you sort of lose the right to complain about whether it has updated features! --Mr.98 (talk) 14:46, 8 November 2009 (UTC)[reply]
I don't consider being able to plug in a new pair of speakers and have them work to be an "upgraded feature". I see no good reason why the interface to speakers needs to change such that old computers can no longer use new speakers. The same is true of printers (although there I could understand that very old computers that were only capable of sending ASCII text to a printer wouldn't be able to send fancy graphics to a new printer, but they should still be able to send text to a new printer). I'm of the opinion that the reason new hardware doesn't work with old versions of Windows isn't because it's technically difficult to do, but because of Microsoft using a strategy of planned obsolescence. So, why do we accept this with computers ? Would you buy a TV that was designed to stop working after a few years ? Of course not (analog TVs can still be used with digital signals via a converter box, like the one I'm watching now). So then, why is it acceptable to do so with computers ? I say that it's not, being bad for the environment to consider computers to be disposable. StuRat (talk) 15:39, 8 November 2009 (UTC)[reply]
Hardware changes, and expecting all manufacturers to be infinitely compatible with decade-old operating systems is kind of silly. Where does it stop? Should they make everything Windows 3.1 compatible? DOS too? How about making sure things are compatible for C64 users? Obviously there is going to be a tradeoff between what is worth time to upgrade and what isn't. You can take your stance, but really, if you don't upgrade periodically, don't be surprised that things stop working, or that manufacturers don't cater to you. Spending time to make things backwards compatible costs money and time—money and time that is either taken away from improvements, or increases the cost to the consumer. Personally, I'm fine with upgrading every couple of years—I usually get more for my dollar each time. Should your preference for slow and out of date things increase my future costs or impact my desire for improved goods over time? --Mr.98 (talk) 16:09, 8 November 2009 (UTC)[reply]
Perhaps they could sell "disposable" computers that are designed to stop working after a stated period of time, and also sell "non-disposable" computers for people like me. I would expect the disposables to each cost less, but for the total price to be higher using disposables in the long run. My problem with the current practice is that they never state that the computers are designed to only work for a few years and then die, even though they are designed to do just that (and/or the operating system on them is). That's false advertising. For the disposables, they could even lease them, and hopefully pass them on to the poor or third world nations when they are returned at the end of the lease period, where they could still be used for many years with old software and hardware, just not for the latest games. StuRat (talk) 16:44, 8 November 2009 (UTC)[reply]
(ec) If you can invent a fan-motor with a MTBF of thirty years; or a hard-disk drive with a statistically insignificant failure-rate; or a thermal-failure-proof CPU, motherboard, and chipset, you can build a computer that lasts forever. Your claim that planned obsolence is a conspiracy to make you buy more things is a bit of a slant - a better way to phrase it is that planned obsolence is the best effort engineering control over the inherent mechanical failures that are known to occur. While it is true that some companies use planned obsolence as a business strategy, it is really making the best of a bad situation (that physical hardware does actually wear out). Nimur (talk) 16:50, 8 November 2009 (UTC)[reply]
Just because the components of a system are disposable doesn't mean the entire system must be. By use of redundancy and easy to replace parts, the system can continue to be usable even after many of the parts have failed. In the case of a computer, every component can be made to be replaceable except the hard drive, since that contains valuable data. For the hard drive, some redundancy is in order, like a 2nd hard drive with a backup of all your data. StuRat (talk) 17:02, 8 November 2009 (UTC)[reply]
As for the discussion of planned obsolescence in general, there are some companies that are quite blatant about it. The worst one I've seen is a toothbrush with bristles designed to slowly dissolve. They claim that this is "to remind you when it's time to toss out that old germy toothbrush", but obviously a toothbrush could be sterilized by boiling or dipping in bleach, so it's quite apparent they just want to force you to buy a new one every few weeks to increase their profits. I'd also be concerned about the effect of ingesting all those dissolved bristles. StuRat (talk) 17:09, 8 November 2009 (UTC)[reply]
Well, per usual, your analysis of things is formed by a few incorrectly understood facts and a lot of supposition. Where are these "dissolving toothbrushes" you speak of? Can you find a link to any of them? Even the ones that do have indicators as to wear (which dentists support, not so much because they are "germy", but because the bristles become frayed and ineffective) do not require you replace them "every few weeks", but rather every three-to-four months. The ADA supports this; there are apparently even scientific studies on this front. Anyway, I find it odd that you're find with replacing fans, RAM, hard drives, and all of the other things that can go wrong with a computer, but not the operating system, that thing that actually makes all of the other things work correctly, that thing whose security problems mean a compromised system, that thing which, especially in older versions (cough cough, Windows 98) are known to have major, significant flaws in even their basic operations. Hey, it's your computer—I really don't care if you don't replace it. But don't be surprised when things aren't up-to-date when you don't update them. As for your earlier question about the television—yes, in fact, my old TV did die after about 7 years. I thought that was a pretty good run for it, to be specific, and for even less money that I had spent before, I got a new, much improved television (wide screen, flat screen, etc.). Planned obsolescence, or just about what a complicated device of tubes and heat ends up with after half a dozen years? No clue, but frankly, I'm glad that they work on making new ones better and cheaper, because in the long term, I have a better TV for it. Maybe you've saved a bit more money, but you've still got the old clunker television, too. --Mr.98 (talk) 18:41, 8 November 2009 (UTC)[reply]
Now find me an environmental group that supports disposable toothbrushes, computers, etc. A disposable society is ultimately unsustainable, and we are starting to see some of the results from that, due to global warming from manufacturing all the unnecessary items, to pollution from both their production and disposal, to higher prices for petroleum and raw materials as the readily accessible raw materials begin to be used up (actually ending up in landfills in forms that aren't easy to reclaim).
As for upgrading the O/S, you seem to have bought the MS line that every O/S is somehow an improvement over the last. They are not. There is often very little new functionality, but quite a bit that is just different for no apparent reason. For example, at one point they renamed the File Manager to Windows Explorer. What new functionality did this rename provide ? It just caused confusion for those familiar with the old name. And when they do provide new functionality, it's frequently unnecessary. For example, older versions of Word required that you press a button to do a spell-check, while newer versions will spell-check and even try to correct errors automatically. Unfortunately, the corrections are frequently wrong, so this isn't really an advantage, is it ? There are also large quantities of functionality that are lost with each new version, but you never see that advertised, do you ?
To look at hardware for a moment; a floppy disk could be inserted, read, written to, write-protected, or removed whenever the user wanted, in any floppy drive, while a CD or DVD requires extra software to get it to behave properly, needs to be compatible with the type of drive, and you still often get a "Can't eject, disk is in use" error, even when it's not in use. Now certainly CDs and DVDs have far more capacity than floppy disks, but that doesn't mean I gladly accept all the limitations the "new technology" imposes. USB flash drives restore some of the lost functionality, but not all. The "write-protect switch", for example, is hard to find on USB flash drives. If I were to upgrade my computer's O/S (which would also mean replacing the computer), I know that half of my stuff would no longer work. Therefore I want to only upgrade when the benefits outweigh the costs, which is rare, IMHO. StuRat (talk) 20:36, 8 November 2009 (UTC)[reply]
Yep agree with those above. The user interface is not the problem as far as I'm concerned, in fact I prefer some linux interfaces. The problem is that there's some programs I want to run for which there are only windows versions whereas windows versions of the ones on Linux are fairly easy to get. I find development much easier on linux for instance. The problem is reducing now so I may switch to using linux as my main platform soon. Dmcq (talk) 14:14, 8 November 2009 (UTC)[reply]
In the meantime, I suggest a dual boot system, which is what I use. StuRat (talk) 16:57, 8 November 2009 (UTC)[reply]
It could be that linux/gnome replaces symbian. --194.197.235.240 (talk) 21:44, 8 November 2009 (UTC)[reply]
Google Chrome OS could be the thing the popularises the Linux desktop, with a large company behind it.F (talk) 01:01, 10 November 2009 (UTC)[reply]

How to get a free webpage?

I would like to put some information on a webpage. I do not want to pay for it or have to bother with it. I imagine it would get a fair number of people looking at it, although it could just stay undiscovered for a long time. How can I best get a free webpage that I can put information on, update at intervals of weeks or months, and that otherwise does not require any time from me? 78.147.8.170 (talk) 13:41, 8 November 2009 (UTC)[reply]

Depending on what you want to use it for, you can possibly just register here and use your free home page for that. Of course, this is not a good idea if you have a huge amount of data or want to use it in ways that are incompatible with Wikipedia. However, if you just want to list your background and maybe a pic of yourself, Wikipedia would be just fine with that. StuRat (talk) 13:54, 8 November 2009 (UTC)[reply]

That would be inappropriate as the information would have nothing to do with Wikipedia. I thought there used to be lots of free websites available, but I have an impression that those kinds of websites have been closing down. Unfortunately I cannot remember what any of them were called. Geosomething masy have been one of them. 78.147.8.170 (talk) 14:11, 8 November 2009 (UTC)[reply]

Geocities, which is now gone. I recommend starting up a free account at Wordpress.com, posting your info there. They host blogs but there's no reason you couldn't just put your data there and leave it there. --Mr.98 (talk) 14:45, 8 November 2009 (UTC)[reply]

An internal Wikipedia link at the base of the Geocities article links to some more free websites, which still seem to be going. 89.243.191.11 (talk) 20:08, 10 November 2009 (UTC)[reply]

This might be of interest. --Rixxin (talk) 14:03, 11 November 2009 (UTC)[reply]

"Mouse wiggler"

I have a problem with Flash animations on Firefox, that they sometimes get into a state where they won't update the screen unless I move the mouse. Is there some software that could virtually wiggle the mouse, say by moving it 5 pixels to the right, then 5 pixels back to the left, repeatedly ? StuRat (talk) 14:13, 8 November 2009 (UTC)[reply]

Such a software would be very easy to write. If you want, I can make one for you. --Andreas Rejbrand (talk) 14:15, 8 November 2009 (UTC)[reply]
Yes, that would be great. I'm on Windows 98, so I hope that's not an issue. Also, I do still want to be able to use the mouse normally. Perhaps it could start to wiggle if I leave it still for 10 seconds and stop when I move it myself. StuRat (talk) 14:27, 8 November 2009 (UTC)[reply]
Sounds like some old Heath Robinson test hardware which just had a photosensor and a magnet pulling down a prodder, and actually used a complete microcomputer to link the two so whenever the output said 'next page' it thumped the send button. You too could make some hardware to wiggle your mouse around. No input or microcomputer necessary. Dmcq (talk) 14:35, 8 November 2009 (UTC)[reply]
I had considered that. With a ball mouse that would put extra wear and tear on it, but I have a laser mouse, so it might be OK. Still, software seems like the more elegant solution. StuRat (talk) 15:22, 8 November 2009 (UTC)[reply]
Back around 2000-2002 or so, there used to be sites out there that would pay you to browse (with their ads). The way they would tell if you were really "browsing" (and not just opening their browser and walking away for a few hours) was to detect mouse movement. I recall there being programs that would simulate mouse movement as a way of scamming these sites. I can't remember the names of the sites, or the programs, but they are out there, somewhere, probably. --Mr.98 (talk) 16:04, 8 November 2009 (UTC)[reply]
As always, there is an xkcd cartoon for (almost) this situation. Jørgen (talk) 18:18, 8 November 2009 (UTC)[reply]
The comic alt-text is spot-on; we have all been there; and some of us have the sourcecode to prove it... the OP may find these codes helpful for UI scripting if they are using Winamp 2.x or 5.x as their flash video player/plugin (I have found the Adobe version to be the single most buggy software component of any of my computers on any the of various operating systems I use, and so I have replaced it as much as possible with alternatives). Nimur (talk) 20:43, 8 November 2009 (UTC) [reply]


I have now created an extremely light-weight Windows utility that does this. Please see CursorMotion.exe @ privat.rejbrand.se if you trust me. When you start this application, it checks if Scroll Lock is on 10 times per second. If Scroll Lock is on, the cursor moves ±2 pixels up and to the left 10 times per second. To exit the application, use the Windows Task Manager. --Andreas Rejbrand (talk) 20:57, 8 November 2009 (UTC)[reply]
However, I have to admit that I do not know if it will run on Win 9x... I have not used this platform for many, many years... --Andreas Rejbrand (talk) 20:59, 8 November 2009 (UTC)[reply]
Windows 9x is a rather instable platform, so you try the app at you own risk! --Andreas Rejbrand (talk) 21:01, 8 November 2009 (UTC)[reply]
No, it says "... expects a newer version of Windows. Upgrade your Windows version." Thanks for trying. Any other ideas ? (Your idea to use the otherwise useless scroll lock key was truly inspired.)StuRat (talk) 21:05, 8 November 2009 (UTC)[reply]
OK, that was no major surprise. I just recompiled it with the old Borland Delphi 7 I found that I still had installed. It might work now. --Andreas Rejbrand (talk) 21:15, 8 November 2009 (UTC)[reply]
OK, I downloaded it on my XP computer, where it works well. I also downloaded it on my 98 machine, where I actually need it. It no longer gives that error, but doesn't appear to move the mouse, either. If you can add some debug prints to it, I could tell you what it says. StuRat (talk) 21:45, 8 November 2009 (UTC)[reply]
You might be interested in the AWT robot - a Java tool that will work with your native platform's mouse interface. Nimur (talk) 21:59, 8 November 2009 (UTC)[reply]
Wiggler.java - example source code
import java.awt.Robot;
public class Wiggler {
public static void main(String[] args) throws Exception {
 Robot r = new java.awt.Robot(); 
 while(true) {
  r.mouseMove(10,10) ;  
  r.delay(100);  
  r.mouseMove(12,12);
  r.delay(100);	
  }
}}
You can add other features, like only enabled when "scroll-lock" is on; or relative mouse-motion; as you need. Nimur (talk) 22:06, 8 November 2009 (UTC)[reply]

Because I was unable to make my app work on the old Win 9x platform, I post the source code here, so that someone more used to this older platform can try to make a working executable. The code is in the Delphi language, but relies entirely on the Win32 API in all essential parts.

program CursorMotion;

uses
  SysUtils,
  Windows;

var
  pnt: TPoint;
  disp: integer;

{$R *.res}

begin
  disp := 2;
  repeat
    if GetKeyState(VK_SCROLL) and 1 = 1 then
    begin
      if GetCursorPos(pnt) then
      begin
        SetCursorPos(pnt.X + disp, pnt.Y + disp);
        disp := -disp;
      end;
    end;
    sleep(100);
  until 1+1=3;
end.

--Andreas Rejbrand (talk) 22:57, 8 November 2009 (UTC)[reply]

Now I also tried a minor modification to the code. It might work now (it is really too bad that I do not have a running Win 9x computer at home right now...). If it does not work, we have to hope that some other developer will make a try on this problem. Sorry for my inability! I feel that I really should know what the problem is... --Andreas Rejbrand (talk) 23:05, 8 November 2009 (UTC)[reply]
Much better ! Only one small bug: It checks the scroll lock key status when it starts, but never again. Looking at your code, I can't see any obvious reason why. Does the VK_SCROLL variable need to be reinitialized before each call to GetKeyState ? Also, why does it need that "and 1=1" part ? Maybe this line:
       if GetKeyState(VK_SCROLL) and 1 = 1 then
Should be split into two lines:
       GetKeyState(VK_SCROLL)
       if VK_SCROLL and 1=1 then
I'm thinking that the value returned in the first case is actually whether the KeyState was read, as opposed to it's current value. StuRat (talk) 00:35, 9 November 2009 (UTC)[reply]
No, VK_SCROLL is a so-called "virtual key constant", identifying the Scroll Lock key. GetKeyState returns a cardinal where the LSB is 1 if the key is "on" and 0 if it is "off", as I understand from [1]. At least this code has always worked for me under Windows NT systems. I think there is a lot more subtle problem. If I get time over "tomorrow", I will plug in my old HP Vectra VE and debug the program. --Andreas Rejbrand (talk) 00:55, 9 November 2009 (UTC)[reply]
OK, cool. Some other thoughts:
1) Does the "if" statement look at the LSB only ?
2) Maybe we need to use the GetAsyncKeyState call instead ? StuRat (talk) 01:39, 9 November 2009 (UTC)[reply]
Yes, you need to call GetAsyncKeyState. GetKeyState returns the key state as of the most recent window message, and this application never processes any messages. The "if" statement looks at the value of (GetKeyState(VK_SCROLL) and 1) = 1, which is boolean. -- BenRG (talk) 02:13, 9 November 2009 (UTC)[reply]
StuRat: 1) Yes. and 1 returns the LSB. 2) Yes, this is probably the subtle problem I am looking for. Strange that it works under Windows XP and Vista, though. --Andreas Rejbrand (talk) 13:29, 9 November 2009 (UTC)[reply]
One problem, though: Although GetAsyncKeyState can check if a key is down or not, it cannot give the status of "lock keys" (Num Lock, Scroll Lock, Caps Lock), I think... But now I have my old HP Vectra plugged in, so I will fix the problem within an hour. --Andreas Rejbrand (talk) 13:47, 9 November 2009 (UTC)[reply]
Cool. StuRat (talk) 14:02, 9 November 2009 (UTC)[reply]
Now it finally works. I gave up the Scroll Lock idea, due to the mentioned problem. Then I tryed to turn the motion on/off when both shift keys are down, but this does not work on Windows 98 (but on XP/Vista). It took a bit longer time than I expected, for I needed to install Windows 98 on the HP Vectra (it had Win95), and also figure out a way to copy files from my Vista computer to the HP Vectra (eventually I found an old USB floppy disk drive). Now the program works perfectly on Windows 98. You enable/disable the motion by simultaneously pressing the "C" and "M" (Cursor Motion) keyboard keys. The disadvantage of this approach is that the current keyboard focus control must, of course, not do something bad when you do this. For instance, it is a bad idea to use the combination when typing a report in Word. Then you simply have to click the desktop, task bar or something else. --Andreas Rejbrand (talk) 15:15, 9 November 2009 (UTC)[reply]
program CursorMotion;

uses
  Windows;

var
  pnt: TPoint;
  disp: integer;
  dorun: boolean;

{$R *.res}

begin
  disp := 2;
  dorun := true;
  repeat
    if dorun then
    begin
      if GetCursorPos(pnt) then
      begin
        SetCursorPos(pnt.X + disp, pnt.Y + disp);
        disp := -disp;
      end;
    end;
    if (GetASyncKeyState(ord('C')) and $8000 > 0) and (GetASyncKeyState(ord('M')) and $8000 > 0) then
    begin
      dorun := not dorun;
      repeat
        sleep(10);
      until (GetASyncKeyState(ord('C')) and $8000 = 0) or (GetASyncKeyState(ord('M')) and $8000 = 0);
    end;
    sleep(100);
  until 1+1=3;
end.

--Andreas Rejbrand (talk) 15:16, 9 November 2009 (UTC)[reply]

Thanks ! It works great. Now I can't wait until the next time my Flash animations lock up to see if it solves that problem. Thanks again. StuRat (talk) 15:28, 9 November 2009 (UTC)[reply]

WHAT ARE DIFFRENT TYPES OF AUDIO,VIEDO STREAMING IN JAVA

PLEASE DONT RESPOND SAYING

"GOOGLE IT DUDE U LL FIND IT"

I HAVE DONE THAT BEFORE

ANSWERS ARE WELCOME. . . . —Preceding unsigned comment added by Aashishkotagiri (talkcontribs) 15:26, 8 November 2009 (UTC)[reply]

You might start at the Java Media Framework article. That library encapsulates most of the common audio and video needs. There are numerous other libraries available to help. Your question is very vague - you can technically write any type of streaming audio or video in Java; but some of the more common types are already available through official (like JMF) and third-party libraries. Nimur (talk) 16:44, 8 November 2009 (UTC)[reply]
Please don't write in ALL CAPS. It is perceive as SHOUTING. --Mr.98 (talk) 17:52, 8 November 2009 (UTC)[reply]
...-ed... --Ouro (blah blah) 10:10, 9 November 2009 (UTC)[reply]
Thanks, typo police. What would I do without you? --Mr.98 (talk) 22:33, 10 November 2009 (UTC)[reply]

How do I make an NPC for Garry's Mod 10?

I have been playing the game "Spore" for quite a while now, and I have also been playing Garry's Mod 10 for a while. I was just wondering, how would I make a new npc for garry's mod 10, like say, a spore creature npc, or any npc. What would I have to do/download to be able to make one, and Im guessing its pretty complicated, so where can I get help? —Preceding unsigned comment added by DeWandel (talkcontribs) 19:57, 8 November 2009 (UTC)[reply]

It seems like you will need to learn LUA scripting, which is the scripting engine used by Garry's Mod and other games. Specifically look at the documentation for server-side NPC LUA scripting. There are numerous introductions and tutorials to LUA scripting on that site. First you need to create an AI script for it, and then you need to load that script and spawn the AI & renderable model in your game script. Here is the list of entities available; you can apparently extend or add to these with your custom scripts. Nimur (talk) 20:29, 8 November 2009 (UTC)[reply]
Suggestion: find existing NPC LUA code, and use it as a template. Re-inventing the wheel is a good way to end up with a bad wheel—improve on someone else's wheel and you'll get farther. --Mr.98 (talk) 00:05, 9 November 2009 (UTC)[reply]

How do I make a custom texture in Source SDK apply like a decal?

I pretty much know the basics to making custom textures for source sdk.....but how do you make it apply so its like graffiti..? Like not somthing you would build with, but, you know, a Decal?? I'm usuing VFT Edit to make my textures. and paint.net, also. —Preceding unsigned comment added by 74.37.226.31 (talk) 22:34, 8 November 2009 (UTC)[reply]