As Promised, MemoryCache
I would like to introduce you to MemoryCache, my newly released NuGet .Net Package, offering easy access to a scalable, multi-threading capable In-Memory storage solution.
Basically, a .Net Cache.
MemoryCache, as with FakeModel, was created to solve a problem domain in something I was working on, ensuring no licensing or ownership issues would arise. I wanted a Lightweight, thread safe In-Memory cache to use, and now I have one. It wouldn’t be fair to keep it all to myself.
I will look to improve MemoryCache as time goes by, but currently I only have one plan for improvement, which is to offer a method of gathering statistics on the current state of MemoryCache.
As always, I’m open to suggestions. If you have any ideas on how I could improve MemoryCache, or even if you just want to know more about it or ask a specific question, feel free to get in touch using the normal channel, over on the Say Hello! page, it’s always nice to hear from you.
Family, Work, Life, Career Prospects, Birthdays, Anniversaries and personal projects.
I have a lot going on right now, so things aren’t getting done as fast as I was hoping. This post isn’t supposed to be happening, it’s supposed to be announcing version 0.0.6 of FakeModel, or version 1.0.0 of MemoryCache.
But alas, I haven’t got everything in place yet and I don’t want to rush anything that isn’t ready, so here’s a peak at what is heading this way.
FakeModel 0.0.6 Sneak Preview
The next update to FakeModel, hopefully not too far away, will see built-in handling for creating collections of fake data objects. This will be done by calling;
There will be more to it than that, a few additional options, but you’ll have to wait until the release for the full story!
MemoryCache Sneak Preview
I’m giving all the secrets away today.
MemoryCache is another personal project I have began working on today, but it’s not a massive project so will be released shortly as well.
A little bit of fine tuning and the creation of some documentation and this In-Memory Data Storage library will be ready to go.
Usage will look a little something like this;
MemoryCache.Store("ObjectKey", Object); MemoryCache.Get("ObjectKey");
But don’t tell anyone yet.
A little side note.
Although it happened back in December, it was nice to see an MVP, Darrel Norton, recommending one of my articles on Donut Caching;
Back on the beaten path
I have a lot going on right now, but I won’t be putting anything on hold, it’s just taking a little longer than I had hoped to get things finished.
Watch This Space!
Test Driven Development, TDD for short, is the concept of using automated tests to drive the design of an application. Test Driven Development relies on very small repetitive cycles of development, a juxtaposition to what is normally expected from development. Using Test Driven Development, we somewhat invert the development process, and we cover the Test part before any Development is done. It may sound whacky, but it works.
Well, they go something like this;
- A suite of unit tests can provide instant feedback as to the state of an application, just from being run
- Scope limitation. If something goes wrong, there is a small area that can be the reason the test is failing
- Once a test passes, and the code has been factored, that code can be considered complete
- Forces better analysis and understanding of a problem domain – A test cannot be created without knowing the desired result, which only comes from analysis and understanding of the problem domain
- Test Driven Development leads to a solid application design that is loosely coupled and easy to maintain.
- Tests act as a safety net and provide regression testing without any effort.*
- Time spent debugging is marginalised. (See *).
* If a bug is found, because this will still happen, a test should be created which replicates the steps taken when the bug occurred. This will reveal the cause of the bug, and production code can be modified to fix the bug. This should be done without causing any of the other unit tests to fail. Each test run then ensures each bug fix applied over the lifecycle of an application are still doing their jobs.
I was reading an article the other day about support for Windows XP and that the final strand ends in 2016. I was curious when reading the article where they get these support dates from, but a quick Google search later I had my answer.
Microsoft created and maintain the Microsoft Product Lifecycle Search on the Support website. This is the first I’ve ever known about it, but it seems it has been around for a while. A quick search for Windows XP gives us the following;
The longest running support for XP does end in 2016, for Windows XP Embedded. Support for all other versions will end on the 8th April of this very year. I wonder if we will see a mad dash towards windows 7 or 8, or if everyone will take a mild stroll to Vista.
Or perhaps nobody will do anything about it, and continue to use the unsupported windows XP for many years to come – Only time will tell.
I must say though, I like that Microsoft are pushing users towards Windows 8, but I’m thinking, if it took me this long to know that the Microsoft Product Lifecycle Search existed, is somebody still using Windows XP really going to be a visitor?
Upon graduation, or when moving out into a placement year, a lot of students feel they don’t really know what they are doing and that there is much more to the job than they think. This can be scary, it can make adequately or excellently skilled professionals feel like they are bottom-level staff who will never quite get what’s going on. But it really isn’t all that bad. Don’t get me wrong, real world development differs greatly from what you experience in University courses, but the one thing that never changes is the Syntax you learned.
I came across a situation today where an Out call would have been useful, or so I thought. I really wanted to right Out in the function parameters, to have multiple Function Return Values from a single function. It then got me looking back to a legacy function which used Out (I didn’t write it, it was like that when I got here!) to pass back two function return values. Then I headed over to another piece of code I know of, (Again, It wasn’t me!) which actually used three function return values. And this got me thinking, why do we use a base of a singular function return value? Continue Reading →
Today I was having a bit of a file clean-up. I have to do this from time to time as I end up with large amounts of test applications lying around, most of which end up useless but occasionally they do some good. Today I came across a simple Benchmarking function that I wrote a fair while ago. As far as Benchmark classes go, this is nothing overly spectacular, but it does the job to give the impression over which method is faster, so I thought I’d release it.
A lot of developers argue that measuring a functions time using a clock, watch or stop watch is a bad idea, generally because they say it doesn’t give accurate results. I may benchmark differently. The way I see it, if, as a user, I click a button and it takes 27 seconds to finish what I’m doing, that measurement is 27 seconds. And that’s how I benchmark my functions. I give them a fair go, I wouldn’t just run them once and say that will do, oh lord no, that would be a terrible idea. Generally, Ill let it run a thousand times and use the average as a result. If I’m comparing two methods, it’s as simple as the faster one wins (Assuming speed is the only factor, of course).
Konami made games, from 1986 they began using a Konami Code in those games. The Konami Code would unlock a secret, be it destroying the enemy ship (Gradius III) or, through a Konami Code variation, powering up the players ship (Also Gradius III)or giving the player multiple lives (Contra) … I won’t list them all, or the variations, or this would take far too long. Instead, you can look here.
The Konami Code began life as a cheat code, to offer players some flexibility with the gaming titles they had come to adore and love, but ultimately sucked at. The Konami Code isn’t limited to Konami games though, it has escalated across genre and platform through its rise to fame. The Konami Code can also be used to unlock secrets on the internet, Easter Eggs as they have come to be called.
Useful DBCC Commands
Happy New Year!
Here’s to hoping you enjoyed yours as much as I enjoyed mine.
I’ve decided to start the new year with the same theme I ended the old, and have brought to you a list of Database Command Console commands that may prove useful throughout your career.
When working with databases there are always going to be commonly used commands that you use on a daily or hourly basis. But when delving a little deeper, there are functions we need to run against databases from time to time which we don’t know so well, simply because we don’t use them often, which is why we keep lists of useful SQL commands.
This can more be the case for those of us who are playing DBA (Database Administrator). Working in a small in-house development team, within a manufacturing environment, we aren’t at luxury to have dedicated DBA’s and Server Managers, instead those duties fall within our small Software Team.
But we are good at it.
Our servers are managed correctly and are efficient, and we take good care of maintaining the multitude of databases that fall before us.
Being such a small team, it has proved difficult in the past to put standard procedures and protocols in place. Thankfully, we have been able to move towards this since I joined the team early this year. Since then we have paid more attention to Servers and Databases, insisting we take the time to manage our resources, which are limited, in the correct way.
Among the arsenal we take into battle on a daily basis are these Useful SQL Commands, which I have decided to share with you.
Ok, So Ill admit that you may see some T-SQL here, but you’ll forgive me for saying SQL in the title.