vendredi 31 décembre 2021

fabricJS - How to determine whether the mouse is on the path




jeudi 30 décembre 2021

Split 1 day array into 2 days array

I have an array like this and I want to split this into 2 arrays with the same date.

 array (size=2)
   'dates' => string '2021-10-20' (length=10)
   'hours' => 
     array (size=2)
       0 => 
         array (size=12)
           0 => string '07:30' (length=5)
           1 => string '08:00' (length=5)
           2 => string '08:30' (length=5)
           3 => string '09:00' (length=5)
           4 => string '09:30' (length=5)
           5 => string '10:00' (length=5)
           6 => string '10:30' (length=5)
           7 => string '11:00' (length=5)
           8 => string '11:30' (length=5)
           9 => string '12:00' (length=5)
           10 => string '12:30' (length=5)
           11 => string '13:00' (length=5)
       1 => 
         array (size=4)
           0 => string '15:30' (length=5)
           1 => string '16:00' (length=5)
           2 => string '16:30' (length=5)
           3 => string '17:00' (length=5)

I want to make 2 arrays with the same date, and it looks like this:

 0 =>
   'dates' => string '2021-10-20'
   'hours' => 
     array (size=1)
       0 => 
         array (size=12)
           0 => string '07:30' (length=5)
           1 => string '08:00' (length=5)
           2 => string '08:30' (length=5)
           3 => string '09:00' (length=5)
           4 => string '09:30' (length=5)
           5 => string '10:00' (length=5)
           6 => string '10:30' (length=5)
           7 => string '11:00' (length=5)
           8 => string '11:30' (length=5)
           9 => string '12:00' (length=5)
           10 => string '12:30' (length=5)
           11 => string '13:00' (length=5)
 1 =>
   'dates' => string '2021-10-20'
   'hours' => 
     array (size=1)
       0 => 
         array (size=4)
           0 => string '15:30' (length=5)
           1 => string '16:00' (length=5)
           2 => string '16:30' (length=5)
           3 => string '17:00' (length=5)

How to make this happen? and my code looks like this, i tried to add variable for dates but its not works. And sometimes just showing last arrays. Help me to split an array into 2 different arrays. Here is my code

if ($cekWaktuDosen4->num_rows == 0) {
    $timesDosen4[$i]['dates'] = $dates;
    $timesDosen4[$i]['hours'] = Array
    (
        (0) => Array
            (
                0 => '07:30',
                1 => '08:00',
                2 => '08:30',
                3 => '09:00',
                4 => '09:30',
                5 => '10:00',
                6 => '10:30',
                7 => '11:00',
                8 => '11:30',
                9 => '12:00',
                10 => '12:30',
                11 => '13:00',
                12 => '13:30',
                13 => '14:00',
                14 => '14:30',
                15 => '15:00',
                16 => '15:30',
                17 => '16:00',
                18 => '16:30',
                19 => '17:00'
            )
    );
}else {
    $y = 0;
    while ($k = $cekWaktuDosen4->fetch_object()) {
        $tglMulaiDosen4 = $carbon->create($carbon->parse($k->tanggal_mulai)->format('Y-m-d'));
        $tglSelesaiDosen4 = $carbon->create($carbon->parse($k->tanggal_selesai)->format('Y-m-d'));
        $tglBantuMulai4 = $tglMulaiDosen4->addHours(7)->addMinutes(30);
        $tglBantuSelesai4 = $tglSelesaiDosen4->addHours(17);
        if($tglBantuMulai4 < $k->tanggal_mulai) {
            $timesDosen4[$i]['dates'] = $tglMulaiDosen4->format('Y-m-d');
            $timesDosen4[$i]['hours'][$y] = create_time_range($tglBantuMulai4->format('H:i'), rounddown_timestamp($carbon->parse($k->tanggal_mulai)->format('H:i')));
            $y++;
            if($k->tanggal_selesai < $tglBantuSelesai4) {
                $timesDosen4[$i]['hours'][$y] = create_time_range(roundup_timestamp($carbon->parse($k->tanggal_selesai)->format('H:i')), $tglBantuSelesai4->format('H:i'));
            }
        }else if($tglBantuMulai4 == $k->tanggal_mulai && $tglBantuSelesai4 != $k->tanggal_selesai) {
            $timesDosen4[$i]['dates'] = $tglMulaiDosen4->format('Y-m-d');
            $timesDosen4[$i]['hours'][$y] = create_time_range(roundup_timestamp($carbon->parse($k->tanggal_selesai)->format('H:i')), $tglBantuSelesai4->format('H:i'));
        }
    }
}



Can I have any way (such as an API) to count the like and react on my post in my page and use that count to store in my database to use it?

I want to create a post in my website and post/share it in my Facebook page. This can be live/video/image etc. The amount likes and reaction my post get in Facebook will need to be fetched and stored in my post related database of my website.

  • Is it somehow possible to do?
  • If it is possible then what tools or guideline I need to follow?



Problem when play youtube vidéos on my website (payback id ) [closed]

I share some videos in my website from a channel on youtube ( with permissions from admin ) but since 3 weeks is not possible to read some videos but some working .. ( for these not working i get an payback id problem .. Someone can help me ? have a nice day




Any recommendations for a good page translator plugin?

I'm looking for a translator plugin for my website that is free, easy to install, effective and does not have a watermark. Please tell me if you know of any plugins that fit the description.




mercredi 29 décembre 2021

How to solve elementor plugging

My sir My website is automatically change when I am installing elementor plugging...my website automatically change civil construction company when I am installing elementor plugging... please resolve my problem




How do I target the folder I want to deploy my web JS app in with Azure Pipelines?

I am really new to Azure DevOps especially when it comes to YAML pipelines.

I am developing a website split between backend and frontend. The backend part is already developed and deployed on my linux server.

Now I want to deploy the frontend part (Vue JS) using YAML pipelines. The thing is I dont want the frontend part to be deployed in the same folder of the backend.

I know that the pipeline script "npm run build" creates a "dist" folder, so how can I force my azure pipelines to deploy the "dist" folder into a specific folder (let's say this specific folder is a subdirectory of "wwwroot" so it would be something like "wwwroot/subfolder/dist")

enter image description here

Thank you for all your help !