[!reality]

useless ramblings

stjerm 0.16.4 Released

leave a comment

I am pleased to announce the immediate release of stjerm version 0.16.4. This version is a maintenance release, which fixes a number of issues:

  • Fixes a compilation error related to Xinerama (#3)
  • Fixes several warnings thrown during compilation
  • Updates the versions required for glib, gtk+, and vte

The new release can be downloaded from GitHubhttps://github.com/mrkrstphr/stjerm/archive/v0.16.4.tar.gz

 

Written by Kristopher

May 19th, 2013 at 5:12 pm

Posted in Programming

Tagged with ,

stjerm Moves to GitHub

leave a comment

stjerm started out being hosted on gna.org, and I moved it over to Google Code Hosting shortly after taking over the project. That was quite awhile ago, and since then, git, and the git hosting platform GitHub, have become quite awesome. GitHub has an intuitive, beautiful user interface, with fantastic issue tracking, merge requests and overall repository browsing and viewing. Git itself has extremely fast and simple branching built it, as well as just about any other feature Subversion has, but done better.

Because of these reasons, I have moved the stjerm project from Google Code to GitHub. You can find it here: https://github.com/mrkrstphr/stjerm. Feel free to check it out, submit bugs/features or fork it and do a merge request of your own features!

Written by Kristopher

April 21st, 2013 at 12:14 pm

Posted in Programming

Tagged with , ,

Using Doctrine Paginator with Zend Framework 2 Paginator

one comment

So Doctrine has a Paginator that uses DQL and Zend Framework has a Paginator for paginating whatever the eff. So which do you use, what do you do? Answer: smash them together!

I created a super simple Adapter for Zend\Paginator that uses the Doctrine\ORM\Tools\Pagination\Paginator class:

namespace Application\Paginator;

use Zend\Paginator\Adapter\AdapterInterface;
use Doctrine\ORM\Tools\Pagination\Paginator;

/**
 * @category   Zend
 * @package    Paginator
 */
class DoctrinePaginatorAdapter implements AdapterInterface
{
    /**
     * Paginator
     *
     * @var Paginator
     */
    protected $paginator = null;

    /**
     * Item count
     *
     * @var integer
     */
    protected $count = null;

    /**
     * Constructor.
     *
     * @param Paginator $paginator
     */
    public function __construct(Paginator $paginator)
    {
        $this->paginator = $paginator;
        $this->count = count($paginator);
    }

    /**
     * Returns an array of items for a page.
     *
     * @param  integer $offset Page offset
     * @param  integer $itemCountPerPage Number of items per page
     * @return array
     */
    public function getItems($offset, $itemCountPerPage)
    {
        return $this->paginator->getIterator();
    }

    /**
     * Returns the total number of rows in the array.
     *
     * @return integer
     */
    public function count()
    {
        return $this->count;
    }
} 

Now I have a method in my Repository that gives me a Doctrine\ORM\Tools\Pagination\Paginator:

/**
 * @param int $offset
 * @param int $limit
 * @return Paginator
 */
public function getPaginator($offset = 0, $limit = 20)
{
    $dql = 'SELECT e FROM Application\\Domain\\Model\\Entity e ' .
        'ORDER BY e.column ASC';

    $query = $this->manager->createQuery($dql)
        ->setMaxResults($limit)
        ->setFirstResult($offset);

    $paginator = new Paginator($query);

    return $paginator;
}

Finally, in my controller, I call this method, pass it off to my DoctrinePaginatorAdapter, then hand that off to Zend\Paginator. Boom!

/**
 *
 */
public function indexAction()
{
    $page = $this->params('page');
    $max = 20;

    $results = $this->repository->getPaginator(($page - 1) * 20, $max);

    $adapter = new DoctrinePaginatorAdapter($results);
    $paginator = new Paginator($adapter);
    $paginator->setCurrentPageNumber($page);
    $paginator->setItemCountPerPage($max);

    return array(
        'paginator' => $paginator
    );
}

And just like that, I have pagination marrying Zend Framework and Doctrine’s pagination wizardry. So simple, even a caveman could do it!

Written by Kristopher

February 26th, 2013 at 10:29 pm

Why I Want to Strip DRM From eBooks

leave a comment

I have purchased several books from Amazon for reading on the Kindle app on my Android Tablet and Smartphone. I’m still old fashioned in that I enjoy holding a physical book in my hands while reading it, but my growing bookshelf clogged with books I’ll likely never read again have me rethinking it. So I’ve purchased a few books and graphic novels, and have read a few older public domain works. But I have a problem with the system.

  1. If I purchase something, I want the ability to do whatever I want without within my legal rights. If I buy a book from Kindle, I want to be able to open it up in Google Books and read it, or open it up in an open source reader, such as Calibre and read it on my computer. Because of DRM, I can’t. I’m forever tied to using Amazon’s services to read my book. And I’m forever supposed to hope that those services never go away and take my books with them.
  2. I want to make sure that Amazon doesn’t randomly decide to revoke my access to my book. I bought it, it’s mine, I want it forever, not until you decide I can’t have it anymore. This actually happened, and Amazon had somewhat justifiable reasons to do so, but the users ended up being the ones getting hurt by it. If it were DRM free and I could back it up and use it elsewhere, this wouldn’t happen.

The DRM is a problem. I understand piracy is also a problem, but we don’t ban steak knives just because they can also be used as murder weapons.

Today as I was searching for a means to strip my Kindle books of DRM, I found several resources with comments blasting the author with piracy claims. One comment even said:

I have no problem with stripping DRM for fair-use purposes. My point is no one is going to use this to take a Kindle book they bought and put it on a Nook, they’re going to use this to pirate Kindle content.

Bullshit. I want control over my content. Is it that hard to believe that I would someday buy a Nook to replace my Kindle and want to read my Kindle books on said Nook?

I have no interest in pirating it. I buy my music, my movies, my books and software. I am a working, responsible adult. And fuck you for claiming the only reason I would want control over my belongings is because I pirated them.

Written by Kristopher

September 21st, 2012 at 1:05 pm

Posted in Mobile,Technology

Tagged with , , ,

Chameleon Launcher: First Impressions

4 comments

Last night, I received my beta login for Chameleon App, which I purchased on KickStarter shortly after they launched. The basic premise of Chameleon is this: you have various homescreens covered in beautiful matching widgets. The homescreens are time and location aware, meaning that a different homescreen can be shown based on GPS, Wifi access point or time of day. This means you can have a screen for home, work, travel, morning, afternoon and/or evening. Whatever your heart desires.

As I had been anxiously awaiting the launch, I quickly downloaded it and gave it a go.

Activation

Since this app was “purchased” through the KickStarter campaign, the first thing the app does is reconcile your registered KickStarter email with your Google Play account email. This is somewhat annoying, but a necessary evil of launching via the Google Play Store, which is probably the best route to go for providing ease of download and updating.

The more annoying and worrisome part of the activation process is that it requests your Google password as some sort of double check process to try to ward off piracy. While Teknision promises they don’t store or use your password for anything other than verification, it’s still scary to give this information up, and may violate Google’s terms of service.

Responsiveness

Whenever clicking the home icon, Chameleon seems to take up to 10 seconds to load and show anything. After that, the widgets themselves start loading content. When selecting a widget and trying to resize it, it seems to take a few extra seconds to load as well. Aside from these instances, the app seems pretty responsive: going in and out of the app drawer, as well as paginating the app drawer, seems snappy, scrolling up and down on the widgets and selecting a homescreen all are very responsive.

After running it for around 12 hours, my battery doesn’t seem any worse off than it did on the stock home screen.

Widgets

This is the part of the launcher that is really going to make or break it: widgets. Right off the bat, admittedly, the app is very light on widgets. The launch included: Weather, News (which sadly doesn’t utilize your Google Reader account), Gmail, Twitter and Instagram. This is a pretty poor showing, but Teknision is already working on new widgets, and even had a few more in their mockups that didn’t make the first cut.

I’d personally like to see other, non-Gmail email supported, Facebook, RSS (Google Reader), LinkedIn, and Mint.com represented.

What is also frustrating is that the widgets don’t have any tie-in with the apps installed on the tablet. For instance, it would be nice if clicking on an email in the Gmail widget launched the Gmail app.

What would be especially nice would be a widget API that allows other developers to write widgets for their apps/services. I heard rumors that this is already in the works. It would be truly fantastic.

The Verdict

Chameleon launcher holds a lot of promise. It’s sweet looking and offers great functionality. I love the ability to sit at my desk and glance over and see a bunch of information really quickly sitting on my tablet. There’s a long way to go, though, and quite a bit more apps needed to really make this shine.

For now, I’m hooked, and can’t wait to see what else Teknision has up their sleeves.

Written by Kristopher

August 7th, 2012 at 9:26 am

Posted in Mobile

Tagged with , , ,

Managers are not Coaches

leave a comment

While at a training seminar this week, I overheard one of the participants, during a discussion, mention that he was a manager of software developers. He quickly corrected himself saying “I’m the coach.” Apparently he didn’t like to be referred to as management and the term “coach” seemed to tickle his fancy. This statement literally left me flabbergasted. To me, this translated as “I’m a micromanager.”

Software developers – and I’m sure many other professionals – don’t need coaches. This isn’t Little League. Software developers went to school and were trained in their art. They don’t to be coached to perform their daily duties. They already know what they’re doing, and if they don’t, you shouldn’t have hired them or have done a poor job getting them the proper training. They don’t need someone sitting over their shoulder telling them what play to do next or telling them how the system is going to react.

The Offensive Guard

What developers need from a manager is an offensive guard. Someone who is going to keep other people and other issues out of their way so that they can do their job and advance the ball down the field toward the end objective. They need someone who can take care of impediments for them so they don’t have to, regardless of what those are. They need someone to get all obstacles out of their way so that they can continue to do what they do best: sit down, write code and architect the system.

The team aren’t servants of the manager, the manager is a servant of the team. The butler of the team. Someone who performs actions and does the dirty work to keep the team focused on what they do best, and focused on getting their tasks done.

The Cheerleader

Developers, and I’m sure just about every other type of worker, needs in their manager a cheerleader. The best managers spend a lot of time cheerleading. Someone who cheers and congratulates them on their accomplishments and when they meet their goals, and someone who uplifts them when they don’t meet their goals (as long as it’s not in an annoying way). This cheerleading extends not only to giving high fives for accomplishments, but also selling the team to the rest of the organization. The managers job is to sell their team to the rest of the company by highlighting their successes.

After a failure, when things have hopefully turned around and corrected themselves, it’s the managers job to sell and cheer on to the rest of the company how well the team solved the problem and rebounded.

I’ve been coached before, I’ve been micromanaged before. I can tell you first hand that it sucks. My no longer being with that company is a testament to that. People need to be treated like they’re the experts. Not some football players who can’t figure out the play on their own. And they need to be rewarded and congratulated for their successes, beyond just earning a paycheck.

Written by Kristopher

July 20th, 2012 at 12:37 pm

Posted in Management

Tagged with , ,

Is Ubuntu Getting Lazy?

leave a comment

ubuntu

After spending a year and half in a hell called Mac Book, I’m finally back on Ubuntu, and couldn’t be happier about that fact. I installed Ubuntu 12.04. Since this version is a LTS, I figured it would be a pretty stable build, especially since Ubuntu seems to take their time slipping new versions of software into their repositories anyway. I thought this was because they wanted to make sure everything was thoroughly tested. But after running into a kludge of issues, I’m wondering if it’s just because their slow.

What I’ve run into so far:

  1. pidgin-sipe is busted. This is big for me, as I use my laptop in a corporate environment and have to be online so that I can interact and support my coworkers. This seems to be a regression issue caused with another library. Being a developer myself, I know what a pain in the ass it is to make code modifications in one place and have some other app blow up unexpectedly because of it. It’s just impossible to test everything.
  2. evolution-mapi apparently can no longer send email. This is another big deal for me as I have to be able to respond to emails. For now I’m stuck using Exchange’s web interface in Chrome, which is an utter piece of horseshit.
  3. Alt+Tab stopped working. Seriously. Alt+Tab. Htf does this happen and not get caught?

Yes. I know. I only listed three issues. But I’ve only been using Ubuntu 12.04 for a couple days. Who knows what else I’m going to find? The big kicker here is these bugs are 2-3 months old, and some of them are listed as importance low. Alt+Tab not working is importance low? Do you understand how utterly fucking difficult it can be to work without Alt+Tab after relying on it since you quit the pacifier?

This is exactly what people talk about when they bitch that Linux is too raw, too breakable and too error prone to gain widespread adoption. My mother doesn’t want to have to use hacks, scripts or recompile software just to get it to work. When has something as simple and core as Alt+Fucking+Tab stopped working on Windows? It probably hasn’t. Because the developers would have noticed instantly.

This is sad. And I hope it isn’t a sign of things to come with Ubuntu.

Written by Kristopher

July 7th, 2012 at 2:42 pm

Posted in Linux,Technology

Tagged with , ,

New stjerm Preferences Dialog

leave a comment

stjerm

In 2008, I took over development of a project called Stjerm from Markus Groß (who himself took over development from the original author, Stjepan Glavina) and, over the years, have slowly added in features, as well as moved the project over to Google Code Hosting from Gna. Then I switched over to using a Mac Book, which essentially halted development.

Now, however, I’ve switched back to Linux and am looking forward to continuing development of the project. My first big push for the project, aside from tackling some outstanding items in the bug reports, is to add in a preferences dialog that will aid in altering the options stored in the .Xdefaults file. It’s something I’ve wanted to do since I took over the project, and I’m finally going to give it a go.

Here’s a mockup of what I’m planning to wet your appetite:

Written by Kristopher

July 7th, 2012 at 12:09 pm

Posted in Linux,Programming

Tagged with , ,

Homebrew, The Missing Package Manager for OS X

leave a comment

homebrew

One of my biggest (of many) complaints about the Mac operating system is the lack of a package manager. Package managers are my favorite feature of most Linux operating systems. They make it easy to find, install, customize and keep up-to-date most software available for the architecture.

Sure, there’s the App Store now, but that’s a piece* and doesn’t have most of the apps I would want anyway. I’m mostly talking server/command line stuff: Apache, PHP, MySQL, PostgreSQL, wget, etc. There are a multitude of options for third party package managers for OS X, some of them more glamorous and some of them more tedious, but I haven’t really enjoyed using many of them. None of them seemed as nice, powerful or reliable as package managers on various Linux flavors.

Then I found Homebrew. And there was much rejoicing.

Homebrew is a package manager for Mac. It is essentially a system for pulling down source code, configuring and making it, much the same way Gentoo’s Portage works. It’s not much different from pulling down source and compiling it yourself, except it does it for you, and if you’re like me, it’s smarter and probably does it better than I would myself. And it also provides a mechanism for letting me know when there’s new updates and allowing me to upgrade those packages. It’s perfect.

It does depend on having Xcode installed. If you’re on OS X Lion, it’s available in the App Store.

The first thing you should do is run:

brew doctor

Follow all the advice given here and fix all the issues. Trust me. Two days of headaches and agony may follow if you don’t. Then, to install a package, such as PostgreSQL:

brew install postgresql

Boom. Done. Follow the notes given on the screen (if you miss them, type brew info postgresql to recall them) and you’re good to go. Want to see if any packages have updates?

brew update

To update any package listed in the available updates:

brew upgrade [package-name]

It’s that simple. And I like simple.

* Seriously, am I the only one that has issues deleting some applications? Or issues trying to download some, or perhaps apps that somehow get marked as hidden without you doing the hiding? Or just blank buttons next to apps that fail to download? Wtf Apple?

 

Written by Kristopher

June 21st, 2012 at 12:11 pm

Posted in Mac

Tagged with , , , ,

Do We Need National or Global Radio Technology Standardization?

2 comments

cells

In the United States, we’re dominated by several wireless radio technologies that cellular devices operate on: CDMA, GSM, HSPA, LTE, WiMAX (and possibly more). What’s the problem with this?

  • It puts a burden on manufacturers to create multiple radios to communicate on the various technologies and integrate them into their devices, rather than just developing one device that can be sold by all carriers.
  • It makes it difficult for people who develop mobile operating systems, like Google’s Android, to have to support multiple different models and radio technologies. Just look at Android’s latest releases. 4.0.4 was just made available, but only for GSM devices. 4.0.5 is rumored to hit soon for the CDMA/LTE version running on Verizon.
  • It prevents a mobile user from taking their device from one carrier to another. A CDMA device from Verizon will not work on AT&T’s GSM network. Granted, there are frequency issues as well, but that’s another topic.
  • For the most part, the rest of the world uses GSM. But Verizon and Sprint use CDMA, making it difficult, if not impossible, to use your device while traveling internationally. There are global devices, but they are few.

I figured that if we were to standardize on a wireless radio technology, it would solve a lot of these problems. So I posed the question to Martin Cooper, the man who invented the cell phone. He raised a red flag about this saying that it would bring competition to a halt because manufacturers wouldn’t have any reason to innovate or compete, because they’re simply meeting a standard.

But I disagree. Standardizing on a wireless radio technology doesn’t prevent manufacturers and carriers from innovating with device specs (speed, storage, screen size, etc) or features (3G->4G, quad-core for gaming, etc). In fact, I think it frees up room for innovation by giving the manufacturers one less thing to worry about and allowing them to pump out a phone that can be sold across all carriers (saving them money having to tweak the device to work for a different carrier).

Plus, it puts more incentive on the carriers to provide better, more affordable service, because it makes it that much easier for me to take my device and cheaply switch carriers if my contract allows me.

Thoughts?

Written by Kristopher

March 30th, 2012 at 10:07 am

Posted in Mobile

Tagged with , , , , ,