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 compiler | |
from compiler.ast import * | |
import pprint | |
from StringIO import StringIO | |
from tempfile import TemporaryFile | |
import re | |
#b = 1 | |
#c = 2 | |
#a = b+c |
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
# min(alchogol to understand this func), vodka, cognac or “Gay Milker” kefir only | |
def apply_deletion range | |
return self if range.start >= self.end # -500 ml | |
len_diff = [self.length, range.length, self.end - range.start, range.end - self.start].min # 1000 ml | |
new_start = [range.start - [0, len_diff].min, self.start].min # 300 ml | |
TimeRange.new(new_start, new_start + self.length - [0, len_diff].max) # 700 ml | |
# total: 1500 ml | |
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
dsfsdfdsfds |
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 module | |
def handle(): | |
... | |
def main(): | |
try: | |
module.test() | |
except: | |
handle() |
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 code is a part of CrashKit, a web-based crash collection and analysis software | |
# (http://crashkitapp.appspot.com). Please consider it to be in public domain. | |
def get_class_name(frame): | |
"""Guesses a class name to show in a stack trace for the given frame, | |
based on the attributes of the first argument of the frame's function.""" | |
code = frame.f_code | |
fname = code.co_name | |
if code.co_argcount > 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
# This code is a part of CrashKit, a web-based crash collection and analysis software | |
# (http://crashkitapp.appspot.com). Please consider it to be in public domain. | |
def get_package_name(frame): | |
shortest_package = frame.f_globals.get('__name__') | |
if shortest_package is None: # afaik this only happens while importing a module | |
for folder in sys.path: | |
folder = os.path.abspath(folder).replace('\\', '/') | |
if not folder.endswith('/'): | |
folder += '/' |
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
# Copyright (c) 2009 Andrey Tarantsov, YourSway LLC (crashkit client) | |
# Copyright (c) 2006 Bob Ippolito (simplejson) | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy of | |
# this software and associated documentation files (the "Software"), to deal in | |
# the Software without restriction, including without limitation the rights to | |
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies | |
# of the Software, and to permit persons to whom the Software is furnished to do | |
# so, subject to the following conditions: | |
# |
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
<html> | |
<head> | |
<script src="http://crashkitapp.appspot.com/static/javascript/crashkit-javascript.js?test/js" type="text/javascript" charset="utf-8"></script> | |
<!-- <script src="http://localhost:5005/static/javascript/crashkit-javascript.js?test/js" type="text/javascript" charset="utf-8"></script> --> | |
<script src="crashkit-javascript-sample.js" type="text/javascript" charset="utf-8"></script> | |
<script type="text/javascript" charset="utf-8"> | |
function xxx(a) { | |
yyy(a, a, a); | |
} | |
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 com.instantiations.eclipse.analisys.indexer.storage.diskmapped; | |
import java.io.File; | |
import java.io.FileNotFoundException; | |
import java.io.IOException; | |
import java.io.OutputStream; | |
import java.util.Random; | |
import com.instantiations.eclipse.analisys.indexer.storage.db.PagedMemoryException; | |
import com.instantiations.eclipse.analisys.indexer.storage.reusable.filesystem.FileObject; |
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
// UIPickerView_SelectionBarLabelSupport.h | |
// | |
// This file adds a new API to UIPickerView that allows to easily recreate | |
// the look and feel of UIDatePicker labeled components. | |
// | |
// Copyright (c) 2009, Andrey Tarantsov <[email protected]> | |
// | |
// Permission to use, copy, modify, and/or distribute this software for any | |
// purpose with or without fee is hereby granted, provided that the above | |
// copyright notice and this permission notice appear in all copies. |