Cablan.net
productions la Source
Open Hand Games
Who is Martin-Pierre Frenette

Software Development articles

    • Launch of the new Frenette.info template

      15.06.2011,Development, TYPO3,Martin-Pierre Frenette,

      I never liked the various www.frenette.info templates I used in the past because, being a personal website, it was always secondary to my job.

      At the same time, I always felt that being a personal website, it should reflect my own style and tastes but I always lacked the time to work on it.

      Last week, I purchased a new tool, styliser, which helps build CSS stylesheets faster than any other tool I ever used.

      As a result, I began playing over the week-end with an old HTML file but with a blank CSS stylesheet.

      Before I knew it, I had a brand new template I actually liked!

      With the help of EasySlider, a Jquery plugin I used for my new timeline, I created a new tt_news template which automatically listed all of the news article in the list view but formatted properly for EasySlider.

      I also created 2 new Flexible Content Elements and modified EasySlider to use custom labels. You can see the result on the Competent Man page.

      To create the tab labels's page, I simply added a marker in the FCE source file and mapped it in JavaScript to a user file I had written back in 2005 for another client:

      includeLibs.tablabels = fileadmin/tabslabel.php

      lib.tabLabels = USER_INT

      lib.tabLabels.userFunc = user_tablabels->GetTabLabels

      In tabslabel.php file is there to retrieve the list of labels for the interior Flexible Content Elements.

      You can find the tabslabel.php file here as a .txt file (right-click on this link and select "save as").

    • Placing a different image on each page

      27.04.2011,Development, TYPO3,Martin-Pierre Frenette,

      In TYPO3, especially with TemplaVoilà, it is very easy to do it.

      The first step consists of creating a new element in your Data Structure in the TemplaVoilà module as a "Typoscript Object Path". I recommend the set the Advanced Mapping field to "img" so ensure it is properly mapped.

      For my site, I linked it to lib.portrait

      In your root template, I added the following code to my template setup:

      lib.portrait = IMAGE
      lib.portrait{
      file {
            import =  uploads/media/
            import.data = levelmedia:-1, slide
            import.listNum = 0
            width = 180m
            height = 270m
             }
      }

       

      In my case, the width was fixed to 180 by 270, so I directly forced it in the typoscript. I could have instead used the imagewidth and imageheight fields to  show the image in its actual size, but in 10 years of TYPO3 development, each time I had to put an image via typoscript, it was to fit precisely in a fixed place.

      Here is an explanation of the code, line by line:

      1. The first line declares lib.portrait to be an image.
      2. We then open a new scope to avoid rewriting the lib.portrait before every line
      3. We work only on the file property of the image, so we open a new scope on it too.
      4. We declare the upload directory. Images stored directly in the page record are always uploaded in uploads/media.
      5. This is the most complex line. It provides 2 different information: levelmedia is a directive to take the image on a specific level of the treeline. A levelmedia of 1 means on level 1. A levelmedia of -1, means on the current page. A levelmeida of -2, would have meant on the parent page of the current one. Slide on the other hand, means: "If the target page doesn't have an image, go up 1 page until you do find an image"
      6. The listnum allows to specify which image of the page is selected. This could allow multiple images to be used, such as a custom header and footer image.
      7. We specify the image width
      8. And height

      Line 5 is particuliarly interesting because if we only put an image on the root page, it will be shown on every page of the site.

      Then, each time we want to override that image with a specific one, we simply need to add the image on the page and it will be changed for that page and all of its sub pages.

      This is why the "About me" page has the same image as my home page: I decided not to put a custom image there for now.

    • Prejudice and decision making

      30.11.2010,Post-Conformism, Leadership, Development,Martin-Pierre Frenette,

      Prejudice occurs when you have a pre-made mindset about something. Anything. Racism and sexism are two kinds of well known prejudices.

      A racist employer might hire an under-qualified white candidate over a better qualified black candidate and cause his company to suffer because he was unwilling to let his racism aside and simply hire the best employee.

      Most people officially fight prejudice and even go so far as to try to combat stereotypes. Yet, time after time, prejudice prevails in non-obvious ways.

      How many times have you spent more money to get a superior product only to discover that the only difference with its competitor was a higher price ?

      Prejudice in Software Development

      When I used to build windows applications I was posed with a serious WIN32 development problems.

      In Windows, to draw graphic on the screen, you need a DC object (a Device Context object).

      Device Context allow you to draw on a screen or even for a printer anything you want. Lines, text, images, etc...

      But when you are programming for the screen, you need one DC object per window. If you have 3 windows in your application, you need 3 DC objects.

      The problem is that when you build an application using the MFC API every button, every menu, every image on the screen is a separate window.

      We were trying to display several line graphics on the screen and as such, created multiple classes to display those graphics, the lines, the grid, etc...

      Each of these classes was officially a window and needed it's own DC object. Switching from one DC to another took time and seriously restrained our ability to accelerate the graphic.

      We would display the grid, overlay the comparison line, the moving average line and the live line needing 4 separate DC object each requiring several milliseconds to activate.

      To achieve 30 frames per seconds, we had to spend less than 33 milliseconds per frame, but simply switching from one DC to another took more than 50 milliseconds back then.

      We could have generated one function to generate all of the display but we loved that each of the 3 lines were managed by the same object.

      Our solution

      Instead, our graphic lines stopped being windows and became piggy-backing on our grid using the same DC saving us enough time to run our display in real time while taking a lot less CPU power.

      Eventually we created a lot of these "windowless controls" which enabled us to display anything on the screen in the same manner as a normal control (and with the same functions) but without needing a separate DC object.

      We were then able to convert any windows-based classes to a more efficient windowless control by just changing a few lines of initialization.

      Better yet, we even used macros to enable switching from one mode to another.

      Had we kept the preconception that every control under Win32 needs to be an Win32 window, we wouldn't have been able to create lightning fast displays without using advance libraries like DirectX which was still experimental back then.

      We saved a lot of money in development time and blew away our competition in raw speed, power and efficiency.

      That is, until they started using specialized libraries. I didn't stay long enough after we created Windowless controls but this is the kind of breakthrough which can only be achieved by putting aside all prejudices.

      Whether it's against certain type of people, certain type of processes or certain decisions we are afraid to make.

       

    • Scope Creep and Unreasonable Clients

      22.05.2008,Development,Martin-Pierre Frenette,

      I am in talks with a development firm which signed a contract almost a year ago to build a TYPO3 contract. Arguments between the client and the development firms caused not only enough delays so that the project still isn't begun, but also that their TYPO3 expert left the company in the mean time.

      This is where I come in. I would do the tasks that expert would have done had he stayed.

      For the last few days, the development firm and I did a lot of "bonding", for the lack of a better word to discover that we appear to be compatible in our approaches and fees (so that they can afford me).

      With my help, a new proposal was made to the client with all of the features they have asked to be added since the original signature, most of which litterally kick-ass and which I would have a lot of fun coding.

      The new proposal is roughly 4 times the cost of the original contract, but the scope of the project more than quadrupuled, so that in the end, it looks like a big bargain.

      We are talking about building what would look like a million dollars site for less than 10% of the cost, a small but signification portion heading my way.

      We all expected the client to drop some of the features due to the high cost compared to the original contract, but despite a lot of experience, we never anticipated the actual answer.

      "We love the proposal. You have a go on the project. We want everything exactly the way you proposed it, it's perfect. There is just one mistake in your document : The price of the contract is 4 times our signed copy. We consider the contract signed last year, with the new features in this proposal, to be binding. There is no way we will pay more than already agreed"

      This is similiar to going to a Toyota dealer, buying an Toyota Yaris, their lowest price model, but before delivery, deciding to buy instead a high priced Camry Hybrid LE but still paying the Yaris's price.

      Yet, the client thinks their suggestion is not only reasonable, they seem to think it would actually hold in a court of law.

      Don't you love clients like that ?

      Granted, I haven't seen the original contract, but I doubt it says "This price includes all features requests not yet mentionned by the client"...

    Categories

  1. Post-Conformism
  2. Politics
  3. Biographie
  4. Blog
  5. Eurodance
  6. Personal
  7. TV/Movies
  8. Philosophy
  9. Leadership
  10. Development
  11. TYPO3
  12. My Writing
  13. My Board Games
  14. Evolution
  15. Sitemap
  16. Français
  17. R is unknown
  18. Archive


    Twitter

    loading tweets ...Reload