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 os | |
import subprocess | |
def executar(str): | |
''' Executa um comendo no shell retornando o stdout ''' | |
args = str.split(' ') | |
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) | |
out, err = p.communicate() | |
return out |
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
from xml.dom import minidom | |
xmldoc = minidom.parse('.classpath') | |
itemlist = xmldoc.getElementsByTagName('classpathentry') | |
for s in itemlist : | |
print s.attributes['path'].value |
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
# -*- coding: utf-8 -*- | |
__author__ = "Eduardo Lopes" | |
__copyright__ = "Copyright 2014, Planeta Terra" | |
__license__ = "Use por conta e risco" | |
__version__ = "0.1-beta-bem-beta" | |
__status__ = "mais ou menos em Production" | |
import os | |
import sys |
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
$.noConflict(); | |
jQuery(document).ready(function($) { | |
if($("#mytabs") == undefined)){ | |
alert("nao achei as tabs") | |
}else{ | |
//cria tabs a partir da ul com id=mytabs | |
//determina o conteudo das divs | |
//dentro da div com id=mypaneltabs | |
$("#mytabs").tabs("#mypaneltabs > div", {initialIndex:2}) | |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> | |
<title>jQuery UI Example Page</title> | |
<!-- dependencias das tabs --> | |
<!-- | |
<link type="text/css" href="css/meucss.css" rel="stylesheet" /> | |
--> |
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
<script> | |
$(function() { | |
$( "#tabs" ).tabs(); | |
}); | |
</script> | |
</head> |
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
capacidade.turma=10 | |
usuario=secretaria | |
senha=segredo | |
papel=admin |
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
describe "#list" do | |
it "list attribute as ruby object" do | |
attrs = @controller.list_attributes | |
attrs.each do |a| | |
a.should be_an_instance_of Attribute | |
end | |
end | |
it "list attribute in xml format" do | |
xml = @controller.list_attributes(:xml) |
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
ScriptEngineManager mgr = new ScriptEngineManager(); | |
String expression = "if( (((((4 == 1) && 'USER_ID' != '1') && 'ON_GOING' == 'ON_GOING') || 1381374000000 != 1381374000000)){ resut = true ; } else { result = false; }" | |
ScriptEngine jsEngine = mgr.getEngineByName("JavaScript"); | |
boolean result = false; | |
try { | |
result = (Boolean) jsEngine.eval(expression); |
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
desc "Salva arquivos em xml" | |
task :export => :environment do | |
require 'builder' | |
docs = Document.all | |
index = 1 | |
docsarray = [] | |
docs.each do |doc| | |
docsarray.push(doc) | |
if docsarray.size % 1000 == 0 | |
save_xml("documents-rkb-" + index.to_s, docsarray) |
OlderNewer