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.
If Google Translate's any help...I'm not talking about bottles (who drinks out of a bottle with a straw??) - I'm talking about these cardboard cups you get at fast-food restaurants, which are so flimsy you need the plastic lid to re-enforce them.
What I want to know is, how does that plastic straw get from my home to the ocean? I throw them in the recycling bin at home or in the trash if I'm out and about. I live 4 hours drive from the ocean and I know my trash goes to a land fill. Who digs through my trash, finds any straw that might be in there and then takes them on a long drive to toss them in the ocean?
How about wax paper straws near the ocean and those of us far from the sea can still have plastic?
And bring back the damn incandescent light bulb while you are at it.
So I finally got the regex optimizing compiler to spit the output i wanted
And it's almost perfect, save the jmp at the beginning the but that's negligible. This is nearly a pure DFA.
The tricky part is at the root some of my lexer expressions may not be able to be converted into this DFA (optimized) code. And while order of evaluation doesn't matter for DFAs it does matter for NFAs (any of the non-optimizable expressions)
So basically what I had to do was scan through my lex expressions top to bottom, looking for entire runs of optimizable expressions
Those I'd transform into a single DFA expression with multiple different match instructions.
And then I intersperse those with the unoptimized expressions in the same order they came to me in.
And boom it allows me therefore to go from
L0000: save 0
L0001: jmp L0002, L0008, L0019, L0022
L0002: set "A".."Z", "_", "a".."z"
L0003: jmp L0004, L0006
L0004: set "0".."9", "A".."Z", "_", "a".."z"
L0005: jmp L0003
L0006: save 1
L0007: match 0
L0008: jmp L0009, L0011
L0009: char "0"
L0010: jmp L0017
L0011: jmp L0012, L0013
L0012: char "-"
L0013: set "1".."9"
L0014: jmp L0015, L0017
L0015: set "0".."9"
L0016: jmp L0014
L0017: save 1
L0018: match 1
L0019: set "\t", "\n", "\v", "\f", "\r", " "
L0020: save 1
L0021: match 2
L0023: save 1
L0024: match -1
Which requires lots of fibers and therefore multiple scans of a character per pass
to this, which requires only two scans per pass max (error checking accounts for the extra jmp):
L0000: save 0
L0001: jmp L0002, L0008
L0002: switch case "\t".."\r", " ":L0003, case "-":L0003, case "0":L0005, case "1".."9":L0004, case "A".."Z", "_", "a".."z":L0005
L0003: switch case "1".."9":L0004
L0004: switch case "0".."9":L0004, default:L0006
L0005: switch case "0".."9", "A".."Z", "_", "a".."z":L0005, default:L0006
L0006: save 1
L0007: match 0
L0009: save 1
L0010: match -1
The only thing left i have to potentially do is eliminate that jmp at the beginning, and add the second operand as the default in the switch/case that follows.
Edit: Perf testing shows me maybe i don't need to that, as it's already on par with the DFA. WOO!
I'm proud of myself.
Edit: Whoops, bit of a bug i just noticed but minor.
Second, "rolex" might not be the best of names, as some company might object to it.
They can object all they like. Trademark law says I'm on solid footing. This isn't a watch or anything related to timepieces so it's not in the same industry, ergo, names can be the same without infringement, at least last time i talked to a copyright legal eagle about it.
Eddy Vluggen wrote:
Any chance you're going to dedicate an article to the subject?
No, it's not to do with the Win32 API. It's a fiber in concept though, and uses the same principles as CreateFiber does. It's a cooperatively scheduled Program fragment with its own instruction pointer (Index)
So, as some of you know, I'm my own boss since last year.
For the first few months I've worked from home, which got very lonely (I have no girlfriend/wife, kids, roommates, etc.).
So I rented a place for a few days a week.
Unfortunately, they were in the middle of moving.
They got kicked out of their old building and the new building, an old coach house, had to be renovated.
The temporary space was an old school building... Just that, old and school-y.
But after three months of old school building I'm finally in the renovated coach house as of today!
It's really nice, good desks and chairs, smartphone access to the building, floor heating, really high ceiling with original beams and modern, warm, LED lighting...
The outside looks cool too, original coach house, but with a new characteristic driveway and a couple of parking spaces.
The owner even wants to ask the municipality to replace the regular (boring) street lighting in front of the building with some beautiful and characteristic lighting.
I share the room and building with some other people and companies, so it's never dull (except today because I'm the only here ).
Goodbye dirty radiators with gum stuck to it, hello professional building where I could invite potential customers if need be
I've had a few VERY nice work spaces
One work space I've had was pretty bad, way too little space...
Luckily that only lasted a few months, after which the company moved to a bigger building and I got a 2m x 1m desk, two big ass monitors and plenty of space to roll and spin my chair
And then I've had an own office which I had to share with someone, but my corner desk was probably something like 3 m2
Those also had some drawers which I never used.
I think a good work place is important for a bit of happiness and productivity at work.