Skip to content

Instantly share code, notes, and snippets.

View hugithordarson's full-sized avatar

Hugi Thordarson hugithordarson

View GitHub Profile
/**
* Instantiates a java object of the given class and applies the values from the given JSONObject.
*
* @param <E> The type to create
* @param json The JSONObject to convert
* @param objectClass Class of the type to create
* @return An instance of the specified class
*/
public static <E> E objectFromJSON( JSONObject json, Class<E> objectClass ) {
try {
#import "Controller.h"
@implementation Controller
- (IBAction)fetch:(id)sender {
NSMutableArray *fetchedItems = [NSArray arrayWithContentsOfURL:[NSURL URLWithString:@"http://hugi.karlmenn.is/d/plist.plist" ]];
items = fetchedItems;
for( NSDictionary *d in items ) {
for( NSString *key in [ d allKeys ] ) {
NSTableColumn *column = [table tableColumnWithIdentifier:key ];
/**
* Create a callable statement from procedure string and parameters
*
* @param procedure String format for oracle procedure( i.e. {call VERE.Owner.OWNE_INSX ( ?, ... ) } )
* @param parameters NSArray containing the parameters in the same order the procedure expects them
* @throws SQLException
*/
public static CallableStatement createCallableStatementWithParametersFromArray( String procedure, NSArray parameters ) throws SQLException {
// We use the connection information in the Ekja EOModel.
/**
* Call VERE_SP_3302 to get the transaction number for the operator
*
* @param username String username of the user that calls the procedure
* @param permno String permno of the vehicle
* @param startdate NSTimestamp date when the operator was registered
* @param enddate NSTimestamp date to set as last date of operator
* @param persidno String persidno of the operator to remove
* @param operserno int serial number of the operator( in the OPER table )
* @param mainoper String is the operator the main operator( 1 or 0 )
@hugithordarson
hugithordarson / ObjectLink.java
Created December 19, 2011 11:44
Tomcat problems
@hugithordarson
hugithordarson / gist:1497082
Created December 19, 2011 12:50
CayenneDataObjectEncoder.java
package is.landsvirkjun.admin.util;
import java.util.HashMap;
import java.util.Map;
import org.apache.cayenne.CayenneDataObject;
import org.apache.cayenne.DataObjectUtils;
import org.apache.cayenne.ObjectContext;
import org.apache.tapestry5.ValueEncoder;
1. Innsetja Eclipse 4.3 EE
2. Innsetja WOLips
http://jenkins.wocommunity.org/job/WOLips43/lastSuccessfulBuild/artifact/temp/dist/
3. Innsetja WebObjects
http://wiki.wocommunity.org/download/attachments/4620419/WOInstaller2013_08_10.jar?version=1&modificationDate=1376164569536&api=v2
java -jar WOInstaller2013_08_10.jar 5.4.3 c:\Apple
4. Setja inn properties-skjal (wolips.properties)
package informix;
import java.util.Date;
import com.webobjects.eoaccess.EOEntity;
import com.webobjects.foundation.NSDictionary;
import com.webobjects.foundation.NSMutableDictionary;
import com.webobjects.foundation.NSTimestamp;
import com.webobjects.jdbcadaptor.JDBCAdaptor;
import com.webobjects.jdbcadaptor.JDBCExpression;