text:
25 Comments
Hooray for Kate Atkinson! As we've discussed before, I loved her crime fiction, but it's nothing to how much I loved this book and Behind the Scenes at the Museum. I do wish they got as much attention as the Brodie books–and I hope she returns to these kinds of books at some point.
First, I love the title Emotionally Weird. 😀
Second, I've never even heard of this author. What would you recommend for me to read? Not the mystery stuff though…
Both books you mentioned are totally new to me! thanks for the heads up.
I have posted a giveaway on my blog – a gift card sponsored by CSN Stores. Please come over and enter!
Ha ha ha, Steph, your final non-parenthetical sentence there turns your fangirly post into one of the most memorable of my year. Awesome ending! P.S. The book sounds good, too–almost forgot to tell you! 😀
"What else do you need to know?"
Not a thing. A deluge of effusiveness (when it's obviously sincere) gets me every time.
::heads for the "A"s, amongst which Emotionally Weird has sat, neglected, for too many years::
@ Teresa: I realize I'm completely the outlier in terms of not liking her crime fiction, but she more than makes up for that (in my eyes) with her non-crime stuff. I really hope she hasn't completely thrown over this type of writing for her Brodie series, because I NEED to read more books like this!
@ Amanda: It is a great title, isn't it? Of Atkinson's non-crime fiction, I've read this one and Behind the Scenes at the Museum and both were REALLY good. This one is definitely more experimental, while Museum is more of a family story about the women within a certain family, so I guess it depends what you're in the mood for. Maybe start with Museum because it was her first book? Either way, I don't think you can go wrong with Atkinson.
@ Mystica: You really need to try Atkinson; she's so smart and talented! More people need to read her!
@ Richard: Glad my effusiveness did not eclipse the book itself! 😉 I worried I crossed a line at the end, but clearly I have not alienated my readers!
@ BuriedInPrint: Sometimes when you love a book so much it's hard to not just write a blathering, personal post. I didn't even try to be objective this time, so I'm glad that people who haven't read the book were able to get something good from my babbling! I really hope you like Emotionally Weird!
Good point – I've only read the Jackson Brodie stuff. Not sure why, because I really like her writing!
@ rhapsody: Sometimes I think I should give her Brodie stuff another try because I like her other writing so much… but then I think of what a snoozefest I found Case Histories and decide I am better off just sticking to what I like!
@ Alex: I have read Museum and I really liked it and actually thought it had some lovely bits of writing so I am going to go up on a limb and agree that it was likely a bad translation you got. Maybe try it in English? Or just go for Emotionally Weird! So fun!
@ zibilee: I think because one of the big themes in Behind the Scenes is the sense of finding oneself and being alienated (so far as I can remember) maybe there is a necessary disconnection that occurs, though one would hope to feel connected to the main character. I do recall liking it, but I do think I liked this one a lot more so I'd say give it a go (especially because I found it quite different from Museum).
@ Stephanie: Yes, Atkinson's detective fiction seems to be her most popular, but I always feel like that's not who she really is as a writer. I personally found Case Histories pretty dull, but her other fiction I just can't put down! Regardless of what you try, you definitely must read something by her!
@ Sarah: While I'm prone to girl crushes, I completely stand by the end of my review! Since lately the book blogging world has been all in a tizzy about women not getting equal attention to men when it comes to writing, I figured I might as well emphasize that this is one writer with girl bits who is well worth reading!
I've only read Behind The Scenes At The Museum and forgot about it 2 minutes after finishing it. Honestly I can only remember that part of it was set in Edinburgh… or maybe not. What I suspect is that it was a really awful translation that sedated anything remotely creative in Atkinson's writing.
But Steph: I'm sold! I'll give her another try with Emotionally Weird 🙂
The only Atkinson I have ever read was Behind the Scenes at the Museum, and while there were some parts that I really loved, there was something about the book that gave me a little feeling of disconnection. Since reading it several years ago, I have often thought that it was just a case of the wrong book at the wrong time, and have been eager to give Atkinson another chance, but the only other books I have ever seen reviewed were the Brodie books, and those just didn't sound like my bag at all. All that being said, I am really glad to see this review, and am going to try to go for this book. I have a feeling that it will be met with much more success than the last one and I am very happy to see you were so thrilled with it. I always pay attention when you rave over books!
I have been meaning to read Kate Atkinson for a LONG time. I hadn't heard of this particular title, but I will definitely keep it in mind when picking out one of her books. Originally, I had planned to read Case Histories, only because that is the one I see around the most.
Dang, I haven't even registered this author. I feel like I've shelved her books during volunteering stints at my library, but haven't ever cracked a book open. You definitely have my attention now! And hehe, the end of your review is awesome. 🙂
For some reason I have associated her name to chick lit — maybe because of the chick-lit-resque covers. Having heard you recommend this book in person makes me change my mind.
I have a collection of her short fiction, which is supposed to be excellent. I'm not sure what has kept me from it except tons of other books waiting in the wings. I didn't even realize she wrote detective fiction!
@ matt: I'm pretty sure when I first picked up an Atkinson novel (her first) I wasn't entirely sure what to expect, but even if you suspect it might be chick-litish, the first few pages of her writing will likely cause all thoughts of that ilk to vanish. She's very good. If she chose to write chick lit, I'd probably read that too! 😉
@ verbivore: I picked up that collection of short fiction too! I didn't realize it was short fiction at the time, but I have no doubt it will be great. It sounds just a little left of center, which is the way I tend to like my short fiction!
Heh, I guess I'm one those vexing people who get excited about her crime novels 😀 I've tried Behind the Scenes at the Museum and couldn't get into it, but then I read the first Brodie book and felt much nicer toward her 😉 I might just try her other works again.
I need to read her again at some point. I didn't love Case Histories, although I seem to be in the minority on this one, and it sounds like I shouldn't give up on her. Perhaps I will love her non-crime fiction.
I agree with you about Kate Atkinson. I read this one some time ago and thought it was excellent, and I rate her Behind the Scenes at the Museum as superb. A great author who always satisfies.
A fine review too
I love the way you are all gushy over Atkinson because I love her writing too. I remember reading Behind the Scenes at the Museum and just being bowled over by her story and her writing which was so easy to read. I also like her mysteries so it's all good for me. I haven't read this one, but it's going on my wishlist especially since you've compared it to Our Tragic Universe. I love books like that: aimless and questioning and something that just transports you.
I need to try again with Atkinson. I've very much enjoyed her short stories, but wasn't keen on the Jackson Brodie series. Your review has made me want to read Emotionally Weird.
@ Bina: I don't get annoyed by people who like her crime books, I just don't consider myself one of them! I may try another of her Brodie novels some day!
@ Dorothy: I didn't love Case Histories either, so I think you may have much better luck with her other stuff; I vastly prefer it!
@ Tom C: Yes, Atkinson is awesome! I read Behind the Scenes at the Museum almost 5 years ago, so I feel like I'll need to re-read it soon! But first I'll probably read Human Croquet!
@ Nicola: I'm so glad to hear you enjoyed her short fiction as I inadvertently picked up that collection while at McKays (I didn't fully read the back cover so I didn't realize it wasn't a novel until I got home!). I would strongly suggest you try some of her non-crime fiction as I think you'd really like it!
@ Eva: Atkinson is an author that I often forget I love and then I read something by her and remember how awesome she is. Hopefully this post will serve as a more frequent reminder to us all!
I've read a couple of her books and loved them: I need to read the rest! 🙂
Love the last sentence of your review. I'm convinced!
"Why oh why don't more people read Kate Atkinson?"
I thought she only wrote detective fiction, which I really don't enjoy! Who knew she wrote other things? I kind of love the title "Emotionally Weird," as well as your description of the book. It's on my TBR list now, so even if I don't get to it right away, at least I won't forget about it!
[…] ever since. It's only fair I give her a second chance, especially after Steph's review of Emotionally Weird. What's your favorite by […]


text:
Tuesday, June 19, 2012
2nd Trailer For 'The Master' Surfaces; Includes First Look at Philip Seymour Hoffman & Amy Adams
We were damn grateful on May 21 when Paul finally decided to give us our first look at "The Master" in the form of a self-cut teaser trailer. But it looks like he isn't done yet as only a few weeks later, a second teaser trailer for his latest has surfaced on YouTube courtesy of "Al Rose Promotions." This one runs a few seconds shorter and features the same score as the first, but also gives us our first glimpse at Philip Seymour Hoffman's Lancaster Dodd a.k.a. The Master and his wife Mary Sue, played by Amy Adams. The clip is entitled "The Master - Hopelessly Inquisitive" and interesting to note that the title on the previous teaser has been updated to read "The Master - Was There A Fight?" Might we be getting a few more of these teases from Paul before October? Only time will tell.
Check out our Flickr page for hi-res stills from both teasers (perfect for your desktop wallpaper or Facebook cover photo). And though we've never been ones to fan the flames but feel we might be remiss if we didn't point out this.
Stay tuned to Twitter and Facebook for the latest news and updates.
14 comments:
What aspect ratio was the film shot in?ReplyDelete
It's interesting, as the last trailer had a few shots that looked like 2.35 bunch up to 1.85, but this one seems more naturally 1.85. Probably there is a lot of Post-Production to do yet, and this might be one of the aspects not yet tended to.
Joaquin looks amazing. I can't wait for this film. Shade of TWBB. The period, the music, etc...ReplyDelete
- AnonymousJune 19, 2012 at 12:46 PM
Love it!ReplyDelete
- AnonymousJune 19, 2012 at 12:56 PM
Does Philip Seymour Hoffman's fantastic delivery in this clip remind anyone else of Orson Welles?ReplyDelete
- AnonymousJune 19, 2012 at 1:10 PM
Given the 70mm format, the aspect ratio should theoretically be 2.20:1. It'll be interesting to see how it's projected.ReplyDelete
- AnonymousJune 19, 2012 at 2:52 PM
They removed the trailer for some reason, but now they've uploaded it again. I didn't see the trailer you linked, but I assume there's no change to it:ReplyDelete
This looks absolutely amazing!!! I can't wait to see this.ReplyDelete
it was removed due to a spelling mistakeReplyDelete
- AnonymousJune 19, 2012 at 7:58 PM
Does anyone know if there have been any photos posted from The Master filming in San Francisco? I was an extra on the set and they were taking a bunch of photos of us in costume and have been dying to see them.ReplyDelete
- AnonymousJune 19, 2012 at 8:58 PM
What was the spelling error?ReplyDelete
- AnonymousJune 20, 2012 at 3:17 AM
In the previous version it ended with 'Teh Master.'ReplyDelete
- AnonymousJune 22, 2012 at 10:09 PM
The spelling mistake was that they spelled Hoffman's name wrong LOL.. I didn't even noticed until someone pointed it out on Facebook.ReplyDelete

subset: commoncrawl


text:
Stop obsessing over HTML5 and CSS3 | Webdesigner Depot
As web designers, we all seem obsessed by HTML5 and CSS3 at the moment. Endless posts, tutorials and discussion about them dominate the blogosphere. But how much are we learning that can be applied today?Don't get me wrong. We all need to understand HTML5 and CSS3. And a lot of it can be used today. My point is that we seem to be spending a disproportionate about of time reading up on the subject when so many other areas deserve our attention.


text:
Saturday, March 26, 2011
It's Here...
My husband is a huge Apple fan. My friend Gretchen jokes that she is sure that someday she will drive by our house to find the Apple symbol hoisted up on our house as a homage to his beloved brand. For all of our married life we have had Apple products, and I honestly can't imagine not having a Mac for our computer(s). It took a lot of self control for Bryce not to buy the iPad when it was first released, but he does not like to buy the first generation of anything. But believe me when I tell you he was up very early to order this second generation ipad.
It has arrived.
And he is happy.
P.S. I really love the quote Bryce had inscribed on the back. It perfectly captures my thoughts on education!
5 comments:
- AnonymousMarch 26, 2011 at 11:01 PM
My husband is dying for one too. Not sure if he will be buying one though. That is awesome that you can get them inscribed. Great quote. he looks happier than a 5 year old on Christmas morning!ReplyDelete
Love the quote! I love Apple too but so mad at them for making me feel like my "old" Ipad is now obsolete. Congratulations...I am jealous :) Enjoy it they are awesome and good luck keeping the kids away from it.ReplyDelete
I love that quote!!!!Thanks!!!We love our old ipad!!! I can't wait to try the new one...but I am going to have to ....wait1 =) Enjoy!ReplyDelete
Will you be next??? You need one too! My iPad is the only way I make it through my daily workouts!!!!ReplyDelete
what are your favorite kid apps for ipad?ReplyDelete
Subscribe to: Post Comments (Atom)


text:
Ben Stars in Bishopsteignton Concert
October 17, 2013
Ben Gardner, from Bishopsteignton, is a very talented musician. Aged 14, he has already achieved Grade 8 piano and is currently working towards his Grade 8 viola. He attends Saturday masterclasses at The Royal Academy of Music where his talents are warmly encouraged. He successfully applied to The Helen Foundation for a bursary to help purchase a new viola, as his previous one was not of sufficient quality to able to progress to the very highest levels of playing to which he aspires. Ben is a truly dedicated musician. His family are hugely supportive of his efforts and his 16 year old sister Gemma is also a talented violinist.
Having received the support of the Foundation, Ben and his family decided to hold a concert in St John's Church, Bishopsteignton to help raise funds for the Foundation and to make a donation to the church. On Saturday 7th September, Ben and Gemma gave a splendid recital in the church to a highly appreciative audience. With assured and fluent playing, the two Garner children offered a wide repertoire from Bach to Irish jigs to the delight of the audience. At the interval, the family served tea and cakes – homemade by family and friends – and no one there could think of a better way to spend an afternoon of heavy downpours! The concert raised £200 for the Foundation.
Recent news
Doddiscombsleigh Primary School – Workshop & Doddi Art Show
November 9, 2019
THF Christmas Cards – Christmas Light – ON SALE NOW
November 9, 2019


text:
What Resources Do You Use to Supplement Your Child's Education?
Our children go to our local public schools which are wonderful. However, they are covering so much material and often, I feel like they don't have the chance to go deep on a...
Started by Benita on 11/17/2015 in Mom's With Educational Worries!
Last update on 01/14/2017 by Andrea


text:
You won't find a better bunch of guys or guides…
You won't find a better bunch of guys or guides…
Brett Jepsen
Brett is the Owner of Three Curl Outfitters and head guide. At a young age, he began hunting ducks at his family farm in Athens, Tx. and hasn't stopped chasing them since. There isn't anything that Brett enjoys more than hunting ducks, or preparing for a hunt. He prides himself on being able to take ducks at close range, and sharing the great outdoors with others, especially our youth waterfowlers.
Charles Spiegel
Charles, co-owner of Three Curl Outfitters, has had a true passion for the outdoors and the tradition of waterfowl hunting ever since he first picked up a gun. He prides himself on being a smart and ethical hunter, and enjoys sharing in the experience of duck hunting with others whether you're just starting out or a seasoned veteran. When it's not duck season Charles serves as Chairman of Arlington Ducks Unlimited and a member of the Ellis County Committee. You can rest assured that when you go hunting with Charles that he has done his homework and you will have a great experience.
Stephen Miley
Stephen is our lead guide and Manager of our Pig Hunting operation, and also runs dove and duck hunts during the fall. You can find him in the field seven days a week finding ways to make your hunt better. He grew up hunting the swamps of Louisiana, moving to Ellis County in his teenage years. Stephen bring years of experience to the team. 469-289-1HOG
Tom Brown
Tom began hunting as a youth on the plains of Western Kansas. He grew up and began guiding pheasant and quail hunts for family and friends. In 1984 his family started an Upland Guide Service, which his brother continues to operate today. Tom still enjoys going back to Kansas to hunt. He has also trained numerous hunting dogs for both upland bird and duck hunting. Since moving to Texas, Tom has become involved in the Ellis County Chapter of Ducks Unlimited and will be our lead guide for Upland hunts.
Luke Johnston
Luke is an avid young hunter that we are happy to have part of our team. He comes from a long history of farming and ranching in Ellis County, his family has been farming here for generations. Luke brings another aspect to the hunt as he knows the ins and outs of every inch of crop land around. We are happy to have him guiding our thermal hog hunts.
Corey Bradford
Corey is one of our key guides, running hog hunts, thermal hunts, duck and dove hunts year round. He comes from a rich hunting history in Mount Pleasant, Tx, and is by far one of our hardest working guides. If he doesn't get you on them, they just aren't there.
Matt Quate
Matt is one of the founders of Three Curl Outfitters and is by far the hardest working guide on our team. He spends countless hours building blinds, and scouting for ducks to ensure his clients are in the right place at the right time. Matt's famous quote during duck season is, "You can't stop time man, that stuff just goes."


text:
Discussion Starter • #1 •
I love to ride aggressively in the curves, but at the same time I don't like surprises in the middle of them, so I'd like to know what's the first thing that scrapes on an XC? From outward appearances it'll be the massive highway bars, which wouldn't be too forgiving and probably end up being quite expensive, and possible painful. My Roadking gave me ample warning with the floorboards hitting first, but I still knew I had about five more degrees of lean angle before anything "Hard" scraped. I'd really like to push the XC harder, especially since it seems to beg for it, but I don't cherish the idea of learning the hard way. Thanks.


text:
In my last post I explained why is useful to add base entity class in EF. Today I will write how with use of this base class an AutoMapped map collection of data objects (i.e. DTOs to existing collection of entities).
Problem with doing:
is that AutoMapper removes all entities from entity collection because data item mapped to entity has diffrent hash code and diffrent reference then original entity. Then when AutoMapper search for same item in original entity collection as mapped entity, it can not find one. That is causing AutoMapper to ads another one entity with the same Id as original, after removing original entity. Entity collection changed in that way cannot be saved to database, because EF complaints that removed entities has to be removed explicitly from database on commit.
To fix that problem we will use custom ValueResolver. To create one we will create class which will derive from IValueResolver available in AutoMapper assembly.
public interface IValueResolver
ResolutionResult Resolve(ResolutionResult source);
There is also available ValueResolver<T1,T2>:
public abstract class ValueResolver<TSource, TDestination> : IValueResolver
protected ValueResolver();
public ResolutionResult Resolve(ResolutionResult source);
protected abstract TDestination ResolveCore(TSource source);
But this class make available to override only ResolveCore method, which will be not sufficient since it does not have information about destination type of entity. Without this infomation wi wont be able to create generic resolver class. So instead this class we will use intrerface.
Our generic mapping class has to take two type parameters type of data object (DTO) and type of entity. Also ResolutionResult object of auto mapper mapping context does not have information of which source member is being mapped inside ValueResolver. This information has to be passed to. It is best to passed it as expression instead of a string, to make it less error prone. To make it possible we will add third type parameter which will be parent type of data object collection.
public class EntityCollectionValueResolver<TSourceParent, TSource, TDest> : IValueResolver
where TSource : DTOBase
where TDest : BaseEntity, new()
private Expression<Func<TSourceParent, ICollection>> sourceMember;
public EntityCollectionValueResolver(Expression<Func<TSourceParent, ICollection>> sourceMember)
this.sourceMember = sourceMember;
public ResolutionResult Resolve(ResolutionResult source)
//get source collection
var sourceCollection = ((TSourceParent)source.Value).GetPropertyValue(sourceMember);
//if we are mapping to existing collection of entities...
if (source.Context.DestinationValue != null)
var destinationCollection = (ICollection<TDest>)
//get entities collection parent
//get entities collection by member name defined in mapping profile
//delete entities that are not in source collection
var sourceIds = sourceCollection.Select(i => i.Id).ToList();
foreach (var item in destinationCollection.ToList())
if (!sourceIds.Contains(item.Id))
//map entities that are in source collection
foreach (var sourceItem in sourceCollection)
//if item is in destination collection...
var originalItem = destinationCollection.Where(o => o.Id == sourceItem.Id).SingleOrDefault();
if (originalItem != null)
//...map to existing item
//...or create new entity in collection
return source.New(destinationCollection, source.Context.DestinationType);
//we are mapping to new collection of entities...
//...then just create new collection
var value = new HashSet<TDest>();
//...and map every item from source collection
foreach (var item in sourceCollection)
//map item
//create new result mapping context
source = source.New(value, source.Context.DestinationType);
return source;
Expression of type Expression<Func<TSourceParent, ICollection>> help as to make sure that inside Resolve method we will get correct property without necessity of using existing object source or creating new one to pass in inside some lambda. GetPropertyValue method is extension of object type. It works by taking MamberExpression from our Expression<Func<TSourceParent, ICollection>>, and then property MamberExpression.Member.Name of source member. After that with source property name we can take its value with reflection:
public static TRet GetPropertyValue<TObj, TRet>(this TObj obj,
Expression<Func<TObj, TRet>> expression,
bool silent = false)
var propertyPath = ExpressionOperator.GetPropertyPath(expression);
var objType = obj.GetType();
var propertyValue = objType.GetProperty(propertyPath).GetValue(obj, null);
return propertyValue;
public static MemberExpression GetMemberExpression(Expression expression)
if (expression is MemberExpression)
return (MemberExpression)expression; } else if (expression is LambdaExpression) { var lambdaExpression = expression as LambdaExpression; if (lambdaExpression.Body is MemberExpression) { return (MemberExpression)lambdaExpression.Body; } else if (lambdaExpression.Body is UnaryExpression) { return ((MemberExpression)((UnaryExpression)lambdaExpression.Body).Operand); } } return null;}
Whole Resolve method is enclosed in if statement:
if (source.Context.DestinationValue != null)
this will ensure that we cover 2 case when we map data collection to existing collection of entities and to new collection of entities. Second case is inside else and is not complicated since it is simple mapping of all items inside collection. Interesting part is happening inside if and it is composed from three phases:
1. Deleting of entities
All entities from destination collection, that are not present inside our data collection, are being deleted. That prevents EF from throwing an error mentioned above. Entities and DTOs have both Ids, which are used to find which of items was deleted. This is where base entity class is useful since it has Id defined inside.
2. Mapping changed items.
If entity with the same Id as item in data collection has been found, it is being used as destination of mapping
3. Mapping of new (added) entities, as new objects.
This generic class then can be used as this inside AutoMapper profile:
.ForMember(o => o.DestinationCollection, m =>
m.ResolveUsing(new EntityCollectionValueResolver<
ParentDTO, SourceDTO, DestEntity>
(s => s.SourceCollection))
One more thing: this solution will cause StackOverflowException if SourceDTO to DestEntity mapping profile will try to map again ParenDTO -> ParentEntity, from ParentEntity property inside DestEntity. Usually child entities has reference to parent entities. If they are not ignored during mapping, AutoMapper will try do mapping: ParentDTO -> SourceCollection -> SourceDTO -> SourceEntity -> ParentDTO which will cause circular mapping.
Also this resolver will not cover case when Destination Collection is collection of derived items from parent item. For example when you have collection of people with students and teachers inside it, this will try to do mapping only for people. All derived types data will be ignored.
Unfortunately this will be not enough to map collection. Its because even items are removed collection, they are not set for deletion inside DbContext class. This will cause critical error in application during SaveChanges method in DbContext. To correct that issue we have to mark them for deletion from context class.
To do that there are 3 options:
1. Use context class inside EntityCollectionValueResolver class and mark deleted items for deletion. This is less elegant, but much more quick solution.
2. Use custom collection class which will mark deleted items for deletion using context class
3. Use custom collection class with items state tracking. This collection could subscribe an OnSaveChanges event of DBContext class in which event handler delete from context items deleted before from collection.
First and second options (maybe third too, it depends from implementation) will suffer from necessity to synchronize DbContext which will be used to save changes inside parent entity. Entity which was mapped from DTO. Also first solution is less elegant because is mixing AutoMapper and DbContext. Those two should live separately.
In this article I will show second option since third, which is better I think will involve changing of entities classes and repositories. It's to much for one article.
First, we have to acquire instance of context class. In my application I have IoC container which have single-for-thread instance of this class. This makes sure of synchronization of Context which loaded parent entity, deletes child entities and will save changes to parent entity.
At the beginning of the method Resolve we will add code that will return current instance of Context class (example with using Microsoft Patterns & Practices IServiceLocator implementation):
var context = ServiceLocator.GetInstance<DbContext>();
With this instance we can delete items from context:
if (!sourceIds.Contains(item.Id))
After that ObjectContextManager private property _entriesWithConceptualNulls, will have 0 items, which is good because any item in this collection will cause EF to throw critical error.
With breakpoint set after line with DeleteObject method call, you can see this collection with expression:
as like in the image:
This is whole body of Resolve method:
public ResolutionResult Resolve(ResolutionResult source)
var context = ServiceLocator.GetInstance<DbContext>();
//get source collection
var sourceCollection = ((TSourceParent)source.Value).GetPropertyValue(sourceMember);
//if we are mapping to existing collection of entities...
if (source.Context.DestinationValue != null)
var destinationCollection = (ICollection)
//get entities collection parent
//get entities collection by member name defined in mapping profile
//delete entities that are not in source collection
var sourceIds = sourceCollection.Select(i => i.Id).ToList();
foreach (var item in destinationCollection.ToList())
if (!sourceIds.Contains(item.Id))
//map entities that are in source collection
foreach (var sourceItem in sourceCollection)
//if item is in destination collection...
var originalItem = destinationCollection.Where(o => o.Id == sourceItem.Id).SingleOrDefault();
if (originalItem != null)
//...map to existing item
//...or create new entity in collection
return source.New(destinationCollection, source.Context.DestinationType);
//we are mapping to new collection of entities...
//...then just create new collection
var value = new HashSet();
//...and map every item from source collection
foreach (var item in sourceCollection)
//map item
//create new result mapping context
source = source.New(value, source.Context.DestinationType);
return source;
From now on after mapping from DTO to entity with automapper and saving mapped entity to database should work just fine.
That is all!
Entity Framework does great job with taking care of entities changes and entities collection internally. And its uses almost plain POCO objects. Almost because collections of dependents data like in 1 to many tables relationship needs virtual keyword. Its understandable since EF needs to track what happens to collection. For instance lets have 2 tables: Customer and dependent Order.
To map this relation in EF model we need to create two classes: Customer with relationship to Orders collection and Order with relationship to single Customer. Both end of relation needs to be virtual. Oh well. Actually they aren't have to be virtual, but as you can read here this allow for 'lazy loading' and 'change tracking' capabilities of EF, so its pretty useful to add virtual keywords in those places.
public partial class Customer
{ public int Id { get; set; }
public string Name { get; set; }
public virtual ICollection<Order> Orders { get; set; }
public partial class Order
{ public int Id { get; set; }
public virtual Customer Customer { get; set; }
That's pretty much it. There some rare cases when for example useful is to initialize collection of child entities on entity creation but its not requirement from EF point of view. So what could be the reason to add base class for entity?
Thing is that whenever you want to transfer entity to some another subsystem to make changes there, Entity Framework cannot and could not track those changes (you NEVER EVER should transfer entity object directly but map it to some other data object first!). Mapping data from entity to some data transfer object (DTO), making changes and returning them again to EF, will more likely fail. With simple object its achievable and should working, but it can spawn errors with collections mapping. In last application I was working that was the case. But I used EntityFramework.Patters extension so, in pure EF this can work fine (but I doubt it).
Root of the problem was Order collection in Customer entity. When I tried to transfer customer through i.e. WCF service, make changes at client side, and return them to EF, it caused EF to think that I deleted all items from Orders, and added some new instead. Its cool that it can tell that collection changed. To bad that this happens even when it not changed at all! To be frank EF wasn't entirely responsible it was mapping mechanism in AutoMapper. It wasn't considering two Order items with same values the same because they weren't referencing same object. After replacing old Order with new Order in AutoMapper, EF wasn't considering them equal for exactly same reason: reference to them was different.
How to remedy that? There have to be some custom mechanism of entities equality. And its best to that on some BaseEntity object, right?
public class BaseEntity : BaseEntity where TEntity : BaseEntity
private int? oldHashCode;
public override bool Equals(object obj)
if (obj == null)
return false;
if (obj == this)
return true;
if (obj is TEntity)
var objAsBaseEntity = obj as TEntity;
return objAsBaseEntity.Id == this.Id;
return false;
This implementation is partly based on MSDN Equals guidelines and on base entity class I have found for NHibernate. But is not enough. With Equals implementation we have to implement also GetHashCode. Problem with this is that, new entity should have whole time its exists the same hash code. More important hash code should be only dependent on Id property, which is only thing that allow two separate objects to be equal. So we need to make entity hash code dependent on id. But what about two new objects? They will have empty id and because of that the same hash code? One solution is to make hash code to be generated from base class when Id is empty.
public override int GetHashCode()
// once we have a hashcode we'll never change it
if (oldHashCode.HasValue)
return oldHashCode.Value;
// when this instance is new we use the base hash code
// and remember it, so an instance can NEVER change its
// hash code.
var thisIsNew = Id == Guid.Empty;
if (thisIsNew)
oldHashCode = base.GetHashCode();
return oldHashCode.Value;
return Id.GetHashCode();
When id is set, hash code is generated from it. When it is not set, hash code is generated from base class which is object in our case. And first time hash code is generated is final. Hash code cannot be changed. It is because it would brake functionality of HashSet and Dictionary classes. EF uses both of them so it would be big issue. It is best implementation I could find, and still it have some drawbacks. For example entity loaded from DB and mapped from outside of EF with the same data and the same Id will have different hash code. It is because in first situation hash code is generated from database id. In second situation hash code is generated from new object which have empty id. It does not matter that after hash code generation id is set to real value. Once it is generated it can not be changed.
To remedy that we need to make mapping of mapped entities and entities loaded from DB by hand. In next post I will explain how to make class that will resolve mapping of entities to correct this issue.
Last time I wrote about problem with testing Entity Framework in Visual Studio 2012. During working on this project I also encounter problems with configuration of Ninject to allow injecting Entity Framework classes from its Patterns extension. To be frankly this was not much a problem then lack of documentation. I just was forced to experiment with Ninject and new-thing-for-me Entity Framework Patterns extension.
So to make world of .NET a little easier I decided to write about my experience.
I started with this documentation for EF extension. It is instruction for someone that decided to use Unity in their project.
There is also link to similar instruction with Ninject IoC container, but its empty. Why authors of this extension decided to include in documentation of their project link to something that is empty eludes me. Oh well you have to make through with things you have. It should not be hard to translate Unity configuration syntax to its equivalent in Ninject.
public static class CompositionRoot
private static readonly IUnityContainer UnityContainer = new UnityContainer();
public static IUnityContainer Container { get { return UnityContainer; } }
public static void RegisterServices()
// Registering interfaces of Unit Of Work & Generic Repository
UnityContainer.RegisterType(typeof(IRepository<>), typeof(Repository<>));
UnityContainer.RegisterType(typeof(IUnitOfWork), typeof(UnitOfWork));
// Every time we ask for a EF context, we'll pass our own Context.
UnityContainer.RegisterType(typeof(DbContext), typeof(Context));
// Tricky part.
// Your repositories and unit of work must share the same DbContextAdapter, so we register an instance that will always be used
// on subsequente resolve.
// Note : you should not use ContainerControlledLifetimeManager when using ASP.NET or MVC
// and use a per request lifetime manager
UnityContainer.RegisterInstance(new DbContextAdapter(UnityContainer.Resolve()), new ContainerControlledLifetimeManager());
new InjectionFactory(con => con.Resolve())
new InjectionFactory(con => con.Resolve())
As you can see it is a little convoluted. That is one of reasons why I like Ninject more. It is cleaner.
Oh right. First lets create Ninject module:
public class InjectModule : NinjectModule
public override void Load()
Modules like that one are used by Ninject in following way:
var kernel = new StandardKernel();
Depending of where you are starting Ninject container it can look a little diffrent but idea is the same you are using modules for registering packs of types. Using that i created module for EF in EF assembly and that way it can be shared in my tests, services, console applications etc.
Now lets fill this new module with meaningfull code. Firstly we will register repository and unit of work interfaces:
Isn't that cleaner than Unity syntax? Next we need to register EF context class. It is as simple as:
Ofcourse DBEntities is your type of EF context class.
Now the harder part, a Unity 'tricky' registering of DBContextAdapter class. What we trying to do here is to make every instance of Repository and UnitOfWork, that is created by Ninject and is transient, created whenever necessary and then disposed, had to share same instance of DBContextAdapter. I decided to make this class single for thread scope. It is not ideal but is bult-in behavior of Ninject. In best case it should be shared for our whole application inlcuding spawned threads. Or for Web apps it could be better to use InRequestScope
To bind interfaces used by UnitOfWork an Repository classes, which allow them use context class indirectly through shared DBContextAdapter class, we have to bind those interfaces to shared instance of this class. To do that we register interfaces IObjectSetFactory (used by repository) and IObjectContext (used by UnitOfWork) with custom method that returns DBContextAdapter:
Bind<IObjectSetFactory, IObjectContext>()
.ToMethod(con =>con.Kernel.Get<DbContextAdapter>());
Whole module for configuration of EF will looks like this:
public class EFModule : NinjectModule{ public override void Load() { Bind(typeof(IRepository<>)) .To(typeof(Repository<>)); Bind<IUnitOfWork>().To<UnitOfWork>(); Bind<UnitOfWork>().ToSelf(); Bind<DbContext>().To<DBEntities>(); Bind<DbContextAdapter>().To<DbContextAdapter>().InThreadScope(); Bind<IObjectSetFactory, IObjectContext>() .ToMethod(con =>con.Kernel.Get<DbContextAdapter>()); }}
This is sufficient to make EF with Patterns extension working in our application.
this.kernel = new StandardKernel();
repository = kernel.Get<IRepository>();
var uow = kernel.Get<IUnitOfWork>();
repository.Insert(new Enity{});
This is it. Operation with UoW and repository pattern should work with EF.
Personally I am unhappy that this particular implementation of UnitOfWork does not implement IDisposable interface. This would greatly improve clarity of code as would be helpfull during maintaining of the code.
this.kernel = new StandardKernel();
repository = kernel.Get<IRepository>();
using(var uow = kernel.Get<IUnitOfWork>())
repository.Insert(new Enity{});
But you cant have everything
Yesterday I was trying to make work simple test class in VS2012. I did not know what was wrong exactly. It was first project when I tried to glue together Entity Framework with repository pattern and Ninject as IoC container. Because of the fact that this was first time for solution like that I was sure that it is me, or rather source of my problem was indeed my code. But let's not skip ahead.
So when I manage to translate adding EF classes to Unity from here: IoC : using EntityFramework.Patterns with Unity 2.1 into Ninject language. I got error like this from VS (when tried to running test case):
Result Message: Unable to create instance of class UnitTest. Error: System.IO.FileLoadException: Could not load file or assembly 'EntityFramework, Version=188.8.131.52, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040).Result StackTrace: at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType) at System.Signature..ctor(IRuntimeMethodInfo methodHandle, RuntimeType declaringType) at System.Reflection.RuntimeConstructorInfo.GetParametersNoCopy() at System.Reflection.RuntimeConstructorInfo.GetParameters() at Ninject.Injection.DynamicMethodInjectorFactory.EmitLoadMethodArguments(ILGenerator il, MethodBase targetMethod) in c:\Projects\Ninject\ninject\src\Ninject\Injection\DynamicMethodInjectorFactory.cs:line 115 at Ninject.Injection.DynamicMethodInjectorFactory.Create(ConstructorInfo constructor) in c:\Projects\Ninject\ninject\src\Ninject\Injection\DynamicMethodInjectorFactory.cs:line 40 at Ninject.Planning.Strategies.ConstructorReflectionStrategy.Execute(IPlan plan) in c:\Projects\Ninject\ninject\src\Ninject\Planning\Strategies\ConstructorReflectionStrategy.cs:line 67 at Ninject.Planning.Planner.<>c__DisplayClass1.<CreateNewPlan>b__0(IPlanningStrategy s) in c:\Projects\Ninject\ninject\src\Ninject\Planning\Planner.cs:line 109 at Ninject.Infrastructure.Language.ExtensionsForIEnumerableOfT.Map[T](IEnumerable`1 series, Action`1 action) in c:\Projects\Ninject\ninject\src\Ninject\Infrastructure\Language\ExtensionsForIEnumerableOfT.cs:line 32 at Ninject.Planning.Planner.CreateNewPlan(Type type) in c:\Projects\Ninject\ninject\src\Ninject\Planning\Planner.cs:line 109 at Ninject.Planning.Planner.GetPlan(Type type) in c:\Projects\Ninject\ninject\src\Ninject\Planning\Planner.cs:line 71 at Ninject.Activation.Providers.StandardProvider.Create(IContext context) in c:\Projects\Ninject\ninject\src\Ninject\Activation\Providers\StandardProvider.cs:line 77 at Ninject.Activation.Context.Resolve() in c:\Projects\Ninject\ninject\src\Ninject\Activation\Context.cs:line 157 at Ninject.KernelBase.<>c__DisplayClass10.<Resolve>b__c(IBinding binding) in c:\Projects\Ninject\ninject\src\Ninject\KernelBase.cs:line 386 at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext() at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source) at Ninject.Planning.Targets.Target`1.GetValue(Type service, IContext parent) in c:\Projects\Ninject\ninject\src\Ninject\Planning\Targets\Target.cs:line 197 at Ninject.Planning.Targets.Target`1.ResolveWithin(IContext parent) in c:\Projects\Ninject\ninject\src\Ninject\Planning\Targets\Target.cs:line 165 at Ninject.Activation.Providers.StandardProvider.GetValue(IContext context, ITarget target) in c:\Projects\Ninject\ninject\src\Ninject\Activation\Providers\StandardProvider.cs:line 114 at Ninject.Activation.Providers.StandardProvider.<>c__DisplayClass4.<Create>b__2(ITarget target) in c:\Projects\Ninject\ninject\src\Ninject\Activation\Providers\StandardProvider.cs:line 96 at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext() at System.Linq.Buffer`1..ctor(IEnumerable`1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source) at Ninject.Activation.Providers.StandardProvider.Create(IContext context) in c:\Projects\Ninject\ninject\src\Ninject\Activation\Providers\StandardProvider.cs:line 96 at Ninject.Activation.Context.Resolve() in c:\Projects\Ninject\ninject\src\Ninject\Activation\Context.cs:line 157 at Ninject.KernelBase.<>c__DisplayClass10.<Resolve>b__c(IBinding binding) in c:\Projects\Ninject\ninject\src\Ninject\KernelBase.cs:line 386 at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext() at System.Linq.Enumerable.<CastIterator>d__b1`1.MoveNext() at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source) at Ninject.ResolutionExtensions.Get[T](IResolutionRoot root, IParameter[] parameters) in c:\Projects\Ninject\ninject\src\Ninject\Syntax\ResolutionExtensions.cs:line 37 at UnitTest..ctor()
So my first thought was: heck, I probably did something wrong and it not so easy (Ninject registrations of components is really easy, you should try yourself). But I cannot find any references to that version of EF anywhere in my project. In fact I did not added them myself, everything was done by NuGet, so it should work, right? Yes. It should and it was working because:
1. Registration of classes from EntityFramework.dll was working perfectly.
2. Registration of classes from EntityFramework.Pattersn.dll was not working at all.
3. When I added console project registration of both types from both assemblies was working without problems.
So the problem was with EntityFramework.Patterns.dll, its internal reference to older version of EF (I was using 5.0 version). Another problem was with assembly redirecting from older version of EF to newer 5.0. In console project section in app.config:
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-188.8.131.52" newVersion="188.8.131.52" />
was doing what it suppose to, forcing application to use 5.0 version despite internal reference to version 4.3.1 inside EntityFramework.Patterns.dll. So maybe in test it is not present. Nope it was. Maybe configuration is not copied into Debug dir? Nope. Maybe it is named wrong? Nope. In this moment I had to take a few minutes off.
I was thinking: everything is as it suppose to. Assemblies, references, redirecting, configuration. So... maybe test environment is not starting correctly? Maybe it is ignoring that part of app.config. When I was adding NuGet packages same day I noticed update for VS. Why not tried that? Few clicks, about 1 hour and restart of VS after I tried again. Guess what? It worked!
So it was bug with VisualStudio. I was glad that it was over and little disappointed for few hours that I have lost. But it was at least one step closer in the right direction.
So if you encounter problem like that tried update VS 2012 with Update 2. It should work!
I will use for that changed code from Minimum length WebGL code to draw least meaningful output - A straight line. What I changed was just removing of few unnecessary lines and putting all uninteresting boilerplate code into functions. First, initGl, initializes WebGl context from canvas tag. Second, initShaders, creates shaders program and initializes it with location of uniforms and attributes. Next initializes scene by clearing plane, creates model-view matrix and perspective matrix. I changed those matrices to those, which I think will help to understand line points coordinates, because Z axis is orthogonal to screen, so point (-1,-1,0) will actually at bottom-left part of canvas. To put it simple: scene viewer and you will look from the same point (more or less of course ). Model view matrix will also translates all Z coordinates by -7, so points with Z = 0, will be visible. Now code:
<script type="text/javascript">
var fragShaderSource = "\
precision highp float;\
uniform vec4 u_color;\
void main(void) {\
gl_FragColor = u_color;\
var vtxShaderSource = "\
attribute vec3 a_position;\
uniform vec4 u_color;\
uniform mat4 u_mvMatrix;\
uniform mat4 u_pMatrix;\
void main(void) {\
gl_Position = u_pMatrix * u_mvMatrix * vec4(a_position, 1.0);\
function get_shader(type, source) {
var shader = gl.createShader(type);
gl.shaderSource(shader, source);
return shader;
var gl, pMatrix, mvMatrix, vbuf,ibuf;
function initGl() {
var canvas = document.getElementsByTagName('canvas')[0];
gl = canvas.getContext("experimental-webgl", { antialias: true });
gl.viewport(0, 0, canvas.width, canvas.height);
function initShaders() {
var vertexShader = get_shader(gl.VERTEX_SHADER, vtxShaderSource);
var fragmentShader = get_shader(gl.FRAGMENT_SHADER, fragShaderSource);
shaderProgram = gl.createProgram();
gl.attachShader(shaderProgram, vertexShader);
gl.attachShader(shaderProgram, fragmentShader);
shaderProgram.aposAttrib = gl.getAttribLocation(shaderProgram, "a_position");
shaderProgram.colorUniform = gl.getUniformLocation(shaderProgram, "u_color");
shaderProgram.pMUniform = gl.getUniformLocation(shaderProgram, "u_pMatrix");
shaderProgram.mvMUniform = gl.getUniformLocation(shaderProgram, "u_mvMatrix");
function initScene() {
gl.clearColor(0.0, 0.0, 0.0, 0.0);
mvMatrix =
[1, 0, 0, 0
, 0, 1, 0.00009999999747378752, 0,
0, -0.00009999999747378752, 1, 0,
0, 1.3552527156068805e-20, -8, 1];
pMatrix =
[2.4142136573791504, 0, 0, 0,
0, 2.4142136573791504, 0, 0,
0, 0, -1.0020020008087158, -1,
0, 0, -0.20020020008087158, 0];
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
gl.uniformMatrix4fv(shaderProgram.pMUniform, false, new Float32Array(pMatrix));
gl.uniformMatrix4fv(shaderProgram.mvMUniform, false, new Float32Array(mvMatrix));
function initBuffer(glELEMENT_ARRAY_BUFFER, data) {
var buf = gl.createBuffer();
gl.bindBuffer(glELEMENT_ARRAY_BUFFER, buf);
gl.bufferData(glELEMENT_ARRAY_BUFFER, data, gl.STATIC_DRAW);
return buf;
function initBuffers(vtx, idx) {
vbuf = initBuffer(gl.ARRAY_BUFFER, vtx);
ibuf = initBuffer(gl.ELEMENT_ARRAY_BUFFER, idx);
gl.vertexAttribPointer(shaderProgram.aposAttrib, 3, gl.FLOAT, false, 0, 0);
function unbindBuffers() {
gl.bindBuffer(gl.ARRAY_BUFFER, null);
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);
function onready() {
var vtx = new Float32Array(
[-1.0, -5.0, -5.0,
5.0, 5.0, 5.0]
var idx = new Uint16Array([0, 1]);
initBuffers(vtx, idx);
gl.uniform4f(shaderProgram.colorUniform, 0, 0, 0, 1);
gl.drawElements(gl.LINES, 2, gl.UNSIGNED_SHORT, 0);
<body onload="onready();">
<canvas width="400" height="300"></canvas>
As you can see code necessary to draw a line is put inside //# in onready function. What that code does? First is array of 6 numbers representing 2 points with 3 coordinates (X,Y,Z). Second array is just indexes for points from first array. We want draw line from first and second point so it is just 2 numbers: 0 and 1. After initializing buffers with those arrays, we are defining width of our line. Next is defined color of our line and lined is drawed to scene. Pretty straightforward. It will give something like in image below.
Live example and code for this you can get here.
What we can change in this code?
First color. It is just rgba format in range from 0.0 to 1.0. You can also add more points to draw now single line but whole path. Great! What about width of line? This is sadly not working how you would want it to. In mozilla you can set whatever value you want and width still be constant. Why?
Answers can be found in OpenGL ES specification:
"There is a range of supported line widths. Only width 1 is guaranteed to be supported; others depend on the implementation. To query the range of supported widths, call glGet with argument GL_ALIASED_LINE_WIDTH_RANGE"
So if you are in browser development just implement line with width = 1 and you are done. Not very helpfull. So if you are looking into using this part of WebGL extensively I bet you will write your own library for lines anyway.
Just out of curiosity I have tried to 'query range' of available widths:
gl.getParameter( gl.ALIASED_LINE_WIDTH_RANGE)
and not for big suprise I got this:
Normally canvas 2D context is using custom coordinate transform where Y coordinates are flipped vertically. Here is image with example (taken from http://diveintohtml5.info/canvas.html; it is great book and you should read it )
It is a bit inconvinient to use if you are drawing some shapes with points given in classic Cartezian coordinate system.
It is convienient that we can change it with setTransform function of canvas context object. How? It is pretty easy:
__context.setTransform(1, 0, 0, -1, 0, currentHeight);
where __context is canvas context and currentHeight is actual height of a canvas element.
I used this in my little library for drawing 2d graphs, which I described in mine previous post http://internetexception.com/post/2013/02/16/Simple-2D-graphs.aspx. You can see example of this little snippet in action right there.
I hope this will help someone.
While writing application for my Masters Degree diploma I was required to came up with simple library for creating simple 2D graphs in the browser. Today I decided to share it with the rest of the world.
My lib uses HTML5 tag canvas and jQueryUI library, which is used for creating dialogs for every figure.
Using is really simple. All you need to have is some data in four arrays:
XAxis - it's array with 2 values, start and end of XAxis range. Those values are also drawn as a legend for X values
XData - it's just array of X values
YAxis - same as XAxis but for Y axis
YData - Y values
It's important to have same number of items in XData and YData arrays. But it's common sense anyway.
Those 4 arrays are values of object, figure representation in JS. This object should also have Type property with value 'line'. This is because I am planning to have unified start point for drawing 2D and 3D graphs. About three dimensional graphs I will post soon.
Object for single figure should look something like this:
{ Type: 'line', XAxis: [0, 1], XData: [...], YAxis: [0, 1], YData: [...]}
This is one figure, but my library can show multiple graphs at once so this figure-data-object must be added to dictionary. Keys from this dictionary will also serve as figure names and canvas ids so this cannot be anything that also is not permitted as DOM element id.
Dictionary with single figure named 'Test1' should resemble following example:
{ "Test1": { Type: 'line', XAxis: [0, 1], XData: [...], YAxis: [0, 1], YData: [...]} }
Dictionary with figures data should be send as param to figures figuresDrawer.draw function. And that is all you need to know before start using my library.
As a example I written JavaScript white noise generator :
$(function () {
YData = [];
XData = [];
length = 100;
for (var i = 0; i < length; i++) {
XData.push(i / length);
figuresDrawer.draw({ "Test1": { Type: 'line', XAxis: [0, 1], XData: XData, YAxis: [0, 1], YData: YData} });
As result we will see graph in jQueryUI dialog:
For more configuration of graph you can change values in figuresConfig.js file.
As jQueryUI library allows to resize dialogs, graphs can be resized to. In this config file you can choose default values of width and height of new dialog.
this.default2dHeight = 400;
this.default2dWidth = 600;
'partialCanvasId' values is just template for graphs canvas tags ids. You can change it, but it has not impact on graphs functionality. I decided to put this here because I needed it in one place for 2D graphs and 3D graphs.
More interesting configuration values are in Figures2d.js file.
__axis_numbers_size - size of font for drawing axes ranges
__axis_numbers_style - here you can change font of those numbers
So changing code to:
var __axis_numbers_size = 20;
var __axis_numbers_style = __axis_numbers_size.toString() + "pt Times New Roman";
will set font to 20p size Times New Roman font.
Next 4 variables are colors of:
__figure_bg_color - background color for axis ranges description; in image above it's gray strips around graph space itself.
__figure_grid_bg_color - this is background color for graphs space; white color above
__axes_color - it is color of axes lines, color of black rectangle separating gray strips and white graph space, but it is also color of axis numbers
__plot_color - color of plot lines; blue color in example
After cnahging code:
var __figure_bg_color = "black";
var __figure_grid_bg_color = "gray";
var __axes_color = "White";
var __plot_color = "#FF0000";
we can see black figure background with white axes and red plot lines on gray background.
You can change it but I think that default are much nicer
Another thing that can be worht mentioning is that after resizing graphs are redrawn after some time after resizing. Without it it would looking strange because resizing of drawn canvas tag work like resizing an image. You can try this for example resizing to small window (it will be not readable in that size), and then again to bigger dialog window (when you will see eventually big pixels with lite smooth effect). After 2 seconds graphs will automatically resize itself to stretch to new size.
I understand that there are plenty of better libraries for this, but maybe this one will suit somebody. It's really simple and lite, less then 300 lines. And without jQueryUI which can be slow sometimes it could be really fast. And it can starting point for someone that would want to write something on their own.
2Dgraph2.zip (190.06 kb)
Recently I was asked at work for quick review of small project. It was created (or updated) in newest version of Visual Studio - 2012. I don't have installed VS 2012.
I could install it, yes, but it would be just waste of time since browsing through code in that project took me only few hours.
So I decided to try to open that in VS 2010.
It was not surprised that didn't work entirely. I was expected that I won't have possibility of building it - .NET 4.5 was not even installed on my machine. But to see "incompatible" next to project name was surprise to me indeed. It was strange I was suspecting that lack of .NET 4.5 binaries could cause that. But installation of framework did not help. I still was seeing this:
That is strange. I would thought that Microsoft at least would allow me to browse through files and see contents of project. I guess they would try every little thing they can to sell they newest software .
So I thought to try to open this project in version 2008. Just for fun and this was surprised it worked . I even get message 'build succeeded' when I tried it, but I have to mention that was only once and after opening files with errors (non existent namespaces and classes) it no longer worked . But it was ok since I was only required to look at the code inside.
After 'build succeeded' info I tried to open project properties of project and get this:
So if project had no framework at all it could skip building entirely and since there was not errors It succeeded
Nevertheless I done my work using VS2008.
Why Microsoft would block something in VS2010 and no in 2008. Maybe users of second are considerably less numerous so it was just to expensive to do such thing.
It was few years back on my first year of studies, when my friend told me about Python. Then it was great for me. One-liners could read ftp folders, web pages, interact with operation system, list comprehension, injecting code into life programs, nested functions, procedural as object oriented programming styles etc. etc. All of this in bultin libraries with simple but yet quite functional editor, supported with great documentation. I wrote my first studies project in Python and I was proud with it a little . During next years I was using Python for writing simple scripts to automate my proffesional work as PHP programmer. Python was and I still think is better language then PHP. After that I started to work as .NET/C# developer. It has diffrent syntax but C similarities let me to learn it quite quick. Framework .NET is powerfull tool also so I didn't touch Python for 2 or 3 years at least for anything longer then few lines.
But a week or so ago I decided to write a simple script to automate reading whole RSS channel. I wanted it to filter it for only those news that I was interested in. I decided to use Python for it. I was considering also PowerShell since it is bultin into Windows and it an benefit from .NET. But I don't like it's weird syntax, and since I wanted to just write this script and not struggle with syntax errors I chose Python. I don't want to say that I made an mistake. I still powerfull language and I manage to write this script quickly, but... there was some misunderstanding. Maybe I am more experienced. Or spoiled with C#, or used to it. Or just picky. Nonetheless I decided to share this with the world.
One of this things was global versus local scope clash. I probablye would get over it if not other things.
Let us consider little program like this:
global_var= 1
def func_with_local_scope():
I does really simple thing: prints value '1' two times. Despite the fact that func has it's own local scope aside from global scope, it will work cause interpreter will think about as 'global_var' variable as global. It is correct behavior. Now let is change a bit:
global_var= 1
def inc():
And... it will fail. Why?
File "test.py", line 4, in inc print(global_var)UnboundLocalError: local variable 'global_var' referenced before assignment
My first reaction was: "Huh?" How it is not assigned? It is done right before this function. Let's inspect scopes inside 'inc' function:
{'__name__': '__main__', 'global_var': 1, '__package__': None, '__doc__': None, 'inc': <function inc at 0x00000000031EC488>, '__loader__': <class '_frozen_importlib.BuiltinImporter'>, '__file__': 'F:\\skrypty\\music_rss\\test.py', '__builtins__': <module 'builtins'>}
It is perfectly fine! Our variable is defined in global scope and it has value! And local scope is empty since I did not declared any local variables. Why system that is resolving variables names do not check for global scope when it is trying to find value? Because doing any assignment in function tells interpreter that this variable WILL be assigned in function and without declaring it with 'global' keyword it WILL be local variable. I know that. I understand that. And I think that is inconsistent and it should be done better. I would agreed to use always 'global' keyword or always not using and just letting interpreter do the job. Either way would be fine since it is consistent and desinger of the laguage decided to this that way. I his call. I could not be ideal but it would be intuitive.
Let's do one test:
global_var = 1
class Incrementer:
def inc(self):
i = Incrementer()
When I was writing this I was expecting it to fail with my knowledge of scopes in functions. But I also was suspecting that this actually might work and I will find more scope inconsistencies. And there it is. I work just fine. I mean it run but it certainly do that like Spanish Inquisition. Result will be:
1 2121
First '1' is print(global_var) inside class declaration. Despite the fact that variable with this name is defined later in class and since this would cause an error in function I would expect it to fail here also. Here comes another 'Huh?'. Instead it is resolved to global variable.
Second print is done after incrementing variable with the same name. Which is it? It is global variable? Or it is new local class variable? If code would be end here it would be good, tricky question for interview for Python job (maybe it is I don't know). Simple programmer like me would expect (if you reference variable with the same name in the same way it SHOULD be the same variable). No. It is not.
Third print show that to us. It is global variable with the same name and it is still simple '1'. Doing incrementation in class scope of global variable (as I would expect) creates new local class variable and assign to it value of global variable PLUS one. How in hell this is incrementation?
Forth print shows us value of two and actual place of incremented value. It is know in class variable with same name as global variable. I will call this inrementation with displacement. Python-like.
Last print shows us global unchanged variable. It still there, not touched.
Uhm... I don't know. Maybe this is explained somethere in documentation. Maybe it is logical somewhere in bowels of interpreter. Or whatever magic thing make this work. I don't know. I don't have time and will to dig in few hundres pages of documentation for specifics of inner workings of something so basic like arithmetical operators. And frankly I don't care. Throw and error, when you trying to increment value that is not there - like C. Resolve it to global variable like in JS. Prevent to name the variable just like another variable in scope level above - like C#. Just pick one please. And be consistent.
Another one exist only in Python 3, contrary to previous. It begins with decision that all strings should be unicode. That is great. Resolving encodings is pain in the ass. But... console have it's encoding too. I don't know how this work in other systems then Windows but I suspect it's problem too since when googling for answer I found that in happened not only to me. So what happens when you get some unicode char that can't be encoded in console specific encoding? It suppose to show some not readable characters like │┐čŠč╣˝ˇ│ or just ? sings, don't you think? No. It throws exception. Program crash. End of story. It is command line. It is tool to interacting with users. If user will have to make something from information that 10% of it is giberish that is bad not it is not critical. When application is throwing an error when encoding string to some specific encoding when saving data to for example to DB, it probably be desired to throw error. But not in output! It is even more horrible because writing an app in Python you cannot know for sure what will be user interface encoding so you cannot be prepared on anything with tool like this.
So script below will work fine in Python Shell fine and will fail in cmd.exe:
string = 'показано'
With exception like that:
File "C:\Python33\lib\encodings\cp852.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_map)[0]UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-7: character maps to <undefined>
I added line print(sys.stdout.encoding) so I know that Python internally know what encoding is in output. This can be used to do something like this BEFORE print:
so every char that can't be encoded will be replaced with something else. But why this cannot be done inside print? Why print at least cannot have another param to silently pass encoding errors?
Another one that is connected with 3 version. In previous releases I used Python to debug http response of websites. It was really nice tool for it with set_http_debuglevel method of HTTPHandler class.
send: 'GET / HTTP/1.1\r\nAccept-Encoding: identity\r\nHost: www.wp.pl\r\nConnection: close\r\nUser-Agent: Python-urllib/2.7\r\n\r\n'reply: 'HTTP/1.0 200 OK\r\n'header: Server: arisheader: Expires: Thu, 07 Feb 2013 21:21:24 GMTheader: Last-Modified: Thu, 07 Feb 2013 21:21:24 GMTheader: Pragma: no-cacheheader: Cache-Control: no-cacheheader: Content-type: text/html; charset=UTF-8header: Set-Cookie: reksticket=1360272084; expires=Sat, 09-Feb-2013 21:21:24 GMT; path=/; domain=.www.wp.plheader: Set-Cookie: rekticket=1360272084; expires=Sat, 09-Feb-2013 21:21:24 GMT; path=/; domain=.wp.plheader: Set-Cookie: statid=184.108.40.206.25161:1360272084:324990297:v1; path=/; expires=Sun, 07-Feb-16 21:21:24 GMTheader: Set-Cookie: statid=184.108.40.206.25161:1360272084:324990297:v1; domain=.wp.pl; path=/; expires=Sun, 07-Feb-16 21:21:24 GMTheader: Content-Length: 94719header: Connection: close
It not working in Python 3:
import urllib.request
b=urllib .request.build_opener(h)
This feature was not documented as far as I know. I have found this in 'Dive in Python' book (http://www.diveintopython.net/). I suspect this was to non important to keep maintaint it in new versions. So much that it was not even removed.
I could go on with lack of nice function for handling dates and time. Or 'self' (non)keyword inside class declarations. But this rant is long enough as it is. Maybe I will write another script in PowerShell, after fighting with syntax it will be more usable for simple scripts.
While writing an application for my Masters degree diploma, I wrote a simple application that was using COM Matlab server. I have found it hard to use it mainly due to lack of documentation, which is really basic with only few code examples for C#. I guess writing programs that use Matlab for calculating is not encouraged by MathWorks, you would became competition that way . Nonetheless, I accomplished why I was required to do, so I decided to share this with the rest of the world.
Important: I was using R2010a version of Matlab. I realize that there is a newer version. But I had only this version at my disposal. Since interface for communicating with Matlab server is dependent on installed Matlab version and registry entries, it may have been different from yours. But I suspect not too much. I also tried with 7.1 and (if I remember correctly) it required only to swap reference in Visual Studio. But again... it was only a test so there might be other problems that I am not aware of.
Let's start with a simple console application. Let's call it MatlabTest. First, we will add DLL reference with COM interface. Click RMB on project and choose [Add Reference] option. In new window, click COM tab. In search text box, write 'Matlab'. Then choose "Matlab Application (Version 7.10) Type Library".
You should get a new reference like below:
Great. Now we should test if it is working. In order to use it, we should create our Matlab server from C# application. To do that, we can add code to our main program:
var activationContext = Type.GetTypeFromProgID("matlab.application.single");
var matlab = (MLApp.MLApp)Activator.CreateInstance(activationContext);
This code will create a single Matlab COM server through Activator class. Program Id "matlab.application.single" means single Matlab COM server for our application. When it will try to create another Matlab, it will just return a reference to the same object. Contrary to that, we could use "matlab.application" which will create another instance of Matlab anytime Activator.CreateIntance method will be executed. In more complex applications or for web applications or other programs which run for a long time, it may create big memory leaks since 1 instance costs around 220 Mb (on 64 bit Windows 7 and Matlab R2010a).
After creating Matlab program, execute a simple sum of 2 integers, just for testing communication - we don't need anything more sophisticated. It should return also a simple string in console:
It's really simple and more importantly, it works!
This way, we can send and receive string messages with MATLAB only. It's not very useful. Also, there is one way to find out if our statement had errors. It will have 'error' string in response.
Let's try to run something like this: '1*', which will result in error:
So to check our command had errors, we have to check if output string has "??? Error" in it.
??? Error
To send some parameters along with our command, we have to use one of 'Put*' methods. Best is one called PutWorkspaceData. It takes three parameters. First is the desired name of our new Matlab variable. Two others are much more tricky. To set variable correctly (so you could reference it in command), you must use global workspace. But it is called? This one took much more time than I would want. It is not mentioned in the documentation of this method. If I remember it right, I found it in some code example and it should be only "base". In the end, I created in my application another method that encapsulated PutWorkspaceData and forgot about it . The third parameter is the value of our variable. It should be simple. Let's change our code to:
matlab.PutWorkspaceData("a", "base", 2);
The result will be as shown below:
But it is just int. What about more complicated structures? How about multiplication of two vectors? Matlab is using .NET type double to send and receive information with our application. Again, I did not find it anywhere in the documentation, but rather reverse engineered this from data returned from Matlab. So let us try to send 2 arrays of doubles. and multiply them in Matlab. First will be named 'a' and second 'b'. Matlab command will be "a'*b". Transposition will give us a nice matrix instead for a single number.
matlab.PutWorkspaceData("a", "base", new[]{2d,3d,1d});
matlab.PutWorkspaceData("b", "base", new[]{4d,3d,2d});
And in return we will get:
Next step will be to return this output to our console app. To do that, we can use GetWorkspaceData that works similar to PutWorkspaceData or... we can use GetVariable method. This one returns dynamic so our application needs to run on .NET 4. It takes two parameters - name of variable we want to return from Matlab and again name of workspace. You really should save this string as const somewhere . Change our code to:
matlab.PutWorkspaceData("a", "base", new[]{2d,3d,1d});
matlab.PutWorkspaceData("b", "base", new[]{4d,3d,2d});
var c = matlab.GetVariable("c", "base");
After that, in our console app, we will have variable c and it will be a two dimensional array of doubles. To show values of this array in console, we can just iterate it with a simple foreach loop. But instead of that, we will iterate two of the dimensions. This will give us information about values and dimensions of this matrix.
for (var i = 0; i < c.GetLength(0); i++)
for (var j = 0; j < c.GetLength(1); j++)
Console.Write(c.GetValue(i, j) + " ");
Ok.That was matrix. How about vectors? Luckily, vectors are for Matlab just a special case of matrix so it will spit out two dimensional array also. More complex is the case of empty matrix. No, it is not null. It would be too easy. Instead, it is a special type Missing. I guess it has some logic behind. Null would indicate that variable will have no value at all or this is not defined. But we have an empty matrix, so this is not defined nor is this a lack of value. So why not just array with zero values in it? No idea.
Let's try to run code like below to test it:
var c = matlab.GetVariable("c", "base");
var d = matlab.GetVariable("d", "base");
for (var i = 0; i < d.GetLength(0); i++)
for (var j = 0; j < d.GetLength(1); j++)
Console.Write(d.GetValue(i, j) + " ");
Running those commands in Matlab will work just fine. Instead of that, error will be thrown on first for loop:
Not very nice. To prevent this error, the application will have to check if dynamic type returned from matlab is in fact empty (Missing). Not very clean it is better to wrap this in other method that will perform this check for us whenever we want to get our data from Matlab. In my project, I ended up writing few methods for returning vectors, matrices, numbers, strings, etc. Vector one looked like this:
public static Vector GetVector(this MLApp.MLApp matlabComObject, string variabla_name)
var dynamicVariable = matlabComObject.GetBaseWorkSpaceVariable(variabla_name);
var dataList = new Vector();
if (TypeChecker.IsVector(dynamicVariable))
dataList = Vector.DynamicToVector(dynamicVariable);
else if (TypeChecker.IsNumber(dynamicVariable))
else if (TypeChecker.IsEmptyMatrix(dynamicVariable))
//do nothing empty vector or matrix ([0x0] or [1x0])
else throw new Exception(string.Format(
"Type of dynamic variable ({0}) is not supported!", dynamicVariable.GetType()));
return dataList;
TypeCheker checks for type of dynamic. It's pretty straightforward. For our Missing type, it's just one line:
public static bool IsEmptyMatrix(object dynamicVariable)
{ return dynamicVariable.GetType() == typeof(Missing); }
After checking type of dynamic, we can just cast it to another type to take advantage of static properties of language. Why use dynamic at all? First, I think that ref and out method parameters are messy and second: I prefer:
var d = matlab.GetVariable("d", "base");
object e;
matlab.GetWorkspaceData("d", "base", out e);
It is only 1 line. And since object you have to create first and then cast it also, don't bother and just use dynamic. But I guess it is just what you will like better.
Strings are much more friendly and there are just string. Or null.
Now we know how to put and get data from Matlab. How to execute commands and check them for errors.
If you executed any of these examples, you probably took notice of a very simple Matlab window which had opened during the life of your console app. If you terminate it by disabling debugging or it will close due to error, Matlab window will remain opened. If not, it will close nicely with console window. But still, it is a huge memory leak risk if not maintained properly. To that, I recommend creating some special class that will create an instance or instances of Matlab. It should track one of the created instances and in case anything bad happens (but dynamic variable cast is probability ), it will close all instances prior to application exit. Tracking should be employed through WeakReference class, so whenever Garbage Collector would want to destroy Matlab instance, it should not be stopped by our tracking class. To destroy COM instance, we can use method Marshal.FinalReleaseComObject. So with weak reference code for that will look like this:
public static void Release(WeakReference instance)
if (instance.IsAlive)
Method Quit of matlab server instance does not close it immediately and the code above will.
If you want to hide that popup Matlab window, you can set this in its instance:
matlab.Visible = 0;
This way, it will fade away and run as service.
This is the most basic information about Matlab in C#, but it will get you started. So happy coding!
About Me
Sign In


text:
While on temporary assignment with the Society for Neuroscience, I edited an article about the International Brain Bee competition to ensure consistency and correct style usage throughout. I also checked for factual errors and asked the writer to clarify important … Continue reading
Tag Archives: editing
While on temporary assignment with the Society for Neuroscience, I helped edit an article about a New Jersey senator who decided to tour the lab of SfN member Dr. Emanuel DiCicco-Bloom after Bloom invited him during SfN's annual Capitol Hill … Continue reading
While on a temporary placement with the Society for Neuroscience, I attended Congressional Neuroscience Caucus and took photos with a Canon 5D Mark III dSLR camera. I selected the photos and wrote captions for them. I also edited the article … Continue reading


text:
Tribology is a branch of mechanical engineering that studies the science of friction, lubrication and wear between interacting surfaces in relative motion.
The working lifespan of equipment is protected with the proper lubrication of machine surfaces and is one of the best ways to control friction and wear.
Plant-based oils are effective naturally at reducing friction and wear between two moving surfaces. Bio-lubricants offer superior lubricating properties that are 5X more effective than petroleum-based lubricants.
Smart Earth formulations offer the natural anti-friction properties of plant-based oils for an advanced biolubricant with increase performance and lubricating functionality.
The biodegradability of Smart Earth lubricants is better for the environment, with a smaller carbon footprint than traditional petroleum-based lubricants.
Lubricants in History
Smart Earth's commitment to replace petroleum-based fluids with environmentally responsible and sustainable alternatives is supported by the effective use of natural oils as lubricants in history.
The use of natural lubricants as a way to reduce friction dates back to antiquity. Archaeological evidence shows that ancient Egyptian and Chinese societies used natural oil as lubricants to assist with the construction of large projects like the pyramids.
The two basic laws of friction: friction is independent of contact area, and friction is proportional to load; were formulated during the Renaissance by Leonardo da Vinci, who was fascinated with the nature of friction.
Leonardo saw that the ease of movement between various materials was quite different and he concluded that smoother materials will have smaller areas of potential friction and wear.
Liquid lubricants made from natural oils were also used during the industrial revolution for corrosion protection, chemical resistance and most importantly, lubrication.


text:
Archive for category: Uncategorized
European stile tilt and turn basement windowsUncategorized
European basement windows which meet National Building Code requirements. Nicely pressure sealed frame, gorgeous European design.
Please review our basement windows.
P.S. Patio doors with this system available as well. Follow our youtube channel for future videos.
REHAU window intruder test!Uncategorized
Please check this REHAU window intruder test! Looks impressive!
Call now to get 15% discount on your home windows improvement from the true leader in uPVC windows industry.
Get a quote today! Call 780-292-2848 to get free in-home estimate!
Windows made with passionUncategorized
Do you know?
Windows and doors from Permanent Windows Solutions are made with REHAU uPVC profile by REHAU authorise manufacturer.
REHAU is a well-known supplier of PVC product for companies such as Mercedes Benz or NASA. Enjoy this informative video.
Call or text now to receive 15% discount* on windows and doors from Permanent Windows Solutions.
*offer valid until April 30 when you order 10 or more units


text:
Welcome back to our Confessions series. I am so glad you stopped by.
Being a mom is the one job that I always knew that I wanted. There was nothing on earth I wanted to be more than a parent. I had ideas of having a boy first so he could grow to protect his sister. I had names picked out when I was 7 (which I kept for my daughter) and I knew that I was going to be a great mother. I just knew it.
I would spend the day playing, singing, and enjoying my children. I wouldn't raise my voice or have to discipline them. They would know how to behave because I would have taught them. Temper tantrums – forget about it! My kids would be perfect all of the time! I had it all figured out. It is funny how much you know about being a parent before you actually become one!
Turns out the only place where you will find any bit of parenting perfection is in the pages of parenting books and magazines.
Here I am knee deep in parenting. My children are over half way grown, by society standards, and I am looking around trying to figure out where in the world I went wrong.
My children stay up far too late more than they should. I find myself yelling, nagging, and getting on my own nerves more than not. Temper tantrums have been replaced with pre-teen meltdowns. Sarcasm and eye rolls are the norm, and sometimes you will find the children doing it too. HA!
Where did I go wrong?
When did I become a parenting failure?
You know what? I didn't do anything wrong. I have a feeling that everything I just listed above is a way that every single mother has felt at one point or another. None of us are failures! We are all doing the best we can with what we got. We are faced each and every day with Pinterest perfect lives all over social media that show just how perfect a mom Louise is to Jimmy and Betty, when I am betting that Louise bribed Jimmy and Betty with a candy bar to take that lovely picture she pinned. The truth is that there is no such thing as a perfect mom. If we judge our parenting level by the Pinterest yard stick we are all failures.
I think it is time we all band together and stop looking at our shortcomings as failures. We are all working toward the same goal: to raise decent, responsible members of society. I am betting that when it is all said and done our children will be just fine. We will be exhausted and ready to hibernate but our children will be just fine!
So, from one parenting failure to another, we got this! None of us are failures!


text: A few years ago, my dad — a man with a serious sweet tooth who dunked Oreos in his morning coffee — got an off-the-charts cholesterol report. My biggest challenge was to come up with a new morning dunker for Dad. For Father's Day, I worked up this biscotti recipe.


text:
With an industry filled with countless creative minds and endless inspiration, it's not nor surprising or unusual to recall the work of designer Norma Kamali — the mastermind who has consistently influenced fashion with her innovative concepts and multiple of dominate trends.
The sleeping bag coat to the prominent high-heeled sneaker is some of many of her creative inventions that have contributed to her iconic disposition. Having formed clothing constructed from sweatshirt fleece fabric, she introduced a way for the modern woman to illustrate style while wearing comfortable attire —something that has been a predominant motive for women everywhere.
It was in 1968, when the designer opened her first boutique in her native hometown of New York where her earliest designs were showcased, including detailed appliqués, snakeskin, patches constructed of lizard and leather and t-shirts embellished with rhinestone studs. A year later both her boutique and creations were featured and covered editorially in the likes of Harper's Bazaar and Vogue. The same year was intertwined with her invention of America's fashionably popular garment, "Hot Pants".
Only the biggest influencers are able to design collaborative masstige lines with world-renown retailers — reasoning as to why Kamali was sought after by Walmart, Everlast and Spiegal.
Being immersed in retail since 1967, Norma does and continues to market and sell her clothing in the most innovative ways. In conjunction with her flagship store in New York, barcodes can be scanned to shop from window and in-store displays. As an alternative to using standard mannequins for visual purposes, 8-foot cutouts of models wearing her latest collections captivate the eyes of shoppers that parade throughout the location.
Today the designer taps into offerings from the past that make up her influential designs. Her spring 2013 ready to wear makes use of hand-crocheted Brazilian lace that has spent years sitting in her closet. Her early uses of appliqué's make for a recurring appearance, contributing as the trim on raw denim jeans and its jacket companion. Not to mention her obsession of decorative studs on jersey fabric are seen again. "This collection is my fresh take on what I did back in the day", says Kamali" as quoted in September's runway feature for WWD.
Keeping the designer as relevant as she is, musical Icon Rihanna has been spotted on several occasions this buycbdproducts wearing everything from a sheer panel Kamali swimsuit while on a January vacation in Hawaii to her February 54th Annual Grammy's performance wearing a mesh bodysuit. In August, she fashioned her summer performance in Osaka, Japan wearing a dark gold lamé skirt from Kamali's Wrap And Tie collection.
A firm believer in fitness and desire to empower women with her informative finds, she remains a contributor to the Huffington Post as well as Elle and More.Com while running a Wellness Café from her flagship store. In her past September 11th "Hey Baby" write-up on Huffington post she expresses:
"A designer hopes to make women feel good and empower them in the clothes they wear. We are successful for the most part in the pursuit of uplifting women. However, we realize the clothes can only do so much, and can't empower a woman when she is undressed or not feeling good about herself."
Norma Kamali is a celebrated designer, a winner of various awards and achievements, including a 1999 Pencil Award for her notable commitment to New York City Public School Education and WWD's 2010 honoring as one of 100 designers who shaped fashion. Her commitment to invent, inspire and evolve as a fashion mogul are proof that she exhibits natural and well deserved staying power as a leading, accomplished woman in business.


text:
The ExecutivevStage speaking stage set up In the exhibit hall has some very interesting speakers that take 10 minutes to leave you with some very insightful ideas. I enjoyed Nuance's Jonathon Dwter take speech recognition to a new level of intelligent systems in less than 10 minutes. Also my feet enjoyed this event to. It is open from 12:30 to 4:30. So a lot of knowledge in a short time. Life forward to some good topics today .
From the mHealth Summit 12/9/13
I'm at the mHealth Summit at the Gaylord National Resort and across the Potomac River from Washington, DC on the Maryland side. It's a 2,000-room hotel surrounded by chain restaurants and stores in one of those destination developments aimed squarely at tourists who want to travel without being exposed to anything new, or heaven forbid, local (think Orlando on the Potomac. ) The weather has been terrible with snow and freezing rain, which has added to the feeling of captivity of being in a hotel intentionally located far from competing restaurants and stores and with no convenient shuttle service or Metro station access, meaning everything you eat or drink will cost twice what the market would otherwise command. It's an expense account crowd, so they don't seem to mind.
The last time I attended this conference was in 2010, when it was still being run by the Foundation for the National Institutes of Health and held in the Washington Convention Center. HIMSS took over in the meantime and attendance has more than doubled to around 5,000. Quibbles aside, HIMSS knows how to run conferences much better than the NIH, meaning there is good signage, an annoyingly peppy opening session featuring questionable curated pop music and lighting, and a strong vendor and commercial presence. It's much more enjoyable.
I felt as though I had intruded on a geeky academic conference in 2010, although with Bill Gates, Ted Turner, and Aneesh Chopra speaking, the keynote star power was a lot higher then than now. Presentations back then were often about public health projects in Africa, government informatics research, and government policy. The "exhibit hall" was mostly just a part of the hallway where public health poster presentations were displayed, along with a modest presence by the telecom companies. I felt somewhere between virtuous and bored being there.
HIMSS, as it usually does, put all of that unsexy and unprofitable subject matter almost out of sight. Now the conference is a freewheeling ode to capitalism showcasing companies willing and able to pay big bucks for space in the exhibit hall and in the endless number of HIMSS-owned publications. The exhibit hall is like a downsized version of that at the HIMSS conference and most of the educational sessions are either about companies or feature vendor people as presenters or moderators. The attendee demographic seems to have shifted from a heavy non-US presence to the same kind of minimally diverse suited people who go to the HIMSS conference, except few of the folks here are from hospitals since we hospital rabble are seen as part of the problem, not of the solution.
HIMSS seems to be positioning the mHealth Summit as the minor league of its conference portfolio. Most of the small mHealth exhibitors will be toast in a couple of years, but those who survive will graduate to the big show, the HIMSS conference. It's an untapped market for HIMSS since companies at this conference aren't selling to hospitals and practices. It's become more of an investment conference than anything else.
The same issues dominated this year as in 2010. Nobody's really sure what mHealth is, basically punting off by saying anything that runs on a smart phone must be, which means the subject matter is entirely unfocused and confusing. Startup companies keep trying to convince each other that they can hang on long enough to be bought out. Everybody fervently believes that mobile apps and brash startup spirit can transform the US healthcare system into one that's cheaper, more health-focused, and more consumer driven. It's always easy for me to be cynical and dismissive, but especially so at the mHealth Summit.
Speaking of disruptive, I had firsthand experience with a business that truly is. Take a look at Uber, which is fairly new to DC and several other cities. Cab companies and the local governments that regulate and tax them are freaking out over Uber. You punch up on your smart phone that you need a run (either a limo-type service or cab). Uber tells you how many minutes it will be until your car arrives, and you can watch it moving toward you in real time on a map. Your driver calls to confirm, takes you to your destination, and then you just walk away since Uber charges your credit card plus a 20 percent gratuity automatically. You don't have to flag down a cab, figure out the whole payment forms/ tip / receipt issue, or explain on the phone where you need picked up. It's pretty amazing, and clearly the deceptively simple app is connected to a super-sophisticated back-end system. I loved everything about it except the two cab problems that even it apparently can't solve – my driver spoke no English and never heard of National Harbor so I had to punch it up on my phone and show him the screen so he could type it into his phone's GPS.
The opening keynotes I saw all involved vendors or investors. It almost made me miss the puzzlingly unrelated but occasionally interesting HIMSS conference speakers, like Dana Carvey or that mountain climber who sawed his own arm off. The Qualcomm guy proudly mentioned its venture arm's new investment in Practice Fusion, which has zero to do with mHealth, but given that everybody wanted to talk about investments and valuations, maybe he was just caught up in the moment.
Investor Ester Dyson was interesting, although a bit prickly. She observed that cell phones didn't compete with land lines, they just showed up and created their own market. She said that mHealth is like that, where it doesn't have to compete with or earn the approval of entrenched companies. She also observed that mHealth has too many iffy apps and not enough real companies.
AOL founder Steve Case said mHealth needs to move from features to products to platforms. He gave an example in the early days of the PC, companies did nothing but sell printer drivers, but that didn't last long. He says the market will open up in 5-10 years (the timeline apparently hasn't changed much since the 2010 conference since that's what they were saying then). Steve's Revolution Health was a flop so he got rid of most of it and turned it into an investment vehicle that doesn't seem to have kicked much of a dent in the universe either, so I don't know if finding a rich, clueless buyer for AOL right before the dot-com bust makes him a sage, so take it for what its worth.
Dyson made an observation I heard a couple of brave skeptics utter at the 2010 conference. All of these cool apps haven't had much impact on health. One company doubled the rate of smoking cessation, but that was still a jump from just 5 percent to 10 percent. In 2010 they were talking about the need for more outcomes research; apparently there still isn't much of it. Case may have explained that in his talk – healthcare and education are the two sectors in which consumers have so little influence (and government has so much influence) that you can't encroach on them via consumer pressure, you have to partner with the entrenched players.
I floated around some sessions and the exhibit hall, not really seeing much that interested me. Apparently the Twitter crowd was more easily impressed since they were lighting up the Twittersphere with observations about both the educational sessions and the exhibits. The biggest and busiest booths were Qualcomm and the National Institutes of Health, which should illustrate my "unfocused" observation pretty well.
I went to a session on government mHealth policy and outcomes. Jodi Daniel of ONC said the FDA, HHS, and ONC are working on a draft strategy report related to the FDASIA report and the FDA's potential role in regulating healthcare IT. She said the report will go out for public comment in early 2014. Credit ONC for always trying to get input from all stakeholders before just laying the law down.
The exhibit I appreciated most was Alego Health, which not only had a bartender handing out wine and beer, they also had a nice cheese board that prevented me from having to pay $8 for a cold wrapped sandwich. I looked them up and they do EMR consulting, which doesn't seem like a good fit for this conference, but I was glad to see them.
The exhibit hall had an Innovation Zone, where smaller, newer companies got a small demo space in a dedicated area in the back.
We had a little HIStalk booth (a freebie from the conference people as a media partner, meaning we write about the event, like right now) where Lorre said hi to anyone who dropped by. Enough people were convinced that Lorre is actually Inga and challenged her on it, so we made her a sign to put front and center assuring that she isn't. She will be in the booth again tomorrow (#1305).
I've chosen some session for Tuesday that sound interesting. It's fun to see a different side of healthcare and healthcare IT than I'm used to as a hospital person. If you're at the conference, feel free to leave a comment with your takeaways so far. Let me know if you saw something amazing in the exhibit hall that I shouldn't miss.