Wednesday, September 5, 2012
2 small things
Wednesday, August 8, 2012
The top 10 most interesting things about Microsoft Store’s developer agreement or “It’s good to be the king”
I was going to post about custom objects in DataTables today. But I ran across this and needed to comment (cuz, you know… I can’t help myself).
Friday, July 27, 2012
MS Sql and my pain.
If you ask MS (or one of their fanbois) they'll tell you that you don't really want to do that. I love it when they say that. They'll say "you don't want that because you can't guarantee which Customer_Name you're getting." When you say you don't care, they'll tell you that the database is mis-designed then. OK... and the world is not at peace. I usually want to give them my boss' number and have them explain how he doesn't really want what he wants, and if he does, he needs to shell out a few million $$ to re-design the data.
Getting up at 3am each night to script things is on the path. Automating it is off.
And the world is not at peace.
Wednesday, July 18, 2012
Microsoft and the courts
http://in.reuters.com/article/2012/07/18/eu-microsoft-browser-idINL6E8IIALJ20120718
Here’s a prediction.
Microsoft will say, basically, “It doesn’t matter, we’re not a monopoly anymore.”
To prove that, they’re argue that Windows8 is not a PC operating system, but an OS for PC’s, phones, Xboxes, notepads and greeting cards that play music when you open them. Since, they will say, Microsoft is getting walloped in non-PC devices, they don’t count as a monopoly. It’s analogous, they will say, to saying that Toyota has a monopoly on cars because it sells more hybrids. The PC, they will argue, is only one part of the target market for Windows8, in the same way that the Prius is only one target for windshields.
Microsoft has a lot of reasons to push Windows8. They seriously have fallen behind in their business strategy. But one of the key reasons, I’m guessing, is that by creating a “one OS to rule them all” platform, they create a legal hole to crawl into.
For years, they’ve been a monopoly (as defined by law, anyway) and they’ve made a zillion dollars. But they’ve also paid billions in fines for breaking anti-trust laws. If they can convince the courts that Windows8 combines markets the way Toyota combines car styles, they can still keep their current markets and profits without the annoying billions of dollars in fines they face all the time. To them, it must seem like a huge win.
Have your cake + eat it = no more anti-trust.
Personally, I think their argument is actually decent and the courts may go for it. I also think we’ll see more restrictions and modifications to Windows8 to make it better fit the model and support the legal argument. I think that’s actually their hidden reason for forcing PC users to use the Metro start screen. And to that end, ultra-books are a Godsend for Redmond. With them, they get to launch the same ARM-based Windows8 they plan to put on notepad and say “see? A laptop is just a glorified notepad. Since we’re not a monopoly in notepads, we’re not one in notebooks either.”
Will be interesting following what happens in the European courts.
--kevin
Wednesday, July 11, 2012
Distinct on custom objects in datatables and lists
Anyway, here’s some of the latest notes that caused me a research headache. Maybe it will save you a headache, or maybe I’ll remember to look here the next time my headache starts.
Suppose you have a data table in C#.
Let’s say it has a date time and a custom object (type = “myclass”).
The “myclass” thing is simple – it’s just a class with one property “v” which is a DateTime (I’ll plug that in later) and the code to set up and load the table is here:
So we end up with a table with two columns: one is a DateTime and the other is a myclass. Conceptually, the DateTime and the myclass objects are about the same thing.
You head shouldn’t hurt yet. If it does, maybe you should stop now. But get the aspirin ready:
var n = (from p in dt.AsEnumerable() select p["someDate"]).Distinct();
This is good. Walk through a foreach on n and it gives one instance for every unique date. In theory, each value in the table is distinct because it’s a DateTime and the loop iteration takes a fraction of a second. In practice, the code is so fast, that the runtime engine eats the fraction of a second, and you’ll get one unique entry in n, so your foreach will have one loop iteration. My head is still pain free. Until I do this:
var n = (from p in dt.AsEnumerable() select p["someObj"]).Distinct();
Now the “Distinct” acts on the custom objects and you get 10 items in n. The headache is small, though, because I get that .Net doesn’t know how to compare my custom objects. So it can’t distinct them. MSDN says that myclass needs to implement IEquatable. There are some examples out there that seem to work.
For simplicity, let me the load 10 custom objects into a List, rather than a data table, and I’ll modify myclass to implement IEquatable.
public class myclass: IEquatable
Thursday, June 14, 2012
The biggest news from Apple.
So I’ve been keeping an eye on the latest news from their developer’s conference, and I think one story has been under-told.
Auto week reported this. For the most part, the mainstream media (and even the tech community) has been ignoring it.
Let me summarize, to save you the time of reading: Apple has agreements to put Siri in the cars made by these auto makers:
BMW, GM, Mercedes, Jaguar, Audi, Toyota, Chrysler and Honda.
Ford already has a tight relationship for voice control software with Microsoft. Besides Ford, Apple gets…um… everyone else? OK, Hyundai and Ferrari aren’t in the list, but come on, everyone else is.
This is a big fat hairy deal for Apple. And a big, fat, hairy coup.
Microsoft was really the first one to do this. They pioneered the trail and owned the market with Ford. And then Apple just stole it from them – not one or two other potential clients – but *all* the rest. I mean, what were the MS sales guys doing while Apple was pitching this? Were they off trying to flirt with Siri?
I think it’s a big, fat, hairy hit for Microsoft. OK, it’s a small hit for Google, too, but Google is only loosing what it never really had – not being a real player in this market anyway. But Microsoft… man… talk about shutting down an entire part of the business! Sure, they’ll hang onto Ford for a while, but how long before Apple gets that? How long before someone wants the same voice system in their Lincoln that their friends have in the Beemers? And even if they keep Ford, the growth potential of the market is gone .
And think about what this means for Apple. While all the world has been cursing or praising Windows 8 and MS is paddling hard to catch up in the ARM space (or is it ARMs race?), Apple flanked them big. Think about it. Think about what happens if you get used to Siri in your car giving you directions to a new Sushi place. That means extra revenue for Apple. It means add dollars from the Sushi place. It means integration with Apple’s new maps (take *that* Google). It means integration with Facebook and Open Table (they announced that too, by the way) so you can see if your friends liked the Sushi place and make a Siri-based reservation on the way. And it means a new reliance on Siri. So, if you are on a trip and you rent with Hertz, you’ll want Siri. If you are at home and you’re wondering where to grab dinner, you‘ll want Siri. It means getting people so used to the service that they’ll look for it everywhere.
And what amazes me, again, is that Microsoft invented the market, but just didn’t have the ability to capitalize on it. Microsoft is the true innovator here (something they claim to do more than they really do). But – most likely—Apple is the true winner.
Now, I wish I wouldn’t have sold that Apple stock…..
--kevin
Monday, June 4, 2012
Debugging tricks
typing ? followed by a variable (there needs to be a space between the ? and the variable name) will print the contents of the variable. This is basically the same as hovering over the variable with your mouse or doing a quick watch, but typing it is easier when you’re looking for someArray[i].someObject.someProperty . I’ve seen lots of people spend all day trying to “drill down” in hover over without clicking on the wrong thing and making it vanish. I do it too, but the debug command is way easier.
- --kevin
Friday, June 1, 2012
Extension methods
string x = "this is a test string";
Console.WriteLine(x.WordCount());
Putting this into an extension method makes a ton of sense. (I’m not sure why Microsoft didn’t already do this, frankly). This means that developers don’t need to deal with this mess each time, but just have to call
public static Type[] numericTypes = new[] { typeof(Byte), typeof(Decimal), typeof(Double),
typeof(Int16), typeof(Int32), typeof(Int64), typeof(SByte),
typeof(Single), typeof(UInt16), typeof(UInt32), typeof(UInt64)};
public static bool IsNumber(this object x)
{
if (x == null)
return false;
return numericTypes.Contains(x.GetType() );
}
public static bool IsNumeric(this DataColumn col)
{
if (col == null)
return false;
return numericTypes.Contains(col.DataType);
}