Posts

Showing posts from July, 2019

Responsive Background Image Bootstrap Code Example

Example 1: make a background image responsive css html { min-height : 100 % ; background-image : url ( image.jpg ) ; background-size : cover ; background-repeat : no-repeat ; background-position : center center ; } Example 2: add background image in bootstrap 5 <div class= "has-bg-img bg-purple bg-blend-screen" > <h4>Background blend mode : Multiply</h4> <img class= "bg-img" src= "..." > </div> Example 3: Scaling Images and Videos css .container { width : 50 % ; height : 200 px ; overflow : hidden ; } .container img { max-width : 100 % ; height : auto ; display : block ; } Example 4: how to set background image in css responsive body { background : url ( "images/xyz.jpg" ) no-repeat center ; Example 5: making image responsive <p> <a href= "MY WEBSITE LINK" target= "_blank" > <img src= "IMAGE LINK" style= 'wi

Textwrap Css Code Example

Example: how to wrap text in div css .example { overflow-wrap : break-word ; }

Sharepoint - Cannot Delete Document, Error: The File Is Currently Checked Out Or Locked For Editing By Another User

Answer : If you examine the item using PowerShell you can get a better idea of what is going on. In all the cases where I have seen it the lock expires after short period(20 minutes) and has been caused by word setting a lock when a user has selected to edit the file: $web = Get-SpWeb http://somesite.net $item = $web.GetListItem("/relative/url/to/item.doc") $item.file.LockType $item.file.LockedByUser $item.file.LockExpires If you are facing this error while deleting empty folder "The file is currently checked out or locked for editing by another user.", Then it might be because of there are documents in the library that don't have a major version published. Yo can go into the Library Settings and take ownership of the files. Then delete the entries, and the folder can be deleted. Library Tools > Library > Library Settings > Permissions and Management > Manage files which have no checked in version

Cron Expression For Every 2 Minutes Code Example

Example: cron every 2 minutes */2 * * * *

Can A Flutter App Be Proposed On The Huawei AppGallery?

Answer : As long as your application complies with the regulations of AppGallery, there should not be any problem it. https://developer.huawei.com/consumer/en/doc/30202 AppGallery does not have any restriction on the language application developed with, no need to worry about it; flutter, cordova, react.native, xamarin they are fine. Just a point to take care. If you are using SDKs or services those depend on Google Play services, when you have published your application on AppGallery, it will be visible only for Huawei devices supports Google Play Services. In theory, yes it could. Huawei uses an OS called Harmony OS. The Arc compiler in Harmony OS supports all the major programming languages including C/, C++, Java, JavaScript and Kotlin. Flutter compiles Dart code to native device code (Java, and Kotlin for Android and Swift for iOS). Huawei is making an Arc compiler that supposedly makes it easy to turn Android apps to Harmony OS apps. What does this mean for Flutt

Bottom Border In Appbar Flutter Code Example

Example: add only bottom border to container flutter decoration : BoxDecoration ( border : Border ( top : BorderSide ( width : 16.0 , color : Colors . lightBlue . shade600 ) , bottom : BorderSide ( width : 16.0 , color : Colors . lightBlue . shade900 ) , ) , color : Colors . white , ) ,

Breadth First Search Time Complexity Analysis

Image
Answer : I hope this is helpful to anybody having trouble understanding computational time complexity for Breadth First Search a.k.a BFS. Queue graphTraversal.add(firstVertex); // This while loop will run V times, where V is total number of vertices in graph. while(graphTraversal.isEmpty == false) currentVertex = graphTraversal.getVertex(); // This while loop will run Eaj times, where Eaj is number of adjacent edges to current vertex. while(currentVertex.hasAdjacentVertices) graphTraversal.add(adjacentVertex); graphTraversal.remove(currentVertex); Time complexity is as follows: V * (O(1) + O(Eaj) + O(1)) V + V * Eaj + V 2V + E(total number of edges in graph) V + E I have tried to simplify the code and complexity computation but still if you have any questions let me know. Considering the following Graph we see how the time complexity is O(|V|+|E|) but not O(V*E). Adjacency List V E v0:{v1,v2} v1:{v3} v2:{v3} v3:{} Ope

Justify Content Center Bootstrap Code Example

Example 1: justify-content-between bootstrap 4 <div class= "d-flex justify-content-start" >...</div> <div class= "d-flex justify-content-end" >...</div> <div class= "d-flex justify-content-center" >...</div> <div class= "d-flex justify-content-between" >...</div> <div class= "d-flex justify-content-around" >...</div> Example 2: bootstrap col center content <div class= "row" > <div class= "col-4 d-flex justify-content-center text-center" > // for image and text </div> </div> Example 3: justify text bootstrap <p class= "text-justify" > your text for example : Hellow! World.. </p> Example 4: bootstrap center align columns <!-- Center columns in a Row --> <div class= "row d-flex justify-content-center text-center" > <div class= "col-4" > // Add Co

AndroidViewModel Vs ViewModel

Answer : AndroidViewModel provides Application context If you need to use context inside your Viewmodel you should use AndroidViewModel (AVM), because it contains the application context. To retrieve the context call getApplication() , otherwise use the regular ViewModel (VM). AndroidViewModel has application context . We all know having static context instance is evil as it can cause memory leaks!! However, having static Application instance is not as bad as you might think because there is only one Application instance in the running application. Therefore, using and having Application instance in a specific class is not a problem in general. But, if an Application instance references them, it is a problem because of the reference cycle problem. See Also about Application Instance AndroidViewModel Problematic for unit tests AVM provides application context which is problematic for unit testing. Unit tests should not deal with any of the Android lifecycle, such as con

Button Script Unity Onclick Code Example

Example 1: unity assign button onclick public Button yourButton ; void Start ( ) { Button btn = yourButton . GetComponent < Button > ( ) ; //Grabs the button component btn . onClick . AddListener ( TaskOnClick ) ; //Adds a listner on the button } void TaskOnClick ( ) { Debug . Log ( "You have clicked the button!" ) ; } Example 2: how to code button click unity using UnityEngine ; using UnityEngine . UI ; using System . Collections ; public class ClickExample : MonoBehaviour { public Button yourButton ; void Start ( ) { Button btn = yourButton . GetComponent < Button > ( ) ; btn . onClick . AddListener ( TaskOnClick ) ; } void TaskOnClick ( ) { Debug . Log ( "You have clicked the button!" ) ; } } Example 3: unity onclick object void Update ( ) { } void OnMouseDown ( ) { // this object was clicked - do something Destroy ( this . gameObject ) ; }

Mirzapur Season 2 Episode List Code Example

Example: mirzapur 2 October 23 rd , 2020

Bg Opacity Css Code Example

Example 1: set background image opacity #bg{ background - image : url ( 'images / wood1 . jpg' ) ; opacity : 0.2 ; width : 300px ; height : 300px ; } Example 2: background image opacity css /* Two ways to make images opaque */ div { background - color : rgba ( 120 , 120 , 120 , 0.5 ) /* the 0.5 is the value of opacity on a scale of 0-1 */ } /* OR */ div { background - color : blue opacity : 50 % } Example 3: css set background opacity /*background color opacity with explainations */ rgba ( 51 , 170 , 51 , .1 ) /* 10% opaque green */ rgba ( 51 , 170 , 51 , .4 ) /* 40% opaque green */ rgba ( 51 , 170 , 51 , .7 ) /* 70% opaque green */ rgba ( 51 , 170 , 51 , 1 ) /* full opaque green */ Example 4: set opacity of background image The following example sets the opacity for the background color and not the text : 100 % opacity . 60 % opacity . 30 % opacity . 10 % opacity . You learned from our .. .

Convert String To Array Python Code Example

Example 1: python string to array >> > text = 'a b c' >> > text = text . split ( ' ' ) >> > text [ 'a' , 'b' , 'c' ] Example 2: convert string to list python # To split the string at every character use the list ( ) function word = 'abc' L = list ( word ) L # Output: # [ 'a' , 'b' , 'c' ] # To split the string at a specific character use the split ( ) function word = 'a , b , c' L = word . split ( ',' ) L # Output: # [ 'a' , 'b' , 'c' ] Example 3: string to list python s = 'hello' l = list ( s ) print ( l ) # prints [ 'h' , 'e' , 'l' , 'l' , 'o' ]

Css Even Odd Nth-child Code Example

Example 1: css odd even child tr :nth-child ( even ) { background : #CCC } tr :nth-child ( odd ) { background : #FFF } Example 2: select even child css li :nth-child ( even ) { /* Selects only even elements */ color : green ; }

Can I Use Javascript To Dynamically Change A Video's Source?

Answer : Sure, You can set the src attribute on the source element: document.querySelector("#myVideoTag > source").src = "http://example.com/new_url.mp4" Or using jQuery instead of standard DOM methods: $("#myVideoTag > source").attr("src", "http://example.com/new_url.mp4"​​​​)​ Then you need to call the load method on the video element: videoElement.load() I have faced this problem several times and based on previous experience and digging I can suggest these options: replace video tag completely yes, just re-insert <video> element with new sources. It's straightforward, but effective approach. Don't forget to re-initialize event listeners. assign video URL to video.src this I saw a lot in answers here, on stackoverflow, and also in sources on github. var video = document.getElementById('#myVideo'); video.src = newSourceURL; It works, but you cannot provide browser opt

.What Is The Data Structure Used To Perform Recursion Code Example

Example: recursion data structure int function ( int value ) { if ( value < 1 ) return ; function ( value - 1 ) ; printf ( "%d " , value ) ; }

Convert String To Time Php Code Example

Example 1: php convert us date to european $originalDate = "2010-03-21" ; $newDate = date ( "d-m-Y" , strtotime ( $originalDate ) ) ; Example 2: string to datetime php $s = ' 06 / 10 / 2011 19 : 00 : 02 ' ; $date = strtotime ( $s ) ; echo date ( 'd / M / Y H : i : s' , $date ) ; Example 3: time to string in php < ? php $date = ' 27 / 06 / 2020 , 04 : 42 : 43 PM' ; $date = str_replace ( '/' , '-' , $date ) ; echo date ( ' F j , Y , g : i a' , strtotime ( $date ) ) ; // output : June 27, 2020, 4:42 pm ? > Example 4: strtotime format $date = ' 25 / 05 / 2010 ' ; $date = str_replace ( '/' , '-' , $date ) ; echo date ( 'Y - m - d' , strtotime ( $date ) ) ; Example 5: php date to seconds < ? php $str = 'Tue Dec 15 2009 ' ; $timestamp = strtotime ( $str ) ; echo $timestamp ; //output: 1260831600 ? > Example 6: Convert String to Date and Date-Ti