* Usage: GUI. Event handlers and listeners
* Usage: threads.
* Spring callbacks in templates
(See other posts on sample codes for both.)
anonymous static and non-static classes are routinely used inside static/non-static methods to create a thread and start it.
–> concurrency developers had better get thoroughly familiar with the basic rules of anon classes
update… I feel if last job is a small no-name company (without a much higher salary), then it would affect my “image” for next job search.
See also post in 610610 http://tigertanbin610610.blogspot.com/2013/12/strategic-directions-2014.html
Over the next 5 years, though i want to stay in a big bank for many years, circumstances might force me to change job every 1-2 years. Aiming to grow stronger in 3 areas.
Brank) leadership job title in big banks — a door opener and a little halo. When job market declines, employers have too many candidates, they prefer known brands.
T) keep my technical skills relevant — I realize every time I change job, technical skill requirement is always (at least one of) the biggest factor. A lot of tech interviews and quizzes are non-trivial. If we stop doing hands-on work with current technology, we will weaken and become obsolete.
F) mainstream financial domain knowledge esp. security trading. This would open up a lot of high-worth job opportunities. They are not open to me now due to my limited mainstream financial experience. Maybe i
don’t need such a job — i can read up and pretend to have, say, risk analytic experience?
For my next (2? 3?) job searches in the next 5 years, I’m unlikely to apply to PM or business analyst roles. Technical is my strength.
 Rarely do i get an easy tech interview on wall street.
what's the challenge when notifyAll wakes up all the waiting threads?
why do we want to consider a synchronized block rather than a method?
why do we need primitive types when we have the wrapper classes?
quiz time! Give one use case for calling dtor explicitly
ARM P279 says placement new can be coupled with placement-destruct. Syntax is
I vaguely remember a static init block can have “synchronized”. I guess 2 threads might (in theory) run the block concurrently.
But each classloader (and all its ancestors) can only load a class once, so i guess the 2 threads will load the same class into separate class loaders that aren’t in parent-child@@
As stated else where on this blog, an “item” in a delegate inv list holds nothing but 2 pointer fields.
http://www.ikriv.com/en/prog/info/dotnet/Delegates.html sheds light on one of them —
Internally an “item” stores its target in a private field named _target.
Normally, public property Target just returns a value of _target. For static delegates though, _target contains a reference to the delegate instance itself. “Get” accessor of Target makes a quick check, and if _target references a delegate Instance (likely to be itself), returns null.
In c++ or java, you can instantiate a class Animal many ways, like
Animal myCat; // exactly like declaring an int variable
Animal myCat(2); //age
Animal* myCat = new Animal(“kit”);
C# delegate is more complicated. http://www.yoda.arachsys.com/csharp/events.html has a concise list of about 5 different ways to Instantiate a delegate Type. Extremely insightful. Among other things, it reveals that in the instance method case the delegate Instance must “remember” the target
public delegate string FirstDelegate (int x); // type declaration.
FirstDelegate d1 = new FirstDelegate(InstanceMethod);
FirstDelegate d2 = new FirstDelegate(this.InstanceMethod);
FirstDelegate d3 = new FirstDelegate(anotherInstance.InstanceMethod);
FirstDelegate d4 = new FirstDelegate(instanceOfOtherClass.OtherInstanceMethod);
Target is NULL for ALL static
FirstDelegate d5 = new FirstDelegate(StaticMethod);
FirstDelegate d6 = new FirstDelegate(OtherClass.OtherStaticMethod);