Posts

html

flutter

  import   'package:flutter/material.dart' ; void   main () {    runApp ( MaterialApp ( debugShowCheckedModeBanner :  false ,  home :  Hi ())); } class   Hi   extends   StatelessWidget  {    @ override    Widget   build ( BuildContext   context ) {      return   Scaffold (        appBar :  AppBar (          centerTitle :  true ,          title :  Text ( "My first App" ),          backgroundColor :  Colors . red [ 700 ],       ),        body :  Column (          children : [            Center (       ...

dart programming

basic  void main(){   print("something");   String greet=greeting();   print(greet);   int ages=age();   print(ages);   List<String> names = ['Chung li','yoshi','mrion',"30"];   print(names);   names.add("Samit");   names.remove("yoshi");   print(names);       } String greeting(){      return "hello"; } int age()=>10; Classes .

python

 functions  default parameter: def add(a,b=0):     c=a+b     return c x=add(3) print(x) in the above code, if no value for b is given, value of b becomes 0 by default json files import json x={"name":"samit, "age":20,"job":"eng"} y=json.dumps(x)               #converts dictionary to json print(y)

git commands

git git config list: view all items of list git config user.name: view username git config user.email: view username git config --global user.name "username": "username" git config --global user.email "email": "email" git init : initialize git and starts tracking git  status: views current status of git  git add --a: add all of items for staging git add first.txt: add only first.txt for staging git commit -m "message": commits with given msg git log: shows logs of all commits made  rm -rf .git: deletes .git folder, wont be git repository anymore git clone url: creates the directory and pull all the content of it locally  

Positions

Block, Inline

Image
 some tags like <h>, <p> takes a whole line, i.e. they have display type of block which means they are gonna take whole width and have a line break. such items can have attributes like height width. some tags like <a>, <img> have display inline properties, i.e. if we add something else, they are gonna stack on same line. such cannot have attributes like height width. those can be changed by display attribute. some basic display attributes are: display: inline, block, inline-block, etc. display: block; drop to a new line where we can have height, text-align, etc. display: inline; brings two items to a same line inlined, margin affects left and right sides only inline-block: respects top and bottom padding as well  

pixels, rem, em

<html> has default font size ok 16px. 1em=16px  Pixel is a static measurement, while percent and EM are relative measurements. The size of an EM or percent depends on its parent. If the text size of body is 16 pixels, then 150% or 1.5 EM will be 24 pixels (1.5 * 16). .text-section{     font-sze: 1.5em; }          /* its parent element is <html> which have default size 16px.                                                      so its font size will be 1.5*16=24px*/ .text-section div{                    /* Its parent element is .text-section whose parent is                     font-size:1.5em                   <html...