|
Don't be. It's frustrating, you spend time getting it looking right, leave the room for thirty seconds and when you return it's in kit form across the floor.
The crackers are a particular favourite - I think they make a nice noise when batted across the room - I've suggested we leave them off, but no, "it's a tradition" ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
OriginalGriff wrote: you spend time getting it looking right There is a right and a wrong way?!?!?
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- Never argue with a fool. Onlookers may not be able to tell the difference. Mark Twain
|
|
|
|
|
There is the Right Way, and the Man Way, just like with flower arrangement ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
TACIT?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Hmmm,
That was also the answer to the CCC he posted last night but subsequently deleted. He probably deleted it when he realized that he misspelled the clue component 'tactic'.
Best Wishes,
-David Delaune
|
|
|
|
|
can't get away with nuttin' around here...
|
|
|
|
|
ya
|
|
|
|
|
|
i got gplex working with Parsley and it's a joy because I don't have to use gplex's grotty input files directly - they're ugly but flexible - a bit like perl is.
now I can generate them from my simple, elegant XBNF format. Not only that, my generated code extends gplex lexers to implement IEnumerable<token> so you can for each over them just like you can with Rolex lexers. That also means they'll work with the backtracking enumerator I posted. And I added in Rolex's "block end" feature that makes it super easy to match things like C block comments, SGML/HTML/XML markup comments and CDATA sections, etc - anything with static multicharacter termination sequences.
I really rocked today. I got this code off the ground, and in some ways what it does is more complicated than Rolex, so it was almost like making a whole new lexer/tokenizer generator.
Not only that I got a new (unicode enabled!) Slang tokenizer up powered by Gplex and i intend to add backtracking to Parsley so it can parse C# (i hope!)
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.
|
|
|
|
|
When do you write Parsnip?
|
|
|
|
|
Maybe my next one. I am given to coming up with silly names for my code.
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.
|
|
|
|
|
Next, you need an Elvis Parsley
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
Going through 400 code files and finding empty catch blocks and fixing them ....
Try {
// Number of code lines
}
Catch (Exception exception){
// Nothing here. Exception is swallowed.
}
Highly paid consultants probably enjoying a holiday season somewhere...
Zen and the art of software maintenance : rm -rf *
Maths is like love : a simple idea but it can get complicated.
|
|
|
|
|
Regular Expressions
|
|
|
|
|
Ha, great minds and all.
OTOH, fools seldom differ either.
|
|
|
|
|
virang_21 wrote: Try {
// Number of code lines
}
Catch (Exception exception){
// Nothing here. Exception is swallowed.
}
Assuming that the code not wildly different than this, you could start with a simple regex replace with a blank string (PHP style, just use notepad++):
Try.*?Catch[^,;]*?\}
Update: I greatly simplified the regex ^-^, and also fixed a bug (the previous regex will match and erase any catch block that starts with a comment, but this one won't).
What does it do?
- If a catch block contains at least one semi-colon, then it's considered as a catch block with some valid code. Therefore, the entire try-catch is left alone.
- If a catch block does not contain a semi-colon, the catch is erased, along with the try block that preceeds it (regardless of what's within the try).
Note: The regex will replace EVERY invalid try-catch block depending on the path and file extension selected in your replace in files dialog, so backing up your code beforehand might be a good idea!
It should be fairly simple to modify to suit your needs if there's any difference.
It replaced everything with an empty string except for the last block in my test cases:
Try {
do stuff
more stuff
blah
}
Catch (Exception exception){
}
Try {
}
Catch (Exception exception){
}
Try {
}
Catch (Exception exception){
}
Try {
}
Catch (Exception exception){
int d = 3;
}
modified 22-Dec-19 22:41pm.
|
|
|
|
|
|
|
That's the first one I downloaded. The trouble is, it will not build without an existing binary because it generates itself.
They didn't bootstrap the distro with the necessary source files (which would be regenerated anyway)
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.
|
|
|
|
|
Reverse recursion.
There's a fitting punishment for that.
|
|
|
|
|
I think in many cases, using your code generator to build your code generator is fine, but bootstrap the damned build so the first build doesn't need the binaries. All it involves is including the most recent generated source files!
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.
|
|
|
|
|
A problem with that approach is when your code develops, and the first build can not be used anymore to build the last build. And then the first version is lost in a server crash.
I just wish I made this up.
|
|
|
|
|
First of all, if a server is bringing down your codebase, why aren't you using source control
second, just to be clear on my part, the most recent build is the one that builds the next build. And any time you modify a spec file it should trigger a rebuild. Those sources that are the result of that go into source control
once you set up the pre-build step it's cake.
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.
|
|
|
|
|
Trust me, I use version control. This wasn't first person experience.l
|
|
|
|