Posts

Showing posts from July, 2000

Text Font Border Css Code Example

Example 1: how to make border for letters in css h1 { /* 1 pixel black shadow to left, top, right and bottom */ text-shadow : -1 px 0 black , 0 1 px black , 1 px 0 black , 0 -1 px black ; font-family : sans ; color : yellow ; } Example 2: html font white text with black border h1 { color : yellow ; text-shadow : -1 px 0 black , 0 1 px black , 1 px 0 black , 0 -1 px black ; } <h1>Hello World</h1>

Responsive Text Bootstrap Code Example

Example 1: how to make fonts respnsive h1 { font-size : clamp ( 16 px , 5 vw , 34 px ) ; } Example 2: responsive text css /* Uses vh and vm with calc */ @media screen and ( min-width : 25 em ) { html { font-size : calc ( 16 px + ( 24 - 16 ) * ( 100 vw - 400 px ) / ( 800 - 400 ) ) ; } } /* Safari <8 and IE <11 */ @media screen and ( min-width : 25 em ) { html { font-size : calc ( 16 px + ( 24 - 16 ) * ( 100 vw - 400 px ) / ( 800 - 400 ) ) ; } } @media screen and ( min-width : 50 em ) { html { font-size : calc ( 16 px + ( 24 - 16 ) * ( 100 vw - 400 px ) / ( 800 - 400 ) ) ; } } Example 3: bootstrap 4 responsive paragraph <p class= "lead" > Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis , est non commodo luctus. </p>

C# Unity Velocity Code Example

Example: unity how to set rigidbody velocity Vector3 velocity = new Vector3 ( 10f /*x*/ , 10f /*y*/ , 10f /*z*/ ) ; GetComponent < Rigidbody > ( ) . velocity = velocity ;

Transform Rotate3d Css Code Example

Example: rotate 3d rotate3d ( x , y , z , a )

Conditional $sum In MongoDB

Answer : As Sammaye suggested, you need to use the $cond aggregation projection operator to do this: db.Sentiments.aggregate( { $project: { _id: 0, Company: 1, PosSentiment: {$cond: [{$gt: ['$Sentiment', 0]}, '$Sentiment', 0]}, NegSentiment: {$cond: [{$lt: ['$Sentiment', 0]}, '$Sentiment', 0]} }}, { $group: { _id: "$Company", SumPosSentiment: {$sum: '$PosSentiment'}, SumNegSentiment: {$sum: '$NegSentiment'} }}); Starting from version 3.4, we can use the $switch operator which allows logical condition processing in the $group stage. Of course we still need to use the $sum accumulator to return the sum. db.Sentiments.aggregate( [ { "$group": { "_id": "$Company", "SumPosSenti": { "$sum": { "$switch": {

Always Show Windows CPU Monitor Graphic In Taskbar

Image
Answer : I have three programs for you. All of them are free: 1. XMeters Taskbar appearance: Setting: So far I'm satisfied with this program. 2. RAM CPU (+DISK) Taskbar It turns your taskbar into a dynamic color-changing resource meter. 3. CleanMem Mini Monitor This one actually display a floating panel and an icon in the notification area rather than in taskbar. It also has more settings than the two above. you can start your pc up with task manager running minimized Right click your desktop and select New then shortcut Type in taskmgr and hit enter Hit enter again Right click the new shortcut and go to properties In the Run dropdown select "Minimized" Click Start and All Programs Find Startup and right click the folder and select Open Drag the new shortcut into that folder Now the taskmanager will always run - minimized - when the computer boots. The @Keltari solution looks good, but the 'Task Manager' icon is still displayed in th

Angular Material Datepicker: Change Event Not Firing When Selecting Date

Answer : There's a dateChange event that's raised both when the date is edited in the text box and when the date is changed via the calendar control. See here <mat-form-field> <input matInput [matDatepicker]="datepicker" required placeholder="Choose a date" (dateChange)="valueChanged()"> <mat-datepicker-toggle matSuffix [for]="datepicker"></mat-datepicker-toggle> <mat-datepicker #datepicker></mat-datepicker> </mat-form-field> Replace change with ngModelChange Change from <input mdInput [mdDatepicker]="datePicker" placeholder="Choose Date" name="date" [(ngModel)]="date" (change)="updateCalcs()" required> To <input mdInput [mdDatepicker]="datePicker" placeholder="Choose Date" name="date" [(ngModel)]="date" (ngModelCha

Android.permission.INTERNET In Android Manifest Code Example

Example 1: allow internet permission android //add to AndroidManifest.xml < uses-permission android: name = " android.permission.INTERNET " /> Example 2: internet permission android < uses-permission android: name = " android.permission.INTERNET " />

Accessing JPEG EXIF Rotation Data In JavaScript On The Client Side

Image
Answer : If you only want the orientation tag and nothing else and don't like to include another huge javascript library I wrote a little code that extracts the orientation tag as fast as possible (It uses DataView and readAsArrayBuffer which are available in IE10+, but you can write your own data reader for older browsers): function getOrientation(file, callback) { var reader = new FileReader(); reader.onload = function(e) { var view = new DataView(e.target.result); if (view.getUint16(0, false) != 0xFFD8) { return callback(-2); } var length = view.byteLength, offset = 2; while (offset < length) { if (view.getUint16(offset+2, false) <= 8) return callback(-1); var marker = view.getUint16(offset, false); offset += 2; if (marker == 0xFFE1) { if (view.getUint32(offset += 2, false) != 0x45786966) {

Cs Go S1mple Settings 2021 Code Example

Example: cs go s1mple settings 2021 cl_crosshairalpha 255; cl_crosshaircolor 5; cl_crosshairdot 0; cl_crosshairgap -2; cl_crosshairsize 3; cl_crosshairstyle 4; cl_crosshairusealpha 1; cl_crosshairthickness 1; cl_crosshair_drawoutline 0; cl_crosshair_sniper_width 1; cl_crosshaircolor_r 0; cl_crosshaircolor_g 255; cl_crosshaircolor_b 170;

Css Selector For Id Code Example

Example 1: css id selector #id{ color:red; } Example 2: how to call an id in css < style > #selector { color : red ; } /* # is id selector */ </ style > < div id = " selector " > < p > This is an id </ p > </ div > Example 3: css how to style id /*put a # infront of the id*/ /* < section id = " example " > </ section > */ #example{ margin: auto; } Example 4: css selectors * { color: pink; } h1, h2 {Select all h1 and h2} li a {select all anchor inside a list} h1 + p {select all p placed after an h1} div > li {all li directly in a div}

Transition Css W3s Code Example

Example: css transition transition : property duration timing-function delay|initial|inherit ;

Slick Slider Animation Effects Code Example

Example 1: slick slider CSS <link rel= "stylesheet" type= "text/css" href= "//cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.css" /> JS <script type= "text/javascript" src= "//cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.min.js" > </script > <script > $ ( ' #carousel ' ) .slick ( { infinite: true , slidesToShow: 3 , slidesToScroll: 1 , arrows: true , autoplay: true , autoplaySpeed: 2000 , responsive: [ { breakpoint: 1200 , settings: { slidesToShow : 2 , slidesToScroll : 1 } } , {

Css Unclickable Div Code Example

Example: make something unclickable css pointer-events : none ;

Comments In Matlab Code Example

Example 1: block of comments in matlab % { Commented code here . % } Example 2: matlab comments % single line comment % Example 3: matlab comment % This is a one - line comment % { This is a multi - line comment % }

Set Webkit Appearance None Js Code Example

Example: css appearance -webkit-appearance : value ; -moz-appearance : value ; appearance : value ;

Android Studio Is Using This JDK Location ... Which Is Different To What Gradle Uses By Default

Answer : Update For macOS only happens on macOS Mojave 10.14.6 . On macOS Catalina 10.15.3 , you only need to set JAVA_HOME in your shell. This answer deals with macOS cases. It doesn't imply Linux or Windows solutions. TLDR On macOS , Android Studio doesn't receive your environment variables defined in your .bash_profile when launched from Finder.app . You must define your environment variables in launchctl : launchctl setenv JAVA_HOME /path/to/my/project/specific/jdk or, if you want to use your system-defined JDK: launchctl setenv JAVA_HOME `/usr/libexec/java_home` But this only works for the current session of your machine. Next, you have to create a ~/Library/LaunchAgents/environment.plist file: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label<

Button Disabled'', False In JQuery Code Example

Example 1: jquery add disabled to button $ ( "#button" ) . attr ( "disabled" , true ) ; Example 2: jquery disable button function disable ( i ) { $ ( "#rbutton_" + i ) . prop ( "disabled" , true ) ; }

10th Gen Intel Core I5-10210u Vs Amd Ryzen 5 3500u Code Example

Example: ryzen 5 vs intel i5 10th gen AMD won by 1 point overall they all are dope

Converting Dot To Png In Python

Answer : Load the file with pydot.graph_from_dot_file to get a pydot.Dot class instance. Then write it to a PNG file with the write_png method. import pydot (graph,) = pydot.graph_from_dot_file('somefile.dot') graph.write_png('somefile.png') pydot needs the GraphViz binaries to be installed anyway, so if you've already generated your dot file you might as well just invoke dot directly yourself. For example: from subprocess import check_call check_call(['dot','-Tpng','InputFile.dot','-o','OutputFile.png']) You can use pygraphviz. Once you have a graph loaded, you can do graph.draw('file.png')

Business Logic In MVC

Answer : Fist of all: I believe that you are mixing up the MVC pattern and n-tier-based design principles. Using an MVC approach does not mean that you shouldn't layer your application. It might help if you see MVC more like an extension of the presentation layer. If you put non-presentation code inside the MVC pattern you might very soon end up in a complicated design. Therefore I would suggest that you put your business logic into a separate business layer. Just have a look at this: Wikipedia article about multitier architecture It says: Today, MVC and similar model-view-presenter (MVP) are Separation of Concerns design patterns that apply exclusively to the presentation layer of a larger system. Anyway ... when talking about an enterprise web application the calls from the UI to the business logic layer should be placed inside the (presentation) controller. That is because the controller actually handles the calls to a specific resource, queries the data by

Make Animation Loop Css Code Example

Example 1: css animation infinite loop div { animation-iteration-count : number|infinite|initial|inherit ; } Example 2: animation shorthand css animation : name time func delay iteration dir fill play ; animation : none 0 s ease 0 s 1 normal none running ; Example 3: css animation shorthand animation-name : none ; animation-duration : 0 s ; animation-timing-function : ease ; animation-delay : 0 s ; animation-iteration-count : 1 ; animation-direction : normal ; animation-fill-mode : none ; animation-play-state : running ;

Entity Framework Connection String In Code Code Example

Example 1: c# entity framework code first connection string < connectionStrings > < add name = "SchoolDB" connectionString = "Data Source=Your Server Name ;Initial Catalog=SchoolDB;Integrated Security=false ; user id =sa ; password =*** " providerName = "System.Data.SqlClient" / > < / connectionStrings > Example 2: entity framework connection string sql server The Data Source key is used to find the machine on which the Sql Server instance runs . You can have different strings for it but the most common used in a LAN environment is composed using the name of the server machine followed by an eventual instance name . So , if your local PC is named GURUBEAST - PC and , at install time , you haven't specified any instance name , the connectionstring Data Source contains only the name of the machine GURUBEAST - PC . If you have an instance name then you should add that instance name to you Data Sour

Bootstrap Rounded Buttons Code Example

Example 1: round button css .btn { display:block; height: 300px; width: 300px; border-radius: 50%; border: 1px solid red; } Example 2: button radius bootstrap 4 < span class = " border " > </ span > < span class = " border-top " > </ span > < span class = " border-right " > </ span > < span class = " border-bottom " > </ span > < span class = " border-left " > </ span >

Creating Multiple Pages With Navigation Menus HTML Code Example

Example 1: navbar multiple pages < script src = " //code.jquery.com/jquery.min.js " > </ script > < script > $ . get ( "navigation.html" , function ( data ) { $ ( "#nav-placeholder" ) . replaceWith ( data ) ; } ) ; </ script > Example 2: html multi page website < nav > < ul > < li > < a href = " # " > Navigation </ a > </ li > < li > < a href = " # " > Menu </ a > </ li > < li > < a href = " # " > Links </ a > </ li > </ ul > </ nav > Example 3: navbar multiple pages <! DOCTYPE html > < html > < head > < link rel = " stylesheet " href = " ./bootstrap-3.3.2-dist/css/bootstrap.min.css " > </ head > < body > < div class = " container " > < @wpbModule externalKey = " 9255b083-95a3-4752-