|
Chris Maunder wrote: Cause Real Scientists Program In FORTRAN.
And you were using it why?
Michael Martin
Australia
"I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So I had to leave the place as soon as possible."
- Mr.Prakash One Fine Saturday. 24/04/2004
|
|
|
|
|
You hurt me. You hurt me deep.
cheers
Chris Maunder
|
|
|
|
|
My very first programming was in BASIC in those days when it was really BASIC: You had a maximum of 286 numeric variables named A to Z or A0 - A9 to Z0 - Z9, plus 26 string variables A$ to Z$. And then you could have 26 arrays, I believe they were named A# to Z#. I really should dig up that old "Real Time Basic for the Univac 1100 series" manual from my basement, for a nostalgia trip
That was in my high school days. At the Univerisity we learned Fortran and then Simula and Pascal, and the professor went to extremes in demanding long, descriptive variable names: When adding two numbers, fitting the names of the sum and the two addends on a single line could be a problem within the 80 char screen width. But the professor insisted.
Then, I looked over the shoulder of the brightest guys in the class while he was typing in some Pascal code, and I gasped: You can't hand in that! ... Variables were named I01, I02... F01, F02 (F for Float) and so on. "Of course I won't!" he replied, "Before I hand it in, I have the editor automatically replace I01 with NumberOfApplesPerBasket, F02 with AverageWeightPerAppleInGrams and I02 with NumberOfBasketsPerLoad - I can't waste my time typing those terribly long names every time I use that variable!" -- Sure he was the brightest guy. To him, the mental effort of knowing the meaning of I01 was no greater than knowingt the meaning of NumberOfApplesPerBasket. So why not save a little typing?
For my own part, I am happy with descriptive names (within limits), even if it takes a little more typing.
|
|
|
|
|
Classic! Why solve a problem when you can create a sub-problem and solve that on top of the main problem.
Ah, software developers.
cheers
Chris Maunder
|
|
|
|
|
Damn socialists unions, they've taken over C# !!!
I'd rather be phishing!
|
|
|
|
|
Vunic wrote: oops just seeing it's not there natively. (Not sure why) Union seems to me more or less meaningless in managed code. At least it it contrary to the philosophy of managed code: You don't have a "memory address" but a handle. The runtime system will interpret that handle, translating it to "some" memory address that you shouldn't care about at all.
The runtime system has the right to to that handle-to-address mapping in whatever way it pleases: It can do a JIT compilation (for code handles) and put the result into the assembly cache, it can load the data object from some backing store (in principle even magnetic tape!) etc.
A union says: Let these two logical objects (usually fields in a class/struct), the two handles, be translated to the same physical address. That would strongly restrict the freedom of the mapping operation of the runtime system. What if the alternative interpretations have different sizes? What if one alternative contains a partial object, addressed through a handle, while another is a flat array? What if one member is an accessor function? Or a delegate? What about a list object unionized with a string? If the semantics of overlaying wasn't unambiguously defined, it would be useless, so you would have to define all the details of cases like these mentiones, and the runtime system would have to imlement exactly that (rather hairy) semantics.
I am really happy that we have kicked unions out the back door.
If you really need that functionality, then you declare a byte array, to hold the "memory block", and define accessors that select parts of that byte array, and by shifting and masking and explicit casting provides other interpretations of the "memory block". It is not done behind the curtain, where the reader would have to know how the compiler and runtime system works on the bit level. Rather, you code it all yourself, explicitly and with a big warnig sign: Danger! Arbitrary, unchecked casts made here! Then you define the overlaying in every detail, completely independent of how the compiler and runtime system treats your data.
Yes, it will cost you a lot of work. It should. To keep you away from doing it.
|
|
|
|
|
*That useful reply* in lounge threads. thanks
Starting to think people post kid pics in their profiles because that was the last time they were cute - Jeremy Falcon.
|
|
|
|
|
Vunic wrote: *That useful reply* in lounge threads Such a thing exists?
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
Lol Very rare, but sure exists.
Starting to think people post kid pics in their profiles because that was the last time they were cute - Jeremy Falcon.
|
|
|
|
|
var unioned = new[] { "Hi" }.Union(new[] { "I'm unioned" }); From the top of my head, but it's a union and it should compile
|
|
|
|
|
|
|
You should be supporting the real men way of doing things bro.
Starting to think people post kid pics in their profiles because that was the last time they were cute - Jeremy Falcon.
|
|
|
|
|
You know, I am "lost in a haze of alcohol soft middle age".
|
|
|
|
|
I did like unions for things like:
union ColorMashup {
long ARGB;
struct {
byte alpha;
byte red;
byte green;
byte blue;
}
}
where the same data could be accessed as a whole or part.
Polymorphism solves most "union" problems a lot better, but the memory will probably be spread around a lot more.
You had to squeeze every drop of memory and performance out of the old unix machines.
|
|
|
|
|
Most useful for hardware registers and even software registers. You can view register broadly via the long/int/short or via the fields contained within it. Save a copy:
myCopyReg.bits = mySrcReg.bits. As a bonus your get a copy of the "undefined" bits.
Beats myRegCopy.fld0 = myRegSrc.fld0; myRegCopy.fld1 = myRegSrc.fld1; myRegCopy.fld2 = myRegSrc.fld2; et. nauseum
|
|
|
|
|
Thank you for this posting.
I am currently working on the conversion of some very old FORTRAN software for the NASA Voyager data processing as we are one of the instrument teams still working the Voyager Interstellar Mission and I have been struggling to find an option in C# to do exactly this, i.e. as mentioned in a reply this is like the FORTRAN COMMON BLOCK statement.
Now I think I will be able to finish my conversion project a lot easier than attempting to write my own version of a COMMON statement and figuring out how to implement all of the various possibilities.
Jerry W. Manweiler, Ph.D.
Fundamental Technologies, LLC
|
|
|
|
|
Starting to think people post kid pics in their profiles because that was the last time they were cute - Jeremy Falcon.
|
|
|
|
|
I'm looking for some guidance on best practices for data dictionaries.
I've seen them done poorly (i.e. a dump of sys.columns from the database), sometimes with a brief description but I've never seen them done usefully.
I guess, to provide more context, I'm looking at this more from an analyst perspective, wanting to query a database rather than work with or enhance the application that uses the database.
The sort of thing I think might be useful would be some commentary on when/where a record can change and how. Has anyone seen documentation at this level?
Another way of looking at the question is: If you have found useful data dictionary documentation on a database (either a transaction application or ODS/DW type of DB) then what specifically made it useful? What did it contain?
Also, what systems are around for tracking this - is Word being used - are there more interactive, automated data dictionary systems around that work well. I know some of the ETL tools try in this space - do they work well or are there independent systems you've liked?
Cheers
modified 10-Sep-18 5:49am.
|
|
|
|
|
I am not really sure about the best practice but this is something we track in spreadsheet and then on an internal portal.
- Table name (logical)
- Table name (physical)
- Business description for the table (what you are probably looking for)
- #1 - #3 for all the columns as well in the table. Along with this constraints are also mentioned for each table.
- For foreign key columns, source table (logical) is to be mentioned
So, if anyone needs to get say, all user addresses, they can take a look at spreadsheet/portal and write a query to get the details.
"It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[ ^]
|
|
|
|
|
There are aftermarket apps that serve a useful purpose in terms of documenting databases.
These guys have some interesting stuff, some of which is free.
ApexSQL Doc - SQL Server and BI documentation tool | ApexSQL[^]
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Taking the lead from JSOP Red-Gate do an excellent suite of tools SQL Toolbelt[^]. They are NOT free, quite expensive actually. We have been using some of their stuff for year but not the documentation tool.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I would add comments directly on the tables and columns.
Foreign Keys and constraints also help define the data dictionary.
For SQL server, search for "SQL Comments on Create Table on SQL Server 2008" for some good examples.
Worse case, create some additional tables for high level documentation.
|
|
|
|
|
Walk the pain and blame right out perhaps? (13)
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Perambulation - anagram of pain blame r out.
Whenever you find yourself on the side of the majority, it is time to pause and reflect. - Mark Twain
|
|
|
|