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
import csv | |
import networkx as nx | |
from decimal import * | |
from itertools import * | |
FILE_SALIDA = 'output.csv' | |
FILE_PROVEEDOR = 'ocrtest_segundo_semestre_prov_rubro CORREGIDO.csv' | |
FILE_ORGANISMO = 'ocrtest_segundo_semestre_organismo_rubro CORREGIDO.csv' | |
class Data: |
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
$.fn.extend({ | |
reset: function(){ | |
return this.each(function(){ | |
$(this).is('form') && this.reset(); | |
}) | |
} | |
}); |
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 Devise | |
module Models | |
module DatabaseAuthenticatable | |
protected | |
def password_digest(password) | |
password | |
end | |
end | |
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
public class EventThreadListModel extends DefaultListModel { | |
private static final long serialVersionUID = -4389671662282607290L; | |
private void invokeOnEventThread(Runnable r) { | |
try { | |
if (!SwingUtilities.isEventDispatchThread()) { | |
SwingUtilities.invokeAndWait(r); | |
} else { | |
r.run(); | |
} |
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
class ActionController::TestCase < ActiveSupport::TestCase | |
module Behavior | |
def process_with_default_params(action, parameters = nil, session = nil, flash = nil, http_method = 'GET') | |
default_params = {:locale => :en} | |
parameters ||= {} | |
parameters.reverse_merge! default_params | |
process_without_default_params(action, parameters, session, flash, http_method) | |
end | |
alias_method_chain :process, :default_params | |
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
(function($){ | |
$.delayedChangeDelay = 1000; | |
$.checkUpdateTime = 500; | |
// Special event definition. | |
$.event.special.delayedChange = { | |
setup: function( params ) { | |
// Add data and handlers to other events |
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
class ActiveRecord::Base | |
def can_destroy? | |
self.class.reflect_on_all_associations.all? do |assoc| | |
assoc.options[:dependent] != :restrict || (assoc.macro == :has_one && self.send(assoc.name).nil?) || (assoc.macro == :has_many && self.send(assoc.name).empty?) | |
end | |
end | |
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
ko.bindingHandlers.instedd_init = | |
init: (element, valueAccessor, allBindingsAccessor, viewModel) -> | |
$.instedd.init_components($(element)) |
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
class Graph: | |
def __init__(self, n): | |
self.n = n | |
self.adjs = [] | |
self.edges = set() | |
for i in range(n): | |
self.adjs.append(set()) | |
def add_edge(self, v, w): |
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
if $('#my_div_in_complex_page').length > 0 | |
class Foo | |
... |
OlderNewer