The response is not a valid JSON response.

The file is too big
You need to compress/export the file in a lighter weight
such as



The response is not a valid JSON response.
You need to compress/export the file in a lighter weight
such as
If you’re connecting multiple displays to your Mac, use the Tech Specs page to find out how many external displays your Mac supports.
Illuminate\Database\QueryException
SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at end of input LINE 1: SET search_path TO ^ (SQL: SET search_path TO )
solution add to config/database.php
'default' => env('DB_CONNECTION', 'pgsql-raleche'),
'search_path' => 'mapi_admin_tool,api,product,public,trade,ws,eddm',
Failed to download laravel/nova from dist: The 'https://nova.laravel.com/dist/laravel/nova/laravel-nova-0a8ec5b37dc3ca29f4b79c7318c9278e5a5d2c1a-zip-7e4351.zip' URL could not be accessed: HTTP/2 403
composer config http-basic.nova.laravel.com [email protected] NovaHasspassword
{"username":"[email protected]","password":"asdsadasdqweqwerewrew”}
As of March 20th 2022, https://github.com/GrahamCampbell updated the following library guzzlehttp/psr7
so in your unit test you will see errors as follow
InvalidArgumentException: "Unprocessable Entity" is not valid header name
InvalidArgumentException: "409 conflict with the current state of the target resource" is not valid header name
InvalidArgumentException: "Not Found" is not valid header name
InvalidArgumentException: "Not Acceptable" is not valid header name
InvalidArgumentException: "Not Found" is not valid header name
InvalidArgumentException: "Bad Request" is not valid header name
InvalidArgumentException: "409 conflict with the current state of the target resource" is not valid header name
InvalidArgumentException: "500 Internal Server Error" is not valid header name
The version 1.8.5 was breaking our set of unit test
Solution is to update composer.json and use this version below
"guzzlehttp/psr7": "1.8.3",
https://github.com/guzzle/psr7/blob/2.2.1/CHANGELOG.md
class Solution {
public function palindrome2 (string $s) : bool {
#aba - true
#abca -
#abc -
$n = strlen($s); #4
$p1 = 0;
$p2 = $n - 1 ; #3
$mid = floor(($n - 1) / 2); #1
$charRemoved = false;
while($p1 < $mid || $p2 > $mid)
{
# p1:1 < mid:1 OR
# p2:2 > mid:1
if ($s[$p1] == $s[$p2]) {
$p1++; #1
$p2--; #1
continue;
}
if($s[$p1+1] == $s[$p2] && $charRemoved ==false) {
$p1 = $p1 + 1;
$charRemoved = true;
continue;
} else if ($s[$p1+1] == $s[$p2] && $charRemoved == true) {
return false;
}
if($s[$p2-1] == $s[$p1] && $charRemoved ==false) {
$p2 = $p2 - 1;
$charRemoved = true;
continue;
} else if ($s[$p2-1] == $s[$p1] && $charRemoved == true) {
return false;
}
if(($s[$p1] != $s[$p2]) && ($p1 + 1 == $mid || $p2 - 1 == $mid) ) {
return false;
}
}
if($s[$p1] != $s[$p2] && (($n % 2) == 0)) {
return true;
}
return true;
}
}
$res = new Solution();
var_dump($res->palindrome2('abbca'));
Steps to delete qa branch
git branch -d dev
git push origin origin/dev
git push origin --delete origin/dev
class Solution {
public function screenFitting($rows, $cols, $sentence)
{
# intiialization
$numberWords = count($sentence);
$wordIndex = 0;
$c = 0;
$r = 0;
# loop foreach row
while($r < $rows && $c < $cols) {
$wordLength = strlen($sentence[$wordIndex]); # 5 {hello} ; 5 {world}
if(($c + $wordLength) < $cols) { # 5 < 7 ; !! 11 < 7 ; 5 < 7; !! 11 < 7
$c += $wordLength; # 5 ; 7
$hashmap[$sentence[$wordIndex]] += 1;
$wordIndex++; #1
var_dump($hashmap);
} else {
$r++; #1
$c = 0;
continue;
}
$c++; # 6
if($wordIndex === $numberWords) {
$wordIndex = 0;
}
}
return min($hashmap);
}
}
$rows = 2;
$cols = 7;
$sentence = ['hello', 'world'];
$sentence = ["i","had","apple","pie"];
$rows = 4;
$cols = 15;
$solution = new Solution();
$res = $solution->screenFitting($rows, $cols, $sentence);
var_dump($res);
Simplified solution
$s = ["hello", "world"];
$cols = 7;
$rows = 6;
$col = 0;
$row = 0;
$i = 0;
$count = 0;;
while($row < $rows)
{
while($col < $cols)
{
$col = $col + strlen($s[$i]);
if($col < $cols) {
continue;
}
$i++;
if($i == 2) {
$i = 0;
$count++;
}
}
$col = 0;
$row++;
}
print $count;
class Solution {
public $gridNumberRows;
public $gridNumberCols;
public $grid;
public function __construct()
{
}
public function maxConnectedColorValue(array $grid) : int
{
$this->grid = $grid;
print $this->gridNumberRows = count($grid);
$countCol = 0;
foreach ($grid[0] as $col)
{
$countCol++;
}
print "\n\r";
print $this->gridNumberCols = $countCol;
# visted cells to false
for($r = 0; $r < $this->gridNumberRows ; $r++) {
for($c = 0; $c < $this->gridNumberCols ; $c++) {
$visited[$r][$c] = false;
}
}
$hashmapColor = [];
for($row = 0; $row < $this->gridNumberRows ; $row++) {
for($col = 0; $col < $this->gridNumberCols ; $col++) {
if($visited[$row][$col] === true) {
continue;
}
if($grid[$row][$col] === ''){
$visited[$row][$col] = true;
continue;
}
$cellColor= $grid[$row][$col];
$visited[$row][$col] = true;
if(!array_key_exists($cellColor, $hashmapColor)) {
$hashmapColor[$cellColor] = 1;
}
$this->dfs($row, $col, $visited, $hashmapColor);
}
}
var_dump($hashmapColor);
return max($hashmapColor);
}
public function dfs($r, $c, &$visited, &$hashmapColor)
{
$cellColor = $this->grid[$r][$c];
if($cellColor == '')
return;
# structure [R,C]
$neighborInstruction = [[-1,0],[0,1],[1,0],[0,1]];
foreach ($neighborInstruction as $neighbor)
{
$neighborRow = $neighbor[0];
$neighborCol = $neighbor[1];
#if whithin boundaries
if(((($neighborRow + $r) >= 0) && ($neighborRow + $r) < $this->gridNumberRows)
&& ($neighborCol + $r) >= 0 && ($neighborCol + $r) < $this->gridNumberCols)
{
# check same color
if($this->grid[$neighborRow + $r][$neighborCol + $c] === $this->grid[$r][$c]
&& $visited[$neighborRow + $r][$neighborCol + $c] === false) {
if (array_key_exists($cellColor, $hashmapColor)) {
$hashmapColor[$cellColor] += 1;
}
$visited[$r][$c] = true;
$this->dfs($neighborRow + $r, $neighborCol + $c, $visited, $hashmapColor);
}
}
}
}
}
$grid = [
['','r','b',''],
['','b','b','b'],
['','','b','']];
$solution = new Solution();
$res = $solution->maxConnectedColorValue($grid);
var_dump($res);