WhiZTiM's Posts
Nairaland Forum › WhiZTiM's Profile › WhiZTiM's Posts
1 2 3 4 5 6 7 8 9 10 (of 18 pages)
Awesome! Being broke is a sin ![]() |
3)Advanced Braking System (ABS)Ogbeni!! ABS stands for Antilock Braking System |
pachman:Haha! It shows growth na...Nonetheless, what's the status report currently? |
"There are two kinds of programming languages: the ones people complain about, and the ones nobody uses." - Prof. Bjarne Stroustrup (Designer and creator of the C++ programming language, and Director of Technology at Morgan Stanley) |
Ejiod:There are actually quite a few (I can mention 3) reasonably good C++ folks here. Mind you, there's no such language as "C/C++"... C++ used to strive for philosophical compatibility with C, but that ceased to be true long time ago. Recent C++ standards reflects that: C++11, C++14 and soon to be published C++17 |
Dude, we can guess good programmers by a lot clues. There's absolutely no clue on you being even remotely one. I went through your posts, and it seems your blood is hot, calm down � and polish yourself, your writing style (grammar and all...), then come back and advertise your craft... After then, we will push the folks disturbing on "learning programming" to you; and recommend you to others. I am serious. Take my post in good faith. I mean no offense. |
SBG04:Sir, with all due respect, are you an apprentice of our legendary Alh. lai Muhammad ? Why was there #OccupyNigeria protests in 2011?? Jonathan wasn't the best leader (sadly), we hoped Buhari will be better, but it turns out we were wrong(more depressing). We have liars and thieves in the government today. Buhari's cabinet of incompetent people are still sabotaging Nigerians. Though, I believe Oga Fashola is very competent compared to the leagues of Lalung of |
wao thanks man! i've been discouraged recently to make post cos i dont get any feedbacks, but you just gave me new inspiration! More Posts On The Way.Ok... I will be checking...! ![]() BTW, pls dont reserve your comments on the bugs on my code, i love being corrected, makes me smarter. i have more codes to post if you dont mind, i deal in AI and i'm trying to create a custom AI-ML. so i've got some pretty interesting code snippets we can brainstorm onOk.... Its a bit Mathematical... C++ treats its STL comparators with the concept of Strict Weak Ordering. This makes it possible to use a single comparator for A variety of things. For example. Using the strict Weak Order of < (less than operator). We can establish the following: - A < B; A is less than B - B < A; B is less than A - !(A < B); A is not less than B. Hence, A is greater than or equal to B - !(B < A); B is not less than A. Hence, B is greater than or equal to A - !(A < B) && !(B < A); A is neither less than B nor vice-versa, Hence A is equall to B -------- See how we were able to use one single operator to Cater for others? - A < B; equivalent to: A < B ; B > A - B < A; equivalent to: B < A ; A > B - !(A < B); equivalent to: A >= B ; B <= A - !(B < A); equivalent to: B >= A ; A <= B - !(A < B) && !(B < A); equivalent to: A == B With that knowledge, we can write a generic version of out Binary Search Algorithm. That takes a functor and makes comparison. Recall that the C++'s STL iterator concept uses the notion of One element past the end. Basically, the iterator produced for a range starts out with a closed interval and ends with an Open Interval. Hence, a range is defined as: [A, B) - The first element, A is inclusive; the last element, B is exclusive Armed with the above, we could write an iterative version of `binary_search`. Which has similar API with STL's version, but we return an iterator instead of a bool as per C++ STL version.: namespace tim{Example Usage: int main(){I haven't run serious tests for the above code though, so, I am still paranoid that there may be a bug lurking somewhere... ...lol Don't mind me... I write libraries, so I am very keen about performance, API intuitiveness and "being generic"... I also answer questions on Stackoverflow... |
Olyboy16:Yea... you should check the work he has been pushing out... "Design by Introspection". BTW, I like the design of your blog. Spent sometime on it. Glad to learn about the Python library "ShutIt". Great job man! |
Hey, calm down big guy! I wrote that code after over 2 years away from c++.I am calm... very calm... But look at the title of your post, "Fix This C++ Code If You Can (dare)!". Now down to the comments.Even if it worked, it would have been an Implementation Defined Behavior, according to ISO C++ standards... ...lol on the rehab process... Goodluck with it... Now just FTR, here is the actual code i wrote. The code is very very buggy... And the interface is ... comments reserved Bug spotted...just for PoC really. the result's half baked...lol. I know, like I said, I am only responding based on the title of your post. Maybe the title of your post betrays your original intent... I dunno... |
Olyboy16:Is that not Dr. Andrei Alexandrescu on your profile? ...The template goon... I picked up D lang cause of that guy.... |
Olyboy16:... Unfortunately, I don't think Your code is not salvageable... By any streak of luck :-( ... It would require a significant change hence rewrite Comments reserved on the code below...
Template Argument Deduction will not work here because none of the arguments depends on the template parameters. Even without Template Argument Deduction, I don't see any use of type `T` in the function-body below Umm, I don't see any #include <string> up there...template<typename T> Seriously? This function returns a `std::string` ![]() Oh boy....int size = hay->size(); Whaaaat?? For what? uninitialized pointer?? Even if `hay` was valid, the code below would invoke Undefined Behavior wanted to use std::copy_backward instead?
Below, doesn't make any sense... We are supposedly recursing with the exact parameters this function was called with?
Below, We are dealing with built in types here, they have bool operator == (T x, T y) defined for them by the compiler!! BTW `std::find` takes a ValueComparable type as the third argument... since you are using some sort of Unary Predicate, wanted to use `std::find_if` instead?
What ?
What kind of nonsense is the declaration of arr? std:: containers should be used as value types... A pointer to any std:: container is more like code smell... ..... Really? Any need to invent your functor here? std::sort uses std::less<T> by default, if you want in descending, why not simply use std::greater<int>? .. |
OfofoLagos1:Did you mean "break"? Or na mechanical system dey hungry you? |
Rewrote this on my blog... Found here: http://whiztim.com/Laymans-Explanation-To-Functions-And-Stack/ |
prinzfunchi:This is over two years now... I am sorry for not responding since ....#facepalm How's the C++ coming? Its two years now, you should prolly be a don by now ![]() |
It was, indeed a terrible accident... |
Good! E remain Daddy Freeze |
hmm @OP... You don't just blog or report numbers, add some charts, some graphs, some visual representation of those numbers..... No matter how small and insignificant your data may be, it's faster, easier and more convenient to understand charts... ...at least for the learned ones. This will set you apart, and give you a good reputation from other (mostly cheap) bloggers. |
Mescopaul:Yes sir, I believe there are. ---------------------- Just a side note: I suggest a specific language should be chosen. Not both of them. C and C++ are not the same language, neither are they similar. Yes, C++ used to strive nearly compatibility with C in terms of being C's superset. But that is no longer true. Newer C++ standards reflects that. |
Mad people "averywhere" ... Anyways, my response to the Slay Queen... Rosalin Meurer
|
Actually, not every man... There are men, and there are boys... Boys are threatened by a woman with bright future. Men are not, they we want someone with a vision, and is an achiever, but a good wife... |
But how is this news?
|
@Fepub Hmmn... there's no point going back and forth this. ...case closed. ![]() |
Febup:No ... No... No... Hell no!! Programmers know little about networking.... Now that said, I believe programmers actually know the some stuff... Which is mostly concerning the uppermost 3 or 4 components of the OSI networking model.... A Server infrastructure Programmers may be a domain expert within the Application, Presentation and Session layers... The Network Engineer should be at least very familiar with the Physical Bit, Data link, and Network layers. There may be a good deal of overlap in the transport layer. ------------------------------ Simply knowing IP, cabling, etc shouldn't qualify anyone to call himself a Network Engineer in my purview. I claim very little knowledge on Networking; so take me with a grain of salt ![]() (Image: courtesy of lifewire)
|
Here's my N1.25kobo rant: ====================== Is the language worth learning?Yes it is. Its a fantastic language. Virtually all major services you use daily has some C++ code sitting somewhere. From your internet systems, routers, web-services, down to your computing device. One thing about C++C++ doesn't give you performance as people claim. However, it gives you unfettered control over performance. So a badly written C++ will not be fast, period. However, a well crafted and highly fine tuned C++ program on a latest aggressively optimizing compiler is likely to produce the best you could get in terms of raw runtime performance. What lessons will I pick up during my C++ Journey- You will learn about absolute performance - You will learn about the Computer Architecture - You will learn how the CPU works - You will learn how to align code to memory lines - You will learn what makes Intel Core i3 7th generation series better than Intel Core i7 2nd generation - You will learn how the OS interacts with your programs. - You will learn to think forward - You will learn to take responsibility What are the prerequisite knowledge?None. There's no entry barrier. How difficult is it?It's one of the most powerful languages out there with some complexities that will take a while (a year or two) to master a lot of it. With enormous power comes a lot of responsibility, so, over the course of your career, you'll learn a lot of interesting stuff that will put you ahead of other programmers in terms of designing and implementing Performance-critical Systems. How long does it take to learn it?You can learn most parts of it within a year. If you are a novice to programming, you can start writing beautiful, elegant, scalable, maintainable infrastructure with it after about two years. As you would find in Google, Facebook, etc. Pro level expertise, about 4 years or more, from novice. Note, don't let this scare you off. Everyone that tells you he is a master of XYZ language after less than 2 years of lifetime programming experience is a liar. Programming is both Technical and Artistic. It takes years to develop a good combo of those skills. Note the emphasis on "lifetime" above. I am talking about new programmers. I want to improve my problem solving skills.The most prestigious programming contest in the world, the ACM-ICPC (Association of Computing Machinery - International Collegiate of Programming Contests) uses C++ as one of its two official languages. Given that you are in school now, you are eligible to participate. http://icpc.baylor.edu ..Do every thing you can to participate, you'll enjoy it. Learning the language isn't enough. You will also need to improve your problem solving skills. Algorithm, Data Structures, System Design. These can mostly be obtained by practicing problems on Hackerrank, LeetCode, etc. Or simply participating in ACM-ICPC a few times. Where can I get resourcesI strongly advice you to stick with the ones here: http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list Those have been curated by world class experts and some have the blessings from the who-is-who in the C++ world. Including my little blessings...lol. How modern is C++C++ has been existing in the industry for more than 30 years now. And has several billions of lines of Code working out there. It has also undergone growth. It evolves every 3 years now. And each evolution gets better, faster, and more modern. No matter what book or resource you pick, make sure it was produced/released of written after the year 2010. - We have an amazing version of the language known as C++11. Standardized in 2011 - We have a nicer version which I currently use for new projects, C++14. Standardized in 2014 - We have an upcoming one called C++17. To be standardized in few months time. - We will have another by 2020. And so on... It gets faster, better, and more beautiful each time. In C++, you only pay for what you use. The language never incurs any penalty on features or stuff you didn't use. After that, how do I stay ahead of the language's evolution?After you've gone through months following introductry texts and undergone some personal projects. You want to attempt answering questions on Stackoverflow. But still, you can go ahead and watch the video coverage of the proceedings from renowned C++ conferences such as: CppCon, CppNow, BoostCon, ACCU, MeetingCpp, NDC talks ...PS: You can search those on Youtube. Why shouldn't you learn C++?If you are lazy and hate challenges, and if you easily get depressed. |
fineboynl:Lazy punk. Getting rich by bet9ja? You gotta be kidding right? -------------- You don't need Jesus to make millions! There are earthly principles for that. Go figure it out! You need Jesus for a life. - And life, abundantly! ------------- |
danidon08:All hail the famous Geologist who detected oil in one of Nigeria's oil fields using only a Stethoscope to the ground... ![]()
|
I stopped going to their house three years ago because my daughter told her husband bad things about me, saying I didn’t encourage their union. .What kind of Hullabaloo is this?? -------------------------------------- “My daughter endured seven years of hardship and pain. When they started their relationship, I told her not to marry him, but she said she loved him.Everyday, I keep learning this lesson not to let "hearty emotions" to overshadow "predictive sense" .... We see evidences, but we say we love him/her?
|

It shows growth na...
..just ignore those issues. it wasn't even a working code anyway, just part of a c++ rehab process(playing around with containers and lambdas).

