| | Maybe I'm getting old but sometimes it would be nice not to keep on upgrading my software. I don't mean small incremental changes like upgrading software on a smart phone but major version changes like going from Office 2003 to Office 2010 (and Outlook Express to Outlook 2010), Visual Studio 2008 to 2010, a new distro of Ubuntu etc. It's probably just a programmer's state of mind; if I don't have the most current (and newest and perhaps buggy!) version, I just don't feel right. So I'll probably still be complaining about upgrading in 10 years time! Catch you next week... | | What is Memoization? A bit of a modern computing phrase this with recent popularity in some functional languages like Haskell. But it's not that complicated. Simply put memoization is an optimization technique used in functions so the first time the function is called for a given set of inputs, it calculates the result and caches it,, perhaps in an array. On subsequent calls of that function with the same inputs used earlier it returns the appropriate cached value. It's not actually new to C++ either. 12 years ago Paul McNamee at a computing facility of John Hopkins University extended automated memoization to C++. The idea being that some functional languages can provide automatic memoization without programmers writing an extra line of code. His code (it's C++ btw even though the file extensions are .c) does this. | C++ Optimization Question Revisited I've mentioned it before but WordPress on the iPhone/iPad has been continually improved and if you're into developing iPhone Apps is quite sophisticated. The same source code has been enhanced for the iPad as well. Study of the extensive source code (92 header files alone for the classes!) would probably teach more than a dozen books. With the Subversion client installed you can fetch the entire current source or view it online (same url) file by file. This is an App that lets you interact with a web server running WordPress and add new posts, edit comments etc to any WordPress blog, including photos. It has text management and editing, photo selection from the Camera Roll or using the Camera and resizing. Want to see how that's done? The code is all there. | How to Maintain Database Integrity Here's the problem. Databases are stored in files and disks fail sooner or later. Either that or applications crash halfway through writing them. Without any assistance, databases would get corrupted very quickly. It was difficult enough but manageable working with single user random access files as I did in the past but when you get multi-user database servers where data is being written and read at the same time then it needs careful design to avoid this situation. One method used is a journal. Before changing the database, the record to be changed is copied into a journal which is a separate file. The change is held in memory until some time when say the memory buffer is full or the database is told to commit changes. These changes are then written to disk and once complete, the journal file(s) are deleted. If anything went wrong during the write, the journal files get rewritten thus leaving the database in a consistent state. This description is very simplified. If you want to know the nitty gritty, then read about journaling which is how SQLite does it. Interestingly SQLite is just introducing WAL (Write Ahead Logging), an alternative method in the latest SQLite version 3.7. This is generally quicker and works better in a multi-user situation. | Never Programmed Before? Start Here Learn how to program computers as a living or just for recreational fun. Find out how to make a computer do what you want. | | | | C / C++ / C# Ads | | | | Featured Articles | | | | | More from About.com | | | | | | Plan a Unique Vegas Wedding The minister, music and champagne are just the beginning -- why not get married aboard a helicopter or have a pirate swing in to deliver your rings? Arrrr! More>
| | | | Join About.com's User Panel! Share your opinions and help us make About.com more relevant, informative and enjoyable to use. More>
| | | | | Sign up for more free newsletters on your favorite topics | | | | You are receiving this newsletter because you subscribed to the About C / C++ / C# newsletter. If you wish to change your email address or unsubscribe, please click here. About respects your privacy: Our Privacy Policy Contact Information: 249 West 17th Street New York, NY, 10011 © 2010 About.com | | | | | Must Reads | | Advertisement | |
No comments:
Post a Comment