Skip to content

Instantly share code, notes, and snippets.

@edpichler
edpichler / IQuote.java
Created February 8, 2011 10:39
Example to Google Group
public interface IQuote {
/** Ex. Petrobrás */
public abstract String getNome();
public abstract void setNome(String nome);
/** Ex.: PETR3 */
public abstract String getCodigo();
public interface ICodeQuote extends IQuote, Serializable{
}
package com.edpichler.bovespa.persistent.impl;
import java.util.Date;
import com.edpichler.osgi.bovespa.quote.IQuote;
public abstract class Quote implements IQuote {
@Override
public String toString() {
return "Quote [nome=" + nome + ", codigo=" + codigo + ", data=" + data
public class StockQuote extends Quote implements ICodeQuote , Serializable{
public static ICodeQuote createFrom(IQuote quote) {
StockQuote q = new StockQuote();
q.setAbertura(quote.getAbertura());
q.setCodigo(quote.getCodigo());
q.setData(quote.getData());
q.setMaximo(quote.getMaximo());
q.setMedio(quote.getMedio());
q.setMinimo(quote.getMinimo());
package com.edpichler.bovespa.process.appengine;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import net.sf.jsr107cache.CacheException;
import net.sf.jsr107cache.CacheFactory;
public class AppengineMemCacheMap implements IQuoteCache {
private Cache cache;
public AppengineMemCacheMap() {
Map props = new HashMap();
props.put(GCacheFactory.EXPIRATION_DELTA, 60);// seconds
try {
public CompositeObject[] getObjetos(){
CompositeObject[] obj = new CompositeObject[10];
for (int i = 0; i < 10; i++) {
obj[i] = new CompositeObject();
}
return obj;
}
public class CompositeObject{
public Double getDouble(){
<mx:DataGrid x="18" y="619" id="dataGrid" creationComplete="dataGrid_creationCompleteHandler(event)" dataProvider="{getObjetosResult.lastResult}">
<mx:columns>
<mx:DataGridColumn headerText="otherPart" dataField="otherPart"/>
<mx:DataGridColumn headerText="objeto" dataField="objeto"/>
<mx:DataGridColumn headerText="string" dataField="string"/>
<mx:DataGridColumn headerText="double" dataField="double"/>
<mx:DataGridColumn headerText="objetos" dataField="objetos"/>
</mx:columns>
</mx:DataGrid>
@edpichler
edpichler / Animal.java
Last active February 12, 2024 18:29
Java AWT/Swing with Drag and Drop.
public class Animal {
private String name;
private int age;
public Animal() {
name = "Name " + System.currentTimeMillis();
age = (int) +System.currentTimeMillis();
}
@edpichler
edpichler / gist:1366689
Created November 15, 2011 10:27
Resizing Oracle Vm HD
C:\Program Files\Oracle\VirtualBox>VBoxManage.exe modifyhd "D:\Users\eduardo.pichler\VirtualBox VMs\win7" --resize 30720