Posts

Showing posts from October, 2013

Bootstrap V5.0.1 Cdn Code Example

Example 1: bootstrap 5 cdn < ! - - BS 5 - -> < link href = "https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/css/bootstrap.min.css" rel = "stylesheet" integrity = "sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl" crossorigin = "anonymous" > < script src = "https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/js/bootstrap.bundle.min.js" integrity = "sha384-b5kHyXgcpbZJO/tY9Ul7kGkf1S0CWuKcCD38l8YkeH8z8QjE0GmW1gYU5S9FOnJ0" crossorigin = "anonymous" > < / script > Example 2: bootstrap 4.5 cdn < ! - - Bootstrap 4.5 CSS - -> < link rel = "stylesheet" href = "https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity = "sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin = "anonymous" > < ! - - Bootstrap JS Requirements - -> &l

Amazon AWS Filezilla Transfer Permission Denied

Answer : To allow user ec2-user (Amazon AWS) write access to the public web directory (/var/www/html), enter this command via Putty or Terminal, as the root user sudo : chown -R ec2-user /var/www/html Make sure permissions on that entire folder were correct: chmod -R 755 /var/www/html Doc's: Setting up amazon ec2-instances Connect to Amazon EC2 file directory using Filezilla and SFTP (Video) Understanding and Using File Permissions if you are using centOs then use sudo chown -R centos:centos /var/www/html sudo chmod -R 755 /var/www/html For Ubuntu sudo chown -R ubuntu:ubuntu /var/www/html sudo chmod -R 755 /var/www/html For Amazon ami sudo chown -R ec2-user:ec2-user /var/www/html sudo chmod -R 755 /var/www/html In my case the /var/www/html in not a directory but a symbolic link to the /var/app/current, so you should change the real directoy ie /var/app/current: sudo chown -R ec2-user /var/app/current sudo chmod -R 755 /var/app/current I hope th

All Compiler Errors Have To Be Fixed Before You Can Enter Playmode! Code Example

Example: all compiler errors have to be fixed before entering playmode HOW TO GET RID OF All "compiler errors have to be fixed before you can enter playmode" 1 - check in the console tab if you have some errors in a code you wrote //the ones in red are the ones that probably are bothering you 2 - if you already fixed all the errors and you didnt get rid of it, try restarting unity 3 - if it didnt work just make another project 4 - if it DIDNT work reinstall unity 5 - if it didnt work call the the tech support 6 - if it didnt work restart yourselve

Opposite Of !important In Css Code Example

Example 1: important css body { font-family : verdana , arial !important ; } Example 2: important css /* The !important property in CSS means that all subsequent rules on an element are to be ignored, and the rule denoted by !important is to be applied. This rule overrides all previous styling rules -- the !important property increases its priority. */ h1 { background-color : red !important ; /* Syntax */ } /* The !important property is mentioned immediately before the semicolon */

Opa The Expanse Code Example

Example: OPA in expanse Outer Planets Alliance The Outer Planets Alliance ( OPA ) is a loosely affiliated network borrowing or associating under a core common ideology that started its life as a labor union or advocacy group , fighting for the interests of inhabitants of the Belt , often in direct conflict with the inner planets ' Earth - Mars Coalition Navy .

Css Margin-top Example

The margin-top CSS property sets the margin area on the top of an element. A positive value places it farther from its neighbors, while a negative value places it closer. This property has no effect on non- replaced inline elements, such as <span> or <code> . Syntax /* <length> values */ margin-top : 10px ; /* An absolute length */ margin-top : 1em ; /* relative to the text size */ margin-top : 5% ; /* relative to the nearest block container's width */ /* Keyword values */ margin-top : auto ; /* Global values */ margin-top : inherit ; margin-top : initial ; margin-top : unset ; The margin-top property is specified as the keyword auto , or a <length> , or a <percentage> . Its value can be positive, zero, or negative. Values <length> The size of the margin as a fixed value. <percentage> The size of the margin as a percentage, relative to the width of the containing block. auto The browser selects a suitable v

Html Responsive Widht And Height Image Code Example

Example 1: responsive img .responsive-img { max-width : 100 % ; display : block ; height : auto ; } Example 2: making image responsive <p> <a href= "MY WEBSITE LINK" target= "_blank" > <img src= "IMAGE LINK" style= 'width:100%;' border= "0" alt= "Null" > </a> </p>

Difference Between Justify Content And Align Items Code Example

Example 1: flexbox align right and left .primary-nav { display : -webkit-flex ; display : flex ; list-style-type : none ; padding : 0 ; justify-content : flex-end ; } .left { margin-right : auto ; } Example 2: justify content /* Positional alignment */ justify-content : center ; /* Pack items around the center */ justify-content : start ; /* Pack items from the start */ justify-content : end ; /* Pack items from the end */ justify-content : flex-start ; /* Pack flex items from the start */ justify-content : flex-end ; /* Pack flex items from the end */ justify-content : left ; /* Pack items from the left */ justify-content : right ; /* Pack items from the right */ /* Baseline alignment */ /* justify-content does not take baseline values */ /* Normal alignment */ justify-content : normal ; /* Distributed alignment */ justify-content : space-between ; /* Distribute items evenly T

Get Rotation Direction Unity Code Example

Example: unity 2d rotate towards direction /// < summary > /// Rotate a gameobject to face a direction in 2D space with offet /// </ summary > /// < param name = " target " > </ param > /// < param name = " RotationSpeed " > </ param > /// < param name = " offset " > </ param > private void RotateGameObject ( Vector3 target , float RotationSpeed , float offset ) { //https://www.youtube.com/watch?v=mKLp-2iseDc //get the direction of the other object from current object Vector3 dir = target - transform . position ; //get the angle from current direction facing to desired target float angle = Mathf . Atan2 ( dir . y , dir . x ) * Mathf . Rad2Deg ; //set the angle into a quaternion + sprite offset depending on initial sprite facing direction Quaternion rotation = Quaternion . Euler ( new Vector3 ( 0 , 0 ,

Android: How Do I Get String From Resources Using Its Name?

Answer : The link you are referring to seems to work with strings generated at runtime. The strings from strings.xml are not created at runtime. You can get them via String mystring = getResources().getString(R.string.mystring); getResources() is a method of the Context class. If you are inside a Activity or a Service (which extend Context) you can use it like in this snippet. Also note that the whole language dependency can be taken care of by the android framework . Simply create different folders for each language. If english is your default language, just put the english strings into res/values/strings.xml . Then create a new folder values-ru and put the russian strings with identical names into res/values-ru/strings.xml . From this point on android selects the correct one depending on the device locale for you, either when you call getString() or when referencing strings in XML via @string/mystring . The ones from res/values/strings.xml are the fallback ones, if y

Does Not Name A Type Error In C++ Code Example

Example: void does not a name a type in cpp void does not name a type

Css :defined Example

The :defined CSS pseudo-class represents any element that has been defined. This includes any standard element built in to the browser, and custom elements that have been successfully defined (i.e. with the CustomElementRegistry.define() method). /* Selects any defined element */ :defined { font-style : italic ; } /* Selects any instance of a specific custom element */ simple-custom:defined { display : block ; } Syntax :defined Examples Hiding elements until they are defined The following snippets are taken from our defined-pseudo-class demo ( see it live also). In this demo we define a very simple trivial custom element: customElements . define ( 'simple-custom' , class extends HTMLElement { constructor ( ) { super ( ) ; let divElem = document . createElement ( 'div' ) ; divElem . textContent = this . getAttribute ( 'text' ) ; let shadowRoot = this . attachShadow ( { mode : 'open' } ) . app

Cool Input Cbox Modal Html Code Example

Example 1: javascript modal close $('#closemodal').click(function() { $('#modalwindow').modal('hide'); }); Example 2: how to make popup modal in jquery with example <!-- AJAX response must be wrapped in the modal's root class. --> < div class = " modal " > < p > Second AJAX Example! </ p > </ div > Example 3: how to make popup modal in jquery with example $("#sticky").modal({ escapeClose: false, clickClose: false, showClose: false });

Rgb(255,255,255) In Hex Color Code Example

Example: rgb 255,255,255 Tints of White #FFFFFF RGB value is ( 255 , 255 , 255 ) .

Remove Overflow Bootstrap Code Example

Example: overflow hidden in bs4 <div class= "overflow-auto" >...</div> <div class= "overflow-hidden" >...</div>

CORS Policy: Response To Preflight Request Doesn't Pass Access Control Check: No 'Access-Control-Allow-Origin' Code Example

Example: been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. My issue was the remote server not responding to OPTIONS requests, so after fiddling about with requests and headers for what seemed like ages I resolved it by removing the headers Content-Type and Access-Control-Allow-Origin

Get Class Name Jquery Code Example

Example 1: jquery get class name //jQuery get class name of element var className=$ ( '#myElementID' ) . attr ( 'class' ) ; Example 2: how to get class name in jquery var className = $ ( '#sidebar' ) . attr ( 'class' ) ; Example 3: how to find a name of class from page in jquery if ( $ ( " .Mandatory " ) .length > 0 ) { // Do stuff with $ ( " .Mandatory " ) $ ( " .Mandatory " ) .each ( function ( ) { // "this" points to current item in looping through all elements with // class= "Mandatory" $ ( this ) . doSomejQueryWithElement ( ) ; } ) ; } Example 4: how to find a name of class from page in jquery $ ( "input [ type = 'submit' ] " ) .click ( function ( ) { if ( $ ( " .Mandatory " ) .length > 0 ) { // Do some code here } } ) ; Example 5: how to find a name of class from page in jquery if ( $ ( ' .Mandator

Css Hover Zoom In Code Example

Example 1: zoom image css /*Zoom on hover*/ <style > .zoom { padding : 50 px ; background-color : green ; transition : transform .2 s ; /* Animation */ width : 200 px ; height : 200 px ; margin : 0 auto ; } .zoom :hover { transform : scale ( 1.5 ) ; /* (150% zoom)*/ } </style> <div class= "zoom" ></div> /*credits: w3schools.com */ Example 2: how to enlarge image when hover on in css img :hover { transform : scale ( 1.3 ) ; } Example 3: on hover zoom card transform : scale ( 1.5 ) ; Example 4: html zoom text on hover <style > #test-text :hover { font-size : 40 px ; } </style> <body> <p id=test-text>TEST</p> </body>

Textit Latex Code Example

Example 1: latex bold text \textbf { text } Example 2: latex italic \emph { accident }

Get Last Child Css Not Working Code Example

Example: not last child css p :not ( :last-child ) { margin-bottom : 20 px }

C Sleep(milliseconds) Code Example

Example: c fractional sleep # define _DEFAULT_SOURCE # include "newSleep.h" void fracSleep ( float sec ) { struct timespec ts ; ts . tv_sec = ( int ) sec ; ts . tv_nsec = ( sec - ( ( int ) sec ) ) * 1000000000 ; nanosleep ( & ts , NULL ) ; } fracSleep ( 0.5 ) ; //Half second delay

Android Studio Logcat Not Showing Logs

Image
Answer : In my case in Android 2.2, for some reason, Firebase was selected by default in the dropdown box marked above. So logs didn't drop. I just needed to change it to No Filters . Then it worked. I even tried restarting the logcat, that didn't work too. No Filters did the magic. Hope this helps someone. Edit : You can as well select Show only selected application for logcat to show only the current debugging process, i.e your app. You may be hiding it, try pressing Alt + 6 to open Log tab. Look at the log level:- it must be verbose. Restart adb. If that doesn't works restart the android studio. In Logcat window reselect your device then reselect your app if it didn't appear restart adb using two commands: adb kill-server adb start-server Happy debugging :)

Fontawesome Icons Size Code Example

Example 1: change font awesome icon size <i class= "fas fa-camera fa-xs" ></i> <i class= "fas fa-camera fa-sm" ></i> <i class= "fas fa-camera fa-lg" ></i> <i class= "fas fa-camera fa-2x" ></i> <i class= "fas fa-camera fa-3x" ></i> <i class= "fas fa-camera fa-5x" ></i> <i class= "fas fa-camera fa-7x" ></i> <i class= "fas fa-camera fa-10x" ></i> Example 2: how to increase size of font awesome icon #elementID { font-size : 20 px ; } Example 3: font awesome size <span style= "font-size: 500px; color: Tomato;" > <i class= "fas fa-camera" ></i> </span> Example 4: how to change size of the font awsome Font Awsome Sizes

Cannot Find Module 'express' Node Code Example

Example 1: Error: Cannot find module 'express' You need to install Express locally into the context of your application (node_modules folder): $ npm install express Example 2: Cannot find module 'express' $ npm install express

Create Empty Array In Javascript Code Example

Example 1: javascript empty array var colors = ["red","blue","green"]; colors = []; //empty the array Example 2: javascript empty array arr = []; // set array=[] //function const empty = arr => arr.length = 0; //example var arr= [1,2,3,4,5]; empty(arr) // arr=[] Example 3: create empty array javascript const myArray1 = [] // or... const myArray2 = new Array() Example 4: how to make array empty A.length = 0 Example 5: javascript declare empty array // Variable array for a wider scope: var arrayName = []; // Local scope variable array: let arrayName = []; Example 6: empty array js let list = [1, 2, 3, 4]; function empty() { //empty your array list.length = 0; } empty();

C# In Vc Code Code Example

Example: how to run csharp in visual studio code /* You should have a application if you want to create a application go the folder which is your project now use the command in the dir use the command dotnet new console to intialize it as a console application. Now You will the a file called {You workspace}.csproj go to the file and run it */