Thursday, April 28

Syllogism

Rule 1 : All + All = All

Problem I
Statement 1 : All boys are intelligent
Statement 2 : All intelligent are girls

Therefor the conclusion derived will be
All boys are girls
From statement 1 : Some intelligent are boys
From statement 2 : Some girls are intelligent

Problem II
Statement 1: All books are pens
Statement 2 : All pens are pencils

I : All books are pencils
II : All pencils are books

From Rule 1 we can derive that All books are pencils
Hence, only conclusion I is true.

Rule 2 : All + No => No
When predicate of 1st statement is equal to Subject of 2nd statement

Problem 1
Statement 1 : All tigers are horses
Subject is "Tiger" and Predicate is "Horse"

Statement 2 : No horse is dog
Subject is "Horse" and Predicate is "Dog"

Since Predicate of 1st statement is same as subject of 2nd Statement, we can apply the rule.

I : No Tiger is Dog
II : Some tigers are dog

Therefore, as per Rule 2, the conclusion would be
No Tiger is Dog

Hence, only conclusion I is correct. Conclusion II cannot be correct.

 Problem II
Statement 1: All students are scouts.
Statement 2 : No Scout is Lady.

I : No Student is lady
II :  Some scouts are students

Therefore the conclusion after applying Rule 2 is
No Student is lady

From statement 1 : All Students are scouts, we can conclude that Some scouts are Students.

Therefore, we can conclude that both the given conclusions are true.

Rule 3 : All + Some => No Conclusion

Problem I
Statement 1 : All pens are pencils
Statement 2 : Some pencils are papers

I : Some papers are pens
II : Some pens are not papers

From Rule 3 : We can concur that there is No Conclusion. Note that for Rule to be used, Predicate of Statement 1 should be same as Subject of Statement 2.


Problem II
Statement 1 : All bats are balls
Statement 2 : Some balls are nets

I : Some bats are nets
II : All nets are bats

Applying Rule 3, There is No Conclusion

Rule 4 : Some + All => Some
In this scenario, there will be 2 conclusions.

Problem I
Statement 1 : Some parrots are Doves
Statement 2 : All Doves are Peacocks

I : All peacocks are doves
II : Some peacocks are parrots

Applying Rule 4, we get two statements
Some Parrots are Peacocks
Some Peacocks are Parrots

From 2nd statement "All Doves are Peacocks" we can derive that "Some Peacocks are Doves"

There the 2nd conclusion alone is true.

Problem II
Statement 1 : Some books are pens
Statement 2 : All pens are papers

I : Some books are papers
II : Some papers are books

Applying Rule 4 i.e Some + All => Some, we get
Some books are papers
Some Papers are books

Therefore both the Conclusion are true.

Rule 5 : Some + No => Some Not 

Problem I
Statement 1 : Some Books are Toys
Statement 2 : No Toy is Red

I : Some books are red
II : Some books are not red

From Rule 5 : Some books are not red.
From statement 1 : Some Toys are Books
From Statement 2 : No Red is Toy.


Problem II
Statement 1 : Some trains are trees
Statement 2 : No Tree is a Picture

I : Some trains are picture
II : No train is a picture

From Rule 5 : Some Train is not Picture
From Statement 1 : Some trees are Trains
From Statement 2 : No Picture is Tree

From above derivation, we can say that no conclusion is true.

Rule 6 : Some + Some => No Conclusion

Problem I
Statement 1 : Some stones are cups
Statement 2 : Some cups are black

I : Some blacks are not cups
II : Some cups are Stones

As per Rule 6 -> There is no Conclusion

Problem II
Statement 1 : Some dogs are rats
Statement 2 : Some rats are horses

I : Some horses are dogs
II : No horse is a rat

As per Rule 6 -> No Conclusion.


Rule 7 : No + No => No Conclusion

Rule 8 : No + All/Some => Some Not Reversed

Problem I
Statement 1 : No File is an Elephant
Statement 2 : All elephants are Caps

I : Some Caps are elephants
II : Some Caps are not Files

As per Rule 8 :
Some Caps are not Files
From Statement 2 we can derive -> Some caps are elephants

Therefore, both the conclusion are correct

Problem II
Statement 1 : No Goat is Door
Statement 2 : All doors are chairs

I : Some chairs are doors
II : Some chairs are goats
III : Some chairs are not goats
IV : Some doors are goats

As per Rule 8:
Some chairs are not Goats

From Statement 2
Some Chairs are Doors
Also -> Some Doors are Chairs (From above derivation)

From statement 1
No Door is Goat

Therefore I and III are true



Problem with 3 statements

Statement 1 : Some newspapers are radios
Statement 2 : Some radios are Television
Statement 3 : No television is magazine

I : No newspaper is magazine
II : No Radio is magazine
III: Some radios are not magazines
IV : Some newspapers are televisions


Statement 1 : Some newspapers are radios
We can derive -> Some Radios are Newspapers

Statement 2 : Some radios are Television
We can derivie -> Some Television are Radios

Statement 3 : No television is magazine
We can derive -> No Magazine is Television

From Statement 1 and Statement 2, we cannot derive any conclusion
From statement 2 and statement 3 : We can get -> Some Radios are not magazine

Therefore only III is true.

Problem with 3 statements

Statement 1 : All fowls are kites
Statement 2: No kite is insect
Statement 3 : No fowl is kite

I : No Fowl is insect
II: No Insect is Fowl
III : Some Kites are Fowls
IV : No Kite is Fowl

Statement 1 : All fowls are kites
=> Some kites are Fowls
     => Some Fowls are Kites

Statement 2: No kite is insect
=> No Insect is Kite

Statement 3 : No fowl is kite
=> No Kite is Fowl

From Statement 1 and Statement 2
No Fowls are Insects
=> No Insects are Fowls

Therefore from all the derived statements, we can get the result that all the conclusions are True.


Friday, February 19

Notes : Brings Up Strong Reasons to Use React.js



- Search wise, in Google trends, React is most widely searched

- Angular is going a major re-write and looks more similar to React. So Angular 2.0 will have lots of API's broken for Angular 1.0, does it mean it is back to square one for Angular 1.0 users?

- Pick up a framework when you know you are building a Web application. Don't use it for making static websites.

- jQuery is still valid, so for web developers can it can be used very productively.

- Unlike Google, facebook is using React on their critical projects.

Wednesday, February 17

Notes : Introduction and Getting Started with React.js - JSConf 2015



1) Install Node.js

2) http://codewinds.com/jsconf-react-win

What makes react.js special?
- Simple to learn - Mostly it is the View.
- Composable components
- Declarative - Rather then doing jQuery manipulation, it is easily done via React.
- Easy to use with existing projects

React.js core concepts
- Just the view
- Virtual DOM - Keeps track of what is changed in DOM and updates it accordingly
- Components
- Top down data flow

You can use ES6

Just the view
class Greeting extends React.Component {
  render(){ // the heart of React.js
    // pass in any type of js objects, methods, or functions.
    return <div>{ this.props.user.name }</div>;
  }
}

Virtual DOM
- Render Virtual tree
- Fast Diff
- Adapters to DOM, ...

Components
Everything is components. You can have your code in different file, you can just import it and use it.



<Name value={this.props.name} /> => JSX code. It is a components.
props is built in react properties set up for you.

Top Down data flow

// from main.js
<App name={appName} items={items} />

// elsewhwere in App's render()
return (<div>
          <MainTitle title={this.props.name) />
          <div/>);


React.js API - JSX


Render, prop



React.js - State, events

when rendering, you can use this.state and this.props



React.js family

- react-router
- Flux
-React Native





Sunday, February 7

Notes : CSSconf EU 2014 | Addy Osmani: CSS Performance Tooling

When you want to be fast, you have to give up the things slowing you down.



3 Tiers of Optimization Tooling

1. Baseline
Minification, concatenation, Image optimization, Compression (Gzip, Zopfil), Asnyc scripts, Leverage caching, WOFF2 for fonts, Spriting. Avoid redirects

2. Get fast, Stay fast.
Inlining critical css, deferring non-critical assets to avoid render blocking, removing unused CSS, visual regression testing to verify changes. Performance bench-marking.

3. Nice to haves
Reduce duplicate colors, selectors, font-families, sizes.

Try to ship something in the range of 0 - 1000ms time. Sites that are slow to load loose visitors.

Step 1 : Measurement
Speed Index - The average time at which visible parts of the page are displayed. Expressed in milliseconds and dependent on size of the viewport.

Lower speed index score is better.

Step 2 : Performance Budget
It is basically you saying that I have this minimum expectations. For example, trying to get 1 sec page load.
Max 200ms server response.

Use webpagetest webapp..

Google's pagespeed app is also very useful. Ideally you should have a pagespeed of 85 on mobile and 90 on desktop.

The average page size is 1.8MB. Most of the size is due to images.

Use gulp image minification tools, css minification tools etc.
Optimizing HTML, CSS, Javascript etc.

What else advanced techniques that we can do to improve performance.?

1) Removing unused CSS.
Google devtools has an option which tells you how much unused CSS you have.

UNCSS - Powerful tool.



CSS Regression testing
Use phantomcss and regression.js

2) Optimize critical path CSS
Optimize critical rendering path. Just render visible content.
To do that, we can do inline css instead for it to fetch for the CSS file.
This is not just a scripting problem and it cannot be solved alone with javascript. This problem is a Multi part problem and needs to be automated. What do we really need to do?



a) Extract stylesheets from HTML - Choice of extraction of defining *.css files upfront

b) Generate the above the fold CSS - Decide on target viewports. Multiple? One sweet spot? Keep it small and lightweight under 14kb

c) Inline critical-path CSS in

d) Asynchronously load the rest of your styles - Remove them from the critical path.

3) Optimizing Images
Tools available and can be used
ImageOptim, GIFBrewery, Packed Image Diffs

Is it important for you to show animation on screen? Will just a jpeg not work? Important question when developing a website.

4) Use of mod_pagespeed enabled on your server.

===================================================================

Automate Performance measurement
1) WebPageTest CLI
2) Grunt-PerfBudget
3) PageSpeed Insights CLI
4) Grunt-PageSpeed
5) Phantomas CLI

Stylesheet complexity Analysis
Easiest way to keep CSS minimal is to minimize the repeatations.
Some tools like
1) Parker
2) Grunt-ColorGaurd
3) Stylestats



Thursday, February 4

Notes : 15 Lessons From 15 Years In UX - JESSE JAMES GARRETT


Jesse James Garrett — 15 Lessons From 15 Years In UX (SmashingConf NYC 2014) from Smashing Magazine on Vimeo.

1. Go Broad
Work on different kinds of problems.

2. Go Deep
Work for the quality, focus on one problem at a time.
Research the founder of a company, to understand their thinking properly.

3. Go for a Walk
Shifting your sensory inputs in any direction. There is a science behind this, if people change their working environment, it gives them capability to think in different ways.

4. Go farther than you think you should
If is easy to fall in trap on limitations. Limitations are your own creations. It is dangerous for you to cut off your thought due to external limitations.

Your own ideas should scare you. There is risk of failure and certainly you may look stupid, however you should rely on your own guts to go forward and work on that idea. Try to rely on people around you and get inspiration.

Designers are creative people and they need to get out of their comfort zone.

5. Put away your notes
Believe in your instincts.

6. Learn to spot your assumptions

7. Stay Curious
Pursue opportunities to evolve

8. Be as curious about your clients as you are about your users
Your clients should be able to relate to your choices and decisions.

9. Hang with different crowds
Helps understanding the technology, improves your communications. Some things that you know but it is difficult to articulate, talking to different people helps.

10. Cultivate allies.

11. Pick your battles
There are always compromises that you have to make. You need to figure out what really matters, what are the load bearing walls, what are things that create structure and integrity of a design.

12. Good work does not speak for itself. 
You should be able to sell your work. You should be able to explain your design to the world. You should have the ability to persuade and convince your opinion.

13. Changing a design is easy, changing mind isn't
It is never about a single product, it is a never ending process.

14. Pay attention to your failures.
Every failure carries a message about how to improve yourself as a designer.
Scale of a lesson is not directly proportional to failure. Small issues teach big lesson and vice versa.

15. Everything is always changing.
Change is continuous. Only difference between one change and another is a mater of degree. Your assumptions at one time may not be applicable. So always remember that change is happening. Don't resign over change.