Click here to Skip to main content
15,916,180 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Why Does Bob have fireworks... Pin
Richard MacCutchan24-Jan-20 4:09
mveRichard MacCutchan24-Jan-20 4:09 
GeneralRe: Why Does Bob have fireworks... Pin
OriginalGriff24-Jan-20 4:16
mveOriginalGriff24-Jan-20 4:16 
GeneralRe: Why Does Bob have fireworks... Pin
glennPattonWork324-Jan-20 5:34
professionalglennPattonWork324-Jan-20 5:34 
GeneralRe: Why Does Bob have fireworks... Pin
Richard MacCutchan24-Jan-20 5:39
mveRichard MacCutchan24-Jan-20 5:39 
GeneralRe: Why Does Bob have fireworks... Pin
dandy7224-Jan-20 5:24
dandy7224-Jan-20 5:24 
GeneralRe: Why Does Bob have fireworks... Pin
glennPattonWork324-Jan-20 7:13
professionalglennPattonWork324-Jan-20 7:13 
GeneralRe: Why Does Bob have fireworks... Pin
kalberts24-Jan-20 8:06
kalberts24-Jan-20 8:06 
GeneralThis code took me years to write Pin
honey the codewitch24-Jan-20 2:33
mvahoney the codewitch24-Jan-20 2:33 
Way too long I've been chasing this, and the answer was right there in front of me. I've been overthinking this for years

C#
foreach (var input in inputs)
{
	var acc = new List<int>();
	var ns = new List<FA>();
	foreach (var state in mapKey)
	{
		FA dst = null;
		if (state.InputTransitions.TryGetValue(input, out dst))
		{
			foreach (var d in dst.FillEpsilonClosure())
			{
				//  add the accepting symbols
				if (d.IsAccepting)
					if (!acc.Contains(d.AcceptSymbol))
						acc.Add(d.AcceptSymbol);
				if (!ns.Contains(d))
					ns.Add(d);
			}
		}
	}
...


I didn't realize I could just make input a range. I thought I'd have to crack it apart into individual characters (kills perf on Unicode)

Pretty much all the lexer code I've written since rolex is now obsolete.
Real programmers use butterflies

GeneralRe: This code took me years to write Pin
Jörgen Andersson24-Jan-20 3:06
professionalJörgen Andersson24-Jan-20 3:06 
GeneralRe: This code took me years to write Pin
Kris Lantz24-Jan-20 3:14
professionalKris Lantz24-Jan-20 3:14 
GeneralRe: This code took me years to write Pin
honey the codewitch24-Jan-20 3:27
mvahoney the codewitch24-Jan-20 3:27 
GeneralUnusual behavior on my WIN 10 machine lately Pin
bVagadishnu24-Jan-20 2:14
bVagadishnu24-Jan-20 2:14 
GeneralRe: Unusual behavior on my WIN 10 machine lately Pin
OriginalGriff24-Jan-20 2:23
mveOriginalGriff24-Jan-20 2:23 
GeneralOccam's razor Pin
bVagadishnu24-Jan-20 7:44
bVagadishnu24-Jan-20 7:44 
GeneralRe: Unusual behavior on my WIN 10 machine lately Pin
Mark_Wallace24-Jan-20 2:51
Mark_Wallace24-Jan-20 2:51 
GeneralRe: Unusual behavior on my WIN 10 machine lately Pin
dandy7224-Jan-20 5:20
dandy7224-Jan-20 5:20 
GeneralRe: Unusual behavior on my WIN 10 machine lately Pin
Mark_Wallace24-Jan-20 7:14
Mark_Wallace24-Jan-20 7:14 
GeneralRe: Unusual behavior on my WIN 10 machine lately Pin
dandy7224-Jan-20 10:58
dandy7224-Jan-20 10:58 
GeneralRe: Unusual behavior on my WIN 10 machine lately Pin
kalberts24-Jan-20 8:21
kalberts24-Jan-20 8:21 
GeneralGrrrrrrrrrrrrrrrrrr! Pin
Mark_Wallace24-Jan-20 2:11
Mark_Wallace24-Jan-20 2:11 
GeneralRe: Grrrrrrrrrrrrrrrrrr! Pin
OriginalGriff24-Jan-20 2:22
mveOriginalGriff24-Jan-20 2:22 
GeneralRe: Grrrrrrrrrrrrrrrrrr! Pin
Mark_Wallace24-Jan-20 2:40
Mark_Wallace24-Jan-20 2:40 
GeneralRe: Grrrrrrrrrrrrrrrrrr! Pin
OriginalGriff24-Jan-20 2:53
mveOriginalGriff24-Jan-20 2:53 
GeneralRe: Grrrrrrrrrrrrrrrrrr! Pin
Mark_Wallace24-Jan-20 3:02
Mark_Wallace24-Jan-20 3:02 
GeneralRe: Grrrrrrrrrrrrrrrrrr! Pin
OriginalGriff24-Jan-20 4:12
mveOriginalGriff24-Jan-20 4:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.