23
Feb
2010

Netbeans : Only using space tabs for python

I like to use tab as separator for all my files (html/css/js) but it is recommended to use space tabulation for python files.

With netbeans, the problem is if you go in the preferences :

Tools > Options > Editor > Formatting

you can see the parameter "Expand tabs to spaces" when you are using "Language : All Languages" and "Category : Tabs and Indents" (Of course, I didn't checked this one in order to have tabs and not space).

But, now if you choose Python as Language, there is no "Tabs and Indents" category.

So by default, you had to choose to expand tabs to space for all your files in order to have the python files to work.

But I've found the solution to just using space for python files, and tab for the rest.

All you have to do is to add the following lines to the file

[Netbeans Installed Folder]/.netbeans/6.8/config/Editors/text/x-python/Preferences/org-netbeans-modules-editor-settings-CustomPreferences.xml

    <entry javaType="java.lang.String" name="code-template-expand-key" xml:space="preserve">
        <value><![CDATA[TAB]]></value>
    </entry>
    <entry javaType="java.lang.Boolean" name="expand-tabs" xml:space="preserve">
        <value><![CDATA[true]]></value>
    </entry>

Restart your editors and that's it ! You can now have space for python and tabs for the rest of your script files !

Hope this helps !

19
May
2009

Do you use CSS reset files ?

Any browser comes with its own implemented method for displaying non-css setted html pages, but they have their own set of styles, sometimes regardless of the W3C recommandation, and so often different between them.

Nowadays, the trends are to use reset css files to make your style identical for any browser, without breaking your head on the wall.

The most commonly used CSS Reset are :

But you, do you use a CSS Reset method or file ? Do you use your own ?

Leave your though, I'll be pleased to discuss with you about that ! :)

03
Feb
2009

Why the form validation are in the View part ?

The question is quite clear and I'm going to explain my point of view.

If you take a look at Struts or JSF,and I'm sure, for a lots of others frameworks out there, the form verification are made in the View side.

For example, this is a wrong method (IMHO) used by JSF templates :


<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<f:view>
   <h:form>
      <h:outputText value="Name: "/>
         <h:inputText id="name" required="true" maxlength="20" value="#{user.name}">
            <f:validateLength minimum="3" maximum="20"/>
         </h:inputText>
         <h:message for="name" style="color: red"/>
         <h:commandButton value="Submit" action="success"/>
      <h:form>
</f:view>

The point I want to raise is the fact that it's generally the job of the web designer to make the template, the forms, but NOT to make the verifications !

Yes he need to know which value is needed, eventually which type is waited (for implementing nice date picker for example), but not to test if the string is too short or too long, if it's an email, etc.

The side that must handle this kind of operation must be the Controller, that know which type a field must be. Eventually, the Model side can impose its structure to the controller, but never the View side ! A webdesigner must never impose the structure of the data. Right ?

Ok now everyone is boiling about what javascript is able to, and I totally agree with that, but with restrictions.

Client-side verifications must be implemented only to improve user experience. Never forget that javascript can be disabled !

But it's a great idea to tell at your webdesigner the constraints for the form in the fact that he could implement a client-side verification, and then, your controller will do the server-side (final) verification, in case javascript is disabled, or some bad guy try to play with your code :p

I would be pleased to know your opinion about that :)

26
Jun
2008

Windows Usability Systematic degradation flame

---- Original Message ----

From: Bill Gates
Sent: Wednesday, January 15, 2003 10:05 AM
To: Jim Allchin
Cc: Chris Jones (WINDOWS); Bharat Shah (NT); Joe Peterson; Will Poole; Brian Valentine; Anoop Gupta (RESEARCH)
Subject: Windows Usability Systematic degradation flame

I am quite disappointed at how Windows Usability has been going backwards and the program management groups don't drive usability issues.

Let me give you my experience from yesterday.

I decided to download (Moviemaker) and buy the Digital Plus pack ... so I went to Microsoft.com. They have a download place so I went there.

The first 5 times I used the site it timed out while trying to bring up the download page. Then after an 8 second delay I got it to come up.

This site is so slow it is unusable.

It wasn't in the top 5 so I expanded the other 45.

These 45 names are totally confusing. These names make stuff like: C:\Documents and Settings\billg\My Documents\My Pictures seem clear.

They are not filtered by the system ... and so many of the things are strange.

I tried scoping to Media stuff. Still no moviemaker. I typed in movie. Nothing. I typed in movie maker. Nothing.

So I gave up and sent mail to Amir saying - where is this Moviemaker download? Does it exist?

So they told me that using the download page to download something was not something they anticipated.

They told me to go to the main page search button and type movie maker (not moviemaker!).

I tried that. The site was pathetically slow but after 6 seconds of waiting up it came.

I thought for sure now I would see a button to just go do the download.

In fact it is more like a puzzle that you get to solve. It told me to go to Windows Update and do a bunch of incantations.

This struck me as completely odd. Why should I have to go somewhere else and do a scan to download moviemaker?

So I went to Windows update. Windows Update decides I need to download a bunch of controls. (Not) just once but multiple times where I get to see weird dialog boxes.

Doesn't Windows update know some key to talk to Windows?

Then I did the scan. This took quite some time and I was told it was critical for me to download 17megs of stuff.

This is after I was told we were doing delta patches to things but instead just to get 6 things that are labeled in the SCARIEST possible way I had to download 17meg.

So I did the download. That part was fast. Then it wanted to do an install. This took 6 minutes and the machine was so slow I couldn't use it for anything else during this time.

What the heck is going on during those 6 minutes? That is crazy. This is after the download was finished.

Then it told me to reboot my machine. Why should I do that? I reboot every night -- why should I reboot at that time?

So I did the reboot because it INSISTED on it. Of course that meant completely getting rid of all my Outlook state.

So I got back up and running and went to Windows Update again. I forgot why I was in Windows Update at all since all I wanted was to get Moviemaker.

So I went back to Microsoft.com and looked at the instructions. I have to click on a folder called WindowsXP. Why should I do that? Windows Update knows I am on Windows XP.

What does it mean to have to click on that folder? So I get a bunch of confusing stuff but sure enough one of them is Moviemaker.

So I do the download. The download is fast but the Install takes many minutes. Amazing how slow this thing is.

At some point I get told I need to go get Windows Media Series 9 to download.

So I decide I will go do that. This time I get dialogs saying things like "Open" or "Save". No guidance in the instructions which to do. I have no clue which to do.

The download is fast and the install takes 7 minutes for this thing.

So now I think I am going to have Moviemaker. I go to my add/remove programs place to make sure it is there.

It is not there.

What is there? The following garbage is there. Microsoft Autoupdate Exclusive test package, Microsoft Autoupdate Reboot test package, Microsoft Autoupdate testpackage1. Microsoft AUtoupdate testpackage2, Microsoft Autoupdate Test package3.

Someone decided to trash the one part of Windows that was usable? The file system is no longer usable. The registry is not usable. This program listing was one sane place but now it is all crapped up.

But that is just the start of the crap. Later I have listed things like Windows XP Hotfix see Q329048 for more information. What is Q329048? Why are these series of patches listed here? Some of the patches just things like Q810655 instead of saying see Q329048 for more information.

What an absolute mess.

Moviemaker is just not there at all.

So I give up on Moviemaker and decide to download the Digital Plus Package.

I get told I need to go enter a bunch of information about myself.

I enter it all in and because it decides I have mistyped something I have to try again. Of course it has cleared out most of what I typed.

I try (typing) the right stuff in 5 times and it just keeps clearing things out for me to type them in again.

So after more than an hour of craziness and making my programs list garbage and being scared and seeing that Microsoft.com is a terrible website I haven't run Moviemaker and I haven't got the plus package.

The lack of attention to usability represented by these experiences blows my mind. I thought we had reached a low with Windows Network places or the messages I get when I try to use 802.11. (don't you just love that root certificate message?)

When I really get to use the stuff I am sure I will have more feedback.

Source : http://blog.seattlepi.nwsource.com/microsoft/archives/141821.asp French source : http://www.gizmodo.fr/2008/06/26/du_grand_bill_gates_qui_va_certainement_nous_manquer.html
24
Apr
2008

Catapult Origin (v0.1.1)

I'm pleased to anounce you the release of my PHP Framework, Catapult.

You will have more information at this address : http://catapult.reflectiv.net

The next version, "Emergence" (v0.2) will be available during June (I hope ! :p), and will bring a newest Sgbd management, an User (User, Authentication and maybe Acl) objects and some other good stuffs :)

I hope you will like it :)