A PDF of a website I used to use in order to get my preferred theme in Sublime text to work. See attached.
C# Entity Framework snippets
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
using (MyEntities context = new MyEntities()) { // Query a collection IQueryable<MyThing> thingsQuery = from thing in context.Things where thing.Name == "Foo" select product; foreach (var t in thingsQuery) { DoSomethingWith(t); } // Delete an object context.DeleteObject(thingsQuery.First()); // Query for a single object, and process related objects var thing = context.Things.Include("Subthings").Where(o => o.ThingID.Equals("foo")).FirstOrDefault(); if (thing != null) { foreach (var subthing in thing.Subthings) DoSomethingWithSubthing(subthing); } // Save changes try { int count = context.SaveChanges(); } catch (OptimisticConcurrencyException) { context.Refresh(RefreshMode.ClientWins, things); context.SaveChanges(); } catch (UpdateException) { // ... } catch (InvalidOperationException) { // ... } } //Source: http://undefinedvalue.com/2012/07/11/entity-framework-cheatsheet |
Simple.Data.SQLite referencing wrong version [SOLVED]
I started to use Simple.Data.SQLite and would install through Nu-get and noticed Simple.Data tried to reference System.Data.SQLite version 1.0.91.0 while Nu-get would only install vserion 1.0.94.0
This would cause an error while trying to compile and it would fail.
The error would be described as below:
System.IO.FileLoadException: Could not load file or assembly ‘System.Data.SQLite, Version=1.0.91.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
SOLUTION
To fix this, I added an entry into the app.config file to point version 1.0.91.0 to the newer version 1.0.94.0
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> </configSections> <startup useLegacyV2RuntimeActivationPolicy="true"> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> </startup> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Data.SQLite" publicKeyToken="db937bc2d44ff139" /> <bindingRedirect oldVersion="1.0.91.0" newVersion="1.0.94.0"/> </dependentAssembly> </assemblyBinding> </runtime> </configuration> |
Difference between Object>Outline Stroke, Object>Expand, and Object>Compound Path/Make
Outline Stroke actually takes a stroke, and turns it into a filled path. For example, if you have a stroked path that’s 10mm long, and 1mm wide, you’ll get a filled path that’s 10mm x 1mm, with no stroke. It doesn’t create lines, it reduces strokes on objects to filled paths.
See: http://helpx.adobe.com/illustrator/using/painting-fills-strokes.html#convert_strokes_to_compound_paths
Expand doesn’t really ‘make the effect part of the object’. If you have a filled object with a stroke, it will turn the fill into a non-stroked simple path, and the stroke into a non-stroked compound path (see the Outline Stroke command). It reduces objects to more basic Illustrator objects.
See: http://helpx.adobe.com/illustrator/using/grouping-expanding-objects.html
The Expand Appearance command does the same, but with more complex effects. It reduced the appearance of the effect into more basic Illustrator objects. A drop shadow behind a square will become a raster object behind a simple path. A square warped with the Warp command will transform to a simple path whose outlines match those of the warped square. Expand Appearance is a destructive command that removes effects and the style of the original objects cannot be easily recreated without reapplying all the original effects.
A Compound Path is a set of paths combined into one object. It can be used with filled objects to ‘cut holes’ in objects. It can be achieved with the Pathfinder command, or using Ctrl+8/Cmd+8. See:http://helpx.adobe.com/illustrator/using/combining-objects.html
Source: http://www.reddit.com/r/illustrator/comments/2cu7zd/difference_between_objectoutline_stroke/
PHPStorm Live templates for PDO & PureCSS framework
Wanted to post Live Templates for phpStorm for PDO examples and for the quick PureCSS Framework ( http://purecss.io/ ) that I’ve created. I plan on updating the files as I add more to them.
PDO:
http://www.jmrowe.com/resources/livetemplates/PDO.xml
PureCSS:
http://www.jmrowe.com/resources/livetemplates/Pure.xml
Right-click the link to “Save link as..” and save in your .WebIde -> config -> templates folder to inspect/use the templates.