----------------------------------------- Some people have shown up for special things, especially at Kirschbaum: Patrick Biercher - PowerGRAPH Dirk Hilger - PowerTOOLS Thomas Reichardt - PowerISAM Further on there are some people on the PD and Shareware-Market which are quite known for their Tools: Thomas Gohel - PBSOUND Matthaues Stadler - HiVGA 10.3. Fido/InterNet - The people from PowerBASIC ------------------------------------------------ Without the many messages or ideas this FAQ would not ny far be what it is today. This is why I would like to use the occasion to thank some people personally: Thomas Gohel - Author of PBSOUND for PowerBASIC, Author of this PowerBASIC-FAQ and many other things... And I seem to be responsible for the PowerBASIC- Support here... ;) Andras Hoeffken - Measurementinstrumentsteering with PowerBASIC - Chapter 'C++ and PowerBASIC' Stephan Guenther - graphical conversion of all pictures with Highlight Professional V1.0 for "Windows New Technology" - incl. all rendered Graphics and Animations for PBSOUND Thomas Geiger - english Version of this FAQ - for some tips for this FAQ Mark Junker - Chapter 'Converting PDS to PB' - for some tips for this FAQ Wolfgang Bruske - english Version of the Chapter 'Pointer' | Dave Navarro - for his comments to this FAQ Bernd Richter - for the correctness of quite some information Peter Cooper - for the grammatical correctness of the english Version Marc van den Dikkenberg - for some tips for this FAQ Roland Arendes - for some tips for this FAQ Roland Osen - dito Wolfram Sang - dito Dr.P.Jennewein - dito Martin Kiewitz - dito Alexander Podkolzin - dito ============================================================================= FidoNet: 2:2410/330, BasNet: 130:1313/102, GerNet: 21:489/330 InterNet: http://www.snafu.de/~pbsound/ Email: pbfaq@pbsound.snafu.de Fax: +49-30-47300910 BBS, Line 1: +49-30-47300910 (24h, 8N1, X75, V.42b, CCB, 64000/128000bps) Line 2: +49-30-47300910 (24h, 8N1, V.42b, V.FC, V.34, 9600-33600bps) ----------------------------------------------------------------------------- - End of the offical PowerBASIC.GER-FAQ (c) Thomas Gohel, all rights reserved ============================================================================= --- CrossPoint v3.11 R * Origin: PBSOUND, PBFILES (32MB), PBFAQ, PBRULES, PBHIVGA at: 2:2410/330.1) --------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: EEA00000 Date: 10/04/97 From: MARVIN STAHL Time: 11:34am \/To: DAVID WILLIAMS (Read 1 times) Subj: Re: Scramble Hi! I posted a 'false' solution some time ago, because I didn't know that you all would make such a big problem out of randomness. Here my solution... Record running water and mix it with tv noise. Then digitize this and use it to scramble the characters like this... ;-) RANDOMIZE TIMER OPEN "WATER.RAW" FOR BINARY INPUT AS #1 ' the sample e.g. 500.000 bytes FOR I=1 TO 25 F=0 WHILE F=0 X=INT(RND*1000)+2 GET$ 1,X,B$ ' get 'random' number of bytes X=ASCII(RIGHT$(B$,1)) AND 3 ' make byte 0-3 Y=ASCII(LEFT$(B$,1)) AND 3 ' " IF X>0 AND Y>0 AND X<>Y THEN ' delete X<>Y if you want ;-) F=1 END IF WEND Temp$=MID$(Text$,X,1) MID$(Text$,X,1)=MID$(Text$,Y,1) MID$(Text$,Y,1)=Temp$ NEXT I CLOSE#1 END Maybe this is random (I'm not a mathe wiz), but IF... it would be an 'overkill routine' just to scramble three characters! ;-) Just to put some oil in the flames... Marvin --- Budweiser Write v3.11 R * Origin: I know I speak for all of us when I say... (2:2410/330.7) --------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: EEA00001 Date: 10/05/97 From: DAVID WILLIAMS Time: 04:14pm \/To: ROBERT FORTUNE (Read 1 times) Subj: Scramble -> Actually I was thinking of using the length of the string passed to -> determine the number of exchanges to make. Yes. I seem to recall that the very similar routine that was posted here a few weeks ago did exactly that. It did 2*N swaps, where N is the number of characters in the string. -> That it may "produce probabilities that are exceedingly close" is -> good enough for me. I like the idea that it has that "randomness" -> built in! Well, it's true that a lot of practical randomizers aren't strictly random, but *tend toward* randomness as some routine is iterated several times. For example, the normal way of shuffling a deck of cards, by splitting it into two roughly equal parts, then riffling the parts together, produces results that are nowhere near random if the actions are done just once. The card that was on the top of the deck will almost certainly still be on the top or very close to it, and so on. Only by repeating the splitting and riffling quite a large number of times, as is done in practice, do the cards become really jumbled, so they would satisfy practical tests of randomness. And the same is true of your routine... However, since BASIC comes with the built-in RND generator, which satisfies just about every test for randomness and operates very quickly, I feel that computer randomizing routines shouldn't depend on tending towards randomness, but should use RND to achieve it very quickly, And that's what my routine does. -> DW>and swaps. I still prefer my routine, which produces a -> theoretically DW>perfect result in just two swaps! -> -> Yes but only when there are only 3 characters in the string. What -> happens when there are more characters in the string? It needs N-1 swaps, where there are N characters involved. The swapping routine is: FOR X = 1 TO N - 1 SWAP L$(X), L$(X + INT(RND * (N + 1 - X))) NEXT X So N - 1 swaps are done. If you figure out the expression in the second L$(), when X=1, the swap can be done in N ways, involving any of the N characters. When X=2, there are only N-1 possibilities in the swap. The first element can't be involved. And so on. So the total number of branches in the decision tree is N*(N-1)*(N-2)* ... *3*2, in other words, N!, the exact same number as the number of possible permutations of N characters. It's easy to show that every permutation is reachable by just one branch, so the permutations are exactly equi-probable - which is the goal of this kind of randomization routine. I still far prefer it to any iteration method! dow --- PCBoard (R) v15.3 (OS/2) 5 * Origin: FidoNet: CAP/CANADA Support BBS : 416 287-0234 (1:250/710) --------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: EEC00000 Date: 10/08/97 From: SCOTT MCNAY Time: 12:15am \/To: ALL (Read 1 times) Subj: SLIP/PPP/etc source code? Hello All! I'm looking for SLIP, PPP, etc. source code, preferably in BASIC (PB would be too much to ask ;). I haven't been able to find ANY code or even specs for these. Probably could be found in internet RFCs, but I guess I haven't found the right ones yet. Thanks!! --Scott. --- timEd 1.01 * Origin: Wizard's, 254-554-2146, Abacus PLUS, 289-8285 (1:395/11) --------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: EEE00000 Date: 10/09/97 From: DAVID WILLIAMS Time: 02:52pm \/To: MARVIN STAHL (Read 1 times) Subj: Re: Scramble -> Record running water and mix it with tv noise. Then digitize this and -> use it to scramble the characters like this... ;-) .... -> Maybe this is random (I'm not a mathe wiz), but IF... it would be an -> 'overkill routine' just to scramble three characters! ;-) Well, sure, there are ways of generating random numbers that depend on physical phenomena, rather than the mathematical algorithms that are used by things like RND. Radioactive decays, which physicists believe are *absolutely* random - i.e. incapable of exact prediction no matter how much information is known about the physical situation -, are used in some circumstances. And, yes, it would be possible to use these to scramble the characters in a string, or anything similar. Whether it's "overkill" depends on how important the results are. If you just want to play games at home, it may not matter if some results come up much more often than others. But if you're running a lottery, with huge amounts of money at stake, you'd better be sure that there is no non-randomness in your numbers, since if there is people could use it to "break the bank" - i.e. put your organization into bankruptcy. But... -> RANDOMIZE TIMER -> OPEN "WATER.RAW" FOR BINARY INPUT AS #1 ' the sample e.g. 500.000 -> bytes FOR I=1 TO 25 -> F=0 WHILE F=0 X=INT(RND*1000)+2 -> GET$ 1,X,B$ ' get 'random' number of bytes -> X=ASCII(RIGHT$(B$,1)) AND 3 ' make byte 0-3 -> Y=ASCII(LEFT$(B$,1)) AND 3 ' " -> IF X>0 AND Y>0 AND X<>Y THEN ' delete X<>Y if you want ;-) -> F=1 -> END IF -> WEND Temp$=MID$(Text$,X,1) MID$(Text$,X,1)=MID$(Text$,Y,1) -> MID$(Text$,Y,1)=Temp$ NEXT I -> CLOSE#1 -> END The fact that you're generating your "random" numbers, X and Y, by some physical method, instead of by using RND, does *not* evade the fact that your calculations are *fundamentally* flawed, in the same way as Robert Fortune's. You're doing 25 swaps, each of which depends on two "random" numbers in the range 1 to 3. So the total number of branches in the decision tree is 9^25. Since all powers of 9 are odd numbers, and all multiples of 6 are even, there is no way in which equal numbers of branches can go to each of the six possible permutations of three characters. So the permutations must *not* be (exactly) equi-probable, no matter how your "random" numbers are generated. -> Just to put some oil in the flames... More like a red herring... dow --- PCBoard (R) v15.3 (OS/2) 5 * Origin: FidoNet: CAP/CANADA Support BBS : 416 287-0234 (1:250/710) --------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: EEM00000 Date: 10/14/97 From: SVEN HERMANS Time: 01:21am \/To: POWERBASIC,INC (Read 1 times) Subj: Error 611 Greetings Technical Support Group, The Error 611 stops My Program when Y Try to "$link" a Unit in My Program. Must Y take the error 611 Serious or not?. And When Y run the Demomous.bas (PB.INC) with the PowerBASIC 3.2 Compiler, Serial nr. 120331992. Then the Mouse cursor is flashing white with black stripes. My Computer is a 486,100 mghz. Further out PowerBasic, there Y have the problem that the Joystick not can be found in a Program like FF.2000 (flight navigator for Dos). But in SVGA for PowerBasic, in the Demo, there are no problems. What can Y do on the Error 611 and on the flashing?. Y Hope on a solution about the problems. Friendle greetings, Hermans Sven --- FastEcho GoldEd Frontdoor. * Origin: BBS, Halumo Lummen 32-11-437027 (2:292/113) --------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: EEP00000 Date: 10/19/97 From: SCOTT MCNAY Time: 10:46am \/To: ALL (Read 1 times) Subj: Upgrade? Hello All! I'm thinking of upgrading. I've got 3.0c and would like to go up to 3.2 or whatever the current version is. Anyone got info on what proof of purchase is needed, and what's being offered now, and how much? Thanks! --Scott. --- timEd 1.01 * Origin: Wizard's, 254-554-2146, Abacus PLUS, 903-3097 (1:395/11) --------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: EFD00000 Date: 11/08/97 From: SCOTT MCNAY Time: 01:50am \/To: ALL (Read 1 times) Subj: ??? Hello All! HELLO!!! This area used to have a decent amount of activity, but now it seems to be basically dead. Is there something wrong with my link to it?? --Scott. --- timEd 1.01 * Origin: Wizard's, 254-554-2146, Abacus PLUS, 903-3097 (1:395/11)