|
1 Memory Manager
Consider a system which is designed to be portable across platforms. Each platform provides a memory manager - i.e. each platform exposes functions equivalent to new and delete. The system under consideration wants to keep a platform-independent memory management scheme. Assume that the system under consideration is coded only using C++. Please describe the following:
1. Approach
2. C++ class declaration for the new memory manager
3. The memory management strategies (strategies you will follow if the system under consideration is a browser)
4. How would you make sure that all the classes in the system use your memory manager? Provide C++ code for the same. Assume that “new” operator is used if an dynamic object of a class has to be created.
can you please help me out with correct answers.
|
|
|
|
|
You are listing it again? Did they promises for really really true this time to stay out of the lounge if you did?
|
|
|
|
|
Oakman wrote: Did they promises for really really true this time to stay out of the lounge if you did
No, but now that it's listed it means
a) I can move messages there
b) people will (hopefully) be less likely to post material in the SoapBox that should be in the BackRoom
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
|
I guess we cant take it anywhere then I used to hear this a lot in the lounge "step out to the soapbox!"
On the bright side however, it was a box full of dirt!
So I'd say good move Chris!
|
|
|
|
|
There's always debate[^], complaints[^] and personal preferences as to whether passwords should be encrypted in a database and sent back to a user when it's requested, or whether it should be one-way hashed and 'reset link' (or similar) provided to those users who forget their password.
Over the years we've asked members what they wanted and the preference has changed from "Please send me my original password" to "Please don't send me my password". I, personally, prefer that I get my original password when I ask for it because
a) I hate having to write down or remember Yet Another Password.
b) I don't use the same password for CodeProject as I do for, say, my bank
c) I control my email box
d) Often sites that allow you to reset your password allow anyone to reset your password (meaning you get lots of links that don't work if someone hates you and abuses the system), or they ask you a 'security' question before sending the link. Frankly, everyone knows my Mother's Maiden name ("Mum" AND the name of my first pet ("Cuddles the Rabbit") so these questions, to me, are not very secure. And to be honest I just couldn't be bothered with the extra hassle.
This reasoning doesn't apply for all, and above and beyond these personal reasons of mine there is the simple fact that if you are going to look after personal information of your members you should do it properly.
So, as of today we no longer encrypt passwords, but instead we store them as a one-way hash. This means we can no longer send you your password when you ask for it.
However, I figured we needed to
a) Allow people to maintain their current password if at all possible, and
b) Protect the system from abuse
So when you request a new password, we send you a temporary password and still allow you to sign in with your old password. If you sign in with the temp password then your password becomes the temporary password, permanently. If you suddenly remember your old password and sign in with it, then the temporary password is removed.
Hopefully the best of both worlds with the added security that no one, not us, not you, not your nosy coworkers, will ever know your password.
|
|
|
|
|
Many of us are software developers which is why we mercilessly pillage the articles on CodeProject.com for code and components. However, as a developer I know that there are the rare occasions when I simply want to spend the money to buy a component in order to have the luxury of ringing up the vendor and hassling them for immediate support. The problem is: how do you know if a component is good and where is the good, up-to-date list of components?
In the spirit of "Let's just write one ourselves" we built catalog.codeproject.com[^]. For our members it's a chance to wander through a list of the best components from the top vendors, commenting and rating as they go. If you sell a component yourself then you can post your product into the catalog for free.
Anyone can post their product for free and if you want a little more exposure (fancy colour, image in the listing page) then there are paid upgrades available for those who wish. The main point, though, is that it's open to all CodeProject members regardless of whether you have a freeware product or you work for Microsoft.
It's a service for you guys. We hope you like it, hope you find it useful, and are always looking for suggestions and ideas for improvement.
|
|
|
|
|
A small change has been made to make the article moderation system less painful. Now, when an article receives a certain number of votes and has a certain score (currently 5 votes, 2.0 rating - but this will change) it will disappear from the moderation list entirely. Only admins and editors will be able to save it from a fate worse than being ignored.
cheers,
Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
|
tortoiseSVN support would be nice.
|
|
|
|
|
We have combined the CodeProject subsites - java.codeproject, sql.codeproject and lamp.codeproject - back into a single CodeProject.com site. No more divisions between developers. One site, one massive resource, one fantastic community whom we hope will behave themselves now that they have to share the same bathroom.
We created an incredibly powerful CMS that was able to split content, expose shared content, and seamlessly move to offsite content when necessary, and in the end we looked at this beautiful, shiny, purring piece of machinery and thought: yeah, but it's not how developers work.
With the way languages are evolving and merging and branching and cross pollinating it became clear that the old buckets we used to organise content with had to be thrown out.
I can use C# on Linux, and Java on Windows. Most of my time is spent fighting HTML, CSS and Javascript in ASP.NET yet the techniques I use are absolutely of value to a PHP developer on a Mac. On top of this I want to start writing Blackberry apps in Java, Windows clients in WPF and then iPhone apps in iC and I soon realised that I, personally, don't want multiple sites. I want one site, and I want to be able to filter the content to my language of the hour, while still having the chance to see the cool stuff that's coming through in other branches of development.
As a bonus to my selfish needs we think that the Java, LAMP and pure SQL stuff out there will now get a lot more exposure and, in turn, generate even more content in those flavours.
As a double bonus it also means we can provide pre-filtered Content Categories as times change. Instead of launching an iPhone site and then, 2 years later, having to abandon it because Palm OS has absolutely cornered the mobile market, we can simply add and remove categories as the times require, all the time keeping everything in one place and always accessible.
cheers,
Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
|
Creating an article is fairly easy, but maintaining it is far, far harder - especially if you've moved on or lost interest. Likewise, collaborating on an article with others can be difficult because authors come and go, and some are more, well, trustworthy than others. And then there's that whole thing with overwriting each others changes or someone deleting content that was actually kind of important.
Three updates we've released today address these issues:- Group Members. Member Accounts can be an individual member account (the standard) or a shared, Group account. A group account is like any other account except that it allows you to have other members perform actions on behalf of that group. The FAQ[^] explains it all.
- Article versioning. Each article now provides a link that allows you to view and compare previous versions of the article. Very handy for those collaborating on articles, as well as those looking to get more information than the usual 'History' comments.
- Article Edit locks. With Groups, we now have more of an issue with multiple authors. To fix this we've added article locks which provide you with exclusive edit access to your article for 20 mins, or until you submit your edits.
cheers,
Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
|
Outstanding!
You must be careful in the forest
Broken glass and rusty nails
If you're to bring back something for us
I have bullets for sale...
|
|
|
|
|
So what next? What do you want in version 1.1 SP1 CTP?
cheers,
Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
|
- The ability to quickly move forum posts.
- The ability to edit other people's forum posts.
---- You're right.
These facts that you've laid out totally contradict the wild ramblings that I pulled off the back of cornflakes packets .
|
|
|
|
|
1. Yes, for Gold members definitely
2. Under what circumstances? Same as the article 'throw to the community' idea? As in: if someone posts a poor question or a bad answer then we allow the community to edit and correct it?
cheers,
Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
|
Chris Maunder wrote: 2. Under what circumstances? Same as the article 'throw to the community' idea? As in: if someone posts a poor question or a bad answer then we allow the community to edit and correct it?
Well... No, i don't think that would work, at least not as the forums currently operate. Chances are, by the time any post worth saving has been thoroughly down-voted, it'll be out of sight - an edited question would merely be ignored, and anyone looking to edit an answer would have simply posted their own, corrected answer.
I'm tempted to say "any post can be edited by any (sufficiently privileged) user at any time"... this appeals to my desire to correct typos and remove grocer's apostrophe's, as well as my bright-eyed-optimist's notion that the vast majority of CPians would use it for good (or... just possibly... a rascally desire to abuse it in The Soapbox). I can think of a couple of compromises though:
- Yet Another Voting Option: vote-to-edit. After a sufficient number of "edit" votes, a post would enter "Mob Mode" - sig and username would disappear, anyone can edit for any reason at any time. I don't really care for this option much, as to be useful it would require Roving Bands of Good Samaritans trudging through the forums voting on, then cleaning up, poorly-phrased questions (and again, the barrier to entry is higher for editing an existing answer than just posting a new one, so why not just post a new one). A history + rollback feature would be pretty much essential to avoiding drive-by vandalism here.
- Assist-mode: any (sufficiently-privileged) user can edit any post at any time... After which, their name is listed next to the original authors (ex:
Re: Content Collaboration upgrades :bob:Chris Maunder (assisted by Shog9)
). A short history + rollback feature would be nice here just to get an idea of what editors were actually up to, but not absolutely necessary.
Semi-OT question for you: is there a way of keeping track of posts that move? So if i'm replying to a post in Web Dev and it gets moved to ASP.NET, my reply would follow it once i get around to actually submitting the forum? And... permalinks to a post in one forum would actually still be permanent in that they'd automatically take me to the post's new home?
---- You're right.
These facts that you've laid out totally contradict the wild ramblings that I pulled off the back of cornflakes packets .
|
|
|
|
|
Shog9 wrote: is there a way of keeping track of posts that move? So if i'm replying to a post in Web Dev and it gets moved to ASP.NET, my reply would follow it once i get around to actually submitting the forum? And... permalinks to a post in one forum would actually still be permanent in that they'd automatically take me to the post's new home?
I think the short answer is "yes". I will check though
cheers,
Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
|
Again most of the updates in the latest upgrade to the system (though I keep thinking of it as "The System") involves behind the scenes stuff that most of you will never notice or use but which will ensure everything stays working and doesn't go bump in the night.
Though we are now reporting the number of times an article is bookmarked. I know - we're getting a little crazy. We also moved the SQL category from the main C++/.NET site to a sub-site of its own because with over 1,800 database related articles we felt it was time.
Besides that we're still hard at work on:
- A new form of content. We'll it's a very old form with a new spin for us
- Our advertising system. Hey - it pays the bills and we want to ensure it's relevant to you guys
- A new service for the community
- More tweaks to the Job Board
- Lots and lots of work on performance and stability
- A lot of internal introspection as we re-question our basic architecture and design philosophy to ensure we're not doing anything obviously dumb.
cheers,
Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
|
Hi Chris,
First off, I wanted to thank you once again for help with article publishing.
On the topic of changes being done on CodeProject, I wonder what is being done about the rating system.
Rating system on CodeProject is the only thing that annoys me and many other publishers, because it is so biased, counterfeited and mainly not in any way objective.
I won't mention my articles this time, but as I browse through the fresh articles by other people I way too often wonder what is going on with the rating when a good article is getting 1 for it. Most importantly, the rating of 1 is given not in tandem with the general opinion, but way against it, which means that normally you won't see 2 and rarely 3 points for the article (mostly 5 and 4), but then some people seem to just love giving 1 to articles. Needless to mention, this is a hit in the balls for the author.
This is just one most recent article example that doesn’t deserve rating 1, yet it got plenty of it: http://www.codeproject.com/KB/aspnet/SoftArch5.aspx
If CodeProject is to be taken more seriously and prosper further, you guys must reconsider the rating system altogether.
These are the tips of what a good rating system is:
- A proper rating system will not allow giving an article a rating below average without providing a text explanation as to why the author thinks the article deserves the bad rating.
- Rating of any article must provide access to details about all the CodeProject accounts that gave the rating, so people see who gives a particular rating.
- A statement should be made visible, saying that if you think the article deserves rating below the current average (or just bad rating), try to contact the publisher before giving your rating.
- And a publisher must have the right and the way to enquire about a ridiculous rating to be reviewed, once the article's popularity reaches a certain level.
Items 1 and 3 are as done by EBay, for instance, while items 2 and 4 are essential for CodeProject.
I really hope that you guys make some changes there, for I do like publishing here and reading the website, I just want you to grow in the right direction and to be able to attract more talents who might also be very upset about CodeProject rating as it is today.
Regards,
Vitaly Tomilov
|
|
|
|
|
Hi Vitaly,
We (as a community) have discussed the rating system for many years and here's what the consensus boils down to:
1. It requires time to effectively provide a representative rating for an article. Statistically there will always be those who vote it up or down, but eventually the weight of legitimate votes will outwiegh spurious votes.
2. Forcing a comment with each vote will result in lots of "asdf" comments. You can't force someone to comment - you can only encourage
3. Exposing the identities of those who vote will lead to retaliatory voting
Item 3 in your list isn't applicable to CodeProject because where eBay is a 1:1 relationship per item, CodeProject is a 1 to many relationship so I'm not sure the "contact the author before voting" will work in the same instance (ie you're not trying to work out why a business transaction went wrong - you are just voting on how well you like an article)
I don't see how 4 will work given my point 3 above
Thanks for your comments, Vitaly.
cheers,
Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
|
Ok, Chris,
Having analyzed what you just said, I see how it can be improved avoiding all these problems:
Only when someone wants to give a vote below the current average he must provide a textual explanation that will be visible to the Article’s author. If such voter puts abra-cadabra into the comment, the Article Author once he saw it can mark it as “Invalid Vote, Staff Attention Required”. Somebody from CodeProject will review such votes, and if seen justified, the voter will lose a point for this and get a warning via email or something, while the vote will be removed.
What do you think?
Regards,
Vitaly
|
|
|
|
|
I'll say even more, such system will allow certain individuals who just like ruining other's work get some 3 points, and have their account removed for this.
This will clear your database from bad accounts like that
|
|
|
|
|
I have sent a bug report about GridCtrl:
error in CGridCtrl::InsertColumn()
Add the following 2 line in CGridCtrl::InsertColumn() in GridCtrl.cpp
m_nCols++;
//Start: New, Stephen Fuheng Yang, 2008.11.08
m_arColOrder.resize(m_nCols);
m_arColOrder[m_nCols-1] = m_nCols-1;
//End: Fuheng Yang
// Initialise column data
SetItemText(0, nColumn, strHeading);
Regards.
Stephen Fuheng Yang
|
|
|
|
|
|
One of the hardest things to do in software development is know when enough is enough. You can write code by looking at your immediate needs and then, every 5 minutes when you realise you need something else, extend the code. This produces wonderful spaghetti code. Or you can sit down and walk through all your possible scenarios that your code will ever need to deal with and design it to be infinitely flexible.
The correct approach is somewhere in between these two extremes: design it so that it covers all your business needs plus the future business needs to the extent to which you can predict, while ensuring, as opportunties present themselves, that you write your code flexibilty and generically enough so that if something unforeseen does come along it's not overly painful to adjust.
We have been working quite extensively on another feature that we've been looking to do for ever and have come up on this classic problem of where to stop designing and where to start coding. Fortunately our work has been made sigificantly easier by a design decision we made 2 years ago: Everything will be modular, everything will be database driven, and every item that we need to store and reference will be referred to by two simple IDs: its type ID and its unique ID within the set of objects within that type.
If we wish to add rating to a new object (say, a Widget) then we merely need to define a type ID for the Widget type, and then all widgets will have their own ID starting from 1. The rating module doesn't care if it's attaching ratings to Widgets or Gadgets or whatever. It just wants to know what object ID and Type ID it's storing a rating for and will do it. The same goes for forums, for bookmarks, for watches - for everything.
It was a simple and fairly trivial decision to make right at the beginning and, when we had almost no code written seemed overkill ("why not just have Article_Bookmark link tables?" "Why not store the rating row ID within the Article table?") but by abstracting out the entire notion of objects in our system and always working on the principle of "You do not, and should not, need to know any specifics about the object you are dealing with" it's meant that creating and plugging in new modules is seamless.
cheers,
Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
|
It's not so much that we're bored, but releases of new products and new technologies is quite common place now.
Way back in the year of the flood when I was given my first coding assignment I was handed a Dos 2.0 manual. No instructions. Just an alphabetical listing of Dos Commands. These were the days when the superintedent of your building was also a sysop for AOL and BBS's was the communication medium of the day.
Heck I remember when HyperLinks and WYSIWYG were hot new technologies!! These were the days when getting a 40MB (Yes, MEGAbyte) disk meant you had to partion it into two smaller disks because we were still waiting for Dos 4.0 to break the 32Megabyte barrier. Today, my father-in-law carries pen drive that's got 4 times the storage capacity of the Wang computers (Remember Wang?) I used to backup everynight.
We're not bored. It's just that the west has been discovered and has been settled. We've had our gold rush (dot coms) and now we're settling in and building a whole new civilation.
Remember, there was a time when only geeks (remember when geek was a bad thing?) new who Bill Gates was.
We've come a long way, and it may be some time before a new discovery is made that fundamentally challenges what we know computing to be. Anyone see my 5.25" floppy?
|
|
|
|
|