Wednesday, January 29, 2014

ImageMagick

ImageMagick® is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 100) includingDPXEXR, GIF, JPEG, JPEG-2000, PDF, PNG, Postscript, SVG, and TIFF. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves.
The functionality of ImageMagick is typically utilized from the command line or you can use the features from programs written in your favorite language. Choose from these interfaces: G2F (Ada), MagickCore (C), MagickWand (C),ChMagick (Ch), ImageMagickObject (COM+), Magick++ (C++), JMagick(Java), L-Magick (Lisp), LuaNMagick (Neko/haXe), Magick.NET (.NET),PascalMagick (Pascal), PerlMagick (Perl), MagickWand for PHP (PHP),IMagick (PHP), PythonMagick (Python), RMagick (Ruby), or TclMagick(Tcl/TK). With a language interface, use ImageMagick to modify or create images dynamically and automagically.

ImageMagick is free software delivered as a ready-to-run binary distribution or as source code that you may use, copy, modify, and distribute in both open and proprietary applications. It is distributed under the Apache 2.0 license, approved by the OSI and recommended for use by the OSSCC.

Wednesday, January 22, 2014

Database Migrations in Entity Framework Code First

Enabling Migrations

Run the Enable-Migrations command in Package Manager Console

Generating & Running Migrations

Add-Migration migration_name

Update-Database –Verbose

Update-Database –TargetMigration: migration_name

If you want to roll all the way back to an empty database then you can use

Update-Database –TargetMigration: $InitialDatabase

Getting a SQL Script

Update-Database -Script -SourceMigration: $InitialDatabase -TargetMigration: migration_name



Automatically Upgrading on Application Startup (MigrateDatabaseToLatestVersion Initializer)

When we create an instance of this initializer we need to specify the context type (MyDbContext) and the migrations configuration (Configuration) - the migrations configuration is the class that got added to our Migrations folder when we enabled Migrations.

Database.SetInitializer(new MigrateDatabaseToLatestVersion<MyDbContext, Configuration>());



References:
http://msdn.microsoft.com/en-us/data/jj591621.aspx

Wednesday, January 15, 2014

Fixing Visual Studio connection to online galery

If you cannot connect to Visual Studio online gallery or online template and you get an error message like this:

Cannot search for online exensions because an error occured while trying to contact the server

Try adding the following to devenv.exe.config (in Common7\IDE folder):

<configuration>
<system.net>
<settings>
<servicePointManager expect100Continue="false" />
</settings>
</system.net>
</configuration>

http://stackoverflow.com/questions/2859148/cannot-connect-to…