If you're a Visual Studio web developer and you haven't tried out the Web Essentials extension by Mads Kristensen, then GO NOW, GET IT!
And for those who do know about it, and you were using it for it's LESS support, then you may have noticed in the last update how it was removed :( The only alternative then would appear to have been T4CSS.
But the same day I updated and saw the lack of LESS support, was the same day that I realised it's now baked into Visual Studio in the most recent ASP.NET and Web Tools 2012.2 Update.
It supports adding LESS files from the New Item dialog, and upon build will generate the CSS and minified CSS for it too. Which is obviously the reason it was removed from Web Essentials. Awesome :)
jamiebarrow
Tuesday, February 19, 2013
Thursday, February 14, 2013
Git tip - diff of only modified files
I was wondering how to see a diff of only those items that were modified in my Git workspace, and thanks to Stackoverflow, you can use the --diff-filter parameter:
The second one is if you use a visual diff tool. I prefer WinMerge, might do a post on my setup at some point, it's pretty simple once you know how.
git diff --diff-filter=M
git dt --diff-filter=M
The second one is if you use a visual diff tool. I prefer WinMerge, might do a post on my setup at some point, it's pretty simple once you know how.
Wednesday, February 13, 2013
Where'd my Visio BMPN stencils go?
For some reason, when opening up a saved Visio diagram that uses the BPMN stencils, these no longer show up in the Shapes window.
To get them back, click on More Shapes > Open Stencil... then find the Visio content directory, in my case this is C:\Program Files\Microsoft Office\Office14\Visio Content\1033, and then enter BPMN*_M.vss to show only the metric BPMN stencils. Select them all, then click Open.
I have no idea why it isn't stored with the document somehow. Apparently if you go to File > Info > Properties > Advanced Properties and then check the Save workspace option, then it should save things like this, but that's checked for me and it doesn't. Maybe because it's the Professional version and not the Premium version, but I doubt it. Sounds like a bug to me.
To get them back, click on More Shapes > Open Stencil... then find the Visio content directory, in my case this is C:\Program Files\Microsoft Office\Office14\Visio Content\1033, and then enter BPMN*_M.vss to show only the metric BPMN stencils. Select them all, then click Open.
I have no idea why it isn't stored with the document somehow. Apparently if you go to File > Info > Properties > Advanced Properties and then check the Save workspace option, then it should save things like this, but that's checked for me and it doesn't. Maybe because it's the Professional version and not the Premium version, but I doubt it. Sounds like a bug to me.
Labels:
BPMN,
Visio,
Visio Stencils
Thursday, February 7, 2013
Easier way to get to that hosts file
In Windows, there's a hosts file mapping IP addresses to hostnames. For some weird reason, it's in the arbitrary location of c:\windows\system32\drivers\etc\hosts. This kinda reminds me of a Unix/Linux path, with the \etc\hosts. But anyway. That's often too much to type in when just trying to go Start -> Run -> notepad++ hosts. So, use symbolic links :) Something else that is Unix/Linux like, that not many people know exist on Windows:
Then you can just say, notepad++ \hosts.
Much easier.
C:\>mklink hosts c:\windows\system32\drivers\etc\hosts
symbolic link created for hosts <<===>> c:\windows\system32\drivers\etc\hosts
Then you can just say, notepad++ \hosts.
Much easier.
Labels:
cmd,
command line,
command prompt,
junction,
junction point,
mklink
Friday, December 28, 2012
Podcast Reunited
I used to struggle to get iTunes to download podcasts properly. Sometimes they wouldn't download fully, or couldn't be resumed and had to be re-started (IIRC, might have just been other downloads that did this). So I would download them as MP3's from the shows' archive websites, e.g. .NET Rocks!.
There is a problem with this though. When you add the files to iTunes, they are picked up as normal music, and not podcasts. This is sorted out easily by going into the file info and changing the Media Type to Podcast. Simple.
What is not so simple is why there are now two separate podcast entries - one for the subscription we used before, and one for the episodes that were downloaded manually. I used to ignore this, and just have them all on one playlist, but recently when I was re-importing everything into iTunes on a re-installed PC, I noticed this again and wanted to solve the issue.
MP3 files come tagged with ID3 tags. The standard ones such as artist, album, track number, etc. are easily editted in most audio programs, including iTunes. But for podcasts, there are some extended ones, namely PODCAST, PODCASTURL, PODCASTID, etc., which I found out using a program called Mp3tag.
You can update these tags using Mp3tag, and probably other software. For more info on this, see the question I asked (and answered) on Superuser.
There is a problem with this though. When you add the files to iTunes, they are picked up as normal music, and not podcasts. This is sorted out easily by going into the file info and changing the Media Type to Podcast. Simple.
What is not so simple is why there are now two separate podcast entries - one for the subscription we used before, and one for the episodes that were downloaded manually. I used to ignore this, and just have them all on one playlist, but recently when I was re-importing everything into iTunes on a re-installed PC, I noticed this again and wanted to solve the issue.
MP3 files come tagged with ID3 tags. The standard ones such as artist, album, track number, etc. are easily editted in most audio programs, including iTunes. But for podcasts, there are some extended ones, namely PODCAST, PODCASTURL, PODCASTID, etc., which I found out using a program called Mp3tag.
You can update these tags using Mp3tag, and probably other software. For more info on this, see the question I asked (and answered) on Superuser.
Labels:
id3,
iTunes,
Podcast,
PODCASTCATEGORY,
PODCASTDESC,
PODCASTID,
PODCASTURL
Sunday, November 11, 2012
Refactoring Databases
On Friday I did a presentation at Entelect's internal dev days regarding Modern Database Development, and how best practices of Agile Development are widely known and regarded in the community, but how we rarely see the same rigour with database development.
And it's not new. Martin Fowler, Scott Ambler and Pramod Sadalage have written books and blog posts on Evolutionary Database Design and Refactoring Databases, going back to at least 2003. But we don't always see people employing the techniques and tools that have been discussed in the past ten years.
I didn't even know about dbdeploy nor the Red Gate developer tools until this year. I've only been on one real life project that used a custom developed database patching tool to roll out database changes and a base for integration testing. But I definitely believe these tools and techniques must be employed more regularly.
I have to say, the presentation went well. I received a lot of positive comments from people and I think that the audience may have got something out of my talk, which is great news. In fact, I was even asked straight afterwards to help someone out in how to help them compare the data in two production databases.
Look up the tools I mentioned, dbdeploy, Red Gate Source Control, SQL Compare and SQL Data Compare, as well as Microsoft's SQL Server Data Tools. dbdeploy is open source, the Red Gate Developer Tools comes with a trial version, and SSDT is free if you have Visual Studio.
Let's all get better at what we do.
Cheers,
James
And it's not new. Martin Fowler, Scott Ambler and Pramod Sadalage have written books and blog posts on Evolutionary Database Design and Refactoring Databases, going back to at least 2003. But we don't always see people employing the techniques and tools that have been discussed in the past ten years.
I didn't even know about dbdeploy nor the Red Gate developer tools until this year. I've only been on one real life project that used a custom developed database patching tool to roll out database changes and a base for integration testing. But I definitely believe these tools and techniques must be employed more regularly.
I have to say, the presentation went well. I received a lot of positive comments from people and I think that the audience may have got something out of my talk, which is great news. In fact, I was even asked straight afterwards to help someone out in how to help them compare the data in two production databases.
Look up the tools I mentioned, dbdeploy, Red Gate Source Control, SQL Compare and SQL Data Compare, as well as Microsoft's SQL Server Data Tools. dbdeploy is open source, the Red Gate Developer Tools comes with a trial version, and SSDT is free if you have Visual Studio.
Let's all get better at what we do.
Cheers,
James
Labels:
agile,
databases,
dbdeploy,
redgate,
refactoring,
sql,
ssdt,
versioning
Wednesday, February 22, 2012
A look at ASP.NET MVC 4
I just watched the talk by Scott Guthrie at Techdays 2012 in the Netherlands entitled "A look at ASP.NET MVC 4", see the video at the bottom of this post if you want.
In the talk, Scott talks about some of the new features in ASP.NET 4, as well as touching on some new features of Entity Framework Code First. The highlights of the features are:
An extremely useful addition to EF Code First is that of database migrations, allowing you to progressively develop your code and database. Migrations allow you to deploy/rollback different versions of your database. Each migration can add/remove its parts to the database (e.g. adding a column when migrating up, or removing the column when migrating down, even perhaps extracting data to a temp table and processing it during a possibly destructive migration). The one project I was on had a whole custom written database patching/versioning framework which enabled true integration testing, as well as generation of deployment scripts, which EF Code First with migrations can probably provide out of the box now. Very nice.
The bundling and minification support is a welcome addition too. By convention, instead of referencing specific scripts or CSS, if you reference a folder, all the relevant resources in that folder will be bundled and processed together. An HTML helper is also available which also provides versioning of the bundles by appending a hash of the resources to the query string. Custom bundles can be defined and custom processors can be implemented as well, for example, in the talk Scott illustrates that you could use CoffeeScript and LESS processors in a bundle, greatly improving a web developers life.
The WCF Web API, is now part of ASP.NET and is now known as the ASP.NET Web API. It provides the power of WCF with the ease of ASP.NET MVC, while respecting the HTTP protocol a lot more. It provides built in support for writing code once and supporting multiple response types (JSON/XML), OData for querying, filtering and sorting data by just adding to the query string (no code change... as long as your code supports returning an IQueryable), and also provides a nicer programming model for HTTP responses.
The default MVC project templates come with CSS that uses media queries for a more adaptive feel to the application. And for scenarios where media queries aren't enough, there's also support for detecting a mobile client, and returning a completely different template or view for a request. This allows for creating a single web application, but catering for a wider range of clients.
The Real Time Communication with SignalR allows for the server to push through to the clients. SignalR can detect if the client supports WebSockets, or if not falls back to various methods that enable the expected behaviour, e.g. long polling.
The Async support just leverages existing asynchronous controller functionality, but allows you to do so using the async and await keywords that are part of the next version of .NET.
I highly suggest that you watch the whole video, as always, the Gu's talk is full of useful information:
In the talk, Scott talks about some of the new features in ASP.NET 4, as well as touching on some new features of Entity Framework Code First. The highlights of the features are:
- Database Migrations
- Bundling/Minification Support
- Web APIs
- Mobile Web
- Real Time Communication (SignalR)
- Asynchronous Support using language features (async and await)
An extremely useful addition to EF Code First is that of database migrations, allowing you to progressively develop your code and database. Migrations allow you to deploy/rollback different versions of your database. Each migration can add/remove its parts to the database (e.g. adding a column when migrating up, or removing the column when migrating down, even perhaps extracting data to a temp table and processing it during a possibly destructive migration). The one project I was on had a whole custom written database patching/versioning framework which enabled true integration testing, as well as generation of deployment scripts, which EF Code First with migrations can probably provide out of the box now. Very nice.
The bundling and minification support is a welcome addition too. By convention, instead of referencing specific scripts or CSS, if you reference a folder, all the relevant resources in that folder will be bundled and processed together. An HTML helper is also available which also provides versioning of the bundles by appending a hash of the resources to the query string. Custom bundles can be defined and custom processors can be implemented as well, for example, in the talk Scott illustrates that you could use CoffeeScript and LESS processors in a bundle, greatly improving a web developers life.
The WCF Web API, is now part of ASP.NET and is now known as the ASP.NET Web API. It provides the power of WCF with the ease of ASP.NET MVC, while respecting the HTTP protocol a lot more. It provides built in support for writing code once and supporting multiple response types (JSON/XML), OData for querying, filtering and sorting data by just adding to the query string (no code change... as long as your code supports returning an IQueryable
The default MVC project templates come with CSS that uses media queries for a more adaptive feel to the application. And for scenarios where media queries aren't enough, there's also support for detecting a mobile client, and returning a completely different template or view for a request. This allows for creating a single web application, but catering for a wider range of clients.
The Real Time Communication with SignalR allows for the server to push through to the clients. SignalR can detect if the client supports WebSockets, or if not falls back to various methods that enable the expected behaviour, e.g. long polling.
The Async support just leverages existing asynchronous controller functionality, but allows you to do so using the async and await keywords that are part of the next version of .NET.
I highly suggest that you watch the whole video, as always, the Gu's talk is full of useful information:
Labels:
ASP.NET,
async,
await,
bundling,
C#,
CoffeeScript,
Entity Framework,
LESS,
Microsoft,
Migrations,
minification,
MVC,
performance,
SignalR,
Visual Studio,
WCF,
Web API,
website performance
Subscribe to:
Posts (Atom)