3 differences between @ include ^ jsp:inclue

What's included? is the raw “file content” included or the translated “response” included?

When u edit the file, is it accessed at the next request?

At what points during the processing flow do the 2 insertions occur?


php oo xx notes

static method is known as “class method”, just like in java. But “static” in php has non-OO meanings too.

setting a variable to null would help the GC, just like in java.

cmp -> hibernate

UBS用的基本上都是CMP,现在已经开始用hibernate了。但不是所有项目都用。hibernate 只能说是刚开始使用。一些小的project中用到。以后的趋势肯定是会逐渐用到多数项目中。

hibernate确实不错,现在流行用spring和hibernate结合,spring framework做transaction management. hibernate 做data access object. 搭配使用,效果不错。

记得你说不久前 UBS 改用 Hibernate. 在这之前是不是用 CMP?

我逐渐感觉到, 对于大机构, 数据量庞大, 数据之间关系异常复杂, Normalize 之后可达到几百上千个表. 所以任何与数据处理相关的技术和流程都要求严格, 也不惜重本.

我觉得能达到这种要求的 Object/Relational Mapping 技术, 只有 CMP, Hibernate, JDO, Oracle Toplink 这几种. 恐怕还是 CMP 资格最老, 用的最多吧?

me as a good team player

see also [[ rare qualities ] developers ]]
see also [[ strengths.xls ]]

Background: wall street values team players.

#1) fairness and an objective mind is kind of rare but extremely important
* helping new comers
* helping initially slow learners
* helping older colleagues
* feeling and showing gratitude
* documentation designed for teammates
* taking initiative for knowledge sharing. my emails
* cross-cultural
* open-communications with due respect to confidentiality. not “selective sharing”
* defending the vulnerable and victims
* owning up to mistakes, in public
* no air of superiority. Approachable
* no favoritism
* no personal attack

runtime-binding ] fttp parser

Note: Strategy pattern is not yet adopted here but more flexible than polymorphism.

* case: a default setAid() in super to be overridden by subclass to implement a /specialized/ formula
* case: getVpi() returns empty string in the base class (OLTUplinkPort) where there’s no “vpi” slot. In the ATM* subclasses, getVpi() returns the vpi slot.
* case: abstract isValid() declared in interface Validity.java.
* case: isSSCFIAccessible() is calculated differently for each building block class

“dynamic binding” is also known as dynamic dispatch. Compiler doesn’t know which version of the method to “bind the name to”. Only at runtime can the jvm put its finger on the most specialized subclass implementation.

In a circuit we have a list of CircuitElements objects, sitting on various levels of the inheritance hierarchy. We invoke isValid() on each. Some will run the isValid() inherited from a parent class, some will run the grand-parent’s implementation, but jvm ensures the most *specific* implementation in each case is chosen to run.

hibernate transaction — a comprehensive intro

— from http://www.hibernate.org/42.html, which also covers ejb, cmt, jdbc, interceptor …

1-sentence intro: Usually you also flush a Session at the end of a
unit of work to execute the SQL DML operations (UPDATE, INSERT,
DELETE) that synchronize the in-memory Session state with the

Hibernate disables or expects the environment (in J2EE/JEE) to disable
auto-commit mode

— sess vs tx
A single Hibernate Session might have the same scope as a single database transaction. DB server probably maintains a session for each connection. I would speculate

1 hib-session – 1 server-session

— hibernate && jta
Hibernate works in any environment that uses JTA, in fact, we recommend to use JTA whenever possible as it is the standard Java transaction interface. You get JTA built-in with all J2EE/JEE application servers, and each Datasource you use in such a container is automatically handled by a JTA TransactionManager.

— no jta@@
If you don’t have JTA and don’t want to deploy it along with your application, you will usually have to fall back to JDBC transaction demarcation. Instead of calling the JDBC API you better use Hibernate’s Transaction interface

Re: NextGen server mean time to failure?

(A draft email) Hi,

Thanks for your quick reply. Sorry I’m unable to give any suggestion. Just some nagging worries. I’m trying to be critical yet objective.

My experience suggests that many java-based daemons are fairly susceptible to degradation with a concurrent load level high enough. Similar to denial-of-service attacks.

I’m not easily convinced that any piece of software (including my favorite — apache httpd) can keep up performance without restart for a few months under heavy load. For example, over 20 years solaris went through continuous improvements in terms of self-healing, daemon/service availability — a clear sign that the system can sustain “injuries” and lose performance. If it can happen to OS, what is immune?

I remember Siva told me the FTTP workload could be quite high and it’s not easy to handle that load. I think he said a few thousand cases a day. Will keep us busy:)

tan bin

container managed relationships, in a Lead-management system

Let’s read about cmr and cross check Binu’s observations

Lead management system, with 60 tables, each represented by a cmp bean.

in only 2 cases, the inter-bean relationship was managed by container-managed relationship. One of the 2 was the Lead-Address relationship, where each lead id is linked to an Address bean. When container loads a particular Lead beam from the DB, the associated Address bean was loaded too. When saving the beans to DB, we used the SLSB to save the Lead bean and the Address bean separately

A: performance. Hibernate has replaced cmr in subsequent projects.
A: The slsb facade is the only “client”. Using local interface.
A: Use ejb-ql.

A: basically nothing but ORM. The entity beans are related as in the DB, so the objects need2b linked up in some way.

Q: Why the majority of the relationships are not by cmr?
Q: how are the cmp beans used in terms of clients?

Q: How does the system know which Address bean to load for a given Lead bean?

Q: j4cmr]this project?

multiple inheritance:unrelated classes sharing methods

This is a limited definition of multiple-inheritance — 2 unrelated classes with unrelated base classes need to share a method (evolving). If you can achieve this, then a class C can inherit methods from many classes.

Let’s say the class hosting the shared method is H. If C can somehow inherit the method from H, then C can also inherit other methods from class G, provided G can immitate[1] H.

[1] sometimes impossible.

Solution 2: IS-A -> HAS-A. Strategy Pattern. Put the concrete method into a helper class, and instantiate an instance of it in each of your “unrelated classes”. P 18 [[ head first design patterns ]] FlyBehaviour.java and QuackBehaviour.java

Solution 1: “global method” ie static method in a utility class. Similar to Arrays .java and Collections .java?

My own design: In nextgen-fttp, 2 classes need the same method parseClli() but the 2 classes already have their own parents

public static String[] parseClli(String clli){
String clliBase, clliExt;
if (clli.length() < 9){
return new String[] {clli, ""};
clliBase = clli.substring(0,8);
clliExt = clli.substring(8, clli.length() );
return new String[] {clliBase, clliExt};

sql tuning — pre-sales and post-sales

pre (ie before turning): keep optimizer mode (optimier stability?)
pre-pre: choose optimizer mode

pre: decide which sql statements to tune
pre-pre: tune the most used sql – OR – most disk-read sql?
pre-pre: set instance-wide optimizer_mode first before tuning

post (ie after tuning): ongoing ranking of top sql statements to tune

agile methodology %%xp

Challenge: too many agile principles
Sugg: focus on a few, relate to your personal xp, develop stories —
understandable, memorable, convincing

–xp: frequent releases

–xp: devops automation
RTS, Mac

–xp: frequent and direct feedback from users

–xp: frequent changes to requirements

–xp: “Working software is the principal measure of progress”
pushmail: repeated code blocks; many functions sharing 99% identical code;

–xp: “Working software is the principal measure of progress”
nbc: top3.txt (expert brackets) not following mvc

–xp: “Working software is delivered frequently (weeks rather than months)”
nbc: half-finished product with hundreds of bugs are released to user to evaluate

–Agile home ground:

Low criticality
Senior developers
Requirements change very often
Small number of developers
Culture that thrives on chaos

–(traditional) Plan-driven home ground:

High criticality
Junior developers
Low requirements change
Large number of developers
Culture that demands order

real stories illustrat`%%debugging expertise — focus on java

see other stories in j,ora.xls

DNS reload
freebsd NIC driver
custom classloader breaking EJB casting
weblogic upgrade max connection exceeded — ulimit for the shell,
max_tcp_connections, file descriptors

jdbc failures — snoop

weblogic jms XA conn factory; disable catch clause to trigger rollback

2 (custom) class loaders loading the same class — cast exception

nbc firefox and ie gets different dates from the same url. we reduced
the code to the simplest. then i managed to get a
Runtime.getRuntime().exec( “ls /tmp” );

log4j appenders in assignment are from 2 classloaders, but “murderer”
(classloader bug) looks like an accomplice — log4j errors are usually

model-based expert system

Q: why is SSCFI expert system model-based? Why is the model central to this expert system?

* according to published data, the largest body of this expert-system’s “knowledge” is about line records, even though the expert-system’s main job is something else ie diagnosis! This is common among real world expert-systems.

* I guess among expert systems, model-based designs form one well-known type. A one-liner introduction is “An expert system based on fundamental knowledge of the design and function of an object. Such systems are used to diagnose equipment problems, for example.”

* Circuit models help the system survive and continue to function despite 2 difficulties
1) many line records are unreliable — non-standard
2) many test equipments (used to test circuits) are unreliable — often misconfigured

Most if not all of the arguments below are my hypotheses with limited evidence.

* I feel an intelligent expert system can “reason” and use judgement, just like humans do with an internal model. The more comprehensive the model, the more it can reason and make sense of confusing data.

* I feel Fault-isolation may require the system to keep track of test resutls, to be interpreted in context. Circuit model is part of the context.

* I feel test data are perhaps correlated. The relations can be hard to identify. A model helps. A human tester, too, relies on a circuit model to correclate data.

* I feel Test results have patterns, as experienced human testers know. Perhaps patterns about brands and models, about seasons, about circuit types and designs … These could presumably be incorporated into the circuit model