Skip to content

Instantly share code, notes, and snippets.

#include <fstream>
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <array>
using namespace std;
struct point {
int64_t x, y;
};
#include <fstream>
#include <cmath>
using namespace std;
double sqr(double x){return x*x;}
double len(double x1,double y1,double x2,double y2)
{
return sqrt(sqr(x2-x1)+sqr(y2-y1));
}
#define eps 1e-4
@frp
frp / log
Created July 21, 2015 18:45
Compilet output
parse1.tab.c: In function ‘int yyparse()’:
parse1.tab.c:1145:18: error: ‘yylex’ was not declared in this scope
parse1.tab.c:1352:30: error: ‘yyerror’ was not declared in this scope
parse1.tab.c:1496:33: error: ‘yyerror’ was not declared in this scope
parse1.y: In function ‘void init_table()’:
parse1.y:51:14: error: ‘arith_fncts’ was not declared in this scope
parse1.y: At global scope:
parse1.y:79:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
parse1.y:79:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
parse1.y:79:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
#include "stdafx.h"
#include <iostream>
#include "Spreadsheet.h"
#include <cassert>
#include <cstring>
#include <string>
#include "SpreadsheetCell.h"
#include <set>
using namespace std;
@frp
frp / Program.cs
Created March 18, 2014 09:56
C# Task17
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
namespace Task17_cs
{
class Program
@frp
frp / processing.rb
Created March 17, 2014 00:50
Bot 2048
require 'selenium-webdriver'
$driver = Selenium::WebDriver.for :firefox
$driver.get("http://gabrielecirulli.github.io/2048/")
def sendkey key
$driver.action.send_keys(key).perform
end
def finished
@frp
frp / lspci
Created July 4, 2012 05:55
lspci and lsusb on Dell Inspiron N5110
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port (rev 09)
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 05)
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 05)
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b5)
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b5)
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b5)
0
@frp
frp / treap.rb
Created May 30, 2012 19:26
Treap with rmq
class Treap
class Node
attr_accessor :key, :priority, :left, :right, :count, :minimum
def initialize(key, priority)
@key = key
@priority = priority
@count = 1
@minimum = key
end
@frp
frp / treap.rb
Created May 30, 2012 18:30
Treap with implicit key
class Treap
class Node
attr_accessor :key, :priority, :left, :right, :count
def initialize(key, priority)
@key = key
@priority = priority
@count = 1
end
@frp
frp / treap.rb
Created May 29, 2012 19:47
Treap with order statistics
class Treap
class Node
attr_accessor :key, :priority, :left, :right, :count
def initialize(key, priority)
@key = key
@priority = priority
@count = 1
end