I got sick of having to edit the launch file whenever I ran my Poker Timer (https://ry4an.org/unblog/msg00038.html), so I wrote a quick CGI that generates a JNLP file which launches the app with the specified settings. You'll need to have a 1.2 or higher Java Virtual Machine installed (http://java.com).
So we've got a Perl interpreter dynamically producing a JNLP file that tells a Java Virtual Machine what to do. Talk about an unholy alliance.
The timer can be run at:
https://ry4an.org/pokertimer/
I said I wasn't going to do it, but I ended up doing so anyway. I've written a Poker dealing IRC bot. It's not terribly modular and it only supports TexasHold'em, but it works. It requires Perlbot 1.9.5 which is available on source forge. Here's an excerpt from play:
<Dealer> Board now shows: AH 2C 9D 2D <Dealer> joe, action is to you. Current bet is 0. * joe bets 20 <Dealer> joe bets 20. <Dealer> Ry4an, action is to you. Current bet is 20. * joe peeks * Ry4an calls <Dealer> Ry4an calls. <Dealer> Board now shows: AH 2C 9D 2D 2H <Dealer> joe, action is to you. Current bet is 0. * joe checks <Dealer> joe checks. <Dealer> Ry4an, action is to you. Current bet is 0. * Ry4an checks <Dealer> Ry4an checks. <Dealer> joe has been called and shows: 7D 8D <Dealer> Ry4an shows 10C 6C and wins 70 with Trips (2 A T)
Anyway, I've attached the code in case someone wants to take it and make it better or update it to the newer versions of perlbot.
There are no new ideas in the message, I just don't know if the existing components have been previously combined in the way I'm proposing. If they have been I couldn't find anyone talking about it. Anyway...
Most websites live forever in obscurity getting a few hundred hits a day at best. However, if that same website gets linked to from a popular super-recommender like slashdot.org or boing-boing.net the hits can jump from 100s per days to 100s per minute. This phenomenon is called the slashdot effect (http://en.wikipedia.org/wiki/Slashdot_effect). On a server built with a low hit volume in mind it's pretty devastating, generally resulting in complete denial of service.
There are, however, things people can do to mitigate the effects of the slashdot effect -- besides buying a beefier server. One of the most effective is to take the specific page to which slashdot has posted a link and create a lighter version of it. One makes a copy with fewer images, less text, no extra boxes, headers, footers, etc. If initially the page was dynamically generated (created on the fly on a per-request basis) a static copy is made that views the same for everyone. Serving up this static, lite version imposes less CPU load on the server and reduces bandwidth consumption.
Sites that do this often configure their web servers so that visitors coming from slashdot get the lite version of the content while those coming from anywhere else get the full page as normally displayed. This is possible because all web browsers send a Referrer: header specifying from whence they just came.
Another strategy employed by many sites with non-user-specific dynamic content is the caching of dynamically generated content as static pages. These cached static pages are re-validated periodically. Doing this form of caching reduces CPU load on servers. In fact, slashdot actually caches its own front page rather than dynamically-generating it on each page view for non-logged-in users (those not viewing a personalized copy of the front page). These dynamic-as-static caches don't, however, re-write the HTML to make it lighter, thus they reduce CPU load (by generating the pages less frequently) but not bandwidth (as all the same data is transferred).
I would think that with a little configuration work, scripting, and maybe a custom Apache (web server) module one could combine and automatic referrer detection, lite version creation, and dynamic content caching to produce a site that in general usage does no caching or content-rewriting (as they're generally unnecessary for small sites), but if and only if the referrer on a request came from a super-recommender would automatically create, cache, and use a lite version of the requested content.
Setting up a referrer specific, auto-caching, auto-rewriting system like this would be better than manually creating a lite version and inserting a referrer-based redirection rule after one's been slashdotted, because the sudden and fleeting nature of a slashdotting provides no warning and ends shortly after. Heck, if the slashdotting drops one's server to its knees one might not even be able to get into it to insert the "redirect to a light version by referrer" logic manually.
If I ever get around to putting such a backup system on my web server I'll post how I ended up doing it. Then again, first I'd have to do something interesting enough to get slashdotted.
A few years back I was working in an office where my workspace was so noisy I kept slipping away to find quieter places in the building to work whenever I has a task which could be completed away from my desk. To avoid looking perpetually absent I wrote a quick script that would display (if available) the contents of a file named I-AM-AT and the how long it had been since I'd last pressed a key.
I fed this simple text output through the xscreensaver (http://www.jwz.org/xscreensaver/) application's phosphor () screen saver which displays text as if were showing up on an ancient monochrome monitor.
The end result being anyone could walk by my desk, see where I was, and how long it had been since I'd left. It worked really well, as as an extra benefit those who came in at 6am could see I'd often left just 3 hours previous which quieted grumbles when I'd arrive at 9:30 or 10:00.
The problem started when I began running over lunch again. I'd walk home (15 minutes), run (30 minutes), shower and change (10 minutes), and walk back to the office (15 minutes) -- totalling 70 minutes, a bit more than the 60 minutes everyone generally took for lunch. My taking an extra 10 minutes every day over lunch wouldn't have been a problem really. Times weren't carefully watched, and everyone (by now) knew I often stayed really late, but still having my own computer advertising that I'd been at lunch for 1:10 just didn't look good.
I decided the fix was to have the time reporting on the display not quite, exactly, correspond with real linear time. The fudge factor, though, couldn't just be "subtract 10 minutes". Doing so would mean that initially it would say I'd been gone for negative 10 minutes, definitely a tip off that something wasn't quite accurate. Also to be avoided were any sudden changes in the time. If "gone for 7 minutes" was still visible scrolling off the screen and "gone for 9 minutes" or worse yet "gone for 5 minutes" was replacing it, the game would be up.
I ended up going with a system of strictly linear time for the first 45 minutes of any absence, at which point the rate of time passage would slow and then return to normal gradually (sinusoidally, actually) until at the 1 hour 15 minute mark it was displaying just 1 hour elapsed and time was running at the right rate again. Then an hour later the process would be reversed with a speed up followed by a slow down that would have time back on track after 2 hours 15 minutes total elapsed real time. This kept my overnight elapsed time reporting accurate while keeping my daily runs to about 57 displayed minutes.
As seen in the previous posting my friends and I are on a bit of a poker kick lately. As mentioned a good while back we sit in an IRC channel all day while working. I thought it would be fun to find and run a tiny little IRC bot that would deal poker for us. You know a few hands over lunch. No real money of course, just a little diversion. There exist IRC bots that do everything from serve virtual drinks to search google for you. Making a bot that deals poker should be well within the realm of the medium. I expected to find ten poker dealing bots in the usual places and if I was lucky one of them would be decent enough to be usable.
A little googling found that someone wrote a very capable IRC dealer. http://www-2.cs.cmu.edu/afs/cs/user/mummert/public/www/ircbot.html Todd W. Mummert a researcher at CMU wrote a great one. It's stable, full featured, and with a good interface -- and no longer available. What's more there are a plethora of excellent graphical clients written by third party developers that are now completely useless. These developers took hundreds of hours to write nice graphical front ends for a poker system that is now completely unavailable because the author never released the source.
Other searches found a new system in the making from some AI researchers in Canada. They've got a reasonably well designed protocol, for academics anyway, specified ( http://games.cs.ualberta.ca/webgames/poker/bots.html ), and they've even written two libraries one can use to write clients -- for their unreleased server which could, of course, vanish at any time leaving a supporting developer out in the cold.
No one's making money off this stuff, and everyone's insistence on server-side secrecy is just baffling. It doesn't prevent cheating; it doesn't facilitate client testing, and I suspect it keeps the best of developers away from their systems.
For now, we'll be poker-less in IRC, and probably get a little more work done because of it, but if I break down and write an IRC poker bot you can be damn sure the source won't be locked away on my drives so that when I finally grow up and move on whomever next wants to write one can start with my crappy code.
Some friends and I have been playing poker a couple of times a month for the last year or so. Our play is terrible, no one cares, and we usually spend more on beer than we win. It's a good time.
In November a few of us decided to head to the local card club and try our hands at play in the wild. We decided to enter a tournament. Tournaments are a great way to start out playing at a card club because you know going in exactly how much money you're going to loose from the start. Ninety or so people each pay a fixed entrance free, and only the top nine of them get any prize money at all. Tournaments all offer good initial chip parity -- everyone starts with exactly the same amount of money so you can't be pushed around by bigger stack from the start. Another added bonus is that for your initial buy-in of twenty or so dollars you get a few thousand "dollars" in tournament chips. They're not real money but they're the closest I'll ever come to saying, "I raise 2000," without having to append, "pennies."
The tournament was great fun and though none of us made it into the top 50% of finishers we really liked the betting structure. The tournament was divided into twenty minute rounds each of which had their own amounts for the blinds (like antes) and minimum bets. The constantly escalating financial pressure encouraged aggressive play and ensured a timely conclusion.
Last night the friends were coming by for poker again and wanted to play tournament-style, but we couldn't find any tournament round display software for download. I ended up writing a quick and dirty one poker timer that allows for the display of progressive round values. I would have liked to have displayed it through the TV but lacked the right cables so we just set a laptop where everyone could see it. I've attached the Java source, binaries, and a screenshot.
Last November while sitting in the Atlanta airport with not much to do I saw a bank of six different trash cans. They were in a neat row, each was in a different color, and they were all good for only one thing. People would walk up with a piece of trash and then carefully place it into whichever bin it best fit. Is this bottle glass or plastic? The lid is aluminum does it need to come off? Is this a number two plastic or a number four plastic?
People, actual grown adults, were sorting garbage. If thirty years ago you had tried to tell me that in the next millennium everyone sorts garbage, you'd have failed because I wouldn't have been born yet. But had I been born I suspect I wouldn't have believed you.
Then in my boredom I had a vision, Shrimp Recycling. I wanted nothing more that to watch the people scanning the array of recycle bins to come across one with a logo indicating that shrimp tails and only shrimp tails were to be tossed into it. Would these automatons even notice or would they just pass it over as not-the-aluminum bin? Would they store away the knowledge and start saving their shrimp tails for future recycling? How the hell would you recycle a shrimp tail?
I knew then I needed to make up some shrimp recycling logos I could affix to existing recycling bins in public places. Today I finally got around to it and, well, it's pretty clear I'm not graphic designer. Still, I hope to make them into vinyl labels and see what happens.
Attached is a small copy of the graphic and an archive containing the layered gimp file and an image sized for printing at 8" x 8" at 300 DPI. If I ever get around to actually making the labels and trying 'em out I'll try and post photos.
Comments
Of course shrimp tails would be an excellent addition to any compost heap. There may be other compostable matter in the airport, but who cares.
Your uncle,
-- Jeff
I got email from a few different folks saying that compost rather than recycling would be a better end for shrimp shells. I would have assumed so myself too, but then some googling turned up some pages saying that seafood shells aren't good for compost as they decompose too slowly. Some sites recommended grinding them into a fine powder and using them in mulch to reduce acidity.
Still, I'm mostly interested in how people would respond to shrimp recycling bins. I suspect the majority would pass them by without surprise. Maybe I'll place one in the row of trash cans next to the Lodge at the lakes this year and stake it out.
-- Ry4an
I live in a sleep deprived state. Not just because I have a lot to do and resent sleep as the short-term death it is, but also because I enjoy the swirling colors. Maintaining a sleep deprived state requires a good alarm clock. When your brain knows it needs 8 hours and you're giving it 4 it's gonna fight you, and given that it's in charge of your perceived reality, it doesn't have to fight fairly.
Buying a good alarm clock is an exercise in frustration. The features advertised on the box are seldom relevant, and the most important ones are never mentioned. In the absence of a plugged in display model one is left to read the labels on the buttons or if available a manual to try to see how the thing actually works. Two features which cannot be omitted without ruining the clock are:
The first of those two is the most important and has only really been available since microprocessors driven solid state buttons became cheaper than sliding switches. Unfortunately I've never seen a clock box explain whether or not turning off the alarm leaves it ready for the next days horrible awakening. Sure, this means that sometimes the alarm goes off on Saturday because I forgot to turn it off for the weekend and that my neighbors hate me when I go out of town, but until I see a clock that knows weekends from weekdays default-on is better than manual-select.
The snooze button to power button ratio is nearly as important. After my eighth snooze my brain is loudly explaining to my arm that everything would be much better if it would just "accidentally" hit the power button instead. The arm must not be allowed plausible deniablity.
Three years back I finally found a great alarm clock. The RCA RP3711 http://www.epinions.com/content_54115470980 meets the two must-have requirements. It also offers:
It's a great clock and I intend to pick up a few as back-ups in the future. Unfortunately, the power-off button is just a little too easy to hit. It's not at all easy to confuse for the snooze button (it's a teal circle up top as compared to a large silver dome on the front), but it can be hit from above with a ham-fisted swat which is just a bit too easy. For years I've corrected this by taping a small circle of plastic over-top the power button. When I was finally willing to actually get up and turn off the clock I'd flip up the cover and then press the button -- sort of like firing missiles in a fighter jet.
However, with things as busy as they've been at work lately I'm running on even less sleep than normal and Brain has been tricking Arm more reliably. A few times as of late I've woken up hours after I should have and Brain is all, "Arm must have done it," and Arm is all, "Nope, Torso was laying on me."
To fix this I decided to take apart the clock and see what could be done about making the power button harder to press. I was envisioning adding another push button in series with the existing one necessitating the pressing both at the same time to shut it off. If these two buttons were on opposites sides of the clock and more than a hand span apart actually waking up when turning the clock off would be almost assured. If a length of cable with two wires in it was used the power button could even be removed from the clock altogether and placed over by the door -- now that's safety.
Unfortunately the little micro-switch was a surface mount component and getting it loose was going to take better soldering skills than I have. I had to settle for snipping off the plastic caps for the volume control and power switch. Now to turn the clock off one must carefully place a finger deep into the gaping hole on the top of the clock and depress the tiny micro-switch. Indelicate button pressing results in a miss and likely an electric shock -- that'll teach Arm to listen to Brain.
Comments
When I was 10 years old, I picked up a Sony "Dream Machine" (ICF-C370). Not only does the alarm stay set, it requires pressing two buttons to turn it off. Not in succession, either, you have to press them both in the proper order - first the 'Alarm' button, and while holding that down, the 'Alarm on/off' button. I've been using this alarm for 15 years and it's performed flawlessly. Although I'm extremely happy with it, I find myself requiring more, as of late. See, I'm not some gimp that requires the use of the snooze button. My problem is that the snooze button is so large that I accidentally hit while fumbling to turn the alarm off. Then, while I'm happily showering or something, it starts going off. I need a way of reducing the size of the snooze button, or disabling it entirely. Also, my clock makes annoying clicking noises if I set my phone to close to it... I'm sad that the alarm clock market sucks so bad now... I really want to find a good one -- Gabe Turner
GPSDrive (http://www.gpsdrive.de/) is nifty software for Linux that turns a laptop and a cheap GPS receiver into a vehicle navigation system. It displays maps, records tracks, logs speed traps, and all the other little features you'd expect in a system trying to divert your eyes from the road.
It also sports a built-in system for networking with other GPSDrive enabled systems on the road to mutually plot one another's locations. The system, called friendsd, uses a simple UDP server to record and report the position, speed, and heading of other reporting systems on the same server. Of course, this reporting only works if the laptop has access to the Internet but with the various cellular and wi-fi systems available that's not so much a stretch.
I've got a silly little project in the works for using friendsd in a manner other than its original intent, but I needed to be able to interact with it using something other than GPSDrive as the client. To that end I wrote up a little Perl module, Net::Friends (attached), that provides for basic reporting to and querying from friendsd servers. I think it game out pretty well.
...or your own silly Condo board. For the second time I've run for and been shot down running for the association board for my condominium development.
The board determines the budget, handles rules infractions, and controls the contract with our management company. The current board, though well meaning, has made a lot of choices I haven't understood and they haven't felt it necessary to explain.
The first time I ran, two years ago, I ran offering a "do nothing" board. I wanted the board to do as little as possible with as little as possible and feared things wouldn't go that way without my involvement. I didn't make the board then and we have had a very... hands on board.
Now two years later, with a large portion of the condo residents unhappy with the board's spending, medaling, and secrecy I ran a campaign promising a more transparent board. I got the majority of the vote of those present at the meeting, but couldn't out number the proxies.
You see rather than have absentee ballots for the 80% of the residents that didn't attend the meeting the board mailed to each of them a form, the signing of which would proxy their voting power to the existing board. So even though most of the people at the meeting voted for me the 32 proxy votes that were cast against me in advance outweighed them. Knowing about the proxy system from prior sham elections I'd created a proxy form that assigned votes to me and had distributed them as best I could without the postal resources the board had. That yielded 16 votes but even those couldn't overcome the 32 votes the board had been given.
Fortunately, there will be another election in just one short year and two of the five seats will be up for grabs. In the meantime I'll be continuing to help maintain http://riverstation.org/ for the visibility and working to get the proxy system replaced with absentee ballots and prior nominations.
To think, all this work just to get on a board and block actions.
Comments
Interesting story, Ry4an.
I think your platform this year is a winning message and you should continue on it next year. To win next time, organize, organize, organize.
I just attended Camp Wellstone <http://www.wellstone.org>, where I learned the basics of organizing a campaign. You might find it useful to attend their candidate track next time they have a program. When I did it, it was about $50.
Here's some of what I learned there, as it applies to your situation [aside: as I wrote this, I realized this could be pretty fun. I'll be your campaign manager if you want...].
The campaign plan is your blueprint for the campaign: how you get to 50% + 1 votes. This will include the size of the voter universe, how many votes you need to win, and what you're willing to spend to do it (budget). You'll also define your message here (accountability and transparency).
Every campaign comes down to lists: supporters, opponents' supporters, donors, volunteers.
Make a list of your core supporters. Add to it those who voted for you last time either by proxy or in person. Also keep track of those who opposed you and the proxy votes they control.
Using your list of supporters, contact them during the year long before the election to let them know you're going to run again, for accountablity and transparency. Line up their support as the basis for your "grassroots" campaign. Get them to assign their votes to you in proxy, and talk their neighbors into doing so as well. This is where you can economically start giving people proxy forms. If you consolidate your base and enlist some of them as volunteers, you can probably have a few of them run off copies to give to neighbors as well.
After you consolidate your base, you need to expand it. RiverStation.org is good for this purpose, as are volunteers you can drum up. You're already regularly attending community meetings, so that is a good place to get support as well. Bring a few copies of literature and proxy vote forms to these meetings to give to people.
Remember to keep track of the people you're contacting in your database.
A few weeks before the vote, start going after potential voters you don't have a personal relationship with. Go door knocking and talk to people. Likely, the will be upset about something the Board is doing. Let them know you're going to fight to make the board more accountable to the residents. This is where literature and proxy form dropping come in.
From your Campaign Plan, you know how many votes you need to win; from your database, you know how many you have. Now, make up the difference.
Starting a few days before the vote, call the people on your list of supporters to see if they're going to the vote meeting. If not, get a proxy form from them (send a volunteer to collect it so you can keep calling).
-- Luke Francl
'd totally take you up on help with this November's election. When writing for and especially speaking for campaign related stuff I have a hard time walking the line between soudning committed and sounding goofy.
I still thing the biggest help would be to get the election rules switched to something more fair, but there's the same problem as with respect to getting IRV in the USA -- the currently controlling parties have no reason to support any change in the way controlling parties are selected.
-- Ry4an
I'd be happy to come over sometime and plot strategy. You should hash out your list of supporters and opponents and how many votes they control before you forget too much.
Regarding changing the voting system, the only way you're going to do that is by getting a majority of the board to agree to it. That means you might need to elect more people to the board than just yourself, unless you can win over the current board with your rhetorical charms.
So why not surprise the board by winning under their rigged system?
-- Luke Francl
Yeah, that sounds fun. Within the condo association everyone's largely anonymous -- I don't know the names of any residents that aren't on the board or weren't previously known to me. Unfortunately, I didn't even think to write down the names of the sixteen people who did proxy their votes to me. It may be that if I provide the copies I could get the board to include me as one of the people to whom votes can be proxied on the form they mail out. Currently that list includes each of the current board members and a management company representative.
The riverstation.org site gathers email addresses and I've got the ability to send out a mass email through that channel which'll hit 50 to 100 of the units. As for making lists the board is launching an official website on March 1st which should provide a roster with names addresses and (maybe) email and phone contact info for everyone in the complex. Also, I suspect a request to the board might result in permission to actually get into each building to slip a flyer/proxy-form under doors instead of having to lurk in the cold to get in.
I think you're right about the (un)likelihood of success for a changing the way votes are done strategy. I've got the big book of condo rules, but I haven't yet checked to see how precisely the policy is spelled out in there and what (if any) policies are in place for modifying the rules themselves.
-- Ry4an
This work is licensed under a
Creative Commons Attribution-NonCommercial 3.0 Generic License.
©Ry4an Brase | Powered by: blohg 0.10.1+/77f7616f5e91