General


Aargh! I don’t seem to be able to get past the wp-login.php page. It keeps redirecting to there.

I am logged in, and using the correct password, but I can’t get through to the admin pages.

I can post entries via ecto, too!

Update: _ck_ has a fix: http://ckon.wordpress.com/2008/07/15/fix-for-wordpress-26-cant-login/

View Comments (0)   RSS Feed for Comments on this Post

This is a post taken out of context I made to a discussion group in my AI subject. (Which another Matt and I have decided they falsely advertised, and should have called “Expert Systems”). It’s a bit vague in a couple of places, and I will probably come back to this topic at some stage and write a clearer explanation of what I mean. But this is here for now.

I did some thinking about the thought experiment where a guy sits in a room translating English into Chinese, and how “He will probably learn some characters over time.”, and how this is not the same as a machine.



I think it is the same. If a machine is able to recognise a word/character, that is still the same as the man learning it, rather than just memorising it. (I’d actually counter that memorising meanings and symbols is still a type of learning, and I come from an educational background, so I do know a little about learning).



But I want to push even further. A human isn’t the same as a translating program because it can learn new information that wasn’t there when the program was written. If a program is able to incorporate new facts, develop new pathways, and perhaps even rewrite it’s own program, then this is a much closer analogy to what we define is learning.



There are system out there that allow for dynamic reprogramming (I think some derivatives of Smalltalk are pretty good at this), and many systems that allow for dynamic alteration of code (perhaps by an outside source). Even the OLPC project is based on a system which can be changed while it is running.



Our brains are a machine that can alter it’s physical structure in response to the environment - indeed that is how we learn - and the pathways that are used often eventually end up working better than those that are used infrequently. A program could work the same way. Evolutionary programming is another example - an algorithm can be seeded, and then a variety of mutations are generated, and an “overseer” selects the mutations which result in a better algorithm.



I can’t provide any hard quotes, but I know this has been used to some extent to develop novel programs.

I know this is verging on Strong AI, which Darius says is a no-no, but consider this post as having taken place in a pub or cafe. In fact, I’m off to the pub now.

View Comments (2)   RSS Feed for Comments on this Post

It’s still relatively unusual for me to have to work on a system that I don’t have superuser status on - at home I am the administrator of all of the machines, and at work I have sudo privs on both the development and production servers.

At Uni, however, I have to play by some other dude’s rules.

And, that means sometimes not having software installed that I need.

Take mercurial, for instance. I use this as my exclusive RCS, because it is simple to set up a repo, easy to clone, plays nice with OS X, and with Trac. It’s extensible, and easy to merge changes from clones.

But it isn’t installed as standard, or even at all on the Solaris machines at Uni. SVN is, but I’m not about to go through the whole rigamarole of setting up an svn server again. It just doesn’t do anything for me that mercurial doesn’t but it’s more setup work.

And I create new repos all of the time. I have one for each of my topics, and every time I start a new project, I create a new repository. It’s just that simple: hg init.

So, I tried installing it as a general user. I have it so that it works to some extent: I have the ability to change my environment variables, so I can add ~/bin to my path, stick all of the hg files in there, and then the mercurial/ directory into ~/.python, which I then make my PYTHONPATH.

Then, I can happily use hg while ssh’d in (or logged in to one of the SparcStation machines).

But, I can’t use the remote access.

See, ssh <machine> hg <command> will not work unless a) hg is in the system path, and b) mercurial is in the system python directory. You can fudge the first part (by explicitly telling the local hg where to look for the remote hg) but then I can’t figure out how to tell it where to load the python classes from.

So, my solution is this: mount the folder using sshd (or in my case, ExpanDrive). Then clone the repository from the local machine. You can then happily work away on either machine, but to push/pull you need to have the folder mounted.

Bit of a bummer. I’ve asked for mercurial to be installed, but we’ll see if that happens or not…

View Comments (2)   RSS Feed for Comments on this Post

I have a custom class, called MultiMatrix, which is basically an NSMatrix that has header rows and columns. Selecting a header row or column will select the whole row/column, and selecting the top-left cell will select the whole table. These header cells will also automatically select themselves if their whole row/column/table is selected.

Because I dynamically update the size of the matrix according to some data elsewhere in my program, I needed to embed it into an NSScrollView, so that when the size exceeds the normal size, then users can scroll to select cells.

I did this, and I was having huge slowdowns. I could select cells alright, but selecting a header cell meant about a one second delay.

Solution: turn off the NSScrollView’s copiesOnScroll.

Even though I wasn’t scrolling, for some reason this was causing big performance issues.

I suspect it’s making my custom matrix class do something lots of times, or perhaps it’s related to the controller and the bindings I have set up. Regardless, unchecking the Copies On Scroll box in IB fixed it.

View Comments (0)   RSS Feed for Comments on this Post

Using Core Data is awesome.

moGenerator makes it even better, as you can have Entitites defined as being of a particular class, and this code generator creates two classes for each Entity - a machine-readable one which is updatable by running the script again, and a human readable one that you can safely edit - it won’t be changed once it has been created.

You can easily make this tool a part of you build process.

First, create a new directory inside your project folder, I called mine MO. Then, cd to that directory, and run:

$ mogenerator -m ../*_DataModel.xcdatamodel

Then add the folder MO to your project.

Now add a new build phase script, and put into it:

cd MO
mogenerator -m ../*_DataModel.xcdatamodel

It’s not quite perfect - if you add a class, it won’t be added to your project automatically. You might be able to get around this by including the -includem switch, but then you won’t be able to have the .m files located in your project, else you will get duplicate symbol errors.

View Comments (0)   RSS Feed for Comments on this Post

Ugh. Ecto just stole my post. Oh well, time to start again.

I pride myself on being almost 100% Microsoft free. I don’t use Windows on a day-to-day basis. I have to test a Windows program against a server I write, but that is it. I used to have to use Windows to run AutoDesk Inventor and a custom MS Access Database, but that was in my prior life as a teacher.

Lately, I’ve been using Pages for all of my Word Processing needs, and I think it works better than MS Word. It is snappier, performs more reliably (doesn’t make stuff jump around randomly), and has all of the features I need and use.

I’ve also been using Numbers as a Spreadsheet. It, unfortunately, doesn’t hold up to the competition, Excel, nearly as well. Firstly, it doesn’t have Pivot Tables, which are a great invention that I just could not live without if I was doing any sort of collation of data. Like the custom Excel Spreadsheet I built for my partner’s expenses and tax purposes. However, she is likely to shift over to MYOB anyway.

My problems with Numbers are mainly to do with Charting. I had to collate data that had run times of various algorithms, as they were implemented using different techniques across different programming languages and paradigms. Most of the data was easy to compare, but as I went to present all of the tests I found an issue.

There is no way to do an X-Y, or Scatter Plot in Numbers.

Your data will be okay if you have the same values for all of your X values for every column, but, if you have the situation I came across where I had some data sets that were increasing by an order of magnitude, and some data sets that were doubling (and, one data set that was incrementing).

Thus, I wasn’t able to obtain the following plot, and had to use Excel.

200806111038.jpg

Pleased to say I used Apple Remote Desktop and a machine that already had it on it, rather than install in on my laptop!

Oh, and before anyone says anything, I tried Tables (which I bought a license to before Apple brought out Numbers), and OpenOffice.

Now, don’t get me started on OpenOffice. I think I’d rather use Microsoft Office. I mean, all they have done is clone it, and haven’t really gotten everything to work. At least there is a Cocoa/Aqua version, but it is clunkier and slower than Excel.

I might actually try Excel 2008 and see how that goes if I need to do some more number crunching.

View Comments (4)   RSS Feed for Comments on this Post

One of the best things about having a laptop as my primary machine is that I generally don’t have to worry about synchronising issues any longer. For instance, I used to have a USB Drive that was my “transfer device”, and I was endlessly copying data to and from it. This meant I had three or more copies of my data, but I sometimes wasn’t sure which was the most recent.

I bought Changes.app to use with my Source Control system(s), as it is nicer than FileMerge.app. And it meant I could support an independent MacOS X Developer. And I’ve been using it, sometimes “in anger” where some data has been corrupted.

Today, I wasn’t able to get onto the Wireless network properly, and had my data on my Laptop, but needed to run some SQL queries on a database on a Uni machine. I copied the files across (in a location where the WiFi worked), and then ran the queries on the Uni Machine, but made some changes to both sets of files at the same time.

When I sat down to merge them all, I happened to think to use Changes. I dragged both folders onto Changes, and it gave me a list of files that differed.

I was able to choose which parts of each I wanted to keep, and save them, and it made both files the same as the merged version.

I wasn’t really expecting this - I naïvely thought that it was a read-only process, but Changes made it pleasant.

View Comments (0)   RSS Feed for Comments on this Post

I ♥ SQL Alchemy.

I’m currently rewriting a database so that the schema definition is in SQL Alchemy, allowing for us to deploy it across a range of platforms with a bit more ease.

We had been using some sequence types to automatically set the primary key to a new unique integer. Think Autoincrement in Access, if that’s where you’ve done some database stuff, or in MySQL I believe it’s AUTO_INCREMENT.

In SQL Alchemy, you get to define Tables in python, like this:


log_table = Table(‘log’, metadata,
Column(‘IP’, String(15), primary_key=True),
Column(‘timestamp’, DateTime, primary_key=True),
Column(‘reqSize’, Integer),
Column(‘resSize’, Integer),
Column(‘time’, Float),
Column(‘reqName’, String(256)),
Column(‘reqData’, String(4096)),
Column(‘resData’, String(4096)),
Column(‘reqObj’, String(4096)),
Column(‘resObj’, String(4096)))

Now, if you need a sequence type, then you can use a Sequence() object. But what if you have existing data, which may or may not have holes, and you need to ensure you don’t have any collisions?

db.query(Person).order_by('id').all()[-1].id + 1

This will query and get the Person object with the highest id, and add one to it.

You can then use this as an argument to the Sequence() object, and it will only generate the sequence from that value onwards.

View Comments (0)   RSS Feed for Comments on this Post

I rarely have to use a VPN, usually ssh does the trick for what I need. However, for one subject I need to access a server from within a variety of applications, and that server is not exposed outside of the campus network, even though it has a global DNS entry.

I can use Tunnelblick to VPN into the system, and then access the server as if I were on campus. The downside of this is that with the default settings, it routes all traffic through the VPN, which then would either slow everything down, or in this case, prevents anything from getting to the outside internets.

This is not really acceptable: if I am working on a problem and I need to access something I don’t have locally, like some documentation, then I have to disconnect the VPN, look up the data and then reconnect the VPN.

There is a line near the bottom of the .ovpn file that sets up the default gateway:

# Make the VPN the default route.
redirect-gateway def1

It’s somewhat tricky to understand how to fix this - I had to restart a couple of times because I had screwed up the routing table.

You need to replace that line with one like the following:

route <address-inside-network> <netmask> <gateway>

In my case, to access barker.infoeng.flinders.edu.au, I needed to have:

route 129.96.22.79 255.255.255.255 129.96.59.73

Restarting the VPN connection then means I can access barker.infoeng.flinders.edu.au, and the wider internets.

I’ve also written a script that gets a new authentication keyfile, since the one that is provided doesn’t work very well. I’ve even made it so that it will automatically grab a new keyfile when the old one is out of date.

View Comments (2)   RSS Feed for Comments on this Post

I use iCal for all of my time management needs, and I mostly like it. It allows me to keep my timetable well organised, and with some of the new features, it makes it quick and easy for me to find information as well.

In a recent incarnation, iCal obtained the capability of storing attachments as well as URLs. In the past, I just used to drag a document from the Finder to the URL area, and it creates an ugly-looking but still functional link to the document. Thus, for a Tutorial, I can have the answers in a PDF document, and easily get access to it directly from iCal.

Attachments are better, as you can have more than one of them. But there is a problem. Whilst you can have a document as an attachment, if you have a document bundle, it doesn’t work. You can create the attachment, but you cannot open it.

It took me some time to figure this out.

So, you can have many single-file documents as attachments, but only one bundle, as a URL.

The other issue with attachments is that they are copies. If you have an attachment, and you edit it, it doesn’t edit the original file you dragged there, only the one that is stored with that calendar entry. Thus, URLs are actually more useful, as this creates a link to the original document.

If only you could have multiple URLs stored in one calendar entry or to do item.

View Comment (1)   RSS Feed for Comments on this Post

Next Page »