Tuesday, May 19, 2015

In the storage industry, file system protocols and their access are very important for the products and the day to day usages.the storage vendors push these features down into their products but cloud service providers have to even wire ways to expose these at their user level. If there were more than one vendot and each vendor had different degrees of interpretation, then there are more variations. Even if there is one vendor to go with, these variations are a helpful study both from a survey perspective as well as in evaluating the maturity of the product. It's in this connection that the change log between the versions and the components affected become all the more interesting . The savviness to use the right product right version of the product and right features enables ease of use to accomplish a task
In an example outside the topic we began some heat questionnaire and answer set for this evaluation.
Examples include :
How does this fit our need now ?
How does this feet our need down the line ?
How does this evaluate with others
How much effort us involved ?
How many moving parts are involved ?
What is the resiliency
And the TCO?
This builds a scorecard for each option.

#codingexercise

Double  GetNthRootSumOddRaisedPEvenRaisedQ (Double [] A,Double  p, Double q)
{
If ( A== null) return 0;
Return A.NthRootSumOddRaisedPEvenRaisedQ(p, q);
}

Monday, May 18, 2015

I've injured my hand and the swelling has increased even more today. In the previous post we ere discussing dynamic pricing models. It's important to note that such model is only applicable in a small percentage of cases. Specifically when the supply is less than demand. Uber's research has shown that both supply and demand curves are elastic here. Higher prices increase supply here. The Boston experiment confirmed that there is higher number of fulfilled requests when that happens. On the demand side there are two areas noteworthy, I referred the corresponding post by Bill Gurley. There is a mention of UberX as an alternative to the black car service and this has caught on.

#codingexercise


GetAllNumberRangeProductSeventhRootPowerTwwlve(Double [] A)



{





if (A == null) return 0;





Return A.AllNumberRangeProductSeventhRootPowerTwelve();




}




Sunday, May 17, 2015

In the previous post we reviewed the pricing models. To summarize we have advertising model with deep pockets and critical mass. Large companies can engage in this. Then there is free product with subscrption Services for sale . This is generally not liked by investors there's a model to renter existing distribution especially with a markup 2 to 5 times above the cost of the software. If we don't want this cost model, we could pursue a value mod l where the offering is clear to the customer and the conversion  from basic services to premium services is with a factor that us simple and clean. Of course pricing model may be allowed to be governed by the factors this is   the example of market model. Where competitive forces could be allowed to shape the pricing  taking its a,step further we can have pricing models
That are dynamic. Take Uber surge
Pricing for instance. This is an example of dynamic model which we haven't discovered so far  there us actually an interesting incident that led to this model. In Boston Uber drivers detected a problem where as they signed off at 1am there was a lot of unfilled request piling up. To make the supply elastic, drivers were given the option of more money for working longer.

Saturday, May 16, 2015

Today we review the different types of pricing models for software.  Pricing models are complex decisions  there are a lot if intertwined factors at play such as strategy, customer etc. Let's use this blog post to come up to speed with at least a few.
First, give it away for free and make money on advertising. Facebook, Twitter and PInterest follow this model. It requires deep pockets and is very hard to measure. There is said to be a critical mass required for this model to succeed.
Second, Free product bundled with paid services model. Red Hat  Linux follows this model. Customers pay subscription fees if they want support or other services from the service offerimgs. A positive benefit of this model is that this generates cash flow although on the flip side it turns investors away
Third pricing model is Freemium model. Dropbox and linkedin offer just enough products for free to gain regular audience and then convert them for paid services. The pricing has to be a function of the perceived incremental value. This is typically made with simple conversion factors so the equation may look like 10000 more at 10$ each.
Next is the cost based model where the product is sold at two to five times the cost incurred.multiples are used because the middlemen in the distribution channels as well as the end retailers work with fixed markup? This is the most common method for entering into existing distributions.
Value model is another. This articulates the value of the offering be it monetary or otherwise. In all these cases the value has to be perceived as compelling.
Portfolio pricing expands on this by offering a variety of products and services. There more mix and match possible now.
Tiered or volume pricing is used if the product is purchased in different types of quantities by different users?
Market pricing is another model which is used in highly competitive and minimally differentiated markets. Strong players like Amazon for instance can ask and get a premium based on better services or better timeliness of services. However businesses have to watch out for not competing themselves away.
Feature pricing is another example of pricing model where the pricing starts from a baseline of features or a bare bone version. This model often suffers from a lot of customer complaints.
Another extension of a pricing model based on reusability is razor and blade model.
Here the base component us sold cheaply or even given away and the consumable portion is charged as used or more often. To be able to provide the base units, there must be a deep pocket to begin with.
Generally speaking complex pricing models can get more and more complex but the right use of metrics and simpler conversions can overcome the shortcomings of overly simplistic model.
Courtesy Cayenne Consulting blog





Friday, May 15, 2015

A quick look at cascade styles in Hibernate ORM framework. By default there is no cascading of state between one associated entity and another. Hibernate does not implement persistence by reachability by default. If we want a cascade style along an association, we must specify it expicitly in the mapping file. Cascading options  can be described as persist, delete, lock. These can be combined. The associations can be parent child for these to work in that what affects the parents cascades to the child.
The cascading operations for a parent child relationship are as follows
If the parent is passed to persist, all children are passed to persist
If the parent is passed to merge, all children are passed to merge.
If the parent is passed to save, update, saveorUpdate, all the children are passed to the same
If a transient or detached child becomes referenced by a persistent parent, saveorUpdate is called.
If a parent is passed to delete, all the children are passed to delete.
If a child becomes dereferenced from a persistent parent, nothing special happens. Cascade = delete-orphan could handle this case.

Thursday, May 14, 2015

Hibernate and deleting persistent objects:
When deleting objects with Hibernate it's best to think of it as making an object transient. The state of the object is erased from the database but it can be referenced.  The order of deleting the objects is not important because there is no risk of violating a foreign key constraint. A NOT NULL constraint on a foreign key column may still be violated if the order is incorrect.--
This is resolved by cascade options.
When flushing the session, the following order is important
All entity insertions in the same order that the save () were called
All entity updates
All collection deletions
All collection elements deletions, updates and insertions.
All collection insertions
All entity deletions in the same order as delete () were called.
While this order is guaranteed there are no guarantees when these JDBC calls will be called except unless explicitly invoked with a flush(). That said, there are different FlushModes available to make these less frequent.
These modes include :
- flush at commit time when the Hibernate Transaction API is used
- flush automatically using the explained routine
- or never flush unless flush is explicitly called.
In addition to Flush modes and cascade styles offered, Hibernate also makes its metadata available to applications. This way applications can choose to implement deep copy algorithms such as for mutable value types and not for immutables or associated entities. Hibernate exposes metadata via the SessionFactory. Instances of the metadata interfaces include ClassMetadata, CollectionMetadata, and the Type hierarchy.




Sunday, May 10, 2015

Persisting objects with Hibernate.
Hibernate defines three object states. Transient, persistent and detached
Transient state is for example a new object. It has no ID associated and consequently no representation in the database. These objects will be collected by the garbage collector. The session helper methods can be used to save the object.
A persistent state is one where there is a database representation available. When we load an object we put it in this state. This object is now in the scope of session. Any changes made to the object will be detected.
A detached state is one where the object goes out of scope of session. Changes can be made because the reference is valid. When the object is reattached to a session,  it and all  it's changes can become persistent again. This enables a way to work with long running unit if work which are called application transaction.
The save method on the session makes an object persistent. It does not guarantee to return an identifier. The assignment might happen at flush time.
The load method of a Session provides a way of retrieving a persistent instance based on its identifier.
Load can work through a proxy. If the class is mapped with a proxy, load returns an initialized proxy which does not actually hit the database. This helps with creating associations or working with batches. If the load has to reach a database and there is no matching row, then there is an unrecoverable exception.Its better to detect the database record with a get method which returns null if there's none. Objects can be loaded for update only when there's a LockMode specified or a cascade style specified.
Reload of an object can work with refresh in the sequence save()->flush()->refresh()
Objects saved by the session are all transactional persistent instances and any changes to the persistent state will be persisted when the session is flushed. Therefore there is no need to call a method such as update between load and flush.
Hibernate works with states only. It does not work with SQL statements from users. That approach might be better with JDBC. Further Batch processing conflicts with online transaction processing, so prefer not to do batching with Hibernate although some options are available.
When an object is loaded but presented to a higher layer where it may spend an inordinate amount of time may require separate transactions for the retrieving and saving. These "long" unit of work therefore have to work with versioned data.
To reattach this detached instance, we call update if the session does not already contain a  persistent instance. We use merge when we want to merge the modifications at any time without consideration of the state of the session.

If there are associated items to the entity we want to save, then they too can be persisted in any order as long as there is no not null constraints on a foreign key column. There is never a risk of violating a foreign key constraint. On the other hand there is risk of violating a not Null foreign constraint if the order is not maintained.

As an aside, the lock method can be used to reassociate a detached object. However the detached instance has to be unmodified. There are several LockMode available.

We now look at automatic state detection. This is enabled via saveOrUpdate method.
This method is supposed to generate a new identifier or reattach with an existing identifier. But first let's note that update, merge and saveOrUpdate methods are not to be called if we are using the same session. They are typically used when going from older session to a newer session.

SaveOrUpdate uses object versioning either with a version or a timestamp. If the version is the same, save it. If the version is different update it

Merge is very different. If there is a persistent entity with the same identifier in the session,  merge will  update it. If there is no persistent entity, merge will load from the database or create a new one. The returned entity doesn't become part of the session but remains detached.

#codingexercise


GetAllNumberRangeProductNinthRootPowerTen(Double [] A)



{





if (A == null) return 0;





Return A.AllNumberRangeProductNinthRootPowerTen();


}