Posts

Showing posts from August, 2009

Css Position: Center Code Example

Example 1: css align center vertical and horizontal .parent-class { display: flex; align-items: center; justify-content: space-around; } Example 2: css center position /**************** 1º method to center all elements ********************/ body { text-align: center; } /* If all of your elements have the property display equal to "inline", "block" or "inline-block", then you can use the text-align: center in the < body > tag */ tag_name { display: inline; /* block or inline-block*/ } /*...but if we have an element of type "block" with a width diferente from the default (maximum width of the page), then this will no longer work!*/ tag_name { display: block; width: 170px; } /**************** 2º method to center all elements ********************/ /* Another method, is to use the margins to center the element horizontally and/or vertically */ tag_name { display: block; width: 100px; margin: 0

Difference Between Absolute And Relative Position In CSS With Example

Example: position relative and absolute difference in css <div class=”parent”> <div class=”box” id=”one”>One</div> <div class=”box” id=”two”>Two</div> <div class=”box” id=”three”>Three</div> <div class=”box” id=”four”>Four</div></div>

Bootstrap How To Start Code Example

Example 1: bootstrap link < link rel = " stylesheet " href = " https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css " integrity = " sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh " crossorigin = " anonymous " > Example 2: bootstrap starter template <! doctype html > < html lang = " en " > < head > <!-- Required meta tags --> < meta charset = " utf-8 " > < meta name = " viewport " content = " width=device-width, initial-scale=1, shrink-to-fit=no " > <!-- Bootstrap CSS --> < link rel = " stylesheet " href = " https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css " integrity = " sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T " crossorigin = " anonymous " > < title > Hell

How To Print Boolean Value In C Code Example

Example: how to print boolean in c printf ( "%s" , x ? "true" : "false" ) ;

How To Add Favicon In Html W3schools Code Example

Example 1: html set icon <link rel= "icon" href= "http://example.com/favicon.png" > Example 2: how to add favicon in html <link rel= "shortcut icon" type= "image/png" href= "Link to the image" /> Example 3: add favicon html <link rel= "icon" type= "image/png" href= "/favicon.png" />

Css Pseudo-elements

A CSS pseudo-element is a keyword added to a selector that lets you style a specific part of the selected element(s). For example, ::first-line can be used to change the font of the first line of a paragraph. /* The first line of every <p> element. */ p::first-line { color : blue ; text-transform : uppercase ; } Note: In contrast to pseudo-elements, pseudo-classes can be used to style an element based on its state . Syntax selector::pseudo-element { property : value ; } You can use only one pseudo-element in a selector. It must appear after the simple selectors in the statement. Note: As a rule, double colons ( :: ) should be used instead of a single colon ( : ). This distinguishes pseudo-classes from pseudo-elements. However, since this distinction was not present in older versions of the W3C spec, most browsers support both syntaxes for the original pseudo-elements. Index Pseudo-elements defined by a set of CSS specifications include the following:

Download Font Google Roboto Code Example

Example 1: google font roboto @import url ( 'https://fonts.googleapis.com/css2?family=Roboto&display=swap' ) ; font-family : 'Roboto' , sans-serif ; Example 2: google fonts roboto //html <link rel= "preconnect" href= "https://fonts.gstatic.com" > <link href= "https://fonts.googleapis.com/css2?family=Roboto:wght@300&display=swap" rel= "stylesheet" > //css @import url ( 'https://fonts.googleapis.com/css2?family=Roboto:wght@300&display=swap' ) ; font-family : 'Roboto' , sans-serif ;

409\ Http Code Example

Example: 409 status code The 409 (Conflict) status code indicates that the request could not be completed due to a conflict with the current state of the target resource. This code is used in situations where the user might be able to resolve the conflict and resubmit the request. The server SHOULD generate a payload that includes enough information for a user to recognize the source of the conflict.

Cannot Find Command 'dotnet Ef'?

Image
Answer : In my case, the tools folder didn't exist inside %USERPROFILE%\.dotnet\ so I had to run the command dotnet tool install --global dotnet-ef to install dotnet ef. Then I was able to run dotnet ef... This was the result of the above install command: Note to readers: If you haven't installed dotnet ef , you need to install it first: dotnet tool install --global dotnet-ef . The question-asker already did that. You need to do that first before the rest of this answer can help. How to fix this For Linux and macOS , add a line to your shell's configuration: bash / zsh : export PATH="$PATH:$HOME/.dotnet/tools/" csh / tcsh : set path = ($path $HOME/.dotnet/tools/) When you start a new shell/terminal (or the next time you log in) dotnet ef should work. For Windows : See this question on how to add to the PATH environment variable. You need to add %USERPROFILE%\.dotnet\tools to the PATH . What's going on? The .NET Core 3.0 (preview)

Google Fonts API Code Example

Example 1: add google font CSS @import url ( https://fonts.googleapis.com/css?family=Roboto ) ; HTML <link rel="stylesheet" href="https://fonts .googleapis .com /css?family=Roboto"/ > body { font-family : "Roboto" ; } Example 2: how to import google font <!-- To Add Montserrat font or any font as such --> <!-- Go to https : //fonts.google.com browse the font you like here , Montserrat--> <!-- On the right click embbed and get the link similar to one given below--> <link href= "https://fonts.googleapis.com/css2?family=Montserrat&display=swap" rel= "stylesheet" > <!-- add this ^ link inside your <head> tag i.e. before </head> --> <!-- In css you can specify the font family as --> font-family : "Montserrat" , sans-serif ; Example 3: use google fonts in css @import url ( 'https://fonts.googleapis.com/css?family=Open+Sans&display=swap' ) ; Example 4:

Amazon RDS Running Out Of Freeable Memory. Should I Be Worried?

Answer : Short answer - you shouldn't worry about FreeableMemory unless it is became really low (about 100-200 Mb) or significant swapping occur (see RDS SwapUsage metric). FreeableMemory is not a MySQL metric, but OS metric. It is hard to give precise definition, but you can treat it as memory which OS will be able to allocate to anyone who request it (in your case it likely will be MySQL). MySQL have a set of settings which are restricting it's overall memory usage to some cap(you can use something like this to actually calculate it). It's unlikely that your instance will ever hit this limit, due to the fact that in general you never reach max number of connections, but this is still possible. Now going back to "decline" in FreeableMemory metric. For the MySQL most of the memory consume by InnoDB buffer pool (see here for details). RDS instances in there config by default have size for this buffer set to 75% of hosts physical memory - which in your case i

Python Get Length Of Array Code Example

Example 1: python get array length # To get the length of a Python array , use 'len()' a = arr . array ( ‘d’ , [ 1.1 , 2.1 , 3.1 ] ) len ( a ) # Output : 3 Example 2: find array length python array = [ 1 , 2 , 3 , 4 , 5 ] print ( len ( arr ) ) Example 3: python array length len ( my_array ) Example 4: find array length in python a = arr . array ( 'd' , [ 1.1 , 2.1 , 3.1 ] ) len ( a )

Not First Child Pseudo Selector Code Example

Example: css not first child .block :not ( :first-child ) { background-color : #990000 ; } //if you need to support legacy browsers then follow the below solution .block { background-color : #990000 ; /* applies to every ul */ } .block :first-child { background-color : transparent ; /* limits the scope of the previous rule */ }

Create Database Mysql Utf8 Code Example

Example 1: create database mysql utf8 CREATE DATABASE mydatabase CHARACTER SET utf8 COLLATE utf8_general_ci ; Example 2: mysql create database utf8 CREATE DATABASE mydatabase CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci ; Example 3: mysql create database charset utf8mb4 CREATE DATABASE mydatabase CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci ;

Android Toast Duration Code Example

Example: android studio Toast usage Context context = getApplicationContext(); CharSequence text = "Hello toast!"; int duration = Toast.LENGTH_SHORT; Toast toast = Toast.makeText(context, text, duration); toast.show();

C# Wpf Timer Example

Example: c# wpf timer using System ; using System . Windows ; using System . Windows . Threading ; namespace WpfTutorialSamples . Misc { public partial class DispatcherTimerSample : Window { public DispatcherTimerSample ( ) { InitializeComponent ( ) ; DispatcherTimer timer = new DispatcherTimer ( ) ; timer . Interval = TimeSpan . FromSeconds ( 1 ) ; timer . Tick += timer_Tick ; timer . Start ( ) ; } void timer_Tick ( object sender , EventArgs e ) { lblTime . Content = DateTime . Now . ToLongTimeString ( ) ; } } }