Click here to Skip to main content
14,450,441 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 5:09
communityengineerRichard MacCutchan24-Jan-20 5:09 
GeneralRe: Why Does Bob have fireworks... Pin
OriginalGriff24-Jan-20 5:16
communityengineerOriginalGriff24-Jan-20 5:16 
GeneralRe: Why Does Bob have fireworks... Pin
glennPattonWork24-Jan-20 6:34
professionalglennPattonWork24-Jan-20 6:34 
GeneralRe: Why Does Bob have fireworks... Pin
Richard MacCutchan24-Jan-20 6:39
communityengineerRichard MacCutchan24-Jan-20 6:39 
GeneralRe: Why Does Bob have fireworks... Pin
dandy7224-Jan-20 6:24
Memberdandy7224-Jan-20 6:24 
GeneralRe: Why Does Bob have fireworks... Pin
glennPattonWork24-Jan-20 8:13
professionalglennPattonWork24-Jan-20 8:13 
GeneralRe: Why Does Bob have fireworks... Pin
Member 798912224-Jan-20 9:06
MemberMember 798912224-Jan-20 9:06 
GeneralThis code took me years to write Pin
honey the codewitch24-Jan-20 3:33
mvahoney the codewitch24-Jan-20 3: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

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 4:06
communityengineerJörgen Andersson24-Jan-20 4:06 
GeneralRe: This code took me years to write Pin
Kris Lantz24-Jan-20 4:14
professionalKris Lantz24-Jan-20 4:14 
GeneralRe: This code took me years to write Pin
honey the codewitch24-Jan-20 4:27
mvahoney the codewitch24-Jan-20 4:27 
GeneralUnusual behavior on my WIN 10 machine lately Pin
bVagadishnu24-Jan-20 3:14
MemberbVagadishnu24-Jan-20 3:14 
GeneralRe: Unusual behavior on my WIN 10 machine lately Pin
OriginalGriff24-Jan-20 3:23
communityengineerOriginalGriff24-Jan-20 3:23 
GeneralOccam's razor Pin
bVagadishnu24-Jan-20 8:44
MemberbVagadishnu24-Jan-20 8:44 
GeneralRe: Unusual behavior on my WIN 10 machine lately Pin
Mark_Wallace24-Jan-20 3:51
MemberMark_Wallace24-Jan-20 3:51 
GeneralRe: Unusual behavior on my WIN 10 machine lately Pin
dandy7224-Jan-20 6:20
Memberdandy7224-Jan-20 6:20 
GeneralRe: Unusual behavior on my WIN 10 machine lately Pin
Mark_Wallace24-Jan-20 8:14
MemberMark_Wallace24-Jan-20 8:14 
GeneralRe: Unusual behavior on my WIN 10 machine lately Pin
dandy7224-Jan-20 11:58
Memberdandy7224-Jan-20 11:58 
GeneralRe: Unusual behavior on my WIN 10 machine lately Pin
Member 798912224-Jan-20 9:21
MemberMember 798912224-Jan-20 9:21 
GeneralGrrrrrrrrrrrrrrrrrr! Pin
Mark_Wallace24-Jan-20 3:11
MemberMark_Wallace24-Jan-20 3:11 
GeneralRe: Grrrrrrrrrrrrrrrrrr! Pin
OriginalGriff24-Jan-20 3:22
communityengineerOriginalGriff24-Jan-20 3:22 
GeneralRe: Grrrrrrrrrrrrrrrrrr! Pin
Mark_Wallace24-Jan-20 3:40
MemberMark_Wallace24-Jan-20 3:40 
GeneralRe: Grrrrrrrrrrrrrrrrrr! Pin
OriginalGriff24-Jan-20 3:53
communityengineerOriginalGriff24-Jan-20 3:53 
GeneralRe: Grrrrrrrrrrrrrrrrrr! Pin
Mark_Wallace24-Jan-20 4:02
MemberMark_Wallace24-Jan-20 4:02 
GeneralRe: Grrrrrrrrrrrrrrrrrr! Pin
OriginalGriff24-Jan-20 5:12
communityengineerOriginalGriff24-Jan-20 5: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.