Wednesday, December 5, 2018

CSS Template : Architects Template



It uses the CSS templates from the W3C, and most of the pages really look good. With the architects template, main things are

Navbar:

w3-bar is the main class for it.
w3-card gives the effect of embossed
header is used for the header area.
Inside the header area, if need to w3-display-middle



 

    BR Architects
   
   

      Projects
      About
      Contact
   

 


The w3-top helps to define the navigation bar which floats on the entire page.



  Architecture
 

   

BR Architects


 


Header


Header area

Paragraph

Column with text

References:
https://www.w3schools.com/w3css/tryit.asp?filename=tryw3css_templates_architect&stacked=h

Flutter how to add local asset resources



Below are the quick steps to do this:

1. From the project explorer, right click and add folder
2. Copy paste the images into this folder
3. In the yaml file, add references to these assets.

If the below was the folder structure

Project root level
images
image.png

In the yaml file it will look like the below

assets:
   - images/image.png

Now in the code, below can be done to load this image:

Class MyTestImageWidget extends StatelessWidget {
    var assetsImage = new AssetImage('assets/explore.png');
    Var image = new Image(image:assetImage,width:40.0,height:40.0)
    Return new Container(child:image);
}



References:
https://www.youtube.com/watch?v=rh15r_8tdRA

GCP : Shared VPC


Shared VPC allows an organization to connect resources from multiple projects to a common VPC network, so that they can communicate with each other securely and efficiently using internal IPs from that network. When you use Shared VPC, you designate a project as a host project and attach one or more other service projects to it. The VPC networks in the host project are called Shared VPC networks. Eligible resources from service projects can use subnets in the Shared VPC network.

Shared VPC lets organization administrators delegate administrative responsibilities, such as creating and managing instances, to Service Project Admins while maintaining centralized control over network resources like subnets, routes, and firewalls. This model allows organizations to do the following:


Implement a security best practice of least privilege for network administration, auditing, and access control. Shared VPC Admins can delegate network administration tasks to Network and Security Admins in the Shared VPC network without allowing Service Project Admins to make network-impacting changes. Service Project Admins are only given the ability to create and manage instances that make use of the Shared VPC network.

Apply and enforce consistent access control policies at the network level for multiple service projects in the organization while delegating administrative responsibilities. For example, Service Project Admins can be Compute Instance Admins in their project, creating and deleting instances that use approved subnets in the Shared VPC host project.

Shared VPC connects projects within the same organization.
Linked projects can be in the same or different folders, but if they are in different folders the admin must have Shared VPC Admin rights to both folders

A project that participates in Shared VPC is either a host project or a service project:

a) A host project contains one or more Shared VPC networks. A Shared VPC Admin must first enable a project as a host project. After that, a Shared VPC Admin can attach one or more service projects to it.
b) A service project is any project that has been attached to a host project by a Shared VPC Admin. This attachment allows it to participate in Shared VPC. It's a common practice to have multiple service projects operated and administered by different departments or teams in your organization.
c) A project cannot be both a host and a service project simultaneously. Thus, a service project cannot be a host project to further service projects.
d) You can create and use multiple host projects; however, each service project can only be attached to a single host project.


A Shared VPC network is a VPC network defined in a host project and made available as a centrally shared network for eligible resources in service projects. Shared VPC networks can be either auto or custom mode, but legacy networks are not supported.

When a host project is enabled, all of its existing VPC networks become Shared VPC networks, and any new network created in it will automatically be a Shared VPC network as well. Thus, a single host project can have more than one Shared VPC network.

Shared VPC makes use of Identity and Access Management (IAM) roles for delegated administration. The following roles can be granted to IAM members, such as users, Google groups, Google domains, or GCP service accounts. If you need to contact any of these admins, you can look them up in your organization's or project's IAM policy



References
https://cloud.google.com/vpc/docs/shared-vpc

HTML, CSS : Photo template


This template has a navigation bar which is moving in from the top. This again is a nav bar

The classes are w3-sidebar, w3-black, w3-animate-top (animate from the top area) w3-xxlarge is for the font.

Now again the header section. this is centred due to the w3-center

Now the main thing is the Photo grid itself. The grids are divs again, which some details like this below

The grid is a vertical one.

The grid is w3-row which is div right now. w3-third tells that there are three columns, Each column has nice images,
But they are all resized as the images itself not programmatically.

References:

Tuesday, December 4, 2018

CSS Display property

Display is CSS's most important property for controlling layout. Every element has a default display value depending on what type of element it is. The default for most elements is usually block or inline. A block element is often called a block-level element. An inline element is always just called an inline element.

block

div is the standard block-level element. A block-level element starts on a new line and stretches out to the left and right as far as it can. Other common block-level elements are p and form, and new in HTML5 are header, footer, section, and more.

inline
span is the standard inline element. An inline element can wrap some text inside a paragraph like this without disrupting the flow of that paragraph. The a element is the most common inline element, since you use them for links.

none

Another common display value is none. Some specialized elements such as script use this as their default. It is commonly used with JavaScript to hide and show elements without really deleting and recreating them.

This is different from visibility. Setting display to none will render the page as though the element does not exist. visibility: hidden; will hide the element, but the element will still take up the space it would if it was fully visible.

The more exotic list of display values is here https://developer.mozilla.org/en-US/docs/Web/CSS/display

references:
http://learnlayout.com/display.html

Flutter : What is a Sliver

Sliver is just a portion of a scrollable area. That’s it! Under the covers, all of the scrollable views you use, like ListView and GridView, are actually implemented using Slivers. You can kind of think of Slivers as a lower-level interface, providing finer-grained control on implementing scrollable area. Because slivers can lazily build each item just as it scrolls into view, slivers are particularly useful for efficiently scrolling through large numbers of children.

You might want this additional control in scrolling behavior if you:

    Want an app bar with nonstandard behavior (disappearing as you scroll, changing size or color as you scroll, etc).
    Need to scroll a list of items and a grid of items all together as one unit. (Yes, you can do this with a table in a ListView but that is much less efficient, particularly if you have a large table.)
    Do something weird like a collapsing list with headers (see gif on the right at the top of this page).

References
https://medium.com/flutter-io/slivers-demystified-6ff68ab0296f

Flutter : Asset Bundling

The assets subsection of the flutter section specifies files that should be included with the app. Each asset is identified by an explicit path (relative to the pubspec.yaml file) where the asset file is located. The order in which the assets are declared does not matter. The actual directory used (assets in this case) does not matter

During a build, Flutter places assets into a special archive called the asset bundle, which apps can read from at runtime

Asset variants

The build process supports the notion of asset variants: different versions of an asset that might be displayed in different contexts. When an asset’s path is specified in the assets section of pubspec.yaml, the build process looks for any files with the same name in adjacent subdirectories. Such files are then included in the asset bundle along with the specified asset.

For example, if you have the following files in your application directory:

  .../pubspec.yaml
  .../graphics/my_icon.png
  .../graphics/background.png
  .../graphics/dark/background.png
  ...etc.

…and your pubspec.yaml file contains:

flutter:
  assets:
    - graphics/background.png

…then both graphics/background.png and graphics/dark/background.png will be included in your asset bundle. The former is considered the main asset, while the latter is considered a variant.

If on the other hand the graphics directory is specified:

flutter:
  assets:
    - graphics/

… then graphics/my_icon.png, graphics/background.png and graphics/dark/background.png will be included.

Flutter uses asset variants when choosing resolution appropriate images; see below. In the future, this mechanism may be extended to include variants for different locales or regions, reading directions, etc.

References:
https://flutter.io/docs/development/ui/assets-and-images