Pages

Friday, February 26, 2010

Remove Blogger Navbar

  •  Log in to blogger

  • On your Dashboard, select Layout. This will take you to the Template tab. Click Edit HTML. Under the Edit Template section you will see you blog's HTML.
  • Paste the CSS definition in the top of the template code:

#navbar-iframe {   height:0px;   visibility:hidden;   display:none   }

Thursday, February 25, 2010

Best Practices for Speeding Up Your Web Site

Hi!

I've found a nice article that describe best practices for speeding up web sites. You can found it here:

http://developer.yahoo.com/performance/rules.html

Wednesday, February 24, 2010

BSDTar I/O redirection bug with Mac OS X Snow Leopard

Hi!

Mac OS X Snow Leopard changed the version of the "tar" utility. Instead of using GNU tar (http://www.gnu.org/software/tar/), they start to use BSDTar which have a bug. BSDTar doesn't send the standard output to the STDOUT but it sends the STDOUT output to the STDERR channel.

Snow Leopard is using BSDTar because it is faster than GNUTar see http://lists.freebsd.org/pipermail/freebsd-current/2007-March/069860.html

If you have scripts or programs that looks at STDERR, you must pay attention to this!

ExtJS - Insert image with tooltip

Hi all!

If you want to add an image with a tooltip, you just have to add the "qtip" property to the "img" tag. Ext.QuickTips.init() must have been previously called...

Example:



...



Friday, February 19, 2010

IntelliJ Community Edition

Hi!

The guys from Jetbrains offer now a community edition of the well known IntelliJ. This version has core feature for Java developpers. It compete with Open Source players like Eclipse and NetBeans.

You can grab your copy of Intellij Community Edition at http://www.jetbrains.com/idea/download/index.html

ERROR: column notation .id applied to type name, which is not a composite type

Hi!

When doing an EJB3 web application with PostgreSQL I have this error message when I try to do a simple SELECT query on my table "user".

After investigation, I've found that:

User is a reserve table in PostgreSQL. We must not have a table named like this! By changing the name of the table, it corrects the problem!!!

Tuesday, February 16, 2010

Nice JSON Formatter

Hi!

If you need a good online JSON formatter, take a look at http://jsonformatter.curiousconcept.com/. It's a really nice tool!


Yann

BorderLayout -=- Using percentage values for width and height

Hi!

As you can see, we can't use percentage width and height with border layout. If you want to do so, your just have to put this piece of code that overrides the actual ExtJS's BorderLayout. After that, you can set width like "width: '33%'".


Ext.override(Ext.layout.BorderLayout, {
 onLayout : function(ct, target){
  var collapsed;
  var size = target.getViewSize(), w = size.width, h = size.height;
  if(!this.rendered){
   target.position();
   target.addClass('x-border-layout-ct');
   collapsed = [];
   var items = ct.items.items;
   for(var i = 0, len = items.length; i < len; i++) {
    var c = items[i];
    var pos = c.region;
    if(c.collapsed){
     collapsed.push(c);
    }
    c.collapsed = false;
    var r = this[pos] = pos != 'center' && c.split ?
     new Ext.layout.BorderLayout.SplitRegion(this, c.initialConfig, pos) :
     new Ext.layout.BorderLayout.Region(this, c.initialConfig, pos);
    if(pos == 'north' || pos == 'south'){
     if(typeof c.height == 'string' && c.relHeight === undefined){
      var p = c.height.match(/(\d+)%/);
      if(p[1]){
       c.relHeight = parseInt(p[1], 10) * .01;
      }
     }
     if(c.relHeight !== undefined){
      if(typeof c.relHeight != 'number'){
       c.relHeight = parseFloat(c.relHeight);
      }
      c.height = h * c.relHeight;
     }
     r.minSize = r.minSize || r.minHeight;
     r.maxSize = r.maxSize || r.maxHeight;
    } else if(pos == 'east' || pos == 'west'){
     if(typeof c.width == 'string' && c.relWidth === undefined){
      var p = c.width.match(/(\d+)%/);
      if(p[1]){
       c.relWidth = parseInt(p[1], 10) * .01;
      }
     }
     if(c.relWidth !== undefined){
      if(typeof c.relWidth != 'number'){
       c.relWidth = parseFloat(c.relWidth);
      }
      c.width = w * c.relWidth;
     }
     r.minSize = r.minSize || r.minWidth;
     r.maxSize = r.maxSize || r.maxWidth;
    }
    if(!c.rendered){
     c.cls = c.cls ? c.cls +' x-border-panel' : 'x-border-panel';
     c.render(target, i);
    }
    r.render(target, c);
   }
   this.rendered = true;
  }
  if(w < 20 || h < 20){
   if(collapsed){
    this.restoreCollapsed = collapsed;
   }
   return;
  }else if(this.restoreCollapsed){
   collapsed = this.restoreCollapsed;
   delete this.restoreCollapsed;
  }
  var centerW = w, centerH = h, centerY = 0, centerX = 0;
  var n = this.north, s = this.south, west = this.west, e = this.east, c = this.center;
  if(!c && Ext.layout.BorderLayout.WARN !== false){
   throw 'No center region defined in BorderLayout ' + ct.id;
  }
  if(n && n.isVisible()){
   var b = n.getSize();
   var m = n.getMargins();
   b.width = w - (m.left+m.right);
   if(n.panel.relHeight !== undefined){
    n.height = Math.round(h * n.panel.relHeight);
    b.height = n.minSize && n.height < n.minSize ? n.minSize :
     (n.maxSize && n.height > n.maxSize ? n.maxSize : n.height);
   }
   b.x = m.left;
   b.y = m.top;
   centerY = b.height + b.y + m.bottom;
   centerH -= centerY;
   n.applyLayout(b);
  }
  if(s && s.isVisible()){
   var b = s.getSize();
   var m = s.getMargins();
   b.width = w - (m.left+m.right);
   if(s.panel.relHeight !== undefined){
    s.height = Math.round(h * s.panel.relHeight);
    b.height = s.minSize && s.height < s.minSize ? s.minSize :
     (s.maxSize && s.height > s.maxSize ? s.maxSize : s.height);
   }
   b.x = m.left;
   var totalHeight = (b.height + m.top + m.bottom);
   b.y = h - totalHeight + m.top;
   centerH -= totalHeight;
   s.applyLayout(b);
  }
  if(west && west.isVisible()){
   var b = west.getSize();
   var m = west.getMargins();
   b.height = centerH - (m.top+m.bottom);
   if(west.panel.relWidth !== undefined){
    west.width = Math.round(w * west.panel.relWidth);
    b.width = west.minSize && west.width < west.minSize ? west.minSize :
     (west.maxSize && west.width > west.maxSize ? west.maxSize : west.width);
   }
   b.x = m.left;
   b.y = centerY + m.top;
   var totalWidth = (b.width + m.left + m.right);
   centerX += totalWidth;
   centerW -= totalWidth;
   west.applyLayout(b);
  }
  if(e && e.isVisible()){
   var b = e.getSize();
   var m = e.getMargins();
   b.height = centerH - (m.top+m.bottom);
   if(e.panel.relWidth !== undefined){
    e.width = Math.round(w * e.panel.relWidth);
    b.width = e.minSize && e.width < e.minSize ? e.minSize :
     (e.maxSize && e.width > e.maxSize ? e.maxSize : e.width);
   }
   var totalWidth = (b.width + m.left + m.right);
   b.x = w - totalWidth + m.left;
   b.y = centerY + m.top;
   centerW -= totalWidth;
   e.applyLayout(b);
  }
  if(c){
   var m = c.getMargins();
   var centerBox = {
    x: centerX + m.left,
    y: centerY + m.top,
    width: centerW - (m.left+m.right),
    height: centerH - (m.top+m.bottom)
   };
   c.applyLayout(centerBox);
  }
  if(collapsed){
   for(var i = 0, len = collapsed.length; i < len; i++){
    collapsed[i].collapse(false);
   }
  }
  if(Ext.isIE && Ext.isStrict){
   target.repaint();
  }
 }
});
Ext.override(Ext.layout.BorderLayout.SplitRegion, {
 onSplitMove : function(split, newSize){
  var s = this.panel.getSize();
  this.lastSplitSize = newSize;
  if(this.position == 'north' || this.position == 'south'){
   this.panel.setSize(s.width, newSize);
   if(this.panel.relHeight !== undefined){
    this.state.relHeight = this.panel.relHeight *= newSize / this.height;
   }else{
    this.state.height = newSize;
   }
  }else{
   this.panel.setSize(newSize, s.height);
   if(this.panel.relWidth !== undefined){
    this.state.relWidth = this.panel.relWidth *= newSize / this.width;
   }else{
    this.state.width = newSize;
   }
  }
  this.layout.layout();
  this.panel.saveState();
  return false;
 }
}); 




This patch has been taken from this post: http://www.extjs.com/forum/showthread.php?p=287261#post287261


Thanks to Condor!

Wednesday, February 10, 2010

ExtJS 3.1.1 Released!

ExtJS's team launched this week a new version of the well known AJAX library ExtJS. You can download it at ExtJS 3.1.1. The enhancements / changes are describe below.



Enhancements
  • Ext.menu.Menu now accepts a zIndex configurations.
  • Combo values with a hiddenName of null will set the value to ” instead of ‘null’
  • Field msgTarget ‘under’ target now handles field resizing.
  • Exposed ptypes via Ext.ComponentMgr.ptypes. Added a new method called isPluginRegistered
  • ArrayReader now passes along the successProperty in the same manner as JSONReader.
  • Added a new constant for the minimum width of a prompt Message Box. Also made the confirm/alert methods explicitly specify the minWidth.
  • The grid now remembers grouping state. Also added a groupchange event.
  • MessageBox respects the maxWidth option when passed as a parameter to show().
  • Added a new removeAll method to Ext.data.Node to remove all children.
  • Menu now accepts a zIndex configuration.
  • Ext.Button now correctly invokes its superclass’s onDestroy method.
  • Combo values with a hiddenName of null will set the value to ” instead of ‘null’
Changes
  • Update getDom to use a strict flag for IE which checks the ‘id’ attribute as a secondary validation. Update id function to use the new getDom strict flag.
  • TabPanel and Window containers were erroneously defaulting monitorResize. As described in the BoxComponent documentation, this is a manually configured flag set by users when needed while using renderTo.
  • Toolbar enableOverflow default set to false as per documentation.
  • Resolved an issue where an HtmlEditor would flicker when being laid out due to moving the fontSelect in the DOM.
  • Fixed an issue where updateEditState was called too early in the render cycle, before the Component was sized.
  • Changed the behaviour so that when an item is added to a disabled toolbar, the item is also disabled.
  • Added a fix that allows multiple CheckColumns to be used in a grid.
  • Added a fix where the DirectStore would not accept the fields option when it had a Record definition. Also made sure the initial config object isn’t modified and changed the constructor to the newer syntax.
  • Added a fix to stop the event when the esc key causes a window to be closed.
  • Added a fix so that beforecheckchange isn’t fired when suppressEvent is set.
  • Added documentation for beforeclose and close events fired on a TabPanel’s child items on close.
  • Added a fix for the header checkbox when using a CheckboxSelectionModel.
  • Added a fix that allows previously rendered nodes to be re-added to a tree.
  • Removed the deprecated returnJson config. Added a new encodeDelete config option that allows the format of the deleted data passed back to the server to be customized.
  • Correct baseParams transition from config option to runtime property, and deferring params enrichment (for a read action) until after the beforeload event.
  • Fixed an issue when removing components with removeMode container from layouts that render the components to a created innerCt.
  • TreeGridSorter revised to be sortType compat with TreeSorter
  • Fixed an issue where keyboard navigation was broken after dynamically setting the root node. This was caused by calling afterRender erroneously in the setRootNode method.
  • Fixed an issue where setting the root node dynamically would cause IE to crash.
  • Hide non-functioning config options in Button and TreePanel docs.
  • Corrected horizontal handle placement (non-snapping).
  • Correct undefined namespace reference for pub vs Ext.lib.Event
  • node.id now correctly included when paramsAsHash is true. Also permits placement of the nodeParameter value in the paramOrder collection.
  • Fixed restful api method assertion (was ignoring user-specified methods)
  • Resets lastOptions for groupBy field change.
  • Changed to call setAutoScroll only if autoScroll defined by the BoxComponent instance.
  • Moved verifyLayout setSize mods forward from Ext 3.0+.
  • AfterRender for GroupingView should check that a dataStore and a columnModel still exist before processing, as it’s superclass does.
  • Fix for Fractional size/width pixels (Firefox)
  • Fixed menu separator visibility problem in IE 6
  • CorrectlistEmptyText handling, dropdown list now collapses on blur. Adds autoSelect config option.
  • Adds current layout to afterlayout event arguments
  • Added ASP.Net example code for generating response for a ScriptTagProxy request.
  • Create gray theme version of the date picker
  • onResize now calls it superclass
  • ComboBox list now evaluates/adjusts to the z-index of the listParent
  • Panel now properly removes events it added to each of it’s toolbars before destroy
  • ComboBox amended to evaluate/adjust to the z-index of the listParent or, if value is not available, that of an upstream Component. Also expands the listAlign cfg property syntax to optionally specify x/y offsets as listAlign : [ 'tl-bl?', [27, 0]]. (Menu example modified to demonstrate.)
  • Reverted some changes to Toolbar which affected buttonAlign.
  • Corrects scenario where GroupView enables/disables Grouping based solely on presence of a groupField (especially when the groupField is cleared externally via the GroupStore.clearGrouping method. Added Clear Grouping Button to grouping example.
  • Workaround for multiple firings of change event on TriggerField in FieldReplicator plugin.
  • Fixed IE6 layout quirk where #header height “jumps”. Made samples link locally, instead of linking to remote and local samples.
  • Field msgTarget ‘under’ target now handles field resizing. errorIcon and errorEl elements properly destroyed.
  • Exposed ptypes via Ext.ComponentMgr.ptypes. Added a new method called isPluginRegistered.
  • Added a check to see if the same editor is being used to prevent onBlur from firing as the editor is being moved from cell to cell.
  • QTips get increased z-index for better visibility in front of loadMasks.
  • TextField font size when editing in WebKit browsers made consistent with Mozilla and others.
  • Fix race condition between hiding and destroying a menu if the browser is resized when a toolbar overflow menu is open.
  • ArrayReader now passes along the successProperty in the same manner as JSONReader.
  • Button control over it’s menu was not specific enough.
  • The TabPanel layout in the Layout Browser example should use activeTab not activeItem.
  • Window Resize events should be buffered for all browsers, not just IE/AIR
  • Added images, CSS and directory (css/theme-access/) for xtheme-access.css.
  • IE8 specific hack rewritten in tabs.css to be more general for fixing a layout issue on tabs that appear incorrectly in IE8 Quirks mode.
  • Firefox 3.6 no longer supports -moz-outline. Added outlinnone after each -moz-outline: none rule
  • IE8 specific hack rewritten in tabs.css. Removed padding-top from x-tab-strip-top to make more visually consistent.
  • Enhancements to Accessibility theme; added Accessibility theme to Examples (key-feed-viewer)
  • Within doLayout, collapsed check should short circuit before canLayout().
  • Changed isVisible with the deep flag regex to match from the beginning of the string and get past tags such as tbody.
  • Radio setValue now checks to make sure it is rendered. In sync with other form widgets.
  • Added a fix so Ext.mean works with empty lists.
  • Added a fix for Ext.num() parsing a few edge case values.
  • Made a change to createAccessor to be more flexible
  • Removes the mouseover event listener properly.
  • Added the Accessibility theme to two existing examples, copying them into the Accessibility section of the 3.1 Samples page. Removed the Accessibility theme from the Key Feed Viewer.
  • Fixed issue with slideOut not being able to size it’s panel due to deferHeight and collapsed flags preventing the adjustment. The code now temporarily clears these flags for the slideOut.
  • Added a fix so that the addElement method works correctly.
  • Added a fix that allows Ext.Resizable to be used in a window. Includes adding a new handleCls property that can be added to the Resizable. Cleaned up the constructor syntax.
  • Viewport will stick with a manual fire of a resize event hooked to onWindowResize.
  • Clarified the differences between Container’s monitorResize and Layout’s monitorResize flags. Layout’s flag name will be changed in a future release for clarity.
  • Update WebKit border issue workaround.
  • Fix updateColumnHeadings to work with ColumnHeaderGroup.
  • constrainScroll updated to account for scrollBars and maximizes space available.
  • TreeNode insertBefore now accepts nodes that already have been created.
  • Recursive layout should occur for the activeItem instead of the cardLayout itself.
  • Connections are now aborted onDestroy.
  • MenuMgr’s onShow now checks to see if the last opened menu has been destroyed before a visible check.
  • Exception no longer thrown when a 201 response is received and data is present
  • Added isDestroyed check in afterShow in case a window is destroyed during an animation.
  • Added a fix to ensure grid editors are destroyed properly. Also cleaned up parts of the code to make the intent clearer.
  • Added new setMaxValue/setMinValue methods to Slider. This fixes an issue that can sometimes occur with the sliding pager
  • Added enableOverflow: true to the example, since it now defaults to false, in accordance with the docs.
  • Added a fix for RowEditor with regards to column model changes.
  • Added a fix for an issue with setActiveItem in CycleButton.
  • Added a fix so that DomQuery doesn’t try and normalize attribute names when used with an XML document.
  • Added a fix for isIterable with an empty NodeList in IE.
  • EventManager will no longer add a task property to the function. Instead we add this in the event cache so it can be referenced at removeListener.
  • Also removes the unload event from Element and moves that functionality to EventManager’s _unload which is the last function to be run before the window’s unload event finishes.
  • Fixed an issue where each() wasn’t working correctly in CompositeElementLite.
  • Adjusts chrome vs chromeframe detection (largely effecting IE)
  • Special mousedown event for the body is now properly removed from stoppedMouseDownEvent.
  • Cleanup of DomQuery. Renamed short variables to reasonable names, Removed unused values, etc
  • Allow Ext.DomQuery.select to use querySelectorAll if available and not being executed against an XML document. Ext.DomQuery.jsSelect will enable you to use the non-native version. Need to add additional checks for known bugs in QSA.
  • AutoLayout is now a proper layout, moved to it’s own file and extends from the base ContainerLayout. AutoLayout needs to do recursive layout calls for onResize.

Tuesday, February 9, 2010

Mac OS X -=- File Comparator

Hi!

If you need to compare two files. You should have a look at KDiff3. It's a very cool application!

Yann

Mac OS X -=- Hex Editor

Hi!

Need an hexadecimal editor for Mac OS X? Try  HexFiend, it's free!

Yann

Monday, February 8, 2010

Mac OS X -=- Text Editor

Hi!


If you want a good software for text editing in Mac OS X, TextWrangler is your best friend! This software is stable, easy to use, and FREE!

Try it!

Yann

Friday, February 5, 2010

Enable Web Inspector in Safari

Hi!

Web Inspector is a great tool to inspect HTML components with Safari on Mac OS X. To activate it, open a terminal and type:

defaults write com.apple.Safari WebKitDeveloperExtras -bool true

To deactivate it, set the boolean flag to false.

Tuesday, February 2, 2010

VirtualBox - Changing UUID of an hard drive

Hi all!

If you want to copy a VirtualBox's virtual machine, you need to change the UUID of the hard drive. The UUID is an unique identifier for the virtual hard drives (.vdi). To change the UUID, go with the console where your virtual hard drive is, and type this command:
VBoxManage internalcommands setvdiuuid WinXP_IE8.vdi

Where WinXP_IE8.vdi is the name of your virtual hard drive.

Monday, February 1, 2010

CSS - IE6 Margin Right Bug

Due to a bug in IE6, the CSS property margin-right doesn't work. Instead using this property, it's possible to use:

.right-align-example {
    float: right;
    display: inline;

}

Using theses properties is a good workaround to align correctly components with Internet Explorer 6.