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, { useState, useEffect } from 'react'; | |
/* Custom hook */ | |
function useAPIFetch(apiURL) { | |
const [loading, setLoading] = useState(true); | |
const [data, setData] = useState(null); | |
function fetchData() { | |
setLoading(true); | |
fetch(apiURL) |
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
// In this implementation it is assumed that grid is always 9x9 | |
function sudoku2(grid) { | |
// check rows | |
for(let row = 0; row < grid.length; row++) { | |
const numbersMap = new Set(); | |
for(let column = 0; column < grid[row].length; column++) { | |
if(grid[row][column] === ".") continue; | |
if (numbersMap.has(grid[row][column])) { | |
return false; | |
} else { |
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
from numpy import unique | |
from numpy import where | |
from matplotlib import pyplot | |
from sklearn.datasets import make_classification | |
from sklearn.cluster import KMeans | |
if __name__ == '__main__': | |
# initialize the data set we'll work with | |
training_data, _ = make_classification( | |
n_samples=2000, |
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
package hello; | |
import org.springframework.web.bind.annotation.*; | |
import java.util.Map; | |
import java.util.concurrent.atomic.AtomicLong; | |
@RestController | |
public class GreetingController { | |
private static final String template = "Hello, %s!"; |
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
[mergetool] | |
prompt = false | |
keepBackup = false | |
keepTemporaries = false | |
[merge] | |
tool = winmerge | |
[mergetool "winmerge"] | |
name = WinMerge |
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
<!DOCTYPE html> | |
<html ng-app="app"> | |
<head> | |
<script src="https://code.jquery.com/jquery.min.js"></script> | |
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.22/angular.min.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/angular-filter/0.4.7/angular-filter.js"></script> | |
<meta name="description" content="GroupBy example using angular.filter"/> | |
<meta charset="utf-8"> |
NewerOlder