0

Ghost Explorer

Ghost Explorer can be downloaded for free from Symantec.

ftp://ftp.symantec.com/public/english_us_canada/products/ghost/utilities/GHO_Explorer.exe

Using this software, ghost file can be view and extracted.
I use ghost software to create image for my Embedded Linux on VortexSx86.
0

GXT Paging ListView

Simply bind the store to ListView and loader to PagingToolBar.
Here is the source code. You might need to refer to my previous posting on JSON reader and paging grid.

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ppktechnology.assetmanagement.client;

import java.util.List;

import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.data.BaseListLoader;
import com.extjs.gxt.ui.client.data.BasePagingLoader;
import com.extjs.gxt.ui.client.data.BeanModel;
import com.extjs.gxt.ui.client.data.BeanModelReader;
import com.extjs.gxt.ui.client.data.ListLoadResult;
import com.extjs.gxt.ui.client.data.ListLoader;
import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.data.RpcProxy;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.ListViewEvent;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.util.Format;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.ListView;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
import com.extjs.gxt.ui.client.widget.toolbar.PagingToolBar;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.ppktechnology.assetmanagement.client.model.ImagesModel;
import com.vcari.client.utils.DataUtils;

/**
 * 
 * @author peyo
 */
@SuppressWarnings({ "rawtypes", "unchecked", "unused" })
public class ImagesList extends LayoutContainer {

    ListStore store = ImagesModel.getInstance().getPagingStore();
    int limit = 20;

    @Override
    protected void onRender(Element parent, int index) {
        super.onRender(parent, index);
        final ContentPanel panel = new ContentPanel();
        setLayout(new FitLayout());
        
        panel.setCollapsible(true);
        panel.setAnimCollapse(false);
        panel.setFrame(true);
        panel.setId("images-view");
        panel.setHeading("Simple ListView (0 items selected)");
        panel.setBodyBorder(false);
        panel.setLayout(new FitLayout());
                
        ListView<ModelData> view = new ListView<ModelData>() {
            @Override
            protected ModelData prepareData(ModelData model) {
                String s = model.get("imagedesc");
                model.set("imagedesc", Format.ellipse(s, 15));
                String thumbnail="images/" +  model.get("thumbnail");
                model.set("thumbnail", DataUtils.formatURL(thumbnail));
                String imagefile="images/" +  model.get("imagefile");
                model.set("imagefile", DataUtils.formatURL(imagefile));
                return model;
            }

        };

         view.addListener(Events.OnDoubleClick, new Listener<ListViewEvent<ModelData>>() {

                @Override
                public void handleEvent(ListViewEvent<ModelData> be) {
                    String imgurl = be.getModel().get("imagefile");
                    com.google.gwt.user.client.Window.open(imgurl, "_blank", "");
                }
            });
        
        final PagingToolBar pagingToolBar = new PagingToolBar(limit);
        pagingToolBar.bind((BasePagingLoader) store.getLoader());
        panel.setBottomComponent(pagingToolBar);
          
        view.setTemplate(getTemplate());
        view.setStore(store);
        view.setItemSelector("div.thumb-wrap");
        view.getSelectionModel().addListener(Events.SelectionChange, new Listener<SelectionChangedEvent<ModelData>>() {

            public void handleEvent(SelectionChangedEvent<ModelData> be) {
                panel.setHeading("Simple ListView (" + be.getSelection().size() + " items selected)");
            }

        });
        panel.add(view);
        add(panel);
        store.getLoader().load();
    }

    private native String getTemplate() /*-{
        return [ '<tpl for=".">', '<div class="thumb-wrap" id="{imageid}">',
                '<div class="thumb"><img src="{imagefile}" title="{imagedesc}"></div>',
                '<span class="x-editable">{imagedesc}</span></div>', '</tpl>',
                '<div class="x-clear"></div>' ].join("");

    }-*/;

}

0

Eclipse JAVA Formatter Line Wrapper Setting

Personally I don't like Eclipse line wrapper default setting since it's not properly wrap my code.
As the result, my code look ugly and harder to be read.

Before : (It will look worse if the code is longer)
adminTree.addListener(Events.OnDoubleClick,
                new Listener<TreePanelEvent<ModelData>>() {

                    @SuppressWarnings("unchecked")
                    @Override
                    public void handleEvent(TreePanelEvent<ModelData> be) {
                        ModelData p = be.getItem();
                        System.out.println(p.get("name"));
                        // MenuHandler.handleMenu(p);
                        Application.defaultViewNavigationTree.getTree()
                                .getSelectionModel().select(p, false);
                        Application.defaultViewNavigationTree.getTree()
                                .setExpanded(p, true);
                    }
                });

Finally I found the solution.

ANSWER:
Source: http://minimalbugs.com/questions/disable-line-wrapping-in-eclipse

You can’t disable line wrapping, but you can add more maximum characters to appear in a single line, by accessing :
  • Window – Preferences – Java – Code Style – Formatter – Edit
  • Insert New profile name because you can’t edit the default profile
  • Click Line wrapping tab in the maximum width, put the maximum character you wanted to be appeared in a single line
After :

adminTree.addListener(Events.OnDoubleClick, new Listener<TreePanelEvent<ModelData>>() {

            @SuppressWarnings("unchecked")
            @Override
            public void handleEvent(TreePanelEvent<ModelData> be) {
                ModelData p = be.getItem();
                System.out.println(p.get("name"));
                // MenuHandler.handleMenu(p);
                Application.defaultViewNavigationTree.getTree().getSelectionModel().select(p, false);
                Application.defaultViewNavigationTree.getTree().setExpanded(p, true);
            }
        });

0

OCI_INVALID_HANDLE (ext\pdo_oci\oci_driver.c:579)

In my project, I need to pull data from Oracle Server.
I need to enable oci8 and PDO_OCI extensions but there is a problem since PHP couldn't find OCI.dll.
I had downloaded the oracle Instant Client, extract and copy the oci.dll file to windows folder and successfully enable the extension. But when I tried to connect to the server, PHP gave me this error message:

OCI_INVALID_HANDLE (ext\pdo_oci\oci_driver.c:579)

So, I take a look on oracle Instant Client installation manual. Actually, it's very simple solution.

How to solve :
  1. Set the variable ORACLE_HOME in the Windows environment setting  to the path of the extracted Oracle Instant Client folder.
  2. Restart Apache
It works.
 
Copyright © peyotest