More PHP ORM disappointment
2012-01-31 12:39 pm ∴ PHP,Rant ∴ Tags: , , ∴ by matt -

OK, so I know I’ve been beaten this horse to a pulp. But today it reared its ugly head again.

The ORM in this case is phpActiveRecord. I had used this in other projects and had a generally positive experience, so I thought it would be a decent fit for this quick little user registration database I had to set up.

Of course, I had neglected to check whether or not phpActiveRecord worked with PostgreSQL. Silly me, when I looked at this page and saw ‘pgsql’ in a DSN, and when I read that PDO is used for the backend — which provides a decent API for the library to use — I assumed that I would be safe.

In short terms, no. In longer terms, fuck no.

There’s an error, apparently in all versions that I could find, in the pgsql adapter. I guess there were some attempts to fix it, but it remains uncommitted to the main branch, despite being a year old.

So good-bye to phpActiveRecord. It was fun, that one time when I used you and you worked correctly. You can now join the wall of shame with lack of PostgresQL support along with WordPress and Drupal. (Yes, I know Drupal core has at least partial support, but modules may not necessarily support pgsql — which could have been avoided with a decent ORM).

The saga continues… sigh…

Another disappointing Python web framework
2012-01-16 5:53 pm ∴ Python,Rant,Web Apps ∴ Tags: , , , ∴ by matt -

I’ve always liked CherryPy. I thought its routing method was a very novel take on the application routing problem. But I never used it too much because it was too loosely coupled for my purposes at the time.

Fast forward to a few weeks ago when I hear about circuits.web, part of the circuits framework. Event driven, modeled after CherryPy, asynchronous, web-socket support, and loosely coupled — which I need this time.

I’ve spent the better part of three weeks working with circuits.web, and I can say it’s been a resounding disappointment.

First of all, documentation is non-existent. And when I say non-existent, I mean non-existent. The core circuits framework is poorly documented at best. The circuits.web component isn’t documented at all. The closest thing to documentation is a collection of asinine examples that have almost no merit for real life applications, if they even work at all.

Second, I can’t exactly tell if the project is still being worked on. When I first started, I naively looked at the dates on the recent commits to the whole circuits project. The circuits.web portion hasn’t been committed to since August. WebSockets were made a candidate recommendation in December. Nothing in circuit.web’s implementation needs to be changed? That makes me suspicious.

Lastly, the Component architecture seemed like a good idea, but it seems to be thrown together in no logical way. Case in point?

Components handle events. Controllers inherit from Components. Controllers can’t handle events. Or if they can, I couldn’t figure out a way. Who knows why — there’s no documentation.

I was trying to create an Authentication component for an admin controller. There are of course, no examples of this. The authentication examples — that is the ACL, HTTP Auth, and HTTP Auth using /etc/passwd — all use an authentication scheme that is site wide.

What I needed was a way to pick specific actions that would require authorization. I figured out a way by accident, and within 3 seconds found a way around it due to the “channel” member of the Controller.

The channel in circuits.web, I assume, specifies the routing for the dispatcher to find the object. So your Admin Controller object might have a channel of “/admin”. The problem I found, using a Component for forcing authentication, I could bypass the Auth Component by going to, “http://localhost/admin/“. Note the trailing slash.

Change the channel to “/admin/” or “admin” and get a 404 on all admin actions — but the auth component works.

And that’s where I’m at. I should have went with CherryPy on this project, but no, I guess I felt like being disappointed by Python web frameworks again.

Am I nuts?
2009-10-26 4:21 pm ∴ Programming,Rant,Thoughts ∴ Tags: , , ∴ by matt -

I’m starting to think I’m a masochist. Examine the evidence:

  • I’ve been in 2 serious relationships with crazy (and I do mean crazy) girls — both ended crappily.
  • I still hand wind my guitar strings.
  • I’ve worked with PHP since version 3 and I’ve had a job doing it for 5 years. I actually gave up a job doing embedded systems with C to keep doing PHP work.
  • I keep thinking I want to learn Erlang.
  • Lastly, and I think this is the big one, despite the fact that I’ve worked on no less than 3 failed IRC clients — I started working on an IRC bot project.

(more…)

Kind of annoyed with WordPress
2009-09-10 7:50 pm ∴ News,Rant ∴ by matt -

So, Automatic upgrade for WP has been broken for some time. Now there’s a stupid coding error that’s responsible for a worm attack. This is what I get for following the trend and not researching some software that I start using.

A possible switch to a different blog software may be in the works if they don’t get their act together.

So this happened
2009-07-02 10:44 am ∴ Programming,Rant ∴ by matt -

I was, at one point, a big fan of the Visual Studio Environment. Yesterday, my appreciation of it was crushed — perhaps permanently.

See, every once in a while, I’ll get the urge to program something. Yesterday, I went to start up a new WPF project in C# Express. I wanted to code myself a little forecast/weather grabber from the NOAA NDFD Forecast Soap Service which I had experimented with before. So I added the service to the project and had Visual C# generate the code, as has been the way for a long time.

Lo’ and behold: it didn’t work.

Turns out that the service didn’t specify an encoding or didn’t encode properly. C#  wants everything to be UTF-8 or UTF-16, and dies thusly. It wasn’t dying or throwing a warning about the encoding while generating the code, or even instantiating the service, but only when data was recieved after the method call. Turns out, the way to handle encodings other than UTF-* is so unbelivably complicated that I don’t care to do it, especially when specifying the encoding could easily be an option when generating the code.

So while I’m debugging this project and trying to get it to work, a “Help Update” dialog pops up and prevents me from doing anything. I try to stop the debugger at least, so this update can complete and VS tells me that it’s waiting for the update to complete. Ok… so I wait. And wait…wait and wait and wait… nothing. According to Task Manager, this update is burning up 100% of my cpu, so I get mad and terminate the process. It takes me two or three times of terminating the process before I can actually get it to die and get control of VS back. As I stop the debugger and prepare to close the IDE, the update dialog comes back, continues to burn up my cpu and my patience.

“Something must be messed up,” I think. So I repair the MSDN install. It comes back. I repair C# Express. It comes back. I uninstall MSDN, effectively removing what needed the update (or so I thought), and it COMES BACK! I uninstall C# Express and the problem goes away :)

So I’m done with Visual C# Express for a while and my high opinion of the MS development tools is shattered. It’s a shame too — I had high hopes for XNA.

Oh yeah, my computer at home is kind of shot and I can’t afford to get a new one. So this site will probably go unmaintained for a bit.

Completely unfair, totally biased review of PHP ORM libraries
2009-05-07 4:37 pm ∴ Rant,Thoughts ∴ Tags: , , , ∴ by matt -

This has been on my mind for a long, long time. Having been spoiled with SQLAlchemy and Elixir, I am tortured with sub-par ORM libraries while at work. Granted I did get to use SA for an internal project, but the majority of the things I do involves PHP.

I’ve been stuck with it for years. It is the language of choice for people who run servers and hate web developers. So yeah, 5 years of PHP and MySQL …and using so many different libs for database abstraction has given me some room to shoot my mouth off.

Anyway, this is going to be a long post and not for the faint of heart.  I’m going to start off at the beginning…

(more…)

How to break Firefox
2009-01-26 11:07 am ∴ Rant ∴ by matt -

I don’t know how long this has been around (I think only since 3.x), but if you’re using Firebug…

  1. Open a site with javascript that you’re presumably trying to debug or are otherwise involved in some time sensitive development.
  2. Set a breakpoint in a script.
  3. Get the breakpoint to be reached, thus halting execution of the script.
  4. Find exactly what you’re looking for.
  5. Fix it in the code file you’re working on
  6. Refresh the page.
  7. Notice that none of the Javascript seems to be working — if the page even displays
  8. Remove the breakpoint and try again
  9. Copy the URL because you know you’re going to have to restart the browser
  10. Get a message about Firefox already running
  11. Open up your process manager and see Firefox using up 100% cpu and an enormous amount of memory
  12. End the process
  13. Start Firefox again
  14. Find out that your URL wasn’t copied
  15. ARGGHH

Note that this can be avoided by resuming the javascript engine before step 6 — but I never remember to do that.