- Netduino Forums
- → bill.french's Content
bill.french's Content
There have been 260 items by bill.french (Search limited from 05-July 23)
#4298 .Net, Fred's webserver, and me
Posted by
bill.french
on 28 October 2010 - 03:12 AM
in
Netduino Plus 2 (and Netduino Plus 1)
I like this explanation on using and IDisposable -- does that sound about right to you?
I've also figured out that the #Region stuff is not a requirement, just a nice way to structure the code, right?
Should you have "GC.SuppressFinalize(this);" as in here? Or is that not applicable in netmf?
Reading the webserver code, I am understanding how it's non-blocking -- but is it multithreaded? There's certainly threads involved, but to make it multithreaded, it seems that once you got a clientsocket, that should be spun off into it's own thread (which would deal with the response) so that the next connection could be accepted? I don't doubt that I'm misunderstanding this. Am I missing something?
Thank you so much for your time!
#4331 .Net, Fred's webserver, and me
Posted by
bill.french
on 28 October 2010 - 11:09 PM
in
Netduino Plus 2 (and Netduino Plus 1)
Corey, if I can get a little more time from you, or anyone else:
But you may be wondering why the link you posted has such complicated code. The answer is that Bill Gates is much smarter and richer than you and me, and therefore he has thought very hard about the difference between finalization and disposing. The rules are subtle and complicated (by the way, the link you posted also has it a little bit wrong)
Is the issue in:
~DisposeObject() { Dispose(false); }
? It seems this finalizer doesn't do anything, and based on what you said:
1. It should call CleanUp()
2. CleanUp() should deal with only unmanaged stuff
3. managed stuff should be handled in the if(disposing) block
Thanks, all, again. --Bill
#4315 .Net, Fred's webserver, and me
Posted by
bill.french
on 28 October 2010 - 12:20 PM
in
Netduino Plus 2 (and Netduino Plus 1)
Please please please don't stop!! Certainly not because of anything I've said! You're a hero in my book.Damn, I hate posting code online.
Wow, thanks everyone, I have read every word and I think I get it. My original post was primarily about tricking smart people into teaching me something I probably should have already known, for free. However, a part of me hopes I'm not alone and that it might be useful for someone else.
I also think this discussion really reveals how awesomely powerful the netmf is -- i can't imagine the competing platforms are having these types of discussions. I am certainly capable of understanding these things, but the subtleties of the implementation are tough, or at least, unobvious. (A tilde means what??)
I have been thinking about the using statement (and IDisposable, but not as much - and only tied the two together in the last 24 hours) for at least 5 years. I've read what it does, but have never gotten to the "but, why?" part. This line in the .net wiki sums up my frustration:
You should be familiar with the pattern or with the interface because it's a basic thing to know about the .Net framework.
Basic thing to know?? Why? I've read many books and created .Net applications that (admittedly small numbers of) people are actively using on a daily basis and never touched/actively avoided it.
I learn much better when there's a practical application involved, and the nd+ web server seemed like a perfect opportunity for me to bring myself forward with code I otherwise understand.
Concerning the multithreading, I agree that how it is done is probably the most appropriate. Threading is also something I'm trying to wrap my head around, so I'm happy to see i've gotten myself to the point of identifying it... how to make it multithreaded (or if it even should be) i will leave up to you all, but maybe I'll tackle it.
So, am I getting this right:
The point/advantage of having Listener implement IDisposable is so others can now call it in a using() (since using() requires the IDisposable interface) and trust it to clean up after itself. Does the IDisposable stuff also get called if, at some point in Program.cs, webServer = "null"? I think "yes".
Thank you, all, again.
#4302 .Net, Fred's webserver, and me
Posted by
bill.french
on 28 October 2010 - 03:29 AM
in
Netduino Plus 2 (and Netduino Plus 1)
#4301 .Net, Fred's webserver, and me
Posted by
bill.french
on 28 October 2010 - 03:25 AM
in
Netduino Plus 2 (and Netduino Plus 1)
Most of what I've written in the past only dealt with exceptions as a bad thing that end a program, I do know that I need to explore using exceptions in positive ways, somewhat similar to events.
#8012 Doing a PIC's Job
Posted by
bill.french
on 20 January 2011 - 07:00 PM
in
General Discussion
other than the thermal pad, you could hand solder this, i think.So, I've been looking over battery charger ICs and I found one that I really like, the trouble is that it's a "thermally-enhanced TSSOP" package which has a pad that needs to get soldered to the circuit board. It also looks very surface-mount and I don't have anything to deal with that. Is there any way to utilize this IC or should I look for something that's easier to use?
Or use this: http://www.proto-adv...ucts_id=2210234
It has videos and everything!
#7211 Doing a PIC's Job
Posted by
bill.french
on 07 January 2011 - 02:13 PM
in
General Discussion
#7243 Doing a PIC's Job
Posted by
bill.french
on 07 January 2011 - 09:01 PM
in
General Discussion
#6927 Doing a PIC's Job
Posted by
bill.french
on 03 January 2011 - 08:25 PM
in
General Discussion
LOL, well, that does make a difference. Even with 10 cells, though, they might peak as high as 1.5v/cell (or more depending on what you're dealing with), so that's still 15v.Sorry, that's a typo, I meant 1-10 cells.
#6910 Doing a PIC's Job
Posted by
bill.french
on 03 January 2011 - 01:27 PM
in
General Discussion
#7231 Doing a PIC's Job
Posted by
bill.french
on 07 January 2011 - 08:22 PM
in
General Discussion
I think you could get away with 3v on the mini, on the 3.3v pin.but I wanted to use a netduino mini since I have a fair understanding of C# and I'm pretty sure that doesn't run on 3V
Also, this site I think has a lot of "in car" stuff, like this:
http://www.mini-box....8&category=1264
...which you might think about using with a small lead-acid battery. Just throwing stuff out there.
Good luck with this!
#5008 Digital spirit-level, which sensor?
Posted by
bill.french
on 17 November 2010 - 04:22 PM
in
General Discussion
#4608 Disable Pull-up resistors
Posted by
bill.french
on 07 November 2010 - 07:53 PM
in
General Discussion
#4674 Disable Pull-up resistors
Posted by
bill.french
on 08 November 2010 - 09:46 PM
in
General Discussion
#4607 Disable Pull-up resistors
Posted by
bill.french
on 07 November 2010 - 07:49 PM
in
General Discussion
#4547 MFToolkit - new release (VS2010 support / .NET MF 4.1)
Posted by
bill.french
on 07 November 2010 - 12:02 AM
in
Netduino Plus 2 (and Netduino Plus 1)
#4580 MFToolkit - new release (VS2010 support / .NET MF 4.1)
Posted by
bill.french
on 07 November 2010 - 02:08 PM
in
Netduino Plus 2 (and Netduino Plus 1)
#5970 Anyone have a clever hex->byte conversion routine?
Posted by
bill.french
on 10 December 2010 - 01:07 PM
in
Netduino 2 (and Netduino 1)
![:unsure:](http://forums.netduino.com/public/style_emoticons/default/unsure.png)
#5956 Anyone have a clever hex->byte conversion routine?
Posted by
bill.french
on 10 December 2010 - 02:02 AM
in
Netduino 2 (and Netduino 1)
#5960 Anyone have a clever hex->byte conversion routine?
Posted by
bill.french
on 10 December 2010 - 03:01 AM
in
Netduino 2 (and Netduino 1)
public static byte[] GetByteArray(string s) { return System.Text.Encoding.UTF8.GetBytes(s); } public static byte GetByteFromHex(string s) { return GetByteFromHex(GetByteArray(s)); } public static byte GetByteFromHex(byte[] ba) { return (byte)((((ba[0] > 96) ? ba[0] - 87 : ba[0] - 48) * 16) + ((ba[1] > 96) ? ba[1] - 87 : ba[1] - 48)); }
#5796 Anyone have a clever hex->byte conversion routine?
Posted by
bill.french
on 06 December 2010 - 02:58 AM
in
Netduino 2 (and Netduino 1)
#5867 Stepper Motor Control?
Posted by
bill.french
on 07 December 2010 - 06:04 PM
in
Netduino 2 (and Netduino 1)
#5875 Stepper Motor Control?
Posted by
bill.french
on 07 December 2010 - 07:57 PM
in
Netduino 2 (and Netduino 1)
#6157 Netduino Plus - First impressions from a beginner
Posted by
bill.french
on 16 December 2010 - 05:34 PM
in
Netduino Plus 2 (and Netduino Plus 1)
Microsoft Tags are actually really cool things.
#6164 Netduino Plus - First impressions from a beginner
Posted by
bill.french
on 16 December 2010 - 08:43 PM
in
Netduino Plus 2 (and Netduino Plus 1)
Thanks Bill.
Er, what can I do with it?
Jim
Well, if you've got a smartphone, you can get the microsoft tag app, scan it with your phone, and it will send you to the netduino download section.
- Netduino Forums
- → bill.french's Content
- Privacy Policy