what would put an offer from Release to Hold

If the logic is really simple (a few lines of code), it may be tempting to duplicate the code a few places rather than refactor to extract a method. A few hidden drawbacks —

1) what if the logic changes? have to change several places.

2) even if the logic rarely (never say never) changes, see the email chain below for another reason.

In the re-architecture, it may be worthwhile to have a simple façade method “changeReleaseToHold()”, so we can quickly scan the source code (in IDE or grep) to see how many places call it.


Make sure no one could easily bypass this choke point.
_____________________________________________
From:…..
Please let me know in case you have a list of such rules which would make an offer go from Release to Hold.

Advertisements

sybase tempdb basics

1984 — first introduced. 23 years. mature.

duration — a tempdb can exist for
* one sql
* part of an sql
* a user session
* multiple sessions

There’s one default temporary database, known as “tempdb”. ASE-15 supports multiple additional temporary databases. J4? Performance.

Lock contention, specifically.

Fairchild Semicon’s IP traffic priority

Practical insight. Extremely useful to a company economizing on bandwith

Based on packet “protocol” [1], an IP router can give relative priorities to
Priority 1: voip packets
Priority 2: peoplesoft traffic
Priority 3: browser traffic
Proirity 4: lotus notes replication traffic

Lower priority packets are dropped more.

The most important browser traffic is, hold your breath, sales processing[2]. Sales staff use a web interface to process sales data. DB resides on another continent! In a rare but illustrative /incident/, lotus traffic ate into Priority 3 bandwidth and brought sales processing to a grinding slowdown.

As an alternative to a relatively fragile web interface, I suggested async messaging-based sales processing application. No clear answer.

[2] perhaps including but not limited to sales order
[1] packet headers on one layer of the envelopes

%% iview quiz #2 — pl/sql exception

Let's build a good quiz and feel confident for 2 years.

A1: zero_divide, dup_vall_on_index, invalid_number,
A3: the caller (ie caller of the pl/sql code) receives it
A2: system raise exceptions. The programmer can also raise a user-defined exception.

q1: name a few common pl/sql exceptions and how did you handle them
q3: what if you don't handle an particular type of exception? Tell me what happens?
q2: how and when can you RAISE an exception@@
q: EXCEPTION comes before or after RETURN in a function? This could appear in a paper quiz.

pl/sql q&&a non-iview

A1: No. Just an empty identifier.
q: how does an insteadof trigger support DML on any view, even non-updatable views?
a: I think this trigger can be placed on any view.

A4: erro code + erro message

q: what constitutes a pl/sql block?
A: I think BEGIN and END

A7: declare a user-defined exception, to be *raised* later
A89: I think the context surrounding the raise

q7: what is meant by declaring an exception?

q: can you connect to your oracle instance from a cybercafe and see your colleague’s pl/sql source with original comments?
A: yes see tref

q: can you obfuscate your pl/sql source?
A: yes see tref

Q: can i raise a standard exception?

q4: a pair of things to be defined for an exception, beside its name?

q: why do some say java try/catch and exception propagation borrowed from pl/sql?
A: “catch or propagate”. In other words, uncaught exceptions are propagated.

Q1: When declaring a user-defined exception, is there any content in it?

Q89: a user-defined exception usually signifies a specific (rather than vague) condition. Where is the specific condition specified?

—-jargons:
–session as in “session object”

index selection in correlated subquery

http://www.onlamp.com/pub/a/onlamp/2004/09/30/from_clauses.html has a simple but good illustration.

select a.CUSTOMER_ID, a.CUSTOMER_NAME
from CUSTOMERS a
where a.ZIP_CODE in ...
and exists (select NULL from ORDERS b
where b.CUSTOMER_ID = a.CUSTOMER_ID and b.ORDERED_DATE >= ...)
order by a.CUSTOMER_NAME

is a good example of a simple correlated subquery. When the rdbms runs the subquery *for each* value of a.customer_id, this value is
taken as a constant. Therefore, the Orders index to use is the index on b.customer_id (perhaps in conjuction with b.ordered_date).

Remember for each table accessed, optimizer chooses one index. I don’t think it can use 2 indices.

Jersey City 2007 UBS IV

Q: have you created custom annotations?
Q: Since you have designed many caching systems, tell me what features are important to a cache?
Q: what jdk1.5 features do you like most?
A: threading
Q: why was enum good for your project?
Q: do you know “reference objects”? Have you used them?
Q: have you subclassed a enum to add methods?
Q: are your caches expandable?
Q: how did you implement size control on your caches?
A: see separate post
Q: now i have told you what a soft reference is, can you think of a good usage in software engineering
Q: now i have told you what a weak reference is, can you think of a good usage in software engineering

Now I guess this is possibly an eq trading system.

cache size control in trading engines#%%ideas

My answer in 2007 – separate thread to monitor the size and send out alerts. JMX-based clean-up operation.

Now I feel we can take the swing EDT approach. “EDT” here means some kind of separate thread/data-structure for cache size control — a watchdog.

Each insert/delete operation on any thread would send a msg to the watchdog queue. Watchdog can decide how many messages to drop before it decides to take a look. If size is close to the limit, then it could decide to be more vigilant. Once limit is hit, watchdog could turn on some flag in the cache system to remind the inserters.

But how does watchdog keep the size within limit? It has to remove the least accessed item. A priority queue with a last-accecced-time might be good. See post on LRU for a java builtin solution.

More importantly, the app has to be tolerant of involuntary loss of cache items. “If cache doesn’t have what I inserted, i will insert again.”

GC-algorithm keywords

http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html is a good intro to generational GC

* Within the Eden (youngest generation area), you can use schedule your garbage collector visits most frequently.
* Within the old generation area, you can schedule your GC visits with least frequency.
* Now, the GC algorithm can be ref count in one area, and a tracer in another.

The *heap* can be divided into old generation area and young (Eden + survivors).

http://articles.techrepublic.com.com/5100-10878_11-6108296.html focuses on java 1.5 GC

–keywords, based on an intro to GC algorithm : http://www.javaworld.com/javaworld/jw-12-2001/jw-1207-java101.html

* copiers — advantage: no fragmentation

* generational copiers — a generational algorithm is-a copier(?). Objects are copied from young to old generation subheap.

* subheap gc — each subheap can have a different gc daemon thread

* concurrent subheap gc — each subheap’s gc daemon thread can run simultaneously

* ref-counters ^ tracers — basically the 2 main types of algorithms. I think most modern algorithms are tracers, including generational

* mark-and-sweep —- a tracer feature. Unmarked => reclaimed

* path-from-root —- a tracer feature.

* overhead — some algorithms adds dereference-overhead (handle table) to every object access [1], while other algorithms adds extra cpu cycles only when GC thread runs — daemon-overhead. The first type of overhead is found in ref-counters and handle tables.

[1] read/write

pl/sql package q&&a

j4package: access control — achieved by declaration. This is A more important j4 than “grouping and code-organization”. Access to what? [1]
j4package: fully-qualified-names — to avoid namespace pollution.

#1 nlg pearl: – – > { spec-body } forms a twin for a pl/sql package.

a: short for “package specification”, which appears before “CREATE OR REPLACE PACKAGE BODY”. Stuff (what stuff? [1]) declared in a spec are “global” ie usable outside the pkg. What aren’t? [2]
A: same meaning — vars declared in a spec. Usable outside the pkg. Read online about why package-variables aren’t persistent in http context.
A: “CREATE OR REPLACE PACKAGE my_pkg8 ..” Note there’s no “BODY”. A spec has nothing to do with “DECLARE ….”
A: a “body”, short for “PACKAGE BODY”.
A: in your “schema”, basically your login account (??? confirmed!)
q: what does a spec look like? How do I know i’m looking at a spec?
Q: what’s a “spec” in pl/sql?
Q: what’s the twin sister of a “spec”?
Q: what are package-variables && global variables?
Q: Where is a function saved if i don’t have a package?
[1] vars, functions, procedures. Yes you can declare all of these in the spec
[2] stuff declared only in the body.

Oracle cursor porperties in 3 modes

J4: Obscure topics, but it’s easy to mater the issues surrounding and beneath them, and your mastery will lead to confidence and better understanding of related cursor topics.

B) Implicit => no %ISOPEN [1]
SQL%ROWCOUNT is usable
SQL%FOUND is usable [2]

C) cursor for loop => %ROWCOUNT is the only usable property
%ISOPEN, %FOUND are completely unnecessary.

A) Explicit cursor
All cursor properties were designed and usable for explicit.

“cursor property” is also known as “cursor attribute” or “cursor variable”.
[1] always false. There’s no loop in which you can test ISOPEN
[2] notice there’s no name for the cursor as it’s implicit. use “SQL%..”

US employers resistant to H1 candidates

Hi XR,

Many overseas candidates feel discouraged. I think it is good to understand that reputable US employers (rightly) feel a number of resistances towards H1 candidates.

Resistance: verifiable track record in large, reputable companies is rare for many H1 holders. You are lucky to have UBS on your track record. As described in my earlier email, many Indian developers are lucky too. I feel some employers may still suspect an overseas candiate’s job duties, even in a large company like UBS.

Resistance: Tech questions — asked by US employers are tough for most Singapore developers.

When we gradually improve ourselves and slowly overcome any of these resistances, you will feel liberated. US is a land of opportunity. Grabbing these opportunities requires hard work and a positive attitude.

java hash table taking in a new node

incoming “guest” — a key-value pair, to be stored. We attach a 3rd item — computed hash code or compressed index — to each guest.

Actually there are other “things” attached to each guest. These tend to distract you when you first study hash tables —

* a pointer. When storing data, we usually store pointers to original data. In Java, Original Keys and Values are always Objects never primitives, so they are always always stored as pointers.

* a bucket id ie the array slot

* a next-pointer since each node is in a linked list