Zen Coding

I use a lot of snippets when I program, those little shortcut that transform several lines of code. Zen coding goes further by proposing to use snippets the same way as the CSS selection.

For example the following line of code:

div#header

is tranformed into:

<div id=”header”></div>

And this:

div # header> p> lorem

is transform into :

<div id="header">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit
anim id est laborum.<p>
</div>

For more information see :http://code.google.com/p/zen-coding/

Leave a Comment

Flex : Using a JSP proxy page to bypass crossdomaine file

This example shows how to create a JSP proxy for XML request Server-Side Scripting. When you write a Flex application, and when you are accessing remote hosts for services you have no control of (ex: RSS Feed), then you find out there is no cross domain file ( crossdomain.xml) and Flex app will complain. Using a proxy (JSP or PHP page for example ) can help you by pass this problem.

The JSP code using Tomcat 6.0 and JDK 1.6


<%@ page language = "java" import = "java.net.*" import = "java.io.*" %>
<%
String search,mime;
HttpSession ses = request.getSession(true);
if(request.getParameter("url") == null)
search = "http://www.theflexshow.com/blog/images/the_flex_show.jpg";
else
search =request.getParameter("url");

if(request.getParameter("mimeType") == null)
mime = "application/xml";
else
mime =request.getParameter("url");
mime = mime.trim();
InputStream resultInStream = null;
OutputStream resultOutStream = response.getOutputStream();
%>
<% response.setContentType(mime); %>
<%
try
{
URL url = new URL(search);
resultInStream = url.openStream();
byte[] buffer = new byte[4096];
int bytes_read;
while((bytes_read=resultInStream.read(buffer)) != -1)
{
resultOutStream.write(buffer, 0, bytes_read);
}
resultOutStream.flush();
resultOutStream.close();
resultInStream.close();
} catch (Exception e) {%><%= e%><%}
finally{ try { resultOutStream.flush(); resultOutStream.close(); resultInStream.close(); } catch (Exception e) {%><%= e%><%}
}%>

This is the Flex code using Flex Builder 3



        
        DataGrid {
           alternatingItemColors: #cccccc, #eff1f2;
           rollOverColor: #999999;
           textRollOverColor: #ffffff;
           selectionColor: #666666;
           color: #000000;
           textSelectedColor: #ffffff;
        }

        Button {
           color: #ffffff;
           themeColor: #333333;
        }
    

    
        

    
    
        
            
        
    
    
    
    

Leave a Comment

Today’s Quote

One of my favorite quote which relates to what we do at Green Design HQ is the following:

‘The only way to communicate is to understand what it is like not to understand.’ It is at that moment that you can make something understandable

~ Richard Saul Wurman

Leave a Comment

Multi-touch support in Flash

The example below is a an example built by StruckAxiom that demonstrate the new APIs that are made available in Flash Player 10.1.

PepsiCo Social Media Visualization from StruckAxiom on Vimeo.

Leave a Comment

Building iPhone Applications with Flash by Lee Brimelow

A nice presentation by Lee Brimelow which shows how to build iphone applications using the Flash CS5.

Building an Iphone application with Flash CS5

Tags:

Leave a Comment