Skip to content

Instantly share code, notes, and snippets.

View sherpc's full-sized avatar

Alexander Sher sherpc

View GitHub Profile
@sherpc
sherpc / myShop.cs
Created February 12, 2012 18:16 — forked from anonymous/Uset.cs
class Program
{
static void Main(string[] args)
{
}
}
class user // класс содержит поля и методы польозвателя
// login, email, password, и методы : * newUser (cоздать нового пользователя)
// * delUser (удалить пользователя)
// * listUser (вывести список пользователей)
@sherpc
sherpc / _form.html.slim
Created February 22, 2012 22:06
ololol
= simple_form_for(@admin_client) do |f|
= f.error_notification
.inputs
= f.input :code_name, :label => 'Кодовое имя'
#pic_icon
= image_tag @admin_client.logo.url
= f.input :logo, :label => 'Иконка'
= f.input :public, :label => 'Публичное?'
#lang_panel
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NullTest
{
class SomeClass
{
}
@sherpc
sherpc / Program.cs
Created May 14, 2012 20:27
RefTest
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RefTest
{
class SomeClass
{
public int SomeProperty { get; set; }
@sherpc
sherpc / lab2.cs
Created June 3, 2012 10:16 — forked from anonymous/lab2
Newton's method & simple iterations method
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace NumericalAnalysis
{
class NonlinearEquations
{
@sherpc
sherpc / morozov.cpp
Last active December 11, 2015 15:28
// for Morozov
void RetSignal(int status) {
if (WIFEXITED(status))
;
else if (WIFSIGNALED(status)) {
printf("ERROR: return signal %d\n", WTERMSIG(status));
}
else if (WIFSTOPPED(status)) {
printf("STOP: return signal %d\n", WSTOPSIG(status));
}
@sherpc
sherpc / test.rb
Last active December 16, 2015 11:19
# Метод, который хотим тестировать
def det(matrix)
# fake implementation
0
end
def do_det_test(test_case)
result = det(test_case[:data])
assert_equal(result, test_case[:expected])
# Пусть магический метод называется defnil
# Тогда обычный вариант:
def f(x,y)
return nil if x == nil
x + y
end
f(1,2) # => 3
f(nil,2) # => nil
(defmacro defn-nil
[fname args body]
`(defn ~fname ~args (if (nil? ~(first args)) nil ~body)))
(defn-nil f
[x y]
(+ x y))
(f 1 2) ;; => 3
(f nil 2) ;; => nil
@sherpc
sherpc / base.html
Last active January 3, 2016 16:19
clj->js problem
<!DOCTYPE html>
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Welcome to sweethome</title>
</head>
<body>
<!-- navbar -->
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">