Saturday, October 31, 2015

Netflix

I signed up for a Netflix account today for the first time in many years, not since Netflix was nothing more than that we-will-snail-mail-you-DVDs alternative to Blockbuster video. I have been under the impression that I needed a TV to watch Netflix and that the streaming service somehow jived exclusively with the modern TVs that I don't understand as I don't have a TV... but I don't! It works great on my laptop and costs very, very little to enjoy. I christened the account by watching "Circle" which is a fourth example of cheapo science fiction. Happy Halloween!

 
 

Addendum 10/31/2015: Alright, I want to write a second time. I am already frustrated with the limited selection. It's really not like going to a video store. I remember dropping the old school snail mail service I once had over this very reason.

The charm bar won't show up at the desktop anymore in Windows 8.1???

Well, a restart fixed the problem in my case.

Rally has a REST API.

You may talk into it and do things like communicate that a build number has been incremented. Enjoy.

Friday, October 30, 2015

Make ReSharper green!

Click on all of the yellow ticks at the right edge of a file's display in Visual Studio (at the vertical scrollbar) to address each one. When you visit each one there will be a tooltip icon of some fashion (perhaps a lightbulb) at the opposite side, the left edge. When you click there will be a menu which appears which gives you options for cleaning up the problem and, yes, there is an option to just ignore the problem. The last option will have a wrench icon and read: Inspection "Assignment is not used" or some similar error message and this will expand yet another menu with: Disable once with comment ...as an option. Hopefully you won't just comment out everything. Hopefully this keeps you out of trouble.

I really hate that ReSharper encourages you to use the var keyword, but I seem largely alone in my opinion. I guess this is just modern C#, huh? Nuts.

Make ReSharper wrap lines at 200 characters instead of 120.

RESHARPER > Options... > Code Editing > C# > Formatting Style > Line Breaks and Wrapping

plus equals string concatenation

Strings are immutable in C# and whenever you appear to be modifying one you are in fact just creating a new string and putting it on the heap.

string foo = "foo";
foo += "bar";

 
 

Using a StringBuilder takes away some of the overhead of constantly growing a string by making new objects (strings) and letting old ones be dealt with by garbage collection. This is a talking point that was the fodder for interview questions ten years ago. A bigger thing to worry about in terms of optimization however would be traffic to and from the database. Don't stress the string concatenation. It probably isn't the real source of your woes. Note that strings are immutable in a weird way. They aren't value types, they are reference types that live on the heap... and yet when you "change" one the pointer for the string changes to look to the new string that is placed on the heap. This unintuitive behavior is a must for this one type given how much you use it and some of the things it has to do. It's not realistic to make a string a value type and give it a fixed-sized of memory on the stack, not when a string could contain one letter or could contain the Magna Carta. The footprint would be huge and mostly largely wasted in most scenarios.

Restrain how long an input is at an XSD?

As given in my enum example here, you have to explicitly make a restriction to sanity check the length of a string or an integer in an XSD. I think that would look like so:

<xs:simpleType name="Email">
   <xs:restriction base="xs:string">
      <xs:minLength value="13"/>
      <xs:maxLength value="42"/>
   </xs:restriction>
</xs:simpleType>

 
 

I'm not positive because when this came up today we became hesitant to do the work given the nasty mess we'd have to make of an otherwise terse XSD file. We're shelving the to-do for now.