tag:blogger.com,1999:blog-53882253958686677932024-03-14T14:30:05.706+02:00jamiebarrowUnknownnoreply@blogger.comBlogger45125tag:blogger.com,1999:blog-5388225395868667793.post-27344636617827077702020-03-17T00:46:00.003+02:002020-03-17T02:02:28.562+02:00Keep the faithHere in the Netherlands, coronavirus has been quite big news. The government had been criticised for <a href="https://dutchreview.com/news/dutch/coronavirus-the-netherlands-considers-its-relaxed-approach-to-the-outbreak-the-best-approach/">being too relaxed</a>, and here <a href="https://www.instagram.com/p/B9eTCnXj2N0/?utm_source=ig_web_copy_link">in Breda</a> - one of the main cities close to Tilburg where COVID19 was first reported in the Netherlands - it has been quite interesting to see it develop.<br />
<br />
<blockquote cite="https://dutchreview.com/news/dutch/coronavirus-the-netherlands-considers-its-relaxed-approach-to-the-outbreak-the-best-approach/">
Slightly stricter measures apply in Noord Brabant, where its recommended to avoid social contact with others, with some events in the province being cancelled.</blockquote>
<br />
Saturday February 22 marked the official start of the Dutch Carnival in North Brabant, except I was laying in bed already hungover from the big party the night before. Some students most likely started even way before that - they really do know how to party in Brabant. When the local Breda football team NAC Breda, whose stadium I believe is smaller than that of AJAX Amsterdam, manages to sell more beer a night, you know they have <a href="https://youtu.be/P36t3qh9bcY">some crazy supporters</a>. I especially love the proudly shown banner "The only thing we fear is running out of beer". My kind of football team :D I've only been to one match, but it is a great atmosphere, filled with truly proud supporters and citizens of Brabant.<br />
<br />
<blockquote class="twitter-tweet">
<div dir="ltr" lang="en">
The only thing we fear is running [out] of beer πΊπΊπΊ <a href="https://t.co/xHZSBnE0jO">pic.twitter.com/xHZSBnE0jO</a></div>
β When Sunday Comes (@WSCsupporters) <a href="https://twitter.com/WSCsupporters/status/1065325216879046659?ref_src=twsrc%5Etfw">November 21, 2018</a></blockquote>
<script async="" charset="utf-8" src="https://platform.twitter.com/widgets.js"></script><br />
<br />
Carnival is filled with <a href="https://youtu.be/xeAv9SYNfu4">the same for pretty much a week long</a> - people drinking beer, dressed up in costumes (otherwise you won't even be let into a pub or venue most likely), not caring about anything but <a href="https://youtu.be/XWlbwZXeU_8">having a good time</a>, even in the cold windy or rainy weather- so windy that this year they postponed/cancelled a few of the carnival float parades that people had been building most likely since last year.<br />
<br />
It was a very different atmosphere to the Breda I experienced this past Saturday evening, which normally buzzes at 6.30pm on a Saturday night, but I barely passed 5 people on my way to the local <a href="https://www.ah.nl/">Albert Heijn</a> (AH) supermarket, which thankfully had not run out of groceries (unlike others apparently). I guess I must have missed the panic rush by then perhaps - I also managed to buy a bag of toilet paper a couple of days before, so maybe I didn't notice what was missing on the shelves because I had the essentials already.<br />
<br />
The relaxed attitude got slightly <a href="https://www.government.nl/topics/coronavirus-covid-19/news/2020/03/12/new-measures-to-stop-spread-of-coronavirus-in-the-netherlands">more serious</a> on Thursday 12 March, when gatherings of 100 people or more were to be cancelled, working from home being encouraged (I luckily had just started doing this the day before), people feeling sick advised to stay at home, and it wasn't yet serious enough to close schools - universities were being encouraged to offer online studies, instead, but primary, secondary and vocational schools to carry on since they're vital to society and the government didn't want to set them back.<br />
<br />
I was surprised by that one actually, usually it's the kids that spread things...<br />
<br />
Sunday evening though a less relaxed and more strict measure was put in place, giving a closure order to the horeca (hospitality-restaurant-catering) industry, closing down schools, and putting in <a href="https://dutchreview.com/featured/dutch-cabinet-announces-new-coronavirus-measures-schools-bars-and-tons-of-other-things-closed">more strict measures</a>.<br />
<br />
<blockquote class="twitter-tweet">
<div dir="ltr" lang="en">
The Dutch government just announced that all coffeeshops will be closed too in the fight against coronavirus. Here's a little line in front of one in Utrecht π<a href="https://twitter.com/hashtag/coronavirusnetherlands?src=hash&ref_src=twsrc%5Etfw">#coronavirusnetherlands</a> <a href="https://twitter.com/hashtag/COVID19NL?src=hash&ref_src=twsrc%5Etfw">#COVID19NL</a><a href="https://t.co/MQoVoBamAY">pic.twitter.com/MQoVoBamAY</a></div>
β DutchReview (@Dutchreviewing) <a href="https://twitter.com/Dutchreviewing/status/1239244530320388101?ref_src=twsrc%5Etfw">March 15, 2020</a></blockquote>
<script async="" charset="utf-8" src="https://platform.twitter.com/widgets.js"></script>Coronavirus started spreading throughout the Netherlands, with Brabant being a centrepoint, with Tilburg and Breda being two of the hotspots still.<br />
<br />
It makes me very anxious. Especially since I have had a bit of a cough for a week or two! Makes me paranoid that maybe I have it already.<br />
<br />
The prime minister, Mark Rutte, announced today a strategy <a href="https://www.dutchnews.nl/news/2020/03/we-are-aiming-for-maximum-control-of-coronavirus-pm-tells-the-dutch/">aiming at maximum control</a> to try stop the spread of the virus. Reading that news article makes me feel quite confident in the government.<br />
<br />
Yesterday my home country <a href="https://youtu.be/hqP5QZVAcUY">South Africa was also addressed by our president</a>, who also announced similar measures to be strict about trying to control the virus.<br />
<br />
It's a tough time at the moment. I feel quite stressed, and as hard as I'm trying to stay positive, it is hard at times to do so, and to carry on as if it is all ok. Today was a very hard day to try and stay focused, and that's why I'm trying to kind of write down what is on my mind, as a source of more peace and calm.<br />
<br />
My girlfriend is in New Zealand at the moment. She has been away since January on a fantastic sounding four month tour of Myanmar, New Zealand, Singapore, Malaysia and Thailand. I was going to be meeting her in Thailand around Easter weekend in April, but those plans seem to be falling through right now. Luckily KLM is most likely going to allow me to get a refund, or a voucher I may use within the next year - still need to hear back from their most likely swamped to over capacity customer support team who usually respond very quickly (haven't heard back from them the whole day).<br />
<br />
My nerves have been quite on edge even just because of this, wondering if she would be okay on her travels. Even just getting to New Zealand she had to bypass China when the start of the outbreak was happening - NZ weren't allowing anyone from China in at that time, and she had to arrange a new flight herself at her own cost since the low cost airline or travel insurance weren't able to help her out then. Most likely she won't hear back from them anytime soon now with the virus being a pandemic.<br />
<br />
She is currently in NZ in the queue for Qantas, hopefully she can find the safest option for her and her aunt that she is there with. No more trip to Singapore for them I believe, which is a pity.<br />
<br />
All I can think of though, is "Is this cough that I have coronavirus? Am I being paranoid? Even if she comes back, if she comes to see me, is that safe for her? I miss her. I love her"<br />
<br />
Then there is the stress of my close family, my Dad, Mom, sisters and their families. My Dad was diagnosed with cancer last year, and I returned to SA to visit while he was in hospital in September. It was meant to be a family trip to Australia to visit Debbie, Etienne and my nephews. We were all going to meet up for a year of milestone birthdays - 40th, 50th and 70th birthdays. In the end, all these plans changed. I used half my month's leave to visit SA first to check up on my Dad, the rock in my life that has provided me so much that I have to be grateful for today. To see my Mom who has also always been there for me, and to also support my eldest sister Michelle who was an absolute angel and star for caring for them, even with a whole lot of drama she had of her own.<br />
<br />
It was good to be there, but it didn't feel like a proper holiday. I wished I could have stayed for longer than 2 weeks to be with them.<br />
<br />
I then returned briefly to Netherlands for the starting game of the world cup, and a great braai spent with friends and "second family" here in the Netherlands, before making my way a couple of days later down to Australia to visit my other sister and her family. My brother-in-law had experienced a <a href="https://www.heart.org/en/health-topics/heart-attack/about-heart-attacks/coronary-artery-dissection-not-just-a-heart-attack">SCAD heart attack</a> while in Australia, and it was the first time I was seeing them since they had left to Oz a few years ago.<br />
<br />
My youngest nephew was just over 1 years old when they left, and now he was busy playing with a remote controlled crane (I was kind of jealous, I think I would have loved that toy as a kid, even now :D), talking, playing with his brother. Fighting with his brother. And vice versa :D<br />
<br />
They drove me a bit insane at times, but I love them. Justin reminds me so much of myself when I was younger. I guess that's maybe the scorpio part of us - his birthday is two weeks apart from mine. He also had been having issues with his own health, where his white blood cell count was indetectable for a while, due to what seemed to be an auto-immune disease. I was very worried about my family down under for quite some time.<br />
<br />
These days though, they seem to be doing better. My nephew's WBC count has increased, and he is on a lower dosage of the medicine he needed, and that makes me so happy. My brother in law can also do a bit more fitness, though, I still think he should be resting - I think he knows it too, he is just stubborn, and can't sit still!<br />
<br />
My Dad, his chemotherapy sessions are almost done, and he seems to have been doing great with it. Except this week he also was back in hospital with a pain in his side. The scans seemed to show that it might be kidney stones maybe that passed before the scan, or that can't be seen in the scan. He was in the hospital for two nights and I was dreading that he would get coronavirus while there, especially since they kept him in for the two nights because his white blood cell count was lower than it should be. Luckily today he was released to go home.<br />
<br />
On the way he sent a whatsapp text on the family whatsapp group, to see if my Mom needed milk. Rightfully so, she told him to avoid the shops! My Mom also has been having to deal with her eyesight deteriorating, and I guess even worse - having to admit that it is age related! :P<br />
<br />
Not to mention my eldest sister, who recently was also in hospital due to a spider bite while working at a new place on the coast - they recently had to change jobs from where they had setup their business for the past, I dunno, 15 years or so... which was also tough for them. Luckily the bite's venom/poison (never remember the difference) didn't reach her muscles, but eina, the wound looks very painful, and took off a nice chunk of her shoulder. Seems to be healing though, so that's good.<br />
<br />
Especially since she also had to go back to the hospital due to an allergic reaction to the medicine/ointment/gel being used for the wound care treatment. Was very worried about her then. My other brother-in-law was up and down to visit her as well, between having to work until a new skipper arrived, helping to take care of her, and <a href="https://www.facebook.com/thesodwanabaypage/posts/2996602043767214">avoiding riots closing off roads in-between</a> - he'll have to wait for that road to clear... no roads with burning tyres, having to test out 4x4 features of his car to do escape manoeuvres from angry mobs chasing him, not since the last time that's for sure!<br />
<br />
It's all just a little stressful.<br />
<br />
So ja, it has been quite a year or two.<br />
<br />
It is tough to stay positive during times like this. A lot of people are finding it difficult. Some more than others. I can't even begin to imagine what it is like for the poor people of South Africa, and the rest of the world, who don't even have electricity or water normally - nevermind load shedding. I try to stay grateful and positive, and focus on what I have. Focus on what I have been through myself as well to get to where I am today.<br />
<br />
I hope this post didn't ramble on too much, and I hope that this whole coronavirus pandemic gets sorted out.<br />
<br />
Jim Rohn has said it <a href="https://youtu.be/3EIDSDvADhA">best in his one seminar</a>, and various books, where he describes life and business as <a href="https://youtu.be/HMMO-3QEEtQ">the changing of the seasons</a>. There will always be winters, but they always eventually are followed by summers. There are always springtimes, and there are always autumns and harvests. Sometimes the winters are easy and sometimes they are hard, whether it be the actual weather with snow and wind and miserable rain, or the metaphorical winters of financial burdens, heartbreaks, anxiety. These will always be followed by summer - you'll get through the hard times. The one big important part of his message though, is how it is your responsibility to act. You only reap what you sow. You only get a full harvest, if you take advantage in the springtime and plant the seeds (or vice versa, I'm not a farmer, and don't have very good green fingers).<br />
<br />
He was also quite spiritual and religious I believe. And I am too. I strongly believe that I am here, because of the power of prayer and the love of God. I had <a href="https://en.wikipedia.org/wiki/Encephalitis">encephalitis</a> (inflammation of the brain) in university, and could have become brain damaged. I blacked out, I felt like I was descending into hell, and I felt like when I woke up and saw my sister's face the next day, that I had been saved and that I was now safe. While I was not fully concious, I was fighting the nursing staff and my own parents, fists swinging, with them trying to hold me down to my bed so I wouldn't hurt myself, surprised by my strength. The drip in my arm, in my delusion, feeling as if I was stuck in my bed, not able to escape it, being attacked whenever I tried to get out of it. They had to give me a lumber puncture while I was under general anaesthetic because of this. While I was out, I was imagining myself descending into a bottomless pit, and being scared and praying to God to help me.<br />
<br />
I experienced Him before that time as well, when someone close to my family, part of my extended family, seemed to want to try and commit suicide. I prayed as he appeared to disappear from our sight, and I pointed to the horizon in the hope that he would come back at the same point. I kept pointing to that point on the horizon, and prayed words for him to come back to shore safe. He did, and at that point in my life I was very shy, and didn't tell him this. But later that day, he was sharing the story of seeing a bird, all the way out there, as if it was calling him back to shore. The words he said after that, were the exact same words I prayed.<br />
<br />
Even the time I came back from Contiki, after visiting the Vatican, buying a Catholic cross that stood out on a table full of memorabilia, meeting a Catholic girl and visiting a church with her not long after for my first Catholic ceremony, then the next day my previous employer's CEO sending out a company wide email about a Catholic formation class that he was starting. It all seemed to be too much of a coincidence, to be coincidence, and not fate.<br />
<br />
I may be sounding crazy and delusional to some right now, and as your read the above, I wouldn't be surprised either. I have felt the same reading similar things in the past before as well.<br />
<br />
It makes me think of when I was in <a href="https://davidblock.co.za/god-and-the-astronomer/">Prof. David Block's</a> classes, studying Astronomy in university. Not only was he a passionate lecturer, he also appeared to be both scientific and spiritual. I was amazed with the way the universe seemed to be explained by these mathematical equations and how much we knew about the universe, and how little we knew too. Dark matter, finding the "God" particle, what caused the "Big Bang" - was it God the creator that caused it? Who knows. Nobody I guess. I also found it fascinating in university, learning about computational molecular biology, how genes are sequences of genomes, and how Computer Science algorithms to match strings, can help with detecting things genetically. How biology can show evolution with mutations of genes. How artificial intelligence can make us question if we ourselves are even intelligent, creative, or designed to think the way we do with an illusion of intelligence - how is someone that can paint, any less creative than a machine that can learn how to paint, when both may be shaped around their environments and experiences? Are we created, just as we have created AI? Is coincidence a thing, or are things predetermined? If so, do we have free will?<br />
<br />
I didn't study theology or philosophy really, but these kinds of questions have been quite interesting to me for a while now. I also joke sometimes that if you want to become a really good software engineer, first study psychology :D People are the hardest part of understanding software development :D<br />
<br />
Does God exist? We can never prove that. But we can always <i>believe </i>it to be true, and have <i>faith</i>. Is the Bible true? Is the Cathechism true? Which version is right? Nobody truly knows.<br />
<br />
I do know though, that I believe in God, I have felt Jesus' presense or the presense of the Holy Spirit, or both, in my lifetime. At least, I believe I have.<br />
<br />
I pray that the world can be made safe again, healed. That coronavirus can be stopped, that people can be cared for. That the world will unite.<br />
<br />
That is quite a big thing to wish for.<br />
<br />
For now, I just wish that my cough will get better for myself. And for my love to be able to see me again so that we may comfort each other, and live a long, happy life together.<br />
<br />
I love you Alies, and I miss you.<br />
<br />
I feel more calm now, so I will stop writing in this blog post. It is one of the first blog posts I've written in public like this (apart from on social media like Facebook etc.) in a while.<br />
<br />
I hope that if you read this far, that you too stay positive.<br />
<br />
I hope that we can all enjoy the summer together.<br />
<br />
Keep the faith.<br />
<br />
Amen.Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-5388225395868667793.post-59820393538200367222020-02-11T23:37:00.000+02:002020-02-11T23:37:00.770+02:00https://jamiebarrow.devSee here - <a href="https://jamiebarrow.dev/blog/2020-02-04/gatsbyjs-blog">https://jamiebarrow.dev/blog/2020-02-04/gatsbyjs-blog</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5388225395868667793.post-38362025593347463022018-08-21T11:47:00.000+02:002018-08-21T11:52:06.896+02:00git bash - deleted local branchesYou can find out which branches have been merged into a branch by running the below:<br />
<div>
<br /></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">$ git branch --merged origin/master</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">* master</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> feature/some-branch</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> feature/some-other-branch</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
This will also print out master as part of it, so we can then pipe that into grep to match results without master:<br />
<div>
<br /></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">$ git branch --merged origin/master | grep -v master</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> feature/some-branch</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> feature/some-other-branch</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
Obviously, you won't want the name <span style="font-family: "courier new" , "courier" , monospace;">master </span>in your branch name, otherwise it'll be excluded too. You can fancier with regex here.<br />
<br />
Now we can take this result and pipe it into <span style="font-family: "courier new" , "courier" , monospace;">xargs</span>, to run <span style="font-family: "courier new" , "courier" , monospace;">git branch -d</span> passing the output as arguments<br />
<br />
<div>
<span style="font-family: "courier new" , "courier" , monospace;">$ git branch --merged origin/master</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> | grep -v master</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> | xargs -r git branch -d</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
I'm splitting up the command onto separate lines for readability. The <span style="font-family: "courier new" , "courier" , monospace;">-r</span> will only run the git command if there is output.<br />
<br />
I've noticed this doesn't always delete all old branches, but it can help. For example, perhaps you had a branch that was a work in progress, or a spike, with changes that aren't merged - this won't be picked up.<br />
<br />
You can do one more trick to detect old branches that have no upstream branch anymore:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">$ git branch -vv</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
This will list branches without an upstream branch with <span style="font-family: Courier New, Courier, monospace;">gone.</span> Those can generally be deleted too.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5388225395868667793.post-54546765076786710212018-08-20T23:25:00.000+02:002018-08-22T10:49:24.376+02:00Today I learned - VSTS CLI and jqToday I learned about the <a href="https://docs.microsoft.com/en-us/cli/vsts/overview?view=vsts-cli-latest" target="_blank">VSTS command line</a> tool from a colleague.<br />
<br />
I might actually have heard about it before, but wasn't able to try it out because I was previously using the on-premise TFS and not the cloud based VSTS, but hey, today I tried it out :)<br />
<br />
For example, you can query VSTS for pull requests you've created by doing the following:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">$ cd /your-vsts-git-repo</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">$ vsts login</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">$ vsts code pr list --creator "James Barrow"</span><br />
<br />
This will return a JSON object containing info about what pull requests you have created.<br />
<br />
If you don't really care about the entire structure, you can then use another command line tool I've come across before called <a href="https://stedolan.github.io/jq/" target="_blank">jq</a>.<br />
<br />
For example, if you only care about the title, status and url of the pull request, you could do the following:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">$ vsts code pr list --creator "James Barrow" | jq ".[] | { title, status, url }"</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
That's a long command, but what it basically does is pipes the JSON result into jq, which parses it by taking each element in the array of the result, and then filtering it to only take the title, status and url properties of each item in the array.<br />
<br />
And finally, since we all know the best way to use git is via the command line and git bash, you can then also create a bash alias in your <span style="font-family: "courier new" , "courier" , monospace;">~/.bashrc</span> file:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">alias prs='vsts code pr list --creator "James Barrow" | jq ".[] | {title,status,url}"'</span><br />
<br />
So you can just check for your pull requests now by simply running:<br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">$ prs</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">{</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> </span><span style="font-family: "courier new" , "courier" , monospace;">"title": "RE #1234 - some pull request",</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> "status": "active",</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> "url": "https://blah.visualstudio.com/.../pullRequests/2345"</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">}</span><br />
<br />
Which gives you something like that ;)<br />
<br />
Much simpler than having to open up Chrome, go to VSTS, find the right tab for pull requests, etc...<br />
<div>
<br /></div>
<div>
I want to dig more into using jq to pull out info on if the pull requests have had votes as well, so I can just run a command from my command line and see if I need to follow up on a PR or not, but this will have to wait for another day :)</div>
<div>
<br /></div>
<div>
One last note is that use of single and double quotes might be important depending on your shell of choice, so keep that in mind too.</div>
<div>
<br /></div>
<div>
Hope this helped someone.<br />
<br />
<b>UPDATE: </b>There is also <span style="font-family: Courier New, Courier, monospace;">vsts code pr list -o table</span> which prints a nice format</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5388225395868667793.post-53994204976606047192018-06-28T22:53:00.001+02:002018-07-07T05:22:44.306+02:00AngularJS to Angular, JavaScript to TypeScript, Gulp to webpack to Angular CLISo I jotted down a whole lot of links for when I was learning webpack, and thought maybe someday I'd write a blog post, but that I probably wouldn't really. That day may come, but that day is not now :P Posting this in case others may want to browse through the links that I found useful when trying to convert an application in AngularJS 1.x with Gulp, using ngupgrade with Angular5 and webpack, onto just one build with the Angular CLI.<br />
<br />
<a href="https://youtu.be/ivQ7HrnBJe8">https://youtu.be/ivQ7HrnBJe8</a><br />
<br />
<a href="https://webpack.academy/p/web-fundamentals">https://webpack.academy/p/web-fundamentals</a><br />
<br />
<a href="https://what-problem-does-it-solve.com/webpack">https://what-problem-does-it-solve.com/webpack</a><br />
<br />
<a href="https://survivejs.com/webpack/foreword/">https://survivejs.com/webpack/foreword/</a><br />
<br />
<a href="https://webpack.js.org/configuration/">https://webpack.js.org/configuration/</a><br />
<br />
<a href="https://webpack.js.org/api/">https://webpack.js.org/api/</a><br />
<br />
<a href="https://webpack.js.org/api/loaders/">https://webpack.js.org/api/loaders/</a><br />
<a href="https://medium.com/@MarkPieszak/using-pug-or-jade-templates-with-the-angular-cli-9e37334db5bc">https://medium.com/@MarkPieszak/using-pug-or-jade-templates-with-the-angular-cli-9e37334db5bc</a><br />
ng add ng-cli-pug-loader<br />
<a href="https://www.npmjs.com/package/pug-html-loader">https://www.npmjs.com/package/pug-html-loader</a><br />
<a href="https://www.npmjs.com/package/exports-loader">https://www.npmjs.com/package/exports-loader</a><br />
<a href="https://github.com/webpack-contrib/copy-webpack-plugin">https://github.com/webpack-contrib/copy-webpack-plugin</a><br />
<a href="https://github.com/webpack-contrib/mini-css-extract-plugin">https://github.com/webpack-contrib/mini-css-extract-plugin</a><br />
DONT USE > <a href="https://github.com/webpack-contrib/extract-text-webpack-plugin">https://github.com/webpack-contrib/extract-text-webpack-plugin</a><br />
<a href="https://github.com/s-panferov/awesome-typescript-loader">https://github.com/s-panferov/awesome-typescript-loader</a><br />
<div>
<a href="https://www.npmjs.com/package/gulp-inject-webpack-plugin">https://www.npmjs.com/package/gulp-inject-webpack-plugin</a><br />
<a href="https://www.npmjs.com/package/indexhtml-webpack-plugin">https://www.npmjs.com/package/indexhtml-webpack-plugin</a><br />
<a href="https://github.com/jharris4/html-webpack-include-assets-plugin">https://github.com/jharris4/html-webpack-include-assets-plugin</a><br />
<a href="https://github.com/altbit/inject-assets-webpack-plugin">https://github.com/altbit/inject-assets-webpack-plugin</a><br />
<br />
<div>
</div>
</div>
<a href="https://github.com/webpack/webpack/releases/tag/v4.0.0-beta.0">v4.0.0-beta.0 Release Notes</a><br />
<br />
<a href="https://gist.github.com/sokra/1522d586b8e5c0f5072d7565c2bee693">https://gist.github.com/sokra/1522d586b8e5c0f5072d7565c2bee693</a><br />
<a href="https://gist.github.com/gricard/e8057f7de1029f9036a990af95c62ba8">https://gist.github.com/gricard/e8057f7de1029f9036a990af95c62ba8</a><br />
<div>
<a href="https://webpack.js.org/configuration/optimization/#optimization-splitchunks">https://webpack.js.org/configuration/optimization/#optimization-splitchunks</a></div>
<div>
<a href="https://webpack.js.org/plugins/split-chunks-plugin/">https://webpack.js.org/plugins/split-chunks-plugin/</a><br />
<a href="https://medium.com/webpack/webpack-4-code-splitting-chunk-graph-and-the-splitchunks-optimization-be739a861366">https://medium.com/webpack/webpack-4-code-splitting-chunk-graph-and-the-splitchunks-optimization-be739a861366</a><br />
<a href="https://www.youtube.com/watch?v=hQBAQh5AFwA">https://www.youtube.com/watch?v=hQBAQh5AFwA</a></div>
<a href="https://webpack.js.org/configuration/optimization/#optimization-minimizer">https://webpack.js.org/configuration/optimization/#optimization-minimizer</a><br />
<a href="https://webpack.js.org/plugins/uglifyjs-webpack-plugin/">https://webpack.js.org/plugins/uglifyjs-webpack-plugin/</a><br />
<div>
<br /></div>
<a href="http://dmachat.github.io/angular-webpack-cookbook/">http://dmachat.github.io/angular-webpack-cookbook/</a><br />
<a href="https://github.com/dmachat/angular-webpack-cookbook/wiki/Angular-Template-Cache">https://github.com/dmachat/angular-webpack-cookbook/wiki/Angular-Template-Cache</a><br />
<br />
<a href="https://github.com/frederikprijck/angularjs-webpack-starter">https://github.com/frederikprijck/angularjs-webpack-starter</a><br />
<a href="https://egghead.io/courses/angular-and-webpack-for-modular-applications">https://egghead.io/courses/angular-and-webpack-for-modular-applications</a><br />
<br />
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5388225395868667793.post-7004582787681519922018-06-13T01:25:00.002+02:002018-06-13T01:25:38.733+02:00PowerShell TipsI'll likely update this as I go along<br />
<br />
<br />
Create a file like you would with touch<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">echo $null > filename</span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5388225395868667793.post-35906355199552364262018-05-16T13:42:00.000+02:002019-03-26T13:21:44.371+02:00git-run for managing many repositoriesSome may make use of a monorepo, <a href="https://cacm.acm.org/magazines/2016/7/204032-why-google-stores-billions-of-lines-of-code-in-a-single-repository/fulltext" target="_blank">for example over there at Google</a>, however for those of us that don't and have to deal with multiple repositories, possibly unrelated ones across various projects, then a great tool to have in your toolbelt is <span style="font-family: "courier new" , "courier" , monospace;"><a href="https://github.com/mixu/gr" target="_blank">git-run</a></span>, or just <span style="font-family: "courier new" , "courier" , monospace;">gr</span>.<br />
<br />
It can keep track of where your repositories are located, and can also be used to tag the various repositories. You can then run a git command across all of these repositories (or based on a tag).<br />
<br />
To set it up:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">$ npm install -g git-run</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">$ git tag discover PATH</span><br />
<br />
One way I have been using that is to create a tag per project, so across a project which may have many repositories, I can see my git status across all of those by executing:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">$ gr @project status</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
It can also run normal shell commands as well<br />
<div>
<br /></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">$ gr @project cat package.json</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<br />
<div>
One thing I realised it didn't do in my git bash shell, was run my aliases that I tend to use (e.g. I have a complicated bash alias for a git log command). But luckily someone else has already got an open <a href="https://github.com/mixu/gr/pull/27/files" target="_blank">pull request</a> to fix this (at least for bash), which suited my needs. Yay for open source!</div>
</div>
<div>
<br /></div>
<div>
Try it out and let me know what you think :)<br />
<br />
Update: I also recently discovered when trying it on a new computer - make sure you don't forget to add tags to the repositories it discovers during <span style="font-family: "courier new" , "courier" , monospace;">gr tag discover</span>, because it won't save its configuration and <a href="https://github.com/mixu/gr/issues/88" target="_blank">you'll get an error</a>.</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5388225395868667793.post-11987636646405028802018-03-26T23:59:00.000+02:002018-05-02T05:31:37.320+02:00Package manager tipsInitially I was just going to post about how to install npm packages while offline, but in case I ever come back to update this page with more tips or package manages, this post is now titled "Package manager tips".<br />
<h3>npm tips</h3><ol><li><a href="https://blog.risingstack.com/nodejs-at-scale-npm-best-practices" target="_blank">Configure initial values</a> for <span style="font-family: "courier new" , "courier" , monospace;">npm init -y</span></li>
<ul><li><span style="font-family: "courier new" , "courier" , monospace;">npm config set init.author.name YOUR_NAME</span></li>
<li><span style="font-family: "courier new" , "courier" , monospace;">npm config set init.author.email YOUR_EMAIL</span></li>
<li><span style="font-family: "courier new" , "courier" , monospace;">npm config set init.license UNLICENSED</span></li>
</ul><li>Installing a package <a href="https://stackoverflow.com/questions/43064107/how-to-install-npm-package-while-offline" target="_blank">offline</a>:</li>
<ul><li>versions older than npm 5, use the <a href="https://addyosmani.com/blog/using-npm-offline" target="_blank">local-npm</a> package</li>
<li><span style="font-family: "courier new" , "courier" , monospace;">npm install --prefer-offline</span></li>
</ul><li>Update a package, e.g. <a href="https://github.com/angular/angular-cli#updating-angular-cli" target="_blank">Angular CLI</a></li>
<ul><li><span style="font-family: "courier new" , "courier" , monospace;">npm uninstall -g @angular/cli</span></li>
<li><span style="font-family: "courier new" , "courier" , monospace;">npm cache verify # if npm < 5, npm cache clean</span></li>
<li><span style="font-family: "courier new" , "courier" , monospace;">npm install -g @angular/cli@latest</span></li>
</ul><li>View the versions of a package:</li>
<ul><li><span style="font-family: "courier new" , "courier" , monospace;">npm view webpack version --json</span></li>
<li><span style="font-family: "courier new" , "courier" , monospace;">npm view webpack versions --json</span></li>
</ul></ol><h3>yarn tips</h3><ol><li>Configure initial values</a> for <span style="font-family: "courier new" , "courier" , monospace;">yarn init -y</span></li>
<ul><li><span style="font-family: "courier new" , "courier" , monospace;">yarn config set init-author-name YOUR_NAME</span></li>
<li><span style="font-family: "courier new" , "courier" , monospace;">yarn config set init-author-email YOUR_EMAIL</span></li>
<li><span style="font-family: "courier new" , "courier" , monospace;">yarn config set init-license UNLICENSED</span></li>
</ul></ol>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5388225395868667793.post-64465960687948473612018-01-19T16:08:00.000+02:002018-01-22T13:46:15.126+02:00CommonAssemblyInfoI'm writing this post since I posted this on Twitter, and within half an hour, was asked to share my knowledge:<br />
<br />
<blockquote class="twitter-tweet" data-lang="en">
<div dir="ltr" lang="en">
I'm still surprised these days when senior developers don't know about the CommonAssemblyInfo trick</div>
β James Barrow (@jamiebarrow) <a href="https://twitter.com/jamiebarrow/status/954314291838103552?ref_src=twsrc%5Etfw">January 19, 2018</a></blockquote>
<script async="" charset="utf-8" src="https://platform.twitter.com/widgets.js"></script><br />
In Visual Studio, there's a little known feature that lets you add files as links to a project. Using this trick, we can also ease maintenance slightly by having a CommonAssemblyInfo.cs file where common attributes across the assemblies in a solution can be applied, but maintained in a single file.<br />
<br />
Here is the sample demo application to show the steps one normally goes through. We have an existing command line utility to calculate tax based on an entered amount and tax rate. Quite simple.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLPHBs6_ZhaKevThXHJX2fCJNFBoCph_LxoCVo6IzLBG_DJMFIbE_ZFMbCqt5SXNYxICYWCy-3Mv7zbxr82OGQa7jHcUu4oGz33iYssF7iujadWctRn93rXrpTWCskoBsM0uqa6ggeKf1Y/s1600/01.png" imageanchor="1"><img border="0" data-original-height="496" data-original-width="1065" height="185" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLPHBs6_ZhaKevThXHJX2fCJNFBoCph_LxoCVo6IzLBG_DJMFIbE_ZFMbCqt5SXNYxICYWCy-3Mv7zbxr82OGQa7jHcUu4oGz33iYssF7iujadWctRn93rXrpTWCskoBsM0uqa6ggeKf1Y/s400/01.png" width="400" /></a></div>
<br />
In the Properties folder there is an AssemblyInfo.cs file listing the various attributes applied to the assembly.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiG7wEFZRwTLe-T94LshnTSgW3k5_m2zK6iEq4zvY0e80GaEPuf0qSYWdSZc7f8Ej2vTzrJ_8qUxO1r_yh8lOhZIUcmcH3IhUqy8W36GMETgkf4er7f1ciZqcaSe_I5KCfnN5loBDnys4dj/s1600/02.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="728" data-original-width="1064" height="272" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiG7wEFZRwTLe-T94LshnTSgW3k5_m2zK6iEq4zvY0e80GaEPuf0qSYWdSZc7f8Ej2vTzrJ_8qUxO1r_yh8lOhZIUcmcH3IhUqy8W36GMETgkf4er7f1ciZqcaSe_I5KCfnN5loBDnys4dj/s400/02.png" width="400" /></a></div>
<br />
This isn't always set up as expected, because most people forget to look at this file. One thing that stands out for example is the Company and Copyright information is defaulted sometimes to Microsoft or some other vendor based on the system settings. This may be undesirable, and so we can update these settings.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwJ5bbvfFmyPfBsxxG9WEi4Mo_20WQXRyNsznMJn6QRx_B5f2zD4Mz7epCF6jJnCkB1zdjUybl516q9eaa3WXHFjwBVbSZpN1YtgBrzN488RprpsOHPcAWNEL9DfmkN1GIENEQObw27iYY/s1600/03.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="727" data-original-width="1065" height="272" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwJ5bbvfFmyPfBsxxG9WEi4Mo_20WQXRyNsznMJn6QRx_B5f2zD4Mz7epCF6jJnCkB1zdjUybl516q9eaa3WXHFjwBVbSZpN1YtgBrzN488RprpsOHPcAWNEL9DfmkN1GIENEQObw27iYY/s400/03.png" width="400" /></a></div>
<br />
See some links at the bottom of this page for more info on these attributes.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP0fbJzzxW6slokfJB1R2YEcMVWL4uMEyKVXr403LXzj5m_ocLT1m8WwGqdojfuHUpab67sXAlILnDTeuhKWX-n_2lQ0yP2-nd-lUVo2prHwBzAhOviMljmXjbnLG7eUBY7h3WEuLrsz3u/s1600/04.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="529" data-original-width="385" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP0fbJzzxW6slokfJB1R2YEcMVWL4uMEyKVXr403LXzj5m_ocLT1m8WwGqdojfuHUpab67sXAlILnDTeuhKWX-n_2lQ0yP2-nd-lUVo2prHwBzAhOviMljmXjbnLG7eUBY7h3WEuLrsz3u/s400/04.png" width="290" /></a></div>
<br />
<br />
You can see these are shown in the properties on the executable that is built.<br />
<br />
Maybe we go back to look at our application and want to separate out the domain aspects of the console application, perhaps because in future we may want to share that with a web application frontend. The first step one would do is creating a new project and moving the classes around, fixing references, etc.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiemVcIbPV0FB86CQCoJmMZldFEAalh2BWWHMSsY0udYSjITWCI3X72Gi5VJhK5W81seIlREH__2e5GtRNA9W9TPY1yArEnEkwb4mGnkMtgKX3oKtTv8UYRnKAuNES03Etnn8QQ-L41ugu/s1600/05.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="727" data-original-width="1063" height="272" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiemVcIbPV0FB86CQCoJmMZldFEAalh2BWWHMSsY0udYSjITWCI3X72Gi5VJhK5W81seIlREH__2e5GtRNA9W9TPY1yArEnEkwb4mGnkMtgKX3oKtTv8UYRnKAuNES03Etnn8QQ-L41ugu/s400/05.png" width="400" /></a></div>
<br />
But you'll notice that most of these attributes are the same. The only two that maybe would be different are actually just the title of the assembly and the Guid it uses. If we rename things someday, we'd have to update at least two files (maybe we rename CommonAssemblyInfoDemo to something more useful, for example).<br />
<br />
The first thing I usually do when creating a solution with more than one project, is first creating a file called CommonAssemblyInfo.cs that lives in the same directory as the solution file (CommonAssemblyInfoDemo.sln). This is usually done outside of Visual Studio, and then using Visual Studio to add the existing item to the solution, to make it easier to edit. I also setup solution folders that are numbered to keep things nicely organised.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiivWwO1nH9iYsjyg20ubYW-AaaxDbonsyH-HsJ__oM6wCfXl2F4_Cy6q2KLWU71gn02LiljaJZL8HCehkqqfGGJ7LS-qtwpL7oUd9Wgphzbiu9OET5JtsHzi8lFFONCwF64WCJt5h5HA5B/s1600/06.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="669" data-original-width="1077" height="247" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiivWwO1nH9iYsjyg20ubYW-AaaxDbonsyH-HsJ__oM6wCfXl2F4_Cy6q2KLWU71gn02LiljaJZL8HCehkqqfGGJ7LS-qtwpL7oUd9Wgphzbiu9OET5JtsHzi8lFFONCwF64WCJt5h5HA5B/s400/06.png" width="400" /></a></div>
<br />
You'll notice that only the common attributes are left in this file. But we still need to incorporate it into the other projects.<br />
<br />
To do this, we also need to add it as an existing item to each project, however, there is a trick - we need to add it as a link.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjITXFKj0k11InVKMH2oCgravE7-ux9SuJDCjzzK1bZFiQksPFconPgit3qdJBKNq-r58DA5mbqdW4FDqR8NGYF7Iife5NcDOAf4TZVo4vRUGBcuzsOyLd3DYDsSzrsG-xHMvim2nss4ob3/s1600/06b.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="146" data-original-width="627" height="92" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjITXFKj0k11InVKMH2oCgravE7-ux9SuJDCjzzK1bZFiQksPFconPgit3qdJBKNq-r58DA5mbqdW4FDqR8NGYF7Iife5NcDOAf4TZVo4vRUGBcuzsOyLd3DYDsSzrsG-xHMvim2nss4ob3/s400/06b.png" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUHFKe33s8GrzkzejDHqgFi_r2A7lcV5JK4nYAfSgEMy-8bnT7WCbzNk-dhlGxO7q71JHnLV7Ls2fYR1FXnqhrUAdXdWB4o6a3BZz3btWvYBHkOQi0gKzwljE0FgVh136UH2jV8-xQTERQ/s1600/09.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="466" data-original-width="792" height="235" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUHFKe33s8GrzkzejDHqgFi_r2A7lcV5JK4nYAfSgEMy-8bnT7WCbzNk-dhlGxO7q71JHnLV7Ls2fYR1FXnqhrUAdXdWB4o6a3BZz3btWvYBHkOQi0gKzwljE0FgVh136UH2jV8-xQTERQ/s400/09.png" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0sQWw7K2dVLHZuf9qlzNGIjP73UTp6AAn7yOy9dDXVc2Na9S0pnH8kmD68JNADZ2fycQlEpRTNaNfMg55955c2RvCMKyFVkGJuJ92AogmjfPfZ_wr4q-vkoBeXgSt7V9Gb0jBMhqvR9_g/s1600/06c.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="93" data-original-width="296" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0sQWw7K2dVLHZuf9qlzNGIjP73UTp6AAn7yOy9dDXVc2Na9S0pnH8kmD68JNADZ2fycQlEpRTNaNfMg55955c2RvCMKyFVkGJuJ92AogmjfPfZ_wr4q-vkoBeXgSt7V9Gb0jBMhqvR9_g/s1600/06c.png" /></a></div>
<br />
You'll notice in the Solution Explorer that the icon of the file has a link symbol in it, to indicate it's just a reference to an existing file, so that all links refer to the same file.<br />
<br />
Now we just update each projects AssemblyInfo to just include the information related specifically to that project.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOKwMDEvF_2cVK7MlODJm4ZSAVN_z4R5CXZRftn-kRxfowCB96JKBMGAjOek9ofc5WDWztQVhN2scnxO8Zc-kEZ9Noc4x7xdVM3kdsoPmc-HjlRdakCJBdGG9JCQ3nfIQoWqlCCMLVqgES/s1600/06d.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="227" data-original-width="1022" height="87" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOKwMDEvF_2cVK7MlODJm4ZSAVN_z4R5CXZRftn-kRxfowCB96JKBMGAjOek9ofc5WDWztQVhN2scnxO8Zc-kEZ9Noc4x7xdVM3kdsoPmc-HjlRdakCJBdGG9JCQ3nfIQoWqlCCMLVqgES/s400/06d.png" width="400" /></a></div>
<br />
If we need to update the AssemblyVersion across the entire solution, it's now a simple matter of just updating the CommonAssemblyInfo file to do this, instead of going through each project and remembering to update each one.<br />
<br />
Hope this helped someone, the extra effort when setting up a new project can sometimes save time in the future.<br />
<br />
For example, if we had a continuous integration build, and we just wanted to update the version number across all these artifacts based on some number set in our CI system, we could just update the CommonAssemblyInfo file before we run the solution through the build.<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<h3>
Links</h3>
<br />
<ul>
<li><a href="https://github.com/jamiebarrow/CommonAssemblyInfoDemo">Sample Code</a></li>
<li><a href="https://docs.microsoft.com/en-us/dotnet/framework/app-domains/set-assembly-attributes" target="_blank">Setting Assembly Attributes</a></li>
<li><a href="https://stackoverflow.com/questions/64602/what-are-differences-between-assemblyversion-assemblyfileversion-and-assemblyin" target="_blank">What are differences between AssemblyVersion, AssemblyFileVersion and AssemblyInformationalVersion?</a></li>
</ul>
<br />
<br />Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-5388225395868667793.post-62215324441337087202017-11-30T20:56:00.000+02:002017-11-30T20:56:05.139+02:00bash startup files and aliasesToday I hosted a Beer and Tech session at Entelect on Automating Database Deployments (with Flyway).<br />
<br />
During the session, I was using the Bash terminal to edit files or run Flyway, and interacting with git quite a bit - as we <i>all </i>know, using git on the command line is the best way to do so ;D<br />
<br />
After the session, a colleague asked me how I created shortcuts for certain commands, and I explained to him how Bash supports aliases and that these can be loaded by a startup file. There are <a href="https://www.gnu.org/software/bash/manual/bash.html#Bash-Startup-Files-1" target="_blank">various startup files</a>, but I tend to use <span style="font-family: "courier new" , "courier" , monospace;">~/.bash_profile </span><span style="font-family: "arial" , "helvetica" , sans-serif;">and not</span><span style="font-family: "courier new" , "courier" , monospace;"> ~/.bashrc.</span><span style="font-family: inherit;"><span style="font-family: Courier New, Courier, monospace;"> H</span>ere a</span><span style="font-family: inherit;"><span style="font-family: inherit;">re</span> some of the shortcuts I currently have setup:</span><br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">alias cls='clear'</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">alias l='ls -Al'</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">alias ..='cd ..'</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">alias gf='git fetch --prune'</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">alias gl='git log --name-status --abbrev-commit'</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">alias grh='git reset --hard'</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">alias gs='git status'</span><br />
<br />
And so on. If you modify the file, you have to re-load these into the current session, or restart a new terminal session. To reload the file, you can just do the following:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">$ . ~/.bash_profile</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: inherit;">Hope this helped someone :)</span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5388225395868667793.post-82892942364034528612017-07-20T15:31:00.001+02:002017-07-20T15:33:00.208+02:00git - exclude files in a diffIn some scenarios you might have a build server that doesn't have access to the Internet, in which case if you're working with something like npm, you might need to commit your node_modules folder to the git repository to get stuff to work.<br />
<br />
Of course, it might be better to setup your own artifact repository such as Nexus on an internal network for these dependencies, BUT, I didn't have that! :D The node_modules are included as part of a commit.<br />
<br />
Having to do a code review of a pull request can be tricky because of this, due to more than 10,000 files being in the commit, of which only 40 are actual source files of interest. We're using TFS 2017 which has a nice web interface for doing this, however it only supports showing 1000 files at a time.<br />
<br />
So back to the best way to use git: the command line :)<br />
<br />
To exclude the node_modules from the diff was as simple as doing the below:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">$ git diff master develop -- . ':!node_modules'</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
Of course, I used <span style="font-family: "courier new" , "courier" , monospace;">difftool</span> because I prefer WinMerge but it works the same.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5388225395868667793.post-17778277925555865552017-04-19T19:18:00.002+02:002017-04-19T19:18:58.529+02:00Finding currently executing queries and parametersIf you've worked with an Object Relational Mapper (ORM) such as Hibernate, NHibernate, Entity Framework, etc., then you'll know these sometimes convert your queries into parameterized queries that can become quite beastly.<br />
<br />
Trying to debug it means either profiling the database to see what queries are executing, and then seeing the query and values from there, or if you can't profile it, maybe selecting from some system tables to do a similar thing.<br />
<br />
This snippet below (<a href="http://stackoverflow.com/questions/2509263/how-to-get-parameter-values-for-dm-exec-sql-text" target="_blank">thanks again StackOverflow</a>) will give you some nice details about the queries on a database, including an XML query plan that contains the parameters that were used when generating the query plan. It can be useful in diagnosing slow queries:<br />
<br />
<pre class="lang-sql prettyprint prettyprinted" style="background-color: #eff0f1; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;"><code style="border: 0px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;"><span class="kwd" style="border: 0px; color: #101094; margin: 0px; padding: 0px;">select</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px;"> </span><span class="pun" style="border: 0px; color: #303336; margin: 0px; padding: 0px;">*</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px;">
</span><span class="kwd" style="border: 0px; color: #101094; margin: 0px; padding: 0px;">from</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px;"> sys</span><span class="pun" style="border: 0px; color: #303336; margin: 0px; padding: 0px;">.</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px;">dm_exec_requests r
</span><span class="kwd" style="border: 0px; color: #101094; margin: 0px; padding: 0px;">cross</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px;"> </span><span class="kwd" style="border: 0px; color: #101094; margin: 0px; padding: 0px;">apply</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px;"> sys</span><span class="pun" style="border: 0px; color: #303336; margin: 0px; padding: 0px;">.</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px;">dm_exec_query_plan</span><span class="pun" style="border: 0px; color: #303336; margin: 0px; padding: 0px;">(</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px;">plan_handle</span><span class="pun" style="border: 0px; color: #303336; margin: 0px; padding: 0px;">)</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px;"> </span><span class="kwd" style="border: 0px; color: #101094; margin: 0px; padding: 0px;">as</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px;"> qp
</span><span class="kwd" style="border: 0px; color: #101094; margin: 0px; padding: 0px;">cross</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px;"> </span><span class="kwd" style="border: 0px; color: #101094; margin: 0px; padding: 0px;">apply</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px;"> sys</span><span class="pun" style="border: 0px; color: #303336; margin: 0px; padding: 0px;">.</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px;">dm_exec_sql_text</span><span class="pun" style="border: 0px; color: #303336; margin: 0px; padding: 0px;">(</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px;">r</span><span class="pun" style="border: 0px; color: #303336; margin: 0px; padding: 0px;">.</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px;">sql_handle</span><span class="pun" style="border: 0px; color: #303336; margin: 0px; padding: 0px;">)</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px;">
</span><span class="kwd" style="border: 0px; color: #101094; margin: 0px; padding: 0px;">where</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px;"> r</span><span class="pun" style="border: 0px; color: #303336; margin: 0px; padding: 0px;">.</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px;">database_id </span><span class="pun" style="border: 0px; color: #303336; margin: 0px; padding: 0px;">=</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px;"> DB_ID</span><span class="pun" style="border: 0px; color: #303336; margin: 0px; padding: 0px;">(</span><span class="str" style="border: 0px; color: #7d2727; margin: 0px; padding: 0px;">'<dbname>'</span><span class="pun" style="border: 0px; color: #303336; margin: 0px; padding: 0px;">)</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px;"> </span></code></pre>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5388225395868667793.post-68782427078408797392017-03-23T11:38:00.003+02:002017-04-19T19:14:03.867+02:00tail on Windows with PowerShellOne of the well known Unix/Linux commands is <span style="font-family: "courier new" , "courier" , monospace;">tail</span>, which gets the tail of a file, meaning the end of a file and prints it out to the output stream.<br />
<br />
I used to try find nice programs for this, including <a href="https://www.baremetalsoft.com/baretail/" target="_blank">Baretail</a> which has some very nice features like colouring lines in that match certain patterns etc.<br />
<br />
But if you just want a simple, and now built into Windows solution, just use PowerShell:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">Get-Content -Tail 10 filename.txt</span><br />
<br />
This will show the last 10 lines of the file. You can even follow the tail, or watch it for changes, as below:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">gc -Tail 10 -Wait filename.txt</span><br />
<br />
Another nice thing you can do is then pipe this into <span style="font-family: "courier new" , "courier" , monospace;">Select-String</span> to filter the output:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">gc -Tail 10 -Wait filename.txt | Select-String -Pattern somepattern</span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5388225395868667793.post-76583291093156349102017-03-20T15:15:00.000+02:002017-03-20T15:15:40.928+02:00diff PDF filesAt a client we have a PDF template that needs to be used for registering users. When this is updated, the template is overriden. But it would be nice to be able to easily see what changed between the two.<br />
<br />
Well, this is possible :)<br />
<br />
You can use <a href="http://imagemagick.org/" target="_blank">Imagemagick</a> and <a href="https://ghostscript.com/" target="_blank">Ghostscript</a> to do this.<br />
<br />
You should be able to just do the below:<br /><br /><span style="font-family: Courier New, Courier, monospace;">magick compare old.pdf new.pdf diff.pdf</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: inherit;">But that didn't seem to work well. What seems to work better is to rather convert the PDF to an image first, and then compare each page.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">magick convert -density 300 -quality 100 old.pdf old.png</span><br />
<span style="font-family: Courier New, Courier, monospace;">magick convert -density 300 </span><span style="font-family: "Courier New", Courier, monospace;">-quality 100</span><span style="font-family: "Courier New", Courier, monospace;"> </span><span style="font-family: "Courier New", Courier, monospace;">new.pdf new.png</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">magick compare old-0.png new-0.png diff-0.png</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: inherit;">Depending on the options you can get better or worse results. Changing the colorspace to CMYK for example could yield better results, or maybe using options to blur/sharpen/despeckle the image too. Try play around with the options to see better results.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">The best results I had was actually via using Adobe Acrobat to first export the PDF to images, and then run the compare. I still need to figure out why, because unfortunately I only have the license at work, so this won't always be an option. I'll hopefully update this post in future to show my favourite variation :)</span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5388225395868667793.post-10092086115148789642017-02-21T13:53:00.000+02:002017-04-06T13:07:20.019+02:00Modern Database Development PracticesBack in November 2012 I presented on this topic at Entelect's Dev Days.<br />
<br />
I've also done a blog post previously on <a href="https://jamiebarrow.blogspot.co.za/2015/12/getting-started-with-automating.html" target="_blank">setting up Flyway</a>.<br />
<br />
I keep referring back to the same links and concepts and this post is here just for that, as a pointer to good resources and brief points about this topic.<br />
<br />
I may revisit it and put down my own consolidated content, but for now this will do.<br />
<ul>
<li>Reading</li>
<ul>
<li><a href="http://www.martinfowler.com/articles/evodb.html" target="_blank">Evolutionary Database Design</a><br />Martin Fowler, 2003</li>
</ul>
<ul>
<li><a href="https://www.amazon.com/Agile-Database-Techniques-Effective-Strategies/dp/0471202835" target="_blank">Agile Database Techniques: Effective Strategies for the Agile Software Developer</a><br />Scott Ambler, 2003</li>
<li><a href="https://www.amazon.com/Refactoring-Databases-Evolutionary-paperback-Addison-Wesley/dp/0321774515" target="_blank">Refactoring Databases: Evolutionary Database Design</a><br />Scott Amber and Pramod Sadalage, 2006</li>
<li><a href="http://www.agiledata.org/essays/databaseRefactoringCatalog.html" target="_blank">Catalog of Database Refactorings</a><br />Scott Ambler</li>
<li><a href="http://odetocode.com/blogs/scott/archive/2008/01/30/three-rules-for-database-work.aspx" target="_blank">Three Rules for Database Work</a><br />K. Scott Allen, 2008</li>
<li><a href="http://odetocode.com/blogs/scott/archive/2008/01/31/versioning-databases-the-baseline.aspx" target="_blank">The Baseline</a><br />K. Scott Allen, 2008</li>
<li><a href="http://odetocode.com/blogs/scott/archive/2008/02/02/versioning-databases-change-scripts.aspx" target="_blank">Change Scripts</a><br />K. Scott Allen, 2008</li>
<li><a href="http://odetocode.com/blogs/scott/archive/2008/02/02/versioning-databases-views-stored-procedures-and-the-like.aspx" target="_blank">Versioning Databases - Views, Stored Procedures, and the Like</a><br />K. Scott Allen, 2008</li>
<li><a href="http://odetocode.com/blogs/scott/archive/2008/02/03/versioning-databases-branching-and-merging.aspx" target="_blank">Versioning Databases - Branching and Merging</a><br />K. Scott Allen, 2008</li>
<li><a href="http://www.ambysoft.com/onlineWritings.html" target="_blank">Scott Ambler's Articles</a><br />Scott Ambler</li>
<li><a href="http://www.sqlservercentral.com/stairway/109328/" target="_blank">Stairway to Database Source Control</a><br />SQL Server Central</li>
</ul>
<li>Martin Fowler's Practices</li>
<ul>
<li>DBAs collaborate closely with developers</li>
<li>Everybody gets their own database instance</li>
<li>Developers frequently integrate into a shared master</li>
<li>A database consists of schema and test data</li>
<li>All changes are database refactorings</li>
<li>Automate the refactorings</li>
<li>Automatically Update all Database Developers</li>
<li>Clearly separate all database access code</li>
</ul>
<li>K. Scott Allen's 3 Rules</li>
<ul>
<li>Never use a shared database for development work</li>
<li>Always have an authoritative source for your schema</li>
<li>Always version your database</li>
</ul>
<li>Tools</li>
<ul>
<li><a href="http://www.red-gate.com/products/" target="_blank">Redgate Developer Tools</a></li>
<li><a href="https://blogs.msdn.microsoft.com/ssdt/" target="_blank">SQL Server Data Tools (SSDT)</a></li>
<li><a href="https://msdn.microsoft.com/en-us/library/dn481501(v=vs.113).aspx" target="_blank">Entity Framework Code First Migrations</a></li>
<li><a href="https://dbup.github.io/" target="_blank">DbUp</a></li>
<li><a href="https://flywaydb.org/" target="_blank">Flyway</a></li>
<li><a href="http://opendbdiff.codeplex.com/" target="_blank">Open DBDiff</a></li>
<li><a href="https://msdn.microsoft.com/en-us/library/ms162773.aspx" target="_blank">sqlcmd</a></li>
<li><a href="http://tsqlt.org/" target="_blank">tSQLt</a></li>
<li><a href="https://github.com/tackley/dbdeploy" target="_blank">dbdeploy</a></li>
</ul>
</ul>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5388225395868667793.post-92154818612233056072017-02-15T13:20:00.003+02:002017-02-23T23:07:26.278+02:00C# - Testing that different cultures won't affect formattingEver worked on a system where you write code and test it and it all works perfect, but then maybe a unit test starts failing on a build server, or maybe a report looks wrong to the consumers of the report, all because it formatted a number to <span style="font-family: "courier new" , "courier" , monospace;">"12345,67"</span> instead of <span style="font-family: "courier new" , "courier" , monospace;">"12345.67"</span>?<br />
<br />
This tip will help you.<br />
<br />
First, lets assume we have this code:<br />
<br />
<pre><span style="font-family: "courier new" , "courier" , monospace;">public class ReportFormatter
{
public string Format(decimal value)
{
return value.ToString();
}
}
</span></pre>
<br />
And a nice little unit test for it:<br />
<br />
<pre><span style="font-family: "courier new" , "courier" , monospace;">[TestClass]
public sealed class ReportFormatterTest
{
[TestMethod]
public void Format()
{
var sut = new ReportFormatter();
var result = sut.Format(12345.67M);
Assert.AreEqual("12345.67", result);
}
}</span>
</pre>
<br />
This works perfectly fine. Lets even imagine that all our machines all have the same setup, and all are set to use the same regional settings. Great, nothing should ever break.<br />
<br />
Until maybe Microsoft releases a patch to Windows that changes our regional settings to be "correct" - in fact, <a href="http://www.sadev.co.za/content/how-correctly-format-currency-south-africa">South Africa should be using a comma as a separator</a>... even though none of us use this standard :D<br />
<br />
So then it breaks our code, and our business rules that disagree with it.<br />
<br />
Well, the good news is we can change the regional settings of the running thread, by changing its CultureInfo details. Here is a little utility class to do so:<br />
<br />
<pre><span style="font-family: "courier new" , "courier" , monospace;">public class TemporaryCultureSwitch : IDisposable
{
private readonly CultureInfo _originalCulture;
private readonly CultureInfo _originalUICulture;
public TemporaryCultureSwitch(CultureInfo cultureInfo)
{
_originalCulture = Thread.CurrentThread.CurrentCulture;
_originalUICulture = Thread.CurrentThread.CurrentUICulture;
Thread.CurrentThread.CurrentCulture = cultureInfo;
Thread.CurrentThread.CurrentUICulture = cultureInfo;
}
public TemporaryCultureSwitch(string cultureName) : this(new CultureInfo(cultureName)) { }
public void Dispose()
{
Thread.CurrentThread.CurrentCulture = _originalCulture;
Thread.CurrentThread.CurrentUICulture = _originalUICulture;
}
}</span>
</pre>
<br />
We can now update our test to be a bit more specific:<br />
<br />
<pre><span style="font-family: "courier new" , "courier" , monospace;">[TestMethod]
public void FormatShouldNotBeAffectedByCultureChanges()
{
var culture = new CultureInfo("en-ZA");
culture.NumberFormat.NumberDecimalSeparator = ",";
using (new TemporaryCultureSwitch(culture))
{
var sut = new ReportFormatter();
var result = sut.Format(12345.67M);
Assert.AreEqual("12345.67", result);
}
}
</span></pre>
<br />
Now we have a test that will fail consistently! Time to fix the code. One way of doing this is realizing that there is an overload of Decimal.ToString that takes in a CultureInfo object. We actually can use the InvariantCulture as below:<br />
<br />
<pre><span style="font-family: "courier new" , "courier" , monospace;">public string Format(decimal value)
{
return value.ToString(CultureInfo.InvariantCulture);
}</span>
</pre>
<br />
The test passes and we now know for sure that regional settings won't affect our code.<br />
<br />Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-5388225395868667793.post-23560324915032983312017-01-25T23:31:00.000+02:002017-01-25T23:31:38.907+02:00Uninstall Windows Service using PowerShellYou can get a list of services using the <span style="font-family: Courier New, Courier, monospace;">Get-Service</span> cmdlet, for example, to retrieve a list of all running services you could run:<br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Get-Service | Where-Object { $_.Status -eq "Running" }</span><br />
<br />
You could even retrieve a specific service and start/stop it:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">$service = Get-Service DemoService</span><br />
<span style="font-family: Courier New, Courier, monospace;">$service.Start()</span><br />
<span style="font-family: Courier New, Courier, monospace;">$service.Stop()</span><br />
<br />
However, there is nothing to remove the service on this object.<br />
<br />
We can also use <span style="font-family: Courier New, Courier, monospace;">GetWmiObject</span><span style="font-family: inherit;"> to do the sam</span>e things:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">$service = Get-WmiObject Win32_Service -Filter "name='DemoService'"</span><br />
<span style="font-family: Courier New, Courier, monospace;">$service.StartService()</span><br />
<span style="font-family: Courier New, Courier, monospace;">$service.StopService()</span><br />
<br />
But this WMI object actually also exposes a delete functionality, which will mark the service to be deleted.<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">$service = Get-WmiObject Win32_Service -Filter "name='DemoService'"</span><br />
<span style="font-family: Courier New, Courier, monospace;">$service.Delete()</span><br />
<br />
If there are resources that are being held onto, it will only be deleted once they're freed up - whether it's the service that needs to gracefully shutdown still, or maybe the services manager snap-in (services.msc) has an open properties window open (I think that's happened to me before), and closing it then puts the delete through.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5388225395868667793.post-40116400510955511102016-07-07T11:13:00.000+02:002017-02-23T22:45:24.339+02:00Updating NuGet extension on Visual Studio 2015<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<div style="margin-bottom: 12px;">
NuGet is pretty awesome, though for some reason the <a href="https://visualstudiogallery.msdn.microsoft.com/5d345edc-2e2d-4a9c-b73b-d53956dc458d" style="color: #0089cf; text-decoration: none;" target="_blank">NuGet Package Manager for Visual Studio 2015 extension</a> was re-done and every time I try to update it I get an error, and then the extension seems to not work when restarting Visual Studio.</div>
<div style="margin-bottom: 12px;">
Took quite a while to figure out why, but it seems that it's to do with not being able to uninstall the old version of the extension. Extensions are installed into the folder <strong>C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions </strong>(or similar depending on the VS version). Certain folders in this path relate to an extension per folder, those that look like randomly generated names specifically, as below:</div>
</div>
<div align="center" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin-bottom: 12px;">
<img alt="404 - Image Not Found" src="https://yoda.entelect.co.za/assets/attachments/10000/01.png" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /></div>
<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<div style="margin-bottom: 12px;">
Each time the NuGet extension tried to update, it would fail to remove the old installation, and then create a new folder for the 'upgrade'. If you tried to upgrade it a few times, you may have quite a few folders that contain the NuGet extension. When you restart VS it seems to have issues loading the extension because of this. Go through each of these to find those folders, e.g.:</div>
</div>
<div align="center" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin-bottom: 12px;">
<img alt="404 - Image Not Found" src="https://yoda.entelect.co.za/assets/attachments/10000/02.png" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /></div>
<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<div style="margin-bottom: 12px;">
Close Visual Studio, and then delete each of those folders specific to the NuGet extension. Then manually download the VSIX extension installer from the website, and install it outside of Visual Studio. Once complete, start up Visual Studio and the extension should be installed properly. Whether it works or not is another thing, it seems the GUI is quite buggy with this extension, so I prefer using the Package Manager Console.</div>
<div style="margin-bottom: 12px;">
Hope this helps someone, I've had to come back to doing this a few times, so it'll definitely help me in future I'm sure :D</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5388225395868667793.post-46115518510853051692016-03-18T11:38:00.000+02:002017-02-23T23:11:49.083+02:00Set up IIS using PowerShell<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<div style="margin-bottom: 12px;">
When you're setting up a new server there are sometimes steps you need to do before you can configure your website, such as turning on Windows Authentication in corporate environments, or perhaps installing the features necessary for an ASP.NET application. I had to do this recently when setting up new servers at a client:</div>
</div>
<div align="center" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin-bottom: 12px;">
<img alt="404 - Image Not Found" src="https://yoda.entelect.co.za/assets/attachments/9910/iis.png" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /></div>
<div align="center" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin-bottom: 12px;">
<img alt="404 - Image Not Found" src="https://yoda.entelect.co.za/assets/attachments/9910/iis2.png" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /></div>
<div align="center" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin-bottom: 12px;">
<img alt="404 - Image Not Found" src="https://yoda.entelect.co.za/assets/attachments/9910/iis3.png" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /></div>
<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<div style="margin-bottom: 12px;">
There was this final screen though where I noticed that this configuration can be exported to an XML file and set up via PowerShell. When inspecting the XML that was generated however, it seemed to include specific host names and so may not be a very generic way of setting up a server. After a bit of investigation, there are other commands that one can run to view what is installed, as well as install specific features.</div>
</div>
<div align="center" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin-bottom: 12px;">
<img alt="404 - Image Not Found" src="https://yoda.entelect.co.za/assets/attachments/9910/iis4.png" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /></div>
<div align="center" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin-bottom: 12px;">
<img alt="404 - Image Not Found" src="https://yoda.entelect.co.za/assets/attachments/9910/iis5.png" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /></div>
<div class="post-codeblock-rich" style="text-align: justify;">
<div style="background-color: white; color: #333333; font-family: "open sans", calibri, candara, arial, sans-serif; font-size: 15px; margin-bottom: 12px;">
Notice too that it seems to install other dependent features by default, as I just specified ASP.NET 4.5 but the other related features were also installed (in the GUI version you would be prompted about this).</div>
<div style="margin-bottom: 12px;">
<span style="color: #333333; font-family: "open sans" , "calibri" , "candara" , "arial" , sans-serif;"><span style="background-color: white; font-size: 15px;">Could be quite useful to have this as a script instead of remembering which features to turn on and off. My PowerShellFu isnβt the strongest, but something along the lines of this should work (I formatted this on separate lines for readability, you will want to run it as a single line):</span></span><br />
<br />
<pre>Get-WindowsFeature -Name Web-*
| Where-Object
{
($_.Name -eq "Web-Asp-Net45" -or $_.Name -eq "Web-Windows-Auth")
-and
$_.InstallState -ne "Installed"
}
| Install-WindowsFeature
</pre>
<br />
This may be a bit more generic, and could be used as a script includ<span style="color: #333333; font-family: "open sans" , "calibri" , "candara" , "arial" , sans-serif;"><span style="background-color: white; font-size: 15px;">ed in source control for setting up new servers, instead of manually doing this via the Server Manager. There are also more advanced options to the cmdlets, more information of which can be seen in the </span></span><a href="https://technet.microsoft.com/en-us/library/jj205467(v=wps.630).aspx" style="background-color: white; color: #0089cf; font-family: "open sans", calibri, candara, arial, sans-serif; font-size: 15px; text-decoration: none;" target="_blank" title="Install-WindowsFeature documentation">documentation</a><span style="color: #333333; font-family: "open sans" , "calibri" , "candara" , "arial" , sans-serif;"><span style="background-color: white; font-size: 15px;">, one example of which is specifying a ComputerName.</span></span></div>
</div>
<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<div style="margin-bottom: 12px;">
One scenario I could think of for this is when setting up a web farm, and perhaps you have multiple hosts you need to do this on. Instead of doing each separately, you could probably pipe in the hostnames to a setup script, and let it perform the setup on each host. Though, as said, my PowerShellFu isn't strong, and I've had issues setting up remote PowerShell admin before, so I'll leave that part up to you ;)</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5388225395868667793.post-54283680755248555452015-12-02T13:41:00.000+02:002017-02-23T22:56:51.123+02:00Getting started with automating database changes using Flyway<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<h2 style="color: #0089cf; font-family: inherit; font-size: 33.75px; line-height: 48px; margin: 12px 0px; text-rendering: optimizeLegibility;">
Intro</h2>
<div style="margin-bottom: 12px;">
For those of us that strive to get to a "One Click Deploy" - where we press a magical button that automatically deploys all of our changes - one of the stumbling blocks during deployment is if there is a relational database involved where schema and/or data changes still need to be run manually.</div>
<div style="margin-bottom: 12px;">
Sometimes this is unavoidable, but assuming it's not, how can we achieve a fully automated deployment when we still need to worry about the database? For the trolls out there, don't say "Just use NoSQL".</div>
<div style="margin-bottom: 12px;">
I spoke about the general idea behind database migration strategies at one of Entelect's dev days, and the concepts are still the same (see the end of this article for some references). Since then, there are two tools that I've become aware of: <a href="http://www.liquibase.org/" style="color: #0089cf; text-decoration: none;" target="_blank">Liquibase</a> and <a href="http://flywaydb.org/" style="color: #0089cf; text-decoration: none;" target="_blank">Flyway</a>. This will go through using Flyway with SQL Server 2014.</div>
</div>
<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<h2 style="color: #0089cf; font-family: inherit; font-size: 33.75px; line-height: 48px; margin: 12px 0px; text-rendering: optimizeLegibility;">
Setup Flyway</h2>
<div style="margin-bottom: 12px;">
Flyway is a Java based library, but also comes as a standalone <a href="http://flywaydb.org/documentation/commandline/" style="color: #0089cf; text-decoration: none;" target="_blank">command line</a> tool. I think that means you don't need to install the Java Runtime Environment (JRE) to use it, but I already had it installed so haven't verified that yet.</div>
<ol style="margin: 0px 0px 12px 25px; padding: 0px;">
<li style="line-height: 24px;">Go to the <a href="http://flywaydb.org/documentation/commandline/" style="color: #0089cf; text-decoration: none;" target="_blank">Flyway command line</a> page</li>
<li style="line-height: 24px;">Download flyway-commandline-3.2.1.zip</li>
<li style="line-height: 24px;">Unzip to C:\flyway-3.2.1</li>
</ol>
<div style="margin-bottom: 12px;">
Since we're using SQL Server, we also need to make sure the right JDBC drivers are available for Flyway to use. Although the <a href="http://flywaydb.org/documentation/database/sqlserver.html" style="color: #0089cf; text-decoration: none;" target="_blank">documentation</a> does show support for using both the <a href="https://msdn.microsoft.com/en-us/library/mt484311(v=sql.110).aspx" style="color: #0089cf; text-decoration: none;" target="_blank">Microsoft</a> and <a href="http://jtds.sourceforge.net/" style="color: #0089cf; text-decoration: none;" target="_blank">jTDS</a> drivers, I found that the jTDS library doesn't support Windows Authentication mode for SQL Server 2014 (it might for older versions), and I had to download and set up the Microsoft driver in any case:</div>
<ol style="margin: 0px 0px 12px 25px; padding: 0px;">
<li style="line-height: 24px;">Go to the <a href="https://www.microsoft.com/en-za/download/details.aspx?id=11774" style="color: #0089cf; text-decoration: none;" target="_blank">Microsoft JDBC driver download</a> page</li>
<li style="line-height: 24px;">Download either sqljdbc_6.0.6629.101_enu.exe or the sqljdbc_6.0.6629.101_enu.tar.gz tarball (I chose the latter)</li>
<li style="line-height: 24px;">Unzip the tarball</li>
<li style="line-height: 24px;"><a href="https://msdn.microsoft.com/en-us/library/ms378422(v=sql.110).aspx" style="color: #0089cf; text-decoration: none;" target="_blank">Choose the right JAR</a> depending on Java version and JDBC compliance, I went with sqljdbc42.jar, and copy this into C:\flyway-3.2.1\drivers</li>
<li style="line-height: 24px;">Since we need Windows Authentication, copy sqljdbc_auth.dll into a folder on the PATH</li>
<ul style="margin: 0px 0px 0px 25px; padding: 0px;">
<li style="line-height: 24px;">I copied it into C:\flyway-3.2.1 since I'll run the command line tool from that location</li>
</ul>
</ol>
<div style="margin-bottom: 12px;">
There are a few configuration options available, but for now we'll just need to setup our connection string and driver in C:\flyway-3.2.1\conf\flyway.conf:</div>
<pre style="background-color: whitesmoke; border-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.14902); font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 14px; line-height: 24px; margin-bottom: 12px; padding: 11.5px; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;">flyway.url=jdbc:sqlserver://localhost;instanceName=sql2014;database=FlywayDemo;integratedSecurity=true
flyway.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver</pre>
<div style="margin-bottom: 12px;">
Technically you shouldn't need to specifiy the driver explicitly, but I prefer being explicit to avoid surprises. In the above connection, I'm connecting to a database FlywayDemo on a named instance called sql2014, and making use of integrated security (Windows Authentication).</div>
<div style="margin-bottom: 12px;">
You should now be able to run the command below to verify that Flyway can connect to the DB:</div>
</div>
<div align="center" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin-bottom: 12px;">
<img alt="404 - Image Not Found" src="https://yoda.entelect.co.za/assets/attachments/9829/flyway-01.png" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /></div>
<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<div style="margin-bottom: 12px;">
The above shows that it can connect to the database, and that there were no migrations found (we will start with that next). You shouldn't get any errors at this stage, though you may need to configure your database to allow TCP connections if it hasn't been configured to do so already: </div>
</div>
<div align="center" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin-bottom: 12px;">
<img alt="404 - Image Not Found" src="https://yoda.entelect.co.za/assets/attachments/9829/flyway-02.png" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /></div>
<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<h2 style="color: #0089cf; font-family: inherit; font-size: 33.75px; line-height: 48px; margin: 12px 0px; text-rendering: optimizeLegibility;">
Baseline</h2>
<div style="margin-bottom: 12px;">
If you're lucky enough to work on a brand new project with a brand new database, you can just create an empty database, and each change to the database can be created as a new script, each run in order.</div>
<div style="margin-bottom: 12px;">
But most of us have an existing database we want to work from. For this demo, I'll just use a simple database with a single table as below:</div>
</div>
<div align="center" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin-bottom: 12px;">
<img alt="404 - Image Not Found" src="https://yoda.entelect.co.za/assets/attachments/9829/flyway-03.png" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /></div>
<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<div style="margin-bottom: 12px;">
We can use Flyway to baseline this version of the database, say, version 1.0:</div>
</div>
<div align="center" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin-bottom: 12px;">
<img alt="404 - Image Not Found" src="https://yoda.entelect.co.za/assets/attachments/9829/flyway-04.png" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /></div>
<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<div style="margin-bottom: 12px;">
This creates a new database table schema_version in the default schema of the database, and tags the database as version 1.0. We could create a backup of this database, and use it as our baseline database to work off of, and when another user restores the database backup, they can use flyway to inspect what version of the database they are using:</div>
</div>
<div align="center" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin-bottom: 12px;">
<img alt="404 - Image Not Found" src="https://yoda.entelect.co.za/assets/attachments/9829/flyway-06.png" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /></div>
<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<h2 style="color: #0089cf; font-family: inherit; font-size: 33.75px; line-height: 48px; margin: 12px 0px; text-rendering: optimizeLegibility;">
Database migration changes</h2>
<div style="margin-bottom: 12px;">
With Flyway, each change to the database should be scripted as an incremental change. This allows us to migrate database changes forward from whatever current version our database is at. Flyway uses specifc <a href="http://flywaydb.org/documentation/migration/" style="color: #0089cf; text-decoration: none;" target="_blank">conventions</a> for database migration scripts, and we'll follow the default. Scripts are to be placed in the folder C:\flyway-3.2.1\sql, and follow the naming convention prefixVERSIONseparatorDESCRIPTIONsuffix, e.g. V1.1__Some description.sql.</div>
<div style="margin-bottom: 12px;">
Lets say we want to change our database structure to extract the Type column of the Person table into its own table. This would involve:</div>
<ol style="margin: 0px 0px 12px 25px; padding: 0px;">
<li style="line-height: 24px;">Creating a new table, PersonType</li>
<li style="line-height: 24px;">Inserting necessary data into PersonType</li>
<li style="line-height: 24px;">Adding a new PersonTypeId foreign key to Person</li>
<li style="line-height: 24px;">Updating the Person data for the new PersonTypeId</li>
<li style="line-height: 24px;">Dropping the old Type column on the Person table</li>
</ol>
<div style="margin-bottom: 12px;">
We could lump all of these in a new V1.1 script, however the recommended practice is to split each DDL change into its own version, since some database vendors don't handle transactions very well with DDL statements, and Flyway tries to wrap each migration in a transaction so if any migration fails it doesn't leave the database in an inconsistent state.</div>
<div style="margin-bottom: 12px;">
Instead, we'll just make each change it's own script, by default:</div>
<ul style="margin: 0px 0px 12px 25px; padding: 0px;">
<li style="line-height: 24px;">V1.1__Create PersonType.sql</li>
<li style="line-height: 24px;">V1.2__Populate PersonType.sql</li>
<li style="line-height: 24px;">V1.3__Create Person.PersonTypeId.sql</li>
<li style="line-height: 24px;">V1.4__Create FK_Person_PersonType.sql</li>
<li style="line-height: 24px;">V1.5__Update Person.PersonTypeId.sql</li>
<li style="line-height: 24px;">V1.6__Drop Person.Type.sql</li>
<li style="line-height: 24px;">V1.7__Make Person.PersonTypeId NOT NULL.sql</li>
</ul>
<div style="margin-bottom: 12px;">
After we've created these scripts in the sql folder, if we re-run flyway info, we will see that we now have pending changes that need to be applied to the baseline:</div>
</div>
<div align="center" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin-bottom: 12px;">
<img alt="404 - Image Not Found" src="https://yoda.entelect.co.za/assets/attachments/9829/flyway-07.png" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /></div>
<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<div style="margin-bottom: 12px;">
We can then use Flyway to migrate our database to include all of these changes:</div>
</div>
<div align="center" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin-bottom: 12px;">
<img alt="404 - Image Not Found" src="https://yoda.entelect.co.za/assets/attachments/9829/flyway-08.png" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /></div>
<div align="center" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin-bottom: 12px;">
<img alt="404 - Image Not Found" src="https://yoda.entelect.co.za/assets/attachments/9829/flyway-09.png" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /></div>
<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<div style="margin-bottom: 12px;">
You'll notice that the version and description columns are pulled from the filename convention. The checksum column is actually a checksum of the contents of the migration script. That is to avoid changes to scripts that were already run in - instead of changing existing scripts, prefer creating a new script with a new version to do the necessary change. If we did modify a script, and run validate, we should see the issue being highlighted:</div>
</div>
<div align="center" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin-bottom: 12px;">
<img alt="404 - Image Not Found" src="https://yoda.entelect.co.za/assets/attachments/9829/flyway-10.png" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /></div>
<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<div style="margin-bottom: 12px;">
Sometimes though, it may make sense to modify an existing script, as long as it's functionality doesn't change - lets say the script takes forever to run the migration, and we find a way to optimize it, then it makes sense to change the script later on. In this case, we can repair the metadata stored in the version table using the repair command:</div>
</div>
<div align="center" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin-bottom: 12px;">
<img alt="404 - Image Not Found" src="https://yoda.entelect.co.za/assets/attachments/9829/flyway-11.png" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /></div>
<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<h2 style="color: #0089cf; font-family: inherit; font-size: 33.75px; line-height: 48px; margin: 12px 0px; text-rendering: optimizeLegibility;">
Development time considerations</h2>
<div style="margin-bottom: 12px;">
This way of working does mean you'll need to be more vigilant with how you make database changes. Changes should be done in small incremental changes. An issue when working on teams may be deciding on how to allocate version numbers - if we're all working in parallel, we may all choose to pick V1.1, whereas my changes might only be deployed after my colleague's changes, meaning his should be V1.1 and mine V1.2.</div>
<div style="margin-bottom: 12px;">
If you were using feature branches, then you could version your changes for your feature as V1, V2, etc. in a separate folder maybe, and only when merging with the common source repository, would you move the files into the sql migration folder with their actual version numbers, e.g. we merge the development branch, notice that someone has implemented V1.6, we can then decide to rename our scripts V1.7.1 and V1.7.2, etc.</div>
</div>
<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<h2 style="color: #0089cf; font-family: inherit; font-size: 33.75px; line-height: 48px; margin: 12px 0px; text-rendering: optimizeLegibility;">
Continuous Delivery</h2>
<div style="margin-bottom: 12px;">
What this all enables is a truly continuous delivery option. This would be the typical flow:</div>
<ol style="margin: 0px 0px 12px 25px; padding: 0px;">
<li style="line-height: 24px;">Developer checks out latest version of the code</li>
<li style="line-height: 24px;">Developer gets latest database setup</li>
<ul style="margin: 0px 0px 0px 25px; padding: 0px;">
<li style="line-height: 24px;">either restore latest database backup, and migrate pending changes,</li>
<li style="line-height: 24px;">or rebuild the whole database using Flyway</li>
</ul>
<li style="line-height: 24px;">Developer makes changes for their feature, both code and migration scripts</li>
<li style="line-height: 24px;">Developer pushes all changes to source control</li>
<li style="line-height: 24px;">Continuous Integration build runs</li>
<ul style="margin: 0px 0px 0px 25px; padding: 0px;">
<li style="line-height: 24px;">gets latest code</li>
<li style="line-height: 24px;">compiles</li>
<li style="line-height: 24px;">runs tests</li>
<li style="line-height: 24px;">gets Integration Test database setup as above in (2) using the tooling</li>
<li style="line-height: 24px;">runs integration tests</li>
</ul>
<li style="line-height: 24px;">Continuous Deployment build runs</li>
<ul style="margin: 0px 0px 0px 25px; padding: 0px;">
<li style="line-height: 24px;">migrates database</li>
<li style="line-height: 24px;">deploys artifacts</li>
</ul>
</ol>
<div style="margin-bottom: 12px;">
This could be setup to happen automatically for every commit, maybe to deploy to a Quality Assurance or User Acceptance Testing environment (or both). This could even be done to drive Production environment deployments, though that may be more complicated, and may be better done by clicking a button to initiate the deployment rather than automatically deploying after a code change.</div>
</div>
<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<h2 style="color: #0089cf; font-family: inherit; font-size: 33.75px; line-height: 48px; margin: 12px 0px; text-rendering: optimizeLegibility;">
Wrap up</h2>
<div style="margin-bottom: 12px;">
Continuous delivery is a part of the devops community that's getting a lot of focus in recent times. Hopefully this article has inspired someone to automate their own deployment process. For those completely new to the database side of this, I recommend reading the links below. For those that aren't new to this, have you tried this on an actual project, and if so maybe share your war stories in the comments! :)</div>
</div>
<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<h2 style="color: #0089cf; font-family: inherit; font-size: 33.75px; line-height: 48px; margin: 12px 0px; text-rendering: optimizeLegibility;">
References</h2>
<h3 style="color: #555555; font-family: inherit; font-size: 26.25px; line-height: 48px; margin: 12px 0px; text-rendering: optimizeLegibility;">
Tooling</h3>
<ul style="margin: 0px 0px 12px 25px; padding: 0px;">
<li style="line-height: 24px;"><a href="http://flywaydb.org/" style="color: #0089cf; text-decoration: none;" target="_blank">Flyway</a></li>
<li style="line-height: 24px;"><a href="http://liquibase.org/" style="color: #0089cf; text-decoration: none;" target="_blank">Liquibase</a></li>
<li style="line-height: 24px;"><a href="https://msdn.microsoft.com/en-us/library/bb510439.aspx" style="color: #0089cf; text-decoration: none;" target="_blank">Database Engine Scripting</a> (sqlcmd and SQL Server PowerShell)</li>
<li style="line-height: 24px;"><a href="https://dbup.github.io/" style="color: #0089cf; text-decoration: none;" target="_blank">DbUp</a></li>
</ul>
<h3 style="color: #555555; font-family: inherit; font-size: 26.25px; line-height: 48px; margin: 12px 0px; text-rendering: optimizeLegibility;">
Articles</h3>
<ul style="margin: 0px 0px 12px 25px; padding: 0px;">
<li style="line-height: 24px;"><a href="https://yoda.entelect.co.za/post/view/9829/martinfowler.com/articles/evodb.html" style="color: #0089cf; text-decoration: none;" target="_blank">Evolutionary Database Design</a>, Martin Fowler & Pramod Sadalage</li>
<li style="line-height: 24px;"><a href="https://yoda.entelect.co.za/post/view/9829/odetocode.com/blogs/scott/archive/2008/01/30/three-rules-for-database-work.aspx" style="color: #0089cf; text-decoration: none;" target="_blank">Three Rules for Database Work</a>, K. Scott Allen</li>
<li style="line-height: 24px;"><a href="https://yoda.entelect.co.za/post/view/9829/odetocode.com/blogs/scott/archive/2008/02/01/versioning-databases-the-baseline.aspx" style="color: #0089cf; text-decoration: none;" target="_blank">The Baseline</a>, K. Scott Allen</li>
<li style="line-height: 24px;"><a href="https://yoda.entelect.co.za/post/view/9829/odetocode.com/blogs/scott/archive/2008/02/02/versioning-databases-change-scripts.aspx" style="color: #0089cf; text-decoration: none;" target="_blank">Change Scripts</a>, K. Scott Allen</li>
<li style="line-height: 24px;"><a href="https://yoda.entelect.co.za/post/view/9829/odetocode.com/blogs/scott/archive/2008/02/02/versioning-databases-views-stored-procedures-and-the-like.aspx" style="color: #0089cf; text-decoration: none;" target="_blank">Versioning Databases β Views, Stored Procedures, and the Like</a>, K. Scott Allen</li>
<li style="line-height: 24px;"><a href="https://yoda.entelect.co.za/post/view/9829/odetocode.com/blogs/scott/archive/2008/02/03/versioning-databases-branching-and-merging.aspx" style="color: #0089cf; text-decoration: none;" target="_blank">Versioning Database - Branching and Merging</a>, K. Scott Allen</li>
</ul>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5388225395868667793.post-89919651366551128642015-07-21T14:19:00.000+02:002017-02-23T22:58:15.443+02:00Visual Studio tip: Hide selected text<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<div style="margin-bottom: 12px;">
Today I noticed the menu item Edit > Outlining > Stop Hiding Current (CTRL+M CTRL+U), and wondered to myself what it does. Well, turns out you can hide selected areas of text and then later unhide them. But how do you hide them in the first place??</div>
<div style="margin-bottom: 12px; padding-left: 30px;">
"The option to hide a selection only shows in the Outlining menu once you've selected text" - Captain Obvious</div>
<div style="margin-bottom: 12px;">
Thank you Captain Obvious!</div>
<div style="margin-bottom: 12px;">
So as an example, lets say we have one of the controllers for a sample ASP.NET MVC project, and just want to inspect it to see what it does, we see the below action with a long bunch of lines:</div>
</div>
<div align="center" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin-bottom: 12px;">
<img alt="404 - Image Not Found" src="https://yoda.entelect.co.za/assets/attachments/9679/01.png" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /></div>
<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<div style="margin-bottom: 12px;">
We go through the first few lines and realise that's all just code related to validation, followed by loading up an item and some more validation. We're not really interested in the validation just yet so we can just collapse it by selecting those lines, and going Edit > Outlining > Hide Selection (or if like me you like keyboard shortcuts, CTRL+M followed by CTRL+H). We now can see what the method's actually trying to do, and can easily ignore the validation code for now:</div>
</div>
<div align="center" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin-bottom: 12px;">
<img alt="404 - Image Not Found" src="https://yoda.entelect.co.za/assets/attachments/9679/02.png" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /></div>
<div align="center" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin-bottom: 12px;">
<img alt="404 - Image Not Found" src="https://yoda.entelect.co.za/assets/attachments/9679/03.png" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /></div>
<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<div style="margin-bottom: 12px;">
If later you do want to see the folded stuff, it's as easy as expanding the code again. It seems that VS remembers this custom code folding section for later on when I close and open the file, and even after closing VS itself (though I wouldn't rely on it to be there forever... I'm guessing it's stored in some local user settings file).</div>
<div style="margin-bottom: 12px;">
I've seen people use the #region directive a lot for this kind of thing - making the code easier to read - but then someone else who doesn't like #regions will delete it later, or someone will restructure it. The advantage of doing this is that it doesn't affect anyone else on your team.</div>
<div style="margin-bottom: 12px;">
To remove the custom code folded section, just do the opposite, Edit > Outlining > Stop Hiding Current (CTRL+M CTRL+U) ... H for hide, U for unhide.</div>
<div style="margin-bottom: 12px;">
Another use case for this would be doing code reviews, or maybe if you're presenting pieces of code that you don't want the audience to read and get too far ahead of the presentation.</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5388225395868667793.post-78457197368889024292015-05-26T16:39:00.000+02:002017-02-23T23:01:13.015+02:00DIFFERENCE in MS SQL<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<div style="margin-bottom: 12px;">
So, if I had two sets, A and B, and wanted to get all items that are in A but not B, as well as items in B but not A (i.e. the opposite of an intersection), I would have thought I could just do:</div>
<div style="margin-bottom: 12px;">
<br /></div>
</div>
<form style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin: 0px 0px 24px;">
<div class="CodeMirror cm-s-ambiance" style="background: url("data:image/png; box-shadow: black 0px 0px 10px inset; color: #e6e1dc; font-family: Monaco, Menlo, "Andale Mono", "lucida console", "Courier New", monospace !important; line-height: 1.4em; overflow: hidden; position: relative;">
<div style="height: 0px; left: 35px; overflow: hidden; position: relative; top: 7px; width: 3px;">
<textarea autocapitalize="off" autocorrect="off" style="border-color: rgb(204, 204, 204); border-radius: 4px; box-shadow: rgba(0, 0, 0, 0.0745098) 0px 1px 1px inset; color: black; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; height: 1em; line-height: 24px; margin: 0px 0px 12px; outline: none; overflow: auto; padding-left: 0px; padding-top: 0px; position: absolute; transition: border 0.2s linear, box-shadow 0.2s linear; vertical-align: middle; width: 1000px;" tabindex="0"></textarea></div>
<div class="CodeMirror-scroll" style="height: 71px; margin-bottom: -30px; margin-right: -30px; outline: none; overflow: auto; padding-bottom: 30px; padding-right: 30px; position: relative;" tabindex="-1">
<div style="min-height: 100%; position: relative;">
<div class="CodeMirror-sizer" style="margin-left: 31px; min-height: 71px; min-width: 172px; position: relative;">
<div style="position: relative; top: 0px;">
<div class="CodeMirror-lines" style="cursor: text; padding: 4px 0px;">
<div style="outline: none; position: relative;">
<div class="CodeMirror-measure" style="height: 0px; overflow: hidden; position: absolute; visibility: hidden; width: 657.938px;">
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: static; word-break: break-all; word-wrap: normal; z-index: 2;"><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span></pre>
</div>
<div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
1</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"><span class="cm-keyword" style="color: #0cb3e8;">SELECT</span> * <span class="cm-keyword" style="color: #0cb3e8;">FROM</span> A</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
2</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;">DIFFERENCE</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
3</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"><span class="cm-keyword" style="color: #0cb3e8;">SELECT</span> * <span class="cm-keyword" style="color: #0cb3e8;">FROM</span> B</pre>
</div>
</div>
<div class="CodeMirror-cursor" style="border-left: 1px solid rgb(121, 145, 232); border-right: none; height: 15px; left: 4px; position: absolute; top: 3px; visibility: hidden; width: 0px; z-index: 3;">
</div>
</div>
</div>
</div>
</div>
<div style="height: 30px; position: absolute; top: 71px; width: 1px;">
</div>
<div class="CodeMirror-gutters" style="background: url("data:image/png; border-right: 1px solid rgb(77, 77, 77); box-shadow: black 0px 10px 20px; height: 71px; left: 0px; padding-bottom: 30px; position: absolute; top: 0px; z-index: 3;">
<div class="CodeMirror-gutter CodeMirror-linenumbers" style="display: inline-block; height: 71px; margin-bottom: -32px; padding-bottom: 30px; width: 30px;">
</div>
</div>
</div>
</div>
</div>
</form>
<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<div style="margin-bottom: 12px;">
Maybe my memory is failing me, but I thought there was a standard SQL difference operator, but after briefly looking around it seems there isn't.</div>
<div style="margin-bottom: 12px;">
It is possible though, using:</div>
<ol style="margin: 0px 0px 12px 25px; padding: 0px;">
<li style="line-height: 24px;">EXCEPT</li>
<li style="line-height: 24px;">FULL OUTER JOIN</li>
</ol>
<div style="margin-bottom: 12px;">
I just tried it with table variables, set up as below (seems we get the same result with actual tables, but table variables are easier for demo purposes :B)</div>
</div>
<form style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin: 0px 0px 24px;">
<div class="CodeMirror cm-s-ambiance" style="background: url("data:image/png; box-shadow: black 0px 0px 10px inset; color: #e6e1dc; font-family: Monaco, Menlo, "Andale Mono", "lucida console", "Courier New", monospace !important; line-height: 1.4em; overflow: hidden; position: relative;">
<div style="height: 0px; left: 35px; overflow: hidden; position: relative; top: 7px; width: 3px;">
<textarea autocapitalize="off" autocorrect="off" style="border-color: rgb(204, 204, 204); border-radius: 4px; box-shadow: rgba(0, 0, 0, 0.0745098) 0px 1px 1px inset; color: black; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; height: 1em; line-height: 24px; margin: 0px 0px 12px; outline: none; overflow: auto; padding-left: 0px; padding-top: 0px; position: absolute; transition: border 0.2s linear, box-shadow 0.2s linear; vertical-align: middle; width: 1000px;" tabindex="0"></textarea></div>
<div class="CodeMirror-scroll" style="height: 218px; margin-bottom: -30px; margin-right: -30px; outline: none; overflow: auto; padding-bottom: 30px; padding-right: 30px; position: relative;" tabindex="-1">
<div style="min-height: 100%; position: relative;">
<div class="CodeMirror-sizer" style="margin-left: 31px; min-height: 218px; min-width: 532px; position: relative;">
<div style="position: relative; top: 0px;">
<div class="CodeMirror-lines" style="cursor: text; padding: 4px 0px;">
<div style="outline: none; position: relative;">
<div class="CodeMirror-measure" style="height: 0px; overflow: hidden; position: absolute; visibility: hidden; width: 657.938px;">
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: static; word-break: break-all; word-wrap: normal; z-index: 2;"><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span></pre>
</div>
<div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
1</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;">DECLARE @A <span class="cm-keyword" style="color: #0cb3e8;">TABLE</span> (</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
2</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> Number <span class="cm-builtin" style="color: #9999cc;">INT</span> <span class="cm-keyword" style="color: #0cb3e8;">NOT</span> <span class="cm-atom" style="color: #cf7ea9;">NULL</span> PRIMARY KEY</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
3</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;">);</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
4</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> </pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
5</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;">DECLARE @B <span class="cm-keyword" style="color: #0cb3e8;">TABLE</span> (</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
6</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> Number <span class="cm-builtin" style="color: #9999cc;">INT</span> <span class="cm-keyword" style="color: #0cb3e8;">NOT</span> <span class="cm-atom" style="color: #cf7ea9;">NULL</span> PRIMARY KEY</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
7</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;">);</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
8</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> </pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
9</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"><span class="cm-keyword" style="color: #0cb3e8;">INSERT</span> <span class="cm-keyword" style="color: #0cb3e8;">INTO</span> @A (Number) <span class="cm-keyword" style="color: #0cb3e8;">VALUES</span> (<span class="cm-number" style="color: #78cf8a;">2</span>), (<span class="cm-number" style="color: #78cf8a;">4</span>), (<span class="cm-number" style="color: #78cf8a;">6</span>), (<span class="cm-number" style="color: #78cf8a;">8</span>);</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
10</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"><span class="cm-keyword" style="color: #0cb3e8;">INSERT</span> <span class="cm-keyword" style="color: #0cb3e8;">INTO</span> @B (Number) <span class="cm-keyword" style="color: #0cb3e8;">VALUES</span> (<span class="cm-number" style="color: #78cf8a;">1</span>), (<span class="cm-number" style="color: #78cf8a;">2</span>), (<span class="cm-number" style="color: #78cf8a;">3</span>), (<span class="cm-number" style="color: #78cf8a;">5</span>), (<span class="cm-number" style="color: #78cf8a;">8</span>);</pre>
</div>
</div>
<div class="CodeMirror-cursor" style="border-left: 1px solid rgb(121, 145, 232); border-right: none; height: 15px; left: 4px; position: absolute; top: 3px; visibility: hidden; width: 0px; z-index: 3;">
</div>
</div>
</div>
</div>
</div>
<div style="height: 30px; position: absolute; top: 218px; width: 1px;">
</div>
<div class="CodeMirror-gutters" style="background: url("data:image/png; border-right: 1px solid rgb(77, 77, 77); box-shadow: black 0px 10px 20px; height: 218px; left: 0px; padding-bottom: 30px; position: absolute; top: 0px; z-index: 3;">
<div class="CodeMirror-gutter CodeMirror-linenumbers" style="display: inline-block; height: 218px; margin-bottom: -32px; padding-bottom: 30px; width: 30px;">
</div>
</div>
</div>
</div>
</div>
</form>
<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<div style="margin-bottom: 12px;">
EXCEPT way:</div>
</div>
<form style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin: 0px 0px 24px;">
<div class="CodeMirror cm-s-ambiance" style="background: url("data:image/png; box-shadow: black 0px 0px 10px inset; color: #e6e1dc; font-family: Monaco, Menlo, "Andale Mono", "lucida console", "Courier New", monospace !important; line-height: 1.4em; overflow: hidden; position: relative;">
<div style="height: 0px; left: 35px; overflow: hidden; position: relative; top: 7px; width: 3px;">
<textarea autocapitalize="off" autocorrect="off" style="border-color: rgb(204, 204, 204); border-radius: 4px; box-shadow: rgba(0, 0, 0, 0.0745098) 0px 1px 1px inset; color: black; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; height: 1em; line-height: 24px; margin: 0px 0px 12px; outline: none; overflow: auto; padding-left: 0px; padding-top: 0px; position: absolute; transition: border 0.2s linear, box-shadow 0.2s linear; vertical-align: middle; width: 1000px;" tabindex="0"></textarea></div>
<div class="CodeMirror-scroll" style="height: 239px; margin-bottom: -30px; margin-right: -30px; outline: none; overflow: auto; padding-bottom: 30px; padding-right: 30px; position: relative;" tabindex="-1">
<div style="min-height: 100%; position: relative;">
<div class="CodeMirror-sizer" style="margin-left: 31px; min-height: 239px; min-width: 235px; position: relative;">
<div style="position: relative; top: 0px;">
<div class="CodeMirror-lines" style="cursor: text; padding: 4px 0px;">
<div style="outline: none; position: relative;">
<div class="CodeMirror-measure" style="height: 0px; overflow: hidden; position: absolute; visibility: hidden; width: 657.938px;">
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: static; word-break: break-all; word-wrap: normal; z-index: 2;"></pre>
</div>
<div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
1</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;">(</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
2</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> (<span class="cm-keyword" style="color: #0cb3e8;">SELECT</span> * <span class="cm-keyword" style="color: #0cb3e8;">FROM</span> @A)</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
3</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> EXCEPT</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
4</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> (<span class="cm-keyword" style="color: #0cb3e8;">SELECT</span> * <span class="cm-keyword" style="color: #0cb3e8;">FROM</span> @B)</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
5</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;">)</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
6</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"><span class="cm-keyword" style="color: #0cb3e8;">UNION</span></pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
7</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;">(</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
8</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> (<span class="cm-keyword" style="color: #0cb3e8;">SELECT</span> * <span class="cm-keyword" style="color: #0cb3e8;">FROM</span> @B)</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
9</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> EXCEPT</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
10</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> (<span class="cm-keyword" style="color: #0cb3e8;">SELECT</span> * <span class="cm-keyword" style="color: #0cb3e8;">FROM</span> @A)</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
11</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;">);</pre>
</div>
</div>
<div class="CodeMirror-cursor" style="border-left: 1px solid rgb(121, 145, 232); border-right: none; height: 15px; left: 4px; position: absolute; top: 3px; visibility: hidden; width: 0px; z-index: 3;">
</div>
</div>
</div>
</div>
</div>
<div style="height: 30px; position: absolute; top: 239px; width: 1px;">
</div>
<div class="CodeMirror-gutters" style="background: url("data:image/png; border-right: 1px solid rgb(77, 77, 77); box-shadow: black 0px 10px 20px; height: 239px; left: 0px; padding-bottom: 30px; position: absolute; top: 0px; z-index: 3;">
<div class="CodeMirror-gutter CodeMirror-linenumbers" style="display: inline-block; height: 239px; margin-bottom: -32px; padding-bottom: 30px; width: 30px;">
</div>
</div>
</div>
</div>
</div>
</form>
<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<div style="margin-bottom: 12px;">
Quite verbose, but pretty easy to follow.</div>
<div style="margin-bottom: 12px;">
The FULL OUTER JOIN way is also pretty easy to follow:</div>
</div>
<form style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin: 0px 0px 24px;">
<div class="CodeMirror cm-s-ambiance" style="background: url("data:image/png; box-shadow: black 0px 0px 10px inset; color: #e6e1dc; font-family: Monaco, Menlo, "Andale Mono", "lucida console", "Courier New", monospace !important; line-height: 1.4em; overflow: hidden; position: relative;">
<div style="height: 0px; left: 35px; overflow: hidden; position: relative; top: 7px; width: 3px;">
<textarea autocapitalize="off" autocorrect="off" style="border-color: rgb(204, 204, 204); border-radius: 4px; box-shadow: rgba(0, 0, 0, 0.0745098) 0px 1px 1px inset; color: black; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; height: 1em; line-height: 24px; margin: 0px 0px 12px; outline: none; overflow: auto; padding-left: 0px; padding-top: 0px; position: absolute; transition: border 0.2s linear, box-shadow 0.2s linear; vertical-align: middle; width: 1000px;" tabindex="0"></textarea></div>
<div class="CodeMirror-scroll" style="height: 302px; margin-bottom: -30px; margin-right: -30px; outline: none; overflow: auto; padding-bottom: 30px; padding-right: 30px; position: relative;" tabindex="-1">
<div style="min-height: 100%; position: relative;">
<div class="CodeMirror-sizer" style="margin-left: 31px; min-height: 302px; min-width: 469px; position: relative;">
<div style="position: relative; top: 0px;">
<div class="CodeMirror-lines" style="cursor: text; padding: 4px 0px;">
<div style="outline: none; position: relative;">
<div class="CodeMirror-measure" style="height: 0px; overflow: hidden; position: absolute; visibility: hidden; width: 657.938px;">
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: static; word-break: break-all; word-wrap: normal; z-index: 2;"><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span></pre>
</div>
<div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
1</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"><span class="cm-keyword" style="color: #0cb3e8;">SELECT</span></pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
2</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> CASE</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
3</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> WHEN a<span class="cm-variable-2" style="color: #eed1b3;">.Number</span> <span class="cm-keyword" style="color: #0cb3e8;">IS</span> <span class="cm-atom" style="color: #cf7ea9;">NULL</span> THEN b<span class="cm-variable-2" style="color: #eed1b3;">.Number</span></pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
4</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> ELSE a<span class="cm-variable-2" style="color: #eed1b3;">.Number</span></pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
5</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> END</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
6</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"><span class="cm-keyword" style="color: #0cb3e8;">FROM</span></pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
7</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> @A a</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
8</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;">FULL OUTER <span class="cm-keyword" style="color: #0cb3e8;">JOIN</span></pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
9</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> @B b</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
10</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> <span class="cm-keyword" style="color: #0cb3e8;">ON</span> a<span class="cm-variable-2" style="color: #eed1b3;">.Number</span> = b<span class="cm-variable-2" style="color: #eed1b3;">.Number</span></pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
11</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"><span class="cm-keyword" style="color: #0cb3e8;">WHERE</span></pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
12</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> (A<span class="cm-variable-2" style="color: #eed1b3;">.Number</span> <span class="cm-keyword" style="color: #0cb3e8;">IS</span> <span class="cm-atom" style="color: #cf7ea9;">NULL</span> <span class="cm-keyword" style="color: #0cb3e8;">AND</span> B<span class="cm-variable-2" style="color: #eed1b3;">.Number</span> <span class="cm-keyword" style="color: #0cb3e8;">IS</span> <span class="cm-keyword" style="color: #0cb3e8;">NOT</span> <span class="cm-atom" style="color: #cf7ea9;">NULL</span>)</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
13</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> <span class="cm-keyword" style="color: #0cb3e8;">OR</span></pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
14</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> (A<span class="cm-variable-2" style="color: #eed1b3;">.Number</span> <span class="cm-keyword" style="color: #0cb3e8;">IS</span> <span class="cm-keyword" style="color: #0cb3e8;">NOT</span> <span class="cm-atom" style="color: #cf7ea9;">NULL</span> <span class="cm-keyword" style="color: #0cb3e8;">AND</span> B<span class="cm-variable-2" style="color: #eed1b3;">.Number</span> <span class="cm-keyword" style="color: #0cb3e8;">IS</span> <span class="cm-atom" style="color: #cf7ea9;">NULL</span>);</pre>
</div>
</div>
<div class="CodeMirror-cursor" style="border-left: 1px solid rgb(121, 145, 232); border-right: none; height: 15px; left: 4px; position: absolute; top: 3px; visibility: hidden; width: 0px; z-index: 3;">
</div>
</div>
</div>
</div>
</div>
<div style="height: 30px; position: absolute; top: 302px; width: 1px;">
</div>
<div class="CodeMirror-gutters" style="background: url("data:image/png; border-right: 1px solid rgb(77, 77, 77); box-shadow: black 0px 10px 20px; height: 302px; left: 0px; padding-bottom: 30px; position: absolute; top: 0px; z-index: 3;">
<div class="CodeMirror-gutter CodeMirror-linenumbers" style="display: inline-block; height: 302px; margin-bottom: -32px; padding-bottom: 30px; width: 30px;">
</div>
</div>
</div>
</div>
</div>
</form>
<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<div style="margin-bottom: 12px;">
This is probably less easy to maintain, because you have to specifically reference the columns to match on, as well as choose which set to select values from, as is being done in the case statement. This could probably become a bit unwieldly for a table with lots of columns, and hopefully you don't mess up the NULL checks.</div>
<div style="margin-bottom: 12px;">
I did try this out on a query on a customers database though, and found that the full outer join method can be faster. Below are the execution plans for the two queries:</div>
</div>
<div align="center" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin-bottom: 12px;">
<img alt="404 - Image Not Found" src="https://yoda.entelect.co.za/assets/attachments/8603/except.png" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /></div>
<div align="center" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin-bottom: 12px;">
<img alt="404 - Image Not Found" src="https://yoda.entelect.co.za/assets/attachments/8603/full%20outer%20join.png" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /></div>
<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<div style="margin-bottom: 12px;">
So, if I'm reading that right, it's having to go through each table more than once in the EXCEPT case, and only once in the FULL OUTER JOIN, which can make quite the... DIFFERENCE... (sorry couldn't help but make that pun :D).</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5388225395868667793.post-5255392693295654672015-01-09T12:26:00.000+02:002017-02-23T23:04:01.094+02:00Removing NodeJS folder on Windows<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<div style="margin-bottom: 12px;">
When playing around with demo projects on NodeJS, and then later trying to throw them away and delete the folders, you've most likely encountered the error: <strong>The file name is too long</strong>. We'll ignore the question of if it's too long, how it got created in the first place...</div>
<div style="margin-bottom: 12px;">
To illustrate it, create a folder that will cause a long file path. I've had this problem with grunt-contrib-imagemin, so lets install that package too:</div>
</div>
<form style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin: 0px 0px 24px;">
<div class="CodeMirror cm-s-ambiance" style="background: url("data:image/png; box-shadow: black 0px 0px 10px inset; color: #e6e1dc; font-family: Monaco, Menlo, "Andale Mono", "lucida console", "Courier New", monospace !important; line-height: 1.4em; overflow: hidden; position: relative;">
<div style="height: 0px; left: 35px; overflow: hidden; position: relative; top: 7px; width: 3px;">
<textarea autocapitalize="off" autocorrect="off" style="border-color: rgb(204, 204, 204); border-radius: 4px; box-shadow: rgba(0, 0, 0, 0.0745098) 0px 1px 1px inset; color: black; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; height: 1em; line-height: 24px; margin: 0px 0px 12px; outline: none; overflow: auto; padding-left: 0px; padding-top: 0px; position: absolute; transition: border 0.2s linear, box-shadow 0.2s linear; vertical-align: middle; width: 1000px;" tabindex="0"></textarea></div>
<div class="CodeMirror-scroll" style="height: 155px; margin-bottom: -30px; margin-right: -30px; outline: none; overflow: auto; padding-bottom: 30px; padding-right: 30px; position: relative;" tabindex="-1">
<div style="min-height: 100%; position: relative;">
<div class="CodeMirror-sizer" style="margin-left: 31px; min-height: 155px; min-width: 469px; position: relative;">
<div style="position: relative; top: 0px;">
<div class="CodeMirror-lines" style="cursor: text; padding: 4px 0px;">
<div style="outline: none; position: relative;">
<div class="CodeMirror-measure" style="height: 0px; overflow: hidden; position: absolute; visibility: hidden; width: 657.938px;">
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: static; word-break: break-all; word-wrap: normal; z-index: 2;"></pre>
</div>
<div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
1</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;">cd \tmp</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
2</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;">mkdir this-is-probably-a-really-long-folder-name</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
3</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;">cd this-is-probably-a-really-long-folder-name</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
4</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;">mkdir yeah-it-probably-is</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
5</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;">cd yeah-it-probably-is</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
6</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;">npm init</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
7</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;">npm install grunt-contrib-imagemin -D</pre>
</div>
</div>
<div class="CodeMirror-cursor" style="border-left: 1px solid rgb(121, 145, 232); border-right: none; height: 15px; left: 4px; position: absolute; top: 3px; visibility: hidden; width: 0px; z-index: 3;">
</div>
</div>
</div>
</div>
</div>
<div style="height: 30px; position: absolute; top: 155px; width: 1px;">
</div>
<div class="CodeMirror-gutters" style="background: url("data:image/png; border-right: 1px solid rgb(77, 77, 77); box-shadow: black 0px 10px 20px; height: 155px; left: 0px; padding-bottom: 30px; position: absolute; top: 0px; z-index: 3;">
<div class="CodeMirror-gutter CodeMirror-linenumbers" style="display: inline-block; height: 155px; margin-bottom: -32px; padding-bottom: 30px; width: 30px;">
</div>
</div>
</div>
</div>
</div>
</form>
<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<div style="margin-bottom: 12px;">
Now, if you try and delete this folder, you will get the pesky <strong>The file name is too long</strong> error:</div>
</div>
<form style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin: 0px 0px 24px;">
<div class="CodeMirror cm-s-ambiance" style="background: url("data:image/png; box-shadow: black 0px 0px 10px inset; color: #e6e1dc; font-family: Monaco, Menlo, "Andale Mono", "lucida console", "Courier New", monospace !important; line-height: 1.4em; overflow: hidden; position: relative;">
<div style="height: 0px; left: 35px; overflow: hidden; position: relative; top: 7px; width: 3px;">
<textarea autocapitalize="off" autocorrect="off" style="border-color: rgb(204, 204, 204); border-radius: 4px; box-shadow: rgba(0, 0, 0, 0.0745098) 0px 1px 1px inset; color: black; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; height: 1em; line-height: 24px; margin: 0px 0px 12px; outline: none; overflow: auto; padding-left: 0px; padding-top: 0px; position: absolute; transition: border 0.2s linear, box-shadow 0.2s linear; vertical-align: middle; width: 1000px;" tabindex="0"></textarea></div>
<div class="CodeMirror-hscrollbar" style="bottom: 0px; left: 31px; overflow-x: scroll; overflow-y: hidden; position: absolute; right: 0px; z-index: 6;">
<div style="height: 1px; width: 2572px;">
</div>
</div>
<div class="CodeMirror-scroll" style="height: 92px; margin-bottom: -30px; margin-right: -30px; outline: none; overflow: auto; padding-bottom: 30px; padding-right: 30px; position: relative;" tabindex="-1">
<div style="min-height: 100%; position: relative;">
<div class="CodeMirror-sizer" style="margin-left: 31px; min-height: 92px; min-width: 2602px; position: relative;">
<div style="position: relative; top: 0px;">
<div class="CodeMirror-lines" style="cursor: text; padding: 4px 0px;">
<div style="outline: none; position: relative;">
<div class="CodeMirror-measure" style="height: 0px; overflow: hidden; position: absolute; visibility: hidden; width: 2602px;">
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: static; word-break: break-all; word-wrap: normal; z-index: 2;"></pre>
</div>
<div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
1</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;">cd \tmp</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
2</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;">rmdir /s /q this-is-probably-a-really-long-folder-name</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
3</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;">this-is-probably-a-really-long-folder-name\YEAH-I~1\NODE_M~1\GRUNT-~1\NODE_M~1\imagemin\NODE_M~1\IMF332~1\NODE_M~1\gifsicle\NODE_M~1\BIN-BU~1\NODE_M~1\download\NODE_M~1\DECOMP~2\NODE_M~1\TAR-ST~1\NODE_M~1\END-OF~1\NODE_M~1\once\NODE_M~1\wrappy\package.json - The file name is too long.</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
4</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;">...</pre>
</div>
</div>
<div class="CodeMirror-cursor" style="border-left: 1px solid rgb(121, 145, 232); border-right: none; height: 15px; left: 4px; position: absolute; top: 3px; visibility: hidden; width: 0px; z-index: 3;">
</div>
</div>
</div>
</div>
</div>
<div style="height: 30px; position: absolute; top: 92px; width: 1px;">
</div>
<div class="CodeMirror-gutters" style="background: url("data:image/png; border-right: 1px solid rgb(77, 77, 77); box-shadow: black 0px 10px 20px; height: 92px; left: 0px; padding-bottom: 30px; position: absolute; top: 0px; z-index: 3;">
<div class="CodeMirror-gutter CodeMirror-linenumbers" style="display: inline-block; height: 92px; margin-bottom: -32px; padding-bottom: 30px; width: 30px;">
</div>
</div>
</div>
</div>
</div>
</form>
<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<div style="margin-bottom: 12px;">
Le sigh.</div>
<div style="margin-bottom: 12px;">
If you manually try and change into that directory, at some point you'll also get an issue where you can't even change into it because the filename is too long. But wait, if you look at the above, everything is using short file names except the first folder. Hmm, what if we try the short file name?</div>
</div>
<form style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin: 0px 0px 24px;">
<div class="CodeMirror cm-s-ambiance" style="background: url("data:image/png; box-shadow: black 0px 0px 10px inset; color: #e6e1dc; font-family: Monaco, Menlo, "Andale Mono", "lucida console", "Courier New", monospace !important; line-height: 1.4em; overflow: hidden; position: relative;">
<div style="height: 0px; left: 35px; overflow: hidden; position: relative; top: 7px; width: 3px;">
<textarea autocapitalize="off" autocorrect="off" style="border-color: rgb(204, 204, 204); border-radius: 4px; box-shadow: rgba(0, 0, 0, 0.0745098) 0px 1px 1px inset; color: black; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; height: 1em; line-height: 24px; margin: 0px 0px 12px; outline: none; overflow: auto; padding-left: 0px; padding-top: 0px; position: absolute; transition: border 0.2s linear, box-shadow 0.2s linear; vertical-align: middle; width: 1000px;" tabindex="0"></textarea></div>
<div class="CodeMirror-scroll" style="height: 50px; margin-bottom: -30px; margin-right: -30px; outline: none; overflow: auto; padding-bottom: 30px; padding-right: 30px; position: relative;" tabindex="-1">
<div style="min-height: 100%; position: relative;">
<div class="CodeMirror-sizer" style="margin-left: 31px; min-height: 50px; min-width: 217px; position: relative;">
<div style="position: relative; top: 0px;">
<div class="CodeMirror-lines" style="cursor: text; padding: 4px 0px;">
<div style="outline: none; position: relative;">
<div class="CodeMirror-measure" style="height: 0px; overflow: hidden; position: absolute; visibility: hidden; width: 657.938px;">
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: static; word-break: break-all; word-wrap: normal; z-index: 2;"></pre>
</div>
<div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
1</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;">dir /x</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
2</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;">rmdir /s /q THIS-I~1</pre>
</div>
</div>
<div class="CodeMirror-cursor" style="border-left: 1px solid rgb(121, 145, 232); border-right: none; height: 15px; left: 4px; position: absolute; top: 3px; visibility: hidden; width: 0px; z-index: 3;">
</div>
</div>
</div>
</div>
</div>
<div style="height: 30px; position: absolute; top: 50px; width: 1px;">
</div>
<div class="CodeMirror-gutters" style="background: url("data:image/png; border-right: 1px solid rgb(77, 77, 77); box-shadow: black 0px 10px 20px; height: 50px; left: 0px; padding-bottom: 30px; position: absolute; top: 0px; z-index: 3;">
<div class="CodeMirror-gutter CodeMirror-linenumbers" style="display: inline-block; height: 50px; margin-bottom: -32px; padding-bottom: 30px; width: 30px;">
</div>
</div>
</div>
</div>
</div>
</form>
<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<div style="margin-bottom: 12px;">
It works! Well, it did for me at least.</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5388225395868667793.post-28653611595799433852014-12-30T11:23:00.000+02:002014-12-30T11:23:10.875+02:00Finding the hostname for an IP address on WindowsWhen trying to investigate networking issues, most people know about ping and nslookup. I discovered today that there's also a utility called nbtstat to get some NetBIOS info, including the hostname and MAC address from an IP address.<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">nbtstat -a IPADDRESS</span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5388225395868667793.post-12712484789770890042014-12-12T15:04:00.000+02:002017-02-23T23:05:10.457+02:00RequireJS and TypeScript<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<div style="margin-bottom: 12px;">
Here is an example of a RequireJS module:</div>
</div>
<form style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin: 0px 0px 24px;">
<div class="CodeMirror cm-s-ambiance" style="background: url("data:image/png; box-shadow: black 0px 0px 10px inset; color: #e6e1dc; font-family: Monaco, Menlo, "Andale Mono", "lucida console", "Courier New", monospace !important; line-height: 1.4em; overflow: hidden; position: relative;">
<div style="height: 0px; left: 35px; overflow: hidden; position: relative; top: 7px; width: 3px;">
<textarea autocapitalize="off" autocorrect="off" style="border-color: rgb(204, 204, 204); border-radius: 4px; box-shadow: rgba(0, 0, 0, 0.0745098) 0px 1px 1px inset; color: black; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; height: 1em; line-height: 24px; margin: 0px 0px 12px; outline: none; overflow: auto; padding-left: 0px; padding-top: 0px; position: absolute; transition: border 0.2s linear, box-shadow 0.2s linear; vertical-align: middle; width: 1000px;" tabindex="0"></textarea></div>
<div class="CodeMirror-scroll" style="height: 218px; margin-bottom: -30px; margin-right: -30px; outline: none; overflow: auto; padding-bottom: 30px; padding-right: 30px; position: relative;" tabindex="-1">
<div style="min-height: 100%; position: relative;">
<div class="CodeMirror-sizer" style="margin-left: 31px; min-height: 218px; min-width: 523px; position: relative;">
<div style="position: relative; top: 0px;">
<div class="CodeMirror-lines" style="cursor: text; padding: 4px 0px;">
<div style="outline: none; position: relative;">
<div class="CodeMirror-measure" style="height: 0px; overflow: hidden; position: absolute; visibility: hidden; width: 657.938px;">
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: static; word-break: break-all; word-wrap: normal; z-index: 2;"><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span></pre>
</div>
<div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
1</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"><span class="cm-variable" style="color: #b9cc14;">define</span>([], <span class="cm-keyword" style="color: #0cb3e8;">function</span>() {</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
2</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> <span class="cm-keyword" style="color: #0cb3e8;">function</span> <span class="cm-def" style="color: #aac6e3;">Calculator</span>() {</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
3</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> }</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
4</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> </pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
5</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> <span class="cm-variable-2" style="color: #eed1b3;">Calculator</span>.<span class="cm-property" style="color: #eed1b3;">prototype</span>.<span class="cm-property" style="color: #eed1b3;">calculate</span> = <span class="cm-keyword" style="color: #0cb3e8;">function</span> (<span class="cm-def" style="color: #aac6e3;">x</span>, <span class="cm-def" style="color: #aac6e3;">y</span>) {</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
6</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> <span class="cm-keyword" style="color: #0cb3e8;">return</span> <span class="cm-variable-2" style="color: #eed1b3;">x</span> + <span class="cm-variable-2" style="color: #eed1b3;">y</span>;</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
7</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> };</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
8</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> </pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
9</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> <span class="cm-keyword" style="color: #0cb3e8;">return</span> <span class="cm-variable-2" style="color: #eed1b3;">Calculator</span>;</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
10</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;">});</pre>
</div>
</div>
<div class="CodeMirror-cursor" style="border-left: 1px solid rgb(121, 145, 232); border-right: none; height: 15px; left: 4px; position: absolute; top: 3px; visibility: hidden; width: 0px; z-index: 3;">
</div>
</div>
</div>
</div>
</div>
<div style="height: 30px; position: absolute; top: 218px; width: 1px;">
</div>
<div class="CodeMirror-gutters" style="background: url("data:image/png; border-right: 1px solid rgb(77, 77, 77); box-shadow: black 0px 10px 20px; height: 218px; left: 0px; padding-bottom: 30px; position: absolute; top: 0px; z-index: 3;">
<div class="CodeMirror-gutter CodeMirror-linenumbers" style="display: inline-block; height: 218px; margin-bottom: -32px; padding-bottom: 30px; width: 30px;">
</div>
</div>
</div>
</div>
</div>
</form>
<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<div style="margin-bottom: 12px;">
To make sure this is compiling through the TypeScript compiler, the first step is to convert it to use modules from TypeScript. The simplest way is:</div>
</div>
<form style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin: 0px 0px 24px;">
<div class="CodeMirror cm-s-ambiance" style="background: url("data:image/png; box-shadow: black 0px 0px 10px inset; color: #e6e1dc; font-family: Monaco, Menlo, "Andale Mono", "lucida console", "Courier New", monospace !important; line-height: 1.4em; overflow: hidden; position: relative;">
<div style="height: 0px; left: 35px; overflow: hidden; position: relative; top: 7px; width: 3px;">
<textarea autocapitalize="off" autocorrect="off" style="border-color: rgb(204, 204, 204); border-radius: 4px; box-shadow: rgba(0, 0, 0, 0.0745098) 0px 1px 1px inset; color: black; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; height: 1em; line-height: 24px; margin: 0px 0px 12px; outline: none; overflow: auto; padding-left: 0px; padding-top: 0px; position: absolute; transition: border 0.2s linear, box-shadow 0.2s linear; vertical-align: middle; width: 1000px;" tabindex="0"></textarea></div>
<div class="CodeMirror-scroll" style="height: 176px; margin-bottom: -30px; margin-right: -30px; outline: none; overflow: auto; padding-bottom: 30px; padding-right: 30px; position: relative;" tabindex="-1">
<div style="min-height: 100%; position: relative;">
<div class="CodeMirror-sizer" style="margin-left: 31px; min-height: 176px; min-width: 487px; position: relative;">
<div style="position: relative; top: 0px;">
<div class="CodeMirror-lines" style="cursor: text; padding: 4px 0px;">
<div style="outline: none; position: relative;">
<div class="CodeMirror-measure" style="height: 0px; overflow: hidden; position: absolute; visibility: hidden; width: 657.938px;">
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: static; word-break: break-all; word-wrap: normal; z-index: 2;"><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span></pre>
</div>
<div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
1</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"><span class="cm-keyword" style="color: #0cb3e8;">function</span> <span class="cm-variable" style="color: #b9cc14;">Calculator</span>() {</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
2</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;">}</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
3</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> </pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
4</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"><span class="cm-variable" style="color: #b9cc14;">Calculator</span>.<span class="cm-property" style="color: #eed1b3;">prototype</span>.<span class="cm-property" style="color: #eed1b3;">calculate</span> = <span class="cm-keyword" style="color: #0cb3e8;">function</span> (<span class="cm-def" style="color: #aac6e3;">x</span>, <span class="cm-def" style="color: #aac6e3;">y</span>) {</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
5</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> <span class="cm-keyword" style="color: #0cb3e8;">return</span> <span class="cm-variable-2" style="color: #eed1b3;">x</span> + <span class="cm-variable-2" style="color: #eed1b3;">y</span>;</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
6</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;">};</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
7</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> </pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
8</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"><span class="cm-variable" style="color: #b9cc14;">export</span> = <span class="cm-variable" style="color: #b9cc14;">Calculator</span>;</pre>
</div>
</div>
<div class="CodeMirror-cursor" style="border-left: 1px solid rgb(121, 145, 232); border-right: none; height: 15px; left: 4px; position: absolute; top: 3px; visibility: hidden; width: 0px; z-index: 3;">
</div>
</div>
</div>
</div>
</div>
<div style="height: 30px; position: absolute; top: 176px; width: 1px;">
</div>
<div class="CodeMirror-gutters" style="background: url("data:image/png; border-right: 1px solid rgb(77, 77, 77); box-shadow: black 0px 10px 20px; height: 176px; left: 0px; padding-bottom: 30px; position: absolute; top: 0px; z-index: 3;">
<div class="CodeMirror-gutter CodeMirror-linenumbers" style="display: inline-block; height: 176px; margin-bottom: -32px; padding-bottom: 30px; width: 30px;">
</div>
</div>
</div>
</div>
</div>
</form>
<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<div style="margin-bottom: 12px;">
To compile this, you then call the compiler with the right module flag, which is AMD for RequireJS:</div>
</div>
<form style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin: 0px 0px 24px;">
<div class="CodeMirror cm-s-ambiance" style="background: url("data:image/png; box-shadow: black 0px 0px 10px inset; color: #e6e1dc; font-family: Monaco, Menlo, "Andale Mono", "lucida console", "Courier New", monospace !important; line-height: 1.4em; overflow: hidden; position: relative;">
<div style="height: 0px; left: 35px; overflow: hidden; position: relative; top: 7px; width: 3px;">
<textarea autocapitalize="off" autocorrect="off" style="border-color: rgb(204, 204, 204); border-radius: 4px; box-shadow: rgba(0, 0, 0, 0.0745098) 0px 1px 1px inset; color: black; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; height: 1em; line-height: 24px; margin: 0px 0px 12px; outline: none; overflow: auto; padding-left: 0px; padding-top: 0px; position: absolute; transition: border 0.2s linear, box-shadow 0.2s linear; vertical-align: middle; width: 1000px;" tabindex="0"></textarea></div>
<div class="CodeMirror-scroll" style="height: 29px; margin-bottom: -30px; margin-right: -30px; outline: none; overflow: auto; padding-bottom: 30px; padding-right: 30px; position: relative;" tabindex="-1">
<div style="min-height: 100%; position: relative;">
<div class="CodeMirror-sizer" style="margin-left: 31px; min-height: 29px; min-width: 307px; position: relative;">
<div style="position: relative; top: 0px;">
<div class="CodeMirror-lines" style="cursor: text; padding: 4px 0px;">
<div style="outline: none; position: relative;">
<div class="CodeMirror-measure" style="height: 0px; overflow: hidden; position: absolute; visibility: hidden; width: 657.938px;">
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: static; word-break: break-all; word-wrap: normal; z-index: 2;"><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-operator" style="color: #fa8d6a;"></span><span class="cm-operator" style="color: #fa8d6a;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span></pre>
</div>
<div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
1</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"><span class="cm-variable" style="color: #b9cc14;">tsc</span> <span class="cm-variable" style="color: #b9cc14;">Calculator</span>.<span class="cm-variable" style="color: #b9cc14;">ts</span> <span class="cm-operator" style="color: #fa8d6a;">--</span><span class="cm-variable" style="color: #b9cc14;">module</span> <span class="cm-variable" style="color: #b9cc14;">amd</span></pre>
</div>
</div>
<div class="CodeMirror-cursor" style="border-left: 1px solid rgb(121, 145, 232); border-right: none; height: 15px; left: 4px; position: absolute; top: 3px; visibility: hidden; width: 0px; z-index: 3;">
</div>
</div>
</div>
</div>
</div>
<div style="height: 30px; position: absolute; top: 29px; width: 1px;">
</div>
<div class="CodeMirror-gutters" style="background: url("data:image/png; border-right: 1px solid rgb(77, 77, 77); box-shadow: black 0px 10px 20px; height: 29px; left: 0px; padding-bottom: 30px; position: absolute; top: 0px; z-index: 3;">
<div class="CodeMirror-gutter CodeMirror-linenumbers" style="display: inline-block; height: 29px; margin-bottom: -32px; padding-bottom: 30px; width: 30px;">
</div>
</div>
</div>
</div>
</div>
</form>
<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<div style="margin-bottom: 12px;">
This will then generate the equivalent JavaScript. You'll notice it adds some extra code that's probably unneccesary, but hey, I'll take that for compile time safety:</div>
</div>
<form style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin: 0px 0px 24px;">
<div class="CodeMirror cm-s-ambiance" style="background: url("data:image/png; box-shadow: black 0px 0px 10px inset; color: #e6e1dc; font-family: Monaco, Menlo, "Andale Mono", "lucida console", "Courier New", monospace !important; line-height: 1.4em; overflow: hidden; position: relative;">
<div style="height: 0px; left: 35px; overflow: hidden; position: relative; top: 7px; width: 3px;">
<textarea autocapitalize="off" autocorrect="off" style="border-color: rgb(204, 204, 204); border-radius: 4px; box-shadow: rgba(0, 0, 0, 0.0745098) 0px 1px 1px inset; color: black; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; height: 1em; line-height: 24px; margin: 0px 0px 12px; outline: none; overflow: auto; padding-left: 0px; padding-top: 0px; position: absolute; transition: border 0.2s linear, box-shadow 0.2s linear; vertical-align: middle; width: 1000px;" tabindex="0"></textarea></div>
<div class="CodeMirror-scroll" style="height: 218px; margin-bottom: -30px; margin-right: -30px; outline: none; overflow: auto; padding-bottom: 30px; padding-right: 30px; position: relative;" tabindex="-1">
<div style="min-height: 100%; position: relative;">
<div class="CodeMirror-sizer" style="margin-left: 31px; min-height: 218px; min-width: 568px; position: relative;">
<div style="position: relative; top: 0px;">
<div class="CodeMirror-lines" style="cursor: text; padding: 4px 0px;">
<div style="outline: none; position: relative;">
<div class="CodeMirror-measure" style="height: 0px; overflow: hidden; position: absolute; visibility: hidden; width: 657.938px;">
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: static; word-break: break-all; word-wrap: normal; z-index: 2;"><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-variable" style="color: #b9cc14;"></span><span class="cm-string" style="color: #8f9d6a;"></span><span class="cm-string" style="color: #8f9d6a;"></span><span class="cm-string" style="color: #8f9d6a;"></span><span class="cm-string" style="color: #8f9d6a;"></span><span class="cm-string" style="color: #8f9d6a;"></span><span class="cm-string" style="color: #8f9d6a;"></span><span class="cm-string" style="color: #8f9d6a;"></span><span class="cm-string" style="color: #8f9d6a;"></span><span class="cm-string" style="color: #8f9d6a;"></span><span class="cm-string" style="color: #8f9d6a;"></span><span class="cm-string" style="color: #8f9d6a;"></span><span class="cm-string" style="color: #8f9d6a;"></span><span class="cm-string" style="color: #8f9d6a;"></span><span class="cm-string" style="color: #8f9d6a;"></span><span class="cm-string" style="color: #8f9d6a;"></span><span class="cm-string" style="color: #8f9d6a;"></span><span class="cm-string" style="color: #8f9d6a;"></span><span class="cm-string" style="color: #8f9d6a;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-keyword" style="color: #0cb3e8;"></span><span class="cm-def" style="color: #aac6e3;"></span><span class="cm-def" style="color: #aac6e3;"></span><span class="cm-def" style="color: #aac6e3;"></span><span class="cm-def" style="color: #aac6e3;"></span><span class="cm-def" style="color: #aac6e3;"></span><span class="cm-def" style="color: #aac6e3;"></span><span class="cm-def" style="color: #aac6e3;"></span><span class="cm-def" style="color: #aac6e3;"></span><span class="cm-def" style="color: #aac6e3;"></span><span class="cm-def" style="color: #aac6e3;"></span><span class="cm-def" style="color: #aac6e3;"></span><span class="cm-def" style="color: #aac6e3;"></span><span class="cm-def" style="color: #aac6e3;"></span><span class="cm-def" style="color: #aac6e3;"></span></pre>
</div>
<div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
1</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"><span class="cm-variable" style="color: #b9cc14;">define</span>([<span class="cm-string" style="color: #8f9d6a;">"require"</span>, <span class="cm-string" style="color: #8f9d6a;">"exports"</span>], <span class="cm-keyword" style="color: #0cb3e8;">function</span>(<span class="cm-def" style="color: #aac6e3;">require</span>, <span class="cm-def" style="color: #aac6e3;">exports</span>) {</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
2</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> <span class="cm-keyword" style="color: #0cb3e8;">function</span> <span class="cm-def" style="color: #aac6e3;">Calculator</span>() {</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
3</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> }</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
4</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> </pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
5</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> <span class="cm-variable-2" style="color: #eed1b3;">Calculator</span>.<span class="cm-property" style="color: #eed1b3;">prototype</span>.<span class="cm-property" style="color: #eed1b3;">calculate</span> = <span class="cm-keyword" style="color: #0cb3e8;">function</span> (<span class="cm-def" style="color: #aac6e3;">x</span>, <span class="cm-def" style="color: #aac6e3;">y</span>) {</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
6</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> <span class="cm-keyword" style="color: #0cb3e8;">return</span> <span class="cm-variable-2" style="color: #eed1b3;">x</span> + <span class="cm-variable-2" style="color: #eed1b3;">y</span>;</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
7</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> };</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
8</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> </pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
9</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;"> <span class="cm-keyword" style="color: #0cb3e8;">return</span> <span class="cm-variable-2" style="color: #eed1b3;">Calculator</span>;</pre>
</div>
<div style="position: relative;">
<div style="left: -31px; position: absolute;">
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="color: #eeeeee; cursor: default; left: 0px; min-width: 20px; padding: 0px 5px; position: absolute; text-align: right; text-shadow: rgb(77, 77, 77) 0px 1px 1px; width: 20px; z-index: 4;">
10</div>
</div>
<pre style="background: transparent; border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0.14902); color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;">});</pre>
</div>
</div>
<div class="CodeMirror-cursor" style="border-left: 1px solid rgb(121, 145, 232); border-right: none; height: 15px; left: 4px; position: absolute; top: 3px; visibility: hidden; width: 0px; z-index: 3;">
</div>
</div>
</div>
</div>
</div>
<div style="height: 30px; position: absolute; top: 218px; width: 1px;">
</div>
<div class="CodeMirror-gutters" style="background: url("data:image/png; border-right: 1px solid rgb(77, 77, 77); box-shadow: black 0px 10px 20px; height: 218px; left: 0px; padding-bottom: 30px; position: absolute; top: 0px; z-index: 3;">
<div class="CodeMirror-gutter CodeMirror-linenumbers" style="display: inline-block; height: 218px; margin-bottom: -32px; padding-bottom: 30px; width: 30px;">
</div>
</div>
</div>
</div>
</div>
</form>
<div class="post-codeblock-rich" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; text-align: justify;">
<div style="margin-bottom: 12px;">
If you're working in Visual Studio, you might get an error about it not using the module flag. If you're working with an existing codebase, you might find you'll need to add TypeScript support first - adding a new TypeScript file in VS2013 does this by adding some stuff to the CSPROJ file, namely the XML element TypeScriptToolsVersion, and will need to reload the project. Afterwards, there should be a new tab for TypeScript Build options in the project properties dialog where you can choose the module style:</div>
</div>
<div align="center" style="background-color: white; color: #333333; font-family: "Open Sans", Calibri, Candara, Arial, sans-serif; font-size: 15px; margin-bottom: 12px;">
<img alt="404 - Image Not Found" src="https://yoda.entelect.co.za/assets/attachments/6463/Untitled.png" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /></div>
Unknownnoreply@blogger.com0