-
Prefer
snake_case
for the names of function arguments, inductive datatypes, definitions, and lemmas. -
Prefer
CamelCase
for the names of hypothesis, variables inside sections, modules, and sections.
Module Foo.
store atomic i32 1, ptr %ptr, seq_cst, align 4 | |
store atomic i32 2, ptr %ptr, release, align 4 | |
store atomic i32 3, ptr %ptr, monotonic, align 4 | |
store atomic i32 4, ptr %ptr, unordered, align 4 | |
store i32 5, ptr %ptr, align 4 ;; NotAtomic | |
... | |
%r1 = load atomic i32, ptr %ptr, seq_cst, align 4 | |
%r2 = load atomic i32, ptr %ptr, release, align 4 | |
%r3 = load atomic i32, ptr %ptr, monotonic, align 4 | |
%r4 = load atomic i32, ptr %ptr, unordered, align 4 |
package org.example; | |
import java.lang.invoke.MethodHandles; | |
import java.lang.invoke.VarHandle; | |
import java.util.concurrent.atomic.AtomicInteger; | |
public class Main { | |
static class Holder { | |
public volatile int atomic = 0; |
; to build the demo type | |
; 1) `opam install dune` | |
; 2) `dune exec ./main.exe` | |
(executable | |
(name main) | |
(flags (:standard -rectypes -warn-error -A -w -K-9-27)) | |
) |
.PHONY: all pbe clean | |
all: pbe | |
clean: | |
rm pbe *.cmi *.cmx *.o | |
pbe: | |
ocamlfind opt -g -rectypes -syntax camlp5o -package ocanren,ocanren.syntax -linkpkg -o pbe pbe.ml |
def fuck(n): | |
A = [0] * (n+1) | |
B = [-1] * (n+1) | |
for i in range(2, n+1): | |
A[i] = A[i - 1] | |
B[i] = i-1 | |
if i % 2 == 0 and A[int(i / 2)] < A[i]: | |
A[i] = A[int(i / 2)] | |
B[i] = int(i / 2) |
# Uses python3 | |
import sys | |
import math | |
# W - вместимость рюкзака | |
# w - набор весов | |
def optimal_weight(W, w): | |
n = len(w) | |
table_res = [[math.inf for x in range(0, n+1)] for y in range(0, W+1)] | |
for i in range(n + 1): |
all: | |
ocamlfind opt -g -rectypes -syntax camlp5o -package ocanren,ocanren.syntax,GT,GT.syntax.all -linkpkg -o poly poly.ml | |
clean: | |
rm *.cm[oix] *.o poly |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Домашнее задание #1 | |
К сожалению, у нас нет "истинных" "наиболее описательных" слов для датасета. | |
В этом задании от вас требуется | |
1) задать правильную формулу TF.IDF в функции calc_token_weight, | |
2) передать в неё правильные параметры. |
module Main (comp2, main) where | |
import Data.Maybe | |
import Data.List | |
import Data.Functor | |
import Control.Applicative | |
import Control.Monad | |
type Env a = [(String, a)] |