|
Okay honey and all - I might come across harsh here, but why in the heck would you want to do this?
I guess maybe if you wanted your own compiler? I can sort of see that. Context: I live in the land of really old code. Supporting legacy systems is my bread and butter. It's put multiple children through college, paid off the cars, and fed me. Cute and fancy scare me - it's okay, I'm an old ****.
How would one support this? What problem is trying to be solved? Why would it make my life eaiser?
For the record, I'm not a computer scientist, I'm an EE in embedded systems. So, I've never had a class in compiler theory or the more traditional CS studies. Keep your explanation simple
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
Basically because I wanted templatizable source code that
A) I could visit and transform
B) I could render out to other .NET languages.
Now I'm going to get into the weeds a bit, if not for you then for other readers. Follow along as you can, but it's not critical that you understand this stuff - anyway:
A and B are what Microsoft .NET's CodeDOM allows you to do. It's an abstract syntax tree with objects representing things like CodeConditionStatement for "if" and CodeVariableDeclarationStatement for declaring a local variable.
You can take that tree and render it to C# or VB.NET out of the box. Or other languages if it has a 3rd party provider for it - any language that can work in ASP.NET has a sporting chance of working with this because they both use the CodeDOM to do their magic.
The trouble with the CodeDOM is it doesn't have a parser. You have to build those trees by hand, and they are extremely verbose.
So I wrote one. It parses a CodeDOM compliant subset of C#6 and builds that codedom tree from what you type in.
Viola! I have templatizable, transformable, language agnostic code that now I can write in (almost) C# (C# can express more than the CodeDOM can so I had to limit what I could support). That code is VB.NET code. That code is C#. That code is potentially F# code, etc.
The trouble with *that* is C# doesn't give you type information, and you need that information to fully manifest what you parsed. Otherwise what you get back is ambiguous.
I resolve those ambiguities when I cook that C# subset into a CodeDOM tree. It takes time.
Deslang (my code generator generator) takes that code, does all the cooking, and produces code that can reinstantiate that code tree instantly on demand. Everything was resolved up front, and the result turned into code that produces a code tree that can render code.
For future transformation or rendering to one of many .NET languages.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
Perhaps a concrete example will make my previous reply clearer.
Rolex: Unicode Enabled Lexer Generator in C#[^]
This is a command line tool that takes many regular expression based rules and generates a DFA lexer in one of many .NET languages. You can add 3rd party languages. (I'm hands off that part, but like IronPython probably has one). VB.NET and C# are supported on any system.
Instead of writing the complicated code to do lexing in CodeDOM AST directly by hand coding new statements.Add(new CodeVariableDeclarationStatement(new CodeTypeReferenceExpression(typeof(int)), "foo", new CodePrimitiveExpression(0))); I can simply do int foo = 0; and it will create those big verbose objects on my behalf.
So I wrote my TableTokenizer using that. I use Deslang to cook it into a codedom tree as a build step. Rolex then transforms that tree during runtime to include the computed DFA table used to make the lexer work (it's a series of int arrays basically, but could be anything)
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
"Down, down, down. Would the fall never come to an end? 'I wonder how many miles I've fallen by this time?'"
cheers
Chris Maunder
|
|
|
|
|
I just used my Rolex lexer generator to generate a 5.7MB C# file and at least 95% of it is a single array of integers.
How's that for testing the limits of C# arrays?
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
And here I were thinking that my Rolex is just for telling time, oh sorry, just noted it is a Lolex, made in ...
|
|
|
|
|
In my student days, upon finding the book 'A Million Random Digits with 100,000 Normal Deviates[^], simply because I was fascinated by the madness of publishing a whole book of random numbers. In the Numerical Methods course, we had been through the theory of random number generator. The cost of the book was something like USD 150. It would be a great thing to pass around at parties with other Comp.Sci. students.
Well, I didn't spend the USD 150. Every now and then I regret it. As my link shows, it is still available, but my friends are different now; they don't see the absurdity / humor of it.
If I need a million integers, a generator would fit in a lot less space than 5.7 Mbytes.
(Btw: What makes a file of a million or so integers C#)? I'd think it was either binary or ASCII/ISO8859/UTF8, but neither is language dependent!)
|
|
|
|
|
It's a DFA state machine lexer for the C# language, so it's pretty expansive.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
At work they have Windows Explorer set to automatically traverse to a place that I rarely, if ever, need to access. Why?!?
It kind of drove me crazy, because I'd open Windows Explorer then click multiple drives & folders to finally end up in my UserProfile , because 99% of the time I needed to be there to save some data.
Life-Changing Shortcut I don't think I'm overstating this.
Anyways, one of the best things I've done for myself in a long time was simply
1. Create a shortcut that opens File Explorer directly into my %UserProfile% directory -- that's c:\users\<your-user-name>\
2. Add the following Target: C:\windows\explorer.exe %userprofile%
3. Add a shortcut key Ctrl + Shift + Right (arrow) to immediately run the shortcut.
Here's a snapshot of what the shortcut looks like[^].
Now, any time I want File Explorer I just Ctrl+Shift+Right(arrow) and it opens up.
Shortcut Seems Faster
Also, I've discovered that for some reason this copy of File Explorer seems to open faster than if you click the one on the TaskBar
(Maybe because this one doesn't have to hit the network since it is going directly to a specific path???)
I've been using this for months now it has provided many benefits:
1. Less folder clicking
2. Less screaming, "Why am I automatically navigated to this @#&%@#!!! network folder!!"
3. I used to be bald and all my hair grew back.
4. Previously I was 5'2" and now I'm 6'4" tall
5. A bag of money fell out of the sky and landed next to me.
6. Various other benefits which are too good to mention here.
|
|
|
|
|
Have you tried Win + R, . <enter>? In other words just type "." in the Windows run dialog. It is one key longer than your shortcut but there is no setup involved.
Mircea
|
|
|
|
|
That is very interesting and I just tried it.
However, that takes me to the preset location that the network admins force on us that we rarely use.
Actually, it does take us to %UserProfile% but it is the network one instead of the local drive one.
That's very interesting.
This may be related to the way the the admins set up SpecialFolders.
Thanks for the tip.
|
|
|
|
|
raddevus wrote: related to the way the the admins set up SpecialFolders That's why I never let any admin touch my machine. Needless to say, there has never been any love lost between me and admins. Luckily, I was the one writing the good code so they kind of needed me
Mircea
|
|
|
|
|
I just discovered that the path is named %HomeShare%
That's basically like %MyDocuments% but we don't use MyDocuments for whatever reason.
The point is that %HomeShare% takes me off box to the network share by default and my shortcut helps me to get to the actual local C:\users\<user-name> directory.
very interesting.
|
|
|
|
|
In my Quick Launch I have a shortcut to "This PC", which I prefer, I can get where I want from there. Also a shortcut to open a browser to "about:blank" because I never want to see the corporate website. Ever.
|
|
|
|
|
Those are two good ones.
I like using QuickLaunch for quick access to commonly used apps too.
It's a nice feature that I don't think a lot of people know about.
|
|
|
|
|
I think when Win 7 (or 10?) came out, people were saying that the Quick Launch was completely gone, but it isn't.
I also have shortcuts for starting Word and Excel empty -- no open document.
modified 24-Dec-23 14:21pm.
|
|
|
|
|
I believe in Windows 11 Quick Launch is no longer available?
If yes, how do I activate/use it? Thanks!
|
|
|
|
|
I have no Win 11 systems. In Win 10 and earlier, look for
C:\Users\<your name here>\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\
Maybe they've eliminated or changed the [ \Internet Explorer\ ] part?
|
|
|
|
|
It's gone on Win 11 unless you use a third party app (ExplorerPatcher). I'd still be on Win 10 without ExplorerPatcher.
|
|
|
|
|
So, what does ExplorerPatcher do? Create the directory?
|
|
|
|
|
It basically gives you the Win 10 taskbar in Win 11. You can then move the taskbar to the top, bottom or the sides. Gives you tool bars so you'll be able to enable Quick Launch, etc. It's basically indistinguishable for the standard Win 10 taskbar. I've been using it for months now and it appears to be working just fine. I also use Open Shell to replace the funky Win 11 start menu.
|
|
|
|
|
raddevus wrote: I've been using this for months now it has provided many benefits:
1. Less folder clicking
2. Less screaming, "Why am I automatically navigated to this @#&%@#!!! network folder!!"
3. I used to be bald and all my hair grew back.
4. Previously I was 5'2" and now I'm 6'4" tall
5. A bag of money fell out of the sky and landed next to me.
6. Various other benefits which are too good to mention here.
Sounds too good to be true 🤣
Paul Sanders.
If I had more time, I would have written a shorter letter - Blaise Pascal.
Some of my best work is in the undo buffer.
|
|
|
|
|
Hush! Let raddevus have their moment.
Software Zen: delete this;
|
|
|
|
|
I have always used this shortcut to open a specific folder:
C:\Windows\explorer.exe /n, /e, C:\SomeFolder
|
|
|
|
|
Very interesting.
Because of your post, I started searching for the windows explorer command-line options to see what /n and /e meant.
Those are very difficult to find. There is no : c:\> explorer /?
Only thing I could find was: https://superuser.com/questions/21394/explorer-command-line-switches[^]
Do you know of a way to get the available options?
modified 25-Oct-23 11:29am.
|
|
|
|