|
Some code is based around algorithms that themselves are very messy.
For example, generating LALR(1) parse tables: LALR(1) Parsing[^]
Or doing DFA the state removal algorithm (easy to visualize, hard to code): regex - State Elimination DFA to Regular Expression - Stack Overflow[^]
It's the algorithms themselves that are the problem.
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'm quitting smoking. Idle hands being what they are I need to stay busy with stuff, and so that means CP contributions.
I've recently built a relatively in depth tutorial on building a feature rich regex engine.
Now I'm going to do one on building a full featured tokenizer with it.
And then the same for a parser - LL(1)
And then *maybe* a second parser round covering LALR(1)
Covering more than the basics, since I've already covered those here before.
PCK, my Parser Construction Kit[^] is built, but basically, building it again, with partitioned heavily commented code, and an article explaining it.
That's much harder and more time consuming but hopefully it will get some interest here.
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.
|
|
|
|
|
Good for you! Hope it goes well.
Are you "going cold turkey", patches, tablets, or gum?
I did it 15 years ago with the patches (via an NHS stop-smoking service) and it wasn't easy but was worth it. One suggestion from the service I used was to put cash in a jar: if you smoke 20 a day, put the cost of a pack in there every day. At the end of the first month, spend the money on a treat for yourself and only yourself. It's surprising how fast it builds up! Keep stuffing cash in there, and after six months, buy yourself an even bigger treat - with a pack averaging around £10 each in the UK, that's a significant bonus to look forward to, and it can help focus you on the long term / medium term advantages of giving up.
Another was to change where you go: break away from the locations where you have a habit of smoking. So if you goto a particular pub and smoke there, go to a different pub. If you smoke at your desk, move your computer to a different room. Stopping the "association" with smoking can really heklp reduce the craving.
Let us know how it's going - I'm sure all us ex-smokers here will support and encourage you to get through this.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Thanks. I'm trying the inhaler device because the patches give me a rash and chantix isn't for crazies like me.
I never could stand the gum.
I quit for 5 years at one point, so I know it's doable for me. It's just not easy. I'm kicking myself for starting up again, but I had moved a smoker in with me, and that was too much being around that all day.
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.
|
|
|
|
|
That sounds exactly the same as I went through many years ago. I finally quit one day when my heart and mind agreed, "no more".
|
|
|
|
|
I'm not doing it for a long life, i just don't want to die of something stupid like cancer or a stroke.
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.
|
|
|
|
|
The patches screwed up my sleep - I just didn't get "deep enough" so I had "lucid" dreams, was pretty much almost awake all night. By the end of the three months I used them, I was pretty badly sleep deprived
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
chantix messed with my sleep but i'd use it again if i could. they don't give it to crazies though like i said
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 grew up in a smoking home, and my father never really managed to quit completely.
In the end it was probably the smoking that finally killed him.
So I believe I can appreciate how hard it is to quit.
And besides, when he started smoking it wasn't dangerous yet.
What I can't wrap my head around is what drives obviously intelligent people to start to smoking, now that we know how dangerous it is.
No, I'm not trying to be sarcastic or anything, I'm genuinely curious.
|
|
|
|
|
being predisposed to addiction tends to make one become a smoker.
(that's not the only reason, but maybe a big one)
I didn't grow up in a smoking household. I was adopted. That said, my biological family pretty much all smoked with a couple of exceptions.
A lot of them are bipolar, and smoking is really common in bipolar folks. We tend to pick it up during mood swingy times.
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.
|
|
|
|
|
Well, that's more an explanation for why you got stuck with it, and I can understand that one.
I mean alcohol (in reasonable amounts), as well as many other drugs, makes you feel good.
While tobacco the first time used tastes like sh*t. And you also feel like sh*t if you get enough of it, in the beginning.
Still haven't talked to anyone having had a different experience.
|
|
|
|
|
When I moved to Singapore I had to give up driving and as a consequence was able to stop smoking - I always smoked in the car.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
Tobacco companies kill their best customers and condom companies kill their future customers.
|
|
|
|
|
Sander Rossel wrote: condom companies kill their future customers.
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.
|
|
|
|
|
Good luck, not the easiest habit to break.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
I look forward to the tokenizer, I need one for the project I'm working on....or something similar!
They call me different but the truth is they're all the same!
JaxCoder.com
|
|
|
|
|
I built PCK and it has one already. Check it out here
GitHub - codewitch-honey-crisis/pck: The Parser Construction Kit ("Puck"): A Parser Generator and Grammar Translator in C#[^]
It has some associated code project articles.
You can generate a tokenizer using PckEdit or the command line
Just write a grammar with all terminals in it.
then use
pckw fagen [options]
or Build|FA Tokenizer from the menu. It will spit out VB or C#. The command line one can spit out any language you have a code dom provider for
Edit: Never mind, there's a bug i must have introduced. I guess that's more stuff to keep my occupied. Fixed the bug
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 24-Nov-19 9:41am.
|
|
|
|
|
Thanks I'll check it out this afternoon.
They call me different but the truth is they're all the same!
JaxCoder.com
|
|
|
|
|
Last week I had to replace my phone.
A consequence was that I lost my app from (what I thought was) NWS, the weather bureau.
I went around looking to replace it.
I could not find it on Google Play, nor could I find it on their website, nor could I find it by searching for it on the internet.
Before last week, all I had to do was tap one time on the face of my smartphone, and the app appeared.
It gave an interface just exactly like this one here.
https://mobile.weather.gov/#typeLocation
I had thought that it was written by people who work at NWS.
If anyone here can find that app, please do post a link, or a name that I might be able to find on Google Play Store, or whatever.
From what I can find on various web searches, the app that I thought I had simply does not exist.
Brain assistance is welcomed and encouraged.
|
|
|
|
|
On NWS Delivers Mobile App Functionality to your Web-enabled or Smart Phone Device[^], I can see a message box telling:
"Do you want NWS "App" functionality on your cellular device? Simple!
Visit mobile.weather.gov on yout smartphone or web-enabled device and add us to your home screen..."
This seems exactly what your are searching for. But maybe there is a technical issue of some kind?
"Five fruits and vegetables a day? What a joke!
Personally, after the third watermelon, I'm full."
|
|
|
|
|
Well, well, well; so, I never had an app in the first place, is this correct ?
This could be truly educational.
|
|
|
|
|
C-P-User-3 wrote: so, I never had an app in the first place, is this correct ?
I can't tell Only you could figure this out.
"Five fruits and vegetables a day? What a joke!
Personally, after the third watermelon, I'm full."
|
|
|
|
|
I'm reminded of this every time I post something basic, like implementing IList<T> in C# here versus something complicated like a regex engine or parser generator.
Guess which article gets all the attention?
It's understandable, as everyone needs container support in C# but most people don't need another regex lib.
Still, it seems the stuff I like to write, and the stuff people like to read are pretty different.
One day I'll figure out how to change this sig permanently
|
|
|
|
|
|
I'm still bitter from that time when my article about IL and Expression Trees[^] (Feb 2011 ), which I still consider my magnum opus, didn't make article of the month because it lost to some simplistic explanation of the chewed out design patterns or some such (me, envious? no way!)
That's democracy for you
|
|
|
|