my net house

WAHEGURU….!

Logging and importance of it with examples

Python and Flask supports wide range of logging as well. Either it’s warning, error or just a logger you can ago through all of those in very specific instance of time.


Logging is important of the Maintainability of the application.

Now logging is something like you need to go for when you see or feel that your web app needs lots of “Watching as well!”

Here is simple Example in Flask:

import logging
from logging.handlers import RotatingFileHandler

from flask import Flask

app = Flask(__name__)

@app.route('/')
def foo():
app.logger.warning('A warning occurred (%d apples)', 42)
app.logger.error('An error occurred')
app.logger.info('Info')
return "foo"

if __name__ == '__main__':
handler = RotatingFileHandler('foo.log', maxBytes=10000, backupCount=1)
handler.setLevel(logging.INFO)
app.logger.addHandler(handler)
app.run()

[/code ]

for more detailed view on logging and system you can go for the following link as well. :

It’s very much explanatory: https://gist.github.com/mariocj89/73824162a3e35d50db8e758a42e39aab

install,setup and Play with Mongo Python

This is the good way to do stuff with Mongo, Python and other.

https://hevodata.com/blog/install-mongodb-on-ubuntu/

 

Deploy Micro-service in Seconds Using Falcon

Falcon framework is great when you have to build micro-services in Python, All we need to do is create a Class that would provide the specific Purpose to Establish one Micro-service as Route and add the route to the API would be able to server as deploy multiple modes inside the Falcon Architecture as well.


# sample.py

import falcon

class QuoteResource:
def on_get(self, req, resp):
"""Handles GET requests"""
quote = {
'quote': (
"I've always been more interested in "
"the future than in the past."
),
'author': 'Grace Hopper'
}

resp.media = quote
class HelpObject:
def on_get(self, req, resp):
"""Handles GET requests"""
quote = {
'quote': (
"I've always been more interested in "
"the future than in the past."
),
'author': 'Arshpreet Singh'
}

resp.media = quote

api = falcon.API()
api.add_route('/quote', QuoteResource())
api.add_route('/quote2', HelpObject())
<span id="mce_SELREST_start" style="overflow:hidden;line-height:0;">&#65279;</span>

IBM hyper ledger Business Card creation and Code familiarity [inbetween]

model/*.cto file- This file is able to describe Asset, Participant and Transactions those occur at that business network as well .

  • Namespace
  • Resources
  • Imports from other namespaces, as required

If your model is very large, you can have multiple .cto model files, as necessary. Every .cto model file must include a single namespace and at least one resource definition.

NameSpace: NameSpace is just naming convention for the File-System. For each of your .cto file namespace would be an unique name for the file. Each of the resources available in the file would be taken from that namespace.

Resource: Now we have following kind of resources we can use.

Asset: A business network Asset(Example Bit-coin is an Asset in Bit-coin-Network)

Transaction: A business Logic

Participant: A business network Participant

Event: Notification of something happening in the network

Enumerated Type: A set of named Values

Concept: Any object you want to model that is not one of the other types

Each resource type corresponds to its model type of the same name (for example, asset is used to model an Asset, participant models a Participant, etc.)

 

asset Vehicle identified by vehicle_id {

 

 

}

Disruption of Block-Chain in Present and Future

An immutable and distributed ledger with unique set of transactions in the forms of blocks depends on the nature and cohesiveness of each transaction which is either able to form the solution or disrupt the already existing solutions is the main event for the current existence and hype for the Block-Chain and it’s nature in the present and future.

There are certain core features of Block-Chain which includes transparency,  democracy,  Efficiency, decentralization and security, Such features can also be considered as default ones because It is the real nature of Block-Chain the provides such basic norms on the FLY!

  1. Banking: obviously!

If we talk about how and when Banking is going to be into Block-chain and how much that could bring out real change into the things then things are already there to have fun with!

Why we need Banks? – A basic institution that is able to save your money like a wallet and you are able to send it all over the world. Right now just believe that we are not talking about Investments as well.

Download ABRA and just Enjoy the Bank in an APP: https://www.abra.com/

Barclyas is the bank that uses the BlockChain:

15% of Banks will be using Block-Chain by the end of 2017:

2. Cyber Security:

Data is stored in the encrypted form and each time it is verified by multiple parties while storing it in DB so that means each time Data is able to secure by default. That eliminates the need of Third party security systems!

3.  Supply-Chain Management! (OMG that was DOPE when I heard that how Efficient it could be in Supply-Chain management):

All the transactions are Documented in permanent record and are being watched securly when any assest is moved from one party to another in the supply chain management!  That is able to measure time, Cost, labor and Emissions which is helpful to reduce and form the necesary  plan to make complete Efficient Supply-Chian management! Which is also helpful to verifity the authenticity and fair trade status of the product.

Startups that are working on Supply-Chain Management are as follows:

https://www.provenance.org/whitepaper

https://bravenewcoin.com/news/fluent-unveils-blockchain-based-global-supply-chain-software-platform/

http://www.skuchain.com/

http://www.blockverify.io/

4. Forecasting:

Think of world like where each and every person is able to collaborate their brian-power and able to build and things collaboratly either it is a research work or making a staretgy that is able to predict next stock price in the NASDAQ!

A decentralized prediction market solution: http://www.augur.net/

5. Networking and IOT:

Thinks of different nodes and how these are able to communicate with each other that could bring repairing and updating and repairing itself without even need of external human maintainer! All the nodes would be able to connecet to each other with eliminating the need of centralized system.

One can see whole idea about ADEPT here: https://www.slideshare.net/_hd/ibm-adept

6. Insurance:

Insurance is based on trust management. BlocakChain can be used to verify many types of data in insurance contracts! Like the real identity of insured person as well as his/her medical records as well.

One example of such system is Aeternity: https://aeternity.com/

7.  Private Transport and Ride Sharing:

There are various cases of Block-Chain which can  be helpful for peer to peer ride sharing system. Presently most of the Ride sharing or Taxi booking systems are based on the some kind of Centralized system like Uber and OLA but using Peer to Peer Transactions and communication can be improved and cost of middle man or centralized system can be reduced over a large amount!

Great Examples are Arcade City and Lazooz:

https://cointelegraph.com/news/arcade-city-decentralized-blockchain-based-answer-to-uber

http://lazooz.org/

8.   Cloud Storage:

It was always a challenge  only because we always need to secure data and have it in many different places and those places should be on virtual locations not in one but also in many!

Storaj is one example of that: https://storj.io/

9. Charity:

There are many cases of corruption comes into place when there are money collection and resources utilization in the charity, There is no doubt that in the cases of Charity because of less transparency all the Money of Charity could be involved into wrong things as well. BlcokChain could be a very useful to get to know that where the donations are going!

https://www.bitgivefoundation.org/

 

10.  Voting:

Block-chain can also be used for Registration, Verification and Vote-counting. Creating and immutable, Publicly viewable ledger of records is the real way to make elections more democratic and viewable.

https://www.democracy.earth/

https://followmyvote.com/

11. Government:  Most of the government based systems are slow, in-efficient and biased. To slow down the bureaucracy,increase security, efficiency and to make government systems more transparent BlockChain is so far the best solution as well.

https://www.khaleejtimes.com/editorials-columns/blockchain-future-is-here-and-dubai-has-grabbed-it

12. Public Benefits:

Public Benefits is the one of the system that has suffered each time from slowness and bureaucracy, As one of the major thing of being transparent block-chain here is the great player to implement that all benefits towards public can be shared in transparent way.

Govcoin is one of the example of BlockChain that is disrupting welfare  system in the UK:

https://www.blockchaintechnology-news.com/2017/11/28/govcoin-aims-disrupt-uk-welfare-system/

There is one more project which is called circle that is able to implement Universal Basic Income using BlockChain: https://www.circle.com/in/

13: Health-Care:

Hospitals always  lack of need to save secure data and that can be used foe various treatment in the patients. BlockChain can be used to save and secure Medical data of patients and that can be shared with Authorized doctors and patients.

Following are the two startups working on the BlockChain to work on secure data:

https://gem.co/

https://tierion.com

14.  Energy Management: Energy Producers and users  have to go through a long list of middle grids to get resources from each other.

Transactive Grid is blockchain solution that is able to create De-Centralized way share resources between various energy producers and consumers.  Transactive Grid uses the Ethereum Blockchain.

15. Online Music:

There are several Block-Chain solutions those are working on the problem for selling music from producers to users. Smart contracts can also be used directly to solve the issue of licensing.

http://myceliaformusic.org/

https://ujomusic.com/

16. Retail:

Shopping is always based on trust on the shop or the market place but in real there is no particular way to understand that how good or bad product could be inside the wrapper. BlockChain is able to cut all the middle-man between buyers and sellers so each time time. Smart contracts are there to maintain the credibility of the system.

https://www.openbazaar.org/

https://ob1.io/

17. Real State: There are few issues in real estate like Fraud, Lack of transparency and  mistaken in public records. BlockChain can simply reduce the paper based record keeping structure. Block-Chain implementation can simply help with tracking, verifying ownership, ensuring accuracy of documents and transferring the deeds.

The one company that is solving this problem is https://www.ubitquity.io/web/index.html

18. Crowd-Funding:

In Blcok-Chain Crowd-funding is created through smart-contarcts and online reputation system. New products can raise funds by releasing their own tokens and those tokens can be used later to buy products and other services.

19 OUR industry: Telecommunication and Networking. SDN(Software Defined Networking!)

Securechain delivers security, scalability and auditability to Software Defined Networks.

SYTEL REPLY HAS DEVELOPED A WORKING PROOF-OF-CONCEPT TO SHOW THE POTENTIAL OF THIS SYSTEM, BASED ON THE ETHEREUM BLOCKCHAIN (THE SAME BLOCKCHAIN AS CHOSEN BY THE R3 FINANCIAL CONSORTIUM, MICROSOFT
AND IBM/SAMSUNG), WHICH CAN NOT ONLY ALLOW VALID NETWORK ENTITIES SUCH AS SWITCHES TO ENTER THE NETWORK, BUT TO DETECT AND REJECT HACKING ATTEMPTS.
Paper based on Block-Chain and SDN:

The way of superior man! Small Digestion!

There are three stages in the life of a man!

Satge1: He thinks for himself only.

Stage2: He thinks for his Family, world and whole earth.

Stage3: He has his true purpose to live and he lives as Gift for the whole world, He has no worry to please anyone and and he has no worry as well to make anyone happy, he lives the way he wants to live and all the time whatever happens in his life and world around him gets huge potential, love, care and benefits for him! that is the way of the superior man! He is the gift for the whole world.

Very bold chapters in the book:

  1. Stop Hoping For a Completion of Anything in Life.(work is never ending Process)

2. Live As If Your Father Were Dead.

3. Be Willing to Change Everything In Your Life;

4. Women Are Not Liars;

5. You Will Often Want More Than One Woman;

6. Your Excellent Track Record is Meaningless to Her;

7. She Want’s the “Killer” In You;

 

Quote1: Keep going that is just life and the way.  LIfe is a journey not a destination!

“Most men make the error of thinking that one day it will be done. They think, ‘If I can work enough, then one day I could rest.’ Or, ‘One day my woman will understand something and then she will stop complaining.’ Or, ‘I’m only doing this now so that one day I can do what I really want with my life.’ The masculine error is to think that eventually things will be different in some fundamental way. They won’t. It never ends. As long as life continues, the creative challenge is to tussle, play, and make love with the present moment while giving your unique gift.”

Quote2: Are you really living up-to full potential that you don’t care if you just die! Fear of death goes away when you take life up-to full potential.

“If you were to die right now, what would be the feeling texture of your last moment? Are you feeling the infinite mystery of existence, so that your last moment would be one of awe and gratitude? Is your heart so wide open that your last moment would dissolve in perfect love? Or, are you so absorbed in some task that you would hardly notice death upon you, until the last instant, whoosh, and everything is gone?”

 

Quote3:  Beat mediocrity do something that you have done before! Embrace your limits and get crazy enough sometimes if possible.

To help you remember the triviality of your daily tasks, interrupt your schedule with refreshers. These refreshers should cut to your core and strip the fat off the moment. Consider your own death. Behold an image of the most enlightened being you know. Contemplate the mystery of existence. Relax into the deepest and most profound loving of which you are capable. In your own way, remember the infinite, and then return to the task at hand. This way, you will never lose perspective and begin to think that life is a matter of tasks. You are not a drone. You are the unbounded mystery of love. Be so, without forgetting your tasks.”

 

Quote4: Self discipline is the key to success.

The core of your life is your purpose. Everything in your life, from your diet to your career, must be aligned with your purpose if you are to act with coherence and integrity in the world. If you know your purpose, your deepest desire, then the secret of success is to discipline your life so that you support your deepest purpose and minimize distractions and detours.”

Quote5: Give it a little more than you can do. A little progress everyday!

In any given moment, a man’s growth is optimized if he leans just beyond his edge, his capacity, his fear. He should not be too lazy, happily stagnating in the zone of security and comfort. Nor should he push far beyond his edge, stressing himself unnecessarily, unable to metabolize his experience. He should lean just slightly beyond the edge of fear and discomfort. Constantly. In everything he does.

Quote6: Face your fear and embrace chances of success.

“By leaning just beyond your fear, you challenge your limits compassionately, without trying to escape the feeling of fear itself. You step beyond the solid ground of security with an open heart. You stand in the space of unknowingness, raw and awake. Here, the gravity of deep being will attend you to the only place where fear is obsolete: the eternal free fall of home. Where you always are. Own your fear, and lean just beyond it. In every aspect of your life. Starting now.

Quote7: Be the best version of yourself! the one from the one who was yesterday!

Make your life an ongoing process of being who you are, at your deepest, most easeful levels of being. Everything other than this process is secondary. Your job, your children, your wife, your money, your artistic creations, your pleasures – they are all superficial and empty, if they are not floating in the deep sea of your conscious loving.”

Quote8:  There is no shame in accepting your fears because these are just fears nothing else after all.

“A free man is free to acknowledge his fears, without hiding them, or hiding from them. Live with your lips pressed against your fears, kissing your fears, neither pulling back nor aggressively violating them.”

Quote9: Whatever you are and whatever is happening to you, you are the only one who is responsible for that!

“You are entirely responsible for cutting through your own laziness, addictions, and unclarity. There is nothing to wait for and nobody to blame. Whatever techniques are appropriate, use them. Try talking with your friends, using therapy, practicing meditation or prayer, going on a vision quest, reading scripture, walking in nature, keeping a journal, or studying with a teacher. Remember that your success with any method you choose depends entirely on your actual commitment to discovering your deepest truth and aligning your life with it.”

Quote10: The best you can get from anyone is yourself and yourself only! It is the way.

“Once you have grown into independent adulthood, you no longer need somebody to take care of you. You can be responsible for yourself. In particular, you realize that you are responsible for your own happiness. Nobody can live your life for you. You must create your own health, success, and happiness. This sense of self-responsibility is only a partial maturity, however. Beyond self-responsibility lies the responsibility to give your gift. It is important to grow beyond dependence on your intimate partner for your own happiness. But it’s equally important to grow beyond simple independence and autonomy. The next stage of intimacy after personal independence has been attained is the mutual flow of gifting, or serving each other in love.”

Hacker’s way to Build of Block-Chain!(Purely-Pythonic+HyperLedger)

What is Block-Chain?

it is just a DB and it is immutable. DB has access with multiple users and they can only create new entries.

What are the potentials behind Block-Chain?

-Cross-Question->Dude! Talk to a salesman who know how to sell comb to bald. I just write code.

w

How block chain works?  No Idea, Let’s build ONE!!

12740327191_SPLASH

Objective: We will use IBM hyperledger and Python-flask to create a wrapper around it and this wrapper  will be able to make REST calls to hyperledger. Bingo-Bascially we will hack Hyper-ledger from Pythonic way!

 

  1. Create your Business-Network.

Understanding of .bna file is really important! (You can download )

Before a business network definition can be deployed it must be packaged into a Business Network Archive (.bna) file.

Create your model file, You can use Online Playground:http://composer-playground.mybluemix.net

models/org.acme.biznet.cto

We’re assuming each Entity (i.e. Factory), will make use of RFID tags to store information on the food, and will scan that tag as it’s received. This information, such as timestamp, the date, and state (production, freezing, packaging, distribution) is stored on the Block-chain.

lib/logic.js

Script File From here, you will define the transaction processor functions, these are the functions that will execute when the transactions are invoked.The ChangeStateToProduction function will change the state of the current food to Production.

permissions.acl

“Access Control” from the left pane. From here, you can determine which participants of the business network have access to which assets and transactions.

These are the important Parts of .bna file for Hyperledger-Composer! One need to understand these three very well to get to know more about “A Smart Contract!”

1. Setting up the Environment(On Ubuntu 16.04 )

Download and install all required Pre-requisites:

curl -O https://gist.github.com/arshpreetsingh/2e628aea04d8615766b2ce14de4e5888

Run the script:

./prereqs-ubuntu.sh

2. Installing the Development Environment

Essential CLI tools

npm install -g composer-cli

Utility for running a REST Server on your machine to expose your business networks as RESTful APIs:

npm install -g composer-rest-server

Useful utility for generating application assets:

npm install -g generator-hyperledger-composer

Yeoman is a tool for generating applications, which utilises generator-hyperledger-composer:

npm install -g generator-hyperledger-composer

npm install yeoman-generator

npm install -g yo

Install Playground

npm install -g composer-playground

Install Hyperledger Fabric

This step gives you a local Hyperledger Fabric runtime to deploy your business networks to.

  1. In a directory of your choice (we will assume ~/fabric-tools), get the .zip file that contains the tools to install Hyperledger Fabric:

mkdir ~/fabric-tools && cd ~/fabric-tools

curl -O https://raw.githubusercontent.com/hyperledger/composer-tools/master/packages/fabric-dev-servers/fabric-dev-servers.zip

unzip fabric-dev-servers.zip

A tar.gz is also available if you prefer: just replace the .zip file with fabric-dev-servers.tar.gz1 and the unzip command with a tar xvzf command in the above snippet.

  1. Use the scripts you just downloaded and extracted to download a local Hyperledger Fabric runtime:

cd ~/fabric-tools ./downloadFabric.sh

Start Hyperledger Fabric

Start the fabric:

./startFabric.sh

Generate a PeerAdmin card:

./createPeerAdminCard.sh

You can start and stop your runtime using ~/fabric-tools/stopFabric.sh, and start it again with ~/fabric-tools/startFabric.sh.

At the end of your development session, you run ~/fabric-tools/stopFabric.sh and then ~/fabric-tools/teardownFabric.sh. Note that if you’ve run the teardown script, the next time you start the runtime, you’ll need to create a new PeerAdmin card just like you did on first time startup.

Deploying the Business Network

After creating the .bna file, the business network can be deployed to the instance of Hyperledger Fabric. Normally, information from the Fabric administrator is required to create a PeerAdmin identity, with privileges to deploy chaincode to the peer. However, as part of the development environment installation, a PeerAdmin identity has been created already.

After the runtime has been installed, a business network can be deployed to the peer. For best practice, a new identity should be created to administrate the business network after deployment. This identity is referred to as a network admin.

Retrieving the Correct Credentials

A PeerAdmin business network card with the correct credentials is already created as part of development environment installation.

Deploying the Business Network

Deploying a business network to the Hyperledger Fabric requires the Hyperledger Composer chaincode to be installed on the peer, then the business network archive (.bna) must be sent to the peer, and a new participant, identity, and associated card must be created to be the network administrator. Finally, the network administrator business network card must be imported for use, and the network can then be pinged to check it is responding.

  1. To install the composer runtime, run the following command:

composer runtime install --card PeerAdmin@hlfv1 --businessNetworkName pizza-on-the-blockchain

The composer runtime install command requires a PeerAdmin business network card (in this case one has been created and imported in advance), and the name of the business network.

  1. To deploy the business network, from the pizza-on-the-blockchain directory, run the following command:

composer network start --card PeerAdmin@hlfv1 --networkAdmin
admin --networkAdminEnrollSecret adminpw --archiveFile
pizza-on-the-blockchain@0.0.1.bna --file networkadmin.card

The composer network start command requires a business network card, as well as the name of the admin identity for the business network, the file path of the .bna and the name of the file to be created ready to import as a business network card.

  1. To import the network administrator identity as a usable business network card, run the following command:

composer card import --file networkadmin.card

The composer card import command requires the filename specified in composer network start to create a card.

  1. To check that the business network has been deployed successfully, run the following command to ping the network:

composer network ping --card admin@pizza-on-the-blockchain

The composer network ping command requires a business network card to identify the network to ping.

Generating a REST Server

Hyperledger Composer can generate a bespoke REST API based on a business network. For developing a web application, the REST API provides a useful layer of language-neutral abstraction.

  1. To create the REST API, navigate to the pizza-on-the-blockchain directory and run the following command:

composer-rest-server

  1. Enter admin@pizza-on-the-blockchain as the card name.
  2. Select never use namespaces when asked whether to use namespaces in the generated API.
  3. Select No when asked whether to secure the generated API.
  4. Select Yes when asked whether to enable event publication.
  5. Select No when asked whether to enable TLS security.

The generated API is connected to the deployed blockchain and business network.

Once the REST server is up and running, head over to https://localhost:3000/explorer

Running the Application

  1. Ensure Python is installed on your local environment (Both Python 2 and Python 3 are supported).
  2. Install the requirements using the command pip install -r requirements.txt.
  3. Run the application as: python application.py.
  4. Point your web browser to the address localhost:<port>.

One may Enjoy Different parts of My Application here.

1

2

3

4

5

https://github.com/arshpreetsingh/food-on-the-blockchain

 

Laws of Power(48 or more may be!)

Power:- Hmm, what it is and how we define power and how we are able to acquire and what are those things behind it’s existence those make humans more crazy about it. Knowledge is Power? Or Money is Power Or self-Awareness is power? Physical strength and Muscular body are also great examples of Power But what is real scenario behind power that lead Humans towards total destruction or behind great achievement.

images (1)

There is interesting saying of Robert Kiyosaki that explain many things about Power when you are young and how you can attain it or how you might be attaining it:

48 Laws of power could be Evil if you are not able to understand the real meaning behind the book. Now here are some practical aspects of book those many of readers might find attractive or really evil if someone is hungry for power and someone is desperate to learn how to acquire power.

1. Never Outshine the master:
Those who are above you always make them Great and Prosperous because you have to learn so much stuff from them.

2. Never Put Too much Trust in Friends, Learn to use Enemies!
In real way yo are always alone and you need to understand that loneliness is solitude and that solitude is the key to overcome your mental abilities. Most of the times when someone is too much surrounded by friends/Yes-Mans He or She gets too comfortable but on the other hand uncomfortable Environment with Enemies lead you to grow more!

3. Stay Mysterious as much as you can, There must be only one person in the whole world who must be knowing your true goal/mark and that person is you and only you! You must remember only one thing that you are at war and only you must be knowing your Next Move!

4. Speak Less but speak Effective whenever you are going to speak something.  Say less that means you would be able to get caught less about stuff that you are going to say about yourself.

5. Your reputation is the only thing that can help you to get unlimited power even when you are not working on it, It is so powerful law but you have to invest small chunks of time everyday to work on this law.

6. Don’t be attention seeker but learn to get attention whenever you are required to have it.

7. You must know or learn to know how Others will work for you and how you must make others realise that they would be doing great not for you but for themselves. All the time make people believe that they are competing against you or they might be doing things those might effect you because the people who are working for you are your enemies and that those enemies of yours will work so much for you only because they want to feel/make you low but in reality you know when you have to cut them and inherit all the stuff they did and make your wrapper around whole work your enemies have done for you. 🙂

8. If you need to force someone to come to you then you are already lost.:)
The force that you will apply on someone else will only make you week and look desperate and that desperation of yours could make someone scary. You never need to force someone all your energy should be around inventing the bait and that bait is the real way for someone to fall for you.

9. Arguments will only make your mind into less peace and more towards the complications and envy. Your arguments will make things more into deep where hope to make stuff happen move towards in less space. Although you might be cool and go towards your work and actions those could prove one to do things which are not on the real scenario but at end you will feel that when others were busy at arguments you took the lead and made the things happen. 🙂

10. Reality is that if there are positivism and affection resides inside the world there are also Negative thoughts and great amount of un-luckyness. Run from such people as much as you can and never look at them at all. If you will find the people in your life those are pulling you backward then you will never get ahead. Such people could also be your relatives or Loved-ones.

11. The more you will teach someone more he or she will go towards independence and more they will come to attack you back or will go so far away from you that you would never be able to get required benefits from them, Such cases are so common that most of the BIG industries follow those rules, Campus Placements are one example of such Law of Power. 😉

12. Learn to know where you have to apply honesty and how much it would effect your circumstances, Be nice to people when you have to be because then you would be able to make things more into realistic for your work, More nice and honest you will be towards other people for certain situations more you will be able to get their side for yourself.

13. Lure them for more and more things in those are for their self interest and they will only come to you when they will find that they are attracted towards you.

14. You are always nice to everyone and all the time you need to learn and understand how someone is behaving with you, in each case you must be going through many levels of layers when you are going to reveal about someone.

15. Wounded lion is far more dangerous than Healthy one, If you got your enemies into the world where they have lost from you once or twice than all you need to do kill them, Crush them properly because at any case if you will leave them un-touched you will regret at the END, Very MUCH!

16. Too much Availability is curse and If they get used to you they will never realise your true Value and that make them think and feel less about you, so use your presence only when it is effective most.

17. Stay Mysterious because that is the Ultimate gift you can give yourself. All the time they should be in-confusion that what would be your next move or how you are going to perform in next 3-4 days or what next you could say about stuff and things. Air of Mystery about you is the way they will never be able to understand your true Potential and your true findings. Less predictable you are less vulnerable you will be.

18. Sometimes just stay in the group and you will find that you have very good amount of Surroundings and security that will make you not shining like a Gold, That make sense because shining and shining alone all the time could cause huge amount of attraction towards you and you would be the one who anyone could be able to make a hit, Prevent yourself from attacks. Never Get ISOlated.

19. You must be knowing whom you are attacking before you are going to attack, Someone out there with really normal outlook could be super dangerous from outside, If you are mysterious anyone else could be as well, So learn to know that whom you are going to attack and how much loss that would cause you, So each time whenever you meet a mysterious person either stay away from that or be-aware very much before calling him out.

 

20. Your Real commitment should be only towards yourself and yourself only, your commitment to others could be more dangerous for both parties, one is your too much availability and other is how your availability towards others could decrease your time and at last but not least is your commitment to one side could also lead you to be enemy of OTHER-SIDE! either way you should avoid creating enemies of yours.

21. You are fool one ever anyone has seen, That should make them to think about you Because only then you would be able to know that what actually the other person is and how he/she is attack-able. 😉

22. Sometimes you have to tell them or make them believe strongly that you are lost and you are going to surrender yourself now, Only then you would be able to re-gain power and make yourself be more consistent. Re-gain your power and you will be able to attack again and this time you would be able to attack again and this time they will believe that only you would be able to loyal to them but actually you are having greater plans this time. 🙂

23. There is so much noise all the time around you, Most of the time this noise is major cause for you to loose focus on real things and waste HUGE amount of Energy, Time and money on such things could be great productivity killer for you, So each time you need to have focus on most important task and energy thing.

24. You must be the one who is the best if anyone asks something for advise but you are or should be only good to advice to those who are have the Designation of King.

25. Power of Re-Invention and Revolt is the most interesting power you can have for yourself, Each time society and surroundings tries to box you up into certain kind of Image and someone at some point you accept that live that kind of boaring life, All you need to do is always get out of the box and re-Invent yourself because It’s your game, your life and you must be the only one who should be controlling it!

26. Never get caught, Learn to make a good amount of balance and you would get to know that you can grow anywhere and you can move everywhere. You do the bad things but you should never be the one who actually performed such things! 😉

27. Be the one whom others feel that is the one that is desired most, Nobody takes care of your causes and things, All you need to do is make them realise that you are helping them not they are helping you to reach your goal.

28. Your Boldness is the key to make believe that whatever you are going to perform had great potential and you believe in that action. That is the only way you are going to rock each time, There is one more catch in this situation and that is if you are un-sure about something that you feel could be not that good to perform then you are good to go along with someone else who has much more idea of what we are about to do!

29. End goal is the most important you must be knowing and that END-GOal is everything, Because you need to fight and along the fight you need to know where you have to stop.

30. Be Cool! No be just Super-COOL! if they would be knowing that you are only doing stuff that is making you week the you are already vulnerable.

31. You are the one who must be controlling the main point or the centre source of Power and let others Play with small things and believe that they are the one who are actually controlling the situation.

32. Never be the one who is delivering bad News and in this whole point you must be the one who is not delivering TRUE BAD news, Learn to please people and learn to make them the one who want to listen only great news.

33. Learn to find out other’s Weakness and learn to Exploit them on that particular Weakness and moreover learn to Penetrate into other’s mind, There could be many weaknesses of someone and those could be Desperation,Fear, Loneliness, Charm, Drugs and Knowledge.

34. You are Amazing, Awesome, Att, Ghaint, Siraa and you are the one who is ruling the World, Live life king Size, You are the ALpha and you must Un-leash this thing in your life because that is what you are made to do. You are Lone wolf, Wolf on the top of the Hill is Never as Hungry as Wolf on climbing the hill.

35. Stay Calm Stay Cool, Work is Never Ending Process, Fight is Never Ending Process, Each day is War and you are not fighting to Survive now it’s your Attitude to Survive so that has very simple meaning and that simple meaning is You are cool enough. Your Hurryness is your Best Exploiting point and you can always get Exploited by someone at any level.

36. There is an art and that is: “Subtle art of Not Giving a Fuck!!” You must not give any kind of attention to your enemies and that less-attention makes them Crazy for you.

37. If you have to explain yourself your power is already in question. Your search for power depends on shortcuts. You must always circumvent people’s suspicions, their perverse desire to resist your will. Images are an extremely effective shortcut: Bypassing the head, the seat of doubt and resistance, they aim straight for the heart. Overwhelming the eyes, they create powerful associations, bringing people together and stirring their emotions. With the white light of the moon in their eyes, your targets are blinded to the deceptions you practice

38. Never Fight the Environment and all time just do your work under the hood, Never complain against the Crazy Mob, just do the stuff that you think+believe is great!

39 Make them know that they are the only one who will loose and that makes them desperate and Crazy to go against you, and the craziness will cause huge amount of imbalance for them, When they are angry and imbalanced that is your time to Rock!!

40. If it is free It is Dangerous.

41. Live away the Shadow of Great People! No matter how great you are doing or How amazing you could be, Each time you just have to remember that You need to make your own Existence. And that Existence of yours helps to create you your own things, Your Own world and your Own Treasure.

42. Do not wait for the troubles they cause to multiply, do not try to negotiate with them – they are irredeemable. Neutralize their influence by isolating or banishing them. Strike at the source of the trouble and the sheep will scatter.

43. Understanding that one alienated, disaffected soul can spark a blaze of discontent, you too must constantly win over more allies on all levels—a time will inevitably come when you will need them.

44. Do as what they do, That will make them to that you are not against there will or may be you are just doing what they are thinking to do, That will only make them crazy enough to fall for you ar make so much crazy and Entitled.

45. Turn the tables but do it slowly, At the end you know that real power is to run your own show, and to run your own show you don’t need to do things as fast as possible, So to have that possibility you need to act fine and accordingly.

46. You are not perfect and never appear the one, Too much shine cause too much attraction and that much attraction cause too much Evils of others.

47. Excess of Everything is Bad and that bad you need to identify. You need to know that when you have won and Do push things sometimes below the required limits.

48. Be Water My Friend! Be water. Flow like a water, Act like a water, Roll like a water. Stability is an illusion.

wooooo hooooo!!

images (2)

Required MySQL commands and stuff

TPOT Python Example to Build Pipeline for AAPL

This is  just first Quick and Fast Post.

TPOT Research  Paper: https://arxiv.org/pdf/1702.01780.pdf


import datetime
import numpy as np
import pandas as pd
import sklearn
from pandas_datareader import data as read_data
from tpot import TPOTClassifier
from sklearn.model_selection import train_test_split

apple_data = read_data.get_data_yahoo("AAPL")
df = pd.DataFrame(index=apple_data.index)
df['price']=apple_data.Open
df['daily_returns']=df['price'].pct_change().fillna(0.0001)
df['multiple_day_returns'] =  df['price'].pct_change(3)
df['rolling_mean'] = df['daily_returns'].rolling(window = 4,center=False).mean()

df['time_lagged'] = df['price']-df['price'].shift(-2)

df['direction'] = np.sign(df['daily_returns'])
Y = df['direction']
X=df[['price','daily_returns','multiple_day_returns','rolling_mean']].fillna(0.0001)

X_train, X_test, y_train, y_test = train_test_split(X,Y,train_size=0.75, test_size=0.25)

tpot = TPOTClassifier(generations=50, population_size=50, verbosity=2)
tpot.fit(X_train, y_train)
print(tpot.score(X_test, y_test))
tpot.export('tpot_aapl_pipeline.py')

The Python file It returned: Which is real Code one can use to Create Trading Strategy. TPOT helped to Selected Algorithms and Value of It’s features. right now we have only provided ‘price’,’daily_returns’,’multiple_day_returns’,’rolling_mean’ to predict Target. One can use multiple features and implement as per the requirement.


import numpy as np
import pandas as pd
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.model_selection import train_test_split

# NOTE: Make sure that the class is labeled 'target' in the data file
tpot_data = pd.read_csv('PATH/TO/DATA/FILE', sep='COLUMN_SEPARATOR', dtype=np.float64)
features = tpot_data.drop('target', axis=1).values
training_features, testing_features, training_target, testing_target = \
            train_test_split(features, tpot_data['target'].values, random_state=42)

# Score on the training set was:1.0
exported_pipeline = GradientBoostingClassifier(learning_rate=0.5, max_depth=7, max_features=0.7500000000000001, min_samples_leaf=11, min_samples_split=12, n_estimators=100, subsample=0.7500000000000001)

exported_pipeline.fit(training_features, training_target)
results = exported_pipeline.predict(testing_features)

%d bloggers like this: