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 java.io.BufferedReader; | |
import java.io.FileReader; | |
import java.io.IOException; | |
import java.util.LinkedList; | |
import java.util.Stack; | |
import java.util.StringTokenizer; | |
class GeneratedGraph { | |
public boolean error = false; // eroare graf ciclic | |
public int n; // numar de noduri |
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
int main() { | |
grid = (int***)malloc(num_players * sizeof(int**)); | |
for (int i = 0; i < num_players; i++) { | |
grid[i] = (int**)calloc(num_lines, sizeof(int*)); | |
for (int j = 0; j < num_lines; j++) { | |
grid[i][j] = (int*)calloc(num_cols, sizeof(int)); | |
} | |
} | |
} |
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 http = require('http') | |
const port = 3000 | |
const requestHandler = (request, response) => { | |
console.log(request.url) | |
response.end("Running") | |
} | |
const server = http.createServer(requestHandler) |
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
Ctrl+Alt+F1 to open virtual console. | |
Ctrl+Alt+F7 to return to desktop. | |
uname -a = printeaza informatii despre sistem | |
inxi -Fxz = informatii despre drivere sistem | |
dmidecode = informatii RAM | |
grep MHz /proc/cpuinf = frecventa procesoare |
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
boolean checkBST(Node root) { | |
return checkHelper(root, Integer.MIN_VALUE, Integer.MAX_VALUE); | |
} | |
boolean checkHelper(Node node, int min_left, int max_right) { | |
if (node == null) { | |
return true; | |
} | |
if (node.data <= min_left || node.data >= max_right) { |
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
public class recursiveMethod { | |
// print something only once in a recursive method | |
public static int y = 0; | |
public static boolean recursiveMethod(int x) { | |
if (x > 4) { | |
return true; | |
} | |
Exception e = new Exception(); | |
e.fillInStackTrace(); | |
if (e.getStackTrace().length == 2) { |
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
suml [] = 0 | |
suml (x:xs) = x + suml xs |
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
sort [] = [] | |
sort [x] = [x] | |
sort (x:xs) = insert (sort xs) | |
where insert [] = [x] | |
insert (y:ys) | x <= y = x : y : ys | |
| otherwise = y : insert ys |
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
#include<stdio.h> | |
#include<limits.h> | |
int main(void) { | |
unsigned int x = 1; | |
int x2 = 1; | |
printf("unsigned: %u\n", x << 31); | |
printf("signed:(-1) %d\n", (x2 << 31) - 1); | |
printf("signed: %d\n", x2 << 31); |
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 numpy as np | |
from scipy.sparse import csr_matrix | |
from sklearn.base import BaseEstimator, TransformerMixin | |
class FeatureComputer(BaseEstimator, TransformerMixin): | |
def __init__(self, train_data): | |
self.data = train_data |
OlderNewer