Thursday, July 31, 2008

Fortunate & Success

I partially agree with the assertion that most important discoveries or creation are random and maybe you find the best solution to another problem that is always not resolved in the world while seeking the answer to one question".After all , as the saying goes that experiences cover a multitude of treasures in life, every success is supposed to be based on a large amount of accumulation and wisdom from the forerunners or before at the expense of the tremendous devotion of time and energy. The proverb that 99 percent industriness and 1 percent fortunate make the full contributions to the final success demonstrates that the creations or important discoveries actually are not accidental, it is the accumaltion of personal payment reachs the point of the change of the nature.To begin with, looking backing the stream of the history, there is no denying that the most important discoveries or creations are made by the persons that have sufficient background knowledge in their research domain as experts and strong desire to change the world in pursuit of exploring the unknown world.After numberless attempts to make experiments on the relevant field , the emergement of the inspiration absolutely depends on the prior exploration and critical thinking rather than fortunate . Besides , we can not emphasize on the importance of the hard work too much .A accomplised software engineer must be equipped with enough fundamental knowledge such as basic knowledge ,software design and specification , database ,net working and so on . Such important are these beyond the successful software engineer ' requirements that the practical experience is significantly important to the development in the software engineer's career.They are allowed to throw themselves into the real project and communicate with customers based on their accumulated theory and knolwdge during 10 years or longer . However , they are unable to ensure that they will be succeed in the project and make achievements in that they always conform to the routine and the conventional approach from the beginning to the end. Assuming that they have no project experience and essential theoretical knowldege , they will destined to fail in the project let alone the creation and important reform for the software field.Therefore, i cling to the belief that your hard work can not determine your future success or creation ,but your indolence destinied your failure.Finally, We are not supposed to sharpely emphasize on the relationship betwwwn fortunate and success, and concede that the creative ideas can be only from geniu. Equally, genius is equivalent to the addition of the hard work and only 1 percent chance.
To sum up, the possiblity that while seeking the answer to one question that we come across the answer to another doesn't indicate that the fortunate truely occupies the large portion of the success or creations. Any qualitative transformation of outstanding achievements comes from quantitative accumulation.

Wednesday, July 30, 2008

Item Providers learning in EMF

Item providers need to perform four major roles:
1.Implement content and label provider functions
2.Provide a property source (property descriptors) for EMF objects
3.Act as a command factory for commands on their associated model objects
4.Forward EMF model change notifications on to viewers

Tuesday, July 29, 2008

Decorator of FilterInputStream in Java I/O

import java.io.*;

public class InputTest {
public static void main(String[] args) throws IOException {
int c;

try {
InputStream in =
new LowerCaseInputStream(
new BufferedInputStream(
new FileInputStream("DiagramEditor.java")));

while((c = in.read()) >= 0) {
System.out.print((char)c);
}

in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
public class LowerCaseInputStream extends FilterInputStream {


/** Decorator Type that maintains a reference of Decorated component
is consistent with Decorated component Type
*/
public LowerCaseInputStream(InputStream in) {
super(in);
}

public int read() throws IOException {
int c = super.read();
return (c == -1 ? c : Character.toLowerCase((char)c));
}

public int read(byte[] b, int offset, int len) throws IOException {
int result = super.read(b, offset, len);
for (int i = offset; i <>
/*****************************Java API --read()************************************* InputStream
FileInputStream StringBufferInputStream ByteArrayInputStream FilterInputStream
PushbackInputStream BufferedInputStream DataInputStream LineNumberInputStream
read
public int read(byte[] b,
int off,
int len)
throws IOException
reads up to len bytes of data from the input stream into an array of bytes. An attempt is made to read as many as len bytes, but a smaller number may be read, possibly zero. The number of bytes actually read is returned as an integer.
This method blocks until input data is available, end of file is detected, or an exception is thrown.

If b is null, a NullPointerException is thrown.

If off is negative, or len is negative, or off+len is greater than the length of the array b, then an IndexOutOfBoundsException is thrown.

If len is zero, then no bytes are read and 0 is returned; otherwise, there is an attempt to read at least one byte. If no byte is available because the stream is at end of file, the value -1 is returned; otherwise, at least one byte is read and stored into b.

The first byte read is stored into element b[off], the next one into b[off+1], and so on. The number of bytes read is, at most, equal to len. Let k be the number of bytes actually read; these bytes will be stored in elements b[off] through b[off+k-1], leaving elements b[off+k] through b[off+len-1] unaffected.

In every case, elements b[0] through b[off] and elements b[off+len] through b[b.length-1] are unaffected.

If the first byte cannot be read for any reason other than end of file, then an IOException is thrown. In particular, an IOException is thrown if the input stream has been closed.

The read(b, off, len) method for class InputStream simply calls the method read() repeatedly. If the first such call results in an IOException, that exception is returned from the call to the read(b, off, len) method. If any subsequent call to read() results in a IOException, the exception is caught and treated as if it were end of file; the bytes read up to that point are stored into b and the number of bytes read before the exception occurred is returned. Subclasses are encouraged to provide a more efficient implementation of this method.


Parameters:
b - the buffer into which the data is read.
off - the start offset in array b at which the data is written.
len - the maximum number of bytes to read.
Returns:
the total number of bytes read into the buffer, or -1 if there is no more data because the end of the stream has been reached.
Throws:
IOException - if an I/O error occurs.
NullPointerException - if b is null.
See Also:
read()
*/

DiagramEditor.java

package cn.edu.whu.sklse.aopworkshop.aosa.ui;

import java.util.ArrayList;
import java.util.EventObject;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.draw2d.GroupBoxBorder;
import org.eclipse.draw2d.LightweightSystem;
import org.eclipse.draw2d.PositionConstants;
import org.eclipse.draw2d.Viewport;
import org.eclipse.draw2d.parts.ScrollableThumbnail;
import org.eclipse.gef.ContextMenuProvider;
import org.eclipse.gef.DefaultEditDomain;
import org.eclipse.gef.GraphicalViewer;
import org.eclipse.gef.KeyHandler;
import org.eclipse.gef.KeyStroke;
import org.eclipse.gef.LayerConstants;
import org.eclipse.gef.MouseWheelHandler;
import org.eclipse.gef.MouseWheelZoomHandler;
import org.eclipse.gef.SnapToGeometry;
import org.eclipse.gef.SnapToGrid;
import org.eclipse.gef.dnd.TemplateTransferDragSourceListener;
import org.eclipse.gef.editparts.ScalableRootEditPart;
import org.eclipse.gef.editparts.ZoomManager;
import org.eclipse.gef.palette.CombinedTemplateCreationEntry;
import org.eclipse.gef.palette.ConnectionCreationToolEntry;
import org.eclipse.gef.palette.CreationToolEntry;
import org.eclipse.gef.palette.MarqueeToolEntry;
import org.eclipse.gef.palette.PaletteDrawer;
import org.eclipse.gef.palette.PaletteRoot;
import org.eclipse.gef.palette.PaletteSeparator;
import org.eclipse.gef.palette.PanningSelectionToolEntry;
import org.eclipse.gef.palette.ToolEntry;
import org.eclipse.gef.requests.SimpleFactory;
import org.eclipse.gef.rulers.RulerProvider;
import org.eclipse.gef.ui.actions.ActionRegistry;
import org.eclipse.gef.ui.actions.AlignmentAction;
import org.eclipse.gef.ui.actions.DirectEditAction;
import org.eclipse.gef.ui.actions.GEFActionConstants;
import org.eclipse.gef.ui.actions.ToggleGridAction;
import org.eclipse.gef.ui.actions.ToggleSnapToGeometryAction;
import org.eclipse.gef.ui.actions.ZoomInAction;
import org.eclipse.gef.ui.actions.ZoomOutAction;
import org.eclipse.gef.ui.palette.PaletteViewer;
import org.eclipse.gef.ui.palette.PaletteViewerProvider;
import org.eclipse.gef.ui.palette.FlyoutPaletteComposite.FlyoutPreferences;
import org.eclipse.gef.ui.parts.ContentOutlinePage;
import org.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette;
import org.eclipse.gef.ui.parts.GraphicalViewerKeyHandler;
import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer;
import org.eclipse.gef.ui.parts.TreeViewer;
import org.eclipse.gef.ui.rulers.RulerComposite;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.part.IPageSite;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;

import cn.edu.whu.sklse.aopworkshop.aosa.AosaPlugin;
import cn.edu.whu.sklse.aopworkshop.aosa.Application;
import cn.edu.whu.sklse.aopworkshop.aosa.constants.DiagramPaletteStrings;
import cn.edu.whu.sklse.aopworkshop.aosa.constants.IIconNames;
import cn.edu.whu.sklse.aopworkshop.aosa.models.ArrowConnectionModel;
import cn.edu.whu.sklse.aopworkshop.aosa.models.AspectComponentModel;
import cn.edu.whu.sklse.aopworkshop.aosa.models.CombinationConnectionModel;
import cn.edu.whu.sklse.aopworkshop.aosa.models.ComponentModel;
import cn.edu.whu.sklse.aopworkshop.aosa.models.ConnectorModel;
import cn.edu.whu.sklse.aopworkshop.aosa.models.CrosscutConnectionModel;
import cn.edu.whu.sklse.aopworkshop.aosa.models.CrosscutInterfaceComponentModel;
import cn.edu.whu.sklse.aopworkshop.aosa.models.InOutConnectionModel;
import cn.edu.whu.sklse.aopworkshop.aosa.models.InterfaceComponentModel;
import cn.edu.whu.sklse.aopworkshop.aosa.models.LogicRuler;
import cn.edu.whu.sklse.aopworkshop.aosa.models.NoteComponentModel;
import cn.edu.whu.sklse.aopworkshop.aosa.models.ParentModel;
import cn.edu.whu.sklse.aopworkshop.aosa.models.LineConnectionModel;
import cn.edu.whu.sklse.aopworkshop.aosa.models.WhiteInterfaceComponentModel;
import cn.edu.whu.sklse.aopworkshop.aosa.parts.PartFactory;
import cn.edu.whu.sklse.aopworkshop.aosa.parts.TreeEditPartFactory;
import cn.edu.whu.sklse.aopworkshop.aosa.rulers.LogicRulerProvider;

/**
* @author Terry Qu
*
*/
public class DiagramEditor extends GraphicalEditorWithFlyoutPalette {

/**
*
*/
public static final String ID = "cn.edu.whu.sklse.aopworkshop.aosa.ui.DiagramEditor";

GraphicalViewer diagramViewer;

private ParentModel parentModel;

public DiagramEditor() {
super();
setEditDomain(new DefaultEditDomain(this));
}

protected void loadProperties() {

}

/*
* (non-Javadoc)
*
* @see org.eclipse.gef.ui.parts.GraphicalEditor#initializeGraphicalViewer()
*/
protected void initializeGraphicalViewer() {
diagramViewer = getGraphicalViewer();
diagramViewer.setProperty(SnapToGrid.PROPERTY_GRID_ENABLED,
new Boolean(true));
// We keep grid visibility and enablement in sync
diagramViewer.setProperty(SnapToGrid.PROPERTY_GRID_VISIBLE,
new Boolean(true));
diagramViewer.setProperty(SnapToGeometry.PROPERTY_SNAP_ENABLED,
new Boolean(true));

// diagramViewer.setProperty(RulerProvider.PROPERTY_VERTICAL_RULER,new
// SubjectRulerProvider(diagram.getLeftRuler()));
// diagramViewer().setProperty(RulerProvider.PROPERTY_HORIZONTAL_RULER,
// new SubjectRulerProvider(diagram.getTopRuler()));
// diagramViewer().setProperty(RulerProvider.PROPERTY_RULER_VISIBILITY,new
// Boolean(diagram.isRulerVisibility()));
//
// // Ruler properties
// LogicRuler ruler = diagramViewer().getRuler(PositionConstants.WEST);
// RulerProvider provider = null;
// if (ruler != null) {
// provider = new LogicRulerProvider(ruler);
// }
// getGraphicalViewer().setProperty(RulerProvider.PROPERTY_VERTICAL_RULER,
// provider);
// ruler = getLogicDiagram().getRuler(PositionConstants.NORTH);
// provider = null;
// if (ruler != null) {
// provider = new LogicRulerProvider(ruler);
// }
// getGraphicalViewer().setProperty(RulerProvider.PROPERTY_HORIZONTAL_RULER,
// provider);
// getGraphicalViewer().setProperty(RulerProvider.PROPERTY_RULER_VISIBILITY,
// new Boolean(getLogicDiagram().getRulerVisibility()));
// Ruler properties
///%%%%%%%%%%%%%%
LogicRuler ruler = new LogicRuler(true);
RulerProvider provider = null;
if (ruler != null) {
provider = new LogicRulerProvider(ruler);
}
getGraphicalViewer().setProperty(RulerProvider.PROPERTY_VERTICAL_RULER,
provider);
ruler = new LogicRuler(true);
provider = null;
if (ruler != null) {
provider = new LogicRulerProvider(ruler);
}
getGraphicalViewer().setProperty(
RulerProvider.PROPERTY_HORIZONTAL_RULER, provider);
getGraphicalViewer().setProperty(
RulerProvider.PROPERTY_RULER_VISIBILITY, new Boolean(true));

parentModel = new ParentModel();
// ComponentModel componentModel_1 = new ComponentModel();
// componentModel_1.setRectConstraint(new Rectangle(0, 0, -1, -1));
//
// InterfaceComponentModel inter = new InterfaceComponentModel();
// inter.setConstraint(new Rectangle(30, 30, -1, -1));
// NoteComponentModel noteComponentModel = new NoteComponentModel();
// noteComponentModel.setRecConstraint(new Rectangle(80, 80, 80,50));
// parentModel.addChild(componentModel_1);
// parentModel.addChild(inter);
// parentModel.addChild(noteComponentModel);
diagramViewer.setContents(parentModel);
diagramViewer.setProperty(MouseWheelHandler.KeyGenerator
.getKey(SWT.MOD1), MouseWheelZoomHandler.SINGLETON);
}

/*
* (non-Javadoc)
*
* @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
*/
public void doSave(IProgressMonitor monitor) {
// TODO Auto-generated method stub
getCommandStack().markSaveLocation();
}

/*
* (non-Javadoc)
*
* @see org.eclipse.ui.part.EditorPart#doSaveAs()
*/
public void doSaveAs() {
// TODO Auto-generated method stub

}

public boolean isDirty() {
return getCommandStack().isDirty();// true * dirty
}

//
public void commandStackChanged(EventObject event) {
firePropertyChange(IEditorPart.PROP_DIRTY);

super.commandStackChanged(event);
}

/*
* (non-Javadoc)
*
* @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
*/
public boolean isSaveAsAllowed() {
// TODO Auto-generated method stub
return false;
}

// getGraphicalControl RulerComposite

// 配置GraphicalViewer
// 把自定义的PartFactory映射到GraphicalViewer上的EditPartFactory
protected void configureGraphicalViewer() {
super.configureGraphicalViewer();
diagramViewer = getGraphicalViewer();
diagramViewer.setEditPartFactory(new PartFactory());
IEditorSite editorSite = getEditorSite();

// create keyboard operation keyhandler
KeyHandler keyHandler = new KeyHandler();

keyHandler.put(KeyStroke.getPressed(SWT.DEL, 127, 0),
getActionRegistry().getAction(GEFActionConstants.DELETE));
keyHandler.put(KeyStroke.getPressed(SWT.F3, 0), getActionRegistry()
.getAction(GEFActionConstants.DIRECT_EDIT));
keyHandler.put(KeyStroke.getPressed(SWT.INSERT, 0), getActionRegistry()
.getAction(GEFActionConstants.EDIT_START));
// getGraphicalViewer().setKeyHandler(keyHandler);
getGraphicalViewer().setKeyHandler(
new GraphicalViewerKeyHandler(getGraphicalViewer())
.setParent(keyHandler));

ContextMenuProvider provider = new DiagramEditorContextMenuProvider(
diagramViewer, getActionRegistry());
diagramViewer.setContextMenu(provider);
getSite().registerContextMenu(
"cn.whu.sklse.aopworkshop.aoso.diagrameditor.contextmenu",
provider, diagramViewer);
ScalableRootEditPart rootEditPart = new ScalableRootEditPart();
diagramViewer.setRootEditPart(rootEditPart);
// get a ZoomManager
ZoomManager manager = rootEditPart.getZoomManager();
//
double[] zoomLevels = new double[] {
// 252000
0.25, 0.5, 0.75, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0, 10.0, 20.0 };
manager.setZoomLevels(zoomLevels); //

//
ArrayList zoomContributions = new ArrayList();
zoomContributions.add(ZoomManager.FIT_ALL);
zoomContributions.add(ZoomManager.FIT_HEIGHT);
zoomContributions.add(ZoomManager.FIT_WIDTH);
manager.setZoomLevelContributions(zoomContributions);
// magnify
IAction zoomIn = new ZoomInAction(manager);

getActionRegistry().registerAction(zoomIn);
// shrink
IAction zoomOut = new ZoomOutAction(manager);

getActionRegistry().registerAction(zoomOut);
getSite().getKeyBindingService().registerAction(zoomIn);
getSite().getKeyBindingService().registerAction(zoomOut);
IAction showGrid = new ToggleGridAction(diagramViewer);
showGrid.setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(
Application.PLUGIN_ID, "icons/help.gif"));
showGrid.setToolTipText("show a grid on the background");
getActionRegistry().registerAction(showGrid);
IAction snapAction = new ToggleSnapToGeometryAction(diagramViewer);
getActionRegistry().registerAction(snapAction);
}

/**
* A generic selection tool.
*/
private static ToolEntry _selectionTool = new PanningSelectionToolEntry(
DiagramPaletteStrings.SELECTION_LABEL,
DiagramPaletteStrings.SELECTION_DESCRIPTION);

/**
* @return The generic selection tool.
*/
public static ToolEntry getSelectionTool() {
return _selectionTool;
}

/*
* (non-Javadoc)
*
* @see org.eclipse.gef.ui.parts.GraphicalEditorWithPalette#getPaletteRoot()
*/
protected PaletteRoot getPaletteRoot() {
// TODO Auto-generated method stub
PaletteRoot paletteRoot = new PaletteRoot();
// PaletteGroup tools = new
// PaletteGroup(DiagramPaletteStrings.GROUP_MAIN_LABEL);
paletteRoot.setDefaultEntry(getSelectionTool());
ToolEntry marqueeTool = new MarqueeToolEntry();
ImageDescriptor descriptor = AbstractUIPlugin
.imageDescriptorFromPlugin(Application.PLUGIN_ID,
IIconNames.COMPONENT_MODEL);

//notation
ImageDescriptor noteDescriptor = AbstractUIPlugin
.imageDescriptorFromPlugin(Application.PLUGIN_ID,
IIconNames.NOTE_COMPONENT_MODEL);
CombinedTemplateCreationEntry combinedTemplateCreationEntry = new CombinedTemplateCreationEntry(
"Notation", "make notations for graphs", NoteComponentModel.class,
new SimpleFactory(NoteComponentModel.class), noteDescriptor, noteDescriptor);

//provided port
ImageDescriptor interDescriptor = AbstractUIPlugin
.imageDescriptorFromPlugin(Application.PLUGIN_ID,
IIconNames.INTERFACE_COMPONENT_MODEL);
CombinedTemplateCreationEntry interTemplateCreationEntry = new CombinedTemplateCreationEntry(
"provided port ", "create a provided port ",InterfaceComponentModel.class,
new SimpleFactory(InterfaceComponentModel.class),
interDescriptor, interDescriptor);

//connector
ImageDescriptor connectorDescriptor = AbstractUIPlugin
.imageDescriptorFromPlugin(Application.PLUGIN_ID,
IIconNames.INTERFACE_COMPONENT_MODEL);
CombinedTemplateCreationEntry connectTemplateCreationEntry = new CombinedTemplateCreationEntry(
"connector ", "create a connector used by kinds of components",ConnectorModel.class,
new SimpleFactory(ConnectorModel.class),
connectorDescriptor, connectorDescriptor);

//aspect
ImageDescriptor aspectDescriptor = AbstractUIPlugin
.imageDescriptorFromPlugin(Application.PLUGIN_ID,
IIconNames.ASPECT_COMPONENT_MODEL);
CombinedTemplateCreationEntry aspectTemplateCreationEntry = new CombinedTemplateCreationEntry(
"Aspect Component ", "create a aspect component used ",AspectComponentModel.class,
new SimpleFactory(AspectComponentModel.class),
aspectDescriptor, aspectDescriptor);

ImageDescriptor whiteInterDescriptor = AbstractUIPlugin
.imageDescriptorFromPlugin(Application.PLUGIN_ID,
IIconNames.WHITE_INTERFACE_COMPONENT_MODEL);
CombinedTemplateCreationEntry whiteInterTemplateCreationEntry = new CombinedTemplateCreationEntry(
"required port ", "create a required port ",WhiteInterfaceComponentModel.class,
new SimpleFactory(WhiteInterfaceComponentModel.class),
whiteInterDescriptor, whiteInterDescriptor);

ImageDescriptor cutInterDescriptor = AbstractUIPlugin
.imageDescriptorFromPlugin(Application.PLUGIN_ID,
IIconNames.CROSSCUT_INTERFACE_COMPONENT_MODEL);
CombinedTemplateCreationEntry cutInterTemplateCreationEntry = new CombinedTemplateCreationEntry(
"crosscutting port ", "create a crosscutting port ",CrosscutInterfaceComponentModel.class,
new SimpleFactory(CrosscutInterfaceComponentModel.class),
cutInterDescriptor, cutInterDescriptor);
/////////////drawer
PaletteDrawer drawer = new PaletteDrawer(
DiagramPaletteStrings.DRAWER_LABEL);

CreationToolEntry creationToolEntry = new CreationToolEntry(
"Base Commponent", "create a base component", new SimpleFactory(
ComponentModel.class), descriptor, descriptor);
drawer.add(creationToolEntry);


// ConnectionCreationToolEntry noteCreationToolEntry = new ConnectionCreationToolEntry(
// "Notation ", "make notations for graphs",
// new SimpleFactory(NoteComponentModel.class),
// noteDescriptor, noteDescriptor);


ImageDescriptor descriptorRelationship = AbstractUIPlugin
.imageDescriptorFromPlugin(Application.PLUGIN_ID,
IIconNames.RELATIONSHIP_MODEL);
ConnectionCreationToolEntry conCreationToolEntry = new ConnectionCreationToolEntry(
"association ", "create a association among components and connectors ", new SimpleFactory(
LineConnectionModel.class), descriptorRelationship,
descriptorRelationship);
drawer.add(conCreationToolEntry);
drawer.add(new PaletteSeparator());
ImageDescriptor arrowDescriptor = AbstractUIPlugin
.imageDescriptorFromPlugin(Application.PLUGIN_ID,
IIconNames.ARROW_RELATIONSHIP_MODEL);
ConnectionCreationToolEntry arrowConCreationToolEntry = new ConnectionCreationToolEntry(
"arrow connector", "create a arrow connector ",
new SimpleFactory(ArrowConnectionModel.class), arrowDescriptor,
arrowDescriptor);
drawer.add(arrowConCreationToolEntry);

ImageDescriptor crosscutDescriptor = AbstractUIPlugin
.imageDescriptorFromPlugin(Application.PLUGIN_ID,
IIconNames.CROSSCUT_RELATIONSHIP_MODEL);
ConnectionCreationToolEntry crosscutConCreationToolEntry = new ConnectionCreationToolEntry(
"crosscutting ", "create a crosscutting relationship ",
new SimpleFactory(CrosscutConnectionModel.class),
crosscutDescriptor, crosscutDescriptor);
drawer.add(crosscutConCreationToolEntry);
ImageDescriptor inoutDescriptor = AbstractUIPlugin
.imageDescriptorFromPlugin(Application.PLUGIN_ID,
IIconNames.IN_OUT_RELATIONSHIP_MODEL);
ConnectionCreationToolEntry inoutConCreationToolEntry = new ConnectionCreationToolEntry(
"in-out relationship ", "create an inner-outter relationship ",
new SimpleFactory(InOutConnectionModel.class),
inoutDescriptor, inoutDescriptor);
drawer.add(inoutConCreationToolEntry);

ImageDescriptor combinationDescriptor = AbstractUIPlugin
.imageDescriptorFromPlugin(Application.PLUGIN_ID,
IIconNames.COMBINATION_RELATIONSHIP_MODEL);
ConnectionCreationToolEntry combinationConCreationToolEntry = new ConnectionCreationToolEntry(
"combination relationship ", "combination relationship between BaseRole and CrosscutRole ",
new SimpleFactory(CombinationConnectionModel.class),
combinationDescriptor, combinationDescriptor);
drawer.add(combinationConCreationToolEntry);





/***********************************************************************
* commono tool
*/
PaletteDrawer commonDrawer = new PaletteDrawer(
DiagramPaletteStrings.COMMON_DRAWER_LABEL);
commonDrawer.add(getSelectionTool());
commonDrawer.add(marqueeTool);
commonDrawer.add(aspectTemplateCreationEntry);
commonDrawer.add(connectTemplateCreationEntry);
commonDrawer.add(combinedTemplateCreationEntry);
commonDrawer.add(interTemplateCreationEntry);
commonDrawer.add(whiteInterTemplateCreationEntry);
commonDrawer.add(cutInterTemplateCreationEntry);

paletteRoot.add(commonDrawer);
paletteRoot.add(drawer);
return paletteRoot;
}

/**
* keyboard operation override method
*
*/
protected void createActions() {
super.createActions();
ActionRegistry registry = getActionRegistry();

// registry DirectEditAction
IAction action = new DirectEditAction((IWorkbenchPart) this);
registry.registerAction(action);

getSelectionActions().add(action.getId());

//
// action = new
// ZoomOutAction(((ScalableRootEditPart)diagramViewer.getRootEditPart()).getZoomManager());
// action.setId(GEFActionConstants.ZOOM_OUT);
// registry.registerAction(action);
// getSelectionActions().add(action.getId());
// action = new
// ZoomInAction(((ScalableRootEditPart)diagramViewer.getRootEditPart()).getZoomManager());
// action.setId(GEFActionConstants.ZOOM_IN);
// registry.registerAction(action);
// getSelectionActions().add(action.getId());
action = new AlignmentAction((IWorkbenchPart) this,
PositionConstants.LEFT);
registry.registerAction(action);
getSelectionActions().add(action.getId());

action = new AlignmentAction((IWorkbenchPart) this,
PositionConstants.CENTER);
registry.registerAction(action);
getSelectionActions().add(action.getId());

action = new AlignmentAction((IWorkbenchPart) this,
PositionConstants.RIGHT);
registry.registerAction(action);
getSelectionActions().add(action.getId());

//
action = new AlignmentAction((IWorkbenchPart) this,
PositionConstants.TOP);
registry.registerAction(action);
getSelectionActions().add(action.getId());

action = new AlignmentAction((IWorkbenchPart) this,
PositionConstants.MIDDLE);
registry.registerAction(action);
getSelectionActions().add(action.getId());

action = new AlignmentAction((IWorkbenchPart) this,
PositionConstants.BOTTOM);
registry.registerAction(action);
getSelectionActions().add(action.getId());
}

/**
* ZoomComboContributionItem
*/
// override
public Object getAdapter(Class type) {
if (type == ZoomManager.class)
return ((ScalableRootEditPart) getGraphicalViewer()
.getRootEditPart()).getZoomManager();
if (type == IContentOutlinePage.class) {
return new CustomContentOutlinePage();
}
return super.getAdapter(type);
}

/**
* outline
*/
// ContentOutlinePage
class CustomContentOutlinePage extends ContentOutlinePage {

public CustomContentOutlinePage() {
super(new TreeViewer());
// TODO Auto-generated constructor stub
}

// SashForm Outline
private SashForm sash;

private ScrollableThumbnail thumbnail;

private DisposeListener disposeListener;

//
public void createControl(Composite parent) {
// SashForm
sash = new SashForm(parent, SWT.VERTICAL);
//
getViewer().createControl(sash);

// Edit Domain
getViewer().setEditDomain(getEditDomain());
// set EditPartFactory
getViewer().setEditPartFactory(new TreeEditPartFactory());
// outline--->ParentModel
getViewer().setContents(parentModel);
// synchronize
getSelectionSynchronizer().addViewer(getViewer());

Canvas canvas = new Canvas(sash, SWT.BORDER);
// LightweightSystem
LightweightSystem lws = new LightweightSystem(canvas);

// RootEditPart
thumbnail = new ScrollableThumbnail(
(Viewport) ((ScalableRootEditPart) getGraphicalViewer()
.getRootEditPart()).getFigure());
thumbnail.setBorder(new GroupBoxBorder("Thumbnail"));
// thumbnail.setBorder(new MarginBorder(3));
thumbnail.setSource(((ScalableRootEditPart) getGraphicalViewer()
.getRootEditPart())
.getLayer(LayerConstants.PRINTABLE_LAYERS));

lws.setContents(thumbnail);

disposeListener = new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
//
if (thumbnail != null) {
thumbnail.deactivate();
thumbnail = null;
}
}
};
// Graphical Viewer thumbnail
getGraphicalViewer().getControl().addDisposeListener(
disposeListener);
}

public Control getControl() {
// outline 为active
return sash;
}

public void dispose() {
// TreeViewer SelectionSynchronizer
getSelectionSynchronizer().removeViewer(getViewer());
if (getGraphicalViewer().getControl() != null
&& !getGraphicalViewer().getControl().isDisposed())
getGraphicalViewer().getControl().removeDisposeListener(
disposeListener);
super.dispose();

}

public void init(IPageSite pageSite) {
super.init(pageSite);
// graphical editor Action
ActionRegistry registry = getActionRegistry();
// Action
IActionBars bars = pageSite.getActionBars();

String id = IWorkbenchActionConstants.UNDO;
bars.setGlobalActionHandler(id, registry.getAction(id));

id = IWorkbenchActionConstants.REDO;
bars.setGlobalActionHandler(id, registry.getAction(id));

id = IWorkbenchActionConstants.DELETE;
bars.setGlobalActionHandler(id, registry.getAction(id));
bars.updateActionBars();
}

}

protected FlyoutPreferences getPalettePreferences() {
return new FlyoutPreferences() {

public int getDockLocation() {
return
// AosaPlugin.getDefault().getPreferenceStore().getInt(IConstants.PREF_PALETTE_DOCK_LOCATION);
AosaPlugin.getDefault().getPreferenceStore().getInt("pre");
}

public void setDockLocation(int location) {
AosaPlugin.getDefault().getPreferenceStore().setValue("pre",
location);
}

public int getPaletteState() {
return 0;
}

public int getPaletteWidth() {
return 0;
}

public void setPaletteState(int arg0) {

}

public void setPaletteWidth(int arg0) {
}
};
}

protected PaletteViewerProvider createPaletteViewerProvider() {
return new PaletteViewerProvider(getEditDomain()) {
protected void configurePaletteViewer(PaletteViewer viewer) {
super.configurePaletteViewer(viewer);
viewer
.addDragSourceListener(new TemplateTransferDragSourceListener(
viewer));
}
};
}

/*
* (non-Javadoc)
*
* @see org.eclipse.gef.ui.parts.GraphicalEditor#createGraphicalViewer(org.eclipse.swt.widgets.Composite)
*/
private RulerComposite rulerComp;

protected void createGraphicalViewer(Composite parent) {
rulerComp = new RulerComposite(parent, SWT.NONE);
super.createGraphicalViewer(rulerComp);
rulerComp
.setGraphicalViewer((ScrollingGraphicalViewer) getGraphicalViewer());
}

// getGraphicalControl RulerComposite

protected Control getGraphicalControl() {
return rulerComp;
}
}

Serializable Problem in GEF

public abstract class Element implements IPropertySource, Cloneable, Serializable {

PropertyChangeSupport listeners = new PropertyChangeSupport(this);

private static final long serialVersionUID = 1;

/** An empty property descriptor. */
private static final IPropertyDescriptor[] EMPTY_ARRAY = new IPropertyDescriptor[0];

public void addPropertyChangeListener(PropertyChangeListener l) {
listeners.addPropertyChangeListener(l);
}

protected void firePropertyChange(String prop, Object old, Object newValue) {
listeners.firePropertyChange(prop, old, newValue);
}

protected void fireStructureChange(String prop, Object child) {
listeners.firePropertyChange(prop, null, child);
}
////
/**
* Returns a value for this property source that can be edited in a property sheet.
*

My personal rule of thumb:


*

    *
  • model elements should return themselves and

  • *
  • custom IPropertySource implementations (like DimensionPropertySource in the GEF-logic
    * example) should return an editable value.

  • *

*

Override only if necessary.


* @return this instance
*/
public Object getEditableValue() {
return this;
}

private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject();
listeners = new PropertyChangeSupport(this);
}

public void removePropertyChangeListener(PropertyChangeListener l) {
listeners.removePropertyChangeListener(l);
}

/**
* Children should override this. The default implementation returns an empty array.
*/
public IPropertyDescriptor[] getPropertyDescriptors() {
return EMPTY_ARRAY;
}

/**
* Children should override this. The default implementation does nothing.
*/
public void resetPropertyValue(Object id) {
// do nothing
}

/**
* Children should override this. The default implementation does nothing.
*/
public void setPropertyValue(Object id, Object value) {
// do nothing
}

/**
* Children should override this. The default implementation returns null.
*/
public Object getPropertyValue(Object id) {
return null;
}

/**
* Children should override this. The default implementation returns false.
*/
public boolean isPropertySet(Object id) {
return false;
}

/*
* Created on 2005-1-24
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package com.example.ui;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.gef.DefaultEditDomain;
import org.eclipse.gef.dnd.TemplateTransferDragSourceListener;
import org.eclipse.gef.editparts.ScalableFreeformRootEditPart;
//import org.eclipse.gef.examples.shapes.model.ShapesDiagram;
//import org.eclipse.gef.examples.flow.model.ActivityDiagram;
import org.eclipse.gef.palette.PaletteRoot;
import org.eclipse.gef.ui.actions.ActionRegistry;
import org.eclipse.gef.ui.parts.ContentOutlinePage;
import org.eclipse.gef.ui.parts.GraphicalEditorWithPalette;
import org.eclipse.gef.ui.parts.TreeViewer;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
import org.eclipse.ui.dialogs.SaveAsDialog;
import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.ui.part.IPageSite;
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;

import com.example.dnd.DiagramTemplateTransferDropTargetListener;
import com.example.model.Diagram;
import com.example.parts.PartFactory;
import com.example.parts.TreePartFactory;
import com.example.tools.PaletteFactory;


public class PracticeEditor extends GraphicalEditorWithPalette {

private Diagram diagram = new Diagram();

private PaletteRoot paletteRoot;

public Diagram getDiagram() {
return this.diagram;
}

public PracticeEditor() {
setEditDomain(new DefaultEditDomain(this));
}

protected void createOutputStream(OutputStream os) throws IOException {
ObjectOutputStream out = new ObjectOutputStream(os);
out.writeObject(diagram);
out.close();
}

protected void configureGraphicalViewer() {
super.configureGraphicalViewer();
getGraphicalViewer().setRootEditPart(new ScalableFreeformRootEditPart());
getGraphicalViewer().setEditPartFactory(new PartFactory());
}

protected void initializeGraphicalViewer() {
getGraphicalViewer().setContents(this.diagram);
getGraphicalViewer().addDropTargetListener(new DiagramTemplateTransferDropTargetListener(getGraphicalViewer()));
}

public void doSave(IProgressMonitor monitor) {
// try {
// InputStream in = diagram.getAsStream();
// IFile file = ((IFileEditorInput)getEditorInput()).getFile();
// file.setContents(in, true, false, monitor);
// getCommandStack().markSaveLocation();
// }
// catch (Exception e) {
// e.printStackTrace();
// }
try{
ByteArrayOutputStream out = new ByteArrayOutputStream();
createOutputStream(out);
IFile file = ((IFileEditorInput)getEditorInput()).getFile();
file.setContents(new ByteArrayInputStream(out.toByteArray()),
true, false, monitor);
out.close();
getCommandStack().markSaveLocation();
}
catch (Exception e) {
e.printStackTrace();
}
}

public void doSaveAs() {
SaveAsDialog dialog= new SaveAsDialog(getSite().getWorkbenchWindow().getShell());
dialog.setOriginalFile(((IFileEditorInput)getEditorInput()).getFile());
dialog.open();
IPath path= dialog.getResult();

if (path == null)
return;

IWorkspace workspace= ResourcesPlugin.getWorkspace();
final IFile file= workspace.getRoot().getFile(path);

WorkspaceModifyOperation op= new WorkspaceModifyOperation() {
public void execute(final IProgressMonitor monitor) throws CoreException {
try {
ByteArrayOutputStream out = new ByteArrayOutputStream();
createOutputStream(out);
file.create(new ByteArrayInputStream(out.toByteArray()), true, monitor);
out.close();
}
catch (Exception e) {
e.printStackTrace();
}
}
};

try {
new ProgressMonitorDialog(getSite().getWorkbenchWindow().getShell()).run(false, true, op);
setInput(new FileEditorInput((IFile)file));
getCommandStack().markSaveLocation();
}
catch (Exception e) {
e.printStackTrace();
}
}

public boolean isDirty() {
return getCommandStack().isDirty();
}

public boolean isSaveAsAllowed() {
return true;
}

protected void setInput(IEditorInput input) {
// super.setInput(input);
// try {
// IFile file = ((IFileEditorInput) input).getFile();
// ObjectInputStream in = new ObjectInputStream(file.getContents());
// diagram = (Diagram) in.readObject();
// in.close();
// setPartName(file.getName());
// }
// catch (Exception e) {
// //This is just an example. All exceptions caught here.
// e.printStackTrace();
// diagram = new Diagram();
// }

// super.setInput(input);
//
// IFile file = ((IFileEditorInput)input).getFile();
// try {
// InputStream is = file.getContents(false);
// ObjectInputStream ois = new ObjectInputStream(is);
// diagram = (Diagram)ois.readObject();
// ois.close();
// } catch (Exception e) {
// //This is just an example. All exceptions caught here.
// e.printStackTrace();
// diagram = new Diagram();
// }

super.setInput(input);

IFile file = ((IFileEditorInput) input).getFile();
// diagram = new Diagram();
try { // attempt to read from a file
InputStream istream = file.getContents(false);
diagram = Diagram.makeFromStream(istream);
} catch (Exception e) { // but if there's an error, create a new diagram
e.printStackTrace();
diagram = new Diagram();
}
}

public Object getAdapter(Class type) {
if (type == IContentOutlinePage.class)
return new OutlinePage();
return super.getAdapter(type);
}

protected PaletteRoot getPaletteRoot() {
if (this.paletteRoot == null) {
this.paletteRoot = PaletteFactory.createPalette();
}
return this.paletteRoot;
}

protected void initializePaletteViewer() {
super.initializePaletteViewer();
getPaletteViewer().addDragSourceListener(new TemplateTransferDragSourceListener(getPaletteViewer()));
}

class OutlinePage extends ContentOutlinePage {
// private PageBook pageBook;

private Control outline;

public OutlinePage() {
super(new TreeViewer());
}

public void init(IPageSite pageSite) {
super.init(pageSite);
ActionRegistry registry = getActionRegistry();
IActionBars bars = pageSite.getActionBars();
String id = IWorkbenchActionConstants.UNDO;
bars.setGlobalActionHandler(id, registry.getAction(id));
id = IWorkbenchActionConstants.REDO;
bars.setGlobalActionHandler(id, registry.getAction(id));
id = IWorkbenchActionConstants.DELETE;
bars.setGlobalActionHandler(id, registry.getAction(id));
bars.updateActionBars();
}

public void createControl(Composite parent) {
// pageBook = new PageBook(parent, SWT.NONE);
// outline = getViewer().createControl(pageBook);
// pageBook.showPage(outline);
outline = getViewer().createControl(parent);
getSelectionSynchronizer().addViewer(getViewer());
getViewer().setEditDomain(getEditDomain());
getViewer().setEditPartFactory(new TreePartFactory());
// getViewer().setKeyHandler(getCommonKeyHandler());
getViewer().setContents(getDiagram());
}

public Control getControl() {
// return pageBook;
return outline;
}

public void dispose() {
getSelectionSynchronizer().removeViewer(getViewer());
super.dispose();
}
}

}


java.io.NotSerializableException: org.eclipse.ui.views.properties.TextPropertyDescriptor
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeArray(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
at java.util.ArrayList.writeObject(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
at com.example.ui.PracticeEditor.createOutputStream(PracticeEditor.java:74)
at com.example.ui.PracticeEditor.doSave(PracticeEditor.java:101)
at org.eclipse.ui.internal.SaveableHelper$1.run(SaveableHelper.java:131)
at org.eclipse.ui.internal.SaveableHelper$4.run(SaveableHelper.java:252)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:369)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:313)
at org.eclipse.jface.window.ApplicationWindow$1.run(ApplicationWindow.java:763)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
at org.eclipse.jface.window.ApplicationWindow.run(ApplicationWindow.java:760)
at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2283)
at org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation(SaveableHelper.java:258)
at org.eclipse.ui.internal.SaveableHelper.savePart(SaveableHelper.java:136)
at org.eclipse.ui.internal.EditorManager.savePart(EditorManager.java:1386)
at org.eclipse.ui.internal.WorkbenchPage.savePart(WorkbenchPage.java:2995)
at org.eclipse.ui.internal.WorkbenchPage.saveEditor(WorkbenchPage.java:3008)
at org.eclipse.ui.internal.SaveAction.run(SaveAction.java:67)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:499)
at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:119)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:461)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:424)
at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:160)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:466)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:799)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:846)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:564)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:506)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:122)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Display.filterEvent(Display.java:982)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:927)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:952)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:937)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:965)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:961)
at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1275)
at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:3346)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:3246)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4025)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1925)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2966)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)

Friday, July 25, 2008

Plan for a job

1.Java Exam
2.DataStructure
3.basic algorithms
4.c/c++
5.performance optimization
6.network
7.operating system
8.Linux/Unix
9.Compiler
10.English Interview & SHL

Monday, July 21, 2008

The basics of using XML Schema to define elements






developerWorks > XML >
The basics of using XML Schema to define elements
Get started using XML Schema instead of DTDs for defining the structure of XML documents

The new XML Schema system, now nearing acceptance as a W3C recommendation, aims to provide a rich grammatical structure for XML documents that overcomes the limitations of the DTD (see the sidebar, Limitations of DTDs). This article demonstrates the flexibility of schemas and shows how to define the most fundamental building block of XML documents -- the element -- in the XML Schema system.
XML Schema is more powerful than DTD. To illustrate the power of the XML Schema mechanism, the first three listings briefly compare the different ways of representing elements. Listing 1 shows an excerpt of an XML document. Listing 2 shows these two elements declared in DTD syntax, and Listing 3 consists of the corresponding XML Schema syntax. Note that the syntax in Listing 3 is the same as XML syntax. Through the schema, a validating parser can verify that the element InvoiceNo is a positive integer and the element ProductID consists of one letter between A and Z followed by six digits. By contrast, a validating parser referring to the DTD can only verify that these elements are represented as strings.Listing 1: An XML document fragment
123456789
J123456Listing 2: DTD fragment describing elements in Listing 1

Listing 3: XML Schema fragment describing elements in Listing 1
Using namespaces in XML Schema
In the collaborative world, one person may be processing documents from many other parties and the different parties may want to represent their data elements differently. Moreover, in a single document, they may need to separately refer to elements with the same name that are created by different parties. How can you distinguish between such different definitions with the same name? XML Schema allows the concept of namespaces to distinguish the definitions.
Limitations of DTDs
Although DTDs have served SGML and HTML developers well for 20 years as a mechanism of describing structured information, DTDs have severe restrictions compared to XML Schema.
DTDs call for elements to consist of one of three things:
A text string
A text string with other child elements mixed together
A set of child elements DTD does not have XML syntax and offers only limited support for types or namespaces.
A given XML Schema defines a set of new names such as the names of elements, types, attributes, attribute groups, whose definitions and declarations are written in the schema. Listing 3 defines the names as InvoiceNo, ProductID, and ProductCode.
The names defined in a schema are said to belong to its target namespace. A namespace itself has a fixed but arbitrary name that must follow the URL syntax. For example, you can set the name of the namespace for the schema excerpted in Listing 3 to be: http://www.SampleStore.com/Account.
The syntax of namespace names can be confusing. Even though the namespace name starts with http://, it does not refer to a file at that URL that contains the schema definition. In fact, the URL http://www.SampleStore.com/Account does not refer to any file at all, only to an assigned name.
Definitions and declarations in a schema can refer to names that may belong to other namespaces. In this article, we refer to those namespaces as source namespaces. Each schema has one target namespace and possibly many source namespaces. In fact, every name in a given schema belongs to some namespace. The names for the namespaces can be fairly long, but they can be abbreviated with the syntax of xmlns declaration in the XML Schema document. We can add more to the example schema as shown in Listing 4 to illustrate these concepts.Listing 4: Target and source namespaces
In the XML Schema in Listing 4, the targetNamespace name is http://www.SampleStore.com/Account, which contains the names InvoiceNo, ProductID, and ProductCode. The names schema, element, simpleType, pattern, string, and positive-integer belong to source namespace http://www.w3.org/1999/XMLSchema, which is abbreviated as xsd through the xmlns declaration. There is nothing special about the alias name xsd; we could have chosen any name. For convenience and simplicity in the rest of this article, we use xsd to refer to namespace http://www.w3.org/1999/XMLSchema and we omit the qualification xsd in some code snippets. In this example, the targetNamespace also happens to be one of the source namespaces because the name ProductCode is used in defining other names.Figure 1: Namespaces for Listing 4
The schema fragment in Listing 4 does not need to specify locations of source schema files. For the overall "schema of schemas," http://www.w3.org/1999/XMLSchema, you need not specify a location because it is well known. For the source namespace http://www.SampleStore.com/Account, you do not need to specify a location since it also happens to be the name of the target namespace that is being defined in this file. To understand better how to specify the schema location and use the default namespace, consider the extension to the example in Listing 5.Listing 5: Multiple source namespaces, importing a namespace

Listing 5 includes one more namespace reference: http://www.PartnerStore.com/PartsCatalog. This namespace is different from targetNamespace and standard namespaces. As a result, it must be imported using the import declaration element whose schemaLocation attribute specifies the location of the file that contains the schema. The default namespace is http://www.w3.org/1999/XMLSchema, whose xmlns declaration does not have a name. Every unqualified name such as schema and element belongs to default namespace http://www.w3.org/1999/XMLSchema. If your schema refers to several names from one namespace, it is more convenient to designate that as the default namespace.
An XML instance document may refer to names of elements from multiple namespaces that are defined in multiple schemas. To refer to and abbreviate the name of a namespace, again use xmlns declarations. We use the schemaLocation attribute from the XML Schema instance namespace to specify the file locations. Note that this attribute differs from the same named attribute schemaLocation of xsd namespace in the previous examples.Listing 6: Using multiple namespace names from multiple schemas
123456789Figure 2: Namespaces for Listings 5 and 6
Back to top
Defining elements
To define an element is to define its name and content model. In XML Schema, the content model of an element is defined by its type. Then, the instance elements in an XML document can have only values that fit the types defined in its schema.
Simple typesXML Schema specification defines a number of simple types for values, as shown in Table 2: Predefined simple types of values.
A type can be simple or complex. A simple type cannot contain elements or attributes in its value. A complex type can create the effect of embedding elements in other elements or it can associate attributes with an element. (The examples in this article to this point have been user-defined simple types (see ProductCode)). The XML Schema spec also includes predefined simple types (see the sidebar Simple types). A derived simple type constrains the values of its base type. For example, the values of derived simple type ProductCode is a subset of the values of base type string.
Simple, non-nested elements have a simple type
An element that does not contain attributes or other elements can be defined to be of a simple type, predefined or user-defined, such as string, integer, decimal, time, ProductCode, etc.Listing 7: Some simple types for elements
Elements with attributes must have a complex type
Now, try adding the attribute currency to the simple element price from Listing 7. You can't. An element of a simple type cannot have an attribute. If you want to add an attribute, you must define price as a complex type. In the example in Listing 8, we have defined what is called an anonymous type, where no explicit name is given to the complex type. In other words, the name attribute of the complexType element is not defined. Listing 8: A complex element type
Elements that embed other elements must have a complex type
In an XML document, an element may embed other elements. This requirement is expressed directly in the DTD. XML Schema instead defines an element, which has a type, and that type can have declarations of other elements and attributes. See Table 1 for a simple exampleTable 1: A comparison of complex data types in DTD and XML SchemaXML document


Thursday, July 17, 2008

SAWSDL study

SAWSDL study:

To make sense of all this data and theseservices, the Semantic Web builds on the foundationsof logic and knowledge representation tohelp computers find the right information for theirusers. Finding and combining information is onlypart of the vision, however. Computers must alsobe able to find and combine services on the Webto free users’ hands and make the Web of servicesscale together with the Web of data.It provides a common ground for the various ongoing effortstoward SWS frameworks, such as theWeb Service Modeling Ontology(WSMO; www.wsmo.org)2 and the OWL-based Web Service Ontology(OWL-S; www.daml.org/services/owl-s).

the W3C formed aworking group to standardize semanticannotations for WSDL, which resultedin the recommendation for SAWSDL,published in August 2007. SAWSDLbuilds mainly on WSDL 2.0,4 but alsosupports the still-prevalent WSDL 1.1.5On the semantic side, SAWSDL is independentof any ontology technologyand assumes that semantic conceptscan be identified via URIs. For instance,SWS frameworks can use the Resource Description Framework (RDF) and Web Ontology Language (OWL) with SAWSDL to annotate Web services.

WSDL and SAWSDLSAWSDL is a set of extensions forWSDL, which provides a standarddescription format for Web services.WSDL uses XML as a common flexibledata-exchange format and appliesXML Schema for data typing. Itdescribes a Web service on three levels:

Monday, July 14, 2008

Protege Study







What is an ontology?
An ontology describes basic concepts in a domain and defines relations among them. Basic building blocks of ontology design include:
classes or concepts
properties of each concept describing various features and attributes of the concept (slots (sometimes called roles or properties))
restrictions on slots (facets (sometimes called role restrictions)) An ontology together with a set of individual instances of classes constitutes a knowledge base.





Why create an ontology?
An ontology provides a common vocabulary for researchers who need to share information in the domain. Some of the reasons to create an ontology are:
To share common understanding of the structure of information among people or software agents
To enable reuse of domain knowledge
To make domain assumptions explicit
To separate domain knowledge from operational knowledge
To analyze domain knowledge





How do I create an ontology?
There is no one correct methodology for developing ontologies, nor is there a single correct result. Developing an ontology is usually an iterative process. You start with a rough first pass at the ontology. You then revise and refine the evolving ontology and fill in the details. In practical terms, developing an ontology includes:
defining classes in the ontology
arranging the classes in a subclass-superclass hierarchy
defining slots and describing allowed values for these slots
filling in the values for slots for instances





How do I know it's right?
There are many possible ontologies for any given domain; any particular ontology is just one way of structuring the concepts and relations. There are a few simple principles which can help you make design decisions in many cases:
There is no one correct way to model a domain - there are always viable alternatives. The best solution almost always depends on the application that you have in mind and the extensions that you anticipate.
Ontology development is necessarily an iterative process.
Concepts in the ontology should be close to objects (physical or logical) and relationships in your domain of interest. These are most likely to be nouns (objects) or verbs (relationships) in sentences that describe your domain.





Where do I start?
You might start by determining what you are going to use the ontology for, and how detailed or general the ontology is going to be. Among several viable alternatives, you will want to determine which one would work better for the projected task, be more intuitive, more extensible, and more maintainable. Remember that an ontology is a model of a real domain in the world and the concepts in the ontology must reflect this reality. After you define an initial version of the ontology, you can evaluate and debug it by using it in applications or problem-solving methods or by discussing it with experts in the field. As a result, you will almost certainly need to revise the initial ontology. This process of iterative design will likely continue through the entire lifecycle of the ontology.





Developing an Example
Suppose we want to develop a system that helps manage the costs and organization of a newspaper. The "examples/newspaper" subfolder of the Protege installation directory contains a completed Protege-Frames project, newspaper, which provides one possible ontology for this domain. Some of the questions we want to answer are:
Who is responsible for each section of the newspaper?
What is the content of each article in a section, and who is its author?
Who does each author report to?
What is the layout and cost of each section? Once we have an idea of what we want to cover, we can list some of the important terms we need. These can include basic concepts, properties they might have, or relationships between them. To begin with we can just collect the terms without regard to the role they might play in the ontology.In the newspaper example we have sections. Each section contains content such as articles and advertisements and has a editor who is responsible for the section. Each article has an author, and that author may or may not be an employee. For each employee, we want to know his or her name and salary, and who he or she reports to.As we continue to generate terms, we are implicitly defining the scope of our ontology, by what we finally decide to include and what to exclude. For example, upon initial examination of the term employee, we might want to add janitor or delivery truck driver. However, on reflection, we might realize that we want our ontology to focus on the costs directly associated with the content generation and presentation of the newspaper. Therefore, we would decide not to include janitor as a term of interest.When we have a fairly complete list, we can start to categorize the different terms according to their function in the ontology. Concepts that are objects, such as article or author, are likely to be best represented by classes. Properties of the classes, such as content or salary, can be represented by slots, and restrictions on properties or relationships between classes and or slots, are represented by slot facets.We will now dive in and show how to use the Protege-Frames interface to create and structure these components of the ontology. http://protege.stanford.edu/





Stony Brook

Graduate School Application ChecklistStony Brook University

Online Applicaton
􀁆 Personal Statement
􀁆 Application Fee
􀁆 Letter of Recommendation #1
􀁆 Letter of Recommendation #2
􀁆 Letter of Recommendation #3
􀁆 OFFICIAL School Transcript(s)
􀁆 OFFICIAL GRE Scores
􀁆 OFFICIAL TOEFL Scores
* Required for students who declare a language other than English as their native language
􀁆 Proof of Permanent Residency
* Required for students who declare themselves as Permanent Residents

applicantion fees is 60$. The copies must be send to the graduate program, and another must be send to the department. Deadline is January 15th.

ibt limit 80 ,but 90 or higher is common.if(Speaking >=28 ) exempt from the ESL.

Research Areas
Visual ComputingThe Center for Visual Computing is an internationally recognized center dedicated to research, industrial interaction, and education in the technology of and applications for digital images and computer-human interaction. Software tools developed by the Center include VolVis for volume visualization (disseminated to more than 3,500 sites), Virtual Colonoscopy for navigating in a reconstructed 3-D model of the colon for cancer screening, and BrainMiner for visual data exploration of the brain. The Center pioneered several architectures; the most recent has been the Cube-4 for real-time high-resolution volume rendering, which has been commercialized by Mitsubishi Electric as the VolumePro board—the first such hardware for the PC. Faculty in this group includes Ashikhmin, Brennan, Chiueh, Gu, Kaufman, Liang, Mitchell, Mueller, Pavlidis, Qin, Samaras, and Stent.
Computer Systems The Computer Systems faculty work on many aspects of computer system problems: distributed systems, networks, and operating systems; communication networks and protocols; high-speed networks; multimedia and P2P networks; wireless and mobile networking; computer security; network security; fault-tolerance and security; storage and file systems; performance evaluation; modeling and analysis; processor and computer architecture; parallel I/O; superconducting computers and networks; massively parallel computation; compression; software systems and portability; software testing and verification; program analysis and optimization; compilers; and more. The Computer Systems faculty include Badr, Chiueh, Das, Gao, Gupta, Mohr, Sekar, Sion, Smith, Stoller, Wittie, Yang, and Zadok.
Applied Logic and Information Systems This research group spans the areas of databases, logic programming, programming languages, Web information systems, and deductive systems. The group includes one of the largest and finest applied logic groups in the world, which attracts international visitors. XSB, developed by the group, is a widely-used deductive database/Prolog engine. FLORA-2, a deductive engine for the Semantic Web, is another popular project. Other important work includes tools for creating intelligent Web agents and automation of inference systems. Deductive calculi proposed by members of the group have been adopted in many state-of-the-art theorem-proving systems and were a key in the automated proof of the Robbins conjecture, a long-standing open mathematical problem. Faculty in this group are professors Bachmair, Gupta, Kelly, Kifer, Liu, C.R. Ramakrishnan, I.V. Ramakrishnan, Warren, Wasilewska, and Zhao.
Concurrency and Verification The Concurrency and Verification group investigates methods for constructing reliable, robust, and secure concurrent and distributed systems. These methods are being used to verify the correctness of a number of safety-critical systems, communication protocols, and e-commerce protocols, as well as security properties of distributed systems. Primary industrial partners include ADEMCO, Computer Associates, Northrop Grumman, and Reuters International. Faculty in this group include Bernstein, Cleaveland, Grosu, Lewis, C.R. Ramakrishnan, I.V. Ramakrishnan, Smolka, Stark, Stoller, and Warren.
Algorithms and ComplexityThis group does research in algorithms and data structures, computational biology, computational complexity, computational geometry, computational finances, complexity theory, string processing, and graph algorithms. In addition to our theoretical contributions, we have a strong record of developing widely-used systems for combinatorial computing, computer graphics optimization, and parallel-processor scheduling. This group includes Arkin, Bender, Gao, Ko, Mitchell, and Skiena.
Apart from research, furthering computer science education is another important part of the departmental agenda. Many faculty members have written books and developed educational software and Web-based material that is in use in hundreds of classrooms around the world. This group of distinguished faculty includes professors Bachmair, Bernstein, Kaufman, Kifer, Ko, Lewis, Pavlidis, Skiena, Smolka, Smith, and Warren
.

Friday, July 11, 2008

有用链接



今天早上的伦理学实在无聊,所以上了一半就翘了课回宿舍睡觉。
回来看到某mm在用电脑,心里一动:Toefl会不会今天出分呢?
打开太傻网一看,果然有人报分。
于是到十分忐忑却又故作镇定地到托福网上查分。
等待许久,终于看到了成绩:112。
第一反应是跑出宿舍在楼道里蹦跳了约10秒钟。

完全没有料到的成绩,因为之前备考实在不好,还一边期末考一边准备托。
Anyway,只能说是人品爆发吧。
就这样被宿舍mm们敲了一顿报告,然后还要报告小亮子和一嵋。
感谢的话就不多说了,在“托福初体验”一文中已经说过。

下面,应某mm的要求把备考的经验写一写。
虽然还是认为自己的备考实在不成功,不过或者有一些经验教训可供人参考吧。
感觉准备时间不管多少,能抓住重点最重要。
我认为的重点已经用红色标了出来~

————————————托福备考经验——————————

1、备考周期
3月底买了托福备考的书籍开始复习,6月7日考试。
虽然备考周期长达3个月,但因为别的事务而时断时续,连贯性不好,感觉效果不太好,不容易保持语言感觉。
建议1:坚持每天复习,不要停顿,哪怕每天复习时间不长也好。

2、备考程序
1、买书(3月底)
买了4本书:OG(官方指南),Delta,Barren,俞敏洪的Toefl词汇词根+联想记忆法。
感觉这几本书还是比较实用的(就是太贵了……):

1、OG(68)是必备,由ETS编的,最权威的一本参考书。
完成度:很好,全看完了^-^

2、Delta(98元)算是参考书里边比较简单的,个人认为编排得比较好,听说读写分开循序渐进复习。对于很久不碰英语的我来说是恢复记忆和信心的好方法。
完成度:一般,完成了阅读和听力部分。

3、Barren(118元)比较难,主要是7套电脑模拟题,用于考前完成(书中附有答案和全部录音解析)。后来才知道可以不买这本书……网上可以下载到模考光盘的……
完成度:一般,全套做完的有3套,剩下的各做了部分(一般是阅读和听力)。

4、词汇书随便选一本就好,貌似很多人用李笑来的。红宝书还可以,有词根分析和联想(虽然我觉得比较扯),还有例句(这个很好~)。
完成度:较差,只看了一半,并且只看了一遍……

就买了这四本书,再加上在网上论坛里下载的东东,感觉完全够了。
建议2:买书贵精不贵多,一定要买OG, Barren可以网上下载。

2、了解考试流程(3月底)非常重要!!!
这一步非常重要!!!可以说是最重要的步骤。
但是依然很多人忽视……我就在考前遇到有人问先做听力还是阅读,加试是什么云云。
要想通过考试,必须先了解它,知己知彼的道理大家都懂。

我主要看了OG上的介绍,很详细很清楚。
Delta和Barren上也有介绍,还有一些小Tips,可以看看。
网上论坛也有很多人写的详细地考试流程解析,可以参考。
当然参看模拟题和机井更是增添了直观感受。
总之在这一步一定不要吝惜时间。
我大概花了3个晚上来研究考试流程,最后基本做到对流程烂熟于心,这是之后备考乃至考试的基础。
建议3:熟悉考试流程最关键,推荐OG上的介绍~

3、背单词(3月底-6月初)
这是本次备考最失败的地方。
我学英语本来就不喜欢背单词,从来都是能不背就不背的,本来想趁着这次机会好好背背单词,谁知……时间拖得长,反而没心情好好看了。
红宝书有35个list,我看了一半,且只看了一遍,实在是不够(不过有听单词mp3)。
看了附录的词组短语list,觉得挺有用的。

我理想中的背单词模式是:
每天一个list,35天背完;
用小本子整理每个list中的生词,每天翻看;
每天一有空就听单词mp3。
这样一个月搞定2000多单词,应该不成问题。

从考试的角度讲,托福对词汇的要求并不高,虽然阅读中也有考单词意思的题,但完全可以通过上下文推断,所以我这样的才能蒙混过关。
建议4:托福对单词要求不高,背单词时间不要太长,一个月足矣。


4、阅读和听力(3月底-5月底)
3月底开始做OG和Delta上的阅读和听力。
每天做一点,Delta还给了个15周的学习计划,可以参考。
最初做Delta上的听力lecture不太适应,但听多了也就习惯了。
在做Delta阅读期间曾经因为干扰太多状态很不好,从90%的正确率降到70%,不过这些都是状态调整中的必然现象,别太给自己压力就好了。
好好看书上的题型分析和技巧,然后做完练习题,这两部分的准备就差不多了。
除了做这两本书,对这两部分没有做别的准备工作。
可以看看网上关于如何记笔记的经验,根据自己的情况找到适合自己的记笔记方法(其实我记笔记不讲方法的,属于尽量记的那种……)

最后这两部分都是29/30,跟平时的练习感觉差不多,感觉是托福考试中比较容易的部分了。
考试中,阅读和听力会有一样加试,到时候电脑随机分配加试哪一样。一定要看加试机井(网上可以找到)!!!后面考前冲刺部分还会讲到。
建议5:阅读和听力做OG和Delta即可,加试机井很重要!!!

5、口语(5月中旬-考前)
个人认为是新托福最难的一部分,难就难在要你在很短的时间内(15秒-20秒)组织语言和思路,然后用不到一分钟的时间流利地表达。

由于我很久不说英语了(都是法语闹的),所以听了Celia同学的建议先恢复语感。
安装了GoldWave软件用来录音,然后找了2007年的托福真题。拿到一道题就开始说并录音,不给自己准备的时间。最开始一点也说不出来,录下来的净是自己的叹息声……说了很久(大概一两周之后)才能勉强有得可说,但可能因为我反应本来就慢,所以还不是很流利。录音之后要分析自己的缺点,然后就同样的话题再说一次录音,再听,不行就再录音……

第二是看了OG上的例子。由于OG的特殊地位,所以这些例子也具有了非常重要的意义,有人甚至说口语机井就在其中~听了的感觉是这些人特别能扯……一直都在说,一直都在说……所以证明了考试的时候只要你keep talking并且讲的是英语,分数应该不会难看。不要停顿,任何停顿都有可能被解读为口语不行。

最后一个问题是要不要准备口语段子。答案是要准备,一定要准备自己的段子,不要太多(多了也记不住),最好一个段子可以套很多个话题。这个问题在考前冲刺部分再详细讲。

考试时前两题提前偷听到了题目(这个偷听的方法在“托福初体验”一文中已经讲了),所以写好了照着念的,很流利,得了Good。
第三题campus一走神,说的时候竟然说错了!木了一秒心想完了,然后恩恩啊啊的开始补救,还是来不及了;第四题也受牵连,没有说完时间就结束了。感觉自己在看、听、说结合上面还是有欠缺。这部分是说得最烂的,得了Fair。
第五六题比三四题稍好一点,完成得差强人意,最后得了fair。
最后口语成绩是26/30。

建议6:不给准备时间来说真题,录音分析,要准备口语模版。

6、写作
这个考前还真是没有准备,只是在考试前一天看了一下,所以实在没有什么经验。
当然这学期我选了高级阅读与写作,是写过三篇作文的,平时作文水平也还不错。

考试中综合写作很容易,可以套模版;独立写作正常写就可以,不需要模版。
注意把握时间,综合写作只有20分钟,独立写作30分钟。
最后写作两部分都是Good,成绩28/30。

7、考前冲刺(考前最后一天)
我的考前冲刺非常郁闷,因为考试前几天竟然有3门通选课期末考试……不过还是做了些我认为最重要的考前准备工作。
真的好好准备的只有考试前一天,那天做了:

1、Barren模考题一套
这个其实平时也有做,主要是做阅读熟悉用电脑看题。
考前大概完整做了3套,其中两套是一周之前做的(考前几天没有空……),考试前一天做了一套。
主要是熟悉题型和流程,对错一点也不重要。

2、加试机井
上午做了Barren模考题,下午睡了午觉起来就开始看加试机井。
看加试机井很重要,因为加试题目万年不变。看了机井,到时候无论是阅读还是听力加试都可以很轻松地做,一边做一边休息。
不过据我推测,加试题是不算分的。为了保险起见,还是要看加试机井。

3、综合作文模版
综合写作一定要准备模版,我已经在多处强调过这点了。因为这可以大大提高写作效率,让不充裕的20分钟变得比较够用。
上网down个你认为比较牛的模版(我在太傻上down的),然后改一改,变成自己的就可以了。

一般结构是开头结尾+中间3点:

1、文中观点是……,lecture不同意此观点,用有力的论据反驳了它。
2、首先,与文中认为……不同,prof认为……。
3、其次,文中认为……,而lecture中认为……
4、最后,文中认为……,而prof认为……
5、In retrospect,文中的观点被有力地反驳了,因此站不住脚。

我的模版已经放到“托福初体验”一文中了,可以参考。

4、口语段子
根据网上流传的分类话题和见过的真题准备10个左右的口语段子。背下来,录音,根据实际效果调整长短,保证能在45秒之内说完主要内容。最好一个段子可以套用多个话题。
我准备了9个,只写了大体思路,如下:

Person
My father is tall and slim, always having a smile on his face.
(My father is my first, and the most important teacher in my life.)
He is a hard-working guy. As a professor in a law school, he spends all his spare time preparing for his lectures and doing research. His diligence gained respect from his students as well as colleagues.
He is also very generous and considerate. Every spring festival he invites his students who cannot go home to our house and have dinner with them in order to let them feel at home.
Besides, he has a sense of humor. When I am frustrated, he always makes up funny stories and jokes to make me happy.
I respect my father, who is at the same time hard-working, generous and humorous.

Qualities of friend/leader/colleague/roommate
Reliable, gain trust from other people, fundamental element to build any relationship
Considerate and generous. Lend money and take care of my plants or pets during emergencies
Sense of humor. When I was frustrated, make up jokes and funny stories to make me happy.

Place, book, culture
The place I wanted to go is Peking University.
(The book I love the most is my day in PKU, written by a graduate student from the university.)

It is a historic site. There are many ancient architectures dating back to the Qing Dynasty. Many celebrities have lived and thus left traces of their life there.
Besides, it has a beautiful scenery. There is a great lake and a wide variety of species in the university. So you feel close to nature.
What’s more, that’s where I (My father) spent four years of college life. It always reminds me of the precious memories that I (He) shared with friends and roommates. I feel sweet when visiting/reading it.
That’s why I love the place/book.

Object, skill, career, leisure time, hobby, aim
I love piano/ I want to be a pianist/
I cannot imagine my life without piano.
For me it is a dream dating back to the childhood. My parents bought it for me when I was four, then I learned to play it during 6 years, 3 hours everyday. It is a symbol of my diligence and effort, of my precious memory.
Besides, playing piano is a good way to make me happy. When I become exhausted or frustrated, playing the piano for half an hour can help me get back my energy and good mood.
Moreover, it makes me an artistic person. I become more sensitive and expressive after playing it. I see the same world, but with different eyes.
Moment, success, a person that helps you
The most unforgettable moment for me is my adaptation to the new environment during junior 3.
At that time, my family moved to Beijing from Chongqing. I really had many problems adapting myself to the new environment: I cannot keep up with classes; I had problem making new friends. I became frustrated. I wrote to my grandpa and said I wanted to go back. He called me and told me to stick on. He said: “If you stay and try, perhaps you will like the city.” I followed his advice. After some efforts, I got to love the city and life here. I feel very proud of myself and I want to thank my grandpa.

way of transportation
I prefer riding a bicycle.
First, it’s convenient and cheap. I just need to buy a bicycle and get on the road.
Second, when riding a bicycle, I feel close to nature. I can enjoy the sunshine on my shoulder and the fresh air.
Third, riding bicycle is a good exercise. It helps me to become physically stronger and relax myself. It’s good for the health.
Last but not least, it is good for environment. It will not produce any pollution thus is better than cars and airplanes.

Newspaper
I prefer reading newpapers.
because I can choose what I want to read. With radio and television, you can only accept whatever comes to your ear or your eyes. But with newspaper, you can just read the parts that interest you.
Besides, it is cheaper. If you want to watch tv, you have to spend much money to buy a tv set, but reading newspaper just costs you 1 yuan a day, very cheap.
Thirdly, you can take it anywhere you want. Other medias like TV or news on internets demand many supplies like electricity or intenet. But newpaper doesn’t need other facilities to support it, you can take it anywhere

Plant/animal
bamboo (beautiful environment, useful pen and tools, food for panda)
panda (Lovely animal fur black and white cute, precious animal not many left, symbol of china, of Olympic games in Beijing)

Living with another person
Share the rent
Listen to me and cheer me up when I am frustrated
Develop the ability to communicate with others and the tolerance

建议一定要准备自己的段子,不要背别人的,这样才可能记得住,在考试时才能默写出来。

5、独立作文题目
看了一遍OG上的185题,一边看一边划出自己认为不知道该怎么写的题目。然后在网上找了个185题解析,对照着找出自己拿不准的几题,看了一下possible的思路。
做完这个就收拾东西睡觉了,正好晚上12点。

建议7:考试冲刺阶段有几件事最好做一下:做几套模考题,看加试机井,准备综合写作模版,准备10个口语段子,看一下独立作文的题目。


备考阶段的经验就是这些,考试时的经验见我写的“托福初体验”一文。

我能想到的就是这些,大家还想问什么给我留言吧。
最近又有一帮孩子要考托了,大家都加油哦~~~~~~Bless all~~~

Presentation Sentence Type

1. Right, let's get started.
2. Let me introduce myself.
3. I've divided my presentation into three main parts.
4. Just to give you a brief overview.
5. I'll be saying more about this in a minute.
6. I'm sure the implications of this are clear to all of us.
7. There's an important point to be made here.
8. OK, let's move on. (go on to make your next point)
9. As you can see, the figures speak for themselves.
10. To go back to what I was saying earlier.
11. Are there any questions you'd like to ask at this point?
12. I'd like to look at this in more detail.
13. Let's put this into perspective. (to explain it this way)
14. Perhaps I should expand on that a little.
15. To digress for a moment? (to depart from your plan)
16. So, to sum up?
17. That brings me to the end of my talk.
18. Thank you. I'm sure you all have lots of questions.

超详细的出国计划

超详细的出国计划
Tag:
版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明http://dearlvsu.blogbus.com/logs/24027957.html8月
  写好第一封联系信,通过E-MAIL发给您感兴趣的学校,索取申请表及相关资料。一般说来,国外正规的大学接到这样的信都会给您回复的。申请资料主要由申请表格组成,但是也包括对学校、原系和专业的介绍材料。只有得到了这些资料,您才能展开申请。  这封信不必写得太长或太详细。因为您未来的教授并不会看到,也不会把它作为您正式申请材料的一部分。内容上,一要表明您计划攻读的学位和专业,一要简单介绍一下您的背景和资历,以说明您为什么有资格攻读您想读的学位和专业。此信的目的是要美国学校对您产生兴趣,并把申请材料寄给您。
  9月-10月
  收到校方的回信和申请资料,着手准备各种各样的文件。首先要对申请表格进行筛选,排除一些不合适或对您表示不欢迎的学校,最后选定10-15所学校作为认真联系的对象。然后按照这些学校各自的要求准备文件。
  复选:收到学校寄来的详细资料后,根据下列标准筛选:
  a. TOEFL要求。各个学校、不同专业对TOEFL的要求不尽相同,而且由于近年来中国学生的成绩出现大幅度上升,竞争日益激烈,实际得到奖学金的学生TOEFL成绩多半都在600分以上。所以,一定要对自己的实力有客观的估计。   b. GRE/GMAT要求。许多学校要求GRE(文、理、工、农、医)或GMAT(管理科学)。所以应该了解申请的学校有无此项考试要求,成绩标准如何。有些学校的有些专业除要求GRE一般考试(General)外,还要求相应得专项考试(Sub)成绩。所以一定要详细了解有关规定,针对自身情况进行选择。一般而言,这项成绩的录取标准是根据申请者在校的学习成绩来定的。您的在校成绩好,GRE或GMAT成绩可以降低一些,在校成绩差则相反。  c. 申请费。考虑自己的经济情况,不要或少申请申请费较高的学校。  d. 经济资助。各个学校甚至各个专业对外国学生的奖学金政策有很大区别。一定要注意是否向外国留学生提供奖学金,数额多少,当地生活费的高低等等。一般规模越大、研究生人数越多的学校,奖学金的机会就越多。  e. 设备与师资。攻读理、工、农、医的申请者应了解学校具有什么设备以及本专业的师资情况。攻读文、法、商等方面的申请者则应重点了解学校有哪些师资。  f. 未来出路。学校的地位越高,则毕业生的出路越大。
11月1日-11月30日
  认真填写所选出的10-15所大学的表格,为这些大学拟全部文件和材料,在这过程中,最好为每个大学建立一个档案,保留和该校相关的文件和文件备份,以便随时掌握联系的进度。准备一个大信封,把全部要寄出的资料按顺序放入。这些资料包括:
  a. Cover Letter,向校方说明全部资料已准备齐全,现在一起寄出,希望校方认真考虑并给予回音。  b. 申请费,可到中国银行或中信实业银行输汇票,然后把该汇票附在您的申请表上。  c. 申请表,按照各大学的要求填写,有条件的可用电动打字机打上去,如果用笔填写,一定要一笔一划写得很清楚。  d. Personal Statement & Resume , 这两个文件事关您的奖学金,一定要把您的优势和成就写得充分可信。  e. 论文或作品集。  f. TOEFL、GRE 成绩单,复印后签上字,放入包封(Package)中。  g. 如果有一篇专业论文附在档案中,一定会增加录取或拿奖学金的机会。学建筑等专业的学员则应提交作品集。  h. 财力证明,不管有没有钱,都要把该表填好放入申请Package中。  i. 各学校所要求的其他资料和文件,这些文件都是要由您自己准备并寄出的。
  ★ 下列文件不能出现在前段提到的大信封里,必须单独寄发:
  a. Three Recommendation Letters,把三封推荐信分三个信封装好,并在信封口上请教授签上字。  b. 中、英文对照的成绩单,用学校的信封封好,封口上应有学校的签章。  c. TOEFL、GRE的正式成绩单,必须安排国外的考试中心直接寄给学校。
  这些材料准备起来非常烦琐,特别是Personal Statement (商学院是Essay)和推荐信的写作,需要有一定的技巧。但是您又不得不倾尽您的全力去准备。因为在您求学之路上,他们将起着至关重要的作用。它们将帮助美国大学的招生委员会成员全面而客观的看待和考察您,而不仅仅只是把您当做一个分数或一份档案。
  如何写推荐信
  推荐信的份量直接关系到能否出国留学,能否获得奖学金等,作为对外联系的材料,是其中一份较为重要的文件。推荐信的目的是通过国内专家向对方介绍申请人的工作、学习和专业方向等情况。在出国申请是否成的诸多要素中,有力的推荐信是录取的重要条件之一,其份量仅次于于本科成绩单和标准化考试(GRE、GMAT、TOEFL)成绩。多数学校都要求申请人提交两封到三封的推荐信,由教授、系主任或工作主管直接寄给指定的单位。
  ◆ 选择推荐人
  推荐信是了解申请人的重要依据,在研究生课程中尤其如此。申请人可以选择现在或以前的老师、教授或雇主。推荐人必须熟悉学生的学习情况,了解学生的学习目的是否明确,在学术上是否有前途,以及学生的适应能力、创造能力、品行和特长。
  书写推荐信的最理想的人选是一封由系主任写,一封由专业课教授写,一封由自己的导师写。不过,对方若无规定,则除了自己的亲属之外,任何人皆可为推荐人。推荐人一般应具备高级技术职称,如教授、副教授、研究员、副研究员等。如果推荐人或者曾经在该校讲过学,那么这样的推荐人写的推荐信就具有很强的效力了。
  ◆ 推荐信的内容
  推荐信一般应包括下列内容:
  1. 被推荐人的基本情况介绍。侧重于个人的毕业时间、学校、所获学位以及个人的专业经历。
  2. 推荐人对被推荐人的基本评价。侧重于被推荐人的专业基础、个性、特点、工作态度和在学术上的前途估计。若是推荐研究生,推荐人还需进一步说明其深造学习的基础和当前所具备的研究能力。显然,恰如其分地评价被推荐人的基础、能力和前途,比言过其实的赞誉更令人情服,更具有实际意义。
  3. 推荐人可以着重介绍被推荐人曾经获得的奖励,发表过的论文,参加过的重要学术会议,以及曾在学生组织或学术团体中的任职等来支持自己的评价。
  4. 推荐人还必须清楚地表明被推荐人留学的身份是研究生还是访问学者,专业领域和研究方向是什么。
  5. 如果大学提供了现成的推荐表格,则必须按这类表格认真逐项填写。推荐表格中一般有学生综合评估的一项,即要求推荐人说明该生在所教的学生中应列为前5%,10%,或25%等。这种评估是指教授的个人评价,可以稍高一点。另外,推荐表格上常有许多难以填写的项目,遇到这种情形可填”I don’t know”,亦不致对该生的评价有何严重影响。
  6. 推荐信尾必须有推荐人的亲笔签名,最好直接由推荐人寄给学校招生办官员或申请就读学校的系主任。如果由被推荐人寄送,可将推荐信装入信封内封好后由推荐人在信封口处亲笔签名以示保密。信封正面注明“A Letter Of Recommendation”,表明这是一封推荐信。
  如何写简历
  申请美国院校入学和奖学金资助,要准备一份合适的个人简历。个人简历的目的是让对方清晰地了解申请者的全面情况,应力求在真实、全面、简明的基础上准确地反映自己受教育和从事专业工作的经历,特别是近年来的工作方向、研究兴趣及成果。
  个人简历主要包括以下内容:
  1. 姓名。力求与各种学历证明的姓名相同,如有更名的情况,务必在公证时予以声明,并附上公证书。  2. 性别。  3. 出生年月日及地点。力求与各类学历证明的出生年月日一致,出生地点写明国别和省别。  4. 国籍。  5. 婚否。应分为未婚、已婚、丧偶、独身四种状况。  6. 现在工作单位及详细通信地址。  7. 个人受教育经历。包括大学、硕士研究生阶段的在读时间,所在大学的名称、专业和所获学位;参加工作后的受教育经历,主要是指脱产接受专门的进修、培训或学习。  8. 个人从事专业的经历。填写专业经历应力求抓住重点,突出研究方向;担任教学工作的可列出主讲、助讲的课程名称;担任研究工作的可列出参加各个研究项目的课题名称。  9. 有何著作、论文或研究成果。个人的论文、著作和研究成果要分门别类列出,并一定要与个人专业经历相一致。所列著作要注明名称、出版年月、出版单位。所列论文要注明论文题目,刊载的杂志或期刊名称、期号、语种;对于在学术会议上发表的文章还要注明学术会议的名称、召开的时间和地点等等。如果其中有被外国学者评论过的,最好附上刊载评论文章的杂志名称及时间。  10. 外语水平。注明参加TOEFL、GRE等考试时间、地点及成绩。若申请者掌握多门外语,则要一一注明语种 并说明熟练程度。  11. 参加何种学术团体,得到何种荣誉。学术团体一般应是省、市或行业一级以上的专业学术团体,在学术团体中所担任职务可予以注明:荣誉主要是指在专业、技术研究方面获得的奖励和荣誉,要注明获奖名称、颁奖时间和颁奖单位。  12. 拟申请的大学和导师的姓名。可根据申请者查询到的资料予以注明,需注意按照每个单位、每位导师给一份简历的原则,即在同一份简历中不必注明全部想要联系的单位或导师。  13. 拟进行的研究方向和希望从事研究的题目。国外院校的专业面一般较宽,要根据国外情况,力求专业面与其一致;研究课题可根据自己的研究兴趣和需要,同时也要尽量考虑对方的条件。简历最好打印。上述项目如遇缺项可不必撰写,只需将下一项内容提前即可。简历的字迹要求工整、清楚。既不要言过其实,又必须充分反映自己的实际水平。
  各种证明材料
  证明材料一般出自有关单位,文字应规范、严谨,并加盖有效印章。申请者应提供的证明材料主要有以下几种:
  1. 学历、学位证明。主要是大学、研究生毕业证书,硕士学位证书,博士学位证书。  2. 成绩单。成绩单是任何申请人都必须提供的,我要大专院校的成绩评定大多彩百分制,而美国而以采用等级制为多,其平均值通常用平均成绩点数(GPA)表示,因此,必须注明所采用的记分方法,最好能提自己在班级所排名次,现在,美国大多数学校都要求申请者通过ETS直接提供TOEFL或GRE成绩。  3. 财力证明。  4. 体检表和健康证明。一般应由指定级别的医院出具。  5. 学业(术)奖励和工作证明。一般学校尽管不作要求,但获得过奖励和有过实际工作经验的申请者,在录取时必定会得到优先考虑,这一点在申请助教、助研及奖学金时尤为重要。  6. 以上只是准备这些材料时所应该注意的一些基本原则,要完成一篇令人满意的文章,仅靠这些是远远不够的。试者全面的审视您自己,勇敢的展示您自己,您会发现这将是一次难得的体验。如果实在觉得困惑,也可以找朋友,或找专业人士聊聊,看看别人眼中的自己。也许会大有收获。北京澳加教育咨询公司美国部的咨询顾问随时等着您的来电。
  奖学金专论
  美国大学学费高是众所周知的,一些热门专业如:MBA,法律等更是让人望而却步。可是这些都不能拦住您去美国的脚步。申请奖学金是大多数中国学生会选择的一条路。因为奖学金的获取不但是对学习和生活负担的减轻,而且也是对您优秀的素质的最好证明。
  什么是财务资助(Financial Aid)?
  财务资助的主要形式有:
  1) 学生贷款(student loan); 2) 奖学金(scholarship); 3) 免学费(partial tuition waiver); 4) 助教/助研(TA/RA-graduate assistantship); 5) 助学金(fellowship); 6) 勤工俭学(on-campus work); 7) 带薪实习和季节工(salaried internship/summer jobs ); 8) 协助住宿和节省方案(residential assistance/savings plan); 9) 寄住美国人家(home-stay); 10)教会协助(church assistance)虽然财政资助的形式多种多样,但中国学生最常见到的,是以下几种方式:
  A. 奖学金
  奖学金的来源主要有三类:a)来自学校,b)来自政府,c)来自校外的私人,公司或教会,一般来说,奖学金的竞争是非常激烈的,并且高额/全额奖学金的数量更是寥若晨星,对绝大多数的国际学生来说,能够争取到¥2000-#3000的奖学金(不用偿还)已经是非常非常幸运的了,奖学金第二年是否继续,取决于学生的学术表现和学校的资金情况。
  B. 助教和助研
  对于读研究生的同学来说,申请干TA/RA是解决读书费用的好办法,申请者通常必须有本科学历,且教/助研就是学生在教授手下工作,协助教授的教学和科研,也有少数的行政管理工作,竞争助教/助研的位子是白热化的,因为如果能干上助教/助研,学生除了拿薪金(stipend)外,通常学校还给学生免部分学费。这种资助在每个学院的具体金额都在其专业系别介绍中说明,一般通过给系主任直接发出一封索取资料信函就可获得这个系的TA、RA介绍。介绍会说明这种资助的具体金额为多少,获奖比率为多少,能否覆盖一年的全部费用,有的还会说明在本系中一般获资助者的TOEFL和GRE(或GMAT)的平均与最低分数。
  C.助学金
  研究员薪金是一种金额最高、但竞争最激烈的非服务性奖学金,一般情况下如果获得一所学院授予的助学金,便是获得了全奖,即除了免学费杂费、住宿费、保险费、书本费以外,还给获奖学生一定金额作为其个人消费费用(Personal Expenses)。助学金在申请过程中竞争尤其激烈,一般除了要求较高的TOEFL-GRE或GMAT成绩外,还要有较好的国内学校成绩单、GPA、推荐信和读书计划(Personal statement),这些材料的准备要十分注意技巧,做到与众不同,才能顺利地拿到全额奖学金。第二年是否继续,取决于学生的学术表现,工作能力和学校的资金情况。
  D.勤工俭学
  美国移局规定,国际学生可以在学校校内每周工作20小时,假期可以工作40个小时,这就是说学生可以通过勤工俭学每年挣到大约#4000-¥6000,工作岗位一般是在图书馆,计算机房,学生餐厅,管理宿舍,办公室,学校书店等等,如果学校常年有学生勤工俭学的工作机会,并且认为学生能够通过勤工俭学解决部分读书费用,学校会有录取材料上说明,但是具体工作要学生到学校后自己找,学校不可能给在万里之外还有得到签证的国际学生预留工作岗位,全部的岗位都是先来先干。
  经过漫长的准备,现在是您出手的时候了。如何能以最有效的方式安全快捷的赶在申请截止日期前寄到校方手中,是大家关心的又一问题。
  向各大学寄出所有联系资料,并要求ETS向各大学寄TOEFL、GRE成绩单原件。在以上工作全部结束以后,可再选出10所左右一般的大学,在不交申请费,不寄TOEFL、GRE成绩单原件的前提下进行联系,有时会有意想不到结果。
  寄申请材料的有效保障——国际速递公司
  1.UPS国际速递  顾客服务电话:(Customer Service Telephone)(86-10)65932932-7  UPS网址:www.ups.com
  2.FedEx国际速递  XXXXX电话:800 810 2338 电话:(86-10)6468 5566   网址:www.fedex.com
  3.DHL国际速递  Tel:8610-6466-2211  网址:www.dhl.com
  4.EMS国际速递  电话:185;65129947
对小件印刷品(申请材料)寄往美国比较,各公司的最低起价为200元左右,提供上门服务,DHL的邮资略高于其它三家公司几十元人币左右,但是它的服务范围更广一些。DHL提供一种叫做“倒付”的业务,既可以由您先将邮资当作押金交给公司,并将校方发信人的Email地址告诉公司,由公司去取回邮件后您再付款(最新报价是250元左右)。这种方法虽价格较贵,但适用于各种必须抢在时间前面,且只能万无一失的场合。另外,在邮寄申请费汇票等重要资料的时候,尤其是自己梦寐以求的大学时,也推荐采用速递的方式邮寄。在服务质量上,国际速递服务也明显好于普通邮件,一般前三家公司3-5天都能保证寄往美国,(在付同样邮资的情况下,EMS的邮寄时间保证上可能略逊一些)。即使是遇到突发事件,如寄往美国的邮件在中途遇到了“9?11“事件的影响,最后也没有耽误太长时间(Fedex寄)。希望大家能在对各种邮寄服务性能价格比综合考虑的前提下,享受到国际速递公司为您带来的方便快捷上门服务。
  2月-4月
  这也许将是您一生中最漫长的一个春天。随着材料的寄出,您刚刚放下的心现在又提了起来,紧张得等待着录取信和奖学金的到来。虽然您心情紧张,但也不能干着急,您还有些工作没有完成。  用通信或e-mail的方式和学校保持联系。可能的话,向大学所学专业的教授写信做自我推荐,让那些能决定您命运的教授了解您,以进一步提高您被录取和授予奖学金机会。有时校方会来函,告知缺什么文件,接到信后应赶紧把所需文件寄过去。在接到一所学校来的奖学金后,不要急于答复,因为可能会有更多更好的学校给予奖学金。到4月上、中旬再决定去哪一所学校,然后再把别的学校回绝掉。
  OFFER的取舍因素:
  如果同时看中了好几所学校,也都被对方接受了,在面对一封封”Congratulations! You are accepted.”的录取通知书时,如何选择、取舍,是决定未来留学生涯的关键。本文就主观及客观应考虑的因素,提供一些供各位参考:
  客观因素:
  ▲ 经过教育部认可的大学:可到教育部国际文教处索阅资料。  ▲ 奖学金:学校是否提供奖学金、学费补助、助教或研究津贴等,这通常是每个人首要考虑因素。  ▲ 学费、生活费:一般私立大学收费都比州立大学要高,但是许多州立大学的学费也相当高;再者,如果学校位于大城市里,生活费会相应提高,这一点不要忽略。  ▲ 学校名声:学校、系所的评监排名,是决定选校或选系的主要参考依据。通常,选择有名的学校对将来就业有较大的帮助。  ▲ 学校师资、设备:对许多特殊的系所,可能要求特别的设备或专家。例如,读海洋研究的同学,应考虑位于两岸的学校。  ▲ 校风:学校风气是保守抑或开明?是否与周围环境息息相关?学术风气如何?例如,学服装设计的同学可能应考虑纽约;学社会学的同学,选择大城市的学校有利于取材。
  主观因素:
  ▲ 亲戚朋友:这是最易影响决定的主观因素。通常如果有朋友、学长已在某校就读,或是有亲戚住在某校附近,该校就会成为理想中的学校。  ▲ 气候:有些人无法受长期严寒的天气,例如新英格兰区的下雪季节长达六个月;有些人就偏爱加州的阳光。选择之前,一定要先对美国各地气候有所了解。  ▲ 个人喜好:看过“爱的故事“的同学爱上哈佛校园;因浪漫情怀而钟情某些学校,大有人在。
  5月-6月
  拿到了录取和奖学金,当然很高兴,但是先别急着庆祝,在国内还有大量的事情等着您处理。我们向您提供以下资料,希望您在输时少走冤枉路。如果在这时还没有消息,也不用着急,但要与学校保持联系,因为大约有三分之一的奖学金是在5月和6月发下来的。
  如果到5月份还没有接到奖学金,不用着急,但要与学校继续保持联系。大约有三分之一的奖学金是在5月和6月发下来的。拿到I-20表的学员,可以开始到公安机关输护照。护照拿到后,随时可去美国大使馆申请签证。每次签证费559元人币。对自己的签证没有把握的,可以找专家咨询一下,看看材料,做做模拟,勇敢自信的走入美国大使馆。
  
  公证的种类
  1、 出生公证 2、结婚公证 3、离婚公证 4、未婚公证 5、经历公证 6、未受刑事处分公证 7、域外亲属关系公证 8、亲属关系公证 9、国籍公证 10、死亡公证 11、学历公证 12、驾驶公证书
  办理公证所需证明:
  出生公证;身份证,户口本,如户口与父母的不在一起则需父母单位(一方即可)出证明。  学历公证:最后的毕业证,学位证即可。  亲属关系:户口本,父母单位证明或派出所证明,有国外亲属需其在国外的居住证明或使用的证件。  有期限的公证:结婚或未婚公证6个月结婚证未婚证即可。  无刑事犯罪公证:6个月单位保卫部门或派出所证明。
  办理公证手续
  1、 先到档案科把档案费交了,得到一张收据;  2、 到公证处取纸一张,填好;  3、 带学生证到系人事科,让人事科老师亲笔誊写一遍,一般系人事科备有办公证的介绍信,XXXXX;  4、 既得介绍信,去公证处,(各公证处介绍信格式都一样,而海淀便宜)带身份证户口卡,公证处负责XXXXX复印;  5、 交费,7-15天后去取。