Strict Standards: Non-static method CodeColorerLoader::Enable() should not be called statically in /home/k6000169/public_html/wp-content/plugins/codecolorer/codecolorer.php on line 254
2011 octubre | Programador freelance argentina

How to upload data to an development server in appengine (MAC OSx)

First download your data as described here.

Then install Charles Proxy App, start the proxy. Set in Proxy -> Proxy Settings to use not the 8888 port.

Finally start your development server and run this in the console.

$ python /path/to/library/google_appengine_python_1.5.5/appcfg.py upload_data –url=http://localhost:8888/remote_api –file=test.csv –application=your_app_id –email=you@gmail.com –passin

How to download data from an appengine app.

From the command line

$ python /path/to/library/google_appengine_python_1.5.5/appcfg.py download_data –application=your_app_id –url=http://app_name.appspot.com/remote_api –filename=test.csv

Uncompressed file formats in Android package

static const char* kNoCompressExt[] = {

“.jpg”, “.jpeg”, “.png”, “.gif”,

“.wav”, “.mp2”, “.mp3”, “.ogg”, “.aac”,
“.mpg”, “.mpeg”, “.mid”, “.midi”, “.smf”, “.jet”,
“.rtttl”, “.imy”, “.xmf”, “.mp4”, “.m4a”,
“.m4v”, “.3gp”, “.3gpp”, “.3g2”, “.3gpp2”,
“.amr”, “.awb”, “.wma”, “.wmv”
};

INSTALL_FAILED_INSUFFICIENT_STORAGE

If you are using SDK 2.2. add this ”

1
<span>android:installLocation="preferExternal</span>

” to the AndroidManifiest.xml like:


1
<span><manifest xmlns:android="http://schemas.android.com/apk/res/android"><br>    package="com.andrewsmith.android.darkness"<br>    android:installLocation="preferExternal"</manifest></span>

How to add C++ support to Eclipse?

Help -> Install new software -> Work with -> Helios -> Programming Languages -> C/C++ Development Tools

😉

GCC 4.2 is not compatible with the Mac OS X 10.4 SDK

Go in the XCode to

Project > Edit Project Settings > Base SDK

And select MAC OSX 10.6 😉

GWT Celltable ContextMenu in a Column

// create your column class
private class ContextMenuColumn extends Column{

public ContextMenuColumn(Cell cell) {
super(cell);
}

@Override
public String getValue(UserModel object) {
return "/img/icons/contextual-menu.jpg";
}

@Override
public void onBrowserEvent(Context context, Element elem, UserModel object, NativeEvent event) {
final UserModel user = object;

int left = elem.getParentElement().getAbsoluteLeft();
int top = elem.getParentElement().getAbsoluteTop();

final DialogBox dialog = new DialogBox();
dialog.setText(constants.Actions());

Anchor lnkEdit = new Anchor(constants.Edit());
lnkEdit.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
placeController.goTo(new ControlPanelUsersEditPlace(user.getUserId()));
dialog.hide();
}
});

Anchor lnkUpdateState = new Anchor(user.getEnable() == false ? constants.Enable() : constants.Disable());
lnkUpdateState.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
presenter.setEnabled(user.getUserId(), !user.getEnable());
dialog.hide();
}
});

Anchor lnkResetPassword = new Anchor(constants.ChangePassword());
lnkResetPassword.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
presenter.resetPassword(user.getUserId());
dialog.hide();
}
});

Anchor lnkDelete = new Anchor(constants.Delete());
lnkDelete.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
presenter.delete(user.getUserId());
dialog.hide();
}
});

VerticalPanel pnl = new VerticalPanel();
pnl.add(lnkEdit);
pnl.add(lnkUpdateState);
pnl.add(lnkResetPassword);
pnl.add(lnkDelete);

dialog.setWidget(pnl);
dialog.setPopupPosition(left - 20, top + 10);
dialog.setAutoHideEnabled(true);
dialog.show();
}
}

// create your column and add it to your table
Column
table.addColumn(contextMenuColumn);

GWT Celltable add a Row Handler

Handler rowHandler = new Handler() {
@Override
public void onCellPreview(CellPreviewEvent event) {
if (event.getColumn() != 0 && event.getNativeEvent().getType().equals("click")) {
placeController.goTo(new CompanyUsersEditPlace(event.getValue().getUserId(), user.getCompanyId()));
}
}
};

table.addCellPreviewHandler(rowHandler);

GWT Celltable and Checkbox Column

// you need a selection model
private final MultiSelectionModel selectionModel = new MultiSelectionModel(operatorKeyProvider);

// you need a selection manager
private final DefaultSelectionEventManager selectionManager = DefaultSelectionEventManager.createCheckboxManager();

// you need the table ;)
@UiField CellTable table;

// then ...
selectionModel.addSelectionChangeHandler(
new SelectionChangeEvent.Handler() {
public void onSelectionChange(SelectionChangeEvent event) {
StringBuilder sb = new StringBuilder();
boolean first = true;
List<UserModel> selected = new ArrayList<UserModel>(selectionModel.getSelectedSet());

Collections.sort(selected);
for (UserModel value : selected) {
if (first) {
first = false;
} else {
sb.append(", ");
}
sb.append(value.getFirstName());
}
}
});

table.setSelectionModel(selectionModel, selectionManager);

// create your column
Column checkBoxColumn = new Column(new CheckboxCell()) {

@Override
public Boolean getValue(UserModel object) {
return selectionModel.isSelected(object);
}

@Override
public FieldUpdater getFieldUpdater() {
return null;
}

};