Monday, August 10, 2015

Research about Java Bytes

Research Findings:
1. byte is a signed type in Java.
2. The byte data type is an 8-bit signed two's complement integer. It has a minimum value of -128 and a maximum value of 127 (inclusive). The byte data type can be useful for saving memory in large arrays, where the memory savings actually matters. They can also be used in place of int where their limits help to clarify your code; the fact that a variable's range is limited can serve as a form of documentation.
3. 10. Assuming that we are going to represent the concept of "raised to the power of" with the "^" symbol (so "10 squared" is written as "10^2"),
4. Our base-10 number system likely grew up because we have 10 fingers, but if we happened to evolve to have eight fingers instead, we would probably have a base-8 number system. You can have base-anything number systems. In fact, there are lots of good reasons to use different bases in different situations.
5. Computers happen to operate using the base-2 number system, also known as the binary number system (just like the base-10 number system is known as the decimal number system).
6. base-2 computers are relatively cheap.
7. So computers use binary numbers, and therefore use binary digits in place of decimal digits.
8. The word bit is a shortening of the words "Binary digIT."
9. Whereas decimal digits have 10 possible values ranging from 0 to 9, bits have only two possible values: 0 and 1. Therefore, a binary number is composed of only 0s and 1s, like this: 1011.
10. You can see that in binary numbers, each bit holds the value of increasing powers of 2. That makes counting in binary pretty easy. Starting at zero and going through 20, counting in decimal and binary looks like this:
11. 0 and 1 are the same for decimal and binary number systems.
12. Bits are rarely seen alone in computers. They are almost always bundled together into 8-bit collections, and these collections are called bytes.
14. Why are there 8 bits in a byte? A similar question is, "Why are there 12 eggs in a dozen?" The 8-bit byte is something that people settled on through trial and error over the past 50 years.
15. With 8 bits in a byte, you can represent 256 values ranging from 0 to 255
16. Bytes are frequently used to hold individual characters in a text document.
17. In the ASCII character set, each binary value between 0 and 127 is given a specific character.
18. Most computers extend the ASCII character set to use the full range of 256 characters available in a byte. The upper 128 characters handle special things like accented characters from common foreign languages.
19. You can see the 127 standard ASCII codes below. Computers store text documents, both on disk and in memory, using these codes
20. Open up a new file in Notepad and insert the sentence, "Four score and seven years ago" in it. Save the file to disk under the name getty.txt. Then use the explorer and look at the size of the file. You will find that the file has a size of 30 bytes on disk: 1 byte for each character.
21. Each character consumes a byte
22. By looking in the ASCII table, you can see a one-to-one correspondence between each character and the ASCII code used.
23. In mathematics and computing, hexadecimal (also base 16, or hex) is a positional numeral system with a radix, or base, of 16.
24. Several different notations are used to represent hexadecimal constants in computing languages; the prefix "0x" is widespread due to its use in Unix and C (and related operating systems and languages).
25. Each hexadecimal digit represents four binary digits (bits)
26. One hexadecimal digit represents a nibble, which is half of an octet or byte (8 bits).
27. In URIs (including URLs), character codes are written as hexadecimal pairs prefixed with %: http://www.example.com/name%20with%20spaces where %20 is the space (blank) character (code value 20 in hex, 32 in decimal).
28. Unicode is a computing industry standard for the consistent encoding, representation, and handling of text expressed in most of the world's writing systems.
29. The key is that the hex literal 0xFF is still an int..that is, it takes up 32 bits. That makes it look like this in binary:
00000000 00000000 00000000 11111111
30. The unary bitwise complement operator "~" inverts a bit pattern;
31. Firstly, you can not shift a byte in java, you can only shift an int or a long. So the byte will undergo promotion first, e.g.
32. The & operator is a bitwise "And". The result is the bits that are turned on in both numbers. 1001 & 1100 = 1000, since only the first bit is turned on in both.
33. This MessageDigest class provides applications the functionality of a message digest algorithm, such as SHA-1 or SHA-256. Message digests are secure one-way hash functions that take arbitrary-sized data and output a fixed-length hash value.
34.  The digest method can be called once for a given number of updates. After digest has been called, the MessageDigest object is reset to its initialized state.
35.  


Now, x >> N means (if you view it as a string of binary digits):
The rightmost N bits are discarded
The leftmost bit is replicated as many times as necessary to pad the result to the original size (32 or 64 bits), e.g.
00000000000000000000000000101011 >> 2 -> 00000000000000000000000000001010

11111111111111111111111111010100 >> 2 -> 11111111111111111111111111110101

Keywords:
Bit, Hexadecimal digits(4-bits), Byte(8-bits), ASCII, Unicode,

Examples:
(1 * 2^3) + (0 * 2^2) + (1 * 2^1) + (1 * 2^0) = 8 + 0 + 2 + 1 = 11

References:
http://www.asciitable.com/
http://unicode-table.com/en/#0004
https://docs.oracle.com/javase/tutorial/java/nutsandbolts/op3.html
http://stackoverflow.com/questions/3312853/how-does-bitshifting-work-in-java
















Thursday, August 6, 2015

Research about Docker Support in Pivotal Cloud Foundry

Knowledge Sharing:
1.  Diego builds out the new runtime architecture for Cloud Foundry, replacing the DEAs and Health Manager.
2.  Diego also helps bring a cleaner container abstraction with Warden, the container technology developed originally for Cloud Foundry.
3.  Diego does not run Docker containers. It has an interface to run compatible images in Warden containers. For the end user, there is very little difference. You can push a Docker image into Warden. Diego is designed to run different backends.
4.  The droplet execution manager (DEA), health manager and some of the cloud controller are now taken care of by Diego, Whelan said
5.  Docker is important for the future of PaaS. Every new PaaS has a strong connection to Docker. To ignore Docker containers ina PaaS would be suicidal.
6.  Diego does that (admittedly with more specificity) and a lot more: containerization, log aggregation, routing, health-management, etc
7.  Each App Lifecycle provides a set of binaries that manage an application lifecycle that specific to Cloud Foundry.
8.  One of the selling points of Diego, is that you support various container backends, such as Windows or Docker.
Functionality is being added to enable end-users to push Docker images directly into a Cloud Foundry cluster running Diego.


References:
http://htmlpreview.github.io/?https://raw.githubusercontent.com/cloudfoundry-incubator/diego-design-notes/master/clickable-diego-overview/clickable-diego-overview.html
http://thenewstack.io/docker-on-diego-cloud-foundrys-new-elastic-runtime/
http://i1.wp.com/blog.cloudfoundry.com/wp-content/uploads/2013/02/fa2_fig021.jpg
http://blog.pivotal.io/pivotal-cloud-foundry/features/cloud-foundry-container-technology-a-garden-overview
http://www.activestate.com/blog/2014/09/cloud-foundry-diego-explained-onsi-fakhouri





Wednesday, August 5, 2015

Research about installing Pivotal Cloud Foundry


Knowledge Sharing:
1. PCF Installation Virtual Appliance is known as Ops Manager
2. Binding a service instance to your application triggers credentials to be provisioned for the service instance and delivered to the application runtime in the VCAP_SERVICES environment variable.
3. Managed Services are defined as having been integrated with Cloud Foundry via APIs and enable end users to provision reserved resources and credentials on demand.
4. For local development we recommend using Bosh Lite to deploy your own local instance of Cloud Foundry.
5. A stemcell is a VM template with an embedded BOSH Agent.
6. “Cloud Foundry v2” they are referring to the version of the cloud controller API. The services API is versioned independently of the cloud controller API.
7. How a service is implemented is up to the service provider/developer. Cloud Foundry only requires that the service provider implement the service broker API. A broker can be implemented as a separate application, or by adding the required http endpoints to an existing service.
8. Pivotal Web Services was born as a place agile teams could rapidly update and scale applications across multiple environments and let Cloud Foundry maintain their applications’ health in production.
9.  PWS is Pivotal’s public Platform-as-a-Service offering. PaaS systems let you host apps by pushing them to a service rather than having to configure and maintain separate installations of web servers, load balancers and so on. PWS is a hosted installation of the open-source Cloud Foundry project, to which Pivotal is a primary contributor.
10. bosh-lite uses Vagrant and a Warden BOSH CPI to deploy Cloud Foundry in a VM. A single VM is created using Vagrant, then each Cloud Foundry component is deployed in its own Warden container using BOSH. bosh-lite supports VMware Fusion, Virtualbox, and AWS
11. In the previous release of Cloud Foundry, Micro Cloud Foundry was a useful tool for Cloud Foundry developers or anyone with a need to run a local instance of Cloud Foundry. Micro Cloud Foundry has not been upgraded for Cloud Foundry v2.


References:
http://docs.pivotal.io/pivotalcf/getstarted/#system
https://upload.wikimedia.org/wikipedia/commons/9/96/VMware_vSphere_in_the_Enterprise_diagram_v1.0.gif
http://pubs.vmware.com/vsphere-60/index.jsp#com.vmware.vsphere.install.doc/GUID-78933728-7F02-43AF-ABD8-0BDCE10418A6.html
http://stackshare.io/stackups/heroku-vs-pivotal-web-services
http://yourstory.com/2012/07/tutorial-getting-started-with-cloud-foundry-part-13/

Local Instance of Cloud Foundry:
https://github.com/cloudfoundry/bosh-lite
https://github.com/cloudfoundry/warden
http://yourstory.com/2012/07/tutorial-getting-started-with-cloud-foundry-part-13/


Docker vs Warden:
http://jamie-wang.iteye.com/blog/2175918
https://gist.github.com/syslxg/5a2ef3cb54f77d6c6572

Challenges:
1. Service Instances
2. Bind Service Instances
3.

Buildpacks:
https://spring.io/blog/2015/04/27/binding-to-data-services-with-spring-boot-in-cloud-foundry
http://blog.altoros.com/creating-a-custom-cloud-foundry-buildpack-from-scratch-whats-under-the-hood.html





Research about deploying application in Pivotal Cloud Foundry

Research Results:
1. Org – Use this to name a cluster of applications that are logically grouped together.
2. Space – Use each space as a separate environment for your application. An Org has multiple spaces, which serves as a convenient way to manage different environments for your applications.
My Cloud Foundry account has an Org called all-apps with a space called staging.
3. Each space role applies only to a particular space.
4. With auto-reconfiguration, Cloud Foundry creates the database or connection factory bean itself, using its own values for properties such as host, port, username and so on. For example, if you have a single javax.sql.DataSource bean in your application context that Cloud Foundry auto-reconfigures and binds to its own database service, Cloud Foundry does not use the username, password and driver URL you originally specified. Instead, it uses its own internal values. This is transparent to the application, which really only cares about having a relational database to which it can write data but does not really care what the specific properties are that created the database. Also note that if you have customized the configuration of a service, such as the pool size or connection properties, Cloud Foundry auto-reconfiguration ignores the customizations.
5. At Cloud Foundry, apps are hosted in spaces, and a space belongs to an org.
6. Every app in Cloud Foundry will have a unique name. Names are made of alphanumeric characters without any space.

Samples:
https://docs.cloudfoundry.org/buildpacks/ruby/sample-ror.html
https://spring.io/guides/gs/sts-cloud-foundry-deployment/

References:
http://pivotallabs.com/deploying-jruby-rails-application-cloud-foundry/
http://docs.pivotal.io/pivotalcf/concepts/roles.html
http://docs.run.pivotal.io/devguide/deploy-apps/environment-variable.html
https://docs.cloudfoundry.org/devguide/deploy-apps/deploy-app.html
https://docs.cloudfoundry.org/buildpacks/java/spring-service-bindings.html#cloud-profiles-java
http://theblasfrompas.blogspot.com/2014/06/pivotal-cloud-foundry-installed-lets.html
http://naturalprogrammer.com/2015/02/06/pivotal-cloud-foundry-spring-boot-web-applications/
http://www.cloudworkshop.org/cloudfoundry/quickstartguide_20150423.pdf
https://blog.appdynamics.com/java/monitoring-apps-on-the-cloud-foundry-paas/
http://www.eclipse.org/community/eclipse_newsletter/2015/april/article3.php
http://support.run.pivotal.io/entries/30758809-not-able-to-push-the-application-









How to do research about Competitors


Research:
1. You'd be surprised how often companies will tell you everything you'd like to learn over the phone, especially if the question is phrased in a context that makes sense. For example, if you want to know how many people work there, you can say: 'I'm looking for individualized attention, and my fear is that your organization is too large, and I'll get lost in the shuffle. How many coaches do you have on staff? Oh, wow, that's quite a few.
2. Seriously. The art of bartering — that is, exchanging stuff and services for other stuff and services without spending any money at all — is becoming huge. People are bartering almost anything and everything imaginable these days, from roof repairs to legal services to Pilates sessions to hotel accommodations to baby-sitting shifts.
3.

Questions:
1.  Who are your competitors ? [Need to identify all competitors, not just top 5, which will overlook some competitors.]
2.

References:
http://www.inc.com/guides/201105/10-tips-on-how-to-research-your-competition.html
http://www.lifeedited.com/share-your-best-friend-with-these-dog-sharing-sites/
http://www.today.com/id/33509970/ns/today-money/t/tricks-swapping-your-way-free-stuff/#.VcC6CpNViko
http://articles.latimes.com/2013/jan/07/local/la-me-dog-share-20130107


News:
http://sharetraveler.com/peer-peer-pet-sitting/
http://www.yelp.com/topic/atlanta-dog-swap-pet-sitting-services
http://www.yelp.com/biz/city-dog-share-san-francisco