|
that's when i knew i wanted to be a witch.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Not even those pigs are as filthy as your bracketless code!
But maybe I shouldn't bitch on your code so much lest you turn ME into a pig (or worse, bracketless code)...
|
|
|
|
|
If I turn you into a pig, it will be for needlessly boxing and unboxing value types.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
var piggy = (Pig)sander;
|
|
|
|
|
i could always just
mov ax, [Sander]
xor ax,ax
and blink you out of existence, but i like you.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
honey the monster, codewitch wrote: i could always just
mov ax, [Sander]
xor ax,ax I'm too young to understand this
honey the monster, codewitch wrote: and blink you out of existence Now this I understand
honey the monster, codewitch wrote: but i like you Phew...
I like you too, despite your lack of brackets (I'd only ever chase you with a torch and pitchfork, never actually burn or sting you)
|
|
|
|
|
Excellent. I could use the exercise. Unruly villagers are kinda scarce around here these days. I got hungry.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
also the part you didn't understand was 6502 assembly code.
My favorite 8 bit proc. Because I like you.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
I can identify with the desk status - mine is layered in eras, the Jurassic being rather popular. If no one messes with it I can find things where I put them at any time.
However. No, let me put it this way: However !
My code is kept scrupulously organized - long before the term refactoring became popular I would do that as repetitive actions became apparent - cleaning up the inner workings. Comments, too, lest I forget. And, now producing web-based applications, I make sure the user interfaces are actually very few so that I don't sew unnecessary confusion amongst the rabble. Inside my machines, also organized and, withing certain limits, the same from box-to-box. Even in DOS times I used SUBST drives to force uniformity when it wasn't physically available.
Slash and burn - is best reserved for other people's code!
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
my code isn't inelegant. but yeah it's not for the faint of heart
(real world excerpt - not production ready)
public static Lalr1ParseTable ToLalr1ParseTable(this CfgDocument cfg)
{
var start = cfg.GetAugmentedStartId(cfg.StartSymbol);
var pda = _ToLrfa(cfg);
var trnsCfg = _ToLRTransitionGrammar(cfg,pda);
var closure = new List<FA<string, ICollection<LRItem>>>();
var lalrclosure = new Lalr1ParseTable();
var itemSets = new List<ICollection<LRItem>>();
pda.FillClosure(closure);
var i = 0;
foreach (var p in closure)
{
itemSets.Add(p.AcceptSymbol);
lalrclosure.Add(new Dictionary<string, (int RuleOrStateId, string Left, string[] Right)>());
++i;
}
i = 0;
foreach (var p in closure)
{
foreach (var trn in p.Transitions)
{
var idx = closure.IndexOf(trn.Value);
lalrclosure[i].Add(
trn.Key,
(idx, null, null)
);
}
foreach (var item in p.AcceptSymbol)
{
if (Equals(item.Rule.Left, start) && item.RightIndex == item.Rule.Right.Count)
{
lalrclosure[i].Add(
"#EOS",
(-1, null, null));
break;
}
}
++i;
}
var map = new Dictionary<CfgRule, ICollection<string>>(_TransitionMergeRuleComparer.Default);
var follows = trnsCfg.FillFollows();
var rtbl = new List<IDictionary<object, CfgRule>>();
foreach (var rule in trnsCfg.Rules)
{
ICollection<string> f;
if (!map.TryGetValue(rule, out f))
map.Add(rule, follows[rule.Left]);
else
foreach (var o in follows[rule.Left])
if (!f.Contains(o))
f.Add(o);
}
foreach (var me in map)
{
var rule = me.Key;
var lr = _LrtSymbol.Parse(rule.Right[rule.Right.Count - 1]);
var left = _LrtSymbol.Parse(rule.Left).Id;
var right = new List<string>();
foreach (var s in rule.Right)
right.Add(_LrtSymbol.Parse(s).Id);
var newRule = new CfgRule(left, right);
if (!Equals(left, start))
foreach (var f in me.Value)
{
var rr = new string[newRule.Right.Count];
for (var ri = 0; ri < rr.Length; ri++)
rr[ri] = newRule.Right[ri];
var iid = _LrtSymbol.Parse(f).Id;
(int RuleOrStateId, string Left, string[] Right) tuple;
var rid = cfg.Rules.IndexOf(newRule);
if (0 > rid)
System.Diagnostics.Debugger.Break();
if (lalrclosure[lr.To].TryGetValue(iid, out tuple))
{
if (rid != tuple.RuleOrStateId)
System.Diagnostics.Debugger.Break();
}
else
{
lalrclosure[lr.To].Add(_LrtSymbol.Parse(f).Id,
(rid, newRule.Left, rr));
}
}
}
return lalrclosure;
}
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
modified 6-Aug-19 9:18am.
|
|
|
|
|
Well-organized code can be developed only by a committee.
However, it doesn't work and it's never finished, but just look how pretty it all is!
modified 6-Aug-19 14:43pm.
|
|
|
|
|
Sadly, your remark deserves far more upvotes than I have to give.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Sorry, but I'm a great believer in the "Clean Desk" policy.
My desk is always so covered in papers, files, boxes, and other random stuff that dirt can't get anywhere near it.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Okay, but I classify a lot of things as filth.
Like this *waves small stack of papers* 6 page pile of rubbish I spent 3 days implementing before I realized it was someone's homework assignment and not a whitepaper (they really should warn people)
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
honey the monster, codewitch wrote: 6 page pile of rubbish I spent 3 days implementing before I realized it was someone's homework assignment and not a whitepaper (they really should warn people) Welcome to CP.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
actually this came out of some university in Israel. That's why i made the mistake. Three students getting at best a D from me, because they got a 1/3 of what they did wrong, and I found out the hard way, by trying to code it.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
|
Yeah, I got taken for a ride. I suck.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
It was so much like me, except for my remaining human parts
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot
|
|
|
|
|
Are you sure you weren't already replaced?
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
I've just put my empty beer can in the robot who will replace the PM.
|
|
|
|
|
CPallini wrote: I've just put my empty beer can in the robot who will replace the PM
The sad thing is that I didn't have to ask "PM of which country?"
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
'Project Manager' was intended. However, 'Prime Minister' fits nicely as well.
|
|
|
|
|
So does president.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
… and whose least circuits you are unworthy to design.
(With apologies to Douglas Adams)
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|