Posts

Showing posts from April, 2000

Crontab Guru Every 5 Minutes Code Example

Example: crontab every 5 minutes */5 * * * *

Composer Ignore Requirements Code Example

Example 1: composer install ignore platform reqs composer install --ignore-platform-reqs Example 2: composer install package with specific version composer require PACKAGE_NAME "PACKAGE_VERSION"

Break / Stop Execution In UML Sequence Diagram Mid-way Inside Alt / Opt

Image
Answer : There are three options for this situation. Each of them I illustrate with a diagram showing how the respective combined fragment should be used. The actual behaviour is hidden with interaction references (normalFlow for a flow that should normally be executed and breakFlow for any flow that should happen in case of a required break). The first solution is the most convenient one - it exactly covers your case and you can also use the positive version of a break guard. However each of them provide you a valid possibility. Break combined fragment When a break combined fragment is met and its guard condition is true, only this fragment is still executed and then the execution of the interaction (flow) stops. If the condition is not met, the combined fragment is omitted and the normal flow continues. This is exactly the case you describe. In this case you would put the messages that shouldn't be executed in case of a break condition after the break combined fragment

Cache A Static File In Memory Forever On Nginx?

Image
Answer : Nginx as an HTTP server cannot do memory-caching of static files or pages. Nginx is a capable and mature HTTP and proxy server. But there seems to be some confusion about its capabilities with respect to caching. Nginx server cannot memory-cache files when running as a pure Web server. And…wait what!? Let me rephrase: Nginx HTTP server cannot memory-cache files or pages. Possible Workaround The Nginx community’s answer is: no problem, let the OS do memory caching for you! The OS is written by smart people (true) and knows the what, when, where, and how of caching (a mere opinion). So, they say, cat your static files to /dev/null periodically and just trust it to cache your stuff for you! For those who are wondering and pondering, what’s the cat /dev/null reference has to do with caching? Read on to find out more (hint: don’t do it!). How does it work? It turns out that Linux is a fine-tuned beast that’s hawk-eyed about what goes in and out of its cache thingy. Th

Online Youtube To Mp3 Y2mate Code Example

Example: yt to mp3 Youtube - DL works great . Download from https : //youtube-dl.org/. To use, type youtube-dl <url> --audio-format mp3

Cristiano Ronaldo Wiki Code Example

Example: cristiano ronaldo CR7 is the GOAT

Cannot Install Cocoapods - No Podfile Found In The Project Directory

Answer : Steps to add CocoaPods to manage dependencies in your project: sudo gem install cocoapods -> This installs CocoaPods as a piece of software on your machine. Go to the root of your project directory and execute pod init -> This will add a base Podfile to your project. Add the external dependencies that you have to this Podfile by editing it. Run pod install which will fetch all the external dependencies mentioned by you, and associate it with a .xcworkspace file of your project. This .xcworkspace file will be generated for you if you already do not have one. From here on, you should use .xcworkspace file instead of .xcproject / .xcodeproj . Example Podfile Syntax: target 'MyApp' do pod 'AFNetworking', '~> 3.0' end Where AFNetworking is the pod and 3.0 is the specific version that I want to install. Documentation: Using CocoaPods If you want to add a library from GitHub to your own project, after installing gems,

How To Build A Scss To Css Code Example

Example: watch scss to css sass --watch scss : css

On Button Hover CSS Code Example

Example 1: button css <a href="#" class="myButton" > green</a > .myButton { background-color : #44c767 ; border-radius : 28 px ; border : 1 px solid #18ab29 ; display : inline-block ; cursor : pointer ; color : #ffffff ; font-family : Arial ; font-size : 17 px ; padding : 16 px 31 px ; text-decoration : none ; text-shadow : 0 px 1 px 0 px #2f6627 ; } .myButton :hover { background-color : #5cbf2a ; } .myButton :active { position : relative ; top : 1 px ; } Example 2: button style css <div class= "pure-button-group" role= "group" aria-label= "..." > <button class= "pure-button" >A Pure Button</button> <button class= "pure-button" >A Pure Button</button> <button class= "pure-button pure-button-active" >A Pure Button</button> </div>

Copper Or Aluminum Heatsink?

Image
Answer : Copper has got better thermal conductivity. Aluminium - \$ \mathrm{ 200 \frac {W} {m\cdot K} } \$ Copper - \$ \mathrm{ 400 \frac {W} {m\cdot K} } \$ (from here, also here) But thermal conductivity within the solid material is only a part of the story. The rest of the story depends on where one wants to dump the heat into. Liquid coolant Copper heatsink (one may also call it heat transfer block) will perform better than aluminium. Air with forced convection In other words, there's a fan blowing onto the heatsink. Copper heatsink will perform better than aluminium. Air with natural convection I've saved best for last. It also looks like it's the O.P.'s case too. With natural convection air , the copper heatsink perform only marginally 1 better (in °C/W) than aluminium. This is because the bottleneck isn't in the transfer withing metal. When you have air with natural convection, the bottleneck is in the transfer between metal and air, and it's th

Can You Call Out To FFMPEG In A Firebase Cloud Function

Answer : ffmpeg is not preinstalled (pretty much just ImageMagick); to see exactly what's installed check out the Dockerfile here: https://github.com/GoogleCloudPlatform/nodejs-docker/blob/master/runtime-image/Dockerfile. However, you can upload arbitrary binaries when you upload your code using gcloud beta functions deploy because everything in the current directory (except node_modules ) is uploaded. Note: you only have disk write access at /tmp/ . Option 1: use ffmpeg-static npm module ffmpeg-static is an npm module that builds the correct ffmpeg binary based on the current system during npm install . Since Cloud Functions builds your code in the cloud, it'll build the correct ffmpeg binary. https://github.com/eugeneware/ffmpeg-static You can see it in action in the Cloud Functions for Firebase examples repo. const ffmpeg = require('fluent-ffmpeg'); const ffmpeg_static = require('ffmpeg-static'); var cmd = ffmpeg('/tmp/video.avi') .

C Program To Add Two Numbers Using Functions Code Example

Example 1: c program to add two numbers # include <stdio.h> int main ( ) { int number1 , number2 , sum ; printf ( "Enter two integers: " ) ; scanf ( "%d %d" , & number1 , & number2 ) ; // calculating sum sum = number1 + number2 ; printf ( "%d + %d = %d" , number1 , number2 , sum ) ; return 0 ; } Example 2: add 2 numbers in c # include <stdio.h> int main ( ) { int a , b , sum ; printf ( "\nEnter two no: " ) ; scanf ( "%d %d" , & a , & b ) ; sum = a + b ; printf ( "Sum : %d" , sum ) ; return ( 0 ) ;

Breakneck Speed Meaning Code Example

Example: breakneck speed meaning If you say that something happens or travels at breakneck speed, you mean that it happens or travels very fast.

Csgo Bind Jump To Mouse Wheel Code Example

Example 1: csgo mouse wheel jump bind bind mwheelup + jump ; bind mwheeldown + jump ; bind space + jump Example 2: bind mousewheel jump csgo bind "mwheelup" "+jump" ; bind "mwheeldown" "+jump" ;

Css For Middle Alignment Code Example

Example 1: css align center //HTML < div class = " parent " > < span > Hello World </ span > </ div > //CSS .parent { display: flex; justify-content: center; align-items: center; } Example 2: how to center div <!--center text--> <!--padding deals with margins within the element itself--> <!--margin deals with blank space surrounding and element--> <! DOCTYPE html > < html > < head > < style > .center { margin : auto ; width : 80 % ; border : 3 px solid #73AD21 ; padding : 10 px ; margin : 20 px ; } </ style > </ head > < body > < h2 > Center Align Elements </ h2 > < p > To horizontally center a block element (like div), use margin: auto; </ p > < div class = " center " > < p > < b > Note: </ b > Using margin:auto will not work in IE8, unless a !DOCTYPE is declared. </ p > </ div > </ body

How To Scroll Multiple Images In Html Code Example

Example: how to scroll multiple images in html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd" > <html> <head> <meta http-equiv= "Content-Type" content= "text/html; charset=UTF-8" > <title>Untitled Document</title> </head> <body> <div style= "width:750px; background-color:white; height:120px; overflow:scroll; overflow-x: scroll; overflow-y: hidden;" > <div style= "width:1000px;" > <img style= " float:left; display:inline" src= "images_news/image1.gif" width= "160" height= "90" alt= "bbc news special" /> <img style= " float:left; display:inline" src= "images_news/image1.gif" width= "160" height= "90" alt= "bbc news special" /> <img style= " float:left; di

What Does ^ Mean Js Code Example

Example 1: what does += mean in JavaScript /* JavaScript shorthand += += is shorthand to add something to a variable and store the result as that same variable. */ // The standard syntax: var myVar = 2 ; console . log ( myVar ) // 2 var myVar = myVar + 3 ; console . log ( myVar ) // 5 // The shorthand: var myVar = 2 ; console . log ( myVar ) // 2 var myVar += 3 ; console . log ( myVar ) // 5 /* In JavaScript, += can also concatenate strings */ // The standard syntax: var myName = "Hi, I'm" console . log ( myName ) // Hi, I'm var myName = myName + " Joe." console . log ( myName ) // Hi, I'm Joe. // The shorthand: var myName = "Hi, I'm" console . log ( myName ) // Hi, I'm var myName += " Joe." console . log ( myName ) // Hi, I'm Joe. Example 2: what does -= mean in JavaScript /* JavaScript shorthand -= -= is shorthand to subtract something from a variable and store the res

Conda Update Code Example

Example 1: update anaconda from cmd // to update anaconda conda update conda // to update all anaconda package conda update --all Example 2: conda update pytorch conda update pytorch torchvision -c pytorch Example 3: conda update package # Basic syntax: conda update packagename # To update specific package in the current env conda update --all # To update all packages in the current environment conda update -n myenv --all # To update all packages in myenv environment Example 4: update conda command conda update conda Example 5: How to update python using anaconda/conda # If want to update python type conda update python # To update anaconda type conda update anaconda # a) If you want to upgrade between major python version like 3.5 to 3.6, you'll have to do conda install python = $pythonversion $ # b) Method 2 - Create a new environment (Better Method) conda create --name py36 python = 3.6 # c) To get the absolute latest python(3.6.5 at time of writing) conda create --name py36

C++ Cout Does Not Name A Type Code Example

Example: cout does not name a type //Statements in C++ need to be inside of a function int main ( ) { std :: cout << "Hello World" << std :: endl ; //Works because we are inside of a function } std :: cout << "Hello World" << std :: endl ; //Doesn't work because we are not inside of a function