Fitting Code from Microsoft
-
So I have the Kinect SDK and Toolkit downloaded. All of the C# samples are in WPF, how nice of them. *rolleyes*. IN the KinectSensorManager class (which is 848 lines long) it is decorated with this:
[SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "Complexity is caused by long list of static properties. This is not real complexity.")]
Fitting, MS provides an overly complex sample code base to show how to use a connect and Suppresses there own message that should have told the developer, hey, wait a minute, I probably should be doing a lot less work. I feel sorry for any developer who wants to learn this stuff who isn't an experienced programmer if these are the supposed samples for people to use.Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost
-
So I have the Kinect SDK and Toolkit downloaded. All of the C# samples are in WPF, how nice of them. *rolleyes*. IN the KinectSensorManager class (which is 848 lines long) it is decorated with this:
[SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "Complexity is caused by long list of static properties. This is not real complexity.")]
Fitting, MS provides an overly complex sample code base to show how to use a connect and Suppresses there own message that should have told the developer, hey, wait a minute, I probably should be doing a lot less work. I feel sorry for any developer who wants to learn this stuff who isn't an experienced programmer if these are the supposed samples for people to use.Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost
Often times the MSDN site sucks for that very reason. I've gone out there to learn how to do something simple like iterate through a collection and they'll throw in a log function or something. I think the sample guys get bored and add stuff that interests them instead of keeping the example simple. Guy 1: OMG, I got stiffed - I have to write the MSDN article for how to iterate through a collection. Guy 2: Pfft. Make it a recursive iteration which sorts Fibonacci numbers, but only those numbers that are also prime numbers. Guy 1: That would make a criminally insane example. Guy 2: Either that or we could order a pizza and kill the delivery boy. Guy 1: Naw, an evil example would make more people cry.
-
So I have the Kinect SDK and Toolkit downloaded. All of the C# samples are in WPF, how nice of them. *rolleyes*. IN the KinectSensorManager class (which is 848 lines long) it is decorated with this:
[SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "Complexity is caused by long list of static properties. This is not real complexity.")]
Fitting, MS provides an overly complex sample code base to show how to use a connect and Suppresses there own message that should have told the developer, hey, wait a minute, I probably should be doing a lot less work. I feel sorry for any developer who wants to learn this stuff who isn't an experienced programmer if these are the supposed samples for people to use.Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost
Is a list of static properties complex?
My Messianic Jewish blog: Kineti L'Tziyon My software blog: Debugger.Break() Judah Himango
-
Is a list of static properties complex?
My Messianic Jewish blog: Kineti L'Tziyon My software blog: Debugger.Break() Judah Himango
-
Often times the MSDN site sucks for that very reason. I've gone out there to learn how to do something simple like iterate through a collection and they'll throw in a log function or something. I think the sample guys get bored and add stuff that interests them instead of keeping the example simple. Guy 1: OMG, I got stiffed - I have to write the MSDN article for how to iterate through a collection. Guy 2: Pfft. Make it a recursive iteration which sorts Fibonacci numbers, but only those numbers that are also prime numbers. Guy 1: That would make a criminally insane example. Guy 2: Either that or we could order a pizza and kill the delivery boy. Guy 1: Naw, an evil example would make more people cry.
MehGerbil wrote:
Guy 1: Naw, an evil example would make more people cry.
This just made my day. :laugh:
The United States invariably does the right thing, after having exhausted every other alternative. -Winston Churchill America is the only country that went from barbarism to decadence without civilization in between. -Oscar Wilde Wow, even the French showed a little more spine than that before they got their sh*t pushed in.[^] -Colin Mullikin
-
Is a list of static properties complex?
My Messianic Jewish blog: Kineti L'Tziyon My software blog: Debugger.Break() Judah Himango
No, but I was surprised to find a 900 line class file that has to use WPF with XAML just to show me how to use Kinect Sensors. The point of showing examples is to keep things simple. Me, personally, I think this would have been a much better introduction to drawing an image on screen.
if(KinectSensor.KinectSensors.Count > 0){
KinectSensor sensor = KinectSensors[0];
if(!sensor.IsRunning){
sensor.Start();
}
Kinect.AllFramesReady += new EventHandler(Kinect_AllFramesReady);
}private void Kinect_AllFramesReady(object sender, AllFramesReadyEventArgs e) {
ColorImageFrame frame = e.OpenColorImageFrame();
if (frame != null) {
byte[] pixels = new byte[frame.PixelDataLength];
frame.CopyPixelDataTo(pixels);
Bitmap image = new Bitmap(frame.Width, frame.Height, System.Drawing.Imaging.PixelFormat.Format32bppRgb);
BitmapData bmapdata = image.LockBits(new Rectangle(0, 0, frame.Width, frame.Height), ImageLockMode.WriteOnly, image.PixelFormat);
IntPtr ptr = bmapdata.Scan0;
Marshal.Copy(pixels, 0, bmapdata.Scan0,
frame.PixelDataLength);
image.UnlockBits(bmapdata);
pictureBox1.Image = image;
}
}Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost
-
Perhaps not "complex," but the source code in question is apparently sufficiently ugly that if you created something similar, you'd be warned.
-
So I have the Kinect SDK and Toolkit downloaded. All of the C# samples are in WPF, how nice of them. *rolleyes*. IN the KinectSensorManager class (which is 848 lines long) it is decorated with this:
[SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "Complexity is caused by long list of static properties. This is not real complexity.")]
Fitting, MS provides an overly complex sample code base to show how to use a connect and Suppresses there own message that should have told the developer, hey, wait a minute, I probably should be doing a lot less work. I feel sorry for any developer who wants to learn this stuff who isn't an experienced programmer if these are the supposed samples for people to use.Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost
-
No, but I was surprised to find a 900 line class file that has to use WPF with XAML just to show me how to use Kinect Sensors. The point of showing examples is to keep things simple. Me, personally, I think this would have been a much better introduction to drawing an image on screen.
if(KinectSensor.KinectSensors.Count > 0){
KinectSensor sensor = KinectSensors[0];
if(!sensor.IsRunning){
sensor.Start();
}
Kinect.AllFramesReady += new EventHandler(Kinect_AllFramesReady);
}private void Kinect_AllFramesReady(object sender, AllFramesReadyEventArgs e) {
ColorImageFrame frame = e.OpenColorImageFrame();
if (frame != null) {
byte[] pixels = new byte[frame.PixelDataLength];
frame.CopyPixelDataTo(pixels);
Bitmap image = new Bitmap(frame.Width, frame.Height, System.Drawing.Imaging.PixelFormat.Format32bppRgb);
BitmapData bmapdata = image.LockBits(new Rectangle(0, 0, frame.Width, frame.Height), ImageLockMode.WriteOnly, image.PixelFormat);
IntPtr ptr = bmapdata.Scan0;
Marshal.Copy(pixels, 0, bmapdata.Scan0,
frame.PixelDataLength);
image.UnlockBits(bmapdata);
pictureBox1.Image = image;
}
}Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost
-
Ugh. That's the kind of mumbo-jumbo that keeps me from using WPF. The good news is that, if games are what you wish to develop, OpenGL is still around and it's almost completely devoid of architecturally correct foolishness.
And of course OpenGL is completely functionally equivalent to whatever MS has to offer, not to mention the tooling. Please, the OpenGL vs Direct3D war is now long lost, mostly through self-inflicted wounds (I can quote posts from OpenGL proponents if you wish). There are some places where OpenGL will reign freely (embedded) and some places it won't enter (Xbox, Windows 8), accept it, move forward and use the right tool for the job.
'I'm French! Why do you think I've got this outrrrrageous accent?' Monty Python and the Holy Grail
-
Often times the MSDN site sucks for that very reason. I've gone out there to learn how to do something simple like iterate through a collection and they'll throw in a log function or something. I think the sample guys get bored and add stuff that interests them instead of keeping the example simple. Guy 1: OMG, I got stiffed - I have to write the MSDN article for how to iterate through a collection. Guy 2: Pfft. Make it a recursive iteration which sorts Fibonacci numbers, but only those numbers that are also prime numbers. Guy 1: That would make a criminally insane example. Guy 2: Either that or we could order a pizza and kill the delivery boy. Guy 1: Naw, an evil example would make more people cry.
-
And of course OpenGL is completely functionally equivalent to whatever MS has to offer, not to mention the tooling. Please, the OpenGL vs Direct3D war is now long lost, mostly through self-inflicted wounds (I can quote posts from OpenGL proponents if you wish). There are some places where OpenGL will reign freely (embedded) and some places it won't enter (Xbox, Windows 8), accept it, move forward and use the right tool for the job.
'I'm French! Why do you think I've got this outrrrrageous accent?' Monty Python and the Holy Grail
-
I didn't claim that OpenGL and DirectX were functionally equivalent. My claim is that one of them makes me want to spend the day programming, while the other makes me want to round up the townspeople and head up to Redmond with pitchforks.
I'm trying to picture in my head developers with pitchforks... doesn't compute :D
'I'm French! Why do you think I've got this outrrrrageous accent?' Monty Python and the Holy Grail