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 () | |
{ |
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
.MODEL TINY ; ADD TWO ARRAYS | |
.CODE | |
.386 | |
.STARTUP | |
.DATA | |
ARRAY1 DB 30H,31H,32H,33H,34H,35H,36H,37H,39H,40H,41H | |
ARRAY2 DB 15H,14H,13H,12H,11H,10H,9H,8H,7H,6H,5H,4H | |
.CODE | |
MOV SI, OFFSET ARRAY1 | |
MOV DI, OFFSET ARRAY2 |
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" |
NewerOlder