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
#encoding: utf-8 | |
require 'sequel' | |
def create_model | |
DB = Sequel.sqlite('aw.db') | |
DB.create_table(:authors) do | |
#creating table of authors | |
primary_key :id, type: Integer, index: true | |
String :name, unique: true |
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
#include "MCADINCL.H" | |
#include <opencv2/highgui/highgui.hpp> | |
#include <opencv2/imgproc/imgproc.hpp> | |
// Reading frame and convert it into MathCad matrix(complexarray). | |
// | |
LRESULT video2MathCad(COMPLEXARRAY * const result, const char * path_to_video, | |
const int frame_number) | |
{ | |
CvCapture* capture = cvCreateFileCapture(path_to_video); |
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
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
require 'sequel' | |
require 'msgpack' | |
require 'benchmark' | |
require 'ruby-prof' | |
require 'logger' | |
def analyze(word) |
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
weights = Array.new(2288) { |x| 1 / 2288.0 } | |
t = 0.0 | |
weights.map! { |x| t += x; t } | |
random_value = Random.new.rand | |
weights.find_index { |x| random_value - x <= 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
package main | |
import ( | |
"math" | |
"fmt" | |
) | |
type Vertex struct { | |
x float64 | |
y float64 |
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
vim.o.background = "light" | |
vim.o.termguicolors = true | |
if vim.g.colors_name then vim.cmd("hi clear") end | |
vim.cmd("syntax reset") | |
vim.g.colors_name = "Boring Tomorrow" | |
-- Default GUI Colours |
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
%h2.expandall Expand/Collapse All | |
- @tag.pages.each do |page| | |
%div{ class: 'title', id: "title_#{page.title}" } | |
= page.pretty_title | |
= link_to(" [edit]", controller: 'wiki', action: 'show', | | |
project_id: page.project, id: page.title) | |
%div{ class: 'section', id: page.title } | |
= raw Redmine::WikiFormatting::Textile::Formatter.new(page.text).to_html | |
:javascript |
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
#!/usr/bin/env ruby | |
require 'sparql/client' | |
sparql = SPARQL::Client.new("http://dbpedia.org/sparql") | |
query = "prefix dbpprop: <http://dbpedia.org/property/> | |
prefix dbpedia-owl: <http://dbpedia.org/ontology/> | |
select ?name, ?hdi | |
where { | |
?country a dbpedia-owl:Country . |
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
#!/usr/bin/env ruby | |
require 'flickraw' | |
require 'json' | |
CREATE_API_KEY = 'https://secure.flickr.com/services/apps/create/apply' | |
CONFIG_FILE = File.expand_path '~/.config/2flickr.json' | |
def init |
OlderNewer