Tegud.NET
Gallery Image
Loading...

    blog

    Monday, 14 June 2010

    A discussion today led to me sending out an email to all the developers at work today, which given the amount of campaigning for jQuery I've done at the company, I had hoped would'nt have been necessary.  But it was.

    Basically a co-worker had asked me for some assistance with some HTML/CSS.  Unfortunately this led to me looking at his code and discovering an abundance of javascript events specified directly within the HTML.

    <div id="MyElement" onclick="javascript: myFunction();">Click Me!</div>

    As I mention, we've adopted jQuery quite widely throughout our products, so I pointed out that it would be much easier for everyone to follow, and easier to take advantage of jQuery's special events and event delegation functions if the events were bound in the $(document).ready() function for that page.  What's more, we know the separating style and markup is important, keeping javascript and the markup separate is also important.  By keeping them apart it makes it easier to split the javascript off into a separate file (much easier to minify AND it's cached!).

    So as I say this is just a quick blog post in case anyone else is unsure about where the best place to specify javascript events are.  In my opinion, not the HTML!

    0
    Posted At: 18:42, by: Steve Elliott in Programming
    , from
    Withington

    Comments

    Loading Comments...
    Add New Comment
    Enter your name and email below, dont worry I wont post your email address for bots to find, its just to link in the Gravatar.

    Friday, 04 June 2010

    As part of what I aim to be a regular series I'm covering great jQuery articles and plugins I've seen over the previous week.  I aim to post this "around" Friday every week, this week may be a little light as I've only been keeping track of articles I've seen for the last few days. 

    As I say, next weeks should have a little more to it. I aim to be a lot more active on this site this year and going forwards, next stage is to implement the article system to display more in-depth articles.  In the mean time I shall endeavour to keep blogging.

    0
    Posted At: 19:56, by: Steve Elliott in Programming
    , from
    Withington

    Comments

    Loading Comments...
    Add New Comment
    Enter your name and email below, dont worry I wont post your email address for bots to find, its just to link in the Gravatar.

    Thursday, 03 June 2010

    This would be my first blog post in over a year, but I've been busy working on the new version of this site. Generally I'm much happier with this design than the previous, but it's extremely likely you never saw the previous design, so that's fine anyway.

    I hope to blog much more frequently now, probably covering all sorts of things. In addition once I have the article system online I'll be posting more in-depth programming articles and tutorials. Before that all starts though, as part of my job I made a blog post of how to pass Table Variable Value Parameters to C#, It's a great technique we've started using that's loads faster than XML, and much safer in my opinion.  It can be found at the company website, Passing Table Value parameters to Stored Procedures from C#.

    0
    Posted At: 08:08, by: Steve Elliott in Site
    , from
    Oldham

    Comments

    Loading Comments...
    Add New Comment
    Enter your name and email below, dont worry I wont post your email address for bots to find, its just to link in the Gravatar.

    Wednesday, 20 May 2009

    Downloaded the beta of Visual Studio 2010 today.  I was expecting WPF to have worked its way in deeper than it has done, currently its only in the editor, but the changes are very nice.  Oddly enough I espcially like the text selection effect, as well as the scaling and general look and feel.  In addition the changes of Intellisense now filtering is very nice.

    Havent had much chance to try out the .NET 4.0 additions, I am quite looking forward to playing around with the new dynamic types.  One change that caught my eye on the Web Forms was the ClientID addition, with the added ability to control the client id of server controls directly it'll bypass the need to "tell" javascript what server control IDs are.

    Will post again once I've had some more time with the new changes.

    0
    Posted At: 21:49, by: Steve Elliott in Programming
    , from
    Manchester

    Comments

    Loading Comments...
    Add New Comment
    Enter your name and email below, dont worry I wont post your email address for bots to find, its just to link in the Gravatar.

    Friday, 03 April 2009

    Well, did it again, still working on the RSS Feed widget thing which you can now see on the right.  Its still very early on, but it does do things!  Basically my long term aim for it to tell you if theres new RSS items and also allow it to be configurable per user, with a set of default ones for users who arent logged in. I dont plan for it to update automatically, but it does have a refresh button.

    As I say, its REALLY early on, much like the majority of this site its a little rough at the moment, but its been a good test bed for some more JQuery fun.  As you may have noticed from the menu system across the site I'm kinda liking the slidey menu thing at the moment and thats been once more used in the RSS Feed display.  Basically if you click on the title of the RSS Feed (with the zoom icon) it'll bring up a full list from the RSS feed, the top one item from the feed is displayed immediatly below.  Its all done via JQuery AJAX, however instead of pulling the feed direct off the sites, I used an ASP.NET page local to this server to go get them, then the JQuery to process that, means I wont have any Javascript permissions issues...

    0
    Posted At: 00:56, by: Steve Elliott in Programming
    , from
    Manchester

    Comments

    Loading Comments...
    Add New Comment
    Enter your name and email below, dont worry I wont post your email address for bots to find, its just to link in the Gravatar.

    Wednesday, 01 April 2009

    Opps, it would appear to be 1am, and on a school night no less. I may have got slightly carried away with the JQuery RSS feed reader I'm writing for the front page. I'm taking a break from the photo gallery to work on something else. I reached the stage where I have to write the interface for loading photos into the database, which is less than fun, but needs doing. I need to work out how to import photos from a folder into the DB with minimal effort.  I am thinking of also including some kind of location based system accross the site soonish as well.

    The site is now technically live, but really all that means is that it can be accessed from the web, I'll be surprised if it gets any hits currently.  I plan on going through and working out the SEO in a week or so, once I've completed the Gallery and the RSS thing. If you do stumble upon here feel free to say hi.

    0
    Posted At: 01:00, by: Steve Elliott in Programming
    , from
    Manchester

    Comments

    Loading Comments...
    Add New Comment
    Enter your name and email below, dont worry I wont post your email address for bots to find, its just to link in the Gravatar.

    Wednesday, 25 March 2009

    Been playing around with JQuery alot lately, really enjoying it. It takes away alot of the pain of doing things in javascript. I was talking to some guys at work today about what it can do, them being difficult were mainly pointing out you could do it all in javascript anyway, which is true, but its hardly going to do something you cant do in javascript.  But what it does do is enable you to do it much easier.  Animations for example, you could use timeouts to move things gradually, or you can use $("#someId").animate();, which is obviously way easier.  And with more people using JQuery instead of writing their own stuff, code becomes more readable and maintainable.

    Alot of this website has been an experiment for me in using JQuery, so somethings could be done better, but its all part of the learning process for me.  The only real area I havent explored properly is the AJAX functions, but apart from that I've been using the other parts quite alot.  The photo gallery has some of the more advanced JQuery on the website, it handles basically all of it.  I combined that with a ASP.net image resizer and the gallery slide view was basically done. Next thing I plan on doing is the list view, which will show one gallery at a time and allow the user to scroll through it.  It will most likely also use lots of JQuery.

    0
    Posted At: 07:37, by: Steve Elliott in Programming
    , from
    Manchester

    Comments

    Loading Comments...
    Add New Comment
    Enter your name and email below, dont worry I wont post your email address for bots to find, its just to link in the Gravatar.

    Sunday, 22 March 2009

    Watched the final episode of Battlestar Galactica.  I think it may have been better if the show had ended before they'd got the go ahead for the prequel, as I think things that were hinted at in the final episode, such as Kara Thrace suddenly disapearing (hinting at that she was never really properly alive again) may have been explained more explicitly.  The ending seem logical though for the most part and everything got wrapped up nicely.  The first 2/3rds of the episode which had the bulk of the action were the best in my opinion, I loved the part where Baltar and Six come into the CIC and Adamas kicking one of the Cylons to the ground.

    I think they could have done better by keeping the relevent religions seperate, mono/poly-theist insteading of tying them both together towards the end (Baltar's speech), also Kara's random co-ordinate jump seemed a tad convinient, if she was assigning numbers to notes previously, surely the fact they made up a 3 point co-ordinate would have occured to her before.

    But overall I really enjoyed the episode, just sad that such a great series has ended, but then if they dont end they tend to stop being so great pretty quick (Prison Break for example).  I'm quite looking forward to the iminent release of the Caprica Pilot as well as getting my hands on the entire battlestar series on DVD.

    UPDATE: It would appear there will be a 2h Battlestar Special called "The Plan" from the perspective of the cylons.  Which should be good, I did like characters like Cavil, and alot of the humanoid models didnt get alot of screen time. 

    0
    Posted At: 09:47, by: Steve Elliott in TV
    , from
    Manchester

    Comments

    Loading Comments...
    Add New Comment
    Enter your name and email below, dont worry I wont post your email address for bots to find, its just to link in the Gravatar.

    Saturday, 07 March 2009

    This is a problem I encountered whilst working on a configuration XSD at work, I wanted to have a node that had content, with an enforced type along with attributes.  An example of the XML I wanted to allow is below.

    <Quotes>
        <Quote author="George W. Bush">Rarely is the questioned asked: Is our children learning?</Quote>
    </Quotes>

    To specify a type for the node contents as well as some attributes, we need to use a type extension, specifying the type we want for the content as the base type.   This is shown below.

    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
        <xs:element name="Quotes">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Quote">
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="xs:string">
                      <xs:attribute name="author" type="xs:string" />
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:schema>

    The XSD above will permit the XML we want, and allow content and attributes on the same node.  I'll probably do some more stuff on XSDs in the near future.

    0
    Posted At: 13:39, by: Steve Elliott in Programming
    , from
    Manchester

    Comments

    Loading Comments...
    Add New Comment
    Enter your name and email below, dont worry I wont post your email address for bots to find, its just to link in the Gravatar.

    Sunday, 22 February 2009

    Got Street Fighter IV on the weekend, it is undeniably great, but suprisingly difficult on even medium alone, or I just suck still, which is a distinct possibility.  The ultra/super moves are proving to be a giant pain in the arse, but I'm sure I'll be fine once I master them.  A nice addition would be the ability to change your "Challenge Status" without going out to the main menu, as its a bit of a pain, and sometimes you just want to finish the arcadey mode.  But nevermind.  Its a very, very pretty game, and I'm incredibly glad they didnt go down the full 3D route, because that would have sucked.

    With luck I'll be better at it and start winning a few games...

    0
    Posted At: 09:28, by: Steve Elliott in Gaming
    , from
    Manchester

    Comments

    Loading Comments...
    Add New Comment
    Enter your name and email below, dont worry I wont post your email address for bots to find, its just to link in the Gravatar.