Friday links 95

  1. SharpPcap – A Packet Capture Framework for .NET – CodeProject
  2. Dear Bucharest IT recruiters… | Sergent.ro
  3. How a Handgun Works: 1911 .45 – Animagraffs
  4. “ASP.NET MVC Helper – MoreLessText” – HonestIllusion.Com
  5. Introducing ASP.NET vNext – Scott Hanselman
  6. 30 Satirical images created by Pawel Kuczynski – 9GAG
  7. How Emotionally Intelligent Are You? Here’s How To Tell
  8. Determining the Exchange Web Services (EWS) URL for the ShareScan Exchange Connector
  9. How to Layout and Manage Your Machine Learning Project | Machine Learning Mastery
  10. Comment le numérique redistribue la puissance économique « InternetActu.net
  11. Social Sentiment and Sentiment Analysis – An Overview
  12. Using QueueBackgroundWorkItem to Schedule Background Jobs from an ASP.NET Application in .NET 4.5.2 – Marius Schulz
  13. Tim Harford — Article — Gary Becker – the man who put a price on everything
  14. Secrets, lies and Snowden’s email: why I was forced to shut down Lavabit | Comment is free | theguardian.com
  15. 10 Things You Must Accept And 10 Things You Must Change In Your LifeElite Daily
  16. 69 Rare Historical Photographs You’ve Probably Never Seen. #8 Is A Bit Disturbing. | SF Globe
  17. The Fermi Paradox – Wait But Why
  18. 10 Things to Do Every Workday | Inc.com
  19. Testează-ţi cunoştinţele cu „Vrei să fii milionar?” Ediţie specială de „Ziua Copilului” | adevarul.ro
  20. 1272 free SVG and PNG icons for your games or apps | Game-icons.net
  21. 14 Brilliant Pieces of Literature You Can Read in the Time it Takes to Eat Lunch – PolicyMic
  22. Architecture and patterns | Exercises in .NET with Andras Nemes
  23. What is NoSQL? Four Things, Actually
  24. 30 Cool Open Source Software I Discovered in 2013
  25. PMI’s Career Central | 3 Bad Habits to Break
  26. AppVeyor – A good continuous integration system is a joy to behold – Scott Hanselman
  27. Flat UI and Forms · An A List Apart Article
  28. 10 of the Best UX Infographics – The Usabilla Blog
  29. The 15 Most Common Mistakes in Writing Novels | Write Edit Seek Literary Agent
  30. Forget Setting Goals. Focus on This Instead. | Entrepreneur.com
  31. DESIGN is… — Medium

Entity Framework 6 Record and play use : Making demos ( part 3 of 5)

 

Part 1 : What is EF record and play : http://msprogrammer.serviciipeweb.ro/2014/11/29/entity-framework-6-record-and-play-1-of-5/ 

Part 2: EF Record and play use: Testing : http://msprogrammer.serviciipeweb.ro/2014/12/08/entity-framework-6-record-and-play-use-unit-testing-part-2-of-5/

Part 3: EF Record and play use: Make demo: http://msprogrammer.serviciipeweb.ro/2014/12/14/entity-framework-6-record-and-play-use-making-demos-part-3-of-5/ 

Part 4: EF Record and play use: Record user Sql when a bug occurs: http://msprogrammer.serviciipeweb.ro/2014/12/26/ef-record-and-play-use-recording-user-sql-when-a-bug-occurred-part-4-of-5/

Part 5: EF record and play: conclusions: http://msprogrammer.serviciipeweb.ro/2015/01/05/ef-record-and-play-conclusions/

 

 

Let’s assume you want to register a demo for a application ( Desktop or Web).

You do arrange the database and you make some repetition before. However, the database must be re-arranged the next time you will make the demo.

For this case you can use EF 6 Record and play – it will make a .zip file with containing resultsets and you can make indefinitely the repetition of the demo – without the real database.

 

Let’s see in action here

 

 

The code is simple

 Database.SetInitializer<ContextForDatabase>(null);
            #region set record EF
            record = new InterceptionRecordOrPlay(@"DemoEmployeeAndDepartment.zip", ModeInterception.Play);

            DbInterception.Add(record);
            #endregion

Source code is available at  https://github.com/ignatandrei/EFRecordAndPlay/wiki/

There is also a NuGet package at https://www.nuget.org/packages/EFRecordAndPlay/

Friday links 93

  1. Egor Homakov: How I hacked Github again.
  2. C# and Table Value Parameters – CodeProject
  3. Sliding Boxes and Captions with jQuery « Build Internet
  4. Patent Pending – Hey Mario (From the new album "Brighter") – YouTube
  5. Google Launches Chrome Apps for Android and iOS
  6. Free ebooks from Microsoft Press
  7. Warning: Malicious version of FTP Software FileZilla stealing users’ Credentials
  8. MSDN Blogs
  9. Cloud Design Patterns now available – eScience @ Microsoft – Site Home – MSDN Blogs
  10. Mac & PC – Amazon Apps & Games Developer Portal
  11. UserJoy – 25 must do’s before launching a website!
  12. 19 Things I Wish Someone Had Told Me Before I Turned 20 so I Didn’t Waste a Decade — The Cleveland Young Professional Minority Women’s Group
  13. This Anti-Skipping School Ad Is The Most Disturbing Thing I’ve Ever Seen | Thought Catalog
  14. What Little Girls Wish Daddies Knew | Tara Hedman
  15. Amazon.com: 100 Books To Read In A Lifetime: Books
  16. Sliding Boxes and Captions with jQuery « Build Internet
  17. blueimp/jQuery-File-Upload · GitHub
  18. Bryan Sampica – Async File Uploads in MVC 4
  19. Turning JSON into a ExpandoObject
  20. A SEAL’s Perspective: 5 Ways to Be a Better Leader
  21. 6 Silly Myths About Selling | Inc.com
  22. Top 20 cele mai interesante locuri nestiute din Bucuresti
  23. Have Sweden’s permissive parents given birth to a generation of monsters? – Telegraph
  24. CKAN demo
  25. Radarc Native Cross-Platform Code Generation for Visual Studio
  26. Introducing TFS Impersonation – taylaf’s TFS Blog – Site Home – MSDN Blogs
  27. Introducing TFS Impersonation – taylaf’s TFS Blog – Site Home – MSDN Blogs

Entity Framework 6 Record and play use : Unit Testing ( part 2 of 5)

 

Part 1 : What is EF record and play : http://msprogrammer.serviciipeweb.ro/2014/11/29/entity-framework-6-record-and-play-1-of-5/ 

Part 2: EF Record and play use: Testing : http://msprogrammer.serviciipeweb.ro/2014/12/08/entity-framework-6-record-and-play-use-unit-testing-part-2-of-5/

Part 3: EF Record and play use: Make demo: http://msprogrammer.serviciipeweb.ro/2014/12/14/entity-framework-6-record-and-play-use-making-demos-part-3-of-5/ 

Part 4: EF Record and play use: Record user Sql when a bug occurs: http://msprogrammer.serviciipeweb.ro/2014/12/26/ef-record-and-play-use-recording-user-sql-when-a-bug-occurred-part-4-of-5/

Part 5: EF record and play: conclusions: http://msprogrammer.serviciipeweb.ro/2015/01/05/ef-record-and-play-conclusions/

 

Let’s suppose that we have a program that have Departments and Employees.

And we want to make sure that, when we add an employee, the department must exists.

We can ensure this from database ( by foreign key) but we can pro-actively search for the department and throw a more meaningful validation .

More, I like more validation than errors.

So, let’s suppose that in the Validation for the Employee we must check in the database for the IdDepartment to see if there is such a department.

How could we make a test for that runs without a database ?

With some trick:  we first Record with a database  – then we can Play the file – and we do not need anymore the database. The test is self contained. 

 

Let’s see in action here

 

Database.SetInitializer<ContextForDatabase>(null);
            #region set record EF
            var record = new InterceptionRecordOrPlay(@"VerifyIValidatableWorks.zip", ModeInterception.Play);

            DbInterception.Add(record);
            #endregion
            var e= new Employee();
            e.ValidateEmployee = true;
            e.IDDepartment = 60000;
            var err= e.Validate(null).ToArray();
            Assert.IsNotNull(err);
            Assert.AreEqual(1, err.Length);

Source code is available at  https://github.com/ignatandrei/EFRecordAndPlay/wiki/

 

There is also a NuGet package at https://www.nuget.org/packages/EFRecordAndPlay/

Entity Framework 6 Record and play – 1 of 5

 

Part 1 : What is EF record and play : http://msprogrammer.serviciipeweb.ro/2014/11/29/entity-framework-6-record-and-play-1-of-5/ 

Part 2: EF Record and play use: Testing : http://msprogrammer.serviciipeweb.ro/2014/12/08/entity-framework-6-record-and-play-use-unit-testing-part-2-of-5/

Part 3: EF Record and play use: Make demo: http://msprogrammer.serviciipeweb.ro/2014/12/14/entity-framework-6-record-and-play-use-making-demos-part-3-of-5/ 

Part 4: EF Record and play use: Record user Sql when a bug occurs: http://msprogrammer.serviciipeweb.ro/2014/12/26/ef-record-and-play-use-recording-user-sql-when-a-bug-occurred-part-4-of-5/

Part 5: EF record and play: conclusions: http://msprogrammer.serviciipeweb.ro/2015/01/05/ef-record-and-play-conclusions/

 

Entity Framework Record And Play

With this helper you can record and then play the actions in Entity Framework(>= 6).

For recording actions just reference the dll and use

DbInterception.Add(new InterceptionRecordOrPlay(@"a.zip", ModeInterception.Record)); 

(Note: For ASP.NET you will use Server.MapPath("~/a folder that supports write/namefile.zip")

For replay use

DbInterception.Add(new InterceptionRecordOrPlay(@"a.zip", ModeInterception.Play));

This can be use for

  1. Unit Testing
  2. Making demos
  3. Recording user actions when a bug occurred

 

Source code is available at  https://github.com/ignatandrei/EFRecordAndPlay/wiki/

and has also a test 😉

There is also a NuGet package at https://www.nuget.org/packages/EFRecordAndPlay/ 

 

image

Friday links 91

  1. Understanding, measuring and improving code quality in JavaScript
  2. ajryan/WorkItemSearchReplace
  3. Creativity is rejected: Teachers and bosses don’t value out-of-the-box thinking.
  4. You Have to Play This 1,600-Year-Old Viking War Game — War is Boring — Medium
  5. The 38 Most Haunting Abandoned Places On Earth. For Some Reason, I Can’t Look Away… | Distractify
  6. Designing User Interfaces for Your Mother — Design/UX — Medium
  7. 28 Inspirational Reminders for Crazy Creative People (as opposed to insanity, which requires professional treatment). | elephant journal
  8. gregoryyoung/m-r
  9. Clarified CQRS
  10. CQRS
  11. Leanpub: Publish Early, Publish Often
  12. præclarum – Await in the Land of iOS – Scripting Users
  13. Quick A/B Testing in ASP.net MVC – Part 1 Using 2 Pages | Simon Online
  14. browserstate/history.js
  15. Are your programmers working hard, or are they lazy? | Javalobby
  16. TYPE CAST EXCEPTION | ASP.NET MVC: Show Busy Indicator on Form Submit using JQuery and Ajax
  17. Genymotion
  18. CodeCombat
  19. The Lean UX Manifesto: Principle-Driven Design | Smashing UX Design
  20. Fonts have feelings too — ooomf labs — Medium
  21. needim/noty
  22. CRUD is Not a Service | Chris Patterson’s Blog
  23. Tim G. Thomas: Simplify Client-side Validation…by Adding a Server
  24. Elegant Code » DTO’s, DDD & The Anemic Domain Model
  25. Here are 89 Life Hacks That Will Make Your New Year So Much Better
  26. How To Produce Bug-Free Software | Aspiring Craftsman
  27. Custom ASP.NET MVC Helper Extensions | On All Things Web

Friday links 89

  1. Business Analyst | Bad Business Analysts, Project Managers, and Relationships
  2. The Six Pillars of Complete Developer Documentation | ProgrammableWeb
  3. Don’t Let Architecture Astronauts Scare You – Joel on Software
  4. Download .NET Universe 2013 Poster from Official Microsoft Download Center
  5. What Not To Do At The Company Holiday Party – Business Insider
  6. How the Law’s Loopholes Shape Our Cities | ArchDaily
  7. Element – JSNLog
  8. Gmail blows up e-mail marketing by caching all images on Google servers | Ars Technica
  9. The 50 Most Perfectly Timed Photos Ever «TwistedSifter
  10. On Being A Senior Engineer | Kitchen Soap
  11. The British Library Just Made One Million Images Public Domain, and It’s a Big Deal—Blog—The Appendix
  12. Implicit Async Context ("AsyncLocal")
  13. The Scale of the Universe 2 — Other Languages
  14. 10 Sentences That Can Change Your Perspective On Life
  15. Introducing ASP.NET Web API Throttling handler – Stefan Tech Notes – Blogging about programming and software architecture
  16. 50 People On ‘The Most Intellectual Joke I Know’ | Thought Catalog
  17. Small Basic is FREE!!! – Small Basic – Site Home – MSDN Blogs
  18. BSON (Binary JSON) and how your Web API can be even faster – StrathWeb
  19. CQRS Journey
  20. Razor, Nested Layouts and Redefined Sections – Marcin On ASP.NET – Site Home – MSDN Blogs
  21. Optional Razor Sections with Default Content – Marcin On ASP.NET – Site Home – MSDN Blogs
  22. Henry Miller’s 11 Commandments for Writing Well – Pick the Brain | Motivation and Self Improvement

Andrei Ignat weekly software news(mostly .NET)

* indicates required

Please select all the ways you would like to hear from me:

You can unsubscribe at any time by clicking the link in the footer of our emails. For information about our privacy practices, please visit our website.

We use Mailchimp as our marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp's privacy practices here.