Monday, February 21, 2011

It Is Easy To Add Widget Between Post

It Is Easy To Add Widget Between Post: "

The common widget in blog is placed at sidebar besides the main content. We are eventually see the blog place its sidebar on the left or right alignment of the main content. And more blog add the sidebar below the main content. When we have it on our own we may bored because there a lot of another blog done the same design with what we’ve done.


The solution is come to homepage of blog list post. In this page, we can do some improvement placing ads, widget and more additional content . The trick is just about iterate variable. We just need to giving the Integer data type variable and define it as 1 in beginning. Then we need adding some division to end section of post list. Within this division you have to do some exclusion with if else bracket. Filter the exclusion based on iteration(e.g. iteration equal to 3). And in the end of exclusion add the iteration action for iteration variable.



/*The container of main content */
...
int i = 1;

/* The post list divission here*/
if(i=3){
// do your widget here
}
/*End of post list divission*/

This trick does work in tutopod to add the popular post, as you can see i place them on 3rd iteration. The way of doing it manually (without plugins) in wordpress, joomla and drupal will coming next.


"

60% Processor Is Just Sand?

60% Processor Is Just Sand?: "

From the intel favorite news, now we know that the processor is made from a complex structure what they said about silicon. The silicon itself is the further creation of sand particle.







And know we know that processor had very complex process to built. And that make the processor expense in their place.


"

Mozilla Dash clears the board

Mozilla Dash clears the board: "



Mozilla Home Dash re-imagines the Firefox interface.(Credit:Mozilla)


Home Dash is a new add-on from Mozilla Labs’ Prospector project that re-imagines the

Firefox interface for Firefox 4 on Windows, Mac OS X, and Linux. It removes nearly all defining features from the interface in an attempt to emphasize the contents of the Web page you’re viewing. Gone are the status bar, bookmark bar, navigation buttons and URL bar, leaving behind only the dedicated Firefox 4 menu button from the upper left of the interface.


All those components get replaced with a translucent Firefox logo below the menu button. Click the logo or use the Control + T hot key and the new “dashboard” appears, flush against the right margin of your browser. The top row shows your open tabs, with pinned tabs on the left, while the cluster of preview windows below reveals frequently visited sites. The numbers on the opened tabs can be used with the Control key to bring them to the foreground quickly, and you can make a tab an app tab by dragging it to the left. The larger sites in the middle are those that you visit most often. Hovering over a thumbnail will show the full size of that site in the background. Click it to pull it into the foreground and hide the Dash.


A search box appears in the upper left of the browser, which uses an agnostic approach towards your query. It searches your history, opened tabs, and the Internet at large simultaneously, much like the URL bar does now in the Firefox 4 beta but without such strict delineations between sources. You can specify a search engine to use by clicking one of the icons below the search box.


Home Dash is a restart-free add-on, so you won’t have to close the browser to get it going. It also only works in Firefox 4 betas 9 and 10. To return to the default interface, you currently must go into your add-ons panel and disable it. Coming in version 2 the developers plan on including a hot key toggle to quickly jump between the two looks.


As befits such a minimalist interface, there are a number of hot key combos to minimize mouse work in the menu. When the Dash is closed, the hot keys function as they normally do: Control + L will bring up your location bar, Control + T opens a new tab, and Control + K opens your default search engine in the current tab. They all open the Dash, too. When the Dash is already open, Control + L will paste the current URL into the search box if it’s empty, or select the text that’s in the box if it’s not; Control + T toggles whether the selected page opens in the current tab or a new tab; and Control + K activates the default search and then cycles through the search engines.


Mozilla has created a lengthy list of keyboard shortcuts for the add-on, including some keys that have double-mapped so that you can use either your left or your right hand. The full list is available in this Mozilla blog post.


Because the add-on is experimental, it wasn’t exactly surprising to me that it crashed my browser multiple times, even with only two tabs open. It also had problems rendering thumbnails for the Dash unless I hovered the mouse over them for about 10 seconds. Let me know your experiences with Home Dash in the comments below.


Watch a Mozilla-produced video on how to use Home Dash here.




"

Center Position Layout With Javascript

Center Position Layout With Javascript: "

sometimes we wanted a page layout that fully center from browser width and height. The short way to doing this is using css marginal. We may pupolar with these codelist



.div{
width:400px;
margin:0 auto;
}

with that code the div element will inherit among the lower layer so the auto work determine to centralize right and left marginal to fit with the browser width. But with this way we must manualy describe how much the height of div element. It is to balance between top and bottom space. And once again it is not cross browser. So you might still met the difference space between top and bottom.


To solve it and make it flexible to follow all browser width and height we can eventually use javascript. We just need to get the current width and height. Then we have to substract it with current div element width and height with following divide the element into two.



function(){
var someDiv= document.getElementById("someDiv");
var windowWidth = document.documentElement.clientWidth;
var windowHeight = document.documentElement.clientHeight;
var popupHeight = someDiv.clientHeight;
var popupWidth = someDiv.clientWidth;
someDiv.style.position = "absolute";
someDiv.style.top = parseInt(windowHeight/2-popupHeight/2) + "px";
someDiv.style.left = parseInt(windowWidth/2-popupWidth/2) + "px";
};

Mix it with HTML and CSS by your own and see the result.


nb: contact me if you’re getting problem



"

Day 3 — JAX-WS Fetching Data

Day 3 — JAX-WS Fetching Data: "

According to the previous day tutorial, we have all set the server publish it service. And now we can digg up our client side application by using web service power.


Again, i have to remain that we had no change to use the Netbeans IDE on this tutorial. Besides, we have to make sure again that database client have remain like in Day – 1 tutorial. It was postgreSQL with table defined as the student table.




How To







  1. Make new project, Web Project.

  2. Generating wsdl. It is can be done by choosing web service client from right click open dialog and choosing web service category. Once you get there, you’ll be ask the wsdl type you may insert. This stage allow you choose three type of wsdl deployment; From project, Selecting local file or by WSDL URL. What i’d know in common usage is the URL. then lets give the server WSDL URL and get it generated.

    http://localhost:8080/class.data.server/ClassServiceService?wsdl



  3. After you generate the WSDL, it will cause generated package inside the project. With this, i’d love to move the generated package to sources package. It is due to issue that some communication between package ain’t works so well if we let it in generated package. And this is the example of mine.


  4. import metro library to support the rpc, for the moment :D

  5. Create java class in same package in cl.app package and add this code,
    package cl.app;

    import java.lang.reflect.Proxy;
    import java.rmi.RemoteException;
    import java.util.Collections;
    import java.util.HashMap;
    import java.util.List;
    import java.util.Map;
    import java.util.Vector;
    import javax.mail.MessageContext;
    import javax.xml.rpc.*;
    import javax.xml.namespace.QName;
    import javax.xml.ws.BindingProvider;
    import java.lang.reflect.Proxy;
    /**
    * @author Arif
    */
    public class fetchData {
    private static String endpoint = "http://localhost:8080/class.data.service/ClassService";

    public List<Core> getData() {
    ClassServiceService service = new ClassServiceService();
    ClassService port = service.getClassServicePort();
    List<Core> coreClass = null;
    coreClass = port.collectAuto();
    return (List<Core>) coreClass;
    }

    public static void main(String[] args) throws ServiceException, RemoteException {

    ServiceFactory sf = ServiceFactory.newInstance();
    Service service = sf.createService(null);

    Call call = service.createCall();
    call.setTargetEndpointAddress(endpoint);
    call.setOperationName(new QName("http://localhost:8080/class.data.service/ClassService", "collectAuto"));

    long time = System.currentTimeMillis();
    fetchData fetch = new fetchData();
    List<Core> coreClass = fetch.getData();
    for (Core cb : coreClass) {
    String errorMessage = cb.getErrMsg();
    if (errorMessage.equalsIgnoreCase("")) {
    System.out.println(
    cb.getSid() + " : "
    + cb.getFname() + " : "
    + cb.getLname()+ " : "
    + cb.getAddress());
    System.out.println("---------");

    } else {
    System.out.println(errorMessage);
    }
    }
    System.out.println(time);
    System.out.println(System.currentTimeMillis()-time);
    }
    }



And you will get this like result when you running the project,



"

Comments