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
hello |
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 | |
namespace App\Helpers; | |
use Illuminate\Database\Eloquent\Collection as EloquentCollection; | |
use Illuminate\Database\Eloquent\Model; | |
use Illuminate\Support\Collection; | |
use Illuminate\Support\Str; | |
use stdClass; |
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
const tick = () => { | |
console.log(count); //logs new value | |
setCount((prevCount) => prevCount + 1); | |
}; | |
useEffect(() => { | |
const interval = setInterval(tick, 1000); | |
return () => { | |
clearInterval(interval); | |
}; |
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
const tick = () => { | |
console.log(count); //will log 0 forever | |
setCount((prevCount) => prevCount + 1); | |
}; | |
useEffect(() => { | |
const interval = setInterval(tick, 1000); | |
return () => { | |
clearInterval(interval); | |
}; |
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
import React, { useEffect, useState } from "react"; | |
export default function IntervalCounter() { | |
const [count, setCount] = useState(0); | |
const tick = () => { | |
console.log(count); | |
setCount(count + 1); | |
}; |
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
let i=0; while(i<=100){ setTimeout(function(){window.scrollTo(0,document.body.scrollHeight)}, i*500); ++i;} |
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
<html> | |
<body> | |
<button>Start Scan</button> | |
<video id="video" width="100%" height="100%" style="border: 1px solid gray"></video> | |
</body> | |
</html> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> | |
<script type="text/javascript" src="https://unpkg.com/@zxing/library@latest"></script> | |
<script> | |
let selectedDeviceId; |
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 | |
$bot_token = "980569822:AAGmatHbU5tMQoAN9hNNP5P3SGOqibfatVI"; // token by botfather | |
$bot_api_url = "https://api.telegram.org"; //api url to request | |
$request_updates_url = $bot_api_url."/bot".$bot_token."/getUpdates"; // final request url ( see telegram api documentation ) | |
$send_message_url = $bot_api_url."/bot".$bot_token."/sendMessage"; // method for sending message is sendMessage | |
/* | |
$request url now is : "https://api.telegram.org/bot980569822:AAGmatHbU5tMQoAN9hNNP5P3SGOqibfatVI/getUpdates" |
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
1 | |
Below is the process to reset the root user password, when we forgot the root user password or missed to recollect the password provided during installation. | |
OS - Ubuntu 16.04 | |
MySQL - 5.7 | |
Stop Mysql Server sudo /etc/init.d/mysql stop | |
To avoid the error, mysqld_safe Directory '/var/run/mysqld' for UNIX socket file don't exists , run below commands: sudo mkdir -p /var/run/mysqld |
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
//Post at : https://medium.com/code01/hamming-code-implementation-in-c-c16f3d038ba1 | |
#include <iostream> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <math.h> | |
using namespace std; | |
int | |
main () | |
{ |
NewerOlder