The Mozilla coding standards are most helpful, but are a tad out of date. For instance, wherever they say "few compilers", the more accurate term "all currently maintained compilers" can be inserted.
This is especially true wrt templates, exceptions (some quirks on this one; I still avoid them) and C++-style comments.
Heck, I use C++-style comments with our HP-UX 9 C compiler (some senior engineer always goes in behind me and converts them anyhow).
Anyhow, I say (please flame me if I need it, I crave correction) that people with ISO non-standard C/C++ compilers need to ditch the commercial stuff and go with GCC (Q: How compliant is LCC on the Windows side?). That's just from a GNUphile. I certainly do not miss the bad old days of VC++, VisualAge, and Borland (don't miss ya, but I luv ya) Turbo C/C++.
My.02
Re:MS-DOS strings end with a '$'?
on
Lineo Frees CP/M
·
· Score: 1
I believe he's talking about DOS assembly strings.
The interrupt function to display strings to the console did not use ASCIIz string like us C coders are used to; it used $ terminated strings instead.
MS-DOS may have emulated DR-DOS's assembly string handling to increase cross-compatibility with DR-DOS executables.
Time to start a Kernel Cousin CP/M?
on
Lineo Frees CP/M
·
· Score: 1
Ok, here's what I got. Its a hexagon with two pentagons attacked on opposite sides, with lines connecting the nodes on either side of the outwardmost node of the pentagon.
If you had drawn a numbered circle of 12 nodes with 1 at the top and 7 at the bottom:
2->6 (internal path), 12->8 (internal), 3->11 (external), and 5->9 (external).
I cannot devise any other figure that works, and I cannot add to it. I like to think of the internal paths as "highways" and the external paths as "bypasses." One observation I made is that each node has within one hop either two highways, two bypasses, or one of each.
If it can be proven that this is a requirement in order to have all nodes within three hops, we can show that +12 node graphs are impossible, since extending the graph at any point would keep at least one node from being able to reach two of the "special" paths, thus keeping at least one other node from being able to reach it.
Wow. Messed up on that count.
But I am determined! Hmm... no how to keep track of inaccessible nodes...
Ah! Looks right if you copy & paste into note
on
Boredom Chasers?
·
· Score: 1
(NT)
Re:solve the degree-diameter problem for small gra
on
Boredom Chasers?
·
· Score: 1
My heartiest apologies. I should learn HTML.
Re:solve the degree-diameter problem for small gra
on
Boredom Chasers?
·
· Score: 1
Wow! Great riddle!
The answer is 22. Here's the proof (this is a full hour's worth of work):
First, we find how many nodes you can theoretically connect to. Let's define a(n,i) to be the number of unique nodes accessible from node n with path maximum length i. Trivially, we can observe:
a(n,0)=1// Contains only n
a(n,1)=4// n's three children and itself.
Now, by observing the propogation of children in this manner, we can derive this recursive function:
a(n,i)=(a(n,i-1)-a(n,i-2))*2 + a(n,i-1))
This yields:
a(n,0)=1
a(n,1)=4
a(n,2)=10
a(n,3)=22
Although we can probably show this function is true for all i>=2, I think it is sufficient to prove that is true at i=3.
Draw a node with three children. Now draw two children for each child (already has one connection to parrent). Now do this again. You'll notice it's 22.
Thus we establish that the theoretical maximum number of nodes that can be connected to any given node by 3 hops is 22.
Now we need to prove that there exists a largest web of (22) nodes for which each node is connected by three or fewer hops to every other node. We prove this by example.
Draw 22 nodes in a circle. Pick a node arbitrarily and label it 0. We will call this the level 0 node. Now draw three lines to other nodes and label those level 1 nodes. Now, for each level 1 node, draw TWO lines to other unconnected nodes. Label these level 2 nodes. Now, draw two lines from each level 2 node to unconnected nodes. Label these level 3 nodes.
By now, all nodes should be connected by three or fewer hops to the level 0 node. Note that all nodes belonging to levels 0-2 have three connections, and all level 3 nodes have only one.
This part gets tricky. Label the level one nodes a, b, and c. Group and circle each level 2 node with its level 3 children. Each level 1 node should be connected to two of these groupings, which you should label a1, a2, b1, b2, c1, and c2.
For both a1 and a2, connect one level 3 node to a level 3 node in b1 and c1, and the other to b2 and c2. Do not refer to the same external node twice! Level 3 nodes in a1 and a2 should not be connected by any lengths shorter than four except via their level 1 grandparent. At this point, both our level 0 node AND our level 1 node "a" are connected by three or fewer hops to each other node.
Repeat the above for the b1, b2 groups, excluding paths already drawn. Once this is complete, you have a largest (22 node) web as described above.
To complete the proof, here is the example I drew, with 22 nodes {1,2,...22}:
1->2,12,22
2->1,3,17
3->2,4,5
4->3,9,20
5->3,6,14
6->5,8,9
7->8,14,16
8->6,7,22
9->4,6,11
10->11,18,20
11->9,10,12
12->1,11,13
13->12,14,15
14->5,7,13
15->13,16,19
16->7,15,17
17->2,16,18
18->10,17,19
19->15,18,21
20->4,10,21
21->19,20,22
22->1,8,21
QED
-- Hal
Maybe Godwin's Rule should be extended to include the words "Florida Recount."
Unless, of course, we get a story where Brian Valentine blames the whole "election thing" on Linux.
In which case we'd have to extend the Rule to include "Brian Valentine," as well...
About four years ago I visited my dear-ol' dad's office on a DoD base, and half the comps there were running Windows 1.0 on MS-DOS 3.0. Do we still consider that vulnerable even though it doesn't natively support networking?
Perhaps regression is the best method of protection.
The Mozilla coding standards are most helpful, but are a tad out of date. For instance, wherever they say "few compilers", the more accurate term "all currently maintained compilers" can be inserted.
.02
This is especially true wrt templates, exceptions (some quirks on this one; I still avoid them) and C++-style comments.
Heck, I use C++-style comments with our HP-UX 9 C compiler (some senior engineer always goes in behind me and converts them anyhow).
Anyhow, I say (please flame me if I need it, I crave correction) that people with ISO non-standard C/C++ compilers need to ditch the commercial stuff and go with GCC (Q: How compliant is LCC on the Windows side?). That's just from a GNUphile. I certainly do not miss the bad old days of VC++, VisualAge, and Borland (don't miss ya, but I luv ya) Turbo C/C++.
My
I believe he's talking about DOS assembly strings.
The interrupt function to display strings to the console did not use ASCIIz string like us C coders are used to; it used $ terminated strings instead.
MS-DOS may have emulated DR-DOS's assembly string handling to increase cross-compatibility with DR-DOS executables.
First up: elf loading!
jk
(Unless you really think it's a good idea.)
(Then not jk.)
Oh wow. You're right. The whole story is...
Hey look! Oh, silly me!
The article says CP\M is free, not DR-DOS!
Heh... sometimes I just forget to read the articles and these things happen.
PS: The original article says DR-DOS is for purchase (includes source code). CP\M is free as the article states.
If you had drawn a numbered circle of 12 nodes with 1 at the top and 7 at the bottom:
2->6 (internal path), 12->8 (internal), 3->11 (external), and 5->9 (external).
I cannot devise any other figure that works, and I cannot add to it. I like to think of the internal paths as "highways" and the external paths as "bypasses." One observation I made is that each node has within one hop either two highways, two bypasses, or one of each.
If it can be proven that this is a requirement in order to have all nodes within three hops, we can show that +12 node graphs are impossible, since extending the graph at any point would keep at least one node from being able to reach two of the "special" paths, thus keeping at least one other node from being able to reach it.
What do you think?
Wow. Messed up on that count. But I am determined! Hmm... no how to keep track of inaccessible nodes...
(NT)
My heartiest apologies. I should learn HTML.
Wow! Great riddle! The answer is 22. Here's the proof (this is a full hour's worth of work): First, we find how many nodes you can theoretically connect to. Let's define a(n,i) to be the number of unique nodes accessible from node n with path maximum length i. Trivially, we can observe: a(n,0)=1 // Contains only n
a(n,1)=4 // n's three children and itself.
Now, by observing the propogation of children in this manner, we can derive this recursive function:
a(n,i)=(a(n,i-1)-a(n,i-2))*2 + a(n,i-1))
This yields:
a(n,0)=1
a(n,1)=4
a(n,2)=10
a(n,3)=22
Although we can probably show this function is true for all i>=2, I think it is sufficient to prove that is true at i=3.
Draw a node with three children. Now draw two children for each child (already has one connection to parrent). Now do this again. You'll notice it's 22.
Thus we establish that the theoretical maximum number of nodes that can be connected to any given node by 3 hops is 22.
Now we need to prove that there exists a largest web of (22) nodes for which each node is connected by three or fewer hops to every other node. We prove this by example.
Draw 22 nodes in a circle. Pick a node arbitrarily and label it 0. We will call this the level 0 node. Now draw three lines to other nodes and label those level 1 nodes. Now, for each level 1 node, draw TWO lines to other unconnected nodes. Label these level 2 nodes. Now, draw two lines from each level 2 node to unconnected nodes. Label these level 3 nodes.
By now, all nodes should be connected by three or fewer hops to the level 0 node. Note that all nodes belonging to levels 0-2 have three connections, and all level 3 nodes have only one.
This part gets tricky. Label the level one nodes a, b, and c. Group and circle each level 2 node with its level 3 children. Each level 1 node should be connected to two of these groupings, which you should label a1, a2, b1, b2, c1, and c2.
For both a1 and a2, connect one level 3 node to a level 3 node in b1 and c1, and the other to b2 and c2. Do not refer to the same external node twice! Level 3 nodes in a1 and a2 should not be connected by any lengths shorter than four except via their level 1 grandparent. At this point, both our level 0 node AND our level 1 node "a" are connected by three or fewer hops to each other node.
Repeat the above for the b1, b2 groups, excluding paths already drawn. Once this is complete, you have a largest (22 node) web as described above.
To complete the proof, here is the example I drew, with 22 nodes {1,2,...22}:
1->2,12,22
2->1,3,17
3->2,4,5
4->3,9,20
5->3,6,14
6->5,8,9
7->8,14,16
8->6,7,22
9->4,6,11
10->11,18,20
11->9,10,12
12->1,11,13
13->12,14,15
14->5,7,13
15->13,16,19
16->7,15,17
17->2,16,18
18->10,17,19
19->15,18,21
20->4,10,21
21->19,20,22
22->1,8,21
QED
-- Hal
Maybe Godwin's Rule should be extended to include the words "Florida Recount." Unless, of course, we get a story where Brian Valentine blames the whole "election thing" on Linux. In which case we'd have to extend the Rule to include "Brian Valentine," as well...
About four years ago I visited my dear-ol' dad's office on a DoD base, and half the comps there were running Windows 1.0 on MS-DOS 3.0. Do we still consider that vulnerable even though it doesn't natively support networking? Perhaps regression is the best method of protection.
Well, maybe that's 'cuz our government websites are 700% more interesting than yours... Mmmm... government websites... mmmmm.... (drools)