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
n = int(input('enter N: ')) | |
clauses = [] | |
clauses_count = 0 | |
i = 0 | |
while i < n * n: | |
row = [] | |
current_clauses = [] | |
for k in range(i, i + n): |
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
#![feature(fn_traits, unboxed_closures, tuple_trait)] | |
use std::marker::Tuple; | |
pub struct Once<F> { | |
f: Option<F>, | |
} | |
impl<Args: Tuple, F: FnOnce<Args, Output = ()>> FnMut<Args> for Once<F> { | |
extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output { | |
if let Some(f) = self.f.take() { |
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
using System; | |
class HelloWorld { | |
static int SumaCifara(int n) { | |
int s = 0; | |
while (n > 0) { | |
s += n % 10; | |
n /= 10; | |
} | |
return 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
import java.net.ServerSocket; | |
import java.net.Socket; | |
import java.util.Scanner; | |
import java.io.PrintWriter; | |
import java.io.IOException; | |
class Client { | |
public static void main(String[] args) throws IOException { | |
int host = 3000; | |
Socket socket = new Socket("localhost", 3000); |
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.net.ServerSocket; | |
import java.net.Socket; | |
import java.util.Scanner; | |
import java.io.PrintWriter; | |
import java.io.IOException; | |
class Server { | |
public static void main(String[] args) throws IOException { | |
int host = 3000; | |
ServerSocket serverSocket = new ServerSocket(host); |
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 { useState } from 'react' | |
import './App.css' | |
import dune from './assets/dune.png' | |
import road from './assets/road.png' | |
import water from './assets/water.png' | |
import draza from './assets/draza.png' | |
const images = { | |
0: dune, | |
1: road, |
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 Foundation | |
let ime: String = "Vahid" | |
let br: Int = 4 | |
let brojevi: [Int] = [1, 2, 3] | |
let ocene: [String: Int] = ["Vahid": 8, "Amar": 9] | |
let broj = brojevi[1] | |
print(broj) |
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
-- semafor | |
-- A ---> B ---> C | |
-- ^ | | |
-- | | | |
-- +-------------+ | |
library IEEE; | |
use IEEE.std_logic_1164.all; |
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
-- Code your design here | |
library IEEE; | |
use IEEE.std_logic_1164.all; | |
-- multiplekser 4/1 | |
entity mux is | |
port ( | |
I: in std_logic_vector(3 downto 0); | |
S: in std_logic_vector(1 downto 0); |
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
main = do | |
content <- getLine | |
print $ calculate content | |
calculate :: String -> Float | |
calculate = head . foldl f [] . words | |
f :: [Float] -> String -> [Float] | |
f (x:y:rest) "+" = (x + y):rest | |
f (x:y:rest) "-" = (y - x):rest |
NewerOlder