 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Aviar³ Grandmaster Cheater
Reputation: 50
Joined: 03 Jan 2008 Posts: 655 Location: Canada
|
Posted: Thu Feb 28, 2013 7:41 pm Post subject: Evil_Intentions post some Java code |
|
|
Bored and want to see what your Java code looks like since mine's shit. I'll post a sample of mine tomorrow. _________________
This is the inception of deception, checking the depth of your perception.
 |
|
| Back to top |
|
 |
InternetIsSeriousBusiness Grandmaster Cheater Supreme
Reputation: 8
Joined: 12 Jul 2010 Posts: 1268
|
Posted: Thu Feb 28, 2013 8:23 pm Post subject: |
|
|
| assburgers couple |
|
| Back to top |
|
 |
Sui Expert Cheater
Reputation: 7
Joined: 04 Sep 2008 Posts: 119
|
Posted: Thu Feb 28, 2013 8:27 pm Post subject: |
|
|
Some java code plz i haven't fapped for days, just nothing out of the ordinary. _________________
|
|
| Back to top |
|
 |
Evil_Intentions Expert Cheater
Reputation: 65
Joined: 07 Jan 2010 Posts: 214
|
Posted: Thu Feb 28, 2013 10:34 pm Post subject: |
|
|
Likely done something stupid somewhere but we're just learning regex so I wanted to use them to write a recursive string rewriting method.
| Code: | package fractals;
import java.util.HashMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class FractalData {
private HashMap<String,String> rules = new HashMap<String, String>();
private final String generator;
private String fractal;
private Pattern p;
public FractalData(String gen){
generator = gen;
fractal = gen;
}
public void addRule(String input, String replacement){
rules.put(input, replacement);
p = buildPattern();
}
public void order(int deg){
order(deg,true);
}
void order(int deg, boolean first){
if(deg==0)return;
Matcher m;
if(first) m = p.matcher(generator);
else m = p.matcher(fractal);
StringBuffer sb = new StringBuffer();
while(m.find()){
m.appendReplacement(sb, rules.get(m.group()));
}
m.appendTail(sb);
fractal = sb.toString();
order(--deg,false);
}
Pattern buildPattern(){
StringBuilder sb = new StringBuilder();
sb.append("(");
String[] r = new String[rules.size()];
rules.keySet().toArray(r);
for(int i = 0; i<r.length; i++){
sb.append(r[i]);
if(i!=r.length-1) sb.append("|");
}
sb.append(")");
return Pattern.compile(sb.toString());
}
public String getFractal(){
return fractal;
}
public static void main(String[] args){
FractalData fd = new FractalData("F+FX--F");
fd.addRule("F", "F+XX");
fd.addRule("X", "YFY-XYX");
fd.addRule("Y", "F-F+F+F-F");
fd.order(1);
System.out.println(fd.fractal);
fd.order(4);
System.out.println(fd.fractal);
}
}
|
|
|
| Back to top |
|
 |
Evil_Intentions Expert Cheater
Reputation: 65
Joined: 07 Jan 2010 Posts: 214
|
Posted: Fri Mar 01, 2013 12:00 am Post subject: |
|
|
...that formatting
Also, I started learning Haxe, http://haxe.org/. This'll compile to c++ source and binary. Does the same thing as my first post.
| Code: | package fractal;
import haxe.ds.StringMap;
/**
* ...
* @author Zachary Moneaux
*/
class FractalData
{
private var generator : String;
private var fractal : StringBuf;
private var rules : Map<String,String>;
private var p : EReg;
public function new(gen : String)
{
generator = gen;
rules = new Map<String,String>();
fractal = new StringBuf();
fractal.add(gen);
p = ~/./;
}
public function addRule(input : String, replacement : String):Void {
rules.set(input, replacement);
}
public function order(deg : Int, ?first : Bool):Void {
if (deg == 0) return;
if (first == null) first = true;
var s = first?generator:fractal.toString();
fractal = new StringBuf();
while (p.match(s)) {
if (!rules.exists(p.matched(0))) fractal.add(p.matched(0));
else fractal.add(rules.get(p.matched(0)));
s = p.matchedRight();
}
order(--deg, false);
}
public function getFractal():String {
return fractal.toString();
}
} |
|
|
| Back to top |
|
 |
teeigeryuh Master Cheater
Reputation: 25
Joined: 13 Oct 2008 Posts: 261 Location: The netherlands
|
Posted: Fri Mar 01, 2013 2:32 am Post subject: |
|
|
| Code: | #include <iostream>
using namespace std;
//start main~~~~~
int main ()
{
int z = 2;
cout << z;
return 0;
} |
_________________
ლ(╹◡╹ლ) |
|
| Back to top |
|
 |
savormix How do I cheat?
Reputation: -1
Joined: 26 May 2007 Posts: 3 Location: Vilnius, Lithuania
|
Posted: Fri Mar 01, 2013 6:03 am Post subject: |
|
|
| Evil_Intentions wrote: | | Also, I started learning Haxe |
This haxe sounds 100% the same as PL/1 sounded half a century ago. I guess it will achieve the very same things as PL/1 did. _________________
| Brolock wrote: | private trackers are shit lel
>paying to pirate
top lel |
|
|
| Back to top |
|
 |
Aviar³ Grandmaster Cheater
Reputation: 50
Joined: 03 Jan 2008 Posts: 655 Location: Canada
|
Posted: Mon Mar 04, 2013 10:10 am Post subject: |
|
|
Some java code I am working on. It won't compile since it isn't the entire project file set, but it should at least be indicative (somewhat of my style):
| Code: | package com.wilkonit.gi.ui.modulos.gestionPropiedades.submoduloPropiedades.mediator;
import java.util.Date;
import java.util.List;
import com.vaadin.event.Action;
import com.vaadin.event.Action.Handler;
import com.vaadin.ui.AbstractComponent;
import com.vaadin.ui.Table;
import com.wilkonit.common.model.Cliente;
import com.wilkonit.common.model.PropietarioPropiedad;
import com.wilkonit.common.ui.ScreenHolder;
import com.wilkonit.crm.dao.PersonaDao;
import com.wilkonit.crm.manager.OperacionesManager;
import com.wilkonit.crm.model.common.Domicilio;
import com.wilkonit.crm.util.ApplicationHelper;
import com.wilkonit.gi.ui.modulos.gestionPersonas.clientes.EdicionClienteHolder;
import com.wilkonit.gi.ui.modulos.gestionPersonas.clientes.ui.PropiedadesClientesUI;
import com.wilkonit.gi.ui.modulos.gestionPropiedades.submoduloPropiedades.Mediator;
public class PropiedadesClienteMediator extends Mediator {
public static final String COLUMN_1 = "Domicilio";
public static final String COLUMN_2 = "Tipo";
public static final String COLUMN_3 = "Estado";
public static final String COLUMN_4 = "Inicio Contrato";
public static final String COLUMN_5 = "Fin Contrato";
public static final String COLUMN_6 = "Inquilino Actual";
public static final String COLUMN_7 = "Garante Actual";
private PropiedadesClientesUI _ui;
private PersonaDao _personDao = ApplicationHelper.getBean(PersonaDao.class);
private List<PropietarioPropiedad> propiedadesDelCliente = null;
public PropiedadesClienteMediator(ScreenHolder pantallaUI) {
super(pantallaUI);
_ui = new PropiedadesClientesUI();
}
@Override
public void loadValues() {
Long uid = null;
//check we have the right data type
try{
uid = (Long) getData(EdicionClienteHolder.ID_CLIENTE);
}
catch(ClassCastException e) {
throw e;
}
if(uid != null) {
//sanitary?
if(uid > 0) {
propiedadesDelCliente = ApplicationHelper.getBean(OperacionesManager.class).getPropiedadesPorCliente(uid);
}
}
return;
}
/**
* Fills table in ClienteUI. This function should be called after calling loadValues,
* otherwise there will be no data to use in the filling process.
*
*/
@Override
public void fillFields() {
Table table = _ui.gettPropiedades().getTable();
//Set table features
table.setImmediate(true);
table.setReadOnly(true);
table.setSelectable(true);
table.setColumnReorderingAllowed(true);
table.setColumnCollapsingAllowed(true);
//Add handler for right-click menu
table.addActionHandler(new Handler() {
private static final long serialVersionUID = 2324846520558192418L;
final Action VER_PROPIEDAD = new Action("Ver Propiedad");
final Action VER_INQUILINO = new Action("Ver Inquilino");
final Action VER_GARANTO = new Action("Ver Garanto");
final Action VER_LIQUIDACION = new Action("Ver Liquidacion");
final Action EDITAR_ASSOCIACION = new Action("Editar Associacion");
final Action NUEVA_ASSOCIACION = new Action("Nueva Associacion");
final Action ELIMINAR_ASSOCIACION = new Action("Eliminar Associacion");
final Action[] ACTIONS = new Action[] {VER_PROPIEDAD, VER_INQUILINO, VER_GARANTO,
VER_LIQUIDACION, EDITAR_ASSOCIACION, NUEVA_ASSOCIACION, ELIMINAR_ASSOCIACION};
@Override
public Action[] getActions(Object target, Object sender) {
return ACTIONS;
}
@Override
public void handleAction(Action action, Object sender, Object target) {
if(action.equals(VER_PROPIEDAD)) {
}
else if(action.equals(VER_INQUILINO)) {
}
else if(action.equals(VER_GARANTO)) {
}
else if(action.equals(VER_LIQUIDACION)) {
}
else if(action.equals(EDITAR_ASSOCIACION)) {
}
else if(action.equals(ELIMINAR_ASSOCIACION)) {
}
else if(action.equals(NUEVA_ASSOCIACION)) {
}
}
});
//Build table columns
table.addContainerProperty(COLUMN_1, String.class, "");
table.addContainerProperty(COLUMN_2, String.class, "");
table.addContainerProperty(COLUMN_3, String.class, "");
table.addContainerProperty(COLUMN_4, String.class, "");
table.addContainerProperty(COLUMN_5, String.class, "");
table.addContainerProperty(COLUMN_6, String.class, "");
table.addContainerProperty(COLUMN_7, String.class, "");
//Fill rows
if(propiedadesDelCliente != null && !propiedadesDelCliente.isEmpty()) {
for(PropietarioPropiedad propietarioPropiedad : propiedadesDelCliente) {
Domicilio dom = propietarioPropiedad.getPropiedad().getDomicilio();
String domicilio = dom.toString();
String tipo = propietarioPropiedad.getPropiedad().getTipoPropiedad().toString();
String estado = propietarioPropiedad.getPropiedad().getEstado().toString();
Date finContrato = propietarioPropiedad.getVencimientoAutorizacion(); //Is this right?
Date inicioContrato = propietarioPropiedad.getVencimientoAutorizacion();
String inquilinoActual;
String garanteActual;
List<Cliente> listado = _personDao.getInquilinosPropiedad(propietarioPropiedad.getPropiedad().getId());
inquilinoActual = !(listado == null || listado.size() == 0) ? listado.get(listado.size() - 1).getNombreCompleto() : null;
listado = _personDao.getGarantesPropiedad(propietarioPropiedad.getPropiedad().getId());
garanteActual = !(listado == null || listado.size() == 0) ? listado.get(listado.size() - 1).getNombreCompleto() : null;
table.addItem(new Object[]{domicilio, tipo, estado, inicioContrato.toString(), finContrato.toString(),
inquilinoActual, garanteActual}, propietarioPropiedad.getId());
}
}
else {
return;
}
}
@Override
public void addListeners() {
// TODO Auto-generated method stub
}
@Override
public AbstractComponent getUI() {
return _ui;
}
@Override
protected void receiveMediatorEvent(Object eventType, Object value) {
// TODO Auto-generated method stub
}
@Override
public void performAction(Object context) throws Exception {
// TODO Auto-generated method stub
}
} |
Something more complete with my style would be the following in AS3 (still not complete complete though):
| Code: | package
{
import flash.events.Event;
import flash.events.EventDispatcher;
/**
* Models a simple finite-state machine (FSM). It is important to note that
* the initial state is permitted to be set ONLY during construction. If the
* statemachine has many final states, it may benefit to set
* copyFinalStatesToStates to true. This will cause states hold all states minus
* the final states, eg.:
*
* States = States - FinalStates
*
* @author Nelson Bermudez-Bassett
*/
public class StateMachine implements IStateMachine
{
private static var _eventDispatcher:EventDispatcher = new EventDispatcher();
private var _states:Vector.<IState>;
private var _initialState:IState;
private var _finalStates:Vector.<IState>;
private var _currentState:IState;
private var _copyFinalStatesToStates:Boolean = false;
//------------- GETTERS
public function get initialState():IState { return _initialState; }
public function get finalStates():Vector.<IState> { return _finalStates; }
public function get currentState():IState { return _currentState; }
public function get states():Vector.<IState> { return _states; }
public function get copyFinalStatesToStates():Boolean { return _copyFinalStatesToStates; }
//------------- SETTERS
/**
* Flag for setting whether to return final states in states() call
* collection.
*
*
* @param Boolean If set to true, all final states are copied to state
* list, thus states() returns all states in the machine. If false,
* final states are not returned in states() and must be fetched
* explicitely through finalStates().
*/
public function set copyFinalStatesToStates(value:Boolean):void {
if (finalStates.length = null) {
_copyFinalStatesToStates = value;
};
else
for each(var state:IState in finalStates) {
for each(var state1:IState in states) {
//TODO: what is equality? Myhill-Nerode relation.
if (state1 == state2) {
}
}
}
}
//------------- CONSTRUCTOR
/**
* A state machine must define at least one state, which is the initial
* state. Any further states are optional.
*
* @param initialState
* @param ...mStates
*/
public function StateMachine(mInitialState:IState, ...mStates):void
{
_currentState = _initialState = mInitialState;
_states.push(_initialState);
for each(var i:IState in mStates)
{
states.push(i);
}
}
//------------- METHODS
/**
* Adds all IStates passed in parameter list to statemachine.
* Does not unpack any states packed into a collection.
*
* @param ...mstates Parameters representing set of states.
*/
public function addStates(...mStates):void {
for each(var i:IState in mStates) {
//TODO: Make sure state.name is unique before adding.
_states.push(i);
}
}
//TODO: Code to define transition
//TODO: Transitions should only be allowed between states which are
//defined for the state machine at time of definition
//TODO: Only one transition per a given input should be allowed. After all,
//there can't be two current states.
/**
*
*/
public function defineTransition():void {
}
/**
*
*/
public function defineTransitions():void {
}
/**
* Minimizes a FiniteStateMachine instance removing dead and
* unreachable states as per Hopcroft's algorithm. It returns a list
* of the states and transitions removed. Please note that this
* operation is <b>DESTRUCTIVE</b>, it does not return a new minimized
* FiniteStateMachine, instead it alters the called
* FiniteStateMachine's states and transitions. The resulting
* StateMachine is considered equivalent to the original.
*
* Algorith runtime: O(|A|.N.log2(N))
*
* |A|: Size of Alphabet
* N: Number of States
*/
public function minimize():void
{
var p:Vector.<Vector.<IState>> = new <Vector.<IState>>[finalStates];
var s:Vector.<IState> = new Vector.<IState>();
for each(var trans:ITransition in states) {
//populate S
}
while (s.length != 0) {
}
}
/**
* Returns a vector containing all states that lack an outbound
* transition, or only have outbound transitions to themselves.
*
* @return Vector.<State> representing dead states in machine.
*/
public function deadStates(stateMachine:StateMachine):Vector.<IState>
{
var deadStates:Vector.<IState> = new Vector.<IState>;
for (var i:uint = stateMachine._states.length; i > 0; i--)
{
}
return deadStates;
}
/**
* Removes and returns a vector containg all states which are not
* reachable from the initial state.
*
* @return Vector.<State> representing unreachable states in machine.
*/
public function unreachableStates(stateMachine:IStateMachine):Vector.<IState>
{
var reachable:Vector.<IState> = new Vector.<IState>(stateMachine.states.length);
reachable.push(stateMachine._initialState);
for (var i:uint = stateMachine._states.length; i > 0; i--)
{
}
return reachable; //set - reachable
}
/**
* Returns a string representation of the finite statemachine in the
* following form:
* [states, initialState, transitions, finalStates]
* @return String
*/
public function toString():String {
return "";
}
/**
* Checks if a state-machine has a start state. If strict is set
* to true, then it also checks to make sure that there exists
* a path from a start state to an end state. If no end state
* exists for the state-machine, then it behaves the same as if
* strict was set to false. This does not guarantee that there
* exists only one path, or that their is only one (reachable) end state.
*
* @param Boolean Represents whether to check if there exists
* a path from start state to an end state.
*
* @return Boolean true if the statemachine has a start state,
* false otherwise. If strict is set to true, the statemachine
* must also have a path from start state to a final state.
*/
public isValid(strict:Boolean = false):Boolean {
}
/**
* Check if there exists a path between two given states.
*
* @param
* @param
*
* @return Boolean Returns true if there exists a path,
* false otherwise.
*/
public existsPath(stateA:IState, stateB:IState):Boolean {
}
}
} |
_________________
This is the inception of deception, checking the depth of your perception.
 |
|
| Back to top |
|
 |
Evil_Intentions Expert Cheater
Reputation: 65
Joined: 07 Jan 2010 Posts: 214
|
Posted: Mon Mar 04, 2013 1:12 pm Post subject: |
|
|
Didn't really get a chance to look over it, but what stood out is your handleAction method. Try using a switch statement int there to clean it up.
I'll look at it a bit more later, I have to cram for a calc 2 midterm atm. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|