Labels

_fuxi (75) _IV (146) _misc (5) {610610 (30) algo (1) automatedTrading (8) banking/economy (3) book (14) c++misc (125) c++real (15) c++STL/java_container (7) cppTemplate (1) db (13) DB_tuning (4) deepUnder (1) dotnet (69) eTip (17) excelVBA (12) finance+sys (34) financeMisc (24) financeRisk (2) financeTechMisc (4) financeVol (21) finmath (17) fixedIncome (25) forex (16) IDE (24) invest (1) java (43) latency (4) LinearAlgebra (3) math (30) matlab (24) memoryMgmt (11) metaPrograming (2) MOM (15) msfm (1) murex (4) nofx (11) nosql (3) OO_Design (1) original_content (4) scriptUnixAutosys (19) SOA (7) socket/stream (15) sticky (1) subquery+join (2) swing (32) sybase (6) tech_orphan (12) tech+fin_career (30) telco (11) thread (21) timeSaver (13) tune (10) US_imm (2) US_misc (2) windoz (20) z_algo+dataStructure (4) z_arch (2) z_c#GUI (30) z_career (10) z_career]US^Asia (2) z_careerBig20 (1) z_careerFinanceTech (11) z_FIX (6) z_forex (31) z_hib (2) z_ikm (7) z_inMemDB (3) z_j2ee (10) z_oq (14) z_php (1) z_py (26) z_quant (4) z_skillist (3) z_spr (5)
Showing posts with label dotnet. Show all posts
Showing posts with label dotnet. Show all posts

Tuesday, April 21, 2015

enough c# mileage accummulated@@

Your mileage will show in IV and in projects, but IV is way, way more important than real project performance -- You only need to be barely competent to get your job done, solving common problems at your pace (though at Baml my own pace was slower than other team members). No need to be competent to solve all tricky problems, some are too tough for everyone. But you better ace the IV.

- - I still feel less familiar with some everyday tasks than my c# veteran colleagues.
- - i did rather few complete projects like Guardian and many enhancement projects. In contrast, veteran c# guys did more big projects. The number of years isn't as important as complexity and variety of challenges. VARIETY -- for eg a web dev expert (or a DB-centric c# coder) isn't really a complete c# expert.
- - wpf is a specialized skillset, like swing, or web dev or sockets. I didn't get a lot of wpf hands-on mileage yet.
- - wcf is another specialized skillset. I lack mileage.
- - assembly, appdomain, GAC

= = people agree that I can get my job done and meet most technical challenges, even if non-trivial. ("tactical")
= = explaining, justifying my design choices - not always convincing. Not only c#, but java too.
= = excel integration is one of the most valuable among the specialized c# skills. I have some experience.

+ + When presented a new c# challenge, when pushed to the frontier of my c# know-how, I am competent to construct a basic "infrastructure" and then search on-line for the missing pieces to complete the loop meeting the challenge
+ + competent with most everyday troubleshooting.  Some troubleshooting is beyond my current skill but I feel many are hard for my veteran colleagues too. If my colleagues can solve 50% of the tech problems, then my level is close to that. This competence comes from mileage i.e. real world projects. The more projects one takes on, the more competent.
+ + like Venkat, I did practice with some hot c# features like threading, closure, remote debugging ...
+ + much more confident with MSVS than before. Perhaps comparable to my Eclipse confidence.
+ + on some of the hot but purely theoretical IV topics (fake mileage), I have read up quite a bit and appreciate their nuances. I can follow most discussions on these topics -
*GC, dtor, finalizer
*threading
*value/reference types
*dynamic type

Saturday, April 11, 2015

## some of my c# dotnet achievements

1) home-grown web server to download any file in the local file system - essentially my invention, as no one in the team know how to do it

GUI - full ownership

stability improvement in the microagent and Guardian server

Bloomberg piece - no one dared to touch it given the complexity

Excel add-in

Created many windows services

Friday, May 30, 2014

print a c# array - one-liner

myArray.Aggregate("", (a, b) => a + b + ", ")

Wednesday, May 21, 2014

SLOOB locations of xap files - win7winxp

C:\Users\a5xxxxxx\AppData\Local\Microsoft\Silverlight\OutOfBrowser - win7
C:\Documents and Settings\A5XXXXXX\Local Settings\Application Data\Microsoft\Silverlight\OutOfBrowser - winxp

Sunday, November 24, 2013

some c# coding practices for IV

These questions will seldom hit the phone round...

Q: Implement IEnumerable<string> foo(IEnumerable<string> aa, IEnumerable<string> b) such that foo returns string in either aa or b but not both.

To keep things simple, let's assume aa holds unique elements, and b too.

Q: regex engine supporting quantifier "*", and the wild-card "."
Q: IteratorTest from MS
Q: circular buffer
Q: reverse a linked list in-place
Q: rotate a long array by 3
Q: spreadsheet concretization

(610610 blog has a letter to XR, which shows a list of coding practice projects I completed.)

Sunday, August 18, 2013

topics in c# interviews

protobuf!
serialize? presumably
xml? presumably
generics
dynamic type?
auto-boxing
task library?
linq? yes
ado.net? perhaps too simple for many jobs
web service? yes
async web service?
wcf? prominent
GC
COM?
unmanaged code?
p/invoke?
assembly, app domain
GAC
win services? ever asked?
algo with standard data structures (c# version). This tends to be a favorite at high-end jobs. This requires
** no threading,
** no generics,
** no linq,
** no wpf,
** no wcf

Friday, August 16, 2013

when to use anonymous delegate vs lambda syntax

http://www.howdoicode.net/2013/05/difference-between-delegate-and-delegate.html points out that in an "anonymous callback", if you don't need to use the arguments passed in, then the delegate{} syntax is easier than the lambda syntax.

I feel in all other cases, the lambda syntax is simpler.

Thursday, August 15, 2013

dotnet thread pool, tips from Pravin

http://www.howdoicode.net/2013/04/net-thread-pool.html has some good tips

Pool threads are always background. Un-Configurable.

Consider creating your own thread if Synchronization needed -- If we rely on synchronization to start, wait and stop the work done by the thread, then it is very likely that the task duration will increase and could lead to starvation very soon. If we have to use WaitHandles, locks or other synchronization techniques - then creating our own threads would be a better option.

Consider creating your own thread if Longer duration of work -- Thread pool is to be used only when the work is of short duration. The faster the thread completes its work and goes back to the pool, the better performance. If threads are assigned to work for something very long, after some time starvation could occur. New threads are not created in the pool after a limit is reached, and if all threads are busy - the work may not be performed at all.

Thursday, July 25, 2013

c# variable naming convention

Without a context, these identifiers all look indistinguishable.

Argument passed in? arg_
Local temp variables? tmp_
Fields? Just qualify it with this.field1 or MyClass.field1
Events? Just qualify ith with this.event1 or MyClass.event1
Properties? CapitalizeFirstLetter. Actually, these are primarily used outside host class. In such cases they are fairly identifiable.

Wednesday, July 10, 2013

LINQ - narrow moving window

Which part of linq operates this way??

-----
Imagine you can only use 1 unit of memory.... You get the narrowest possible moving window (size 1) over the "stream" of items. You can't query how many items in total -- You have to remember the past items. You can't query the sequence for a past or future item.

I feel this is similar to SAX parser...

I feel this is similar to database drivers. When you iterate the rows from a large query, the server gives you one row at a time.

It also reminds me of the c++/java/c# stream concept, but streams consist of bytes not "composite, structured objects"

Friday, July 5, 2013

exceptions - SingleOrDefault(), FirstOrDefault() ...


Single() would throw if there’s 0 or 2+ items. Exactly 1 expected.

SingleOrDefault() would throw if there are 2+ items.

First() would throw if there REMAINS 0 item. You could be at the beginning or middle of a sequence.

FirstOrDefault() would not throw.

Sunday, June 30, 2013

dotnet unmanaged RESOURCES, learning notes

(Many open questions below are a bit arcane and may not be relevant to IV or projects.)

I feel "managed" means "automatically-released". In that case, most dotnet Objects qualify as managed "Resources". Any time you need Dispose() in your CLASS, that's a telltale sign of unmanaged resources.

"Resource" is a rather abstract term, best understood by example[1]. In my mind, a resource is some runtime object(s) needed by our App, something constructed and configured. Like a natural resource it is scarce, shared and rationed. Like a library book, there's usually an acquisition "protocol", and a return protocol.

[1] As a crude example, what's a city and what's not a city? Best learn by example.

http://stackoverflow.com/questions/13786570/determine-managed-vs-unmanaged-resources has some interesting comments.

--Unmanaged resource and ... IntPtr + handle ?
What's an IntPtr? Basically a struct that represents a native void pointer (or a native handle) --
http://stackoverflow.com/questions/1148177/just-what-is-an-intptr-exactly Many unmanaged "resources" are accessed via IntPtr.

--Unmanaged resource and unsafe code?

--Unmanaged resoruce and p/invoke?

--Unmanaged resource and ... win32 + COM?

--some managed resources
filestream is a MR. It contains a native file handle, which is UR. It's IntPtr, but not a integer-based file descriptor as in C/python. See MSDN.

A socket object is a MR. It contains a socket handle, which is UR and IntPtr

A DB connection is probably UR.

Friday, June 28, 2013

wcf bindings - ws, pipes, msmq...

http://msdn.microsoft.com/en-us/library/ms730879.aspx shows the standard/default list of bindings in WCF, including
- serialization in each binding
- session support in each binding

"Basic" uses web service. I think a lot of wcf apps use this.

Most bindings use binary serialization. Web service bindings use xml serialization.

Tuesday, June 25, 2013

## common memory leaks in CLR

A static field holding a growing collection...

event registration - see other posts

Monday, June 24, 2013

http flavor of wcf - best for heterogeneous, b2b setup, across firewalls


wcf - named pipe vs TCP

named pipes can be half-duplex; TCP can be full duplex
 
named pipes -- both client/server must be on the same box
 
TCP can be same-box or across hosts.

Sunday, June 23, 2013

bbg c# IV - 15minutes

Q: Can a struct implement an interface
%%A: an interface is a reference type. When casting to the interface type, you get autoboxing
A: http://stackoverflow.com/questions/63671/is-it-safe-for-structs-to-implement-interfaces shows many standard structs implement
IEquatable and other interfaces

Q1 When I create a custom class, what's the type I derive from?
%%A: System.Object, which is a reference type

Q1b What methods do you usually override in your custom class
%%A: tostring, gethashcode, equals. Fairly good answer.

Q: what are the value types you normally create
%%A: enums and structs

Q: what's IDisposable

Q: what's the relationship - IDisposable vs Finalizer

Q: Mutex vs Monitor

Sunday, June 16, 2013

why Dispose should call SuppressFinalize(this)

See [[accelerated c# 2010]]. Even more details are in [[.net gotchas]].

* small optimization idiom. I think it's a sign of mastery, esp. if you can explain why.
* by default, if the class has a finalizer, then after Dispose, the object is still be seen with a finalizer. Will be moved to finalize queue. Delayed deallocation
* Often Dispose() handles all clean-up. In that case the final final finalization isn't required any more.

Note GC.SuppressFinalize is a static method

Wednesday, June 12, 2013

There's space in each CLR object reserved for locking

P272 [[concur programming on windows]] points out "You allocate your object on the GC heap and the CLR will handle initialization of
internal data structures needed to support synchronization".

Therefore I believe even the simplest dotnet heap object needs at least a few extra bytes for this.

3 ways to create new types dynamically - c# vs java

c# reflection lets you create an entire new class at runtime, using
** Builder classes
** Reflection.Emit to insert IL code into the new-built class

java standard reflection is lacking this feature, but look at cglib...

The Emit technique is clumsy, tedious, and less popular than codegen (#2). ExpandoObject is the #3 technique. See post(s) on ExpandoObject.