Both work....tangential question, which books in python did you guys read while starting? I have read only the official tutorial right now. I wanted to read a intermediate book to better understand the design principles, I have just started Fluent Python. What do you guys suggest? :)
beyond that if you are looking for software principles, design patterns. I would say step away from explicit Python-things and look at more design approaches in general.
@SachinfromPune mysql is like a naughty child. Tell them "collect your toys from the floor". They say "will do" - they understand what you mean by it - but then do nothing. The solution is to stop using such a childish database and use a mature solution such as PostgreSQL — Antti Haapala1 min ago
@idjaw what course would that be? I am not a systems guy. There are two courses in my university one called Programming Language and Translators and other called Design using C++. If possible can you tell me which is better fit?
C++ is Turing Complete so in principle it is sane if any single Turing Complete language exists that is sane, since you can just emulate that.
Your C++ program might be, like char[] actualProgram = "import sys; \n def f(): [...] print('Hello, World!');"; executeProgram(actualProgram), but as long as it works right
Template metaprogramming (TMP) is a metaprogramming technique in which templates are used by a compiler to generate temporary source code, which is merged by the compiler with the rest of the source code and then compiled. The output of these templates include compile-time constants, data structures, and complete functions. The use of templates can be thought of as compile-time execution. The technique is used by a number of languages, the best-known being C++, but also Curl, D, and XL.
Template metaprogramming was, in a sense, discovered accidentally.
Some other languages support similar, if not...
I want to ask "do people actually use nontrivial amounts of template metaprogramming in actual code, or is this an academic curiosity?" but "nontrivial" is ill-defined to the point that I don't think I'd get a straight answer
@Kevin, obviously stuff like Game of Life is just a curiosity, but TMP is a compile time language on types, so it's used heavily if you need to do complicated transformations on types
for example, Eigen, which uses TMP to vectorize operations so A = B * C + D, where those are all huge matrices, performs as fast as a hand written optimized loop
@Kevin Yakk loves doing pretty fancy stuff with templates. I don't see much of his work on SO because I don't follow the C++ tag, but he has posted many examples on the xkcd coding forum.
@MacSigler sorry: igniting a petroleum product in this room at zero-hundred hours will activate the fire suppression system and would seal off this entire room :)
My jimmies are going to be supremely rustled if this problem I've been working on for a week can be resolved by changing the value of a single dropdown that I've looked at but disregarded roughly ten times a day
@khajvah yeah, I didn't want to bog down chat with too much code; I didn't find any other questions with my exact issue so maybe I'll just open a question
> Developers coding in one of the 5 most popular languages (Java, C, C++, PHP, Ruby) are most likely to switch to Python with approx. 24% chance on average.
@AndrasDeak NAA might fly in the review queue, but if your computation requires all data to be in memory then FILE I/O operation can't help much here. in this case you need to break your code or task into small tasks and do iterative process for each small task do computation and save data to file. and then so on.. will probably be enough to get it declined in the mod queue
> Gelato is the Italian word for ice cream. It starts out with a similar custard base as ice cream, but has a higher proportion of milk and a lower proportion of cream and eggs (or no eggs at all).
@AndrasDeak sighs put a direct link to a review in the room and no-one acts on it... guess you're to have to hope people come across it naturally in the queue then :p
Oh, I don't mind voting in the queue, I'm probably not going to use 30 delv votes otherwise, it just doesn't make as much sense now that the threshold is 4 vs 6 votes.
I seem to remember a Meta post that figured out that you could use the API to make your votes always be "recommend deletion" even if you have delete votes left.
@davidism I suppose the only difference is that 4RD's can be self-undeleted by the answerer... if there's a proper delvote in there - they can't do that.
@davidism an answerer can self-undelete a post if they deleted it or it get deleted via recommended deletions in review. If it's deleted by 3 20kers, they can cast an undelete vote if they're able, but it still requires 2 more to effect the undelete.
Hmm by setting a value in a dropdown completely unrelated to the dropdown I was looking at before, I was able to execute the function that's been crashing for a week. It sort of makes sense why this fixes the problem, but the question still remains why this became a problem. Why it worked for ten years, then spontaneously stopped working a week ago.
Well I mean not "spontaneously" because I was refactoring code in that region of the code base, but it was all innocuous stuff that shouldn't have caused these cryptic runtime incompatibilities
Unless what I consider "innocuous" is actually quite nocuous despite appearances.
The crash occurs before my code even executes, so what my code does is immaterial compared to how it's structured.
If my code contains a lambda expression, it crashes before even getting to that line. If my code does not contain the lambda expression, the crash does not occur. So the problem has something to do with the parsing of the expression syntax and not its execution.
(this is in C# incidentally so it's double-plus incomprehensible that a parsing error would occur at runtime and not compile time)
Why yes, I do think it's odd that code on line 107 can cause an exception on line 102, after I have confirmed with 100% certainty that it's not a syntax error like "you missed a parenthesis".
Troubleshooting neophyte's problems on Stack Overflow has not prepared me for this. It's the difference between the municipal swim club and the vast and endless sea. There's no land in sight and something just brushed my foot.
This is rather elementary. You should try to write some code & post it here, otherwise your question is likely to collect some downvotes. — PM 2Ring3 mins ago
I suppose I could bribe every person that has the power to ask "why hasn't the WidgetViewer project updated recently?" but it would probably take more money than I could possibly earn in my lifetime
@AndrasDeak For typos and dupes, yeah. For homework-like questions with no code attempt by the OP I prefer to only give hints. But I guess a one-liner solution might be ok after the question's been put on hold.
Commenting on a hammered post to explain how the target applies to their specific problem is OK. Pointing out the exact typo in a typo-closed Q is OK. Taking pity on a Too Broad or Resource Rec Q and giving them what they want is of questionable morality similar to feeding a stray cat.
I try to comment/hint on pyparsing questions when I don't want to snipe rep from someone else who has worked up the gumption to post an answer answer using pyparsing (but no mercy for those posting "pyparsing, wut?! use this regex!" answers)
I don't comment answer on voted questions for closing or hold, I comment answer on questions that are open for others to take my comment and verify for me :D
I must admit that I sometimes post a partial answer as a hint in a comment when I'm about to write a FGITW answer. Sometimes it seems to discourage the competition, but sometimes it backfires, and someone else will write an answer that's consistent with my hint & submits it before I submit my own answer. But I guess the comment is evidence that I thought of the idea before they posted their answer. ;)
When I see a hint in a comment, I tend not to answer with the expectation that the commenter is working on a full answer, and has a head start on me. So you should leave hints in comments if you specifically want to avoid being Kevinned by me personally.
@vaultah Oh, I didn't know the results are out :( darn nvm sorry for bringing it up, if it makes you feel better you were one of the two I voted for :\