Click here to Skip to main content
15,891,976 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: Food for thoughts for Christmas, about blackholes... Pin
trønderen24-Dec-21 16:01
trønderen24-Dec-21 16:01 
GeneralRe: Food for thoughts for Christmas, about blackholes... Pin
Randor 24-Dec-21 16:26
professional Randor 24-Dec-21 16:26 
GeneralRe: Food for thoughts for Christmas, about blackholes... Pin
theoldfool24-Dec-21 13:54
professionaltheoldfool24-Dec-21 13:54 
GeneralRe: Food for thoughts for Christmas, about blackholes... Pin
Super Lloyd24-Dec-21 14:42
Super Lloyd24-Dec-21 14:42 
JokeRe: Food for thoughts for Christmas, about blackholes... Pin
oofalladeez34327-Dec-21 8:47
professionaloofalladeez34327-Dec-21 8:47 
GeneralRe: Food for thoughts for Christmas, about blackholes... Pin
jschell29-Dec-21 8:07
jschell29-Dec-21 8:07 
GeneralRe: Food for thoughts for Christmas, about blackholes... Pin
Super Lloyd29-Dec-21 8:32
Super Lloyd29-Dec-21 8:32 
GeneralWell now what? Pin
honey the codewitch24-Dec-21 12:07
mvahoney the codewitch24-Dec-21 12:07 
I've mentioned here before that whenever I catch myself forgetting that I don't know it all, I try my hand at a brain teaser I've been trying to solve for years now.

The problem is simple: Convert a finite automata to a regular expression.

The solution had eluded me. I've attacked it many different ways.

Finally I settled on the state removal method as it generates the cleanest regular expressions, and seemed easier for me to understand than methods like Arden's theorem: R=QP* whatever the heck that means.

Anyway, I solved it I think. I still need to create a battery of tests, but it seems to be working so far.

(abcd|12(3|55|77|99)4)(ef)*g
q0:
        (12(34|554|774|994)(ef)*g|abcd(ef)*g) -> q1

*q1:

(12(34|554|774|994)(ef)*g|abcd(ef)*g)


It's not the exact same regex, because that's not necessary. It just has to match the same text as the original one matched.

If anyone is curious, here's my mess. The main meat is in Program.cs under the ToRegex() method in the main project. The rest is support.

GitHub - codewitch-honey-crisis/FAToRegex: A testbed for FA to Regex via state removal in C# (work in progress)[^]

Anyway, point is, now I need another problem I can't solve, that students can, that I can attack for years to keep me humble. Smile | :)
Real programmers use butterflies

GeneralRe: Well now what? Pin
Randor 24-Dec-21 13:06
professional Randor 24-Dec-21 13:06 
GeneralRe: Well now what? Pin
honey the codewitch24-Dec-21 13:14
mvahoney the codewitch24-Dec-21 13:14 
GeneralPlz help! My audio playback is breaking up! Urgentz! Pin
Marc Clifton24-Dec-21 11:35
mvaMarc Clifton24-Dec-21 11:35 
GeneralRe: Plz help! My audio playback is breaking up! Urgentz! Pin
Ravi Bhavnani24-Dec-21 11:39
professionalRavi Bhavnani24-Dec-21 11:39 
GeneralRe: Plz help! My audio playback is breaking up! Urgentz! Pin
Ron Anders24-Dec-21 11:40
Ron Anders24-Dec-21 11:40 
GeneralRe: Plz help! My audio playback is breaking up! Urgentz! Pin
Mike Hankey24-Dec-21 11:46
mveMike Hankey24-Dec-21 11:46 
GeneralRe: Plz help! My audio playback is breaking up! Urgentz! Pin
DerekT-P25-Dec-21 3:12
professionalDerekT-P25-Dec-21 3:12 
Generaldisplay port vs. HDMI interface Pin
Southmountain24-Dec-21 8:48
Southmountain24-Dec-21 8:48 
GeneralRe: display port vs. HDMI interface Pin
Mycroft Holmes24-Dec-21 11:54
professionalMycroft Holmes24-Dec-21 11:54 
GeneralRe: display port vs. HDMI interface Pin
Southmountain25-Dec-21 12:15
Southmountain25-Dec-21 12:15 
GeneralIs this a good idea for an invention to help the unsighted Pin
BernardIE531724-Dec-21 7:43
BernardIE531724-Dec-21 7:43 
GeneralRe: Is this a good idea for an invention to help the unsighted Pin
David O'Neil24-Dec-21 7:56
professionalDavid O'Neil24-Dec-21 7:56 
GeneralRe: Is this a good idea for an invention to help the unsighted Pin
BernardIE531724-Dec-21 9:09
BernardIE531724-Dec-21 9:09 
GeneralRe: Is this a good idea for an invention to help the unsighted Pin
Gerry Schmitz24-Dec-21 8:57
mveGerry Schmitz24-Dec-21 8:57 
GeneralRe: Is this a good idea for an invention to help the unsighted Pin
BernardIE531724-Dec-21 9:14
BernardIE531724-Dec-21 9:14 
GeneralRe: Is this a good idea for an invention to help the unsighted Pin
Gerry Schmitz25-Dec-21 5:29
mveGerry Schmitz25-Dec-21 5:29 
GeneralRe: Is this a good idea for an invention to help the unsighted Pin
BernardIE531725-Dec-21 8:43
BernardIE531725-Dec-21 8:43 

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.