This file contains hidden or 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
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
#include <cmath> | |
#include <cstdio> | |
using namespace std; | |
const int MAXM = 100000; | |
const int MAXFREE = MAXM / 2; |
This file contains hidden or 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
# Find a and b for y = ax + b, for known x and y (Least-squares function approximation) | |
x = [-2, -1, 1, 2, 3] #example | |
y = [-1.34, 0.94, 5.5, 7.78, 10.06] | |
sumxmulty = 0 | |
sumxsqu = 0 | |
sumx = 0 | |
sumy = 0 | |
n = len(x) |
This file contains hidden or 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
@Bean(name = DEFAULT_STREAMS_BUILDER_BEAN_NAME) | |
@Primary | |
public StreamsBuilderFactoryBean defaultKafkaStreamsBuilder(KafkaStreamsConfiguration kStreamsConfigs) { | |
return new DynamicStreamsBuilderFactoryBean(kStreamsConfigs); | |
} | |
public static class DynamicStreamsBuilderFactoryBean extends StreamsBuilderFactoryBean { | |
private StreamsBuilder instance; |
This file contains hidden or 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
<properties> | |
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | |
<maven.compiler.source>11</maven.compiler.source> | |
<maven.compiler.target>11</maven.compiler.target> | |
</properties> | |
<dependencies> | |
<dependency> | |
<groupId>org.springframework</groupId> | |
<artifactId>spring-context</artifactId> |
This file contains hidden or 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 org.apache.poi.hssf.usermodel.HSSFCellStyle; | |
import org.apache.poi.hssf.usermodel.HSSFFont; | |
import org.apache.poi.hssf.usermodel.HSSFSheet; | |
import org.apache.poi.hssf.usermodel.HSSFWorkbook; | |
import org.apache.poi.ss.usermodel.Cell; | |
import org.apache.poi.ss.usermodel.CellType; | |
import org.apache.poi.ss.usermodel.Row; | |
import java.io.File; | |
import java.io.FileOutputStream; |
This file contains hidden or 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
$i = 0; | |
while ($i <= 100) { | |
if ($i % 3 === 0 && $i % 5 === 0) { | |
echo "FizzBuzz <br>"; | |
} elseif ($i % 3 === 0) { | |
echo "Fizz <br>"; | |
} elseif ($i % 5 === 0) { | |
echo"Buzz <br>"; | |
} else { |
This file contains hidden or 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 x = () => { | |
for (let i = 1; i <= 100; i ++) { | |
if ( i % 3 === 0) { | |
if (i % 5 === 0) { | |
console.log("FizzBuzz"); | |
} else { | |
console.log("Fizz"); | |
} | |
} else if (i % 5 === 0) { | |
console.log("Buzz"); |
This file contains hidden or 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
<meta charset="UTF-8"> | |
<script> | |
"use strict"; | |
function vowelsAndConsonants(s) { | |
let vowel = ["a", "e", "i", "o", "u"]; | |
let arrVowel = []; | |
let arrConson = []; | |
for (let i = 0; i < s.length; i++) { | |
switch (s[i]) { |
This file contains hidden or 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
<meta charset="UTF-8"> | |
<script> | |
"use strict"; | |
function median(data) { | |
function compareNumbers(a, b) { | |
return a - b; | |
} | |
let arr = data.sort(compareNumbers); |
This file contains hidden or 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
<meta charset = "utf-8"> | |
<script> | |
"use strict"; | |
var x=0; | |
function my_function(n) { | |
if (n==1){ | |
return (x+1); | |
}else{ |