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.
So either I do not understand how to distribute software using ZIP
Let's agree that you don't distribute software using ZIP. You might send it to a friend, on a very occasional basis but software distribution is done using other, more appropriate tools like NSIS or something similar.
End of lecture
The quick way I zip a tree is to right click on the root folder and "Send to -> Compressed (zipped) folder"
Thank you for informing me of NSIS Maybe it will come in handy However the purpose of my ZIP was to provide project files to Visual Studio support for the purpose of duplicating an apparent error in VS rather than the installation of executables which NSIS seems to be utilized for Thank you also for informing me I need not have purchased WinZip - Cheerio
I think there is a good answer elsewhere, but if you find yourself doing this repeatedly where you want to exclude sensitive data files, etc.
For extremely complicated inclusion and exclusion rules in a folder hierarchy, the very old Ant build <jar> and <fileset> tags let you build powerful inclusion and exclusion rule sets with recursion to build a jar/zip.
You can use macros or templates for standard cases to generate the filesets.
I was making a state removal method that would turn a state machine into a regular expression.
In the process I needed to do a subtask, to wit, I needed to set up a quick and dirty finite automaton engine to hold the states.
Rather than make a bunch of objects/states that point to other objects/states using dictionaries, I simply stored all the dictionary transitions as a single tuple (int from, int to, string input) in a flat list.
The result is smaller, and allows me to do complicated queries on the relationships between the states (now represented as simple integers) very simply.
In fact, the result is so good, I may be able to rewrite a more compact and efficient state engine using this technique. And it was originally just intended to be "just enough of a thing" to be scaffolding for my overarching algorithm to work with.
I'm elated. Even if the overarching algorithm doesn't work, it means far more compact and efficient code potentially in terms of the finite automata code it works with.
Sometimes it doesn't have to be completely right to work for a situation. Honestly I respect code that does just enough to do the job for a particular application - very efficiently. It's to my mind, one of the higher achievements in code such that if you can pull it off regularly you are way more clever than I. I have to respect it.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
I like the state machine setup that is basically an abstract/pure virtual super class where each possible input is a method that returns the next state. Each state is a concrete class that must implement all of the input methods.
It would likely take up more memory with vtables than your approach, but I like that it makes the introduction of a new input a compile time check on all of the states. Same if you add a new state; you have to define transitions for every input.
I prefer compile time checks, but I work on a memory hog of a system where we have that luxury.😊
In this way you dictate the state machine specs, it then creates an in memory digraph of the states, which it then does some transformations on before compiling into code, at which point *everything* is compiled - in this case into goto tables - one label for each state. Although it can also generate a table/array based matcher
Because of how that works, your solution actually doesn't actually fit that particular application (and this is how i most often use them). Because it goes spec->state-machine->code, not spec->coded-state-machine
Whenever I let the blessing of my intelligence go to my head, as happens from time to time - which makes me foolish as a result - I try to solve Arden's Theorem in code. It's readily doable. It's proven possible. A CS major could do it over lunch. I've been trying for years.
I've also tried to implement an alternative algorithm. It's equally frustrating.
But it reminds me that I don't know everything, and certain things may remain beyond my reach.
Part of me hopes I never solve it. It's a wonderful lesson in humility.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!