|
1. The lounge is for the CodeProject community to discuss things of interest to the community, and as a place for the whole community to participate. It is, first and foremost, a respectful meeting and discussion area for those wishing to discuss the life of a Software developer.
The #1 rule is: Be respectful of others, of the site, and of the community as a whole.
2. Technical discussions are welcome, but if you need specific programming question answered please use Quick Answers[^], or to discussion your programming problem in depth use the programming forums[^]. We encourage technical discussion, but this is a general discussion forum, not a programming Q&A forum. Posts will be moved or deleted if they fit better elsewhere.
3. No sys-admin, networking, "how do I setup XYZ" questions. For those use the SysAdmin[^] or Hardware and Devices[^] forums.
4. No politics (including enviro-politics[^]), no sex, no religion. This is a community for software development. There are plenty of other sites that are far more appropriate for these discussions.
5. Nothing Not Safe For Work, nothing you would not want your wife/husband, your girlfriend/boyfriend, your mother or your kid sister seeing on your screen.
6. Any personal attacks, any spam, any advertising, any trolling, or any abuse of the rules will result in your account being removed.
7. Not everyone's first language is English. Be understanding.
Please respect the community and respect each other. We are of many cultures so remember that. Don't assume others understand you are joking, don't belittle anyone for taking offense or being thin skinned.
We are a community for software developers. Leave the egos at the door.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
modified 16-Sep-19 9:31am.
|
|
|
|
|
Slang is kinda big, and build tools used in a pre-build step don't need DLL's to be dragged along with them.
But a slang enabled exe can be 350k easy in release mode.
So what I've done, is endeavored to remove
A) the startup processing time of a slang enabled code generator tool
B) the dependency of said tool on the large CodeDOM Go Kit (which includes Slang)
How I did it was I went meta, and I wrote code that generates code that generates code.
In this case, I can take all the work that slang requires and prebake it, because now I can serialize those code trees to arrays as code, so now I don't slang to reinstantiate them.
It's confusing to explain but easy to use.
So now i have this tool, Deslang. Basically you can precook all the work slang did into the code, add your dynamism by visiting that tree that got from Deslang as a prefab array (no slang required, just one visitor file) and add in your dynamic arrays or whatever that you wanted to generate.
Normally
Build Tool -> Slang -> Output
Now
Build Tool -> Precooked Slang -> Output
The latter runs a lot faster, and the build tool binary winds up a lot smaller because i don't need to include all the CodeDOM Go Kit source code.
Works perfectly for rolex, where 80% of what Slang is used for is easing maintenance - it's just static code, but it's written in slang just so it can be language agnostic and not force me to manually build a codedom.
Point is this is is clever. Rolex is 200k !! smaller and lightning fast now.
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 3hrs 20mins ago.
|
|
|
|
|
all that sounds very nice
but please tell us it's getting a new icon too!!
<< Signature removed due to multiple copyright violations >>
|
|
|
|
|
lopatir wrote: but please tell us it's getting a new icon too!!
We don't need no steenkin' icons!
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
Daniel Pfeffer wrote: We don't need no steenkin' icons! Yes you do! You've just used a double negative
"Five fruits and vegetables a day? What a joke!
Personally, after the third watermelon, I'm full."
|
|
|
|
|
Tripping through some older but still used C code, I found this section:
action a;
if ((a = hash_table[r]) && !cmdcmp(commands[--a].name, p)
|| (a = short_hash_table[r]) && !cmdcmp(commands[--a].short_name, p)) r = a;
else r = -1;
Somebody sure put a lot of faith that the order of evaluation, especially short-circuit evaluation, would remain the same across compilers!
Of course, the programmer saved a couple of characters by excluding four(?) unnecessary parens.
Upon further investigation, I found many instances of this type of statement structure. Apparently that was the preferred coding style. So, I'm guessing the programmer probably saved 100 characters. But it takes a lot of time to examine each statement and hopefully understand what is going on.
|
|
|
|
|
I hate that kind of stuff. I always add the redundant parenthesis because I want to be explicit about what is going on and I find it helps in deciphering the statement. I do NOT want to rely on the precedence order.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
Yup, I'm pro-parenthesis too. Real important in Regular Expressions as well.
|
|
|
|
|
caveat with parenthesis in regular expressions. Unfortunately, with some engines () creates an unavoidable capture (no way to turn it off unlike in PCRE or .net regex)
So if you're using like, Microsoft Visual Studio search and replace w/ regex (which i have to from time to time) it pays not to use extra parens. You're not maintaining that regex "code" anyway and the parens just make it so you have to keep advancing $1, $2, to $3 for each group and you only get 9 of them so it's maybe not the best idea to use extras.
I bring this up because 50% of the time i'm not tokenizing i'm using regex in something like a search box and the above applies.
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, sure, but with some rather complex ones which are hard-coded in a program.
The OR operator in particular causes me trouble, so I use parentheses, e.g. ((foo)|(bar))
And often with the Explicit Capture option.
.net's engine is so feature-rich.
I was working with SPLUNK over the summer and was stunned by the lack of flexibility in that engine (PCRE?).
|
|
|
|
|
I've never heard of splunk but i'm actually far more comfortable with the non-backtracking subset of regex - everything that can be boiled down to () | or *
That's because i mostly use them with tokenizing.
But honestly i've found if you need backtracking, regex might not be the best tool anyway, because it quickly becomes cumbersome with complex expressions.
In one of my fancier tokenizers i gave you ways to break up the regex into reusable bits if you liked to keep them manageable. I may or may not do that again but i never really used it. Some people hate regex tho.
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 once had a colleague who believed in obfuscating his C code to the maximum. He did not add comments to his code or any documentation of any kind. I believe he thought if he was the only one to understand his code, it provided a kind of job security.
All went well for him until I was promoted into a position where he reported to me. One of my first actions was to fire him.
|
|
|
|
|
|
In the name of the code-base, the style guidelines, and the future maintainers, we say - comment (And just name things well.)
|
|
|
|
|
Any employee who thinks he has "job security" should be summarily fired.
|
|
|
|
|
Hmmmm,
Looks like Sebastiano Vigna[^] wrote that code back in 1998 shortly after leaving Milano.
Best Wishes,
-David Delaune
|
|
|
|
|
I agree with you that the code is just a pain.
Quote: Somebody sure put a lot of faith that the order of evaluation, especially short-circuit evaluation, would remain the same across compilers!
I would. It better. If it's not, it's not C spec and the documentation better have that in big red flashing letters.
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.
|
|
|
|
|
Oh, ever hear of Caché? (The "database".)
Its not-quite-SQL language doesn't honor order-of-operations! (But it's faaaasssst!)
|
|
|
|
|
that seems kind of pointless. How can I tell what it's doing? oh never mind. it's just silly. i don't even want to know.
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.
|
|
|
|
|
After having received the anycubic mega-s and being really impressed with it, I found that I was wanting to rattle out maybe another small print, but the printer was busy doing something big, so basically tied up for the day (or over night). I started looking around for a 2nd smaller printer, one of these nano/mini ones that could print objects upto around 10cm cubed. The prices weren't far off the same price as my current printer, and by the time I added shipping to Cyprus, it just didn't make sense, so I didn't bother.....
Then I was in chat on a thread in Twitter, and someone posted a link to the printer I had already bought, on the manufacturers website and had mentioned the price, and I thought that it sounded slightly cheaper than normal and so out of curiosity I clicked the link and visited the site, and sure enough it was on sale $40 off. That is when I noticed they were having a pre-christmas sale.
I just started looking at all their models again, just because I was the site, and then I noticed their large Delta style Predator printer was reduced from $619 to $339 in the sale, but only available in Europe and Australia. I thought their shipping price to Cyprus would kill the savings. I added it to the basket and took it through the checkout process to see what they would charge for the shipping and well elephanting me it was FREE!
I really couldn't miss this, so paid with paypal and the exchange rate came out at 266ukp. So I consider this a birthday present to myself, seeing as that is next week!
Now, I knew this thing would be bigger than my current one, as the print volume is 370mm diameter by 455mm tall, but it wasn't until I looked at Youtube at the reviews that it really dawned on me how big.
I mean, it looks massive next to this guy....
Anycubic Predator 3D printer Review - YouTube
Good job I have a dead corner in the office at home that it can sit in!
Anyway, can't wait for it to arrive now, could job I'm heading home next week and it should be arriving around the same time.
|
|
|
|
|
Holy cr@p, that's big!
I'd have to remove stuff from my office just to get it in, and even then it'd be massive cat-bait unless I moved even more stuff out to give space for a box to put it in ...
Congrats on the free shipping though!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
As absolutely bitchin and "space age" 3d printing is. Compared to laser 2D printers it still seems primitive. Lots of plugging stuff and add on stuff to make it better. Reminds my of the early days of the personal computer like the Amiga heyday and the nerd clubs. I think someday we'll look back and snicker at the fiddlyness of it all.
Kick A$$ tugboats.
Toot toot!
|
|
|
|
|
Print me a cute lil car.
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 think it could manage this one:
cute lil car - Google Search[^]
M.D.V.
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.
|
|
|
|
|