The harsh truth

I’m a nerd. Everyone who visits here should know that. As such, I tinker with everything I have and usually find its limits sooner or later. This is how I have come to appreciate the .Net framework from Microsoft. Honestly, such unity is awesome. It seems rather large and truly limited for the time being, but Vista should make that non-existant.

But… some older boys have been talking to me (my coworkers) and explaining different problems. It goes along with computer problems… and they all get blamed on Microsoft Windows. Granted, a lot of the problems that plague Windows is the users. This is very true. The problem is that Windows has become too open for users, in my opinion. Honestly, why have we allowed people to get so far from standards? For more creativity!

But, no. That isn’t right. It’s like the web standards project. I am a huge advocate of standards (i’m sorry i’m an ass, everyone, but it’s worth it in the end). As such, I have come to see that the only advantages of allowing for non-compliant creations merely makes people able to make things faster and without as much knowldege. But is that better?

Read more

Too many projects, too little time

Well… berrydev is not progressing the way I wanted it to… RIM is taking their sweet time to get back to me, so I’m waiting. In the mean time, i realize that i didn’t release my cookie handler script (recently updated) to my site. It probably is one of my more useful code bits as it can help you to have secured persistant logins to your site or just storing a username (like hotmail does). That means I gotta upload and write about it… later.

I also noticed that wordpress doesn’t have a search. This can be a problem for developer blogs (ie. mine) especially after it becomes long and filled with various scripts. Hell, i should keep each script on its own page all linked off of downloads… but i don’t want to keep all the zips and such so I think i’ll just post code and talk about it until someone encourages me to do otherwise.

On a final note, I am a music lover. I always have been. it makes it somewhat logical for me to use audioscrobbler then to keep track of what I listen to. it lets artists see how many people are listening as well as what else. I like it because i can get ideas for new bands by people with similar interests. Just for fun, here is one of the status pictures that they have premade. This one is my weekly top artists (i now remember that i fell asleep with godsmack on):

quad341's Last.fm Weekly Artists Chart

Wiki install woes

Well, i mentioned in my last post that i installed media wiki for berrydev.net but failed to mention the struggle to get there.

I went to install 1.5.5 (latest stable) figuring it would be ok.  I swear they didn’t test the install. Note: this was a completely blank domain.  no conflicts were possible.

Step one: add maintainance into the installer’s include path. in /config/index.php, edit line 118 and add $sep$IP/maintenance into the include path (new line: ini_set( "include_path", ".$sep$IP$sep$IP/includes$sep$IP/languages$sep$IP/maintenance" );)

Step two: edit the dbsource function. they seem to assume aliasing or something.  either way, we need slashes and better references to files.  insert after line 94 (so this becomes the first few lines in the function):
if(!preg_match('%^/.%',$fname)){
  $fname = dirname( __FILE__ )."/".$fname;
 }

(probably optional) Step three: insert the contents of InitialiseMessages.inc into updaters.inc. Just copy/paste the first into the end of the second.  for some reason, my server would not include the file right so i was getting “funciton not found” fatal errors. it fixed it so… eh.

in case anyone else is having problems installing it, that was what I ended up doing and all worked.

Updates

Ok, well… I updated WordPress to version 2.  It’s got a nice backend, though as a user, you might not siee a difference.  One nice advangate is that I can upload files for my posts a lot easier… but I don’t remember where they end up… I’ll find out later.

 

Anyway, my latest endevor was to set up berrydev.net as a site for BlackBerry Developers.  I find the wiki system to be a good way to set up information, so I’m going to use that for the moment.  It really needs some more configuration for uploads as well as a lot more content (and maybe a logo, but d-ba or russ is making that).  Head over there and contribute?

 Now for what entertained me earlier today.  So i got an email for a topic that I submitted an answer for on Expert’s Exchange and it just happens to be abandoned (it happens a lot).  Well, they use intellitext for their ads and it just happens to have made a weird association.  Why php makes we want Microsoft online training is beyond me (especially considering their entire site is run by java server pages).  See:

Catching up and I’m a moron

A while ago I promised 2 little scripts. Well, one of them is the source of the index file i use for the cardamar mirror (Source Code). Since I wanted a bit of writing to go with it, i’ll just put it in here:

the script is reletively simple. the top is just the top part of the html and as such can be set up as you desire. inside the php, we first define an array of files we do not want to list. every directory has ‘.’ and ‘..’ meaning current folder and up one level respectively and probably should be ignored. .htaccess is the standard Apache directory settings file and also should be ignored. you also should make sure that you don’t include the file itself and any other files you don’t want to list in the array (in this case, i also exclude source.php). it then opens the current directory (’./’) and starts looping through all of the files. if it finds it in that array or the file ends with .md5 or .diz, it does not display the file (continue forces the loop into another iteration). if it does find the file, it calculates the filesize in megs (rounded to the nearest tenth). $md5_s is the string that contains all of the md5 information if available. it trys to find the md5 of the file in a file with the exact same name as the file with .md5 at the end. the file contains only the md5 hash. if found, it makes a nicer looking bit of html which will be included. if no md5 can be found, $md5_s is still blank when it is included. the description of the file is found in a file of the same name as the original file with .diz at the end. It then echos all the information in html with heredoc syntax.

Updates: You could easily integrate as much as you wanted of this into a database. I chose not to since there aren’t many files that I am going to need to handle and physical files allows for people to make direct requests to the files without doing any tricks (like setting up a .htaccess file that passes the file name as the parameter and could then query the database for it. somewhat of a demo later). You could still keep the files physical and the md5 and/or descriptions in a database as well, but that would be best suited for large amounts of files (of which you also might want to put pages in as well).

Remember that source.php file that I excluded and that demo i mentioned? well, you can take a look at the source of source.php at http://cardamar.quad341.com/source.phps. funny, that looks like a script that is displaying the source of files, but the files with the parameter of ‘f’ in the get parameters (also note that i deny access to any file that begins with a . since they are supposed to be either hidden or are in another directory except for .htaccess so i can use this to display it). Well, we haven’t been going to http://cardamar.quad341.com/source.php?f=index.php or http://cardamar.quad341.com/source.php?f=source.php to view the source of the files but it does seem that this is what is parsing the files… so what gives? This is where .htaccess redirects comes into play (and why i allow people to see my .htaccess). If we go over to http://cardamar.quad341.com/source.php?f=.htaccess and take a look, you can see a simple example of using mod_rewrite to make the redirection of what seems to be a physical file to actually feed into another file. You can see that it enables the RewriteEngine and then searches for a REQUEST_URI (that’s the part after the domain) that begins with / and ends with .phps and selects everything in between. If it finds this, it feeds it to source.php?f= with after that filled in with the file name with .php on the end. Fun, eh?

Well, that’s one (well…three, but i’m still giving out one more). This other one is just a function. I set it up because someone needed to be able to sort some dates that were formed a specific way. I’m not sure how many people really need to sort dates after they have been put into visual form, but the function will. It searches for the month location and the year location (year is optional though) and then sorts it in order. You can also look at this for an example of using array_multisort. You can see the source of the function here and the output here.

Now for why I’m a moron:
I was waiting for a special person to get online, so i decided i’d message the aol server until they came on. This actually took a while and i had a lot of anger to take out on aol. suddenly the server stops sending me errors. ok, so i guess they signed in. i have since found out that the server just blocked me. it no longer took my messages. this caused some misunderstandings later… but needless to say, i just hate aol more now.