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
def countries | |
#Obtiene todos los países para ser listados | |
render json: CS.countries | |
end | |
def cities | |
#Obtiene las ciudades por un estado y un país | |
render json: CS.cities(params[:state], params[:country]) | |
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/python2 | |
import sys | |
def main(argv): | |
if (len(sys.argv) != 2): | |
sys.exit('Uso: caesar.py <entero>') | |
plaintext = list(raw_input('Mensage: ')) | |
alphabet = list('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') |
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 Collatz(object): | |
def __init__(self): | |
self.numbers = [] | |
self.ways = 1 | |
def solve(self, number): | |
self.numbers.clear() | |
self.ways = 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
def equilateral(a,b,c) | |
if(((a-b)+(b-c)+(a-c))==0) | |
return true | |
end | |
return false | |
end | |
def isoceles(a,b,c) | |
if(((a-b)+(b-c))==0 or ((a-b)+(a-c))==0) | |
return 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
//todo-spec.js | |
describe('4chin page', function() { | |
it('click in image', function() { | |
browser.ignoreSynchronization = true; // Non angular page | |
browser.driver.manage().window().maximize(); | |
browser.get('http://boards.4chan.org/wg/thread/6813282/like-this'); | |
var list = element.all(by.css('.fileThumb')); | |
list.each(function(elem){ | |
elem.click(); |
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 sudoku; | |
import java.util.LinkedList; | |
public class Sudoku { | |
public void DoSudoku(int [][] board, int row, int column) { | |
if(isFinish(board)){showBoard(board); return;} | |
if(row >= board.length) return; | |
if(column >= board[row].length){ |
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
<?xml version="1.0" encoding="utf-8"?> | |
<openerp> | |
<data> | |
<!-- Vista de formulario --> | |
<record model="ir.ui.view" id="contadesk_fv_factura_form"> | |
<field name="name">Virtual Invoice</field> | |
<field name="model">contadesk.factura.virtual</field> | |
<field name="type">form</field> | |
<field name="arch" type="xml"> | |
<form string="Virtual Invoice" version="7.0" create="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
""" | |
Dynamic size in account_invoice report | |
Just send the account_invoice_line_id take the len() and multiply it with 7 (millimeters) | |
This example is simulating the paper of a supermarket invoice, the default size in my country is 24 millimeters for a correct | |
format, but you can change it! | |
How it works: You need pass this method inside the qweb report sending the lines. | |
""" | |
#Qweb | |
<t t-esc="o.change_size_page(o.lines)"/> |
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
# This came up with a huge problem for days, but i resolve it. | |
# The main problem is the limitation in form in odoo. Mostly of this are not in the official documentation, | |
# so maybe you will feel a bit blind sometimes, but I feel you bro. | |
# Basically works for partner_id relation for many2one | |
# PART ONE | |
# Create a class res_partner.py | |
class ResPartner(models.Model): | |
"""This part is the easy part, @api.model overrides to name_get (optional) and name_search.""" | |
_inherit = 'res.partner' |
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 ProductTemplateKit(models.Model): | |
_inherit = 'product.template' | |
international_code = fields.Char('Codigo Internacional') | |
is_kit = fields.Boolean( | |
string='Es kit', | |
default=False) | |
product_combo_ids = fields.One2many('product.combo', 'product_parent_id', 'Combo de productos') | |
class ProductCombo(models.Model): |
OlderNewer