We want to prepare the perfect curry with ingredients P
, Q
, and R
.
"A"
is a zero-indexed array of N integers.
Elements of A
are integers within the range [−99,999,999 to 99,999,999]
The curry
is a string consisting of N characters such that each character is either P
, Q
, or R
and the
corresponding index of the array is the weight of each ingredient.
The curry is perfect if the sum of the total weights of P
, Q
, and R
is equal.
Write a function
function makeCurry(Array);
such that, given a zero-indexed array Array consisting of N integers, returns the perfect curry of this array.
The function should return the string "noLuck"
if no perfect curry exists for that Array.
Since Chrome apps are now being deprecated. Download postman from https://dl.pstmn.io/download/latest/linux
Although I highly recommend using a snap
sudo snap install postman
tar -xzf Postman-linux-x64-5.3.2.tar.gz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get the information of PHP | |
========================== | |
$ sudo apt show php | |
OR | |
$ sudo apt show php -a | |
$ sudo apt install php // this will install default php version ( may be 7.2 ) | |
T0 Install Different Versions Of PHP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Drop-in replacement for apache_request_headers() when it's not available | |
if ( ! function_exists( 'apache_request_headers' ) ) { | |
function apache_request_headers() { | |
static $arrHttpHeaders; | |
if ( ! $arrHttpHeaders ) { | |
// Based on: http://www.iana.org/assignments/message-headers/message-headers.xml#perm-headers | |
$arrCasedHeaders = array( |
type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install | |
# via http://askubuntu.com/questions/510056/how-to-install-google-chrome | |
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - | |
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' | |
sudo apt-get update | |
sudo apt-get install google-chrome-stable | |
# Update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= ssd cache setup= | |
I got a new pc with an SSD and a spinner disk. Having to decide exactly what I think I needed on the SSD was hard. Why not try using it as a caching device? | |
==Why use ssd caching?== | |
* Intel's "Smart Response Technology" on Windows 7 is awesome | |
* SSD wear can be reduced | |
* The ssd use can be optimized automagically | |
* No compromise on free space on ssd vs empty space on hdd | |
===What runs slow normally for me?=== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript | |
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Front Controller rewrite | |
RewriteEngine on | |
RewriteBase / | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^.*$ index.php [L,NC] | |
# Ensure we are using HTTPS | |
RewriteCond %{HTTPS} !on | |
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] |
NewerOlder