Saturday, 14 March 2015
Saturday, 19 March 2011
Self-Defense Techniques
It took me some time before I got to a stable and convenient backup system. I think I got there now. It’s hassle-free, complete and entirely automatic. This is the setup I use now for backup and synchronisation between all my portable gizmos.
1st level
Dropbox to synchronise my essential documents between
- home PC,
- 2 VAIO laptops,
- IPhone
- IPad.
I have less than 2 GB of essential documents so the free version of Dropbox is fine. I find the synchronisation very fast and more reliable than using the Windows offline files feature or Live Sync. This acts as a first form of backup since all files are saved on the Dropbox server by default. Dropbox files are always available offline under Windows. On the IPad/IPhone versions of Dropbox you must manually tick the files to make them available offline. By essential files I mean
- technical Books
- travel documents, flight tickets, travel insurance policy, conference tickets….
- Visual Studio projects
- OneNote files
2nd level
Daily incremental backup on an external hard drive of all documents on my D drive using the backup tool that comes with Windows 7. The drive is a 1TB Western Digital. This protects absolutely everything in case my main drives fail, which is a very likely occurrence.
3rd level
Off-site backup with Mozy, just in case my flat burns or I get burgled. This is an industrial-scale backup: documents, video, raw sound files, VM files, everything gets saved. I currently have 130GB saved on Mozy. At the time I bought the subscription, the backup size was unlimited. No matter how big a video is it will save it, it’s just a matter of time. It took me about one week to finish the initial backup. After that it does very quick daily automatic incremental backups.
I’m happy about this system so far, it’s entirely automatic and very exhaustive.
Wednesday, 29 April 2009
First Contact with DevExpress
- GridControl
- VGridControl
- PropertyGridControl
- TreeList
- If all you do is setting the DataSource then the control doesn't know anything about the data layer, which is good.
- However if you add columns from the designer (either manually or from a datasource) then you create a tight coupling with the data layer, which might be ok depending in the type of app you're creating. I find the designer is great for discovering functionality but when given a choice, it is better to write code: this avoids having the UI know too much about the data.
- Both theVGridControl and PropertyGridControl use reflection to display the properties of an object.
- For some reason PropertyGridControl works fine for public properties with exotic types (such as collections) while VerticalGridControl simply doesn't display collection properties -unless there is something I missed...
- The DemoCenter that comes with the DevExpress install
- The blonde and brunette from DevExpress TV
Monday, 17 November 2008
Using NUnit with native C++
NUnit was designed to be used with managed apps. So what?
All you need to do in order to test native code is create a C++/CLI project to host the test files. To link the test project to the native C++ project, simply add a configuration to the solution and call it ReleaseUnitTests for instance. This configuration will build the native C++ project as a static library as opposed to an executable. The C++/CLI test project links to this library and can call into any public method of the native project.
Job done! Who needs cppunit?
Detailed steps:
- Install NUnit.
- In Visual Studio Pro, create a native C++ project and call it CatHouse
- Add a class called Cat with a public method void Feed()
- Add another project to the solution: choose Visual C++ > CLR > Class Library and call it CatHouseTests. This will create a mixed assembly containing both native and managed code.
Add a C++ managed class called CatTest. Declare it public because we want it to be a managed type that can be seen by Nunit. Add a public method called TestFeed(). - Open CatHouseTests project properties, go to Common Properties > References and add the nunit.framework.dl assembly.
- In CatTests.h, add the line using namespace NUnit::Framework.
- Now you can add the [TestFixture] and [Test] attributes to the class and test method declarations respectively.
- By default the CatHouse project has a Debug and Release configurations. Add a new one called ReleaseUnitTests: in Build > Configuration Manager in the Active Solution Configuration drop-down, select New. In the dialog, type ReleaseUnitTests and in Copy settings from choose Release. Click OK. Now all projects have a configuration called ReleaseUnitTests.
Using Configuration Manager, ensure that the Debug and Release solution configurations build CatHouse only and not CatHouseTests. Ensure that ReleaseUnitTests builds both CatHouse and CatHouseTests, both having project configuration ReleaseUnitTests. - Open the properties of project CatHouse and in Configuration Properties > General, select Configuration ReleaseUnitTests. Change configuration type to Static Lib (that will make it possible to link all the content with the test program).
- Make CatHouseTests link to the .lib generated by CatHouse. In Project Properties of CatHouseTests, go to Common Properties > Add New Reference > Projects > CatHouse.
- Add a #include "Cat.h" in CatTest.cpp and change the project properties so that it knows where to find the include.
- In the TestFeed() method, instantiate a Cat object on the native stack and call its Feed() method.
- Build the solution in Release mode then in ReleaseUnitTests mode.
- In the NUnit GUI type Ctrl O, select the CatHouseTests.dll. The TestFeed test should appear in the tree view.
Monday, 3 November 2008
Sugar Sync
- your data is encrypted with AES, which is the least you should ask for, really.
- the really nice thing: it comes with a client that automatically syncs your PC folders with the remote storage.
- the sync works accross many PCs, which is cool as well.
- you can access your files online over the web.
- you can, and that's really convenient, send links to large files per email to other people. The recipient doesn't need to login to retrieve the file, he just clicks it. You get notified when he receives it.
Friday, 30 November 2007
Usefull Tools
- editor: Notepad2 (free)
- screen capture: Screen Hunter 5 (free for business use)
- secure FTP client: Core FTP LE (free for business use)
- refactoring for C++: Refactor! (free for business use)
- cheap Photoshop-like: Paint.NET (free)
- browse .NET assemblies: Reflector (free)
- Web Apps: http://www.dumblittleman.com/2008/12/21-excellent-web-apps-for-college.html