Results: 1578
Notes
  • Newest first
  • Oldest first
  • Newest first(All)
  • Oldest first(All)
Make an object from a string
function mapString(string) {
  let map = {};
  for (let i = 0; i < string.length; i++) {
    let letter = string[i];
    if (map[letter]) {
      map[letter].push(i);
    } else {
      map[letter] = [i];
    }
  }
  return map;
}
console.log(mapString('blblllaaha'))
by Valeri Tandilashvili
3 years ago
0
JavaScript
objects
0
create a .gitignore file inside that directory that contains these four lines
# Ignore everything in this directory
*
# Except this file
!.gitignore
by Luka Tatarishvili
3 years ago
0
0
IMPORTS:
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;
import java.util.TimeZone;
 
Scanner scan = new Scanner(System.in);
        System.out.print("");

        int num = scan.nextInt();
        scan.close();

        TimeZone tz = TimeZone.getTimeZone("UTC");
            SimpleDateFormat df = new SimpleDateFormat("HH:mm:ss");
        df.setTimeZone(tz);
        String time = df.format(new Date(num * 1000));
        System.out.println(time);
by Luka Tatarishvili
3 years ago
0
JAVA
0
1:
sudo apt update
2:
sudo apt -y upgrade
3:
sudo systemctl reboot
maybe this fails but not problem Add Ondřej Surý PPA repository: 4.1
sudo apt update
4.2
sudo apt install lsb-release ca-certificates apt-transport-https software-properties-common -y
4.3
sudo add-apt-repository ppa:ondrej/php
5:
sudo apt update
install PHP 8.1 6:
sudo apt install php8.1
Hit the y key to start installation Check for the current version of PHP 7:
php -v
by Luka Tatarishvili
3 years ago
0
PHP
20.04
ubuntu
0
by Luka Tatarishvili
3 years ago
0
PHP
20.04
22.04
ubuntu
0
sudo npm install --unsafe-perm=true --allow-root
by Luka Tatarishvili
3 years ago
0
0
in_array for Multidimensional array
foreach($taxonomy_tree as $item){

                   $taxonomy_item_family = (json_encode($item));

                    $string = '"id":"1"';

                   if (str_contains($taxonomy_item_family, $string)) {
                        dd($item);
                    }


                }
by Giorgi Ivanidze
3 years ago
0
PHP
array
0
Laravel could not read .env file
Solution to the problem:
composer dump-autoload
php artisan cache:clear
php artisan config:clear
php artisan view:clear
by Valeri Tandilashvili
3 years ago
0
Laravel
artisan
0
Variables are used to store data, like string of text, numbers, etc. Variable values can change over the course of a script. Here're some important things to know about variables: 1. In PHP, a variable does not need to be declared before adding a value to it. PHP automatically converts the variable to the correct data type, depending on its value. 2. After declaring a variable it can be reused throughout the code. The assignment operator (=) used to assign value to a variable. Naming Conventions for PHP Variables These are the following rules for naming a PHP variable: All variables in PHP start with a $ sign, followed by the name of the variable. A variable name must start with a letter or the underscore character _. A variable name cannot start with a number. A variable name in PHP can only contain alpha-numeric characters and underscores (A-z, 0-9, and _). A variable name cannot contain spaces.
by Gigi Butchvelashvili
3 years ago
0
PHP
Variable
0
Line1
Hello world, This is sample text
Line2
Hello, world What's going On
We want to search string that contains:
world & going
words VISUAL STUDIO Example:
STEP 1: Press CTRL + F (Open find dialog)
STEP 2: Press ALT + R (Use Regular expression)
STEP 3: Write 
world(.*)going
in the search field
The search result will be:
Hello, 
world
What's
going
On
because it contains the same time words "world" and "going"
by Luka Tatarishvili
3 years ago
0
0
Results: 1578