aa_counter.py — pre- and post-increment and decrement in python

Bookmark and Share

Screen shot 2015-05-24 at 3.36.42 PMI like Python. A lot. But it has its limits, and short of forking a new version of Python for myself, sometimes it is just best to implement some kind of work-around. In this case, for pre- and post increment and decrement operations on counters, which Python regrettably lacks.
Read the rest of this entry »

Tags: , , , ,

Email This Post Email This Post

aa_bargraph.py — Bar graphing using text and image-free HTML

Bookmark and Share

Need to graph something? Happens to me all the time. And I need some very particular functionality. But that doesn’t mean I want to code it up every time I need it, nor should you have to. Python’s import library mechanism makes “canning” nearly any functionality you can imagine easy to do, and once canned… well, you know the drill. Import libraries are wonderful.

Console (text) mode bar graph in XTerm  shell

Console (text) mode bar graph in XTerm shell

So in this case, it was bar graphs I needed. Sometimes at the console, sometimes on web pages. aa_bargraph.py puts that together and makes it usable at several different levels of sophistication, at both the console (in text mode) and within the context of an HTML web page.
Read the rest of this entry »

Email This Post Email This Post Email This Post Email This Post

aa_webpage.py — awesome and easy web pages with Python

Bookmark and Share

I do a lot of generating web pages using Python. Python because I think Python 2.7 is awesome, and web pages because I do lots of work with various web sites that require dynamic results. Python is a very useful tool for me to get those dynamic results. It’s server-side (at least, the way I use it, it is, because I really try not to embed client-side resource usurping things), it is fast and efficient, and it is what I am comfortable with.

The thing is, web pages — generally speaking — aren’t all that simple if you really do them right. You can’t just throw a few tags together, test them on one browser, and hope you’re golden. Because you won’t be, I can pretty much promise you.
Read the rest of this entry »

Tags: , , , , , , , , ,

Email This Post Email This Post

Let’s talk about on-hold music

Bookmark and Share

If your company uses, or is considering using, on-hold music, please… just stop. Immediately. If for no other reason than that the digital compression now almost universally employed by the telecommunications companies dependably turns what was — or what may have been, it’s often debatable — actual music at the time when it was recorded into a phase-shifted, reduced information nightmare of excruciating abuse for the listener.

Which you are probably exacerbating by feeding into your phone system at too high a volume. But don’t reach for any knobs or sliders; you absolutely cannot fix this by changing the volume or the equalization. It is a fundamental and unavoidable problem inherent to the communications systems between your facilities and the customer.

Having on-hold music enabled makes music haters hate it more, and hate you for inflicting this horror upon them; and it makes music lovers hate you for being responsible for doing such miserable things to the music. The people who made the music are likely driven into deep depression if they happen to hear their work so abused.

To put it simply, on-hold music makes everyone hate you.

So please. Don’t enable on-hold music, or if already enabled, turn it off.

While I’m at it, try having an actual human being answer your phones. You’d be amazed what a positive first (and follow-on) impression that leaves. As opposed to:

 

Please listen carefully, as our menu options have changed.

Press one if you’d like to be driven insane by something that might have been on-hold music before it was turned into horrific, distorted mush on its way to your phone.

Press two if you’d like to listen to another menu full of options that have nothing to do with why you called.

Press three if you would like to be summarily disconnected while waiting for “the next available representative.”

Press four if you would like us to kill your cellphone battery with an indefinite hold, regularly punctuated by wholly false assurances that “we really care about you and will be with you soon.”

Press five if you’d like to be directed to our website. Please be aware that our website is only partly functional and was designed by poorly paid foreigners who have neither language skills or any understanding that websites should only take action, such as drop menus or pop up windows, when people actually click on buttons and links clearly intended to initiate such action.

Pulse seis si desea escuchar a estos menús en mal hablado español.

Press zero to hear these options again. Thank you for calling StupidCorp, and we look forward to taking your money and under-serving you in the future. Remember: StupidCorp. We were the ones that drove you to regular doses of Bupropion. Now you can up your dose!

…All with underlying noise that makes (what used to be) music seem as if it had been pushed through an outhouse. From deep below. Backwards.

Email This Post Email This Post

Amazon Echo really, really needs this feature

Bookmark and Share

What if it was easy to make Amazon’s Echo do anything your computer knows about, or you can make it know about? That’s what I’m going to talk about here.

It’ll be worth your time, I promise.

The Echo is a nice device to have around the house; you can ask it some things that Amazon has set up, you can even launch a few (very few) things via the IFTTT website. But there is a huge, untapped area there, those things that are unique to you and your family.

What if you could leverage the Echo to do… anything!?!?
Read the rest of this entry »

Email This Post Email This Post

aa_dbo.py — Simplified PostGreSQL use from Python

Bookmark and Share

Screen shot 2015-05-04 at 3.00.37 PMHere’s a Python import library that, working in conjunction with the PyGreSql project, makes using PostGreSQL from within Python super, super easy. Complete with examples. You need PostGreSQL installed and running (obviously, I hope), and you’ll need to install the PyGreSQL Python module as well.

Click here to download the import library.

Revision Changes
1.0.1 Initial Release
1.0.0 Internal Version

Tags: , , , , , , , ,

Email This Post Email This Post

Amateur Radio Callsign utility

Bookmark and Share

Screen shot 2015-05-02 at 11.36.46 AMWhen creating reports involving amateur radio callsigns, it is useful to be able to sort them according to region, prefix and postfix, as this is the way we are accustomed to thinking about them. In addition, padding them so that call regions align and other types of worthy formatting are applied is something I have found to be very handy.

For this purpose, I developed aa_calllib.py, a Python import library. You are welcome to use it.

Click here to download the zipped library.
Read the rest of this entry »

Tags: , , , , , , , , , , , , , , ,

Email This Post Email This Post