Open Policy Agent[1] is a promising, light weight and very generic policy engine to govern authorization is any type of domain. I found this comparion[2] very attractive in evaluating OPA for a project I am currently working on, where they demonstrate how OPA can cater same functionality defined in RBAC, RBAC with Seperation of Duty, ABAC and XACML.
Here are the steps to a brief demonstration of OPA used for HTTP API authorization based on the sample [3], taking it another level up.
Running OPA Server
First we need to download OPA from [4], based on the operating system we are running on.
For linux, curl -L -o opa https://github.com/open-policy-agent/opa/releases/download/v0.10.3/opa_linux_amd64
Make it executable, chmod 755 ./opa
Once done, we can start OPA policy engine as a server. ./opa run --server
Define Data and Rules
Next we need to load data and authorization rules to the server, so it can make decisions. OPA defines these in files in the format of .rego. Below is a sample …
Get link
Facebook
Twitter
Pinterest
Email
Other Apps
How to Pick Best Stocks in Share Market
Get link
Facebook
Twitter
Pinterest
Email
Other Apps
When thinking about investments, 3 things come to my mind, in the Sri Lankan context.
Buy real state in a suburb or a town that is fast growing
Put in a Fixed Deposit in a bank
Invest in the stock market
As the current FD rates are in the declining phase, it did not really come as a good option for me at the moment of writing this. Hence I thought to investigate a bit on investing in the share market as it doesn't really need a larger amount of money as to by property as in option 1.
Below is an insightful speech by the richest person in Sri Lanka, who is known as a business magnate, 'Mr. Dhammika Perera', explaining how he started with share market (while the overall speech highlights many important facts, he specifically talks about share market from 6minutes and 26 seconds. Speech is in Sinhalese).
One thing he said, captured me that do not enter a business if you do not know about it. He also emphasized that it's the knowledge we should seek, not money, which surprised me to hear from him until I understand the depth of that statement.
Why you should not totally depend on your stock broker's advice?
As pointed out in Mr.Dhammika Perera's speech, if stock broker's adviser is so brilliant first they would have made their own investments and be rich than keep doing a job that ends up in a monthly salary. That is one aspect to look at it. While I really value the adviser's inputs as he is much more experienced in the business while I am a novice, still it doesn't stop me from learning the art and analyze why he is saying it.
Also, there are stock market manipulations such as 'Front running' where stockbrokers use their advance knowledge of pending customer orders to make a profit. Nowadays, since investors can directly place an order online, I suppose this is under some control.
Ultimately no one else out there will have a need to earn for you than you yourself.
How to select stocks to buy?
I am just suggesting this with my 3 months knowledge gathered investigating the share market businesses. Therefore take it at your own risk or comment if you know better. :)
1. Price going up or down?
Obviously, we buy when the price is low and we sell when the price is high. The difference will make our profit after deducting broker fees and other commissions, or make a loss if hard luck. So the question is how to judge whether it's low price or a high price or where the prices will go in the future. This may look simple at a glance, but this is the most complex decision to take in a stock market. Sometime price may be in a decreasing trend, yet not really at a low range.
To help make a decision amongst this complexity there is a technical methodology that needs to be mastered. In this technical analysis, it analyzes the past data statistically identify some known patterns that have proven to work with a good probability. Here it tries to apply these known patterns to the past data of a particular stock. It will need some experience to train your eye to see these patterns in the candle charts, but mastering it will be a great support in the decisions. Below is such analysis done on Sampath Bank stocks.
Once the patterns are identified there are 3 more statistically calculated indicators that can be used to further refine and time the purchase or sale.
RSI - Relative Strength Index
This indicates the speed and change of price movements of a specific stock. This can be a value from 0-100, where values below 30 indicate oversold --> time to buy and values above 70 indicates overbought --> time to sell.
Stochastic RSI (STOCH RSI)
Here the limits to consider are 20 and 80 in contrast to RSI. While I am still trying to understand the different theories behind this and RSI, the rule of thumb is to depend on RSI in a trending market(going in one direction, up or down) while weighting STOCH RSI more in a choppy market(going both up and down). This is not recommended to use as the sole indicator without combining with others.
MACD is a lagging indicator that can reveal information on strength, momentum, direction, and duration of a trend. Zero crossover, Divergence is most important to look at.
Below is a candle with the above indicators shown at the bottom. Making use of what they are trying to tell us is in our hands with experience and knowledge we gain.
2. Is the price is above the net assets value of the company?
Next thing that needs to be considered apart from the above indicators is whether the share price within the net asset value of a company. It is not rational to buy shares above the net asset value of a company in most of the cases.
3. Dividends
Dividends is another we can make profits. There are several companies in the Sri Lankan stock market, which has continuously paid dividends to their investors, at their financial year or as interim dividends. Within this set of companies, there are few dividends paying companies that are released from taxes as well. We should also consider this as a plus point at buying and should check if there is a dividend announcement and pay attention to XD-date. Following 2 dates are significant in receiving dividends.
Record date - This is the date when we must be on the company records as a shareholder to receive the dividend.
XD-date (Ex-Dividend Date) - If we purchase a stock on its XD date or after, we are not eligible to receive the dividend payment. Instead, the seller gets the dividend. If we purchase before the ex-dividend date, we get the dividend.
4. General Knowledge
Then additionally we can make use of general information like recent political changes, tax enforcement, laws, consumer trends, new innovations, foreign impacts etc. to predict on the future of market segments to make the investment decisions more accurate.
Digital signing is a widely used mechanism to make digital contents authentic. By producing a digital signature for some content, we can let another party capable of validating that content. It can provide a guarantee that, is not altered after we signed it, with this validation. With this sample I am to share how to generate the a signature for SOAP envelope. But of course this is valid for any other content signing as well.
Here, I will sign The SOAP envelope itselfAn attachment Place the signature inside SOAP header
With the placement of signature inside the SOAP header which is also signed by the signature, this becomes a demonstration of enveloped signature.
I am using Apache Santuario library for signing. Following is the code segment I used. I have shared the complete sample here to to be downloaded.
In most of the business services sometimes there comes requirements to send notifications to users or administrators via email.
For example : Confirming a user registrationPassword reset via emails
Following code segments can be used to send these emails using Google SMTP server. Here I am sharing two ways to do it. Using javax.mail.jar directlyUsing Apache commons email jar which wraps javax.mail
Using javax.mail try {
Properties props = new Properties();
props.put("mail.smtp.host", "smtp.gmail.com");
props.put("mail.smtp.auth", "true");
props.put("mail.debug", "false");
props.put("mail.smtp.ssl.enable", "true");
Session session = Session.getInstance(props, new EmailAuth());
Message msg = new MimeMessage(session);
InternetAddress from = new InternetAddress("sendersEmailAddress", "Sender's n…
Open Policy Agent[1] is a promising, light weight and very generic policy engine to govern authorization is any type of domain. I found this comparion[2] very attractive in evaluating OPA for a project I am currently working on, where they demonstrate how OPA can cater same functionality defined in RBAC, RBAC with Seperation of Duty, ABAC and XACML.
Here are the steps to a brief demonstration of OPA used for HTTP API authorization based on the sample [3], taking it another level up.
Running OPA Server
First we need to download OPA from [4], based on the operating system we are running on.
For linux, curl -L -o opa https://github.com/open-policy-agent/opa/releases/download/v0.10.3/opa_linux_amd64
Make it executable, chmod 755 ./opa
Once done, we can start OPA policy engine as a server. ./opa run --server
Define Data and Rules
Next we need to load data and authorization rules to the server, so it can make decisions. OPA defines these in files in the format of .rego. Below is a sample …
This comment has been removed by a blog administrator.
ReplyDeleteThanks for sharing the wonderful and helpful information
ReplyDeleteDelhi Agra Jaipur Yatra
India Trip Designer
www.indiatripdesigner.com
+91-9837332533