Posts

Showing posts from June, 2012

Scss Array Variables Code Example

Example: scss array In Sass < 3.3 you can use multidimensional lists : $ numbers : ( 3 "three" ) ( 4 "four" ) ; @each $i in $numbers { .# { nth ( $i , 2 ) } -# { nth ( $i , 1 ) } { /* CSS styles */ } } DEMO In Sass >= 3.3 we get maps : $ numbers : ( "3" : "three" , "4" : "four" ) ; @each $number , $i in $numbers { .# { $i } -# { $number } { /* CSS styles */ } } DEMO So in terms of fractions , you could just do something in this direction , so that you don't need multiple lists or maps : $ number : 6 ; $ name : ( ( "one" ) , ( "two" "halv" "halves" ) , ( "three" "third" "thirds" ) , ( "four" "quarter" "quarters" ) , ( "five" "fifth" "fifths" ) , ( "six" "sixth" "sixsths" )

2d Raycast From Mouse Code Example

Example: unity 2d raycast mouse // detect object that was clicked using raycast RaycastHit2D hit = Physics2D . Raycast ( Camera . main . ScreenToWorldPoint ( Input . mousePosition ) , Vector2 . zero ) ; if ( hit . collider != null ) { Debug . Log ( "Target name: " + hit . collider . name ) ; }

Alternatives To Debian Live For Persistent Debian System On USB

Answer : Alternatives to Debian Live for persistent Debian system on USB You can create a debian Live USB with persistence using the mkusb tool : How to install mkusb in Debian These methods are tested in Debian Wheezy. It contains an instruction to install the ppa 'manually'. There is also an alternative to download the file(s) and check the download manually. The mkusb is tested and work fine on debian jessie and debian Stretch . There is no dependencies problem. To install mkusb , add the following line to your /etc/apt/sources.list deb http://ppa.launchpad.net/mkusb/ppa/ubuntu xenial main Import the gpg key : apt-key adv --keyserver keyserver.ubuntu.com --recv 54B8C8AC Update and install mkusb : apt-get update apt-get install mkusb The command line tool is mkusb-nox (txt mode) , the GUI is mkusb . The are a few steps to create a Debian Live Persistent USB using the mkusb GUI : Download the Debian Live ISO from the official website. Run mkusb

Bulma Templates Code Example

Example 1: bulma npm install bulma Example 2: bulma starter template <! DOCTYPE html > < html > < head > < meta charset = " utf-8 " > < meta name = " viewport " content = " width=device-width, initial-scale=1 " > < title > Hello Bulma! </ title > < link rel = " stylesheet " href = " https://cdn.jsdelivr.net/npm/bulma@0.9.2/css/bulma.min.css " > </ head > < body > < section class = " section " > < div class = " container " > < h1 class = " title " > Hello World </ h1 > < p class = " subtitle " > My first website with < strong > Bulma </ strong > ! </ p > </ div > </ section > </ body > </ html > Example 3: bulma bower install bulma Example 4: bulma npm inst

Bootstrap Hide Class Code Example

Example 1: display sm none Hidden on all .d-none Hidden only on xs .d-none .d-sm-block Hidden only on sm .d-sm-none .d-md-block Hidden only on md .d-md-none .d-lg-block Hidden only on lg .d-lg-none .d-xl-block Hidden only on xl .d-xl-none Visible on all .d-block Visible only on xs .d-block .d-sm-none Visible only on sm .d-none .d-sm-block .d-md-none Visible only on md .d-none .d-md-block .d-lg-none Visible only on lg .d-none .d-lg-block .d-xl-none Visible only on xl .d-none .d-xl-block Example 2: bootstrap display inline block <div class= "d-inline-block" ></div> Example 3: visibility hidden bootstrap 4 <div class= "visible" >...</div> <div class= "invisible" >...</div> Example 4: how to hide display in bootstrap <!-- Bootstrap 4 --> <div class= "d-none" ></div> <!-- Bootstrap 3 --> <!-- <div class= "hidden- { screen size } "></div> --> <div cl

Composer Install Single Package Without Update Code Example

Example 1: composer remove packages composer remove vendor/package Example 2: composer update single package composer require phpmailer/phpmailer Example 3: composer update single package composer.phar update doctrine/doctrine-fixtures-bundle Example 4: install a package only composer dont update composer update new/package

Could Not Load File Or Assembly System.Runtime.CompilerServices.Unsafe

Answer : Could not load file or assembly System.Runtime.CompilerServices.Unsafe It seems that you have installed System.Runtime.CompilerServices.Unsafe nuget package 4.5.3 version. And it corresponds to System.Runtime.CompilerServices.Unsafe.dll assembly version 4.0.4.1 . Suggestion 1) Please try to register System.Runtime.CompilerServices.Unsafe version 4.0.4.1 into GAC so that the system can it. Run Developer Command Prompt for VS2019 as Administrator type: cd xxxxx (the path of the the System.Runtime.CompilerServices.Unsafe 4.0.4.1) gacutil /i System.Runtime.CompilerServices.Unsafe.dll 2) If you use Net Framework projects with xxx.config file, you could use bindingRedirect. Add these in app.config file or web.config file: <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe"

Composer Require Package Specific Version Code Example

Example 1: composer check package version composer show package/name Example 2: composer update php composer.phar update Example 3: composer require with version composer require vendor/package:version composer require refinery29/test-util:0.10.2

Clf Subplot Matlab Code Example

Example: clf subplot matlab h1 = subplot ( 2 , 1 , 1 ) ; hold on x1 = ( 0 : 0.01 : 10 ) ; y1 = sin ( x1 ) ; p1 = plot ( x1 , y1 ) ; h2 = subplot ( 2 , 1 , 2 ) hold on x1 = ( 0 : 0.01 : 10 ) ; y2 = sin ( x1 ) + cos ( x1 ) ; p2 = plot ( x1 , y2 , 'Color ',' r' ) ; cla ( h2 ) cla ( h1 )

Convert String To Clob In Java

Answer : Those who are still looking for an alternate answer, a Clob object could be created without the need for a connection object as shown below. Clob myClob = new javax.sql.rowset.serial.SerialClob(stringData.toCharArray()); Throws warning: Clob not initialized. You need an OracleConnection to create a Clob, using the Oracle Database. OracleConnection conn; // initialize this first Clob myClob = conn.createClob(); private OracleConnection conn = null; public void setConnection( OracleConnection conn ) { this.conn = conn; } void setClob( String cookie ) throws SQLException { Clob myClob = conn.createClob(); myClob.setString( 1, cookie); } Try this : OracleConnection conn; // initialize this first CLOB clob = conn.createClob(); public Clob getClob(String data){ return clob.setString(position, data); }

401 Unauthorized Vs 403 Forbidden: Which Is The Right Status Code For When The User Has Not Logged In?

Answer : The exact satisfying one-time-for-all answer I found is: Short answer: 401 Unauthorized Description: While we know first is authentication (has the user logged-in or not?) and then we will go into authorization (does he have the needed privilege or not?), but here's the key that makes us mistake: But isn’t “401 Unauthorized” about authorization, not authentication? Back when the HTTP spec (RFC 2616) was written, the two words may not have been as widely understood to be distinct. It’s clear from the description and other supporting texts that 401 is about authentication. From HTTP Status Codes 401 Unauthorized and 403 Forbidden for Authentication and Authorization (and OAuth). So maybe, if we want to rewrite the standards! focusing enough on each words, we may refer to the following table: Status Code | Old foggy naming | New clear naming | Use case +++++++++++ | ++++++++++++++++ | ++++++++++++++++ | ++++++++++++++++++++++++++++++++++ 401 | Unaut

Border: InputBorder Properties Flutter Code Example

Example: input border flutter TextField ( decoration : new InputDecoration ( focusedBorder : OutlineInputBorder ( borderSide : BorderSide ( color : Colors . greenAccent , width : 5.0 ) , ) , enabledBorder : OutlineInputBorder ( borderSide : BorderSide ( color : Colors . red , width : 5.0 ) , ) , hintText : 'Mobile Number' , ) , ) ,

A Man Is Known To Speak Truth 3 Out Of 4 Times. He Throws A Die And Reports That It Is A Six. Find The Probability That It Is Actually A Six.

Answer : The difference in solutions comes in the estimation of the probability that the man reports six when six has not occurred. If the man randomly chooses a number to report when he lies (which seems like a reasonable statement), then the probability he chooses 6 is 1/5. If you multiply your calculation of P(E|S2) by this, you get your teacher's solution.

Could Not Find A Version That Satisfies The Requirement Django (from Versions: None) Code Example

Example: pip error could not find a version that satisfies the requirement $ curl https://pypi.org The requestors Network has been blacklisted due to excessive request volume. If you are a hosting customer, please contact your hosting company's support. If you are the hosting company, please contact infrastructure-staff@python.org to resolve

Android Developer Blog Code Example

Example: blogs: android development This is test

Js Hasclass Code Example

Example 1: javascript check if element has class if ( document .getElementById ( "myElmentID" ) .classList .contains ( "hidden" ) ) { // I have the 'hidden' class } Example 2: javascript hasclass if ( document .body .classList .contains ( 'thatClass' ) ) { // do some stuff } Example 3: javascript hass class if ( myElement .classList .contains ( 'someClassname' ) ) { // do something } Example 4: query selector has clas document.body.classList. add ( 'thisClass' ) ; // $ ( 'body' ) . addClass ( 'thisClass' ) ; document.body.classList. remove ( 'thatClass' ) ; // $ ( 'body' ) . removeClass ( 'thatClass' ) ; document.body.classList. toggle ( 'anotherClass' ) ; // $ ( 'body' ) . toggleClass ( 'anotherClass' ) ; Example 5: how to check has class name in js? element.classList. contains ( className ) ; Code language : CSS ( css ) Example 6: jquery select input valu

2d Animation Script Unity Code Example

Example: unity animation 2d c# using UnityEngine ; using System . Collections ; public class ExampleClass : MonoBehaviour { public Animation anim ; void Start ( ) { anim = GetComponent < Animation > ( ) ; foreach ( AnimationState state in anim ) { state . speed = 0.5F ; } } }

Css Transition Opacity To 1 Code Example

Example 1: css transition opacity /* Answer to: "css transition opacity" */ /* CSS transitions allows you to change property values smoothly, over a given duration. */ .myClass { vertical-align : top ; transition : opacity 0.3 s ; /* Transition should take 0.3s */ -webkit-transition : opacity 0.3 s ; /* Transition should take 0.3s */ opacity : 1 ; /* Set opacity to 1 */ } .myClass :hover { opacity : 0.5 ; /* On hover, set opacity to 2 */ } /* From `opacity: 1;` to `opacity: 0.5;`, the transition time should take 0.3 seconds as soon as the client starts to hover over the element. */ Example 2: css opacity transition div { transition : opacity seconds ; }

Instagram Gradient Color Code Css Code Example

Example: linear gradient instagram background : #f09433 ; background : -moz-linear-gradient ( 45 deg , #f09433 0 % , #e6683c 25 % , #dc2743 50 % , #cc2366 75 % , #bc1888 100 % ) ; background : -webkit-linear-gradient ( 45 deg , #f09433 0 % , #e6683c 25 % , #dc2743 50 % , #cc2366 75 % , #bc1888 100 % ) ; background : linear-gradient ( 45 deg , #f09433 0 % , #e6683c 25 % , #dc2743 50 % , #cc2366 75 % , #bc1888 100 % ) ; filter : progid : DXImageTransform.Microsoft. gradient ( startColorstr= '#f09433' , endColorstr= '#bc1888' , GradientType= 1 ) ;

Cannot Change Primary Key Because Of "incorrectly Formed Foreign Key Constraint" Error

Answer : The error Error on rename of ... errno: 150 - Foreign key constraint is incorrectly formed) happens because you are trying to drop a referenced primary key, even though you are disabling foreign key constraint checking with SET FOREIGN_KEY_CHECKS=0; Disabling foreign key checks would allow you to temporarily delete a row in the currency table or add an invalid currencyId in the foreign key tables, but not to drop the primary key. Changing a PRIMARY KEY which is already referenced by other tables isn't going to be simple, since you risk losing referential integrity between the tables and losing the relationship between data. In order to preserve the data, you'll need a process such as: Add a new Foreign key column ( code ) to each FK table Map the code foreign key from the previous currencyId via an update Drop the existing foreign key Drop the old currencyId foreign key column Once all FK's have been dropped, change the primary key on the