Saturday, December 25, 2010

binder req

1.any process should be able to transfer control and data to any other process in the system
2.device driver is equally visible to all processes in the system
3.a mechanism that can uniquely package data and control from one process to another
4.process A wants to send data and control,it sends ioctl to b-driver,telling which process to send,which function to call,which data to process.
5.b-driver has a mechanism where it can find from the given information the target process where its target entry points are present,it invokes the target process,passes control to the entry point with data.
6.passing control to the entry point-- at initialization in source and target, an ioctl, a thread is kept waiting for a notification or even APC is defined in the process.Once b-driver determines its target it calls the process through returning the ioctl,waking thread,or calling apc with the
entry points control code.it also passes data to the target.

android opencore

1.platform-->MIO-->encoder(-->hwaccelerator)-->controller
-->decoder(-->hwaccelerator)-->MIO-->platform
2.application-->player-->parser-->controller

catergories in sw-hw development

1.pure s/w - cost a pc ~ ~20kR --- ibm
2.firmware - cost a development kit with single DSP~ 20kR to 30kR - TI
3.verilog/systemC - cost a FPGA - 2LkR - Xilinx
4.verilog/systemC - cost a SDR FPGA with multi-DSP - 4LkR - Lyrtech + TI

1.FPGA - an arrangement of various IP cores
product will be one single component
for eg: LTE on fpga,
phy will be from X
i2c/spi from Y
pcie from Z
only NAS to MAC will be developed by current company

sometimes the vendor may give some of the above or it needs to be bought from 3rd party

Tuesday, December 7, 2010

way to align for big projects

1.think of framework,maintanace and module teams
2.framework team can be 3 to 10
3.maintenance can be 3-5
4.module can be around 5
5.all 3 working parallely from day 1
6.Main issues is development branching and merging
7.it can also be that during initial stages people are aligned for framework and later moved into others
8.highest indicators of the resources are interfaces and the number of entry points,independent libraries and overall framework
9.critical design components are innate scheduling and memory ownership
10.a library if having the property of changing , there should be 2 teams following it.core and maintanace,
11.the fundamental principle being even if 1 line of code is chaged per day , if its known what is to be changed, the goal will be achieved
12.the framework team has to be ahead than others all time, first deliverable from them
13.maintanance team goal is to achieve uniformity,symmetry everywhere also to bring up gaps
14.module teams have to follow the framework team close

Monday, December 6, 2010

ofbiz cont.

1.its a web app containing inside multiple apps
2.each is called a component.
3.each component can be accessed independently by different users logging from different locations by an account
4.primary handle to a login session is based on user name and password.
5.a handle will be obtained for the session.
6.this handle typically identifies an entry in static login table in the database.
7.Now there can be different operations like create smthg,delete,modify etc based on the handle
8.a user ui session calls on the component with the handle,the event handler identifies the current
context with the handle.
9.the context will be a row with n coloumns,each coloumn containing separate sql formula (pointers)
10.the entry point of the event will update this context and refresh,after that every successive operation with the context should refresh before using it.
11.this makes the context in nnn(context,request)
12.the event handler can be a separate java lib,scripts etc(binary mapping,inplace loading)
13.prefer scripts over lib
14.how to load two batch files in an application and call a function in one batch file from other in the context of application.
15.event handler ultimately gathers some other contexts into its workspace , manipulates and writes something back to contexts or updates some data base tables, or passes on to next call.

event1:
get context from handle1, and data
do something
get handle for event2 in another module
call event 2 pass handle, and data
get context2
16.some context row can reserve a column for unknown handle
17.when this context is passed to another module it can access the unknown modules handle which is a depenent db

sw desig and devel

1.sw desig and devel are entirely different things
2.A sw design that can be explained within a day or two will need atleast 6 months development with novices to implement
3.Most effective design is one where after design none of the developers need to communicate with each other.Absolute reduction of h2h interactions.
4.Still if the design does not understand leaves even single gap in requirement analysis the development can fail
3.development has many weak points because of multi human interfaces, code typing with io devices.logic error correction h2h,integration h2h,testing h2h/h2sw,debugging h2sw etc
4.a good design will have a solid framework
5.a good framework is reusable and extensible
6.It gives a clear demarcation at directory-file level,binary module level,absract module level(interface,context,token,framework,drv1,drv2,lib1 etc),class etc.

not related: ssl encrypts tcpip payload

ofbiz

on a webserv there can be multiple portal,offbiz is an web application that contains other applications.since offbiz binds to port its portal.

simple pluggable ftl to display a dialog on web page
simple beanshell script to make and transfer a we between two wq
simple groovy script to print the contents of wq's

ftl and bsh example
http://www.opensourcestrategies.com/ofbiz/hello_world2.php

General working of offbiz
when starting it looks for file X
if it finds, parses file X
file X contains many paths
It checks for the UI component path
In the UI component path it looks for file A
It loads A and executes
It checks for business logic part
It checks for data base part

Basic idea is, most functionalities are prescribed in configuration files and implemented in std
libraries.A user can reuse the configuration files and hence the libraries to get most of the
work done.If extensions are required, framework allows to add more configuration files and
associate it with libraries and thus to achieve more functions

Http requests are captured by http server,converted to system events,mapped by (remote ip,incoming url,session).
webserver forwards to it client(index page).Any events on the index page is forwarded to handler java libraries.
This can be chained.A webserver has a url parser,a directory serach logic and html transfer logic.After the
html transfer the event handler java classes get loaded.http requests come for events with data,its routed to
a process/thread having the incoming session id.when it reaches the thread it already contains the loaded java
lib hence delegates the call to handler.
or each time a http request comes ws spawn thread loads libs and calls a handler with context.May be ws will
store only store the context mapped to session id,threads are not kept alive.

look and feel of offbiz freemarker, screen widgets and form widgets can be changed by using style sheets

offbiz used work flow engine shark before but now does it using EDA/SOA/SOAP/SECA/EECA
offbiz can export a components functions directly over web.This feature is used
to test,measure,debug.A special service needs to be created.It uses axis2.refer to
http://www.mail-archive.com/user@ofbiz.apache.org/msg16286.html.

In offbiz lang loading seed data means filling the data base with worable data.
adding new names,orders,accounts etc.complex database tables are created based
on the seed data.

ftl,screen widg,form widg
-------------------------------
| |
entity engine<==============service engine (BL)
| |
bsh script bsh script
--------------------------
groovy
db interface

The service engine will use the entity engines functions to do the business logic


ftl,screen widg,form widg
---------------------------------------------
| |q1 |q2 |q3 |q4
entity engine<==============service engine (BL)
| |
bsh script bsh script
--------------------------
groovy
db interface


|frm1 |frm2 |frm3 |frm4

|null |wq2 |wq3 |wq4

|dbt1 |dbt2 |dbt3 |dbt4

seed data will be single category dbt.More coloumns will be added in seed if and
only if has atomic relation between prim key.

there are dynamic dbts and static dbts.seed data always is static
wq comprises dynamic dbt.its size can vary from 0 to N.

at data model,relational dbt's will come into picture.items will be picked from
seed dbt's and grouped here.


For a SOAP example,ExampleServices.xml

Offbiz services tutorial
http://www.packtpub.com/article/ofbiz-services-apache
Offbiz tut
http://www.hotwaxmedia.com/ofbiz-tutorials.html
Buy Apache offbiz cook book
http://docs.google.com/viewer?a=v&q=cache:sqMDVClJIW8J:docs.huihoo.com/apache/ofbiz/The-Hitchhiker-Guide-to-OFBiz.pdf+download+offbiz.pdf&hl=en&gl=in&pid=bl&srcid=ADGEESjrpP2nZyqmuFanSz_GEvUF52XIZyiG4wSVqXY0-mcQugEsUdX5qPHBIiBXxaJgMBZSGFP0tWQHRCEXJ3A2fpQfS6UOGqokVgVfwmYOaToUg2uYTCoOqzznmJ1_bbnZIU2cOtgB&sig=AHIEtbTnzDMl3Fuc4BGj-s60qyVyg--G4Q
Buy Apache offbiz development beginners tutorial
Offbiz architecture view
http://webcache.googleusercontent.com/search?q=cache:YuejplShHfIJ:docs.huihoo.com/apache/ofbiz/OFBiz-An-Insider-View.pdf+ofbiz+widgets,database&cd=21&hl=en&ct=clnk&gl=in&client=firefox-a

wondering what erp involves

main players
1.hr
2.procurement
3.production
4.finance
5.inventry
6.scm
7.asset

A cycle is the activities happening from the time a customer order enters into erp system and its
closed

it goes through lot of token forwarding and feedback between the modules of course and maintaing data and states.

parts of sw puzzle

1.ability to create replicas
2.loadable modules
3.single module multi interface and contexts
4.discontinuous control flow
5.notion of data movement, src:dst local and remote. local uses virtual addresses direct by reference, remote by value

Sunday, December 5, 2010

brain vs pc

1.trying to replace one string in a c file
2.this replacement may have an impact on dependent calls
3.for simplest effort its better to replace this string all together in the single file and then check the dependencies
4.if tried to make one change and then trace dependency, at dept of atleast 2 mostly chances are there to forget the start unless its recorded outside

approaches to learn

1.begines by picking data thrown at you
2.many people thinks this is the only way ahead
3.next it can be sought by going looking for it
4.methods may involve throwing correlated data back and checking feedback
5.preparing mental model of the same is required if a self ,incremental,progressive learning is desirable
6.every thrown data should be plugged into the model
7.if all the pieces start to make sense together , conclude to be the right track

Friday, December 3, 2010

collective progress

1.every medium of entertainment is a mix of talent and business
2.what is talent, its a blend of technique accrued over a time by minisicule advances and desire to push oneself
3.what is popularity, a mixture of timing(luck), right associations(politics), talent (as above) and again desire to push oneself
4.popularity is also a result of layman's inability to understand the reason behind it, the ingredients of success
5.Once someone understands it , the perception changes.Rather than considering the popularity as just blind admiration , it becomes a respect for someone who figured out or got the right mixture.
6.so can talents be cultivated yes because if something can happen once it can happen twice also
7.for this to happen knowledge of the process should sink deep into the community, rather than viewing everything in awe, people should look at themselves and the process and prepare a timebased plan.
8.what is failure, it is the reason of not understanding the process completely.hence when that understanding is made things will be on track
9.if still progress cannot be made, the environment is also a factor.
10.a high talent in a particular field at the time of recession will do no good
11.the best way to progress is to follow a path of collective progress
12.discussing,helping without hidden agenda but with open agenda can create positive vibes
13.Knowledge that everything that has evolved big has a smaller version to it
14.try to figure out how to setup this smaller version and then make a steady incremental progress
15.focuss doesnt mean 24x7 working on the thing,but the will to work on it consistantly
16.its 100% true that in sw, if 1 person can do a job in 10 days, 10 equally knowledgeble guys can make it happen in one day,proper planning and assesment needed
17.practically, people who takes risks can only realise their dreams(risk mostly means money)
18.people who can motivate can only realise their dreams(motivation means money)
19.people who can clearly show their vision to others can realise their dreams
20.if this process can rise standard of living for a community(every type of member) it will be acceptable
21.faltering can happen if living situations doesnt improve over a period of time and comparisons come into picture
if two persons put varying amount of money in getting the same goal high probability in getting by high spender to goal first, may not be sustainable

windows security

1.Any process(hence thread) running in windows is under a "logon session","user account" or
"group account"
2.lets talk about a client application and a server service in windows
the above applies to client
3.for server service, when this service application is written, the programmer can specify
security details of all obects it creates and accesses.for he can associate a security info with a directory he creates and another he acceses.before accessing a directory he can also impersonate before the access
4.the service application will have a data structure called DACL,SACL in which he stores the information of all objects
5.client also have access to SID that represent accounts
6.while doing remote access, first a logon session is established, this inturn will give client attributes to each access done by that session.

Wednesday, December 1, 2010

oop and binary modules - 1

1. use case - a class implemented in static library
use case - a class implemented in shared library


2. when a eclient uses this , it will first instantiate the class directly, or derive a class
from the above and then instantiate, or it will derive a class and store it in static/dyn lib

3. there is a module boundry between static and dynamic library

4. internal symbol infos are stored per module.c++ name mangling is global per string.same compiler
will give same mangle for the same string across

5. when a class is stored in static or dyn, its mangled symbol info is stored in a stub inside the module

6.when a client uses this class, step one is loading the binary into its space, second resolving names.A memory block is created for the object, then it needs to patch up the function references
in the memory object.for that it consults the stub and fills its load addresses into function table.it means object memory can be global among the loaded address space.though the main class
and subclass implementations belong to different modules, the global unique object of base class
and subclass will contain references to method addresses in differnt modules.

it also implies that the data is stored in global store.global means the process space.

if RTTI is enabled it can identify any objects type in process space.

client(binary) uses class 1

class1(static) class2 der class1(dyn) class3(dyn)

here when client instantiates class1, it has to load class 2 module and its methods will
be resolved auto.the class1 obect will have its base class method in static lib and
derived class methods in dll

when access to virtual method of class 1 is done it will call into either staic module or dll

class 1 gives a uniform interface to methods behind it.client doesnt know whether the implementation is in staic or dynamic lib.

if at the time of instantiation, class 1 could specify from where the dll is loaded then
clients main code becomes decoupled from the static and dynamic

so it becomes
class A-1 classA-2 ..... (binaries)
=================================================
client object selection (selects based on string) (different binaries)
client main logic(will not change ever)


4.if base class is a binary dyn,derived is also binary dyn can it happen
yes if the client loads the base class and derived class into its space before using them
at lazy binding.the created object will resolve to dyn1 for base class and dyn2 for derived class

5.At compilation time there can be a problem, there will not be base class addresses available when compiling derived binaries.how will compiler provide support for this

same applies to client, at compile time client doesnt have symbol access to base and derived

6.a game app can be viewed as

module layers ... all dlls are present in this layer,they may be base classes or derived classes
base and derived can be in separate dlls

client layer interface - a layer that loads members of module layer

client logic - a layer that makes use of base type object to do all the complicated work,here
its assumed that all the classes in thae module layer is somehow derived from base type obect

module layers are separate binaries,client lay intf can be separate binaries,client logic can be separate binaries

7.what if 2 dlls contain same function same prototype ,both expost this function.a client loads the dll and tries to import the function.will compiler give warning or its runtime

oop and binary modules

1.how can interfaces be registered with the operating system
a binary module implements the generic interface,and adds its basic info into registry/config file

system wide parser reads the registry/config file and locates the binary and calls the exported
interface.based on the response its loaded.once its loaded other interfaces can be registered from it



2.can 2 binaries , upper and lower extend dynamically
ie suppose lower is not loaded we get the functionality of only upper,once lower is loaded
it shadows the functionality in upper

requirement, the upper should have exported functions,an object of lower should have exported functions that a third entity can access

a third entity should control the master interface of upper and lower,it needs to keep track of where upper is loaded and where lower is loaded

the third entity should be able to access v table of lower that it can write to
3.the system has 2 dlls that implement addition in 2 different ways
the 2 dlls have same interface
whenever a client instantiates a type of that interface,what we need is that
the objects method pointers should be mapped to dll1 or dll2

4.http://stackoverflow.com/questions/1114115/undefined-symbol-error-for-base-class-in-c-shared-library

5.good pluging tutorial http://willperone.net/Code/codedll.php