Skip to content

Instantly share code, notes, and snippets.

from xml.dom.minidom import parse, Node, Text as TextNode, Element as Element
from collections import namedtuple
import re
class SpecialQueryElement: pass
text = SpecialQueryElement()
def childQuery(node,query):
if isinstance(query,str):
@Odomontois
Odomontois / trans1.xslt
Created October 11, 2012 17:26
Some abap-xslt shit
<xsl:transform version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:sap="http://www.sap.com/sapxsl"
>
<xsl:strip-space elements="*"/>
<xsl:template match="ZHR_A07">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
@Odomontois
Odomontois / FUNCTION z_open_fi_interface_00001120.
Created October 29, 2012 14:48
ABAP деривация ФМ из карточки договора
FUNCTION z_open_fi_interface_00001120.
*"----------------------------------------------------------------------
*"*"Локальный интерфейс:
*" IMPORTING
*" VALUE(I_BKDF) TYPE BKDF OPTIONAL
*" TABLES
*" T_BKPF STRUCTURE BKPF
*" T_BSEG STRUCTURE BSEG
*" T_BKPFSUB STRUCTURE BKPF_SUBST
*" T_BSEGSUB STRUCTURE BSEG_SUBST
@Odomontois
Odomontois / IusPZContractUpload.xsd
Created December 10, 2012 14:43
Загрузка договоров ИУС ПЗ
<?xml version='1.0' encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:ru:insys:iuspz:cntr:upload"
version="0.1">
<xs:simpleType name="attributeName">
<xs:restriction base="xs:string">
<xs:pattern value="[A-Z0-9_]+"/>
</xs:restriction>
val studenten = Map("Otto" -> 10, "Anna" -> 11, "Bill" -> 4, "Stefan" -> 15)
def filteredKeys[K, V](map: Map[K, V])(filter: V => Boolean) = map.filter(pair => filter(pair._2)).keys.mkString(", ")
val filterStudenten = filteredKeys(studenten) _
println("lower than 10: " + filterStudenten(_ < 10))
println("higher than 10: " + filterStudenten(_ > 10))
println("exactly 15: " + filterStudenten( _ == 15))
val studenten = Map("Otto" -> 10, "Anna" -> 11, "Bill" -> 4, "Stefan" -> 15)
def filteredKeys[K, V](map: Map[K, V])(filter: V => Boolean) = map.filter(pair => filter(pair._2)).keys.mkString(", ")
val filterStudenten = filteredKeys(studenten) _
println("lower than 10: " + filterStudenten(_ < 10))
println("higher than 10: " + filterStudenten(_ > 10))
println("exactly 15: " + filterStudenten( _ == 15))
val studenten = Map("Otto" -> 10, "Anna" -> 11, "Bill" -> 4, "Stefan" -> 15)
def filteredKeys[K, V](map: Map[K, V])(filter: V => Boolean) = map.filter(pair => filter(pair._2)).keys.mkString(", ")
val filterStudenten = filteredKeys(studenten) _
println("lower than 10: " + filterStudenten(_ < 10))
println("higher than 10: " + filterStudenten(_ > 10))
println("exactly 15: " + filterStudenten( _ == 15))
%----Data----
{"S": 1379.9,
"X": 1500,
"u": [1.0036, 1.0044, 1.0060, 1.0056, 1.0064, 1.0087, 1.0102, 1.0114, 1.0126, 1.0133, 1.0151, 1.0150],
"pu": 0.4930,
"r": 2.8000e-04,
"deltaT":1
}
%------------
import scala.collection.mutable
/**
* User: Oleg
* Date: 1/12/14
* Time: 3:32 AM
*/
object Probability {
def main(args: Array[String]) {
println(prob[Int, Double](.5, .8, 13, 10, 0))
import math.*
import scipy.optimize.*
def k2t(k):
f = lambda t : gamma(1/t)*gamma(5/t)/gamma(3/t)**2-k-3
return fsolve(f,2)