Monday, November 05, 2012

On Private Software

This was originally posted on my new website, where you can read the full post. Please subscribe to the new feed there to follow new things I write.

Private software is software one writes only for themselves and never shares or intends to share. It isn't commercial, because it isn't sold or even distributed at all. It isn't open source, but it shares something in spirit. I write about this in favor, though like all things, on a case by caes basis.

I'm coming to really enjoy the idea of private software. Private software made by a person to solve a personal need and none other. It is, at its surface, very contrary to what you might expect Open Source to be about, but in a way I believe it to be a great shining example of the ideals open source comes from.

read more at www.ironfroggy.com/on-private-software

Sunday, November 04, 2012

Jules 0.2 Released

This originally posted to my new site and has been reposted for anyone following my old feeds. Please subscribe to my new website.

I've released version 0.2 of Jules today, which is actually the first packaged version released. There are no users other than me, so no care was taken in backwards compatibility and this is less announcing a new verison and more an announcement of the project as a whole.

Jules is a static blog generator named after a victorian-ish era literary or intellectual character, because that's a trendy thing to do. (Jekyl, Hyde, Nikola, etc.)

The design is flexible and plugin-oriented. Much of the built-in functionality is available through a set of plugins, which creates an architecture very prone to adaptation and customization. One of the major goals (though not yet reached) is template impartiality.

Today, Jules is a very capable little static website generator you may find useful for your personal, project, or organization site.

You can install Jules easily with
 
pip install jules

Which will install the latest version from PyPI.

Why I Won'T Be Doing Nanowrimo Anymore

This was originally posted at my new website. Please read it there, and follow my new feed to follow what I write about in the future!

I looked forward to it, I planned on it, and I was prepared for it. My outlines were ready, my story was waiting. So, why am I not doing NaNoWriMo this year?

Please subscribe to my new feed when you visit the new site!

Sunday, October 28, 2012

PyCarolinas 2012 Recap

I ran a conference.

I said it had to be done, apparently I said I'd even be the one to do it. Before I knew it, I was doing it and now its over.


All the way up to the date of our inaugural year I was feeling unprepared, afraid I was forgetting terribly important things, or simply that the event would be uneventful. I could not have been more unprepared for the sheer success of PyCarolinas, from the presentations everyone was able to enjoy to the success of the food and drinks we provided to keep them all going to the amazing sense of community and connectedness everyone at the conference obviously felt.

How Did I Get Myself Into This

This was not only the first conference I ran, but the first involvement in running an event beyond a dozen-person hacknight for TriZPUG, so "out of my comfort zone" accurately describes how I felt during the months leading up to October 20th and 21st.
I had mentioned a few times, in a few places, that the carolinas (and the south east in general) need a Python conference. What I meant was "Hey, someone else should run a Python conference, so I can attend."
But, no one did.
The catalyst was Chris Calloway finding the great space we used, and pushing to reserve it for the event. Once he had those wheels moving, it was up to me to make something happen at the time and place we now found ourselves with.

Pulling it Off

I did the best I could with no idea what I was doing.
We did a lot of things right on our first year, which is great.
  • There was coffee to spare. It was good coffee
  • There were pastries and muffins all day long
  • The schedule and talk selection was well varied and interesting
  • Food trucks were picked to keep lunch costs down (catering is expensive)
  • We had amazing shirts designed by Julia Elman of Caktus Group, one of our sponsors
The call for proposals was out pretty early, which I think was good. Lots of our speakers were able to practice their talks to polish, and this really showed.
I could not have done this alone, and I need to thank everyone who made PyCarolinas 2012 possible.
Chris Calloway was invaluable.
He kicked off everything with a space to actually have this event. Chris spent countless hours negotiating with the UNC departments responsible for our needs between the space of the conference and the parking lot we reserved for our lunch trucks. Chris has long been the heart of our local user group, TriZPUG, and he carried that enthusiasm and commitment to his help in making PyCarolinas a reality.
Thank you, Chris.
Kurt Grandis was tireless.
The great lunches we had from the Only Burger truck were possible because of all the leg work Kurt did hunting down great options. The crowd was really happy about the food truck, and everyone should thank Kurt for the great good.
Thank you, Kurt.
Rebecca Lovewell was generous.
She organized our well received coffee reserves, which never ran out, and helped underwriting our never ending pastries. Every conference I've been to seems plagued with ran-out-of-coffee syndrome, so we should all thank her for helping us all stay awake through the exhausting weekend.
Thank you, Rebecca.
Andrew Thompson was a life saver.
I made the grave mistake of failing to organize volunteers well, or at all, during the actual conference. I also underestimated the quick pace and difficulty of keeping up with registration in the first morning! But, Andrew stepped in (we had never met before) and helped run the registration table, doing a much better job of it than I was. Without his spontaneous volunteering, I would have been unable to leave registration and take care of everything else that needed attending that morning.
Thank you, Andrew.
Of course, our sponsors made everything possible.
Thank you, Caktus Group.
Thank you, Google.
Thank you, 10 Gen.
Thank you, Marakana.
Thank you, Cox Media.
Thank you, Wingware.
Thank you, Kitware.
Thank you, Meta Metrics.
Thank you, RochApps.
Thank you, Heroku.
Thank you, Red Hat.
And, a special thanks to Joe Copp and Andrew Kuchling, who both made personal donations in support of our fledgeling event.
And, without our amazing speakers to fill our schedule and share their knowledge and experiences with us, there would be no conference to attend in the first place.
Thank you, to our keynote speakers Lynn Root and Gary Bishop.
Thank you to all of all session speakers Randall Hunt, Joseph S. Tate, A.M Kuchling, Chris Church, Paul J Kowalczyk, PhD, Rick Copeland, Mark Lavin, Michael Manfre, David Ray, Vinod Kurup, Wayne Witzel III, William Sams, Al Snow, Barry Peddycord III, Kenneth Reitz, Matthew Frazier, Julia Elman, Fred Alger, Jeff Heard, Brian Painter, Tim Hopper, Simeon Franklin, Francois Dion, Flaviu Simihaian, Chris Calloway, Michael DeHaan, Dr. Brian J. Soher, Philip Semanchuk, and Brad Crittenden.
But, what would a conference be without an audience?
I want to give a very sincere thank you to everyone who attended this first year. You all came to an event that had never happened before, so you had no idea what to expect. This faith in our new occurance is not missed, and I hope we have lived up to whatever it was you hoped to get out of the weekend. I hope that PyCarolinas was good enough use of your time that I will not only see each and every face again next year, but that you'll all spend the year pumping up your local user groups and Python community and bring more people along next year.

Next Year

There will be a next year. It will be smoother.
While the first PyCarolinas was amazing, it is important to remember what could be done better. I've kept a "to done" list. A list of things I should have done, or done different.
  • Seek out volunteers for the registration desk ahead of time
  • Seek out session chair volunteers
  • Seek out volunteers to clean-up afterwards
  • Print out better programs with sponsor logos. They deserved more thanks.
  • Prepare the badges and sign-in sheet better. I forgot to alphabetize.
  • The badges should show last names better
  • and, they should have shown the conference name and logo!
and, finally
Even though I talked to the people responsible for the space we used about scheduling the cameras to record I should have confirmed this within the week before the conference, in case there was a mixup. Which, I am very sorry to report, there was. We do not have the recordings of all our wonderful talks, as had been expected. I am terribly sorry for this.
Not the least of reasons being that I didn't actually see any talks in full the entire weekend, personally.
If anyone has any other suggestions, please let me know what could have been better!
Thank you to everyone who attended. Thank you again to all our sponsors and speakers. I hope to see everyone there again next year!

-- Calvin Spealman

Thursday, September 27, 2012

PyCarolinas 2012 Registration is Open!


Cross-posted from the PyCarolinas blog

Have you been looking forward to grabbing your spot for PyCarolinas 2012?
That time is today, as we’re ready to accept registrations for the inaugural event on October 20th and 21st. Spots our limited, due to our generously donated space, to 150 attendees including staff, speakers, and sponsor slots.
Don’t hesitate to registration, you might loose your spot. We expect nothing short of a great turn out, our schedule is fantastic, our keynotes are prime, and our sponsors are nothing short of enormously generous.
Come out and enjoy the wonderful fall weather in Chapel Hill, NC and what is sure to be the first year of a great tradition!

Sunday, September 23, 2012

I Am Worried About The Future Of Python

This piece was posted to my new website.

Python is Great

I've been in love with the language for a decade.

I feel a connection to the community that has only grown over time, both in numbers and in awesomeness. However, I see difficult times ahead. Not where Python is or where it is going, but places it will always have trouble entering growing in importance. I think we have, as a community, really downplayed the significance of some of our beloved languages shortcomings.
I'm concerned about growing areas in software, which are hostile to Python. This is a coincidental, but important direction a lot of focus in software is moving in.

Read the full post at my new site and please subscribe to the new feed there.

Friday, August 31, 2012

Read Counter, an Idea

Originally posted to my new website, where all of this content will eventually go.

Just a thought. We have so many tools for, essentially, ranking content.

We vote on Reddit, like on facebook, plus one on Google. We pretend this stuff is (relatively) new, but aren't they all just non-passive hit counters? Maybe a return to the beginnings would be nice. But, simply loading a page isn't enough.

My proposal: the Read Counter.

At the end of a page, the Read Counter would trigger simply by scrolling into view. It would be a rough measurement of traffic, and as a simple bonus would avoid counting people who opened the page but don't seem to have actually read the content.

Simple, but useful. Passive, but meaningful.

Friday, August 24, 2012

PyCon 2013 Posts I want to see

PyCon 2013 will be my third PyCon, and I'm walking into it with a better idea what I'm hoping for than my first two. Here is my shortlist for talk hopes.

  • Python inside Government
    Are any federal, state, or local governments using Python internally? In any important or large ways? Maybe at the national archives or the library of congress? I want to know about these things! Does the IRS crunch my taxes with Python?

  • Python and Big Data
    Working with large datasets fascinates me, probably because I don't get the opportunity to do so. I'd love to see where Python is being used to crunch big datasets. I wonder if gets used in any pipelines in processing results from CERN? Or maybe diagnosing medical tests?
  • Python close to the wire, embedded or working with wire protocols
    Using Python in mobile devices, embedded devices, or implementing binary protocols on the wire that need to work fast and with low latency? These are things people often don't think Python does well, so prove them wrong.
  • Python in movies
    Pixar, Disney, I know you guys are out there! Is python used in stages of the pipeline to make all those 3D movies I take my kids to see?
  • Community-centric talks, please!
    These are personally interesting to me, because I want to build community. I want to learn from more people who are great at it.
If you can give any of these talks, or any talk at all, submit your proposal for PyCon 2013!

Saturday, June 30, 2012

Julython is on!

I'm participating in Julython, are you?


Julython is a great initiative to promote Python developers focusing on their own projects through the month of July and contributing to the community providing great software, great libraries, and great tools. Sign up, track your commits on GitHub and BitBucket, and tell your dev friends to take part.


Julython is going to be a lot of fun!


Saturday, June 09, 2012

How To use Sphinx Autodoc on ReadTheDocs with a Django application

Sphinx is awesome for writing documentation. ReadTheDocs is awesome for hosting it. Autodocs are great for covering your entire API easily. Django is a great framework that makes my job easier.


Between these four things is an interaction that only brought me pain, however. I'm here to help the next dev avoid this.


Autodocs works by importing your modules and walking over the classes and functions to build documentation out of the existing docstrings. It can be used to generate complete API docs quickly and keep them in sync with the libraries existing docstrings, so you won't get conflicts between your docs and your code. Fantastic.

This creates a problem when used with Django applications, where many things cannot be imported unless a valid settings module can be found. This can prevent a hurdle in some situations, and requires a little boilerplate to get working properly with Sphinx. It require a little extra to get working on ReadTheDocs. What makes this particularly hard to figure out, is the environment running on their servers is not the same as your own, and you have only terse error reports to guess about.

Here is the snippet you need to add into the conf.py of your docs/ to tell Sphinx how to load a settings.py.

import sys, os

sys.path.append(os.path.dirname(__file__))
import django 

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
if django.VERSION < (1, 4):
    from django.core.management import setup_environ

    settings = __import__(os.environ["DJANGO_SETTINGS_MODULE"])
    setup_environ(settings)


and a simple settings.py is all you need sitting beside that.

# Django settings for docs project.
# import source code dir
import os
import sys
sys.path.insert(0, os.getcwd())
sys.path.insert(0, os.path.join(os.getcwd(), os.pardir))

SITE_ID = 303
DEBUG = True
TEMPLATE_DEBUG = DEBUG

DATABASES = {"default": {

    "NAME": ":memory:",
    "ENGINE": "django.db.backends.sqlite3",
    "USER": '',
    "PASSWORD": '',
    "PORT": '',

}}

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'YOUR_APP_HERE', # This is where you put your app
)



And you should be good to go!

Wednesday, June 06, 2012

Announcement: Tracerlib 0.1 Released

Tracerlib is a set of utilities to make tracing Python code easier.

It provides TracerManager, which can allow multiple trace functions to coexist. It can easily be enabled and disabled, either manually or as a context manager in a with statement.

Tracer classes make handling the different trace events much easier.
 
class TraceExceptions(Tracer):
    def trace_exception(self, func_name, exctype, value, tb):
        print "Saw an exception: %r" % (value,) 
 
Tracer is also easily capable of filtering which events it listens to. It accepts both an  
events parameter, a list of trace events it will respond to, and a watch parameter, a list of paths it will respond to in the form of package.module.class.function.
This can easily wrap a trace function, or you can subclass Tracer and implement one of its helpful trace_*() methods.

And, a helper class FrameInspector which wraps a frame and makes it trivial to inspect the function name and arguments the function had been called with.
 
inspector = FrameInspector(sys._getframe())

print "Called", inspector.func_name
print "args:", inspector.args
print "kwargs:", inspector.kwargs 
 
You can read the full documentation at the read the docs site and see the code at github.
 

Saturday, May 19, 2012

I Read Things On The Internet

It is true, from time to time I read things on the internet. What has been bothering me lately is the feeling that all of these ideas I'm consuming and all of my responses to them are just lost into a sea churning together everything into the unidentifiable paste that comes out of my head.


So, I've decided to start logging this. After all, the word "blog" is a shortening of "weblog", a web log, a log of the things you've read on the web. I want this for my own daily readings, both to keep a record for myself (and anyone with an interest) and to note my thoughts, comments, responses, and questions about the things I come across.


Ironfroggy Reads Things On The Internet is this new thing. It is a blog on Tumblr, which I find a useful tool for smaller posts and their bookmarklet is perfect for my needs here. I'll be directing the posts to twitter to, as an experiment. Let me know if that turns out annoying.


Follow it, if you care to. Mostly its for me, but I believe in transparency by default.

Thursday, May 17, 2012

ANN: straight.command 0.1a1 - A command framework with a plugin architecture

New Project Announcement:

I'd like to announce a new project, based on straight.plugin, a command framework that provides a declarative way to define command-line options, sub-commands, and allows plugins from third-parties to expand commands.


This is all very early, I'm calling this version 0.1a1 and lots of things are missing, but here is an example (which works) of a small todo application built with this.


#!/usr/bin/env python

from __future__ import print_function
import sys
from straight.command import Command, Option, SubCommand

class List(Command):
    def run_default(self, **extra):
        for line in open(self.parent.args['filename']):
            print(line.strip('\n'))

class Add(Command):
    new_todo = Option(dest='new_todo', action='append')

    def run_default(self, new_todo, **extra):
        with open(self.parent.args['filename'], 'a') as f:
            for one_todo in new_todo:
                print(one_todo.strip('\n'), file=f)

class Todo(Command):
    filename = Option(dest='filename', action='store')

    list = SubCommand('list', List)
    add = SubCommand('add', Add)

if __name__ == '__main__':
    Todo().run(sys.argv[1:])

And a sample of the result of this little script:

$ ./todo.py todo.txt add "Write an example tool"
$ ./todo.py todo.txt add "Get the documentation cleaned up and on readthedocs"
$ ./todo.py todo.txt add "Blog about the project"
$ ./todo.py todo.txt list
Write an example tool
Get the documentation cleaned up and on readthedocs
Blog about the project

The documentation and source are both available now.

Tuesday, February 14, 2012

ANN: Django Better Cache 0.5.3

I've added a small, but useful, addition to Django Better Cache, today. The new bettercache.decorators.CachedFormMethod utility is a decorator for Django form methods, which is essentially a memoizer, but with a nice twist.

This is great for forms that include DB or search index reading methods which can be expensive and you'd like to cache, but normal memoization fails when the important parameters to key on are in the form data, not the arguments to the actual method.

Read about the new decorator at the docs to learn more.

class FriendsLookup(forms.Form):

    username = forms.CharField(required=True)

    @CachedFormMethod(expires=60*15) # expire in 15 minutes
    def get_friends_list(self, include_pending=False):
        username = self.cleaned_data['username']
        friends = Friendship.objects.filter(
            from_user__username=username)
        if include_pending:
            friends = friends.filter(status__in=(PENDING, APPROVED))
        else:
            friends = friends.filter(status=APPROVED)

        return friends 

Tuesday, January 31, 2012

ANN: Django Better Cache 0.5.1 with expanded docs


I've made a small incremental release on Django Better Cache, adding a from_miss() method to handle cache misses in CacheModel objects. Now, you can define your cache model and how it initializes data when the cache is empty, and perform all your lookups through the CacheModel, expecting misses to auto-populate for you.

You can see a quick example of the new functionality below, but I have also made large improvements to the documentation hosted over at ReadTheDocs, so go read the full docs right now, if you are interested.

from bettercache.objects import CacheModel
from django.contrib import auth

class User(CacheModel):
    username = Key()
    email = Field()
    full_name = Field()

    def from_miss(self, username):
        user = auth.models.User.objects.get(username=username)
        self.email = user.email
        self.full_name = user.get_full_name()


If this get() does not find the object in the cache, it will create a new
User instance and call from_miss() with the key parameter username to
initialize it, and then save and return that object for you. The next call,
it will find it in the cache.

user = User.get(username="bob")

Sunday, January 29, 2012

ANN: straight.plugin 1.3 released - with docs!


I think it is worth a new release to announce that I have documented straight.plugin and published the docs to ReadTheDocs. I hope this will help anyone who has had trouble parsing my terse README file, and will improve adoption of the project in the future.

Check out the new code and the new docs.

Thursday, January 26, 2012

A little trick for wide pages

We have wide monitors and our reading doesn't tend to like wide text very well. This is why newspapers have lots of narrow columns, rather than stretch each story across the entire width of the paper.


Not all websites follow this tip, so drag this to your bookmark toolbar and squeeze the margin in 100px at a time, until you can read more naturally.




Yes, I could resize my window, but the same width isn't right for all pages, and most are padded or have sidebars. This is good when you only need some of the pages you have open to be narrower than the rest.

Sunday, January 22, 2012

ANN: Django Better Cache 0.5 Released

I am announcing the release of Django Better Cache 0.5 today. This release includes a move to sphinx as a documentation tool and a new component, the bettercache.objects module, which provides a lite ORM-like interface for caching data.

Please read the full, but short documentation over at Read The Docs for details on the bettercache {% cache %} tag and the bettercache.objects ORM, and have a much easier time with your caching needs.


Here is just a quick example of the new cache models, from the docs:


class User(CacheModel):
    username = Key()
    email = Field()
    full_name = Field()

user = User(
    username = 'bob',
    email = 'bob@hotmail.com',
    full_name = 'Bob T Fredrick',
)
user.save()

...

user = User.get(username='bob')
user.email == 'bob@hotmail.com'
user.full_name == 'Bob T Fredrick'
 

Tuesday, January 17, 2012

Leaving Google AppEngine

Calvin Spealman
I can use AWS and work on technological engineering issues, or appengine and work on price-ological engineering issues. :-/


Maybe I should take myself seriously when I said this. In the past few months, I've barely done any feature or bug work on JournaApp, because it takes my limited time and energy just keeping myself under quota when I'm the only user of the app. I can't keep that up and keep my sanity, and it is honestly an emotionally draining exercise. This is creating a toxin that affects everything I do, so I'm going to take it out of my life.

I don't know if I'll port JournalApp or not. I like it, it has been fun and useful, but I'll probably take project notes in Evernote from here on forward, and on paper again. I miss paper.
I write here about programming, how to program better, things I think are neat and are related to programming. I might write other things at my personal website.

I am happily employed by the excellent Caktus Group, located in beautiful and friendly Carrboro, NC, where I work with Python, Django, and Javascript.

Blog Archive