Uncategorized

Android ImpulseShopper released

About ImpulseShopper(pre-beta) is application that lets you monitor your favorite daily deals websites like woot.com, 1saleaday.com, dailysteals.com etc… Includes both widget and full blown application. Engine based Filters Product thumbnails Share via SMS, Email, Twitter Notifications Deployed on Google AppEngine Screenshots [nggallery id=7]

HashTable implemented using quadratic probing for collision resolution

Using quadratic probing for collision resolution #define ERROR_TABLE_FULL -1 #define ERROR_RECORD_NOT_FOUND -1 #define ERROR_DUPLICATE_RECORD -1   class HashTable{ public: HashTable(int table_size); int insert(const string &record); int retrieve(const string &record); private: int hash(const string &record); int hash_size; int record_count; string* table; };   /** * Constructor accepting table_size */ HashTable::HashTable(int table_size){ hash_size = table_size; table = …

HashTable implemented using quadratic probing for collision resolution Read More »

HashTable implemented using linear probing for collision resolution

Using linear probing for collision resolution in hashtable   #define ERROR_TABLE_FULL -1 #define ERROR_RECORD_NOT_FOUND -1 #define ERROR_DUPLICATE_RECORD -1   class HashTable{ public: HashTable(int table_size); int insert(const string &record); int retrieve(const string &record);   private: int hash(const string &record); int hash_size; int record_count; string* table; };   /** * Constructor accepting table_size */ HashTable::HashTable(int table_size){ hash_size …

HashTable implemented using linear probing for collision resolution Read More »

Display all managed-beans in JSF at runtime

Sometimes we like to see whats going on under the hood of jsf application (Checkout my JSFConsole). One such task is being able to display all the registered managed-beans during runtime. Here we can see all registered beans, including implicit object(cookie,header,param etc…) Result a4j a4jSkin ajaxContext ajaxHandler application applicationScope beeHive — My Managed bean cookie …

Display all managed-beans in JSF at runtime Read More »

Remove/Change default constraints sql 2000/2005

Problem When we add default constraint on a field it is automatically assigned a name in following format Format: DF__tablename__PARTOFFIELDNAME__HASHCODE Example: DF__scheduled__CREAT__00DF2177 DF__scheduled__MODIF__01D345B0Format: DF__tablename__PARTOFFIELDNAME__HASHCODE Example: DF__scheduled__CREAT__00DF2177 DF__scheduled__MODIF__01D345B0 HashCode part of the format is different on each database so we can’t just find the name of constraint and use that in our alter script. That’s when …

Remove/Change default constraints sql 2000/2005 Read More »

Serving resources using Resource PhaseListener

PhaseListener designed to serve resources like css, javascript, images, pdf etc.. from jar file ResourcePhaseListener.java All required files can be downloaded here. package com.gregbugaj.jsfdump.console;   import java.io.IOException; import java.io.InputStream; import java.util.HashMap; import java.util.Map;   import javax.activation.MimetypesFileTypeMap; import javax.faces.context.FacesContext; import javax.faces.event.PhaseEvent; import javax.faces.event.PhaseId; import javax.faces.event.PhaseListener; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse;   import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; …

Serving resources using Resource PhaseListener Read More »

Manually firing Quartz scheduler jobs

Exactly what the title says, this snippet will fire all job for all schedulers registered. // Get our scheduler factory StdSchedulerFactory schedulerFactory = new StdSchedulerFactory(); Collection<Scheduler> schedulers=schedulerFactory.getAllSchedulers(); for(Scheduler scheduler:schedulers){ System.out.println("scheduler "+scheduler.getSchedulerName()); String[] groups=scheduler.getJobGroupNames(); for(String jobGroup:groups){ System.out.println(" ** GROUP="+jobGroup); String[] jobNames=scheduler.getJobNames(jobGroup); for(String jobName:jobNames){ System.out.println(" ** jobName="+jobName); //Fire actuall job scheduler.triggerJob(jobName, jobGroup); } } }// Get our …

Manually firing Quartz scheduler jobs Read More »