4. Four ways to style react components

This is the fourth part of my React tutorials. See the Intro to react.js here

There are four different options to style React components. All depend on your personal preferences and the specific complexity of your application.

If you want to add just a few style properties, then inline styling is the best option.

When you want to reuse your style properties in the same file then style-component are perfect.

When your application is more complex I recommend CSS Modules or regular CSS stylesheets.

1. CSS Stylesheet

Simply import css file import './DottedBox.css' so you can have a separate css file for each component.

import React from ‘react’;
import ‘./DottedBox.css’;

const DottedBox = () => (

Get started with CSS styling


export default DottedBox;

.DottedBox {
  margin: 40px;
  border: 5px dotted pink;

.DottedBox_content {
  font-size: 15px;
  text-align: center;

2. Inline styling

In React, inline styles are not specified as a string. Instead they are specified with an object whose key is the camelCased version of the style name, and whose value is the style’s value, usually a string.

import React from 'react';

const divStyle = {
  margin: '40px',
  border: '5px solid pink'
const pStyle = {
  fontSize: '15px',
  textAlign: 'center'

const Box = () => (
  <div style={divStyle}>
    <p style={pStyle}>Get started with inline style</p>

export default Box;
  • We can create a variable that stores style properties and then pass it to the element like style={nameOfvariable}
  • We can also pass the styling directly style={{color: 'pink'}}

3. CSS Modules

A CSS Module is a CSS file in which all class names and animation names are scoped locally by default. Great article about css modules here.

import React from 'react';
import styles from './DashedBox.css';

const DashedBox = () => (
  <div className={styles.container}>
    <p className={styles.content}>Get started with CSS Modules style</p>

export default DashedBox;
  • Similar to css we import css file import styles './DashedBox.css'
  • then we access to className as we access to object
 :local(.container) {
   margin: 40px;
   border: 5px dashed pink;
 :local(.content) {
   font-size: 15px;
   text-align: center;

:local(.className)-this when you use create-react-app because of webpack configurations

.className-this if you use your own react boilerplate.

To make CSS modules work with Webpack you only have to include the modules mentioned above and add the following loader to your webpack.config.js file:

 . . .
test: /\.css$/,
loader: 'style!css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]'
. . .

4. Styled-components 💅

Styled-components is a library for React and React Native that allows you to use component-level styles in your application that are written with a mixture of JavaScript and CSS

import React from 'react';
import styled from 'styled-components';

const Div = styled.div`
  margin: 40px;
  border: 5px outset pink;
  &:hover {
   background-color: yellow;

const Paragraph = styled.p`
  font-size: 15px;
  text-align: center;

const OutsetBox = () => (
    <Paragraph>Get started with styled-components 💅</Paragraph>

export default OutsetBox;
  • First we need to install styled-components library
  • npm install styled-components --save
  • Now we can create a variable by selecting a particular html element where we store our style keys const Div = styled.htmlElemnet`color: pink`
  • Then we use the name of our variable as a wrapper <Div></Div> kind of react component:)
  • Tips to use emoji icons key shortcut CTRL+CMD+SPACE 💡

All these ways of styling react components have pros and cons.

It all boils down to both your own personal preferences and the specific complexity of your application.

I suggest you to make 4 projects, each using different way of style.

Enjoy 😃

McD’s betting on voice tech to change the way people order food! Are you?

Today, technology has become an important part of the business. For long term business success, implementing new technology is the key to lead in the competitive market. McDonald’s acquires Apprente (a startup building conversational voice agents) to bring voice technology to the drive-thru to reinvent fast food experience. 

What is Apprente voice technology to Drive-thru.

Apprente company  is specialized in building voice-based agents. It will help McDonald’s in taking orders in multiple languages and accents. McDonald’s has been testing Apperent’s technology in several locations and expects it will allow for “faster, simpler and more accurate order taking” at its drive-thru.

Why Voice technology is Adopted: 

According to MacDonald’s it will not only low wait times but also allow restaurants to operate with a smaller staff. It can be used in mobile and kiosk ordering.

Voice technology will be used in creating a drive-thru to suggest the food tailored by things like the weather, current restaurant traffic and trending menu items. Once customers have started ordering, the display can also recommend additional items based on what they’ve already chosen.

The Golden Arches said McD has tested Apprente’s technology at selected restaurants. It works as follows: you drive up to the menu board, speak to a voice-powered machine (just like ordering stuff from Amazon’s Alexa) to place an order, and drive up to the window to pick up the order.

Gone are the days of having to repeat your order five times into the drive-thru, which ultimately slows down the drive-thru lane. So, that’s a positive from a customer service and productivity standpoint.

Why your business should use voice technology:

To simplify customer experience:

  • To simplify customer experience:

“I think the main thing is providing the customer with the opportunity to use their natural language to get what they want,” Leary says.

Voice technology is faster than other types and an enhanced client experience makes for more sales. The voice technology does away with the typing, clicking and swiping through other types of customer service platforms.

Following companies integrated the voice technologies to simplify customer experience:

    1. At the CES 2018 in Las Vegas, Sony, TiVo and Hisense unveiled smart home skills that integrated Alexa, enabling customers to control the TV by voice.
    2. “Hawaii Pacific Health, a not for a profit healthcare system with four major hospitals and 70 clinics statewide, focuses on providing the highest quality healthcare. As part of that effort, Hawaii Pacific Health improves its patients’ in-room experience by eliminating outdated nurse-call buttons and replacing them with natural conversations with Alexa. Patients use their voice to direct and control their in-room amenities, entertainment choices and answers to many of their questions.
    3. Domino’S has announced it has partnered with google that allows customers to place and track the order via the google assistance. Customers with google assistant powered product ( Google, Home, Pixel phone, etc) can order their favourite order and their last order via voice activation.

Work Processes become more efficient:  

Following companies integrated voice assistants like Alexa and Google Home to improve their employee efficiency:

  1. Stonehenge company expert in investment management integrated with Alexa for business with salesforce by using AWS IoT to connect things within apartments, it helps them in creating an enjoyable and delightful experience and provide peace of mind to their tenants and employees in completely new ways.
  2. A Propel Insurance, US’s largest privately held insurance company integrated Amazon Alexa to ease the daily routine tasks of their employees like starting a meeting or joining the conference call. They integrated the voice assistant like Alexa, to make all the conference rooms voice-enabled. Employees loved the simplicity of the solution and how it makes their workday more productive.

Voice recognition software allows a business to put employees to better use: Software can handle answering incoming calls and routing calls. It can enable a company to reduce staff and cut training costs. Many tedious job duties related to phone operations can be streamlined and simplified.

Valence: They built a private skill using Alexa for Business, called Valence Bot that can answer employee questions and handle requests related to the company. It is widely used by employees and they get a lot of positive feedback about what a unique benefit.

The industries can get the benefits of voice technology:

1.Banking and finance:

Customers of banking sectors can take advantage of voice technology by performing various functions such as checking account balance, obtaining transaction and even making payments.

It can increase the level of security in banking as voice is biometric recognition to authentic genuine.

2. E-commerce:

Voice technology can be used in ecommerce business as it will simplify the process of online shopping. By speaking products name or related keyword customers can search the products, add the product in cart, and complete the whole online process.

3. Education:

Integrating voice technology in the classroom can enhance learning and engagement. Teachers can effectively create online lessons and teach through video and students get access to these lessons quickly and effectively. At a time more students can learn by effectively implementation of voice technology.

4. Transportation:

In the transportation industry  voice technology can be used in various forms like companies can integrate voice-platforms that ease the booking process, and informing the customers related to the next available option, transport routes, timings, and more.

HR and Marketing:

In the HR, Voice technology replaces all of the manual labor with simply asking a device to tell you about your upcoming work schedule. Similarly, marketing professionals can rely on voice assistants for easing up tasks such as the creation of reports and scheduling of social media posts.

Voice technology gives companies to take competitive advantage in terms of customer experience and employee productivity. The best way to do so is to  connect with expert partner who can create high quality voice recognition software for your business. Our team of expert business analyst and developer can help you achieve in increasing growth and efficiency using voice technologies. Connect with us to discuss how you can integrate voice technology in your current business.

How To Start a Blog – Beginner’s Guide for 2019

how to start a blog

So, you want to start a blog huh? Great idea!

But…how the heck do you get started? There’s so much info out there on the web, and everyone’s telling you to do different things. Who do you listen to? Where’s the starting point?

Damnit, maybe you should just forget it – it’s too confusing!

Well, hold up. I used to be a blogging newbie too. I had the same problems. I started my blog (BloggingBasics101.com) way back in 2006, and I knew less than nothing about blogging. In fact, it was only the week before I’d learned what a blog was.

Now I know a ton about them, and my blog’s doing pretty well – I receive more than 300,000unique visitors per month which makes me consider myself someone you could listen to and learn from when it comes to building your own blog. I’m not some sort of Guru, but I certainly do know the basics.

I promise it’ll be simple, relatively easy, and definitely easy to understand (no stupid jargon). Sound good?

Awesome, let’s move on.

Why you should create a blog and join the blogging community

So below, I’m going to outline exactly what you need to do to get started and set up your own personal blog. Before we dive in though, I really want to talk about WHY you should build a blog.

Note: If you already have a solid idea of the whys, then skip this and go right ahead with the guide.

  1. Blogging has quickly become one of the most popular ways of communicating and spreading information and news. There are literally millions of blogs online (don’t worry, you can make yours stand out and get noticed!).
  2. It’s a great way to express yourself and also a fantastic way to share information with others.
  3. You become a better person and a better writer.
  4. The best reason? You can make money doing it!

I bet you already knew all of that, but it’s nice to be reminded.

One very last thing before we get started:

Creating your own blog can take a little while, probably up to 30 minutes. So grab yourself a coffee or juice (whatever you fancy) and let’s get stuck in. If you need any help during the set-up process, get in touch with me here and I’ll help as best I can and answer any questions you might have).

Disclosure: This guide to starting your own blog contains some affiliate links. If you purchase any service through one of these links I may earn a small commission, this is at no extra cost to you.

The Steps Covered In This Blogging Guide

It’s nowhere near as difficult as setting up a website from scratch (there’s very little technical ability needed here). In fact, there’s no coding required by you. Good news, huh?

How to Start a Blog in 5 Steps:

There are five main steps you need to do in order to start a blog. If you follow this guide exactly, you’ll have your own blog set up in 30 minutes or less.

  1. Choose a great blog platform
  2. Choose a web host for your blog
  3. How to Set up a blog on your own domain
  4. Design your new blog
  5. Useful resources for blogging

So, we made it. Phew. Better late than never! So, without further ado, let’s jump into step 1.

Step 1 – Choose your preferred blogging platform

Choosing where you want to build blog is pretty much the first thing you have to do. I’m going to take a leap and assume you’ve heard of WordPress, and this is the platform I advocate. It’s massive.

It’s by far one of the biggest blogging platforms in the world, with countless plugins and add-ons and almost infinite ways to design and layout your blog.

There are more than 82 million active users of WordPress = a lot, basically.


There are other alternatives, however, and they are listed below:

  • Blogger – Definitely the next best thing to WordPress.
  • Tumblr – Half social network, half blog. Interesting, and very simple to use.

Even though WordPress is bigger (and probably better) than those two, here are my reasons why you should still go with WordPress:

  1. Super easy set-up and is free to use
  2. Tons of free themes and layouts (I’m not kidding, there are gazillions).
  3. There’s a massive support forum in case you get stuck (you won’t, but it’s nice to have it there if you need it).
  4. Your blog will be insanely fast and it’ll also look Functionality and form – perfect!
  5. People can interact with you easily. Your content can be shared, commented on, and so on.

Here’s an article about different blogging platforms (including WordPress), give it a read:

How to Choose a Blogging Platform – (updated for 2019)

Now, Step 2 (see, we’re moving fast now!)

Step 2 – Self-hosting or a free alternative?

Whoa, slow down there! This is the biggest decision you’ll have to make before we go any further. You need to decide whether to pay for your blog or grab a free one.

WordPress, Tumblr, and Blogger all offer free blogs for anyone. Awesome, right? It’s perfect for those of us who aren’t super serious about blogging. But it does have downsides:

1) You won’t be able to get your OWN domain name

On a free blog, your blog’s web address (your URL) will be butt-ugly. Like, really ugly. In short, create a free blog with any other the above free blog services and it’ll look like this:

  • yourblog.wordpress.com
  • yourblog.blogspot.com
  • yourblog.tumblr.com

I know, ugly right?

2) Limits and more limits

There are some limits to free blogs. You can’t fully monetize it, and you don’t have the possibility to upload all those videos and images you want to show everyone – it’s all limited. Worse still, you won’t even have access to the free themes offered by WordPress.

3) You DON’T OWN your blog

It might sound silly at first, but you don’t actually own your blog. It’s hosted on someone else’s web property and they can delete it if they want to. They have done so in the past, and keep doing it in the future. Which means all your hard work on your blog, all those countless hours of writing blog posts might have vanished within seconds. Sad…

On the other hand, with a self-hosted blog on your own domain name – you are the REAL owner of your blog. You’ll be able to name your blog whatever you want, for example, “YourName.com” or “YourAwesomeBlog.com. You can end it with .com, .co.uk, .net, .org, or virtually any other web suffix. Add to that unlimited bandwidth for videos, images, and content plus the free themes and you have a winning combo.

So how much is hosting and a domain name? Not as much as you’re thinking, fortunately. It usually works out to about $5 to $10 per month, depending on your hosting provider which is less than a couple of coffees.

If you still have questions, here’s some further information for you to look at:

Step 3 – Start a blog on your own domain (if you chose self-hosting and a custom domain)

wordpress blogging platform

I’m going to push ahead based on the premise you’ve chosen WordPress, and if you haven’t, you should. Seriously, it’s the best.

If you’re still a little confused by what a self-hosted blog is, allow me to explain and how you can go about setting one up for yourself.

You’ll need to come up with a domain name you like and also choose a hosting company that can host your blog.

  • Domain: The domain is basically the URL of your website. Examples: google.com (Google.com is the domain), Facebook.com (Facebook.com is the domain). See? Simple!
  • Hosting: Hosting is basically the company that puts your website up on the internet so everyone else can see it. Everything will be saved on there. Think of it as a computer hard-drive on the internet where your blog will be saved.

Disclosure: I recommend using Hostgator for web hosting. If you click through one of my links and make a purchase, I will receive a commission, which helps me keep bloggingbasics101.com up and running.

Personally, I use Hostgator (for my blog domain and hosting), and I’ve got nothing but good things to say about it.

It’s probably one of the cheapest (less than $3 per month) hosting providers out there. A domain name will cost around $10-15 a year, but with Hostgator, you can get that for FREE first year.

If you do sign up with Hostgator be sure to use the coupon code BB101 as this will unlock the maximum discount they offer on all their hosting packages.

:). Big smiles for that!

They’re the providers I use for all of my blogs, including the one you’re reading right now.

If for any reason you don’t want to go with Hostgator, feel free to choose your own hosting company. Most, if not all of them, should have a “one-click” WordPress install solution on their admin panel.

That button will automatically install WordPress on your blog. Did I say it was simple or what?

All you need to do is sign up with Hostgator (or your chosen provider), choose your hosting plan and a domain name and look for the one-click WordPress install button on the admin panel.

If you are getting stuck at any point this guide may help as it has screenshots.

WordPress essentials aren’t often needed, but I’d recommend whois privacy (that will keep all your personal details private) and definitely automated backups (that’ll save your website just in case anything fails or disappears so you won’t lose any or very little of your blog).

Start a Blog with Hostgator today and get an exclusive 60% discount with coupon BB101

Once WordPress is installed on your website, all you have to do to start blogging is go to your WP-Admin page usually www.yourblognamehere.com/wp-admin and start writing by adding a new post.

At the start, the layout looks confusing, but it gets very understandable quickly. Don’t worry!

Step 4 – Designing your WordPress blog

Now, the fun bit.

Let’s make your blog look exactly how you want it to. To choose a new theme, you can either head to Appearance > Themes and install a free WordPress theme or you can head to a premium theme website like ThemeForest.net and buy a theme for around $40.

I usually choose something that looks professional and pretty easy to customize. WordPress also has this awesome feature that allows you to change themes with just a few clicks. So if you start getting tired of your current blog template, you can just switch to another one without losing any precious content or images.


Remember, your blog’s design should reflect both you and your personality, but also what the blog is about. There’s no point having a football-orientated theme if your blog is about tennis, understand?

On top of that, it should be easy to navigate if you want people to stick around. If it’s tricky and difficult to move around it, people won’t stay. After all design is a subjective art; meaning everyone likes different things.

But no one likes ugly websites, and they especially hate websites that need a university degree to navigate. Make it easy for them.

For more reading, I’ve put together 3 blog posts about designing your blog. Feel free to check them through.

Last step! Woo!

Step 5 – Useful Resources For Beginner Bloggers

Bloggers come to blogging arena with varying degrees of online and social media experience, but we’ve all made more than a few newbie mistakes – there’s always room for more learning and improvement, whether you’re a beginner or you’ve been blogging for years.

These articles may help you avoid some of the growing pains when it comes to your first blog – enjoy!:

And that’s it! I’m more than confident that your initial blog set up should now be finished and ready to go, and all that should have been really damn easy (unlike my first time, lucky you!). If you are having any problems installing WordPress on Hostgator then this guide may help.

If by some unfortunate circumstance you get stuck or have any questions for me about how to create a blog, just get in touch with me or leave a comment below. I’ll help you out with any problems.

Enjoy your new blog!



Second One is Coming

Don ….

Copenhagen-based banking app Lunar Way has raised a €26 million round led by SEED Capital, while obtaining a European banking license from the Danish Financial Supervisory Authority.

Founded in 2015, the banking app, which focuses exclusively on the Nordics, raised €13 million and expanded to Norway back in February. With the additional funding and the new banking license at hand, Lunar Way plans to accelerate the development of its Nordic bank, develop new products, and grow in the Danish, Swedish, and Norwegian markets.

The app already offers several features such as budgeting, spending notifications, transfers, bill payment, and card freezing. The new banking license will open up even more possibilities, for instance loans, insurance, and multi-currency cards.

“The funding and banking license is the preliminary culmination of years of hard work and dedication from the entire Lunar Way team,” said Lunar Way founder and CEO Ken Villum Klausen. “We have grown from a small startup to a fintech with close to 100 employees from Denmark, Sweden and Norway with users in all of Scandinavia – a market notoriously hard to penetrate. All the while challenging the status quo of banking in the Nordics and meeting the regulatory demands of becoming a bank. We’re the very first of our kind in the Nordics to get a banking license. We’ve done all this in four years. That in itself is an accomplishment. But our journey is only just starting now.”

The Nordic market consists of only 27 million people but is the home of the most stable economies in the world, with some of the wealthiest and tech-savvy populations on the planet. Though the market is known for being hard to crack for new banking entrants due to the Nordic clearing systems, as well as demanding regulations for safety and payment infrastructures that vary greatly from country to country, Lunar Way has chosen to focus its efforts solely on the Nordics since day one.

“Unlike other fintechs that have chosen to expand vertically, Lunar Way’s approach is to go deep in the Nordics, building not just a supplement for users to have when travelling or as an add-on to their other banking solutions, but as a 100% digital, innovative and true alternative to traditional banks,” said Villum Klausen. “We mean it when we say that the goal is to change the status quo of banking and to be the #1 banking app of the Nordics.” 

Where 90% is digitally native and already has a mobile banking solution, the first challenge in the Nordics is to offer a product that is innovative and easy to manage. The next challenge is to launch a bank, unlike anything the users know.

“The future belongs to those who offer the best user experience, and it’s our ambition to be the leading financial marketplace in the Nordics,” added Villum Klausen. “We already offer the users control of their entire personal finances, spending overview, savings, interactive budgets and up to 4% interest. The plan going forward is to collaborate with those who offer the best financial solutions out there and tie the whole thing together in the Lunar Way app.

“From here the user can access, view and handle all their personal finance needs. We’ve already taken the first steps in Denmark and offers insurance, loans, multi-currency cards and so on with several different partners. Soon we’ll provide investments with Saxo Bank. The bank license will help us create similar marketplaces for our Swedish and Norwegian users faster. It will also enable us to build our own financial products.”


Examples of Blogs – Inspiration for New Bloggers

If you’re thinking of starting your very own blog, but just don’t have a clue on what to blog about, then fear not!

In this article, I have included a whole load of blog examples from a wide variety of different niches.

Since the beginning of the internet, millions and millions and millions of blogs have been created. Many have died due to lost interest or their owners giving up on the idea, while others have thrived and continue to grow, making money and earning their owners a steady income. It’s a constant evolution of content that keeps people coming back for more, especially if these blogs contact highly resourceful material that people find useful and interesting.

Each example listed in this blog post are all different in some way and all bring something unique to their readers & subscribers. I want to show you what is possible and how you can take inspiration from them and create an awesome blog of your own.

Some of these blogs make over $100k a month, others are just a hobby for their owners, but all have the same purpose at their core… the love of writing and sharing information.

Remember that it doesn’t cost the earth to start your own blog. You can be up and running for as little as $1.45 per month with Hostinger.

Bluehost offer web hosting, Free SSL, Email, web builder and a FREE DOMAIN for as little as $2.95 a month.

First Post


If you are someone who contributes to the nearly 50% of the world’s organizations who use Office 365, you want to read this!

Because of the continued increase in the number of companies in the world using Microsoft software, cybercriminals are increasingly shifting their focus to using Microsoft’s identity in their phishing scams. Microsoft has become the leading choice of identity when it comes to deceptive phishing scams.

The IT Company is not choosing to share this information with you to scare you or turn you away from Microsoft. We believe Microsoft speaks for itself with its efficiency and capabilities, and there is a strong reason for why it has taken over a good majority of the world’s businesses. We intend not to scare you away from Microsoft, but rather bring you awareness of this topic so your business can continue to use Microsoft, while protecting you and your business.

In Agari’s (reliable security firm) Q1 2019 Email Fraud & Identity, they find evidence supporting that 8 out of 10 email scams with the target of high-value executives, contained the presence of Microsoft’s false identity. Agari’s evidence also found that an overall 44% of all identity deception phishing scams used Microsoft as their identity.

The IT Company has referenced KnowBe4 in several of our technology topics. Last week they reportedon this topic as well, summarizing the Agari Report regarding the tactics behind brand deception scams as followed:

  • 50% portray a brand using email display names.
  • 13% portray an individual using email display names
  • 17% use lookalike domains
  • 20% leverage compromised accounts

If you are a Microsoft user, the chances are you will be presented one of these deceiving scams. Before your company falls victim to these scams, take the time to educate your people. And while Microsoft users are at much higher risk and there is a high focus on them currently because of the increase of cybercriminals really targeting Microsoft’s identity, they are not the only ones. Any user can be deceived through these identity deception phishing scams. Other common brands being used for deception include the IRS, Amazon, and AT&T.

So what can you do? IT Companies, including ourselves, are constantly promoting the need of Security Awareness Training. We can’t say it enough; train, train, and train again all of your employees. The more aware they are of what to be skeptical of, the better off your company will be.

Security Awareness is something that should be at the center of your company.

Hello world!

Welcome to WordPress. This is your first post. Edit or delete it, then start writing!

  • Name
  • back
  • Same
  • Home
  • Work

Nothing Is Everyting.

I’m an expert on how technology hijacks our psychological vulnerabilities. That’s why I spent the last three years as a Design Ethicist at Google caring about how to design things in a way that defends a billion people’s minds from getting hijacked. c When using technology, we often focus optimistically on all the things it does for us. But I want to show you where it might do the opposite.

name is shown here

 And this is exactly what product designers do to your mind. They play your psychological vulnerabilities (consciously and unconsciously) against you in the race to grab your attention.
I want to show you how they do it.

from numpy import exp, array, random, dot

class NeuralNetwork():
    def __init__(self):
        # Seed the random number generator, so it generates the same numbers
        # every time the program runs.

        # We model a single neuron, with 3 input connections and 1 output connection.
        # We assign random weights to a 3 x 1 matrix, with values in the range -1 to 1
        # and mean 0.
        self.synaptic_weights = 2 * random.random((3, 1)) - 1

    # The Sigmoid function, which describes an S shaped curve.
    # We pass the weighted sum of the inputs through this function to
    # normalise them between 0 and 1.
    def __sigmoid(self, x):
        return 1 / (1 + exp(-x))

    # The derivative of the Sigmoid function.
    # This is the gradient of the Sigmoid curve.
    # It indicates how confident we are about the existing weight.
    def __sigmoid_derivative(self, x):
        return x * (1 - x)

    # We train the neural network through a process of trial and error.
    # Adjusting the synaptic weights each time.
    def train(self, training_set_inputs, training_set_outputs, number_of_training_iterations):
        for iteration in xrange(number_of_training_iterations):
            # Pass the training set through our neural network (a single neuron).
            output = self.think(training_set_inputs)

            # Calculate the error (The difference between the desired output
            # and the predicted output).
            error = training_set_outputs - output

            # Multiply the error by the input and again by the gradient of the Sigmoid curve.
            # This means less confident weights are adjusted more.
            # This means inputs, which are zero, do not cause changes to the weights.
            adjustment = dot(training_set_inputs.T, error * self.__sigmoid_derivative(output))

            # Adjust the weights.
            self.synaptic_weights += adjustment

    # The neural network thinks.
    def think(self, inputs):
        # Pass inputs through our neural network (our single neuron).
        return self.__sigmoid(dot(inputs, self.synaptic_weights))

if __name__ == "__main__":

    #Intialise a single neuron neural network.
    neural_network = NeuralNetwork()

    print "Random starting synaptic weights: "
    print neural_network.synaptic_weights

    # The training set. We have 4 examples, each consisting of 3 input values
    # and 1 output value.
    training_set_inputs = array([[0, 0, 1], [1, 1, 1], [1, 0, 1], [0, 1, 1]])
    training_set_outputs = array([[0, 1, 1, 0]]).T

    # Train the neural network using a training set.
    # Do it 10,000 times and make small adjustments each time.
    neural_network.train(training_set_inputs, training_set_outputs, 10000)

    print "New synaptic weights after training: "
    print neural_network.synaptic_weights

    # Test the neural network with a new situation.
    print "Considering new situation [1, 0, 0] -> ?: "
    print neural_network.think(array([1, 0, 0]))
view rawmain.py hosted with ❤ by GitHub

Western Culture is built around ideals of individual choice and freedom. Millions of us fiercely defend our right to make “free” choices, while we ignore how those choices are manipulated upstream by menus we didn’t choose in the first place.

This is exactly what magicians do. They give people the illusion of free choice while architecting the menu so that they win, no matter what you choose. I can’t emphasize enough how deep this insight is.

When people are given a menu of choices, they rarely ask:

  • “what’s not on the menu?”
  • “why am I being given these options and not others?”
  • “do I know the menu provider’s goals?”
  • “is this menu empowering for my original need, or are the choices actually a distraction?” (e.g. an overwhelmingly array of toothpastes)

The code Element

Programming code example:

x = 5; y = 6; z = x + y;
 For example, imagine you’re out with friends on a Tuesday night and want to keep the conversation going. You open Yelp to find nearby recommendations and see a list of bars. The group turns into a huddle of faces staring down at their phones comparing bars. They scrutinize the photos of each, comparing cocktail drinks. Is this menu still relevant to the original desire of the group? 

It’s not that bars aren’t a good choice

, it’s that Yelp substituted the group’s original question (“where can we go to keep talking?”) with a different question (“what’s a bar with good photos of cocktails?”) all by shaping the menu.

Moreover, cdsc

April 2020
« Nov    

At the beginning of his life, few would have predicted that Theodore Roosevelt even had a choice in the matter. He was sickly and fragile, doted on by worried parents. Then, a conversation with his father sent him driven, almost maniacally in the other direction. I will make my body,” he said, when told that he would not go far in this world with a brilliant mind in a frail body. What followed was a montage of boxing, hiking, horseback riding, hunting, fishing, swimming, boldly charging enemy fire, and then a grueling work pace as one of the most prolific and admired presidents in American history.

Again, this epigram was prophetic for Roosevelt, because at only 54 years old, his body began to wear out. An assassination attemptleft a bullet lodged in his body and it hastened his rheumatoid arthritis. On his famous “River of Doubt” expedition he developed a tropical fever and the toxins from an infection in his leg left him nearly dead. Back in America he contracted a severe throat infection and was later diagnosed with inflammatory rheumatism, which temporarily confined him to a wheelchair (saying famously, “All right! I can work that way too!”) and then he died at age 60. But there is not a person on the planet who would say that he had not made a fair trade, that he had not worn his life well and not lived a full one in those 60 years.