Re: Perl vs. Python question...
On Sat, 2009-07-11 at 23:44 -0400, Paul Lussier wrote: How do I create dynamically created methods in python classes? For example, if I have a number of member variables which I want to get or set, I don't want to have to create getters and setters for each attribute, since the code would largely be the same, just the variable I'm dealing with would be different. You've already gotten two useful responses. I'd just like to add that typically, the object attributes are referenced directly: rect.length * rect.width to compute area. Do not use: rect.get_length() * rect.get_width(). getter/setter methods get created when you some code is needed to control access: room.celsius room.fahrenheit computes the proper value from a single stored temperature (in Kelvin?). The code still looks like a direct reference to the attribute. You have a choice of using __getattr__/__getattribute__/__setattr__ or properties as suggested in the other email responses. -- Lloyd Kvam Venix Corp DLSLUG/GNHLUG library http://dlslug.org/library.html http://www.librarything.com/catalog/dlslug http://www.librarything.com/rsshtml/recent/dlslug http://www.librarything.com/rss/recent/dlslug ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
Re: Finding *unfiltered* free WiFi?
On 07/10/2009 04:15 PM, Joshua Judson Rosen wrote: I've had to deal with stationary freeloaders doing high-load filesharing on my open WiFi network, am I going to have to deal with transients who've planned out their road-trips around a WiFi AP-hopping scheme so that they can run bittorrent on-the-go? I think I'm going to tell myself that that's unreasonably paranoid--I hope I'm right :) A good GUI for traffic shaping controls would be a huge win. My basic philosophy on open AP's is that they can't make _my_ usage slow and they can't use enough data to put my connection over the ISP's monthly cap. I recently put a port-25 outbound block on due to some l0zer with an infected Windows machine that hopped onto my office network (I'm now in a mixed professional/residential neighborhood). The rate limits aren't too hard to do for those familiar with traffic shaper guts, but some user-land helpers would be really useful. Anybody seen these on low-cost AP's? -Bill -- Bill McGonigle, Owner Work: 603.448.4440 BFC Computing, LLC Home: 603.448.1668 http://www.bfccomputing.com/Cell: 603.252.2606 Twitter, etc.: bill_mcgonigle Page: 603.442.1833 Email, IM, VOIP: b...@bfccomputing.com Blog: http://blog.bfccomputing.com/ VCard: http://bfccomputing.com/vcard/bill.vcf ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
Re: Perl vs. Python question...
On 07/11/2009 11:44 PM, Paul Lussier wrote: In perl, I can use the AUTOLOAD feature to dynamically create methods, something like this: It looks like in perl6 you get this for free. I'm just getting started with it though. -Bill -- Bill McGonigle, Owner Work: 603.448.4440 BFC Computing, LLC Home: 603.448.1668 http://www.bfccomputing.com/Cell: 603.252.2606 Twitter, etc.: bill_mcgonigle Page: 603.442.1833 Email, IM, VOIP: b...@bfccomputing.com Blog: http://blog.bfccomputing.com/ VCard: http://bfccomputing.com/vcard/bill.vcf ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
Re: Finding *unfiltered* free WiFi?
Bill McGonigle wrote: The rate limits aren't too hard to do for those familiar with traffic shaper guts, but some user-land helpers would be really useful. Anybody seen these on low-cost AP's? Both Tomato and DD-WRT have QoS/bandwidth limiting capabilities. I'm not using it, so I don't know how well it will meet your requirements. -Mark ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
Re: Finding *unfiltered* free WiFi?
I confess that I'm happy to use free wireless on occasion but I worry that if I make my own AP similarly available then somebody is going to use it to post kiddy-porn or make threats and it'll be traced to my IP address and people with guns will then make me spend a lot of time money trying to convince them that I didn't do it. ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
Re: Finding *unfiltered* free WiFi?
On 07/13/2009 12:40 PM, Michael ODonnell wrote: I confess that I'm happy to use free wireless on occasion but I worry that if I make my own AP similarly available then somebody is going to use it to post kiddy-porn or make threats and it'll be traced to my IP address and people with guns will then make me spend a lot of time money trying to convince them that I didn't do it. There's also the inverse - if your WiFi isn't uncrackable (given?) and the same happens, what is your likely defense? Running open might offer some protection against that scenario. Granted, not technical problems. Your concern is real though, a guy in Germany running a Tor exit node was raided/beaten and held in jail for that kind of traffic. -Bill -- Bill McGonigle, Owner Work: 603.448.4440 BFC Computing, LLC Home: 603.448.1668 http://www.bfccomputing.com/Cell: 603.252.2606 Twitter, etc.: bill_mcgonigle Page: 603.442.1833 Email, IM, VOIP: b...@bfccomputing.com Blog: http://blog.bfccomputing.com/ VCard: http://bfccomputing.com/vcard/bill.vcf ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
Re: Finding *unfiltered* free WiFi?
On 07/13/2009 12:39 PM, Mark Komarinski wrote: Both Tomato and DD-WRT have QoS/bandwidth limiting capabilities. I'm not using it, so I don't know how well it will meet your requirements. They can classify traffic and assign relative priorities (good) but not hold anything to fixed caps or rates. I use the former on DD-WRT to keep my neighborhood network flowing nicely, but it's only fortune and cooperative neighbors that has kept our usage below caps (I'd really love to rate-limit limewire for one user). If 'unlimited' really meant that, the DD-WRT implementation would be perfect. I've attempted to hack pf to do the latter, but it's messy and confusing, even with current GUI helpers -Bill -- Bill McGonigle, Owner Work: 603.448.4440 BFC Computing, LLC Home: 603.448.1668 http://www.bfccomputing.com/Cell: 603.252.2606 Twitter, etc.: bill_mcgonigle Page: 603.442.1833 Email, IM, VOIP: b...@bfccomputing.com Blog: http://blog.bfccomputing.com/ VCard: http://bfccomputing.com/vcard/bill.vcf ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
Re: Legal hazards of WiFi (was: Finding *unfiltered* free WiFi?)
Bill McGonigle b...@bfccomputing.com writes: On 07/13/2009 12:40 PM, Michael ODonnell wrote: I confess that I'm happy to use free wireless on occasion but I worry that if I make my own AP similarly available then somebody is going to use it to post kiddy-porn or make threats and it'll be traced to my IP address and people with guns will then make me spend a lot of time money trying to convince them that I didn't do it. There's also the inverse - if your WiFi isn't uncrackable (given?) and the same happens, what is your likely defense? Running open might offer some protection against that scenario. Granted, not technical problems. Your concern is real though, a guy in Germany running a Tor exit node was raided/beaten and held in jail for that kind of traffic. And the thing that is often forgotten is that the raid, seizure, and even jail happen *before* court-trial--before the issue of `defense' even enters into it. Ending up `not guilty' does not undo whatever damage is done by the investigative process. So, the question isn't so much `do you have a good defense' as `can you minimise your risk of becoming a suspect in the first place'. Though, if this sort of fear (`there's no legally-safe way to run WiFi') is really warranted in NH, then maybe we should raise an issue with our government; NH being home to the Free State Project, and having several Free Staters in the NH House of Representatives, it may actually be worthwhile to talk to them. -- Don't be afraid to ask (Lf.((Lx.xx) (Lr.f(rr. ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
Re: Perl vs. Python question...
Lloyd Kvam pyt...@venix.com writes: You've already gotten two useful responses. I'd just like to add that typically, the object attributes are referenced directly: rect.length * rect.width Lloyd, thanks. But what if the attribute isn't set yet? If I have self.foo, and self.foo hasn't yet been set, I want it to go and get set, then return the correct value. I get the impression the __getattr__() method helps here, I just don't quite get it yet. -- Thanks, Paul ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/