Posted by A.R. Van Halleorg on 2010/04/02
After a day or so, I finally managed to get some basic Login/Logout functionality working on my Django project. What a pain in the butt, when you have no idea what you’re doing to begin with and you’re trying to do something without having to go back and do it later!
Several pages and much headaches later, I stumbled on one that made it pretty clear to me.
Since I am a fan of trying to lessen the trauma of people everywhere with similar issues as me, I will tell you that if you’re trying to make an authentication (basic one), go to this page. It’s part of the documentation on Django Project.
One mistake I made while trying to make the login() function work after my authentication was some KeyError…I think. No biggie. Just change the name of the view calling it. I had a wonderful stroke of mental prowess and thought…”Hey, why don’t I make this view login(), instead of something like login_page().” Well, I never claimed to be a rocket scientist. So just take my word for it if you’re a newbie and just make it something other than login().
If you guys want to see the result of the code itself, I s’pose I could paste it on here, but really the linked page in the above text was what I used. I haven’t deviated from it yet. Just visit the page and read it and hopefully it’ll help you if you’re having trouble with it.
Sadly, I’m not a python/django expert yet, so I can’t really help too much.
“The page I’m going on about.”
Have an awesome Easter weekend!
Posted by A.R. Van Halleorg on 2010/03/31
The following is just a small blurb from the post I wrote earlier today for a blog we’ve started at work among in the web team. You can go ahead and read more about it here.
“This is a snippet of code that I was working on this morning with the input of a coworker for the concept. Basically we needed to have a way to include a navbar at the top of every site, which includes javascript functionality, but also doesn’t conflict with already present jQuery libraries.”
Small note: In IE, you need the jQuery.noConflict() line to be separate from the rest of your snippet code if you want it to work. IE seems to have an issue with the XML connotation of CDATA Comments. It sucks. I swear I’mma just boycott them until they conform. Okay, I won’t, but it’s nice to dream. I don’t know why IE does this to be honest, it just does.
<script src=”js/jquery-1.4.2.js” type=”text/javascript” language=”javascript”></script>
<script>var $newJS = jQuery.noConflict();</script>
<script>alert(‘do a bunch of stuff here’);</script>
Posted by A.R. Van Halleorg on 2010/03/18
For the past 6 months at least, I’ve had varied versions of ‘JavaScript embedded into Colorbox’ as a search term that has led to my website and after numerous occasions of useless dead ends on my site, I thought that I’d go ahead and write a post about a very basic way to get this done.
The easiest way to call a Colorbox is with the following code:
$(“idColorboxLink”).colorbox({href:”/link/”, open:true});
Visit the demo page for Colorbox to see other ways to open it.
There are exactly 5 ways that you can place your JavaScript so that your colorbox content will be affected by it.
onOpen (Before Colorbox opens)
onLoad (While Colorbox is opening)
onComplete (Content is displayed in the Colorbox)
onCleanup (While Colorbox is closing)
onClosed (Colorbox is closed)
Then you just enter them into the code as follows:
$(“idColorboxLink”).colorbox({href:”/link/”, onOpen:function(){}, onLoad:function(){}, onComplete:function(){}, onCleanup:function(){}, onClosed:function(){}, open:true});
If you had a function like…fillField, you could just call it like this:
$(“idColorboxLink”).colorbox({href:”/link/”, onComplete:function(){fillField()}, open:true});
This probably could have been much more elaborate, but I’m more a use it to learn it kind of person and I thought that this might at least provide an idea of what to do if nothing else for those who are searching for this.
Have a great day.
Posted by A.R. Van Halleorg on 2009/12/30
Since its launch on Oct. 21, there have been nearly 80,000 downloads internationally and just over 56,000 in Canada from people seeking out the NFB’s documentaries and animation.
Read more from the article
Download the NFB iPhone App (English Version)
Download the NFB iPhone App (French Version)
Posted by A.R. Van Halleorg on 2009/12/23
NFB Video Plugin
Just made a small change to the NFB Video Plugin for WordPress, the width/height weren’t setting correctly when you updated from an older version that used different variables.
Now the default is set to 516-337, and it should also set it to that height if your fields are empty for width/height. It’s just to avoid the player being a tiny little mush ball of uselessness cause the width wasn’t defined.
There was mention that the plugin makes it impossible to add/crop images in the uploading process, I’m not sure how that’s happening just yet, if anyone is having this issue can you tell me where in the process you see the fail? I’ll continue investigating in the meantime.
Posted by A.R. Van Halleorg on 2009/12/11
So in the last couple of weeks we’ve been implementing agile practices at work (We’d done a bit, but only recently the boss decided we should all be doing it) and I really enjoy it. I’m one of those people who are actually between two teams. There’s the one team that uses the Scrum and one that uses the Kanban.
I’ll have to go into what the differences are in another post, mainly because it’ll take a long post to explain all that relatively sanely. I’m just too tired to do it right now.
So anyways, I went out and bought a bunch of post-its, got out my white board and set up my Kanban for my big project at home. Since I’m a 1 person team, my board is simple.
- Backlog (as much as my board can hold of these)
- Todo (max 4)
- Integration (max 2)
- Programming (max 3)
- Validation (max 2)
- Done
I have a list of things that I should be getting done in each category in order for it to get moved to the next column and I can’t pull any forward until things get done. One thing our instructor told us to do also was to put ‘blocked’ and ‘ready’ notes on things so we know what’s coming up in the backlog so when a spot frees up in the todo list we can go ahead and put it in and also if we’re blocked on something and it depends on something else.
It’s pretty cool, but like I said it’ll take another post to talk about it, this is just a random personal brain fart to say I’m doing it, cause it’s fun.
Have a great day!
Posted by A.R. Van Halleorg on 2009/12/11
There’s a good chance that you’ve probably seen this before and weren’t able to come up with a solution and ripped your hair out trying to get it and maybe that’s what you were about to do before you stumbled on this. I was shown this by a coworker this morning and I decided to add it to my ever growing list of reasons why IE6/IE7 reminds me of a mother-in-law with it’s horrific ability to nag for details. (Not my case, my mother-in-law doesn’t care about anything)
So! Actually there are 2 things I’ve seen that work :
1. Remove the margin-top from the element (especially things like headers and put padding or line-height instead)
2. (from coworker) set your element to have vertical-align:top and suddenly it disappears!
Hope that helped someone. If not, well I guess I’ll keep looking.
Posted by A.R. Van Halleorg on 2009/12/08
Firstly, I’d like to apologize to booking for this taking so long. The update is coming up, I had a few days of issues with regular expressions and things didn’t go so well, but now it’s on track.
The main reason for the push on this update prior to my other changes is that some people have been having difficulty with the simple_html_dom.php file and I apologize for that. I was unable to get a hold of the person who made it, so I had to restructure my plugin for independence. Thank you to Booking for helping me with validating that the snippet worked.
Left to do : Add CSS to the admin / Almost done
Newly added : You can include the description of any National Film Board of Canada film that you link to via the oembed. If YouTube and Vimeo throw descriptions into their oembed xml files, then all will go well with their videos too. The element is video_description if they’re curious of if you know someone there and want to harass them to put it.
Newly updated : The layout is a little different on the front end now. There’s the title (an h3), followed by the embed code (which is set to the width/height of your choice), followed by the caption (Author/Provider) and then in a blockquote, there is a description. They all have their own individual CSS though, which is why my first point is not complete yet. Last minute change.
New admin : The administration panel is completely revamped. It has the colours of the NFB website and now shows you the last three films that were added to the NFB website, if you change the admin language, it will show you the last three French films as well. The oe links are provided underneath those videos if you’d like to add it to a post.
Future changes that will come up in the next update :
1. A button in the post page that will let you preview the embed before you insert it in the post.
2. Each film will have its own individual width/height set aside from the default if you wish to make an exception.
3. Embeds will be capable of being saved in the database so you aren’t having to make calls all the time for the information. (optional; sorry I couldn’t fit it in this patch)
4. Visibility of all posts that contain oembeds so you can keep track of which films you’ve already added (optional)
5. Separate CSS layout for all embeds.
6. Ability to replace an oe link with the actual embed. (Once this is done however, it’s irreversible. This is for the more determined folk.)
There will be more to come, but those are some of the changes in the upcoming fixes. Look for the update on at http://wordpress.org/extend/plugins/nfb-video-plugin/ within the next 48 hours.
Posted by A.R. Van Halleorg on 2009/11/19
Isn’t this an annoying bug? Just when you think your troubles are over and you’ve got the file all figured out, it goes and denies you the video portion of your video.
This really isn’t Viper’s fault, but one parameter in particular seems to have a problem with a lot of MOV files.
So go into the plugin’s file and find the following bit of code:
myQTObject.addParam(“scale”, “aspect”);
Then comment it out :
/*myQTObject.addParam(“scale”, “aspect”);*/
Save and then refresh your blog page and see if it shows your video now.
If so, YAY.
If not, I’m sorry, it’s all I found.
Hope it helps!
Posted by A.R. Van Halleorg on 2009/11/10
Over the last week I’ve been reading Practices of an Agile Developer. It’s a book with Pragmatic Programmer that discusses what Agile is, bad habits that developers tend to have in regards to production, development and their view on customers/users, and the best practices in trying to set aside these old habits in order to become a more productive developer for yourself and your team.
One of the major things they emphasize on in this book is feedback. Have a constant flow of feedback and get everything achieved in iterations (small periods of development to get things done) and making sure that you don’t end the day with things left to do. And sometimes that means splitting a list of tasks in order to get some things done and others done later.
After having read it, I have already started to break down my tasks. Let’s say for instance…You have a newsletter and you need to get it sent out. In this case I have a newsletter that gets sent out once a month and there’s quite a flow problem in getting it out there. I get a document with the information, I put it in an html file, I have it reviewed 7 times for 2 typos, and then I proceed to put it online and get it revised yet again. As you can tell it causes quite a bit of overhead.
So what am I doing this week? Making it a bit more Agile.
Step 1 : Receive document, put information in html and send for revision.
Step 2 : Edit
Step 3 : Once everything is done and given the go ahead, I put it on the CMS for the online version
Step 4 : Let them know it’s out of my hands now.
It doesn’t sound like it’s reduced THAT much in the process. But the organized structure allows me to work on my other tasks while I wait instead of having to put it in the CMS waiting for more of the changes. Waiting is a huge problem with development.
Anyways, if you’re interested, you can get Practices of an Agile Developer:
Hope you enjoy it!