tl;dr - vsix-tools fixes the 'Invalid Multiple Files in VSIX' issue on the Visual Studio Gallery and lets you set vsix version numbers with Powershell.
I maintain a reasonably large project called SharpGL. This project contains two Vsix packages (Visual Studio Extensions), each of which contains project templates for

Surprisingly, for such a mature and robust open-source product, the basic bootstrap.css file most people download is almost entirely uncommented. The only comment characters you’ll find are the credits/attributions, an old IE 8-9 hack, and at the very bottom, the sourceMappingURL. And that’s in the unminified version of the file. This comes from a very fundamental bias on the […]

Surprisingly, for such a mature and robust open-source product, the basic bootstrap.css file most people download is almost entirely uncommented. The only comment characters you’ll find are the credits/attributions, an old IE 8-9 hack, and at the very bottom, the sourceMappingURL. And that’s in the unminified version of the file. This comes from a very fundamental bias on the […]

There's a new chapter up! It's on
"Concurrency, Parallelism, and State".
And zombies. And Lady Gaga. And dwarven berserkers. And mind reading :D
This has definitely been the most challenging chapter to write so far.
I've tried to explain the concepts in a way that's fun and easily
understandable for folks who haven't don't much, if any, parallel
programming. If anything's confusingly written I'd love to hear about
it :)
By the way - if you're at ClojureWest, then lucky you! Sadly, I am
not, but I'd like to recommend Bridget Hillyer and Jennifer Eliuk's
talk on ClojureBridge. Bridget (and many others) have been doing a ton
of work to put on the first free Clojure workshop for women. If you
can't be there, send them some love on twitter, @bridgethillyer and
@7maples! Another recommendation: Alan Dipert and Micha Niskin's talk
on Hoplon. Alan is hilarious and brilliant, and Hoplon is really fun
to use. It's a very different and very enjoyable way to do frontend
programming.
Up next: some chapter revisions! After that, I'll write about Java
for Clojurists.

TLDR; Git is greatly extensible. I made many custom commands to create an interesting talk on "The Insides of Git". Skip the text and just watch the video for details.
Back in June last year in the cool city of Pune at the RubyConf India 2013, I gave a talk on Git. It was aptly titled Inside Git Guts with Ruby.
The idea was to explore what happens inside the .git folder when you do git operations like commit, push, merge etc. The talk was far more about git than ruby. Infact, the part with Ruby in the title was added just to ensure a better chance of my proposal getting selected for RubyConf. Although, all of the tools I showed in the talk were written in Ruby, the actual ruby code shown was just about 4 lines.
Now, here's the actual talk:
The talk was greatly inspired by the movie Inception. Infact I even had a command git inception which gave the following output(truncated):
$ git inception
.git
.git
.git
.git
.git
.git
.git
.git <--- 2nd Level Gitception
.git
The Inception bit was actually the most interesting part of the talk. There were other super cool commands like - git music, git autocommit, git server, git fireworks, git quote, git about and more
Lots of folks have asked me to share the code and the instructions, so here's the code. To get all the tools on your system:
gem install git_guts

IIS Express is the de facto server to use for local development of ASP.NET MVC and Web Api apps. It’s just like it’s big brother IIS
minus a few features rarely used for local development.
Unlike it’s big brother, IIS Express runs on demand as a regular console app under the security context of
your current login. This makes it much easier to start and stop debugging sessions.
Being a console app is great – you can see System.Diagnostics.Debug.Print and System.Diagnostics.Trace.Write
output right in the console alongside IIS’ usual log statements for HTTP requests.
A really useful trick is to create a Windows Explorer shortcut to iisexpress.exe, and open that shortcut iisexpress.exe.lnk file instead of directly
opening iisexpress.exe. There are two benefits to this:
iisexpress.exe gets a dedicated icon on the Windows taskbar. In the screenshot below, I can WinKey + 5 to quickly switch to my IIS Express
console output. (WinKey + N focuses/opens the Nth item on the taskbar; repeat as needed if you have multiple windows grouped for that taskbar icon).
I can customize the command prompt preferences for just iisexpress.exe. In the screenshot below, I’m using a smaller font in purple color, with the
window stretched the entire 1600 pixel width of my display. This helps greatly with the readability of long lines of text in the console output.
Here’s a closer look at the console ouptut:
Here are screenshots of the Explorer settings I used for C:\Program Files\IIS Express\iisexpress.exe.lnk:

Today a work colleague put together a nice Vagrantfile to run a Linux dev environment on our laptops. Vagrant
is sweet for DevOps. The Vagrant file worked great on his Macbook Pro.
But it was no dice running on my Windows box – the VM was a 64-bit Linux VM (why wouldn’t a server be 32-bit?) and I’m on a
32-bit laptop (don’t ask why my corporate IT still issues 32-bit Windows images on 64-bit hardware!).
To my surprise, VirtualBox can actually a 64-bit guest VM on a 32-bit host OS:
If you want to use 64-bit guest support on a 32-bit host operating system, you must also select a 64-bit operating system for the particular VM. Since supporting 64 bits on 32-bit hosts incurs additional overhead, VirtualBox only enables this support upon explicit request.
Source: http://www.virtualbox.org/manual/ch03.html
However, I learned Vagrant cloud boxes may forget to explicity declare they want VirtualBox to enable 64-on-32 support. While changing the box “Operating System Type” from “Ubuntu” to “Ubuntu (64 bit)” would be
an easy fix, I decided to see if Vagrant could dynamically choose the right guest CPU architecture based on the host OS’ CPU architecture.
Our app would run as either 32 or 64, so it made sense to run 32 on 32 and 64 on 64, right?
Turns out it is quite easy. The power of ruby as the config language for Vagrant really shines here:
Here the relevant changes to our Vagrantfile to get Vagrant to run a 64-bit Linux guest on 64-bit hosts,
and a 32-bit Linux guest on 32-bit hosts:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "hashicorp/precise64"
config.vm.box_url = "https://vagrantcloud.com/hashicorp/precise64/current/provider/virtualbox.box"
# support 32 windows hosts :(
if ENV["PROCESSOR_ARCHITECTURE"] == "x86"
puts "falling back to 32-bit guest architecture"
config.vm.box = "hashicorp/precise32"
config.vm.box_url = "https://vagrantcloud.com/hashicorp/precise32/current/provider/virtualbox.box"
end
# ... lots more vagrant plugin and chef goodness ...
end

As Ruby programmers we don’t write for loops instead we iterate over enumerables. We’ve got a rich library of methods like each, map, select or detect to choose from and they all take a block that lets us do something as each element passes by. It leads to a functional style of programming. As I was talking with Pat Shaughnessy about his recent article Use An Ask, Don’t Tell Policy With Ruby I realized when I chain these methods together sometimes the blocks take different numbers of parameters.
For example if we want to find the first 3-letter word in a wordlist we can use the detect method
%w(Hi there how are you).detect do |word|
word.length == 3
end
# => "how"
Here’s where it gets a little weird. If we are looking for the index of the first 3-letter word we chain the same detect method after each_with_index. each_with_index yields the element and index and somehow those 2 parameters are passed all the way through to the detect block.
%w(Hi there how are you).each_with_index.detect do |word, index|
word.length == 3
end
# => ["how", 2]
That seems strange! How can the detect method block sometimes accept 1 parameter and at other times accept 2?
Blocks don’t check their arity
It turns out that in Ruby blocks don’t check how many parameters they are passed. Arity is the formal word for “the number of arguments passed to a function”. This means you can pass 3 arguments to a block expecting 1 and the extra ones will be ignored. You can also pass 1 to a block expecting 3 and the extra parameters will be nil.
def test
yield :a
yield :a, :b, :c
end
test {|x| puts x.inspect}
# :a
# :a
test {|x, y, z| puts [x, y, z].inspect}
# [:a, nil, nil]
# [:a, :b, :c]
Its interesting that we can be so flexible when writing blocks and that got me thinking about two other Ruby concepts closely related to blocks - procs and lambdas. Can we do something similar with them?
The same trick with lambdas and procs?
Blocks are closures that functions can yield to and there are two other types of clojures you can use programmatically in Ruby lambdas and procs. They are almost the same as each other and both report themselves as instances of the Proc class. They differ in what happens if you return from inside one and whether they enforce arity. Lambdas enforce arity while procs do not. Both lambdas and procs are objects you can assign and pass around while blocks can only be created as syntax when calling a method.
First we’ll try our example with a proc and see it continue to work whether we yield 1 or 2 parameters. Proc behave just like a block and we get the same results we did with blocks before.
proc = Proc.new {|word, index| word.length == 3 }
# => #<Proc:0x007fdae31547d8@(irb):88>
%w(Hi there how are you).each_with_index.detect &proc
# => ["how", 2]
%w(Hi there how are you).detect &proc
# => "how"
When we try with a lambda we see the difference. Lambdas enforce arity and we get an error when we try to call the lambda expecting 2 parameters with only 1.
lambda = ->(word, index) { word.length == 3 }
# => #<Proc:0x007fdae302b7d0@(irb):74 (lambda)>
%w(Hi there how are you).each_with_index.detect &lambda
# ArgumentError: wrong number of arguments (1 for 2)
# from (irb):156:in `block in irb_binding'
# from (irb):158:in `each'
# from (irb):158:in `detect'
# from (irb):158
# from /Users/alex/.rvm/rubies/ruby-2.1.1/bin/irb:11:in `<main>'
%w(Hi there how are you).detect &lambda
# ArgumentError: wrong number of arguments (1 for 2)
# from (irb):156:in `block in irb_binding'
# from (irb):160:in `each'
# from (irb):160:in `each_with_index'
# from (irb):160:in `each'
# from (irb):160:in `detect'
# from (irb):160
# from /Users/alex/.rvm/rubies/ruby-2.1.1/bin/irb:11:in `<main>'
This is even more surprising than I expected. I expected the last one to fail as it is only passing 1 parameter to a lambda expecting 2 but why did the .each_with_index.detect &lambda give an error? A bit more testing shows that map works.
lambda = ->(word, index) { word.length == 3 }
# => #<Proc:0x007fdae302b7d0@(irb):74 (lambda)>
%w(Hi there how are you).each_with_index.map &lambda
# => [false, false, true, true, true]
Is this a bug in MRI? In both JRuby and Rubinius detect and map work the same. I’m not sure but am wondering whether I’ve uncovered a bug in MRI (that would be exciting!) I’ll have to ask my friend Pat Shaughnessy for help spelunking into the MRI source.
Putting this aside for a moment we’ll switch to the map version and think about how to overcome the arity checking in lambdas. We can force our code around it by using the splat operator. Instead of defining the lambda with specific arguments we tell it to expect an array of whatever arguments it gets.
lambda = ->(*args) { args.first.length == 3 }
# => #<Proc:0x007fdae313f270@(irb):85 (lambda)>
%w(Hi there how are you).each_with_index.map &lambda
# => [false, false, true, true, true]
%w(Hi there how are you).map &lambda
# => [false, false, true, true, true]
Would you ever create a lambda like this? Probably not, but its kinda fun to know you can.
This is also the first time I’ve had to think deeply about blocks, procs and lambdas and dig into their differences.

I had a weird problem today using a Dictionary. The process involved removing and adding data, and then printing the data. I assumed that it was ordered. I was wrong! Let me show you: var dictionary = new Dictionary<int, string>(); dictionary.Add(5, "The"); dictionary.Add(7, "quick"); dictionary.Add(31, "brown"); dictionary.Add(145, "fox"); dictionary.Remove(7); // remove the "quick" entry After a […]
The post About a dictionary, removing and adding items, and their order. appeared first on Kristof's blog.

Open CMD prompt (Run as Administrator)Goto directory (where you want to create website) and typeyo angular:project_nameYou are done!! It will create all dependent files in the directory.If you are using IIS server, create a website and point it to directory/app folder. Browse the website for example: http://localhost, it will show you beautiful index page.Pre-Requisite: Yeoman (the scoffolding tool) should be installed. Refer Yoeman website for more details.Common Issue: When scoffolding angular project using yo command, if in between you are receiving errors, then execute this line on CMD prompt;C:\MyProject>git config --global url."https://" .insteadOf git://Author: Sumit BajajThanks for reading!!