Little things make me happy…
Easy way to get the RGB value for images / web pages
Check out ColorZilla plugin for Chrome.
At the February 2014 MADdotNET (@maddotnet) meeting – had David Manske (@davidemanske) from Centare out to talk on what’s new in Visual Studio 2013! Couple absolute gems of knowledge were passed on – one of them was “SideWaffle Templates for Visual Studio” – I had never seen this – so figure some others may not have seen this either!
Specifically liked seeing the AngularJS templates… Check them out!
It is a client-side MVC (Model-View-Controller) pattern and it rocks for making SPA (Single-Page-Applications) that emphasize responsiveness. Take a look at either the AngularJS site, or there are a couple great AngularJS videos on Pluralsight – specifically “AngularJS Fundamentals” and “AngularJS for .NET Developers”.
I know that I have a ton to learn about AngularJS – and wanted to share what I’m learning along the way…
Specifically, have a page that has a list of items to be displayed – and want to filter them by a parameter based on what the user clicked. So in AngularJS we can separate showing the items to be displayed into one controller – the “CollectionController” – and the filters to be applied into another controller – the “FilterController”. Found many examples / discussion on how to communicate between the controller, but some seemed to be way overkill or confusing – so got the following code crafted – and wanted to share as it turned out pretty slick! :)
To boot, have the live code running on JSFiddle – which again, if you haven’t played with is WAY awesome!
As a primarily Microsoft SQL Server developer, when playing around with MySQL database ( specifically using MySQL Workbench ) wanted to be able to press F5 to execute the SQL commands that I was writing, by default you need to press Control-Enter or Control-Shift-Enter – but there is no GUI interface to remap keys shortcuts like there is in most Microsoft programs… so… found that the following worked and wanted to share!
Locate your “main_menu.xml” MySQL configuration file – mine was in “C:\Program Files (x86)\MySQL\MySQL Workbench CE 6.0.6\data\main_menu.xml”. Find the following XML.
1: <value type="object" struct-name="app.MenuItem" id="com.mysql.wb.menu.query.execute_current_statementwin">
2: <link type="object" key="owner" struct-name="app.MenuItem">com.mysql.wb.menu.query</link>
3: <value type="string" key="caption">Execute Current Statement</value>
4: <value type="string" key="name">query.execute_current_statement</value>
5: <value type="string" key="command">builtin:query.execute_current_statement</value>
6: <value type="string" key="itemType">action</value>
7: <value type="string" key="shortcut">Modifier+Return</value>
8: <value type="string" key="platform">windows</value>
Replace the “shortcut” xml (line 7 above) with the following, exit and reopen MySQL Workbench – and you’re rocking with F5!
<value type="string" key="shortcut">F5</value>
You should almost always store your date/times in your database as UTC – you may think it’s not important now, but as soon as your application needs to display times to users in different time zones ( to paraphrase Yoda ) …it will be, it will be…
But do you need to know and store your user’s timezone to display it correctly?
In my blog “NuGet – Limiting updates for jQuery and Bootstrap” – we looked at continuing to utilize NuGet to keep us up to date on the latest jQuery 1.x version ( even though 2.x is out ). Reason being that we needed to stick with 1.x because we are still supporting IE 7/8. :(
So… jQuery 1.x and 2.x have feature parity – but you want to use jQuery 2.x when you can, simply because it’s a smaller download as they were able to take out a lot of IE7/8 “fixes”. Note, jQuery’s post on conditionally include one or the other based on the version of the browser.
But we also like to use the cool MVC bundling and minification feature – can we have the best of all worlds? Oh ya… :)
Need to setup a “Created” DateTime field in your SQL table that is auto-computed to add the current date and time that the field is inserted into the database?
If you’re doing so in SQL – in the “Default Value or Binding” you just need to enter GETDATE() or GETUTCDATE() – insert a record, and you’ll see the date/time value automatically added to that column. “…that was easy…”
But how to do the same thing when using Entity Framework Code First?
No big deal here either – as long as you add the couple lines of code described here…
I love to say “…if it’s not in NuGet, it’s DEAD to me…” – and for the most part that is very true. :)
If you don’t know what NuGet is – you MUST – look at Introducing NuGet: the smart way to bring bits into your projects
However, as I and many developers need to continue to support IE7/8 – we can’t update to the latest versions of jQuery or Bootstrap, as jQuery version 2.+ and Bootstrap version 3.+ no longer support IE7/8…
Also considering jQuery is continuing to update their 1.* version with updates – how do we handle that and continue to use NuGet inside of Visual Studio to show us when there are updates that we DO want to install?
Here’s the solution!
In your “packages.config” file – add the allowedVersions tag to both as follows ( noting that the right parenthesis looks strange, but it is correct – it means ‘less than version X’ )…
<package id="jQuery" version="1.10.2" allowedVersions="[1.9.1,2)" targetFramework="net45" />
<package id="bootstrap" version="2.3.1" allowedVersions="[2.3.1,3)" targetFramework="net45" />
Now when you open up NuGet ( noting that you need to close and reopen VS and the project ) – you see the following!
For this, we were on Bootstrap 2.3.1 – and only saw an upgrade to 3.0 – but now we see we can upgrade to the latest 2.3.2! And we’re currently at the latest jQuery 1.10.2 – so correctly don’t see an update – but we will when one comes out. :)
I love NuGet… :)
Are you are new to robotics? Or do you go to bed dreaming of counting cybernetic-sheep? In either case, Lego Mindstorms EV3 has just released an awesome next generation robot kit that’s made for everyone! EV3 adds never before seen functionality in a format accessible to all current and future programmers. Learn how to start teaching and showing others how to use the Lego programming tools! And just have fun with Robots! :)
PowerPoint presentation from ThatConference 2013 (Big 109MB!)
Check out the EV3 Core Set on Lego Education US!
Some very difficult choices in choosing from so many awesome talks at That Conference – but can’t wait – and wanted to share…
For those speakers and talks that I’m not able to get to – love to have you out to MADdotNET to give your presentations!
Encourage everyone to share their schedule!
President of MADdotNET - Madison Wisconsin .NET User Community
.NET Technology Architect, who channels his passion for development into presentations and blogging, as you never learn something as well as when you plan on teaching it to others.
One of the organizers for That Conference - bringing you the best conference in the Mid-West and beyond! Aug 12th-15th 2013.
Enter your email address to subscribe to this blog and receive notifications of new posts by email.
Join 5 other subscribers