Programming.....the bumps and diversions, just like many tech things

Well I discovered today something new, that most upper languages will not talk directly to hardware. So am now having to stop c# for a while, take a detour into something allows direct talking to computer hardware. No matter how complete they try to make it, something always lacks and big time. Eg, Since I'm trying to focus on c# and comms layers, this thing requires much more than classes built into the c# language. Any of you programmers come accross this or am I just talking a difficult route? Eg if you are writing an app to query a usb device? Rgds.

Basically, it is possible using libusb-win32. Look at: http://stackoverflow.com/questions/994600/writing-drivers-in-c (do not listen to the naysayers) http://libusb-win32.sourceforge.net/ You can pinvoke in C# to call functions in libusb as described here: http://www.ddj.com/windows/184416423 However, it is still helpful to maintain some knowledge of C if you want to do such low-level stuff. It aids in understanding APIs and pre-existing code. Fortunately, with some knowledge of C#, C will be a breeze once you get over "pointers". ________________________________ From: aki <aki275@googlemail.com> To: Skunkworks forum <skunkworks@lists.my.co.ke> Sent: Thursday, August 20, 2009 3:33:38 PM Subject: [Skunkworks] Programming.....the bumps and diversions, just like many tech things Well I discovered today something new, that most upper languages will not talk directly to hardware. So am now having to stop c# for a while, take a detour into something allows direct talking to computer hardware. No matter how complete they try to make it, something always lacks and big time. Eg, Since I'm trying to focus on c# and comms layers, this thing requires much more than classes built into the c# language. Any of you programmers come accross this or am I just talking a difficult route? Eg if you are writing an app to query a usb device? Rgds. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com

Neva used C# but am sure it has libraries or an API to access USB On Thu, Aug 20, 2009 at 11:42 PM, Bernard Owuor <b_owuor@yahoo.com> wrote:
Basically, it is possible using libusb-win32. Look at:
http://stackoverflow.com/questions/994600/writing-drivers-in-c (do not listen to the naysayers) http://libusb-win32.sourceforge.net/
You can pinvoke in C# to call functions in libusb as described here: http://www.ddj.com/windows/184416423
However, it is still helpful to maintain some knowledge of C if you want to do such low-level stuff. It aids in understanding APIs and pre-existing code. Fortunately, with some knowledge of C#, C will be a breeze once you get over "pointers".
------------------------------ *From:* aki <aki275@googlemail.com> *To:* Skunkworks forum <skunkworks@lists.my.co.ke> *Sent:* Thursday, August 20, 2009 3:33:38 PM *Subject:* [Skunkworks] Programming.....the bumps and diversions, just like many tech things
Well I discovered today something new, that most upper languages will not talk directly to hardware. So am now having to stop c# for a while, take a detour into something allows direct talking to computer hardware. No matter how complete they try to make it, something always lacks and big time. Eg, Since I'm trying to focus on c# and comms layers, this thing requires much more than classes built into the c# language.
Any of you programmers come accross this or am I just talking a difficult route? Eg if you are writing an app to query a usb device?
Rgds.
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks Other services @ http://my.co.ke Other lists ------------- Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce Science: http://lists.my.co.ke/cgi-bin/mailman/listinfo/science kazi: http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general
-- www.dealcent.com - Your electronics shop www.golavish.com - The travel and leisure www.raccuddasys.com - code Development issues

On Thu, Aug 20, 2009 at 11:42 PM, Bernard Owuor <b_owuor@yahoo.com> wrote:
Basically, it is possible using libusb-win32. Look at:
@ Thnks Bernard. :-) Yesterday I found WMI with Win32_ classes . Now am having to go back to scratch as WMI is mostly scripting. I had no idea WMI was powerful on windows. I also found something " new to me" for windows i.e Powershell programming. I guess I must be at the correct cross roads......... @Thnks Frankline. :-) Cheers.

@Aki! I think you found a convenient and artificial crossroads because you're facing some challenges in C#. I'd urge you to stick with C# because all other languages are cheesecake once you master one. I'm currently converting a VB app to C# (so that it can run in *nix - using mono) and seem unable to notice the differences between the languages, apart from the abundance of C# docs. Stick with it or take a subset to get through. From: aki <aki275@googlemail.com> To: Skunkworks forum <skunkworks@lists.my.co.ke> Sent: Friday, August 21, 2009 1:00:17 AM Subject: Re: [Skunkworks] Programming.....the bumps and diversions, just like many tech things On Thu, Aug 20, 2009 at 11:42 PM, Bernard Owuor <b_owuor@yahoo.com> wrote: Basically, it is possible using libusb-win32. Look at:
@ Thnks Bernard. :-) Yesterday I found WMI with Win32_ classes . Now am having to go back to scratch as WMI is mostly scripting. I had no idea WMI was powerful on windows. I also found something " new to me" for windows i.e Powershell programming. I guess I must be at the correct cross roads......... @Thnks Frankline. :-) Cheers. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com

On Fri, Aug 21, 2009 at 9:44 PM, Bernard Owuor <b_owuor@yahoo.com> wrote:
@Aki! I think you found a convenient and artificial crossroads because you're facing some challenges in C#. I'd urge you to stick with C# because all other languages are cheesecake once you master one.
I'm currently converting a VB app to C# (so that it can run in *nix - using mono) and seem unable to notice the differences between the languages, apart from the abundance of C# docs. Stick with it or take a subset to get through.
@Bernard, Much thnks for the above info :-) .... I managed to go a bit deeper into WMI much better today ( until my brain can handle no more for now ), especially System.Management and create new instances of the objects to query hardware like HDD and serial numbers etc etc. *Incase anyone is looking at connecting to hardware and c#, the here's how to use WMI :* - In IDE, add a Ref to System.Management namespace - Add directive at top of code page : using System.Management - //Add directive at top of code page : using System.Management.Instrumentation Within class method, create a new instance ( to query a Fan ) : ManagementObjectSearcher Fan = new ManagementObjectSearcher(string eg "SELECT * FROM Win32_Fan"); There are 22 properties of the Fan Object like Active Cooling etc. These will become available from the instance above. Might need some corrections but working on it. Asante. :-)

@Aki, I see why you could be lost in WMI world. All the great things at your fingertips, so much for crons and bash in linux. WMI seems really great for writing monitoring scripts. Well, if it meets your USB device access need, then you're home. You'll have to dig deeper if you want to build device driver for new hardware. Cheers! ________________________________ From: aki <aki275@googlemail.com> To: Skunkworks forum <skunkworks@lists.my.co.ke> Sent: Friday, August 21, 2009 3:57:18 PM Subject: Re: [Skunkworks] Programming.....the bumps and diversions, just like many tech things On Fri, Aug 21, 2009 at 9:44 PM, Bernard Owuor <b_owuor@yahoo.com> wrote: @Aki!
I think you found a convenient and artificial crossroads because you're facing some challenges in C#. I'd urge you to stick with C# because all other languages are cheesecake once you master one.
I'm currently converting a VB app to C# (so that it can run in *nix - using mono) and seem unable to notice the differences between the languages, apart from the abundance of C# docs. Stick with it or take a subset to get through.
@Bernard, Much thnks for the above info :-) .... I managed to go a bit deeper into WMI much better today ( until my brain can handle no more for now ), especially System.Management and create new instances of the objects to query hardware like HDD and serial numbers etc etc. Incase anyone is looking at connecting to hardware and c#, the here's how to use WMI : - In IDE, add a Ref to System.Management namespace - Add directive at top of code page : using System.Management - //Add directive at top of code page : using System.Management.Instrumentation Within class method, create a new instance ( to query a Fan ) : ManagementObjectSearcher Fan = new ManagementObjectSearcher(string eg "SELECT * FROM Win32_Fan"); There are 22 properties of the Fan Object like Active Cooling etc. These will become available from the instance above. Might need some corrections but working on it. Asante. :-)

On Sat, Aug 22, 2009 at 10:30 AM, Bernard Owuor <b_owuor@yahoo.com> wrote:
@Aki,
I see why you could be lost in WMI world. All the great things at your fingertips, so much for crons and bash in linux. WMI seems really great for writing monitoring scripts.
Well, if it meets your USB device access need, then you're home. You'll have to dig deeper if you want to build device driver for new hardware.
Cheers!
@Bernard, thnks for sharing some insights. Its a big help for future directions. :-)

Benard, Please check out http://msmvps.com/blogs/jon_skeet/default.aspx. The fellow started off with C, Mastered Java but somehow fell in love with C#. Strange thing is that he now works at Google UK. He has very interesting comments at stackoverflow.com http://stackoverflow.com/questions/295224/list-major-differences-between-c-a... http://stackoverflow.com/users/22656/jon-skeet Considering the fellow is a Brit am sure he will be in Kenya one of these days for holidays. Never thought any (Brit) would interest me but this one is as civil (decent) as he is sharp. He is such a great educator that ignoring him would be pure folly. On Fri, Aug 21, 2009 at 9:44 PM, Bernard Owuor <b_owuor@yahoo.com> wrote:
@Aki! I think you found a convenient and artificial crossroads because you're facing some challenges in C#. I'd urge you to stick with C# because all other languages are cheesecake once you master one.
I'm currently converting a VB app to C# (so that it can run in *nix - using mono) and seem unable to notice the differences between the languages, apart from the abundance of C# docs. Stick with it or take a subset to get through.
*From:* aki <aki275@googlemail.com> *To:* Skunkworks forum <skunkworks@lists.my.co.ke> *Sent:* Friday, August 21, 2009 1:00:17 AM *Subject:* Re: [Skunkworks] Programming.....the bumps and diversions, just like many tech things
On Thu, Aug 20, 2009 at 11:42 PM, Bernard Owuor <b_owuor@yahoo.com> wrote:
Basically, it is possible using libusb-win32. Look at:
@ Thnks Bernard. :-) Yesterday I found WMI with Win32_ classes . Now am having to go back to scratch as WMI is mostly scripting. I had no idea WMI was powerful on windows. I also found something " new to me" for windows i.e Powershell programming. I guess I must be at the correct cross roads.........
@Thnks Frankline. :-)
Cheers.
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks Other services @ http://my.co.ke Other lists ------------- Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce Science: http://lists.my.co.ke/cgi-bin/mailman/listinfo/science kazi: http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general

@Murigi, An interesting, impressive and outstanding person indeed. Why not invite the guy to skunkworks if you think he might visit Kenya in the near future? I'm almost sure he'll be glad to give a talk. ________________________________ From: Murigi Muraya <mmskunkworks@gmail.com> To: Skunkworks forum <skunkworks@lists.my.co.ke> Sent: Thursday, August 27, 2009 3:35:05 AM Subject: Re: [Skunkworks] Programming.....the bumps and diversions, just like many tech things Benard, Please check out http://msmvps.com/blogs/jon_skeet/default.aspx. The fellow started off with C, Mastered Java but somehow fell in love with C#. Strange thing is that he now works at Google UK. He has very interesting comments at stackoverflow.com http://stackoverflow.com/questions/295224/list-major-differences-between-c-a... http://stackoverflow.com/users/22656/jon-skeet Considering the fellow is a Brit am sure he will be in Kenya one of these days for holidays. Never thought any (Brit) would interest me but this one is as civil (decent) as he is sharp. He is such a great educator that ignoring him would be pure folly. On Fri, Aug 21, 2009 at 9:44 PM, Bernard Owuor <b_owuor@yahoo.com> wrote: @Aki!
I think you found a convenient and artificial crossroads because you're facing some challenges in C#.
I'd urge you to stick with C# because all other languages are cheesecake once you master one.
I'm currently converting a VB app to C# (so that it can run in *nix - using mono) and seem unable to notice the differences between the languages, apart from the abundance of C# docs. Stick with it or take a subset to get through.
From: aki <aki275@googlemail.com>
To: Skunkworks forum <skunkworks@lists.my.co.ke> Sent: Friday, August 21, 2009 1:00:17 AM Subject: Re: [Skunkworks] Programming.....the bumps and diversions, just like many tech things
On Thu, Aug 20, 2009 at 11:42 PM, Bernard Owuor <b_owuor@yahoo.com> wrote:
Basically, it is possible using libusb-win32. Look at:
@ Thnks Bernard. :-) Yesterday I found WMI with Win32_ classes . Now am having to go back to scratch as WMI is mostly scripting. I had no idea WMI was powerful on windows. I also found something " new to me" for windows i.e Powershell programming. I guess I must be at the correct cross roads.........
@Thnks Frankline. :-)
Cheers.
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com _______________________________________________
Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks Other services @ http://my.co.ke Other lists ------------- Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce Science: http://lists.my.co.ke/cgi-bin/mailman/listinfo/science kazi: http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general

I am just a weeny bit curious why Murigi evidently certain the coder will be coming to Kenya on holiday soon and that he'd be interested or find time to give a free talk? Whom does he work for? His blog says "**This is my personal blog. The views expressed on these pages are mine alone and not those of my employer.** Employers are not supposed to be any secret:) regards On Thu, Aug 27, 2009 at 7:39 PM, Bernard Owuor<b_owuor@yahoo.com> wrote:
@Murigi, An interesting, impressive and outstanding person indeed. Why not invite the guy to skunkworks if you think he might visit Kenya in the near future? I'm almost sure he'll be glad to give a talk.
________________________________ From: Murigi Muraya <mmskunkworks@gmail.com> To: Skunkworks forum <skunkworks@lists.my.co.ke> Sent: Thursday, August 27, 2009 3:35:05 AM Subject: Re: [Skunkworks] Programming.....the bumps and diversions, just like many tech things
Benard,
Please check out http://msmvps.com/blogs/jon_skeet/default.aspx. The fellow started off with C, Mastered Java but somehow fell in love with C#. Strange thing is that he now works at Google UK. He has very interesting comments at stackoverflow.com
http://stackoverflow.com/questions/295224/list-major-differences-between-c-a... http://stackoverflow.com/users/22656/jon-skeet
Considering the fellow is a Brit am sure he will be in Kenya one of these days for holidays. Never thought any (Brit) would interest me but this one is as civil (decent) as he is sharp. He is such a great educator that ignoring him would be pure folly.
On Fri, Aug 21, 2009 at 9:44 PM, Bernard Owuor <b_owuor@yahoo.com> wrote:
@Aki! I think you found a convenient and artificial crossroads because you're facing some challenges in C#. I'd urge you to stick with C# because all other languages are cheesecake once you master one.
I'm currently converting a VB app to C# (so that it can run in *nix - using mono) and seem unable to notice the differences between the languages, apart from the abundance of C# docs. Stick with it or take a subset to get through.
From: aki <aki275@googlemail.com> To: Skunkworks forum <skunkworks@lists.my.co.ke> Sent: Friday, August 21, 2009 1:00:17 AM Subject: Re: [Skunkworks] Programming.....the bumps and diversions, just like many tech things
On Thu, Aug 20, 2009 at 11:42 PM, Bernard Owuor <b_owuor@yahoo.com> wrote:
Basically, it is possible using libusb-win32. Look at:
@ Thnks Bernard. :-) Yesterday I found WMI with Win32_ classes . Now am having to go back to scratch as WMI is mostly scripting. I had no idea WMI was powerful on windows. I also found something " new to me" for windows i.e Powershell programming. I guess I must be at the correct cross roads.........
@Thnks Frankline. :-) Cheers. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com _______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks Other services @ http://my.co.ke Other lists ------------- Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce Science: http://lists.my.co.ke/cgi-bin/mailman/listinfo/science kazi: http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks Other services @ http://my.co.ke Other lists ------------- Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce Science: http://lists.my.co.ke/cgi-bin/mailman/listinfo/science kazi: http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general

Good questions. These are just my convictions (no rationale). The fellow is a strong believer in social justice. http://skeetfaith.blogspot.com/ Kind of fellow who would read *Britain's Gulag*<http://www.amazon.co.uk/Britains-Gulag-Brutal-Empire-Kenya/dp/022407363X>and want to do something small to make up for it. Previous e-mail indicated who he works for. Nothing special about him and if our Alpha Geeks (such as Bernard) imitated him and presented more of their insights we would all be better off. On Thu, Aug 27, 2009 at 8:37 PM, Gakuru Alex <alexgakuru.lists@gmail.com>wrote:
I am just a weeny bit curious why Murigi evidently certain the coder will be coming to Kenya on holiday soon and that he'd be interested or find time to give a free talk?
Whom does he work for? His blog says "**This is my personal blog. The views expressed on these pages are mine alone and not those of my employer.** Employers are not supposed to be any secret:)
regards
On Thu, Aug 27, 2009 at 7:39 PM, Bernard Owuor<b_owuor@yahoo.com> wrote:
@Murigi, An interesting, impressive and outstanding person indeed. Why not invite the guy to skunkworks if you think he might visit Kenya in the near future? I'm almost sure he'll be glad to give a talk.
________________________________ From: Murigi Muraya <mmskunkworks@gmail.com> To: Skunkworks forum <skunkworks@lists.my.co.ke> Sent: Thursday, August 27, 2009 3:35:05 AM Subject: Re: [Skunkworks] Programming.....the bumps and diversions, just like many tech things
Benard,
Please check out http://msmvps.com/blogs/jon_skeet/default.aspx. The fellow started off with C, Mastered Java but somehow fell in love with C#. Strange thing is that he now works at Google UK. He has very interesting comments at stackoverflow.com
http://stackoverflow.com/questions/295224/list-major-differences-between-c-a...
http://stackoverflow.com/users/22656/jon-skeet
Considering the fellow is a Brit am sure he will be in Kenya one of these days for holidays. Never thought any (Brit) would interest me but this one is as civil (decent) as he is sharp. He is such a great educator that ignoring him would be pure folly.
On Fri, Aug 21, 2009 at 9:44 PM, Bernard Owuor <b_owuor@yahoo.com> wrote:
@Aki! I think you found a convenient and artificial crossroads because you're facing some challenges in C#. I'd urge you to stick with C# because all other languages are cheesecake once you master one.
I'm currently converting a VB app to C# (so that it can run in *nix - using mono) and seem unable to notice the differences between the
languages,
apart from the abundance of C# docs. Stick with it or take a subset to get through.
From: aki <aki275@googlemail.com> To: Skunkworks forum <skunkworks@lists.my.co.ke> Sent: Friday, August 21, 2009 1:00:17 AM Subject: Re: [Skunkworks] Programming.....the bumps and diversions, just like many tech things
On Thu, Aug 20, 2009 at 11:42 PM, Bernard Owuor <b_owuor@yahoo.com> wrote:
Basically, it is possible using libusb-win32. Look at:
@ Thnks Bernard. :-) Yesterday I found WMI with Win32_ classes . Now am having to go back to scratch as WMI is mostly scripting. I had no idea WMI was powerful on windows. I also found something " new to me" for windows i.e Powershell programming. I guess I must be at the correct cross roads.........
@Thnks Frankline. :-) Cheers. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com _______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks Other services @ http://my.co.ke Other lists ------------- Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce Science: http://lists.my.co.ke/cgi-bin/mailman/listinfo/science kazi: http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks Other services @ http://my.co.ke Other lists ------------- Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce Science: http://lists.my.co.ke/cgi-bin/mailman/listinfo/science kazi: http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks Other services @ http://my.co.ke Other lists ------------- Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce Science: http://lists.my.co.ke/cgi-bin/mailman/listinfo/science kazi: http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general
participants (5)
-
aki
-
Bernard Owuor
-
Frankline Chitwa
-
Gakuru Alex
-
Murigi Muraya