This file contains hidden or 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
| +--------------------------+----------+------------------------+ | |
| | Benchmark | win-main | main | | |
| +==========================+==========+========================+ | |
| | 2to3 | 342 ms | 171 ms: 2.01x faster | | |
| +--------------------------+----------+------------------------+ | |
| | async_generators | 436 ms | 269 ms: 1.62x faster | | |
| +--------------------------+----------+------------------------+ | |
| | asyncio_tcp | 659 ms | 301 ms: 2.19x faster | | |
| +--------------------------+----------+------------------------+ | |
| | asyncio_tcp_ssl | 1.82 sec | 801 ms: 2.27x faster | |
This file contains hidden or 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
| +--------------------------+----------+------------------------+ | |
| | Benchmark | win-main | main | | |
| +==========================+==========+========================+ | |
| | 2to3 | 342 ms | 174 ms: 1.97x faster | | |
| +--------------------------+----------+------------------------+ | |
| | async_generators | 436 ms | 262 ms: 1.66x faster | | |
| +--------------------------+----------+------------------------+ | |
| | asyncio_tcp | 659 ms | 304 ms: 2.17x faster | | |
| +--------------------------+----------+------------------------+ | |
| | asyncio_tcp_ssl | 1.82 sec | 805 ms: 2.26x faster | |
This file contains hidden or 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
| ## Бессмертные объекты и субинтерпретаторы | |
| Интересный факт - если посмотреть код реализации субинтерпретаторов, то никаких отсылок к бессмертным объектам найти не удастся. При этом они являются неотъемлемой основой субинтерпретаторов в CPython. | |
| Как это происходит? | |
| Как уже упоминалось выше, к бессмертным объектам относятся: | |
| 1. *статически* выделенные константы - `None`, `False`, `True`, `...`, `NotImplementedType`, `0`, `1`, `''`, `b''`, `()`. (`object.c:_Py_GetConstant_Init`) | |
| 2. целые числа в диапазоне [-5, 256] (`pycore_runtime_structs.h:_Py_static_objects`) | |
| 3. символы в кодировке latin1 | |
| 4. статические типы (`_Py_TPFLAGS_STATIC_BUILTIN`), а также их компоненты, такие как, базовый класс, список базовых классов, `MRO` (method-resolution order) | |
| 5. интернированные строки и идентификаторы (`pycore_runtime_structs.h:_Py_cached_objects`) |
This file contains hidden or 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
| { | |
| "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", | |
| "blocks": [ | |
| { | |
| "alignment": "left", | |
| "newline": true, | |
| "segments": [ | |
| { | |
| "type": "text", | |
| "style": "plain", |
This file contains hidden or 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 func(): | |
| raise ConnectionError | |
| # 1 вариант - обрабатывает и подавляет исключение | |
| try: | |
| func() | |
| except ConnectionError as exc: | |
| print('exception: ', type(exc), exc) | |
| # получите сообщение: | |
| # exception: <class 'ConnectionError'> |
This file contains hidden or 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
| using Serilog; | |
| using Serilog.Core; | |
| using Serilog.Events; | |
| Log.Logger = new LoggerConfiguration() | |
| .WriteTo.Console(formatProvider:new GuidFormatter()) | |
| .Destructure.With<GuidDestructuringPolicy>() | |
| .Destructure.ByTransforming<CustomClass>(Helper.ToString) | |
| .Destructure.ByTransforming<CustomStruct>(Helper.ToString) | |
| .CreateLogger(); |
This file contains hidden or 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
| <# | |
| .SYNOPSIS | |
| Generates a project change log file. | |
| .LINK | |
| Script posted over: | |
| http://open.bekk.no/generating-a-project-change-log-with-teamcity-and-powershell | |
| #> | |
| # Where the changelog file will be created | |
| #$changelogFile = "%system.teamcity.build.tempDir%\changes_%teamcity.build.id%.txt" |
This file contains hidden or 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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using System.Windows; | |
| using System.Windows.Controls; | |
| using DevExpress.Xpf.Grid; | |
| using GUI.Params.DynamicTable.Impl; |
This file contains hidden or 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 distutils.core import setup | |
| from distutils.dir_util import copy_tree | |
| from py2exe.build_exe import py2exe | |
| import glob | |
| import os | |
| import zlib | |
| import shutil | |
| import time | |
| import shutil | |
| import enthought.tvtk |
This file contains hidden or 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
| private static function getSpriteImpl(filename : String, width : Float, | |
| resize : IResizeBitmapData) : FlxSprite | |
| { | |
| var key = resize.key(filename, width); | |
| if(!FlxG.bitmap.checkCache(key)) | |
| { | |
| if(cacheWarning) | |
| { | |
| trace([filename, key, "Not found"]); | |
| } |
NewerOlder