Category: Random Coding
-
Javascript is Evil – Curly brace indentation
So I’m building a little DurandalJS SPA (single page app) test site tonight and while building the view model I do what I’ve typically done in the past when I run into Java curly brace convention, which is to plop that sucker down to the next line a la default VS C# convention.
Little did I realize that it was going to bite me in the booty and give me a crazy run around.
My view Model originally
return { displayName: 'Cats', cats: ko.observableArray([]) };
The version that works in js
return { displayName: 'Cats', cats: ko.observableArray([]) };
¿c wut I did there?
Who in hell would be as so evil to seriously make that a difference and why has JS become the dominant language of the web? Unfortunately the question is rhetorical and it’s reason for success is numerous, but seriously the language is nasty. Once I get my sample running, I’m going to go investigate Typescript and Coffeescript. … Read the rest
-
Wix Windows Service – Start on install
So I was building a wix setup project for a windows service and kept running into a wall while getting the service to start after a successful install. It kept giving me an error “Verify that you have sufficient privileges to start system services”. I searched through nearly 50 articles that led me on a wild goose chase of the issue being related to actual permissions, dual service control tags, the wait attribute and hacks inside the service installer code behind. To actual solution was ridiculously simple, the error was just too obscure to identify the root cause.
My wxs file had the following contents
<ServiceInstall
Id="ServiceInstaller"
Type="ownProcess"
Vital="yes"
Name="Ninjacrab Awesome Service"
DisplayName="Ninjacrab Awesome Service"
Description="The super awesome service"
Start="auto"
Account="LocalSystem"
ErrorControl="ignore"
Interactive="no"
/>
<ServiceControl
Id="StartService"
Name="NinjacrabAwesomeService"
Start="install"
Stop="both"
Remove="uninstall"
Wait="yes"
/>
Not sure how it caught my eye, but I noticed the name was different
… Read the rest
<ServiceInstall
Id="ServiceInstaller"
Type="ownProcess"
Vital="yes"
Name="Ninjacrab Awesome Service"
DisplayName="Ninjacrab -
Random Coding 3 didn’t happen… yet!
Well, I was diligently playing with Nuget packaging and hoping to make a video where I create a Nuget package that hosts the VSIX that I created in random coding two. However, it seems as though Nuget doesn’t support installing a VSIX, item templates or project templates.
I then sat back and thought “Unpossibleh!!!”
I’m certain I’ve downloaded packages that alter Visual Studio’s menus and options and then it hit me.
I built a Visual Studio Extension.
Nuget is a package manager for libraries.
I didn’t need to place the VSIX in a Nuget package, I simply needed to upload the extensions to the Visual Studio Extensions Gallery. There really is no need for a 2 minute video on uploading the package that was created. So now I’ll be off to thinking about my next random coding Video topic.
Regardless you may now download my project and item templates from the Visual Studio Gallery, but it’s incredibly incomplete as I … Read the rest
-
Confuzzled…
So I was preparing materials for my “Random Coding 3” video episode and this time the subject was relating to Conflicademia in regards to the loading performance of Android and how to optimize your build in Unity so that the game has reasonable loading performance.
However, as I was prepping my material and generating the relevant evidence to prove why this session improves the performance, I disabled all my “tweaks” and re-launched the game on my phone and to my surprise, the game was still loaded in a respectable time.
I still have no clue why it just works now, though it’s good for my game, it ruined my “Random Coding – Session #3″…
So I will spend time re-creating the performance issue to prevent getting caught by it again, but I don’t think it’ll be the next Random Coding series until performance becomes a problem again and I have some hard evidence on it.
Until then, I did have … Read the rest
-
Random coding 2
So I finally got around to finish the second video in the random coding series. I decided to change up how I recorded it, breaking it into multiple chunks and blending them together with Sony Vegas. Apparently FFSplit, by default record to mp4 which vegas had a hard time working with. Fortunately, I Was playing with ffmpeg which converts from one format, to practically any other. It then converted into the .m2t format that Sony loves and real time editing became a breeze.
I’m really enjoying building these as it also really forces me to learn more about something to demo it. I’m also in contemplating of what video will be the third in my series.… Read the rest
-
WPF notify helper – C# 5.0
So after looking at the documentation on what’s new in C# 5.0, I read about the feature that you can get a function’s caller information that looks like the following.
public void DoProcessing() { TraceMessage("Something happened."); } public void TraceMessage(string message, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0) { Trace.WriteLine("message: " + message); Trace.WriteLine("member name: " + memberName); Trace.WriteLine("source file path: " + sourceFilePath); Trace.WriteLine("source line number: " + sourceLineNumber); }
This snippet is stolen straight from msdn.
http://msdn.microsoft.com/en-us/library/hh534540(v=vs.110).aspxI also saw another example of where this would be used for WPF classes that implement INotifyPropertyChanged. The example looked liked the following
protected void RaisePropertyChanged([CallerMemberName] string memberName = "") { RaisePropertyChanged(memberName); }
This actually reminded me of what I did in some of my WCF services to get the calling method name displayed when invoked, so that I could print out who called it(using WindowsIdentity) and what method they called. However, I … Read the rest
-
Enterprise Library Logger
After a monumental hiatus, I will provide this nerdy snippet and an update on my life.Sadly, after writing a bit of code for my logging toolkit, I’m going to modify it from using Enterprise Library to Log4Net. Apparently there was some change in Enterprise Library 4.0 that does not make it directly backwards compatible with 3.1 and I can’t find the documentation for what makes it different.
All of a sudden my formatters no longer work and neither does the mailer. As a good friend of mine said. “It’s a freaking logger!” Why is it not backwards compatible? What kind of crazy magically awesome changes could they have made to make me want to update a vital library used in all my applications?Thus, if I have to make a change, I’m moving to Log4Net. For anyone curious, I’ll be happy to keep a copy of my current logger with the Enterprise library implementation so that they can see… Read the rest -
Systems updating like whoa!
Well, Vista Service Pack 1 is finally available for machines that have installed the Korean language pack and Ubuntu has just informed me that it wanted to update a whopping 115 packages. So I’ll let those occur as I drift off to la-la land.
It’s 85 degrees right now in NY and it’s night time. My AC is kicking on and off like a fat ninja in a kicking marathon. I think I need a fan to circulate the air so that the AC can regulate the temp across the entire 375 sqft instead of the tiny section by the unit.
I just got back from Wheeling again where I met a Cardiovascular surgeon. We had an interesting conversation about his software needs and I’m interested in starting a project for that request. It doesn’t seem to be that intense or involved. I’m going to work on a few Proof of concepts do some research to really see if the … Read the rest
-
Our Nation’s Capital
Well to begin with, I’m writing this on a Mac. I’ve switched my blogs over to blogger.com and I stepped outside of NYC this weekend to visit our nation’s capital, Washington DC.
I’ll go into some of the technical differences that I’ve experienced from working with the OS X, Windows, Unix and Linux environment.
However, I’ll digress over to my recent “vacation”.
So this weekend, my snuggle muffin and I decided to meet halfway in Washington DC. I took the Chinatown bus and she drove in to town. We found a great deal on a hotel and so we spontaneously ran off.
To sum up the trip, it was a trial of our patience and a continuous series of unfortunate circumstances. Regardless, my love stood by me, supported me and cheered me up. Then there were trying times for her as well so that I could do the same for her. I’m not entirely certain if the weekend was really … Read the rest