Skip to content

Instantly share code, notes, and snippets.

View spellancer's full-sized avatar

Sarkis Nanyan spellancer

  • Russian Federation
View GitHub Profile
gem install pg -v '0.14.1'
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/home/sarkis/.rbenv/versions/1.9.3-p286/bin/ruby extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
--with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/..
Using rake (0.9.2.2)
Using i18n (0.6.1)
Using multi_json (1.3.6)
Using activesupport (3.2.8)
Using builder (3.0.4)
Using activemodel (3.2.8)
Using erubis (2.7.0)
REM ***** BASIC *****
Function replace(str as String,sFrom as String,sTo as String) as String
'Заменяет в строке str все подстроки sFrom на sTo и возвращает полученную строку
Dim s as String
Dim i as Integer
s=str
i=1
Do While true
if i>len(s) then
Sub zap(oEvent)
Dim i as Integer
i=0
oForm = oEvent.Source.getModel().getParent()
oCon=oForm.ActiveConnection 'объект для доступа к базе данных
oStatement=oCon.CreateStatement() 'объект для выполнения запросов
sSQLL= "SELECT ""Название"" , ""ID"" FROM ""Вид соревнований"" "
sSQL= "SELECT ""Место"" , ""Страна"" , ""Вид соревнований"" FROM ""Ведомость"" "
oRes=oStatement.executeQuery(sSQLL)
oResult=oStatement1.executeQuery(sSQL)
Do While oResult.next()
Do While oRes.next()
@spellancer
spellancer / gist:4181489
Created December 1, 2012 10:51
Model-lab-3
#encoding: utf-8
# задаем вспомогательные функции
# функция с таблицами для сложения
def sum(len,a,b)
if len == 2
asb = [[0,1],[1,1]]
elsif len == 3
asb = [[0,1,2],[1,1,1],[2,1,2]]
elsif len == 5
@spellancer
spellancer / gist:4275280
Created December 13, 2012 09:37
model-lab-4
#include <iostream>
#include<vector>
#include<math.h>
using namespace std;
int sum(int a,int b)
{
int mas[2][2]={{0,1},{1,1}};
int aplusb;
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDOHVL4B91yGfIb7P5f5jLNbNk4vnxEDkfhM8GGsEzzaqnVk2OszILpnIppbFFp/HKkDB+2yWGrWU+MP549Wb1vuxgSMFcVG8nPO9kTyzMDIJ0LW2m2kmVHgRGPCLVYRnMyQuNo2ntVLTHhBi28W01zmxlF5wY4DePHXYYCC97qBQnUVv1fh5JP+M9lpi+F2bf3bnfTPJALI/LDh4/7IDmChiuTU/jJuws2oDebWPSxpRQgoaLQl/6FoPmspttg92+7Ae6q37AoKVdHl6o6QXglZGIQnwkf0ADP74GpC0p/i2KcCudxWlF+XwTbr4qec41OWar5YHbHsXzOLat5qW8p [email protected]
#include <iostream>
using namespace std;
class A
{
public:
float num;
int num_to_int;
A operator*(A a);
void to_int(A a);
};
#include <iostream>
#include <fstream>
#include <string.h>
#include <stdlib.h>
using namespace std;
int main ()
{
char buff[300];
unsigned int res=0;