Posts

Showing posts from August, 2001

Make Border Bottom Half Width Code Example

Example: half border bottom div { width : 500 px ; height : 100 px ; position : relative ; padding-top : 20 px ; margin-top : 50 px ; } div ::before { content : '' ; display : block ; position : absolute ; top : 0 ; width : 50 % ; left : 25 % ; border-top : 1 px solid red ; }

Private Protected Php Code Example

Example: how to access private and protected members in php < ? php class GrandPa { protected $name = 'Mark Henry' ; } class Daddy extends GrandPa { function displayGrandPaName ( ) { return $ this -> name ; } } $daddy = new Daddy ; echo $daddy -> displayGrandPaName ( ) ; // Prints 'Mark Henry' $outsiderWantstoKnowGrandpasName = new GrandPa ; echo $outsiderWantstoKnowGrandpasName -> name ; // Results in a Fatal Error

Convert Base64 To String Javascript Code Example

Example 1: javascript base64 encode var string = "Hello folks how are you doing today?" ; var encodedString = btoa ( string ) ; // Base64 encode the String var decodedString = atob ( encodedString ) ; // Base64 decode the String Example 2: base64 to string and string to base64 javascript decode // base64 to string let base64ToString = Buffer . from ( obj , "base64" ) . toString ( ) ; base64ToString = JSON . parse ( base64ToString ) ; //or let str = 'bmltZXNoZGV1amEuY29t' ; let buff = new Buffer ( str , 'base64' ) ; let base64ToStringNew = buff . toString ( 'ascii' ) ; // string to base64 let data = 'nimeshdeuja . com' ; let buff = new Buffer ( data ) ; let stringToBase64 = buff . toString ( 'base64' ) ; Example 3: javascript encode base64 const encoded = window . btoa ( 'Alireza Dezfoolian' ) ; // encode a string const decoded = window . atob ( encoded ) ; // decode the string Examp

Copyright Symbol Html Code Example

Example 1: copyright symbol html & # 169 ; & copy ; Example 2: copyright symbol html < ! -- Copyright ( © ) Symbol in HTML -- > HTML ENTITY : & copy ; HTML CODE : & # 169 ; Example 3: copyright symbol html & # 169 ; or & copy ; Example 4: copy the text html < script type = "text/JavaScript" > //courtesy of BoogieJack.com function killCopy ( e ) { return false } function reEnable ( ) { return true } document . onselectstart = new Function ( "return false" ) if ( window . sidebar ) { document . onmousedown = killCopy document . onclick = reEnable } < / script >

Convert Text To Ssml Function Code Example

Example 1: ssml < speak > < amazon: emotion name = " disappointed " intensity = " medium " > I want to tell you a secret. < voice name = " Kendra " > I am not a real human. </ voice > . Can you believe it? </ amazon: emotion > </ speak > Example 2: convert text to ssml function convert text to ssml function Example 3: convert text to ssml function how are you

Bytes Vs Bytearray In Python 2.6 And 3

Answer : For (at least) Python 3.7 According to the docs: bytes objects are immutable sequences of single bytes bytearray objects are a mutable counterpart to bytes objects. And that's pretty much it as far as bytes vs bytearray . In fact, they're fairly interchangeable and designed to flexible enough to be mixed in operations without throwing errors. In fact, there is a whole section in the official documentation dedicated to showing the similarities between the bytes and bytearray apis. Some clues as to why from the docs: Since many major binary protocols are based on the ASCII text encoding, bytes objects offer several methods that are only valid when working with ASCII compatible data and are closely related to string objects in a variety of other ways. In Python 2.6 bytes is merely an alias for str . This "pseudo type" was introduced to [partially] prepare programs [and programmers!] to be converted/compatible with Python 3.0 where there is a

Svg Arrow Up Code Example

Example: right arrow svg <link rel= "stylesheet" href= "https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css" > <script src= "https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js" ></script> <script src= "https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js" ></script> <span class= "glyphicon glyphicon-circle-arrow-right" ></span>

Add Css Using Jquery Code Example

Example 1: jquery add style //revising Ankur's answer //Syntax: $ ( selector ) . css ( { property - name : property - value } ) ; //Example: $ ( '.bodytext' ) . css ( { 'color' : 'red' } ) ; Example 2: jquery css $ ( '#element' ) . css ( 'display' , 'block' ) ; /* Single style */ $ ( '#element' ) . css ( { 'display' : 'block' , 'background-color' : '#2ECC40' } ) ; /* Multiple style */ Example 3: jquery add css $ ( '#start' ) . css ( { 'font-weight' : 'bold' } ) ; Example 4: set css using jquery $ ( '.name' ) . css ( 'color' : 'blue' ) ; Example 5: add css file through jquery $ ( 'head' ) . append ( '<link rel="stylesheet" href="style2.css" type="text/css" />' ) ; Example 6: edit css jquery $ ( '.ama' ) . css ( 'color' , 'red' ) ;

Css Disable Enable Link Code Example

Example 1: how to disable a link < style > .isDisabled { color : currentColor ; cursor : not-allowed ; opacity : 0.5 ; text-decoration : none ; } </ style > < a class = " isDisabled " href = " https://unfetteredthoughts.net " > Disabled Link </ a > Example 2: disabled a click // CSS .not-active { pointer-events: none; cursor: default; text-decoration: none; color: black; } // HTML < a href = " link.html " class = " not-active " > Link </ a >

Android Camera Preview Stretched

Image
Answer : I'm using this method -> based on API Demos to get my Preview Size: private Camera.Size getOptimalPreviewSize(List<Camera.Size> sizes, int w, int h) { final double ASPECT_TOLERANCE = 0.1; double targetRatio=(double)h / w; if (sizes == null) return null; Camera.Size optimalSize = null; double minDiff = Double.MAX_VALUE; int targetHeight = h; for (Camera.Size size : sizes) { double ratio = (double) size.width / size.height; if (Math.abs(ratio - targetRatio) > ASPECT_TOLERANCE) continue; if (Math.abs(size.height - targetHeight) < minDiff) { optimalSize = size; minDiff = Math.abs(size.height - targetHeight); } } if (optimalSize == null) { minDiff = Double.MAX_VALUE; for (Camera.Size size : sizes) { if (Math.abs(size.height - targetHeight) < minDiff) {

Font Awesome Bootstrap Cdn Download Code Example

Example 1: fontawesome cdn <link href= "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css" rel= "stylesheet" > Example 2: bootstrap 4 cdn <script src= "https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity= "sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin= "anonymous" ></script> <script src= "https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity= "sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin= "anonymous" ></script> <script src= "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity= "sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin= "anonymous" ></script> Example 3: bootstrap 4 cdn link <link rel= "stylesheet" href=

Letter Spacing Css W3schools Code Example

Example 1: letter spacing css div { letter-spacing : 2 px ; } Example 2: letter spacing css div { letter-spacing : 2 px ; }

Connect To Azure Devops Repo Using Sourcetree On MacOS

Image
Answer : Although SourceTree for macOS has updated the name of Azure DevOps (from "Visual Studio Team Services"), it appears that it does not support the new Azure DevOps URLs. You can use the old-format (VSTS-style) URLs. Instead of https://dev.azure.com/username , you can use https://username.visualstudio.com . Ironically, it seems that SourceTree for Windows still calls the product "Visual Studio Team Services" but supports the new-style Azure DevOps URLs.) You need to set up a Personal Access Token. The below is from the documentation Personal access tokens (PATs) are alternate passwords that you can use to authenticate in to Azure DevOps and Team Foundation Server (TFS). In this article, we walk you through how to create or revoke PATS. Azure DevOps Services and TFS use enterprise-grade authentication to help protect and secure your data. Clients like Visual Studio and Eclipse (with the Team Explorer Everywhere plug-in) also support Microsoft account and Az