Posts by Tag

java

Re read inputstream in java

less than 1 minute read

Sometimes in java you get an inputstream, you need to process it the first time to process the data then you need it again to output the contents. To do thi...

Set the base url for jsp

less than 1 minute read

Sometimes when you’re working on jsp pages and you need to set a base url for all pages, and this value needs to be available for use, then use the followin...

Java Template pattern

less than 1 minute read

The Template pattern formalizes the idea of defining an algorithm in a class, but leaving some of the details to be implemented in subclasses. Reasons for ...

Java Observer pattern

less than 1 minute read

Observer pattern - one subject many observers, state changes in the subject must be notified to all observers. Observers first register with the subject, on...

Java Overriding vs Overloading

less than 1 minute read

Method overloading, is when method with same name co-exists in same class but they must have different method signature. Method overloading is done via ...

Java String StringBuffer StringBuilder

less than 1 minute read

String is immutable StringBuffer and StringBuilder is mutable StringBuffer is synchronized thread safe. StringBuilder is not thread safe but operation is fa...

Back to Top ↑

programming

Batch programming getting the date

less than 1 minute read

How to get the date in bat? Windows XP.for /f “tokens=1-4 delims=/ “ %%a in (‘date /t’) do (set year=%%a& set month=%%b& set day=%%c& set weekd...

Java toolkit

less than 1 minute read

If you want to use the image manipulation toolkit included with the JDK.when using this in eclipse:Image image = Toolkit.getDefaultToolkit().getImage(“tray.g...

Java pattern matching

less than 1 minute read

case insensitive search for a string      Properties properties = System.getProperties();      properties.list(System.out);      String osname = (String)pr...

Programming java form base authentication

less than 1 minute read

add security-constraint, login-config, security-role into web.xml<security-constraint>        <display-name>securityconstraint</display-name...

Rules for Cleaning logs

less than 1 minute read

Clearing logs or file purging should be done at the systems level and not at the programming or applications level because cleaning logs or deleting files ...

Back to Top ↑

machinelearning

Back to Top ↑

tensorflow

Back to Top ↑

design_pattern

OOP composition vs inheritance

less than 1 minute read

favour composition over inheritance. even though you have common code in the base class and child classes uses those methods it is better to move those com...

The Template Method

less than 1 minute read

use template method when you need a base class to contain a certain behaviour with some base algorithms while having the subclasses implement those other b...

Patterns delegation

less than 1 minute read

use delegation when you need an object to contain behaviour of two other objects containing the same methods.some object pretending to be another object but...

Patterns abstract factory

1 minute read

use abstract factory if you need platform independence, for example if you have an api that creates buttons and you need to modify the library so that you ...

Back to Top ↑

struts

Programming struts redirect howto

less than 1 minute read

struts redirect howto different web contextswebappA sendredirect to webappBString url = response.encodeRedirectURL(“urlwithparameters”);System.out.println(“...

Programming struts tags usage

less than 1 minute read

struts tags usageusing arraylist and mapsdefine in your action<pre>List urlName = new ArrayList();for (Iterator i = st.iterator(); i.hasNext();) {Str...

Struts invalidate session

less than 1 minute read

Create a struts action - LogoutAction.java<pre style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;back...

Back to Top ↑

apache

How to generate certificate for apache2

less than 1 minute read

If you need to setup ssl (‘https’) connections to your apache2 webserver then use the following steps. sudo mkdir /etc/apache2/ssl sudo openssl req -x509...

Apache httpd configuration

less than 1 minute read

Alias /pds /packaging/sun/pds <directory packaging="" pds="" sun=""> Options Indexes Order allow,deny Allow from all </directory> Make changes ...

Apache httpd reverse proxy howto

less than 1 minute read

apache httpd reverse proxy settings howtoLoadModule proxy_module modules/mod_proxy.soLoadModule proxy_ajp_module modules/mod_proxy_ajp.soLoadModule proxy_ba...

Back to Top ↑

network

Unix solaris commands

less than 1 minute read

Use prstat to see the Processes and CPU loadUse vmstat 2 2 to indicate the free memoryUse iostat to see internal disksUse netstat to see network infoUse mpst...

Apache virtualhost mod_proxy example

less than 1 minute read

How to setup a virtualhost in Apache for example same ip apache 80 port -> tomcat 8080 port (use reverse proxy) apache 19080 port -> tomcat 9080 port(...

Back to Top ↑

general

Constant Improvement

less than 1 minute read

Must have constant improvement.Go over each topic.Create examples for each topic.Doesn’t matter if it takes time, that is what improvement means.

What is web 2.0

less than 1 minute read

web 1.0 people just put their static information on the webweb 1.5 some interactivity mainly online shoppingweb 2.0 is all about interactivity and communicat...

Back to Top ↑

maven

Basic Maven Commands Part 3

less than 1 minute read

use jetty to run program To use the Jetty Plugin just add the following in your pom.xml: <project> ... <build> <plugins> &l...

Basic Maven Commands Part 2

less than 1 minute read

Here are some basic maven commands for setting up your project: JavaWebapp mvn archetype:generate -DarchetypeArtifactId=maven-archetype-webapp -DgroupId=co...

Maven dependency management

less than 1 minute read

Maven dependency management Scenario: jar file from repository not in the format you want. <pre style="background-color: #eeeeee; border: 1px dashed rgb(1...

Back to Top ↑

docker

Back to Top ↑

gcp

Back to Top ↑

vuejs

Back to Top ↑

management

Bad way of doing things

less than 1 minute read

Things NOT to do:how not to do thingsdon’t just do, confirm the requirements in writing before implementing.reduce the risk of customers saying i didn’t ask ...

Environment setup

less than 1 minute read

Must have a environment setup so that the company can run right.Must have a file server where commonly used files can be stored eg. slide templates.This ca...

Back to Top ↑

spring

Spring webservices part 2 jax-ws example

2 minute read

This is a simple example of webservices using jax-ws spring component.It is a contact application that allows you to store your addresses.The webservice retr...

Spring webservices example part 1

3 minute read

This is a blog on how I implemented webservices using the spring framework.In part 1 we setup a simple spring web application. A simple contactapplication wh...

Back to Top ↑

firebase

Back to Top ↑

ldap

LDAP getting the previous dn

less than 1 minute read

public static String getPreviousDN(String dn) { String retString = null; try { DirContext DirCtx = DriverLocator.getInstance().get...

Back to Top ↑

hibernate

Programming hibernate annotations example

1 minute read

Hibernate annotations - hibernate without the mapping filesnote: you must use jdk1.5, hibernate 3.2 core and annotationscreate hibernate.cfg.xml<pre st...

Back to Top ↑

servlets

Back to Top ↑

eclipse

Back to Top ↑

mdb

Jboss mdb example

1 minute read

This is an example on writing a Message Driven Bean in JBossif you decide to use jboss as your application servercomponents usedjboss-4.0.5.GAeclipse 3.2xdo...

Back to Top ↑

jboss

Jboss mdb example

1 minute read

This is an example on writing a Message Driven Bean in JBossif you decide to use jboss as your application servercomponents usedjboss-4.0.5.GAeclipse 3.2xdo...

Back to Top ↑

webservices

Spring webservices part 2 jax-ws example

2 minute read

This is a simple example of webservices using jax-ws spring component.It is a contact application that allows you to store your addresses.The webservice retr...

Back to Top ↑

linux

Installing libav on Ubuntu 14.04 Trusty

4 minute read

Requirement: Got a video that was encoded using HEVC, couldn’t play it on my device so have to convert it to mpeg4. The tool ffmpeg was replaced in previous...

Back to Top ↑

android

How to add gcm messaging to your app

1 minute read

If you tried the gcm playground and it does not work then try gcm quickstart tutorial. git clone https://github.com/googlesamples/google-services.git You ...

Back to Top ↑

jenkins

Back to Top ↑

gradle

Back to Top ↑

jsp

Set the base url for jsp

less than 1 minute read

Sometimes when you’re working on jsp pages and you need to set a base url for all pages, and this value needs to be available for use, then use the followin...

Back to Top ↑

ASUS

Back to Top ↑

RT-AC55UHP

Back to Top ↑

ENTWARE

Back to Top ↑

transmission

Back to Top ↑

entware

Back to Top ↑

spring boot

Back to Top ↑

microservice docker

Back to Top ↑

backups

Back to Top ↑

systemintegration

Back to Top ↑

cacti

Back to Top ↑

payments

Back to Top ↑

compute-engine

Back to Top ↑

cloud-storage

Back to Top ↑

firestore

Back to Top ↑

prometheus

Back to Top ↑

apple

Back to Top ↑

ios

Back to Top ↑

swift

Back to Top ↑

gitlab

Back to Top ↑

ci

Back to Top ↑