April 10, 2026

How to Structure a 12-Week Cycling Training Plan

Why 12 Weeks Is the Sweet Spot for Structured Training

A 12-week training block is long enough to drive meaningful physiological adaptation — mitochondrial growth, FTP improvement, and endurance development all require 8–12 weeks of progressive stimulus to fully manifest. It’s also short enough to maintain focus, adjust to life circumstances, and retest your fitness with a clear before-and-after comparison.

https://personalbestpace.com/how-to-structure-a-12-week-cycling-training-plan/

September 13, 2012

foursquare badges, getglue stickers and more

for the last couple of months I have been busy with them :) pretty fun to track them
the applications contains simple term call gamification:
wiki definition:
Gamification is the use of game design elements,[1] game thinking and game mechanics to enhance non-game contexts

So do something in the app and get your achievement now

Foursquare

foursquare : no defition needed I guess
all the badges and badge wallpaper and more badges on their google map
application that you


Untappd

same for
untappd : drink share and get your badges
untappd badges and badges wallpaper

Getglue


Getglue: Share what you are watching on tv and get your stickers (not badges :) )
Getglue stickers, getglue sticker times,timeline or calendar getglue sticker wallpaper

hope you like achivy :)


December 16, 2008

new blogs

hi,
here are new blogs.
hope you'll like them

December 11, 2007

altuure.com on air

hi,
from now on I'll be bloging on my domain :)

www.altuure.com

November 14, 2007

Iterations for SOA

SOA platform migration plan.

Resolve Dependency Among Applications

If you are planing to move your old applications to a SOA platform for all its benefits. You should resolve the dependency and the relation between applications. Any direct database/file/library access should be clearly defined.

Write Clear Interfaces to Connect Applications(WS)

Refactor your applications and extract interfaces that will be used among applications. You can easy export those interfaces with your app server or use XFIRE for easy wsdl and webs ervices.
This steps also includes java/XML binds XSD/WSDL definetions.

Generate notifications for external Listener(JMS)
to bind listeners, applications should trigger event via JMS. you can create Queues for any third party implementations.

Extract Process form code base to a BPM engine
define your process add flow via a visiual BPM/BPEL editor add run your process on the machine






September 28, 2007

moving to my notebook :)

Yesterday I got my notebook and today I am busy with it:)
or let's say enjoying it:)

nice notebook pretty notebook I'll format you delete all files, I'll setup lot of project nice notebook pretty notebook

And As you can guess I will be whole week event :)

what I have done up to now

jdk 6u2
idea 6.0.6
maven 2.0.7
postgres 8.2
tortoisesvn
firefox

and checkout my projects to test the performance :)

July 3, 2007

Multi-Tier Clusters

Today most of projects are build upon a composite structure that has multiple different APIs. Since many of them is unaware of the others and has its of implementation and dependency , every one of them should be have its own configuration which will make them work as a single application.

This is the hard point in fact "To bundle them in single application"

An Example:

in a sample medium size application like AppFuse would be using Hibernate/JPA, Acegi,SpringFramework,JasperReports, JSF, Tomcat/Jetty and so on. it is all good even perfect when you are run in a single JVM. but if you want to build a cluster for only a load balancing you should configure every one by one.


In other world you be building a multi tier cluster for each APIs , which would be harder rhan implemation for some old fashioned singleton type application (a type of application which has lots of static variable and caches)

your applcation would be looking like this.


what should be your success criteria

performance : cluster should not slow down the application in a critical point
transaction: any rollback should be noticed
failover: in case of any instance fail over any other one can replace it.
seamless: the cluster mode should be seamless. should be hidden behind proper interfaces


today most open and commercial API support clusters. but in most cases you would implement a yous own schema for your own needs . before start you should read some articles about "Distributed Application" , you can use any distributable caching, maps, or JMS bridges between your components

June 13, 2007

Clustering Acegi via JGroups (DistributedHashtable)

moved my blog to altuure.com
please click to continue
http://www.altuure.com/2007/12/23/clustering-acegi-via-jgroups-distributedhashtable/

May 28, 2007

anti-JSF thoughts

blog post moved to altuure.com

anti-JSF thoughts

May 7, 2007

Rapid Java : Part I (Platform)

For rapid and non-painful development and products here's some java libraries (startup dependencies)  I choose from bottom to top:

Module I: Core
  • postgresql / mysql / hsql depends on project's size if you don't large size of startup data try to use hsql
  • log4j : logging (alternative commons-logging)
  • hibernate: Simple and high quality open source ORM (alternative:)
  • springframework:  high quality IoC container and very good integration library (a framework to rule them all)
  • quartz: scheduled task
  • osworkflow: Simple workflow and state engine, to manage actions and states
  • velocity: simple and useful template engine for formatted text/html/csv outputs (alternative freemarker)
  • beanshell for providing business point (alternative groovy)
  • acegi: Authentication and authorization
Module II : Report
  • jfreechart:for impressive charts
  • jasperreport: for pdf reports
  • mondrian: for BI
  • jxls: for excel reports
Module III: Web Layer
  • Struts : here, you have lots of choice from popular jsf to tapestry,spring mvc, I choose struts because of two reason simple life cycle and it is action based current I am STILL using struts  1.2.x  but I will move to Struts2
  • Prototype.js  standard js for web 2.0
  • script.aculo.us very useful js lib for effects and more
  • DWR for extra js calls from client browser to your java codes
  • displaytag: very useful jsp taglib
  • jstl: standard jsp taglib
  • tomcat/jetty: choose one that you are familiar

It looks so complex at first sight and I'm sure it could be so painful to you but where All become one you would have quite clear Framework. 
for how to integrate them look at appfuse.

What is missing?
 your  application specs you can need JMS (eg: activemq)  ,networking (eg:jgroups) libs 

April 30, 2007

"Too many open files" but what are they?

java.io.FileNotFoundException: /opt/tb55/s3/conf/web.xml (Too many open files) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:106)
this shows the open file limit has been reached.. you can check this by JMX
java.lang:type=OperatingSystem >  OpenFileDescriptorCount


but what are these files ? you can see this by linux shell script

lsof -u tomcat

solution: increase systems open file limit !!!

vi /etc/security/limits.conf

and edit the line to increase open file limit

* soft nofile 3072
* hard nofile 4048

April 12, 2007

Clustering Acegi

Acegi is a well known security framework. Some really good features:
  • method level based security configuration
  • url level auth configuration
  • easy login mechanism
  • so on.
But there only one point that is missing in current version (1.0.3) distributable SessionRegistry, in fact there is one implemantion to this interface but it do not support multiple JVM.This is used for concurrent access with username.

Quick Fix:
replace the Maps in SessionRegistryImpl with your distributable caching mechanism (can be ehcache,oscache,vs) and reimplement it. Or you can use some JMS mechanism to fix this cap but it should be used only in complex architectures.

Acegi Concurrent Setup:

<bean id=" org.acegisecurity.concurrent.SessionRegistry" class="org.acegisecurity.concurrent.SessionRegistryImpl"/> <bean id="org.acegisecurity.concurrent.ConcurrentSessionController" class="org.acegisecurity.concurrent.ConcurrentSessionControllerImpl"> <property name="maximumSessions"> <value>1</value> </property> <property name="sessionRegistry"> <ref local="org.acegisecurity.concurrent.SessionRegistry"/> </property> <property name="sessionRegistry" ref="org.acegisecurity.concurrent.SessionRegistry"/> </bean> <bean id="org.acegisecurity.AuthenticationManager" class="org.acegisecurity.providers.ProviderManager "> <property name="providers"> <list> <ref local="org.acegisecurity.providers.dao.DaoAuthenticationProvider"/> <ref local="org.acegisecurity.providers.anonymous.AnonymousAuthenticationProvider"/> </list> </property> <property name="sessionController" ref="org.acegisecurity.concurrent.ConcurrentSessionController "/> </bean> <bean id="org.acegisecurity.concurrent.ConcurrentSessionFilter" class="org.acegisecurity.concurrent.ConcurrentSessionFilter "> <property name="sessionRegistry" ref="org.acegisecurity.concurrent.SessionRegistry"/> <property name="expiredUrl" value="/myself/"/> </bean>




And add org.acegisecurity.concurrent.ConcurrentSessionFilter to your filter list

PS:
check my new blog Clustering Acegi via JGroups (DistributedHashtable)

April 11, 2007

when do not generate code !

     Currently code generation is very common way of some handling common repeating code fragments and some initial setup task like startup configurations and so on. Some clear benefits are:
  • ease your setup process
  • protects your code form some common coding mistakes
  • maintain some coding pattern practices and standards.
  • keep your effort on complex tasks
But on the other hand when you evaluate code generator or while writing your code should thing about " why you generate this code ? and not writing some generic component to evolute such business"
 this is the most common mistake while using this technology. you generate code to customize the generated code. If you not need this fragment to customization. DO NOT GENERATE IT. otherwise in most case any enhancement in these fragments will require great effort or worse (to generate again).

so what is important.
  • more less code generated more perfect it is
  • more easily you customize it more useful it is
Some code generators:
http://www.codegeneration.net/

March 26, 2007

URI Encoding for tomcat 5.5.X

encoding problem with paramater while GET ?

for tomcat 5.5.x

http://split-s.blogspot.com/2005/12/internationalized-get-parameters-with.html

<Server ...> <Service ...> <Connector ... URIEncoding="UTF-8" /> ... </Connector> </Service> </Server>

March 25, 2007

moved to postgres

I change my development database to postgres SQL for a several reasons :
  • I'am bored to mysql :)
  • mysql do not give me entreprise database trust: looks so simple even too simple to offer to my customers. it suites for less complicated fast application.
  • Last but most important reason it its Licensing !!!
Since I am very new to postgres I am playing with it. looking for new features and trying to solve compatibility problems :(

One good referance for people like me :

http://en.wikibooks.org/w/index.php?title=Programming:Converting_MySQL_to_PostgreSQL

PS:
since I am using hibernate and so on no development required for this migration...

December 11, 2006

Core and Render Services

While implementing software systems you have two different major issues.
  • Implementing Core Functions: Can be considered as commit transactions( Insert records, transfer files to legacy systems, batch imports) . These methods are atomic and can change the entire data for the whole system.
  • Rendering data as Human Readable Form. All Forms, lists, Reports can be considered in this case. There is no data change in background system but only export of this system.
When you distinguish these two system you can separate the implementation of these functionality. CoreService,RenderService.

  • CoreService: have transactional service methods. Each method is a atomic unit and as a whole the services capture whole system functions.So they are reusable
  • RenderService: Can be implemented depending on the domain. Either Web Technologies, reporting or desktop applications. Each domain have its own constraints so unlike CoreService these methods are hardly reusable.
Here is sample Dependency Diagram.

Sample Flow would be like:
  1. User request page with a GET method
  2. Render Service render the html and form.
  3. User fills the forms and POST the data
  4. Core method reads the data from request and commit the transaction
  5. Redirect the request to and URL
  6. Another GET and render Case

With this pattern you support and increase the separation of concern and increase the abstraction layer.

For java web applications, it would be best to use a action oriented framework like Struts suits well for the pattern

November 12, 2006

Load Balance and Cluster Setup for Tomcat via Apache 2.2


for updated version please visit

http://www.altuure.com/2007/12/03/complete-apache-22-ajp-load-balance-via-mod_proxy/



Hello, here I will try to describe a sample configuration of a multiple tomcats and one APACHE for load balancing and identical tomcat server instances. These tomcat instances will be identical since they serve the same application 'medya'. This sample is based on opensuse 10.1 Remastered with apache 2.2 and tomcat 5.5.20. It’s done for a server with 16GB RAM and 4 CPUs and jvm only enable 2 GB heap size


main purpose is using same tomcat-home for diffrent tomcat-bases for identically same tomcat instances


Part I: Tomcat Cluster and Linux Service definitions

First download and extract the tomcat 5.5.x to /usr/tomcat55 this will the unique tomcat home for our tomcat instances. Same tomcat instance count will be 3 (s1,s2,s3). Then replace server.xml with the same file at the attachment. This file contains simple variable configuration like

<Server port="${tomcat.server.port}1" shutdown="SHUTDOWN"> .... <Connector port="${tomcat.server.port}2 ...

variable are given as external jvm parameters for the same configuration file.

tomcat.base: standard tomcat variable for common base jars files names and shell scripts.
tomcat.server.port: used in the configuration file as port prefix
${tomcat.server.port}1: Shutdown port
${tomcat.server.port}2: http connector port
${tomcat.server.port}3: ajp connector

eg:if tomcat.server.port:771 then shutdown port will be 7711, http will be 7712,ajp will be 7713

tomcat.server.name: tomcat server name for load balancing and cluster

and sample tomcat cluster configuration

then create a directory for first tomcat base. /opt/tb55/s1 and link file system to base tomcat instance I do this sample on a single computer and it can be done over a network since the files are only used at startup for very limit size. and copy same base for more

mkdir /opt/tb55
mkdir /opt/tb55/s1
ln /usr/tomcat55/conf /opt/tb55/s1/conf -s
ln /usr/tomcat55/shared /opt/tb55s1/shared -s
mkdir /opt/tb55/s1/logs
mkdir /opt/tb55/s1/temp
cp /usr/tomcat55/webapps /opt/tb55/s1/webapps -R
cp /opt/tb55/s1 /opt/tb55/s2 -R
cp /opt/tb55/s1 /opt/tb55/s3 -R

Up to we build single tomcat home and three tomcat base. these instances have same library with different applcation base(webapps),log and temp directories.

Part II: Defining and starting tomcats as linux service in a cluster structure.

copy the service.sh to /usr/tomcat55/bin it will be standard startup script. this script is based upon the script at link. and copy startup script tb-s1,tb-s2,tb-s3 to /etc/init.d for service definition.

content of tb-s1 (tomcat 1 service script)

TOMCAT_USER=tomcat
PP=771
export CATALINA_NAME=s1
export CATALINA_PORT=`echo $PP`1
export CATALINA_BASE=/opt/tb55/$CATALINA_NAME
export CATALINA_HOME=/usr/tomcat55
export CATALINA_TMPDIR=$CATALINA_BASE/temp
export CATALINA_NAME=s1
export CATALINA_LOCK=$CATALINA_BASE/$CATALINA_NAME.lock
export CATALINA_PID=$CATALINA_BASE/$CATALINA_NAME.lock
export JAVA_OPTS="-Duser.language=en -Dtomcat.server.port=$PP -Dtomcat.server.name=$CATALINA_NAME -Dcom.sun.management.jmxremote"
export JAVA_HOME=/usr/java/jdk1.5.0_05
chown $TOMCAT_USER:$TOMCAT_USER $CATALINA_HOME -Rh
chown $TOMCAT_USER:$TOMCAT_USER $CATALINA_BASE -hR
chown $TOMCAT_USER:$TOMCAT_USER $CATALINA_TMPDIR -Rh
su $TOMCAT_USER -m -c "/usr/tomcat55/bin/service.sh $1"

As you see this contains variables for server.xml and jvm options you add or remove yours. this service will be run as a system user tomcat.

now you can add this service as system service


chkconfig --add tb-s1
chkconfig --add tb-s2
chkconfig --add tb-s3

Part III: Defining AJP connector ,proxy and load balancer for APACHE

put mod_proxy_balancer.conf to /etc/apache2/conf.d

this file contains all configuration for

proxy_ajp_module: for tomcat ajp connector used by proxy module

proxy_module: used by apache to support for proxy
proxy_balancer_module: used to load balance application context over different tomcat instances

LoadModule proxy_module /usr/lib/apache2/mod_proxy.so
LoadModule proxy_balancer_module /usr/lib/apache2/mod_proxy_balancer.so
LoadModule proxy_ajp_module /usr/lib/apache2/mod_proxy_ajp.so
<Location /balancer-manager>
SetHandler balancer-manager
</Location>
<Proxy balancer://medyaCluster>
BalancerMember ajp://localhost:7713 route=s1
BalancerMember ajp://localhost:7723 route=s2
BalancerMember ajp://localhost:7733 route=s3
</Proxy>
<Location /medya>
ProxyPass balancer://medyaCluster/medya stickysession=JSESSIONID
</Location>


and restart apache2 service

Part IV: Deploying Sample application

simple put you application folder to /home/tomcat/medya

and out medya.xml to /usr/tomcat55/conf/Catalina/localhost/medya.xml

<Context docBase="${user.home}/medya" distributable="true" path="/medya"></Context>


I hope you enjoy your application :) .

Sorry for formating :(

tomcatsetup.tar.gz




for updated version please visit

http://www.altuure.com/2007/12/03/complete-apache-22-ajp-load-balance-via-mod_proxy/

maven profiles



moved to altuure.com


please visit http://www.altuure.com/2008/11/13/maven-profiles/