Showing posts with label technical. Show all posts
Showing posts with label technical. Show all posts

Sunday, July 01, 2012

If you like to maintain White Elephant, buy Apple products!

If you like to maintain White Elephant, buy Apple products! A White Elephant is a beautiful product though albeit a costly affair.


Product is good, no doubt

I bought my beautiful Apple MacBook 13' in Nov 2009. It was almost like love at first sight, and did not mind shelling out a premium at that point. Love is blind, right? Snow Leopard was shining at that time. And I was/am pretty happy/proud owner of a Apple product in India. Quite a thing I think.

A year passed. There was another temptation from Apple: the first iPad became available in India in Jan 2010. Of course I bought it. Pretty impressed, and satisfied with the product.

Product maintenance is costly (as well)

So far so good. Come Jun 2012. My MacBook's battery started depleting noticeably quickly. I visited Authorized Apple Service Provider (AASP) in Thane, Kapurbavadi Junction. Battery replacement was suggested. The cost of the battery is about Rs 8000. That cost is probably okay though quite high I think. The icing on the cake was the service charge by the AASP. AASP charged me about Rs 2000 as service charges!

Battery plus service charge in all is about Rs 10000. The AASP service charge is cool 25% of the battery cost. That's about 20-25% of the original cost of MacBook itself! The total of Rs 10000 every, say 3 years, just for battery replacement! Compare it with a decent Windows box that's available in India at about Rs 30000, just thrice the cost of Apple's battery replacement. My Dell Inspiron battery seems to cost (including service charges) about Rs 5000.

Lessons

Frankly, I did not think of such recurring cost every three years when I bought MacBook. Just thought it might be useful for people who don't have such White Elephant yet, but are considering buying one. You don't have much choice once you are deep into it! AASP support is kind of a monopoly play. If you want a reliable service/maintenance, you are truly stuck with AASP anyway. There is no alternative per se. In Windows world, there seems to be a range of options when it comes to maintenance in India, right from manufacturer's support to off the shelf options in any hardware variety.

BTW, MS Office (Word, Excel) today are equal to, if not better than, their Apple iWorks counterparts. I have paid versions of both. I do use both of them, at least at intermediate level I think. I can imagine Apple iWorks having an upper hand in its beginning days. And, MS Office catching up later on. Today, MS Office works better for me.

Just wondering what is the experience with iPhone, or iPad maintenance in India. Guess I am worried too from maintenance point of view in my case. Android based products will catch up (or almost already there may be), and will work out better from India/above point of view I think.

So, hold your wallet, think, think twice before you decide to buy Apple products in India. A wait for few months, half year or so for a competitive (maintenance friendly) product will not prove bad in hindsight, may be. If you are not money conscious, then you will not worry about maintenance cost anyway!

Tuesday, August 07, 2007

Flex

After a brief hiatus I'm back. I was busy relocating. Just a dump on what I understood about Flex so far.

JavaFX Script = ActionScript.
JavaFX Pad = Flex Builder, in the long run.
JRE = FlashPlayer.
MXML no real equivalent, but AjaxToolkits (Dojo, etc and jMaki are of help here).
Flex seems to be a clear leader, innovator in this space.

Presentation tier if it resides on client, what's the use of JSP/Servlet technology! A web app is just a packaging of Flex applications: a set of SWF files and HTMLs that refer them. A web server that dishes out such HTMLs and its embedded objects (SWF files) is just enough.

Looks like presentation with its dynamic aspect is back on the client box.
State management is back on the client box, i.e. state is maintained at client box, server gets back its scalability (to dish out data, or execute business logic, or any Web 3.0 functionality).
Business logic, if simple, can be part of client-side following MVCS (MVC with a communication service S to fetch data) pattern. If business logic is complex say transactional in nature, it can reside in a JEE server.

Flex application can use two free/open RPC services, HTTPService and WebService, to interact with remote servers (to fetch data, or perform a business logic step). By "free/open" I mean you don't need any special proprietary (or for pay) infrastructure on the server side. The third type of RPC service, using RemoteObjects, is available if you have Adobe provided Flex Data Service (FDS) server infrastructure that maps Action Message Format (ActionScript binary object marshalling format) message to instantiate Java objects on server side. FDS is not free; may have changed now. { TODO: Not sure if it allows instantiating .NET CLR compliant objects for M$ platform. }

Flex Builder is Eclipse plugin; to develop Flex application you need C++ based IDE, and at run-time it needs JRE! { TODO: Why it needs JRE at run-time? }

Just a side-note: FlashPlayer is about 1.5MB size, JRE is about 15MB in size. Probably it is good for Sun to break JRE as say full vs minimum (to compete with FlashPlayer considering JavaFX).

Friday, April 13, 2007

Semantic Web


http://www.w3.org/DesignIssues/Principles.html
http://www.w3.org/DesignIssues/Evolution.html
http://www.w3.org/DesignIssues/Extensible.html
http://www.w3.org/People/Berners-Lee/UU.html

http://www.w3.org/DesignIssues/Semantic.html

Achieving a set of connected applications for data on the Web in such a way as to form a consistent logical web of data.


http://novaspivack.typepad.com/nova_spivacks_weblog/
Nova Spivack. Founder Radar Networks; SFO based Web 3.0 startup!


http://www.xml.com/pub/a/2007/03/14/a-relational-view-of-the-semantic-web.html?CMP=OTC-TY3388567169&ATT=A+Relational+View+of+the+Semantic+Web
A relational view of semantic web. With query language SPARQL, a query framework for RDF-based store.


http://www.mkbergman.com/?p=354
DBPedia, largest source of structured data on Internet. Freebase is another competing technology or consortium, based on Wikipedia.
DBPedia represents data using Resource Description Framework (RDF) model. RDF uses a triple "subject-predicate-object" to model data; subject is the resource, predicate denotes traits or aspects of resource and a relationship between the subject and the object. The subject, predicate and object can be individually identified using URIs.


http://blogs.sun.com/bblfish/entry/short_interview_for_semantic_web
Henry Story, Sun's Staff Engineer
Semantic web brings together the web, data bases, object oriented programming, and reasoning.
Claims that to bring these things together, we've to be extremely simple and clean and build on the core thought of "everything is connected".
Semantic web is about making information more connect-able.
Schema = Ontology, in semantic web terms. SPARQL can work with half-baked ontology/schema; it can determine ontology dynamically.

http://www.businessweek.com/technology/content/apr2007/tc20070409_248062.htm
Semantic web use cases!
Semantic web is about data mining; building relations using data in dynamic fashion.


WWW first decade of Internet: 1989 to mid-1990s; HTML. Server generated Web; users were just fetching data published as HTML. Few services like email, calendar that were used by users.
Web 2.0 second decade of Internet: Late 1990s to early naughties; services on Internet; amazon, ebay, google. AJAX-based rich UI, XML Web Services. Social networking, blogging, Wiki, photos, etc. Ability to categorize data by tagging. User generated Web.
Web 3.0 third decade of Internet: Late naughties to early teens; HyperData markup or Semantic Web. May be streamlining tagging a bit; allowing Internet end-points/applications to build relations between data available on the Net and/or themselves.

http://www.businessweek.com/technology/content/apr2007/tc20070409_961951.htm
Semantic web = Data web; its about finding and co-relating information.

Tuesday, March 20, 2007

Dependency Injection = GoF Builder

http://www.martinfowler.com/articles/injection.html

Component = Software that is intended to be used, without component-source-code change, by client applications. Component and it's client are typically co-located, e.g. in same JVM or in same executable.
Service = Service and it's client are not co-located, or client accesses a remote service.

If you see
public interface Injector {
public void inject(Object target);
}
, it injects (or sets) target to act on for a component. Basically, a setter on a component that implements Injector-interface.

Tester class or Assembler (actor) is nothing but a GoF-Builder-participant-Director that knows how to construct a GoF-Builder-participant-Product (MovieLister) that has GoF-Builder-BuildPart (MovieFinder).

Can we then say that Dependency Injection is nothing but configuring a GoF-Strategy (or algorithm in general) using GoF-Builder pattern?
Or, in general, Dependency Injection is nothing but GoF-Builder?

Builder is supposed to separate the construction of complex object (data and procedures that operate on that data - a GoF-Builder-participant-Product, or MovieLister in Martin's link above) from its representation (MovieLister with certain implementation of MovieFinder in Martin's link above).


Dependency Injection (DI) is referred as specific case of the general pattern "Inversion of Control", i.e. how framework invokes call-backs from client source code. For example, how MovieLister (say part of framework source code) invokes MovieFinder (say part of client source code). Inversion is in terms of framework invoking client, rather than the most typical case of client invoking framework methods.


http://java.sun.com/developer/technicalArticles/J2EE/injection/

Java-EE 5 seems to be using such DI using Java-SE Annotations mechanism. The Java-EE 5 Web/Application Container is the Builder-Director that builds Java-EE-components like Servlets, EJBs. The Java-EE-components are the Builder-Products.

Java-EE 5 Annotations (examples at least) seem to promote hard-coding of such "dependency" names-or-identifiers, e.g.
@Resource(name="jms/demoTopic")
private javax.jms.Topic demoTopic;
Just wondering if it's possible to pass such names dynamically to the annotation!

Thursday, March 15, 2007

Big O Notation


O(1) = Constant-time = Time to execute an algorithm or operation doesn't depend on size of input
Getting or accessing array element is a constant-time operation.

Constant-time is sort of "dream come true" for an algorithm, the best!


O(log n) = Logarithmic time = Time to execute an algorithm or operation is proportional to logarithm of size of input n.
Binary search on a sorted list is logarithmic in complexity.


O(n) = Linear time = Time to execute an algorithm or operation depends on size of input n, or is directly proportional to size of input n
Determining smallest element in an unsorted array is a linear-time operation.
Determining smallest element in an unsorted, fixed-size array can be considered as a constant-time operation (since n is a constant in this scenario).

Linear time is desirable attribute of an algorithm!


O(n log n) = Log-linear time
Heap sorting is log-linear in nature.


O(nk) = Polynomial time = Time to execute an algorithm or operation is no greater than a polynomial function of a constant k irrespective of size of input n.
O(n2) = Quadratic time
O(n3) = Cubic time

Polynomial time is considered "fast" (enough) for an algorithm.


O(kn) = Exponential time = Time to execute an algorithm or operation is an exponential function of size of input n.

Exponential time is (considered) "slower" than polynomial time for an algorithm.