Wikipedia:Reference desk/Archives/Computing/2009 October 1

Computing desk
< September 30 << Sep | October | Nov >> October 2 >
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.


October 1 edit

The wireless charger edit

Dell has a new high-end laptop that charges wirelessly. I haven't seen this computer yet, but it comes to me that this design may have some serious inherent problems. How do they solve them? If you have to install an induction coil in the bottom of a laptop, how do you:

  • Keep the coil in the same place for the next generation's product?

Since laptop computers are compact, they may require rearrangement of parts from model to model.

  • If the coil is very large in size (certainly much larger than the coils for electric toothbrushes), how do you use the bottom of computer for heat dissipation?

Many laptop computers use the bottom to dissipate heat. However, wireless charging requires touching of two parts to maximize efficiency. Certainly I can make a bottom that sits 1/8" apart from the charging stand. This shall enable the air to flow freely to remove the heat. It just renders the charger much less useful.

If your computer has a large footprint (this one has a 16" monitor), you probably have the land area to install the coil. What if you want to install it on a much smaller computer?

  • Can the charging stand be used internationally? I mean voltage.

Many years ago I have seen a creative use of inductive charging on a Japanese-made PHS phone. The charging stand makes half of a transformer and the handset makes its another half. When the handset sits in the charging socket, this hard-wired transformer lowers the AC voltage for recharging (you need additional circuits in the handset). Since PHS is mainly used in Japan, they may afford to build hard-wired circuits for 100 VAC. Most GSM phones may need extra circuits to handle international variable voltages for their roaming users.

To me, this design trick seems to have a business sense. They are for the high-end markets. A rich user may just buy several charging stands for the home study, living room, office, and elsewhere. The charging stands cost very little to build (possibly nothing but a coil). They shall be very profitable. -- Toytoy (talk) 01:14, 1 October 2009 (UTC)[reply]

I must be missing something here. If you have to sit the laptop on the charging stand to charge it, and you have to plug in the charging stand - how is this any more convenient than a conventional charger ? I can't see how it makes the laptop smaller or lighter, because you still have the same laptop battery ? Is the charging stand supposed to lighter than a conventional charger ? Gandalf61 (talk) 11:22, 1 October 2009 (UTC)[reply]
It does eliminate the power connector as a point of failure. I have seen a number of laptops with mangled power connectors on the laptop or charger end. Throw in the wireless docking station and you eliminate the need to plug in any cables. ---— Gadget850 (Ed) talk 13:29, 1 October 2009 (UTC)[reply]

There is any program that randomize a song?? edit

There is any program that randomize a song?? An example: The program get the sound, split in many parts with 0,001 second and then put those parts together in a random order. —Preceding unsigned comment added by 189.0.212.236 (talk) 01:31, 1 October 2009 (UTC)[reply]

Such a program would be trivial to write (e.g. about five or ten lines of code) in GNU Octave. (Have a look at audio processing tools). Because it's not a very commonly-needed utility, I doubt it has been written and widely distributed. Nimur (talk) 05:45, 1 October 2009 (UTC)[reply]
If you split a song in 0,001 second chunks, and then join them in a random order, I'm certain that the result would bear no resemblance whatsoever to the original. I'm also pretty sure that what you would hear is a a 1000 Hz tone with some background noise. If you want to get a result that would be even remotely pleasing to the ear, your chunks would have to be a lot longer, and your program would have to choose the splice points carefully. At the very least, the signal at the end of the first chunk needs to have about the same amplitude as the signal at the beginning of the chunk you are joining it to. Otherwise there will be a very audible "pop". (And it is the playing of 1000 pops per second that would create the 1000 Hz tone that I referred to). Writing such a program is not trivial. --NorwegianBlue talk 10:01, 1 October 2009 (UTC)[reply]
It would be an example of Granular synthesis applied to a soundfile. With the grain size around a millisecond you would no longer be dealing with the original song so much as synthesizes wholly new sounds out of semi-random waveform bits and pieces. There are lots of granular synthesis tools, as listed on the page about it. Also, taking care of the "pops" is integral to granular synthesis. Pfly (talk) 07:37, 2 October 2009 (UTC)[reply]

gdb, C++ classes, and "incomplete type" edit

Consider a user-defined type class Quantity and a variable of that type declared as

Quantity q;

Under certain circumstances (I know not what) gdb can not print this variable. If I say

print q

gdb says

$1 = <incomplete type>

And if I type

whatis q

gdb says

type = struct Quantity

(By comparison, under the circumstance where gdb can properly print the value of a Quantity, the whatis command prints "type = class Quantity".)

I know what "incomplete type" means in C (a struct whose name is known but whose internal details are not, and which is being used to declare a pointer such that those internal details don't matter), but that's not the case here; the definition of the internal details of class Quantity is amply in scope.

I've learned that templated types cannot always have their type info reliably stored by gcc and read by gdb (there's this bizarre situation called "vague linkage"). I have eliminated templates from the inheritance hierarchy of class Quantity, and this has helped somewhat, but not entirely.

Does anyone know of any other reasons why gdb would be unable to print the value of a (reasonably) ordinarily user-defined type, or to misprint its type as struct rather than class? There might be some perturbations going on due to namespaces, but I've tried to rule those out, too. —Steve Summit (talk) 01:41, 1 October 2009 (UTC)[reply]

This seems to be a common problem in gdb. You wuld not happen to have a complete compilable example, would you? decltype (talk) 08:11, 1 October 2009 (UTC)[reply]
I agree it seems common, which is why it's odd that solution(s) aren't better known.
No, I don't have a complete example (or at least, not one small enough for this margin to contain :-) ). (That's why I asked "does anyone know of?", not, "Can someone look at this code for me?".) —Steve Summit (talk) 15:54, 1 October 2009 (UTC)[reply]
Here's an example:
$ cat foo.cpp
#include <iostream>
int main() {
    std::cout << "hi\n";
} 

$ g++ -g foo.cpp

$ gdb a.out
(gdb) b main
Breakpoint 1 at 0x8048615: file foo.cpp, line 3.
(gdb) r
Breakpoint 1, main () at foo.cpp:3
3           std::cout << "hi\n";
(gdb) p std::cout
$1 = <incomplete type>
(gdb) quit

$ g++ -v
g++-4.3_proper (Ubuntu 4.3.3-5ubuntu4) 4.3.3

$ gdb -v
GNU gdb 6.8-debian
--Sean 20:44, 2 October 2009 (UTC)[reply]
Have you instantiated the class variable q? - e.g. q = new Quantity(); --Phil Holmes (talk) 14:19, 1 October 2009 (UTC)[reply]
Yes. —Steve Summit (talk) 15:54, 1 October 2009 (UTC)[reply]
The declaration of q above requires a complete type (since it needs to know how big it is on the stack), so it's likely a GDB bug. This thread discusses such a thing, so you might try upgrading your GDB. On a side note, near-future versions of GDB are going to be very much nicer for C++ debuggery (printing types as you wrote them, not with template argument hell; default STL pretty-printing; embedded Python scripting; proper exception handling support; etc.). --Sean 17:13, 1 October 2009 (UTC)[reply]
cout has external linkage, so it's not on the stack. Anyway ostream typedef's to basic_ostream< char,char_traits<char> >, and Quantity is not templated.—eric 00:25, 3 October 2009 (UTC)[reply]
I don't understand the relevance of any of your three statements, but the timings of the above posts make this thread somewhat hard to read if you're just coming in. "p std::cout" should work no matter where it is; I know what cout is, the point of my code example was that gdb doesn't know; and I don't get the relevance of Quantity being templated or not. Elaborate? --Sean 14:43, 3 October 2009 (UTC)[reply]

Mac Computers edit

Is it true that the Mac computers are not infected by any virus and other worms and trojans etc.? —Preceding unsigned comment added by 113.199.142.244 (talk) 03:07, 1 October 2009 (UTC)[reply]

[1], [2], [3], [4], etc.--Drknkn (talk) 03:24, 1 October 2009 (UTC)[reply]
Were you trying to answer the question "yes" or "no"?
* A virus that you'll only catch if you run a pirated version of some software (iWork, in this case) -- which is always a ridiculously risky thing to do, because it'll always be coming from some dark, sleazy underbelly of the net that you can't trust.
* This doesn't appear to be a virus per se; it appears to describe a technique by which a malicious program (once running on your computer) can infect another program on your computer. The report is from three years ago. Symantec gives it its lowest-possible threat rating.
* A report claiming that Mac vulnerabilities are "on the rise". The report mentions "37 high-vulnerabilities", but without any details. The report is four and a half years old.
* Another report about the same pirated iWork virus.
I'm not shakin' in my boots, here. —Steve Summit (talk) 04:02, 1 October 2009 (UTC)[reply]
Yes, it is currently true that Macs are vastly less vulnerable to viruses than Windows machines. There are no circulating Mac viruses that will infect your computer unless you are already doing something terribly unsafe and inadvisable (such as installing pirated software that you found on the net). You can run an unprotected Mac connected to the open Internet with virtual impunity. The contrast with Windows (where putting an unprotected machine on the 'net is sheer folly, where the mean time to infection if you do so has been measured in minutes, and where even if you do install decent antivirus protection, you are still advised to be careful in what you do while online) is stunning. —Steve Summit (talk) 04:08, 1 October 2009 (UTC)[reply]
"There are no circulating Mac viruses that will infect your computer unless you are already doing something terribly unsafe and inadvisable (such as installing pirated software that you found on the net)." And that's how most Windows users get viruses, too. I've been seeing a lot of users infected with a fake anti-virus program called "Personal Anti-Virus." The user visits a page with a fake virus scan that says that they're infected. Even though the "scan" is just an animation on a web page, they assume that they are infected and click through several windows, download the program, and execute it. How can you protect against a virus a user downloads and runs on purpose? Did Apple program their OS to prevent that? Another common vector are keygens coming with pirated software. It's my opinion that mac users are actually more vulnerable because they're so cocky (like you, frankly). Apple markets their products as being easy to use, so computer newbies tend to gravitate to them and then they take no precautions. I tried to cite articles above from a wide range of time periods to illustrate that Macs have always had viruses. In fact, the first computer virus was written for the Macintosh in the 1980s. Apple spends much less money on developing protection against viruses than Microsoft. Users complained that Windows Vista was too secure, with its myriad of confirmation dialogs. Try to be honest with other users, because Mac users need to make their computers more secure for the upcoming deluge of Mac viruses. They are already appearing, as a quick Google search will show you.--Drknkn (talk) 05:14, 1 October 2009 (UTC)[reply]
What you're doing is called fearmongering. It's not that I'm cocky; it's that I prefer a computer that tries to be secure from the get-go, as opposed to one that has to be propped up by third-party antivirus software. You said, "Mac users need to make their computers more secure", but my attitude is, why should *I* have to make my computer more secure? That's like saying I have to make my car more crashworthy. It's not my job, and I'm not in a position to do it properly anyway. I'd very much prefer the original manufacturer did it in a proper, integrated way. There's nothing I can do to make my Mac more secure that Apple can't do for me, beforehand, and better.
I said "...unless you are already doing something terribly unsafe and inadvisable", and you said, "And that's how most Windows users get viruses, too." But most Windows users get viruses by clocking "OK" between one and three times. Is clicking "OK" an action that's terribly unsafe and inadvisable? There's a huge difference, I think, between clicking "OK" a few times after visiting a random web page, versus deliberately seeking out, downloading, and installing a pirated copy of a major application suite.
You said, "How can you protect against a virus a user downloads and runs on purpose?" Well, part of a computer's security depends on its ecosystem, and as far as I know Mac users simply do not download and run programs (on purpose or otherwise) nearly as often as Windows users do. Mac users tend to rely more (as they should) on the software that was originally installed by the manufacturer. Installing new programs on a Mac is a relatively rare and deliberate act, and typically requires typing a password. Windows users, on the other hand, evidently download and run new programs all the time, and doing so is typically one-click easy, because Microsoft has gone out of its way to make the process easy (and, thus, greatly enabled the malware distributors). The proliferating "Are you sure?" screens don't tend to help, because on Windows, users are conditioned to click "OK" dozens of times per hour, without thinking. On the Mac, on the other hand, the OS doesn't even let you try to do dangerous things, so it doesn't have to pop up dialogs nearly as often, so when it does pop one up, it's a significant event, and users are inclined to pay more attention, and not just click "OK" by reflex.
I am being honest when I say Macs are more secure. What's dishonest (or, at least, misguided) is to assert that computers are inherently woefully insecure, and that malware is omnipresent and inexorably invasive, and that end users have to worry about this and be careful all the time. By so generously enabling the malware authors for so many years, Microsoft has unfortunately bred an ecosystem in which such paranoia is all too necessary, but it needn't have been, and there are other ecosystems where the realities are quite different. —Steve Summit (talk) 05:56, 1 October 2009 (UTC)[reply]
Sigh, let me try to nip this in the bud before a flame war gets started. OP - no, it's not true that "the Mac computers are not infected by any virus". There are plenty of viruses which could potentially infect a Mac. If you don't want to get a virus, it doesn't matter what platform you use - install some antivirus, and make sure to update your OS and antivirus frequently. Also don't install random internet trash. If you did nothing to protect yourself, you'd probably be somewhat safer with a Mac than a PC. But you'd be asking for trouble either way. Indeterminate (talk) 05:26, 1 October 2009 (UTC)[reply]
As a Mac user with a sense of history, allow me to introduce you to the late 1980s: nVIR (computer virus) (spread all over the place around 1988-89) and Scores (computer virus) (I never saw it, but it was supposed to be maliciouser). Disinfectant, which was free, was the antivirus software of choice at the time. Tempshill (talk) 05:41, 1 October 2009 (UTC)[reply]
Indeterminate: If you're worried about merely potential threats, there are plenty of objects in your kitchen which could potentially kill you. There are thousands of worms and viruses which will infect an unprotected Windows machine. Can anyone name one currently-circulating actual Mac virus or worm?
Things are finally changing as Vista and Windows 7 gain some significant elements of inherent security, but today I think the average Mac user is still a lot safer, not just somewhat safer. —Steve Summit (talk) 06:17, 1 October 2009 (UTC)[reply]
I like to think different OSes like different neighbourhoods - some might be safer than others, but you can never be perfectly safe; and if you're gonna be stupid you will get into trouble no matter what. With some sensible precautions though, it's quite unlikely to get infected either way. --antilivedT | C | G 07:30, 1 October 2009 (UTC)[reply]
You can be pretty stupid and not get a virus on a Mac. You can have other security problems, but you're not going to pick up a virus, or spyware. You can be pretty smart and still get a virus and malware on a Windows machine. It's sort of disingenuous to imply that they're all the same odds—they're not. To stay "clean" on a PC requires a constant effort. On a Mac, you don't have to do a thing. Literally. Nothing.
I agree with Steve Summit's take on the problem with Windows and the "patch as you go" model. I have encouraged all of my relatives to buy Macs—it's just not worth their time to try and learn all of what goes into good security. Their machines should be basically secure from the beginning, because they are just unable to learn how to flush out their HOSTS file or repair their registry. As Bruce Schneier puts it, to those who say "educate the users," have you actually met the users? Most of them definitely don't care enough to patch their own machines on a daily basis, and that's bad for all of us.
I'm aware that much of the Mac's "inherent" security comes through the fact that nobody bothers to write viruses for it. But it's been that way for years and I haven't seen any evidence of that changing soon. --Mr.98 (talk) 13:05, 1 October 2009 (UTC)[reply]

It helps to try to imagine yourself as a malware writer. Are you after fun, or money? Whichever, there are hugely more Windows computers connected to the web than there are Mac OS X (or other) computers. You're likely to want to go after the greatest number of patsies, and as long as malware has to be OS specific, that means you'll want to go after Windows computers. So quite aside from the alleged relative strengths of the OSes (or their users), Windows has a certain disadvantage here. Note that this does not mean that OS X (or GNU/Linux) malware doesn't exist; and even if it doesn't exist now this doesn't mean that it couldn't exist next week. -- Hoary (talk) 07:33, 1 October 2009 (UTC)[reply]

From our Microsoft Windows page: "As of July 2009, Windows had approximately 93% of the market share of the client operating systems for usage on the Internet." Just to echo the sentiments above, why would anyone want to write a virus to infect the vast minority of users? Livewireo (talk) 13:44, 1 October 2009 (UTC)[reply]
If I had the motivation, skill, or desire to write this kind of malicious software, I'd try to write something for a Mac just to be the first to write a self-propegating worm. Everything I've seen (For OS X at least) is user installed and requires an admin password. None of the malicious software I've seen reported is self-propegating and none of it installs automatically. I can see people writing this kind of software just as a proof of concept, and it still hasn't come that far. Macs are more secure from self-propegating malware for two main reasons: obscurity and a system of handling files that is more secure than on windows. While you can account for the very small amount of existing malware by obscurity, it's hard to account for the complete lack of self-propegating malware using that particular arguement. That said, don't be stupid no matter what system you're on. P2P file sharing is risky, and visiting shady sites and downloading "gimmicks" is what will be the most likely cause of getting infected. Caltsar (talk) 15:03, 1 October 2009 (UTC)[reply]
Why write a Mac virus? Well, for the bragging rights, and to wipe the smug, cocky grins off the faces of all those vainglorious, self-satisfied Macheads. —Steve Summit (talk) 15:59, 1 October 2009 (UTC)[reply]
Caltsar: See Safari_(web_browser)#Browser exploits. There are vulnerabilities in Safari that take control of a Mac without user input. And Apple took quite a while to fix those vulnerabilities. They took long not because of corporate culture, but because Apple spends only 3.5% of their revenue on R&D (c.f. 15% for MS!). As for the password dialog, you can also make Windows ask users for a password to perform administrative tasks. This does little to prevent malware from infecting those machines, as I can attest from experience. The user may have limited privileges, but the malware will simply take control of system memory via a buffer overflow. Or, the program will make itself run at startup with administrative privileges. Macs are not immune to either of these techniques. But Windows Vista introduced a feature to combat buffer overflows called Address space layout randomization.--Drknkn (talk) 21:41, 1 October 2009 (UTC)[reply]
I never claimed that OS X had no vulerabilities. I claimed that no self-propegating malware has been documented on OS X. Additionally, OS X Leopard has a feature similar to address space randomization. No OS is completely secure, but OS X seems to protect against auto-execution and self-propegation better than windows. While every OS has security vulnerabilities, and while Apple didn't patch Safari fast enough, there are far fewer vulnerabilities reported and "open" on OS X. On the other hand, with Windows Vista and Windows 7, the OS is becomming increasingly more secure, and in my use I have yet to have a virus detected this year on vista/7, but even on a patched XP system, I still occasionally get hits on the anti-virus software. The relatively low adoption rate of Windows Vista may account partly for the amount of malware out there as (in my experience), the newer versions of windows are significantly better at detecting these threats. It is still easier to make malware self propegating on a Windows system as UAC and other security features are often turned off by users (this isn't an option in OS X for most things). Once again, this doesn't mean Windows is completely insecure, and for the massive userbase of the OS, I'm impressed at how well Malware can be kept off the machine. Caltsar (talk) 14:51, 2 October 2009 (UTC)[reply]

This is a general followup to several posts in this thread. This article mentions that there's now an OS X botnet. Botnet software normally spreads using vulnerabilities that have already been patched by the vendors; it targets uneducated users who don't update their machines and never notice the malware is running. Therefore, please don't advise people to buy a Mac and then do nothing to keep it secure. For everyone's sake it's important that they at least install security updates (which mainly just means keeping auto-update enabled and rebooting when it tells you to). I've been using Windows machines for nearly two decades and in that time I've never had a malware infection. I don't mean antivirus software stopped the malware, I mean the antivirus software never had to do anything. I attribute my longevity to two things: installing security patches as they become available, and not running software supplied by someone I wouldn't buy a used car from. It's not intrinsically safe to run untrusted software on OS X either, but in practice right now it may be safe. But even if that's so you still should install those security patches. Patch-as-you-go is the approach taken by all the major vendors, it has nothing to do with Microsoft especially. Even OpenBSD has had a few major vulnerabilities slip by. The security model on all of the major OSes sucks. Any program I run, even as an unprivileged user, has permission to read, write or delete all of that user's personal files. That's crazy. Software should have no filesystem access unless I grant it. The security of Java applets has nothing to do with bytecode or bytecode verification or type safety; those are needed to enforce security boundaries in-process, but OSes can accomplish the same thing with separate address spaces. No, Java applets are safe because Java has a security model that fits what people actually need in this age of networked PCs. NT, OS X and Linux don't. So I don't want to hear people claiming that Linux and OS X are secure by design. If they were, ActiveX-style native code applets would be as safe as Java. Finally, I would like to ask people here not to exaggerate the malware problem by saying things like "thousands of viruses will infect an unprotected Windows machine". Fear of malware is itself a big problem; in fact, I think it's a bigger problem than the actual malware. Politicians exploit fear of "cyberterrorism" to justify infringing our civil liberties, and so does Microsoft. -- BenRG (talk) 20:18, 2 October 2009 (UTC)[reply]

Many linux distributions come with selinux or apparmor preinstalled, which brings "Java-like" security to any app. --194.197.235.240 (talk) 12:04, 3 October 2009 (UTC)[reply]
I would like to note that the article linked above specifically mentions the pirated versions of iLife and iWork were responsible for the creation of the botnet using an existing trojan from incredibly unsafe computing practices that rely on the user bypassing security, not through any software exploits. Nothing is stronger than the weakest link, and in this case that link is the user and not a vulnerability in the operating system. Caltsar (talk) 17:56, 7 October 2009 (UTC)[reply]

Database type edit

Hi :) What is known as a "multiple-entry fixed-format database"? I came across this in a website (which doesn't really explain what it is, so I'm asking here). I'm trying to learn programming and databases, but as you can see, I'm still learning the basics. 122.255.2.163 (talk) 03:29, 1 October 2009 (UTC)[reply]

I have never heard it described in that way, but I assume the person is referring to a database that has multiple entries, each entry in the same format. That, basically, is just about any popular database that exists. -- kainaw 03:54, 1 October 2009 (UTC)[reply]
I've also not heard it described so. I can only imagine it refers to the character fields which are fixed sizes and don't grow or shrink as needed, such as varchars in oracle. For example, if you define a character field as size 10, it will always use 10 bytes of fixed storage even if you're inserting 1 byte at a time. I would imagine the database being referred to stores numbers and dates etc. in the same way? What database is that? Sandman30s (talk) 09:39, 1 October 2009 (UTC)[reply]

I Want to Convert my Tiff Images to Text files,Is it possible? edit

i want to convert my Tiff Image file to text file for editing and make some correction on it. —Preceding unsigned comment added by 124.125.175.163 (talk) 07:34, 1 October 2009 (UTC)[reply]

You could possibly do this with an OCR (Optical Character Recognition) program, if the text is relatively clear. --Phil Holmes (talk) 09:57, 1 October 2009 (UTC)[reply]

Windows Movie Maker edit

I have created a movie with Windows Movie Maker, but when I save it as a video file, it becomes miscoloured. How can I fix this? Jc iindyysgvxc (talk) 08:04, 1 October 2009 (UTC)[reply]


This website lists some ways to deal with this problem. Window Movies Maker Advice Hmrox (talk) 14:29, 1 October 2009 (UTC)[reply]

You might have the compression settings too high, which means the video loses a lot of quality when being encoded (saved). Try increasing the settings or allowing a larger file size —Preceding unsigned comment added by Avrillyria (talkcontribs) 17:26, 4 October 2009 (UTC)[reply]

Wireless speeds edit

My home wireless has been very wonky lately. It cuts out, it goes verrrry slow sometimes, things of that nature. It was never very fast to begin with.

Just for fun, I tried plugging into it with an ethernet cable. Without the cable, over Airport, I get at max 5-6 Mb/s. Plugged in with the ethernet cable (to the wireless router), suddenly I'm scoring 30 Mb/s at speedtest.net.

Is this common, or is it a sign that a) my wireless router sucks, or b) my wireless card sucks? What's the weak link in this system? Any way to improve it (other than being wired all the time)?

The router is a Netgear MR814v3 (11 Mbps, 2.4 GHz 802.11, b). The wireless card is an AirPort Extreme. --Mr.98 (talk) 13:09, 1 October 2009 (UTC)[reply]

If your router is 802.11b, then you'll never exceed 11Mbps. Of course that 11Mbps is a theoretical maximum, and is subject to some overhead. Signal strength will also affect the speed. --LarryMac | Talk 13:32, 1 October 2009 (UTC)[reply]
OK. That's what I thought. Guess this old router has got to go! --Mr.98 (talk) 13:55, 1 October 2009 (UTC)[reply]
Just be thankful that you have an internet link that makes wireless speeds possible! Here in rural UK we measure internet speeds in Kb/s. Sometimes we think we would do better in a third-world country! Dbfirs 16:00, 1 October 2009 (UTC)[reply]

Trouble with while.....wend edit

What is the best and most correct way to deal with a situation here- XLEN=LEN(X$):IF ENDPOS<XLEN THEN WHILE MID$(X$,ENDPOS,1)<>" ":ENDPOS=ENDPOS+1:WEND In this snatch of GWBasic code the value of endpos can exceed the length of x$, which causes an error. Is there a better way of arranging things other than just using a goto to break out of the loop when endpos become too high? Thanks 78.146.235.74 (talk) 15:01, 1 October 2009 (UTC)[reply]

What's the point of this code, really? What are you trying to accomplish? --Mr.98 (talk) 15:32, 1 October 2009 (UTC)[reply]
I want to capture each word in a string of words and spaces. The above code finds out where the word stops and spaces begin. Once the start and end position of each word is found, then the word can be isolated using MID$(). I'd be interested to hear of any better ways to do it. 78.144.204.139 (talk) 20:08, 1 October 2009 (UTC)[reply]
You can use 2 conditions in your WHILE statement. I'm not very familiar with GW Basic, but testing for WHILE MID$(X$,ENDPOS,1)<>" " AND ENDPOS<XLEN should do what you want - although you may need to check whether I've written it exactly as GW Basic will need it. --Phil Holmes (talk) 16:19, 1 October 2009 (UTC)[reply]

Thanks, that does seem to work. 78.144.204.139 (talk) 20:08, 1 October 2009 (UTC)[reply]

An easier way to do it would involve using INSTR to find the spaces, and then just using MID. --Mr.98 (talk) 23:53, 1 October 2009 (UTC)[reply]

Progress report on the Commodore 64 games restoration project edit

The XM1541 cable arrived today. I downloaded OpenCBM, compiled, and installed it. Everything went without problems. I then powered the system down, attached my old 1541 through the XM1541 cable to the PCI parallel port replicator, and powered the 1541 up first and the system up later. The result: The system boots up perfectly OK. I haven't blown it physically up or messed up the Linux kernel. It's a fully usable Fedora 9 system. Accessing the 1541 doesn't work at all. The red light stays lit the entire time the system is powered up, and cbmctrl status 8 reports: 99,driver error,00,00. Now I think the reason is either that the PCI parallel port replicator doesn't work, and I really do need a real parallel port on the motherboard, or that the 1541 itself is broken. But I don't know which is the case. Could someone suggest how I should proceed here? JIP | Talk 17:03, 1 October 2009 (UTC)[reply]

I'd be suspicious that either the port replicator isn't working, or that the driver isn't talking to it properly. So I'd try the operation with the port replicator removed (from the USB connection). Only if you get a different error message to the one you have now can you begin to suspect the driver/cable/1541. -- Finlay McWalterTalk 18:43, 1 October 2009 (UTC)[reply]
The port replicator connects to PCI, not USB. I found out early enough that OpenCBM doesn't support USB parallel port replicators at all, so I went for a PCI one instead. I think cbmctrl status 8 gives the same error message whenever it can't find the drive, for any reason. It gave the same error message when I hadn't attached the drive in the first place. I very much suspect that the case is simply that even a PCI parallel port replicator isn't supported, it simply has to be a real parallel port. I have two options to test it: a real Commodore 64 or an old PC with a real parallel port. Unfortunately I have neither - my team mate did mention he had an old Commodore 64 for sale, so I could ask him about it, and I could ask the IT support at work if they have any old laptops for sale. JIP | Talk 18:54, 1 October 2009 (UTC)[reply]
A reply from the OpenCBM mailing list suggested that the 1541 is broken. No wonder, as it's over twenty years old. I should get a new one ASAP, but from where? I might try asking my team mate, but failing that, I could try Finnish small ads and auction sites first, and something like eBay second. The only issue with foreign hardware is the power sources. British power sources are incompatible with continental European ones, and American power sources are even more so. Will this be a problem with a 1541? JIP | Talk 19:51, 1 October 2009 (UTC)[reply]
Looking at photos of the back (uk, us) it looks like there isn't a voltage selector (unlike modern PCs, for example); unless some models do have a voltage selector, then you can't use a US one. Really the 240v supply the UK used when 1541s were made should be compatible with the 230v Finland uses. -- Finlay McWalterTalk 20:33, 1 October 2009 (UTC)[reply]
Someone has recompiled Commodore Basic for Windows, if that is of any interest. http://www.pagetable.com/?p=48 78.144.204.139 (talk) 20:12, 1 October 2009 (UTC)[reply]
That is completely unrelated to my problem, and won't help me at all. Thanks for the good faith reply, though. JIP | Talk 20:18, 1 October 2009 (UTC)[reply]
To confirm your PC's new parallel port is working, you might try connecting it to a printer with a parallel port interface, then seeing if the PC can control the printer.
Did you purchase the Commodore 64 your teammate offered to sell? If so, are you able to test the 1541 with the Commodore 64? Even with no TV or monitor connected, you might still be able to blindly enter LOAD"$",8 and see if the drive responds normally. --Bavi H (talk) 02:09, 2 October 2009 (UTC)[reply]
I didn't purchase the Commodore 64 yet. And using a parallel printer wouldn't help, because printers make less use of the interface than the XM1541 does, so they are more compatible, while the XM1541 requires better implementation from the interface. And I don't even have a printer. JIP | Talk 04:26, 2 October 2009 (UTC)[reply]

Limitation of Maximum RAM based on CPU / CORE edit

I want to know is there any relation between the number of CPU's or CORE's and maximum RAM limitation? Is ther any capacity of the CORE is defined based on how much RAM can be addressed by each CORE / CPU? —Preceding unsigned comment added by 202.75.192.25 (talk) 18:12, 1 October 2009 (UTC)[reply]

I'm assuming you mean CPUs and cores in a conventional PC-intel architecture (a normal PC, in other words)? In that case, all the CPUs and their cores operate in a shared memory space and with a common pool of RAM. So there's no relationship between the number of CPUs and the amount of memory (strictly all those CPUs have some onboard cache, but for the purposes of your question that's transparent). Now this isn't the only memory architecture there is; NUMA architectures have separate memory for each CPU, and then (often, but not always) a shared memory space too. This is how the Cell processor (that you'll most commonly find in a Playstation 3) works, and how IBM's NUMA-Q servers work. Strictly, in a rather weird way, even your PC does work that way - the GPU on your graphics card is increasingly like a CPU (in capabilities, and the tasks it's given), and it has its own memory. Finlay McWalterTalk 18:40, 1 October 2009 (UTC)[reply]

Riva tuner (fan speed) edit

Hello there, I have increased my XFX 9800 GT's fan speed from 35 (stock) to 60 percent. After finishing any game or 3D application the fan speed soon goes back to its stock speed (35%). I have to manually set it again to 60%. Is it normal? Is there any way to keep the speed 60% in both idle or 3D load? Thank you--119.30.36.41 (talk) 20:25, 1 October 2009 (UTC)[reply]