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
# As an option can be placed | |
# in models/concerns | |
module CustomTimestamps | |
extend ActiveSupport::Concern | |
included do | |
class_attribute :custom_updated_at, :custom_created_at | |
before_save :update_custom_updated_at | |
before_create :set_custom_created_at | |
end |
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
module CustomTimestamps | |
extend ActiveSupport::Concern | |
included do | |
class_attribute :custom_updated_at, :custom_created_at | |
before_save :update_custom_updated_at | |
before_create :set_custom_created_at | |
end | |
def update_custom_updated_at |
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
require "opencv" | |
include OpenCV | |
WINDOW_NAME = "Difference visualization" | |
# read videostream from camera | |
camera = OpenCV::CvCapture.open(0) | |
# open simple window wedget | |
# can show (CvMat/IplImage) | |
window = OpenCV::GUI::Window.new(WINDOW_NAME) |
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
require 'nokogiri' | |
require 'open-uri' | |
base_url = "http://cms.indygov.org/MyAssessedValue/Result.aspx?Parcel=" | |
neccessary_ids = ["#ctl00_header_txtParcel", "#ctl00_header_txtPropertyLocation", "#ctl00_header_txtTotalAssessed2011"] | |
input_file_name = '2008 Unsold Tax Sale Properties as of 08-24-2010.txt' | |
output_file_name = input_file_name.split('.')[0] + "_detail" | |
if File.exist?(input_file_name) |
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 | |
# -*- coding: utf-8 -*- | |
# Author: seniorihor (12.03.2012) | |
class MyArray | |
def initialize(arr) | |
@array = arr.clone() | |
@max_positive = 0 | |
@max_minimum = 0 | |
end |
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 | |
# -*- coding: utf-8 -*- | |
# Aurhor: seniorihor and vertoldo (12.03.2012) | |
class General | |
def initialize(quantity, numbers) | |
@quantity = quantity | |
@numbers = numbers | |
@posMensh=0 | |
@posBilsh=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
kilkist = gets.chomp.to_i | |
soldatu=gets.chomp.split(" ").map! {|el| el=el.to_i} | |
posMensh=soldatu.index[soldatu.min] | |
posBilsh=soldatu.index[soldatu.max] | |
sec=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 org.uzhnu.homework.stack; | |
public class Driver { | |
/** | |
* @param args | |
*/ | |
public static void main(String[] args) { | |
// init empty stack | |
Stack st = new Stack(); |
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 org.uzhnu.homework.stack; | |
public class Stack { | |
private String [] strArray; //new arr | |
private int currEl; //pointer to Stack top | |
private static int defaultSize=10; | |
Stack(){ | |
this.strArray = new String[defaultSize]; |
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
mojeePole = [#a b c d e f g h i k | |
[0, 0, 0, 0, 0, 0, 0, 0, 0 ,0],#1 | |
[0, 0, 0, 1, 0, 0, 0, 0, 0 ,0],#2 | |
[0, 0, 0, 1, 0, 0, 0, 0, 0 ,0],#3 | |
[0, 0, 0, 1, 0, 0, 0, 0, 0 ,0],#4 | |
[0, 0, 0, 0, 0, 0, 0, 0, 0 ,0],#5 | |
[0, 0, 0, 0, 0, 0, 0, 0, 0 ,0],#6 | |
[0, 0, 0, 0, 0, 0, 0, 0, 0 ,0],#7 | |
[0, 0, 0, 0, 0, 0, 0, 0, 0 ,0],#8 | |
[0, 0, 0, 0, 0, 0, 0, 0, 0 ,0],#9 |
NewerOlder