-
Posts
5,244 -
Joined
-
Last visited
Content Type
Profiles
Forums
Developer Articles
KSP2 Release Notes
Everything posted by PB666
-
C, C++, C# Programming - what is the sense in this
PB666 replied to PB666's topic in Science & Spaceflight
Why I'm moving on from VB One has to wonder how computer programmers think how outsiders might approach computer language. Now certainly on the night the folks at M$ wrote this little jewel someone must have been passing around a little microdot. See if you can figure out where the binary input occurred (Hint think bonafida function statements). The one major difference between VB and C is in VB you never had to worry about adding additional classes or dll's to your program, not so anymore Add IO.system class library before you begin. Sub OpenSource() Dim pathSource As String = "c:\x.bin" Try Using fsSource As FileStream = New FileStream(pathSource, FileMode.Open, FileAccess.Read) ' Read the source file into a byte array. Dim bytes() As Byte = New Byte((fsSource.Length) - 1) {} Dim numBytesToRead As Integer = CType(fsSource.Length, Integer) Dim numBytesRead As Integer = 0 While (numBytesToRead > 0) ' Read may return anything from 0 to numBytesToRead. Dim n As Integer = fsSource.Read(bytes, numBytesRead, numBytesToRead) If (n = 0) Then Exit While ' Break when the end of the file is reached. End If numBytesRead = (numBytesRead + n) numBytesToRead = (numBytesToRead - n) End While numBytesToRead = bytes.Length '[Write section eliminated damage would have already been done at this point] End Using Catch ioEx As FileNotFoundException Console.WriteLine(ioEx.Message) End Try End Sub From what this was cut this was a way to copy a text.file using their new code. There are so many things wrong with this code it actually boggles the mind. So let me go through these. Why use Visual basic to copy a file. There is only one reason that I have repeatedly use binary read/write to copy a file going back as far as 1990, and only one reason, the file is too big to transport and it needs to be split. So you might argue maybe they have another need to copy, but since their dos does if faster, but anyway, OK, granted some crytic need, but they piped the reader in advertising the sequential read/write capability. But wait a second, why might someone actually need to sequentially read a binary . . . . . . . . . . .the binary might be larger than the computers memory or the memory required to process the data in the binary! Dim bytes() As Byte = New Byte((fsSource.Length) - 1) {} <---- creates a byte() array the size of the file. It just so happens the file I read was 256Mb, but I had 22 files to read, and the last file to be read was 64Gb Before this was created it should have queried the user if size was a certain fraction of available program memory Dim numBytesToRead As Integer = CType(fsSource.Length, Integer) <------- if the filelength is not an integer, luckily in this instance Integers have been promoted to the old long, but the better choice was UInteger type Lets just suppose that at Integer maxima (2,147,483,647) the program sends only the maxima back as the limit length, so basically that is 2Gb of the average 4Gb computer memory, and that is an awful heap of memory for VB to handle The second thing is what might the user do with those bytes. For example I am going to expand each byte to 6 bytes, that would mean 2Gb + 6Gb = 8 Gb thats the memory of the overwhelming majority of computers, and of course since these are going to be in arrays its actually over the limit of almost all PCs. There really needed to be a clarify function call on the back side of this function. "Msgbox ......"Do you really want to load this much data [datablocksize]?" Dim n As Integer = fsSource.Read(bytes, numBytesRead, numBytesToRead)<------This is the transfer function, hard to deduce because the output is an integer see variable array bytes tucked into the argument list. This would not have crashed the program, the dynamic declaration of bytes() would have. If you had a file you wanted VB to copy you would want to do this. Open up a binary file for sequential read. Read to a certain part of the file storiing the binary in an array Open an output file storing the data in an output file Close the output file Repeat the Read unless the 'certain' size is larger than the binary information left in the file (-1). Close the binary file Close the last outfile after storing the data in it. They made something excessively complicated providing a solution for which there is no need, are they trying to drive users to another platform? -
http://www.universal-sci.com/headlines/2015/10/1/water-discovery-could-change-the-nature-of-future-mars-exploration
-
http://www.theguardian.com/science/2015/oct/01/asteroid-that-killed-dinosaurs-also-intensified-volcanic-eruptions-study
-
The theory of nearly almost someday everything
PB666 replied to PB666's topic in Science & Spaceflight
The precedences of the past demonstrate a certain frailty of the human mind. It is not so much the point that you know what needs to change as to accept that change is needed, and no matter how fundemental the idea, it could be replaced in subsequent lines of thought. I myself think string theory is bunk, but I think the standard model is representative of a direction but not necessarily the most precise representation of reality. There is, as the author eludes to, sufficient enough variance and uncertainty in the current observations to tolerate revisions of the model. -
http://www.nature.com/news/nasa-narrows-its-list-of-planetary-targets-1.18482?WT.ec_id=NEWS-20151001&spMailingID=49675374&spUserID=Njk3NjE5NzEwNjES1&spJobID=780102082&spReportId=NzgwMTAyMDgyS0 - - - Updated - - - piggy backing this onto the post, its also future of NASAs SETI http://www.dailygalaxy.com/my_weblog/2015/09/nasas-search-for-extraterrestrial-life-in-the-milky-way-the-next-ten-years.html?utm_source=feedburner&utm_medium=email&utm_campaign=Feed%3A+TheDailyGalaxyNewsFromPlanetEarthBeyond+%28The+Daily+Galaxy+--Great+Discoveries+Channel%3A+Sci%2C+Space%2C+Tech.%29 - - - Updated - - - and this op ed about Mars exploration http://www.spacetera.com/space-exploration/race-to-mars-part-1
-
C, C++, C# Programming - what is the sense in this
PB666 replied to PB666's topic in Science & Spaceflight
In the process of running cheap checks right now. But last night I found someone has already done part of the alignment online, problem is they did not parse the contigs into two branches. Lets say that i gave everything a unique but near infinite meaning using long long integers (comperable to firing a bullet from an orbit between mars an earth and hitting the hole of A donut floating around in earths orbit). This means that 6 billion sites get long-long id strings (because Unidirectional integers only reach 4.8 billion it represents 32 pieces of information about a site that can identify it and. 4^32 is roughly 1/1000000 chance of hitting the wrong target) So that each site now has 1 8 byte cell. So thats 48 gb of data, and my memory is 16 gb. I can deal with this anyway because i can simply select certain sites. in the institutes they use massively paralleled processing and have a huge amount of memory, but I don't. So i have to find clever work arounds one is to simply stop at 4.8 gig, i can codify the data and cut it to 3 gigs, but there will be alot of degeneracy. -
http://nautil.us/issue/29/scaling/the-trouble-with-theories-of-everything piggybacking this onto the first http://www.symmetrymagazine.org/article/july-2013/real-talk-everything-is-made-of-fields
-
Ediacaran biota may have been displaced by burrowing animals.
PB666 replied to PB666's topic in Science & Spaceflight
Possibly, one problem, not to much oxygen in the burrows, to eat you need to catabolize. It is known that some worms altered their biochemistry to make themselves work more efficiently in low oxygen environments. Most of the shale that we see that is rich in organics comes before the cambrian, so it is possible that these innovations in metabolism were novel for complex eucaryotes of the period. Because catabolism in oxygen poor layers was essentially stopped those layers once penetrated would have been rich in hydrogen sulfide and metal salts thereof. We know this is true because some of the most ancient bacteria utilize sulfate as an oxygen source when oxygen is in short supply for other organisms, and the end result is sulfide. So the sub benthic would have been diificult to access but a rich sourceof energy once mastered. Of course, no one can travel back to the period and see for certain, and the sampling of this papers results are small so ............ -
One reason not to use Larger boosters is the problem with speed control. If your rockrt is shaped like an SR71 this is not a problem. The space shuttle coupled SSME to boosters and could control force/mass during the first 90 seconds, largely because the coonections could not handle the stress of breaking mach at low altitude. Remember that main engine throttle down at maximum dynamic stress, that dynamic comes from drag, and the stress was largely created and maintained by the boosters. At least in the game you could use fat boosters just make you parts more aero or they will want to flip. Then of course lower the CoD for the leading part. One way to get around this is to have big smart booster in which the available solid fuel over time is structured to decline so that thrust begins to fall off as maximum dynamic pressure is reached. This is how i think about the problem. I have all these nice efficient engines that work well in space, and the i have a rocket sitting on a launch pad. How can i get my rocket high enough so that i can use thos light weight but efficient rockets. The solution is to modulate the booster phase This basically means boosters are a composite, so we close the game and enter RL 'well it worked in KSP' :^} Since th perfect launch to high altitude booster is a composite ..... drumroll.........you don't have to transport an interstate crusher to the launchpad or build the entire thing on site. You can compose it on site from managable pieces.
-
Stupid school project - Stopping the moons velocity
PB666 replied to Myggen's topic in Science & Spaceflight
What you need here is a mass energy converter, then convert a small amount of the moons mass to energy then use the Cannae drive to stop the moon. This is a joke, only a joke, for the next sixty seconds . . . . . . . Here's a question, if you attached a saturn v rocket to the leading surface of the moon, could you overcome the force imparted on the moon by earths tides and its rotation? How many saturn V rockets would it take I say 1000. -
You had the chance to chew up their math, anyway don't waste your time, i agree, omg, 100%, damn thats scarey. oh and we still cannot see what goes on below the event horizon.
-
http://www.bbc.com/news/science-environment-34403738 New analyses
-
That might be a wider regional desire. You could go even one step higher, have the circuit stop an explosive self-destruct, if it not replace every month it the circuit breaks and self-destructs initiate. Or even have the circuit switch to a allied activated self-destruct, so when you engage a foe with your stolen vehicle in battle you simply blow them up.
-
I was thinking along those lines, but instead a James Bond style bug that looks like a button or some common household item, maybe a cockroach which can evesdrop but after a certain period disintegrates leaving no trace. Or imagine a chip for an elevator that works for a time, but then the next rider gets dropped to the basement. Or a memory pen that has a virus that will distribute for a time but then after a while part of the memory just vanishes, leaving no evidence that the memory was 10mb instead of the 8 that it appears. With regard to the first responder, dropping carbon atoms, I agree, who expects stability. Certainly if you want stable carbon devices they need to be coated in somesort of anti-oxidant otherwise the lowest energy state, even for graphene is CO2.
-
I would guess that time dilation is stopping annihilation.
-
http://www.hngn.com/articles/135288/20150930/scientists-discover-create-disappearing-electronic-circuits-using-graphene.htm According to the article adding carbon on top of graphene causes them to evolve, eventually disappearing.
-
C, C++, C# Programming - what is the sense in this
PB666 replied to PB666's topic in Science & Spaceflight
This is a joke, right. My structures and consts all by themselves will be 100 lines. I have no choice but to move to C, VB is too slow, win10 makes it even slower. The assunption here is that you know what the density of Sqrt operations are in the code, as alredy describe above, i might get away with a substantila performabce tweeking the compiler, more if I use the inverse float square root function. Read the post, if you use an older c++ math.sqrt it can take 400 cycles, they managed to get that down to 3 specifying the inst set and using x * rsqrtss x. lol, 100 fold difference........ To get a feel take four charcter types, lets make them bytes , now make random sized that accumulate to 150 gb. And you dont know apriori how big in terms of numer of byte strings the set is. Now i am going to give you 6gb divided in 22 units, These units are not identical to the first, not even in pieces, they vary in both string sequnce, multiple type can exist at a position in a string and their identities are known to shrink and swell. Your job is to find which unit every piece in the first set best fits into the second and then fit those byte strings into a long chain. In addition there is degenerecy, some pieces best fit in several places, and other pieces may not fit at all, so these have to be set aside. the inclusion and set asides are determined mathematically using log functions and square roots. All of this can be done with known algorythm on mainframes, no problem. But now I am going to give you data that is not in the public domain, its coded differently from the first set, so the public alignment routines will give false optimals. So now you need to mimic that process on the mainframe except on the PC and with a much high frequency of variation in particularly convinience defined strings without cherry picking. IOW the boundaries of the variation should be self-defining. -
C, C++, C# Programming - what is the sense in this
PB666 replied to PB666's topic in Science & Spaceflight
Well knowing the King's English does not immunize you from geek speak. For example Class, Single, Double, Char (which is not a char, but a number that represents that char), ByVal, Option Strict, Const, Dim, Sub, Redim, Static, Friend, Gosub, ^ (not typically meanings in Basic that a non-computer savvy person might have). And of course if your friends (not the FRIENDs we just invented on Virtual Studio) read reddit then TIL WT_ NSF_, AMA, IAMA, and DAE mean. If they are having trouble with "If Then Else End If" or "For Next" then I would tell them they have a whole lot of woe in store for them in RL, 'cause the geeky-speaky urban lexicon is quickly becoming the lingua franca of a whole generation of folks who have early-onset device-induced social dysfunction. -
C, C++, C# Programming - what is the sense in this
PB666 replied to PB666's topic in Science & Spaceflight
I stopped upgrading with VB6 and Office2007 just to avoid the net conversion until the current research lines had played out. Now with win10 and vb.net and issues with connectivty it was time to move TIL that type declarations - gone, structures .... great ... i ll just ......wth. Public private friend ....why do in need all these in my friggin type declarations if i make that type declaration private? So now I wannabe in MonoDev, but im having to relearn VB in VS express. And my 'type declarations' have subroutines, oh that definitely is a performance improvement. lol. The reason to program in basic is so your thoughts and your algorythm are fluid with the language. If all the time is spent trying to figure that language, all those nifty thoughts gravitate to figuring out the code. -
Could someone help identify what this kit is used for?
PB666 replied to RickyJogging's topic in Science & Spaceflight
Don't laugh too hard. You have a contractor setting around waiting for an inst to move a JOEL 100 kva EM, youbwould be surprised how fast they try to find a taker. -
C, C++, C# Programming - what is the sense in this
PB666 replied to PB666's topic in Science & Spaceflight
That is one of my peeves, the closures on statement blocks should be unique an standardized. This is the reason you do want function and subs to reduce the number of nested loops and conditionals. you can formally Call in basic but it doesn't read as well. -
C, C++, C# Programming - what is the sense in this
PB666 replied to PB666's topic in Science & Spaceflight
-
C, C++, C# Programming - what is the sense in this
PB666 replied to PB666's topic in Science & Spaceflight
Yes the gui is nice but the intricate parts of VB are the sloppiest parts, particularly the scrollable lists, i only use one active X control and that is in excel, throws me up a code box and a away to start and capture transfer bugs. The VB sourced .exe files are not standalone, so its better not to use the gui if possible. The problem since vista is that unless its a background program, you almost have to use a visual interface. XP was the last MS OS to have a dos emulation mode, and it is hideously slow. Its not impossible to run text only display and entry, but it becomes stone knives and bear skins. Excel basically is a VB gui, so whats the point of making a stand alone now. I mean you can open and save a textfile from excel's VBA so at worst you need to use two programs instead of one. -
C, C++, C# Programming - what is the sense in this
PB666 replied to PB666's topic in Science & Spaceflight
GOTO statements were how people used to program, that's how you used to loop. You assumme that just because one can have bad habits they do. part of the evolution was That MS got ridcof Gosub, replaced with subs. They added type definitions, they added option explicit. they added functions, far better designed than the C# functions. All these things can be used if the user chose to, you don't have to have bad practices, in any language.