code
stringlengths
1
1.72M
language
stringclasses
1 value
import sys import os import inspect import logging import struct from argparse import ArgumentParser from elfesteem import pe from elfesteem import * from elfesteem.strpatchwork import StrPatchwork from miasm2.core import asmbloc from miasm2.arch.x86.arch import mn_x86 from miasm2.arch.x86.disasm import dis_x86_32 fr...
Python
#! /usr/bin/env python from miasm2.core.cpu import parse_ast from miasm2.arch.x86.arch import mn_x86, base_expr, variable from miasm2.core.bin_stream import bin_stream from miasm2.core import parse_asm from miasm2.expression.expression import * from elfesteem import * from pdb import pm from miasm2.core import asmbloc...
Python
#! /usr/bin/env python from miasm2.core.cpu import parse_ast from miasm2.arch.x86.arch import mn_x86, base_expr, variable from miasm2.core.bin_stream import bin_stream from miasm2.core import parse_asm from miasm2.expression.expression import * from elfesteem import * from pdb import pm from miasm2.core import asmbloc...
Python
# Minimalist Symbol Exec example from miasm2.core.bin_stream import bin_stream_str from miasm2.arch.x86.arch import mn_x86 from miasm2.arch.x86.ira import ir_a_x86_32 from miasm2.arch.x86.regs import all_regs_ids, all_regs_ids_init from miasm2.ir.sy...
Python
#! /usr/bin/env python from miasm2.core.cpu import parse_ast from miasm2.arch.x86.arch import mn_x86, base_expr, variable from miasm2.core.bin_stream import bin_stream from miasm2.core import parse_asm from miasm2.expression.expression import * from elfesteem import * from pdb import pm from miasm2.core import asmbloc...
Python
#! /usr/bin/env python from miasm2.core.cpu import parse_ast from miasm2.arch.x86.arch import mn_x86, base_expr, variable from miasm2.core.bin_stream import bin_stream from miasm2.core import parse_asm from miasm2.expression.expression import * from elfesteem import * from pdb import pm from miasm2.core import asmbloc...
Python
import sys from elfesteem import pe_init from miasm2.arch.x86.disasm import dis_x86_32 from miasm2.core.asmbloc import bloc2graph from miasm2.core.bin_stream import bin_stream_pe if len(sys.argv) != 3: print 'Example:' print "%s box_upx.exe 0x410f90" % sys.argv[0] sys.exit(0) fname = sys.argv[1] ad = int(...
Python
from miasm2.arch.x86.arch import mn_x86 from miasm2.arch.x86.regs import * l = mn_x86.fromstring('MOV EAX, EBX', 32) print "instruction:", l print "arg:", l.args[0] x = mn_x86.asm(l) print x l.args[0] = EDX y = mn_x86.asm(l) print y print mn_x86.dis(y[0], 32)
Python
#! /usr/bin/env python from miasm2.core.cpu import parse_ast from miasm2.arch.arm.arch import mn_arm, base_expr, variable from miasm2.core import parse_asm from miasm2.expression.expression import * from miasm2.core import asmbloc from elfesteem.strpatchwork import StrPatchwork my_mn = mn_arm reg_and_id = dict(mn_ar...
Python
from miasm2.arch.x86.disasm import dis_x86_32 from miasm2.core.asmbloc import bloc2graph s = '\xb8\xef\xbe7\x13\xb9\x04\x00\x00\x00\xc1\xc0\x08\xe2\xfb\xc3' mdis = dis_x86_32(s) blocs = mdis.dis_multibloc(0) for b in blocs: print b g = bloc2graph(blocs) open('graph.txt', 'w').write(g)
Python
#! /usr/bin/env python from miasm2.core.cpu import parse_ast from miasm2.arch.x86.arch import mn_x86, base_expr, variable from miasm2.core.bin_stream import bin_stream from miasm2.core import parse_asm from miasm2.expression.expression import * from elfesteem import * from pdb import pm from miasm2.core import asmbloc...
Python
#! /usr/bin/env python # test instruction caching from miasm2.core.cpu import parse_ast from miasm2.arch.x86.arch import mn_x86, base_expr, variable from miasm2.core.bin_stream import bin_stream from miasm2.core import parse_asm from miasm2.expression.expression import * from elfesteem import * from pdb import pm fro...
Python
#! /usr/bin/env python from miasm2.core.cpu import parse_ast from miasm2.arch.x86.arch import mn_x86, base_expr, variable from miasm2.core import parse_asm from miasm2.expression.expression import * from miasm2.core import asmbloc from elfesteem.strpatchwork import StrPatchwork reg_and_id = dict(mn_x86.regs.all_regs_...
Python
# This Python file uses the following encoding: utf-8 from django.db import models from django.template.defaultfilters import slugify class Familia(models.Model): nom = models.CharField(u"Nom", max_length=250, help_text = u'''Nom de la família''', blank = False ) logo = models.ImageField(u"Logo", blank=True, ...
Python
""" This file demonstrates writing tests using the unittest module. These will pass when you run "manage.py test". Replace this with more appropriate tests for your application. """ from django.test import TestCase class SimpleTest(TestCase): def test_basic_addition(self): """ Tests that 1 + 1 a...
Python
# Create your views here.
Python
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "fp2cat.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
Python
# This Python file uses the following encoding: utf-8 #----write pdf------------------------------------- from django import http from django.template.loader import get_template from django.template import Context import cStringIO as StringIO from django.utils.translation.trans_real import gettext_noop from decimal im...
Python
from django import forms from django.forms.widgets import Widget class ckbxForm(forms.Form): ckbx = forms.BooleanField(required = False ) def __init__(self, *args, **kwargs): self.label = kwargs.pop('label', None) self.help_text = kwargs.pop('help_text', None) super(ckbxForm,self...
Python
# This Python file uses the following encoding: utf-8 from utils import tools from django.utils.datetime_safe import date def dades_basiques(request): (user, l4) = tools.getImpersonateUser(request) sessioImpersonada = tools.sessioImpersonada(request) return { 'data': date.today(), ...
Python
# This Python file uses the following encoding: utf-8 from django.db import models from utils.fields import CurrencyField class Preferencies(models.Model): codi = models.CharField(u'Codi', max_length = 20, help_text = u'''Codi de la preferència. (No canviar-lo)''', unique=True) boolean_value = models.NullBo...
Python
""" This file demonstrates two different styles of tests (one doctest and one unittest). These will both pass when you run "manage.py test". Replace these with more appropriate tests for your application. """ from django.test import TestCase class SimpleTest(TestCase): def test_basic_addition(self): """ ...
Python
# This Python file uses the following encoding: utf-8 from django.db import models from decimal import Decimal class CurrencyField(models.DecimalField): __metaclass__ = models.SubfieldBase def to_python(self, value): try: return super(CurrencyField, self).to_python(value).quantize(Decimal(...
Python
from django.conf.urls.defaults import patterns urlpatterns = patterns('utils.views', (r'^about/$', 'about') , (r'^preferenciesEdit/$', 'preferenciesEdit') , )
Python
import datetime from django.contrib.auth import logout class NoCacheMiddleware(object): def process_response(self, request, response): if response and type( response ) != type: #if hasattr(request, 'session'): request.session.set_expiry(1500) response['Pragma'] = 'no-cache' ...
Python
from django import template from django.template import resolve_variable, NodeList from django.contrib.auth.models import Group register = template.Library() #http://djangosnippets.org/snippets/390/ @register.tag() def ifusergroup(parser, token): """ Check to see if the currently logged in user belongs to a spec...
Python
#This Python file uses the following encoding: utf-8 from django.contrib.auth.models import Group from django.http import Http404 def group_required(groups=[]): def decorator(func): def inner_decorator(request,*args, **kwargs): for group in groups: if Group.objects....
Python
# This Python file uses the following encoding: utf-8 #http://copiesofcopies.org/webl/2010/04/26/a-better-datetime-widget-for-django/ #from django.template.loader import render_to_string from django.forms.widgets import Select, MultiWidget, DateInput, TextInput from time import strftime from django.utils.safestring im...
Python
# This Python file uses the following encoding: utf-8 #templates from django.template import RequestContext from django.shortcuts import render_to_response from django.http import HttpResponseRedirect from django.contrib.auth import logout from django.contrib.auth.models import Group from django.forms.forms import ...
Python
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "fp2cat.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
Python
# This Python file uses the following encoding: utf-8 from django.db import models from django.contrib.auth.models import User from curriculums.models import Cicle, ModulProfessional, UnitatFormativa, Contingut from django.template.defaultfilters import slugify class Post(models.Model): TIPUS_CHOICES = ( ...
Python
""" This file demonstrates writing tests using the unittest module. These will pass when you run "manage.py test". Replace this with more appropriate tests for your application. """ from django.test import TestCase class SimpleTest(TestCase): def test_basic_addition(self): """ Tests that 1 + 1 a...
Python
# Create your views here.
Python
from fp2cat.settings import SITE_ROOT DEBUG = True #DATABASES = { # 'default': { # 'ENGINE': 'django.db.backends.postgresql_psycopg2', # 'NAME': 'fp2catdb', # 'USER': 'fp2cat', # 'PASSWORD': 'i', # 'HOST': '', # 'PORT': '', # }...
Python
from django.conf.urls import patterns, include # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('', (r'^$', 'utils.views.about'), (r'^about/$', 'utils.views.about'), #(r'^correus/', include('cicles.urls')), ...
Python
# This Python file uses the following encoding: utf-8 DEBUG = False TEMPLATE_DEBUG = DEBUG import os, sys SITE_ROOT = os.path.join( os.path.dirname(os.path.realpath(__file__)), '../') SITE_TMP = '/tmp/' ADMINS = ( ('dani herrera', 'ctrl.alt.d@gmail.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { ...
Python
""" WSGI config for fp2cat project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` s...
Python
# This Python file uses the following encoding: utf-8 from django.db import models from cicles.models import Cicle from django.template.defaultfilters import slugify class ModulProfessional(models.Model): cicle = models.ForeignKey( Cicle, db_index = True ) numero = models.IntegerField(u"Número", help_text = u...
Python
""" This file demonstrates writing tests using the unittest module. These will pass when you run "manage.py test". Replace this with more appropriate tests for your application. """ from django.test import TestCase class SimpleTest(TestCase): def test_basic_addition(self): """ Tests that 1 + 1 a...
Python
# Create your views here.
Python
# This Python file uses the following encoding: utf-8 from django.db import models from django.contrib.auth.models import User from cicles.models import Cicle from curriculums.models import ModulProfessional, UnitatFormativa class Perfil(models.Model): usuari = models.OneToOneField( User, db_index = True ) ...
Python
""" This file demonstrates writing tests using the unittest module. These will pass when you run "manage.py test". Replace this with more appropriate tests for your application. """ from django.test import TestCase class SimpleTest(TestCase): def test_basic_addition(self): """ Tests that 1 + 1 a...
Python
# Create your views here.
Python
# This Python file uses the following encoding: utf-8 from django.db import models from django.contrib.auth.models import User from posts.models import Post class VotPositiu(models.Model): usuari = models.ForeignKey( User ) post = models.ForeignKey( Post ) data = models.DateTimeField(u'Moment votació', a...
Python
""" This file demonstrates writing tests using the unittest module. These will pass when you run "manage.py test". Replace this with more appropriate tests for your application. """ from django.test import TestCase class SimpleTest(TestCase): def test_basic_addition(self): """ Tests that 1 + 1 a...
Python
# Create your views here.
Python
#!/usr/bin/env python # To run this script, use Python version 2.7 not version 3.x import argparse import struct #Standard SST25VF040B FLASH size of 4Mbits flash_size = 4*1024*1024/8 #Standard size of bitstream for a Spartan 6 LX9 bit_size = 340*1024 parser = argparse.ArgumentParser(description='Concatenate...
Python
#!/usr/bin/env python # To run this script, use Python version 2.7 not version 3.x import argparse import struct #Standard SST25VF040B FLASH size of 4Mbits flash_size = 4*1024*1024/8 #Standard size of bitstream for a Spartan 6 LX9 bit_size = 340*1024 parser = argparse.ArgumentParser(description='Concatenate...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Inicializador del programa. Levanta la ventana principal y el entorno necesario """ import wx import sys class main(): def __init__(self): self.app = wx.PySimpleApp(0) wx.InitAllImageHandlers() self.frame_1 = MainFrame(None, -1, "") ...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- """ >>> import wrapper >>> w = wrapper.Wrapper() Caso de prueba 1: - la pila inicialmente tiene valores no númericos >>> res = w.get_stack() [nan, nan, nan, nan, nan, nan, nan, nan] Caso de prueba 2: - ingresamos algunos valores al stack mediante FLD >>> w.FLD(3) >>...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- """ >>> import wrapper >>> w = wrapper.Wrapper() caso de prueba: FLDxx (constantes) >>> w.FLD1() >>> w.FLDL2E() >>> w.FLDL2T() >>> w.FLDLG2() >>> w.FLDZ() >>> w.FLDPI() >>> res = w.get_stack() #doctest: +ELLIPSIS [3.14159..., 0.0, 0.30102..., 3.32192..., 1.44269..., 1.0,...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- """ >>> import wrapper >>> w = wrapper.Wrapper() caso de prueba: FLDxx (constantes) >>> w.FLD1() >>> w.FLDL2E() >>> w.FLDL2T() >>> w.FLDLG2() >>> w.FLDZ() >>> w.FLDPI() >>> res = w.get_stack() #doctest: +ELLIPSIS [3.14159..., 0.0, 0.30102..., 3.32192..., 1.44269..., 1.0,...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Inicializador del programa. Levanta la ventana principal y el entorno necesario """ import wx import sys class main(): def __init__(self): self.app = wx.PySimpleApp(0) wx.InitAllImageHandlers() self.frame_1 = MainFrame(None, -1, "") ...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- """ >>> import wrapper >>> w = wrapper.Wrapper() Caso de prueba 1: - la pila inicialmente tiene valores no númericos >>> res = w.get_stack() [nan, nan, nan, nan, nan, nan, nan, nan] Caso de prueba 2: - ingresamos algunos valores al stack mediante FLD >>> w.FLD(3) >>...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- import wx import os _nibbles = {"0":"0000", "1":"0001", "2":"0010", "3":"0011", "4":"0100", "5":"0101", "6":"0110", "7":"0111", "8":"1000", "9":"1001", "A":"1010", "B":"1011", "C":"1100", "D":"1101", "E":"1110", "F":"1111", ...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Este módulo contiene diferentes clases que sobrecargar o agregan comportamientos a los controles (widgets) estándar de Wx. Por ejemplo, InstructionListCtrl incorpora métodos que manipulan el orden de las filas (las intrucciones). También recibe un diccionario con el...
Python
# -*- coding: utf-8 -*- """ Interfaz con la biblioteca dinámica C que es un intermediario hacia rutinas de ensamblador Cada instrucción de FPU implementada en bajo nivel tiene su acceso desde un objeto Wrapper Desacople en dos procesos ------------------------- Para mantener la coherencia del estado interno del ...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Este módulo contiene diferentes clases que sobrecargar o agregan comportamientos a los controles (widgets) estándar de Wx. Por ejemplo, InstructionListCtrl incorpora métodos que manipulan el orden de las filas (las intrucciones). También recibe un diccionario con el...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- import wx import os _nibbles = {"0":"0000", "1":"0001", "2":"0010", "3":"0011", "4":"0100", "5":"0101", "6":"0110", "7":"0111", "8":"1000", "9":"1001", "A":"1010", "B":"1011", "C":"1100", "D":"1101", "E":"1110", "F":"1111", ...
Python
# -*- coding: utf-8 -*- """ Este es el código de la ventana principal, y el verdadero controlador del programa Contiene diferentes "widgets" (listas, cajas de texto, botones, menúes,...) que pueden producir eventos. Un evento es un click, la presión de una tecla, etc. Los eventos se asociacion a uno (o más) método...
Python
#!/usr/bin/env python # # Copyright 2004 Matt Mackall <mpm@selenic.com> # # Inspired by perl Bloat-O-Meter (c) 1997 by Andi Kleen # # This software may be used and distributed according to the terms # of the GNU General Public License, incorporated herein by reference. import sys, os#, re def usage(): sys.stderr....
Python
import sys import re start_re = "(^.*released under the GPL version 2 \(see below\)).*however due" skip = 0 while True: line = sys.stdin.readline() if not line: break m = re.match (start_re, line) if m: g = m.groups() print g[0] + '.' skip = 5 if skip > 0: sk...
Python
import sys from PySide import QtCore, QtGui from tools import add_color_diff, color_diff class Grapher(QtGui.QWidget): def __init__(self, parent = None): super(Grapher, self).__init__() self.generate = False self.fractal_color = QtGui.QColor(0, 0, 0) self.outer_...
Python
from PySide import QtGui def add_color_diff((r, g, b), color2, multi = 1): red = r * multi + color2.red() green = g * multi + color2.green() blue = b * multi + color2.blue() return QtGui.QColor(red, green, blue) def color_diff(color1, color2): r = color1.red() - color2.red() g = color1.gre...
Python
from distutils.core import setup import py2exe import operator import sys if operator.lt(len(sys.argv), 2): sys.argv.append('py2exe') setup(windows = [{'script': "main.py"}], options = {"py2exe" : {'optimize': 2}}, zipfile = "shared.lib")
Python
# -*- coding: utf-8 -*- ''' Created on 2014年3月3日 @author: jun.chn@gmail.com ''' import subprocess import sys def cmd_util(cmd): p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) res = p.stdout.readlines() if p.wait() == 0: return res return F...
Python
# -*- coding: utf-8 -*- ''' Created on 2014年3月10日 @author: jun.chn@gmail.com ''' # setup.py from distutils.core import setup import py2exe setup(console=['cport.py'])
Python
import urllib import urllib2 import re import json import time from datetime import datetime from urlparse import urlparse, parse_qs from traceback import format_exc from bs4 import BeautifulSoup import xbmcplugin import xbmcgui import xbmcaddon import xbmcvfs addon = xbmcaddon.Addon() addon_version = addon.getAddo...
Python
# This file originally came from # http://www.scons.org/cgi-sys/cgiwrap/scons/moin.cgi/NsisSconsTool # I have edited it as required to work with the Debugmode Frameserver NSIS script. #------------------------------------------ # # NSIS Support for SCons # Written by Mike Elkins, January 2004 # Provided 'as-is...
Python
import os program_files = os.environ['ProgramFiles'] if not program_files.endswith('\\'): program_files += '\\' def SetupEnv(environ, vcver): # Add the most commonly used libs as the default ones to save work in each target. environ['LIBPATH'] = [ '../fscommon', # for the build targets one level...
Python
Import('env_vc9') Import('env_vc9_x64') # ---- libFileIO ---- fio_env = env_vc9.Clone() fio_env['CPPDEFINES'] += ['_LIB'] fio_env['CPPPATH'] = ['../sdks/VegasV2/libFileIO'] fio_env['LIBS'].remove('common.lib') fio_env['LIBS'] += ['rpcrt4.lib'] fio_env['LINKFLAGS'] += ['/IGNOREIDL'] target = 'libFileIO' ...
Python
Import('env_vc9') Import('env_vc9_x64') # ------ Premiere Pro CS4 and below (32 bit build) ---- env_cs4 = env_vc9.Clone() env_cs4['CPPDEFINES'] += ['_USRDLL', 'PRWIN_ENV', 'MSWindows', 'UNICODE', '_UNICODE'] env_cs4['RCFLAGS'] += ['/d', 'PRWIN_ENV'] env_cs4['CPPPATH'] = ['../sdks/Premiere/cs4', '..', '../fsco...
Python
Import('env') Import('env_vc9') Import('env_vc9_x64') # ---- ImageSequence.dll ---- is_env = env.Clone() is_env['CPPDEFINES'] += ['_USRDLL', 'IMAGESEQUENCE_EXPORTS'] is_env['LIBS'] += ['gdiplus.lib', 'vfw32.lib'] target = 'ImageSequence' is_env['PDB'] = target + '.pdb' bin = is_env.SharedLibrary( targ...
Python
Import('env') env = env.Clone() env['CPPDEFINES'] += ['_USRDLL'] env['CPPPATH'] = ['../sdks/Wax', '..', '../fscommon', '../dfsc', '../utils'] env['LIBS'] += ['rpcrt4.lib', 'wininet.lib'] target = 'dfscWaxOut' env['PDB'] = target + '.pdb' bin = env.SharedLibrary( target, [ 'WaxFS.cpp', 'WaxF...
Python
Import('env') env = env.Clone() env['CPPDEFINES'] += ['_USRDLL', 'EXPORT_VIO'] env['CPPPATH'] = ['../sdks/MediaStudioPro/include', '..', '../fscommon', '../dfsc', '../utils'] env['LIBS'] += ['rpcrt4.lib', 'wininet.lib'] target = 'dfscMSProOut' env['PDB'] = target + '.pdb' bin = env.SharedLibrary( target...
Python
Import('env') env.SConscript( [ 'dfsc/SConscript', 'EditStudio/SConscript', 'fscommon/SConscript', 'MediaStudioPro/SConscript', 'NetClient/SConscript', 'NetServer/SConscript', 'Premiere/SConscript', 'PremiereV2/SConscript', 'Vegas/SConscript', 'VegasV2/SConscript'...
Python
Import('env') env = env.Clone() env['CPPDEFINES'] += ['_USRDLL'] env['CPPPATH'] = ['../sdks/Vegas/ffp', '..', '../fscommon', '../dfsc', '../utils'] env['LIBS'] += ['rpcrt4.lib', 'wininet.lib'] target = 'dfscVegasOut' env['PDB'] = target + '.pdb' bin = env.SharedLibrary( target, [ 'VegasFSMain.cp...
Python
Import('env') env = env.Clone() env['CPPDEFINES'] += ['_USRDLL'] target = 'dfsc' env['PDB'] = target + '.pdb' bin = env.SharedLibrary( target, [ 'dfsc.cpp', 'dfsc.def', ] ) env.Install('#/src/dist/bin', bin[0])
Python
SConscript( [ 'dfscacm/SConscript', 'dfscvfw/SConscript', ] )
Python
Import('env') env = env.Clone() env['CPPDEFINES'] += ['_USRDLL', 'DFSCACM_EXPORTS'] target = 'dfscacm' env['PDB'] = target + '.pdb' bin = env.SharedLibrary( target, [ 'codec.c', 'dfscacm.def', env.RES('codec.rc') ] ) env.Install('#/src/dist/bin', bin[0])
Python
Import('env') env = env.Clone() env['CPPDEFINES'] += ['_USRDLL', 'PRWIN_ENV', 'MSWindows'] env['RCFLAGS'] += ['/d', 'PRWIN_ENV'] env['CPPPATH'] = ['../sdks/Premiere/compiler', '..', '../fscommon', '../dfsc', '../utils'] env['LIBS'] += ['rpcrt4.lib', 'wininet.lib'] target = 'cm-dfscPremiereOut' env['PDB'] =...
Python
Import('env') env = env.Clone() env['CPPDEFINES'] += ['_USRDLL'] env['CPPPATH'] = ['../sdks/EditStudio/include', '../sdks/EditStudio/src', '..', '../fscommon', '../dfsc', '../utils'] env['LIBS'] += ['rpcrt4.lib', 'wininet.lib'] target = 'dfscEditStudioOut' env['PDB'] = target + '.pdb' bin = env.SharedLibra...
Python
Import('env') env = env.Clone() env['CPPDEFINES'] += ['_USRDLL'] env['CPPPATH'] = ['../sdks/Wax', '..', '../fscommon', '../dfsc', '../utils'] env['LIBS'] += ['rpcrt4.lib', 'wininet.lib', 'ws2_32.lib'] target = 'DFsNetClient' env['PDB'] = target + '.pdb' bin = env.Program( target, [ 'NetClient.cp...
Python
Import('env') env = env.Clone() env['CPPDEFINES'] += ['_USRDLL'] env['CPPPATH'] = ['../sdks/Wax', '..', '../fscommon', '../dfsc', '../utils'] env['LIBS'] += ['rpcrt4.lib', 'wininet.lib', 'ws2_32.lib'] target = 'DFsNetServer' env['PDB'] = target + '.pdb' bin = env.Program( target, [ 'NetServer.cp...
Python
import maya.cmds as cmds; import maya.mel; cmds.SelectAll(); cmds.Delete(); wallThickness = 2.0; horizontalBoomFudge = 0.1; boomWidth = 12.7 + horizontalBoomFudge;# 0 .5 in to mm height = wallThickness + boomWidth/2.0;# just making it 3 mm to be an even metric number, fudge = 0.6; zipWidth = 5.0; zip...
Python
import maya.cmds as cmds; import maya.mel; originalWidth = 10; boomWidth = 12.7;# 0 .5 in to mm fudge = 0.1; horizontalBoomFudge = 0.1; verticalBoomFudge = 0.1;#need to leave room for overhang and warping. #no longer needed since we aren't printing overhang horizontalChange = boomWidth - originalWidth + horiz...
Python
import maya.cmds as cmds; import maya.mel; cmds.SelectAll(); cmds.Delete(); wallThickness = 4.0; horizontalBoomFudge = 0.1; boomWidth = 12.7 + horizontalBoomFudge;# 0 .5 in to mm height = wallThickness + boomWidth/2.0;# just making it 3 mm to be an even metric number, fudge = 0.6; zipWidth = 5.0; zip...
Python
import maya.cmds as cmds cmds.SelectAll(); cmds.Delete(); wallThickness = 1.0; cameraheight = 35.0; cameraWidth = 43.0; holderWidth = 45.0; nexusHeight = 180.0; nexusThickness = 10.5; nexusHeightFudge = 0.1; lipWidth = 5.0; holeDiameter = 5.0; leftHoleHeight = cameraheight/ 2.0 - 4.0; leftHoleOffset = (c...
Python
import maya.cmds as cmds if (not cmds.objExists("screwMountShader")): screwMountShader = cmds.shadingNode('lambert', asShader=True,name="screwMountShader"); cmds.setAttr("screwMountShader.color",0.960784,0.0753556,0.0753556,type="double3"); wallThickness = 0.7; baseThickness = 1.4; boardBuffer = 1.0;#dist...
Python
import maya.cmds as cmds cmds.SelectAll(); cmds.Delete(); height = 43.0 circleDiameter = 120 motorDiameter = 82.5 baseThickness = 2#area that is square topCylinderHeight = 6; cubeSide = 120 wallThickness = 4 screwHoleDiameter = 5.0 strutRadius = 20 ventDiameter = 30.0 holeDistance = 105#refers to x/y not...
Python
import maya.cmds as cmds; cmds.SelectAll(); cmds.Delete(); def pin_solid( h=10.0, r=4.0, lh=3.0,lt=1.0): curve2 = cmds.curve(d=1,ep=[ (0,0,0), (r,0,0), (r,h-lh,0), (r+lt/2.0,h-lh+0.25*lh,0), (r+lt/2.0,h-lh+0.50*lh,0), (r-lt/2.0,h,0), (0,h,0), ...
Python
import maya.cmds as cmds; import pymel.core as pm; cmds.SelectAll(); cmds.Delete(); pulleyRadius = 25; ropeDiameter = 3; lipHeight = 1; screwDiameter = 7.9375;#5/16 in bolt to mm wallthickness = 5; washerThickness = 1.5875;#5/16 in bolt washer = 1/16 in thickness to mm pulleyheight = ropeDiameter + 2*li...
Python
import maya.cmds as cmds; import maya.mel; fudge = 0.1; holeDiameter = 3.7084;#6 screw chart width oldHoleDiameter = 3.0; newHoleDiameter = holeDiameter + fudge; ratio = newHoleDiameter / oldHoleDiameter; cmds.SelectAll(); cmds.Delete(); cmds.file('C:/Users/Santiago/Documents/maya/scripts/customMount.STL...
Python
import maya.cmds as cmds; # cmds.SelectAll(); # cmds.Delete(); wallthickness_mount = 2.0; #taken from strykercode as a starting point def createScrewMount(x,y): motorHoleRadius1 = 3.2/2.0; #actual = 3 adding fudge motorHoleRadius2 = 6.2/2.0;#actual = 6 adding fudge curve2 = cmds.curve(d=1,ep=...
Python
import maya.cmds as cmds cmds.SelectAll(); cmds.Delete(); height = 10.0 cubeSide=208 circleDiameter = 232 wallThickness = 1 fanDiameter = 180 fanTubeHeight = wallThickness*2 tubeDiameter = 101.6#4 in circleOutter = cmds.polyCylinder(sa=100,r=circleDiameter/2.0+wallThickness,h=height)#polypipe bug, where h...
Python
import maya.cmds as cmds import mount_2826_6 as mount; cmds.SelectAll(); cmds.Delete(); length = 50; height = 10.0; taperAmount = 1.6619/4.3146; baseHoleRadius = (3.2/2.0); #hole width is 3 mm using 4.5 for fudge factor baseHoleWidth = baseHoleRadius*2.0; closerHoleDistance = 46.23 + baseHoleWidth; fartherH...
Python
import maya.cmds as cmds; import maya.mel; cmds.SelectAll(); cmds.Delete(); wallThickness = 4.0; horizontalBoomFudge = 0.1; boomWidth = 12.7 + horizontalBoomFudge;# 0 .5 in to mm height = wallThickness + boomWidth/2.0;# just making it 3 mm to be an even metric number, fudge = 0.6; zipWidth = 5.0; zip...
Python
import maya.cmds as cmds; import createPin; cmds.SelectAll(); cmds.Delete(); outsideDiameter = 85.24; insideDiameter = 74.28; heightToTopPeg = 7.0; pegDiameter = 4.2; peg2peg = 63.9; pegOffset = 5.6;#peg isn't in center of circle #height = 2*(heightToTopPeg - pegDiameter) + pegDiameter; height = 9.3;#c...
Python
import maya.cmds as cmds; cmds.SelectAll(); cmds.Delete(); outerThickness = 7.5; outerLength = 11; innerThickness = 2.88; stickLength = 131; screwDiameter = 1.65; wireThickness = 3.15; wireHolderWidth = 20.0 + outerThickness; wireHolderThickness = 6; wirePlacementOffset = 1.0;#position below stick where ...
Python
import maya.cmds as cmds import pymel.core as pm; cmds.SelectAll(); cmds.Delete(); pulleyRadius = 25; ropeDiameter = 3*1.15; lipHeight = 1; lipWall =0.1; screwDiameter = 7.9375*1.10;#5/16 in bolt to mm boltMountDistance = pulleyRadius / 2;#purposefully using integer division here to get even nubmer wallth...
Python