2019年11月11日
最近、SOLIDの原則について考えていて、その有用性に疑問を感じている。 SOLIDの原則は曖昧で、範囲が広すぎて、混乱を招き、場合によっては完全に間違っている。しかし、これらの原則の動機は正しい。問題は、ニュアンスの異なる概念を簡潔な文に落とし込もうとすることにあって、翻訳の過程で価値の大部分を失っているのだ。 これはプログラマーを間違った道へと導いてしまう(私にとっては確かにそうだった)。
おさらいとして、SOLIDの原則は以下の通りである:
2019年11月11日
最近、SOLIDの原則について考えていて、その有用性に疑問を感じている。 SOLIDの原則は曖昧で、範囲が広すぎて、混乱を招き、場合によっては完全に間違っている。しかし、これらの原則の動機は正しい。問題は、ニュアンスの異なる概念を簡潔な文に落とし込もうとすることにあって、翻訳の過程で価値の大部分を失っているのだ。 これはプログラマーを間違った道へと導いてしまう(私にとっては確かにそうだった)。
おさらいとして、SOLIDの原則は以下の通りである:
UAbilitySystemComponent* ASC = UAbilitySystemBlueprintLibrary::GetAbilitySystemComponent(TargetActor); | |
if (!IsValid(ASC)) | |
{ | |
return; | |
} | |
// Create a Query to specify the GE to be removed. | |
// Similar to the implementation of UAbilitySystemComponent::RemoveActiveGameplayEffectBySourceEffect, but with additional check by SourceObject. | |
FGameplayEffectQuery Query; | |
UAbilitySystemComponent* InstigatorAbilitySystemComponent = ASC; |
FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked<FAssetRegistryModule>("AssetRegistry"); | |
TArray<FAssetData> AssetData; | |
AssetRegistryModule.Get().GetAssetsByClass(UBlueprint::StaticClass()->GetFName(), AssetData, true); | |
for (FAssetData& Asset : AssetData) | |
{ | |
if (Asset.ObjectPath.ToString().StartsWith("/Game/")) |
th { | |
padding: 0; | |
} | |
td { | |
padding: 0; | |
} | |
table { | |
margin: 0 0 1em 0; |
import adsk.core, adsk.fusion, traceback | |
import os.path, sys | |
def run(context): | |
ui = None | |
try: | |
app = adsk.core.Application.get() | |
ui = app.userInterface | |
# get active design |
# FusionAPI_python Import3DCadFiles ver0.0.1 | |
# Author-onionmk2 | |
import adsk.core, adsk.fusion, traceback | |
import os.path | |
def run(context): | |
ui = None | |
try: | |
app = adsk.core.Application.get() |
/* begin------------幅を広げる------------*/ | |
/* デフォのcssがmax-width: 600px; のような値を入れてくるせいで無駄に狭い。デフォのcssを殺して最大化。 */ | |
[data-testid="primaryColumn"] { | |
max-width: -webkit-fill-available; | |
} | |
/* URLが https://twitter.com/home なら子セレクタ(>)だけに限定できる。 | |
しかし それ以外のURLでは、 子孫セレクタで一括指定する以外修正できないので、やむなく子孫セレクタを使用。*/ | |
[data-testid="primaryColumn"] div { | |
max-width: -webkit-fill-available; | |
} |
#from typing import Any, Iterable | |
import Rhino | |
import rhinoscriptsyntax as rs | |
import scriptcontext as sc | |
doc = Rhino.RhinoDoc.ActiveDoc # type: Rhino.RhinoDoc | |
objectTable = doc.Objects # type: Rhino.DocObjects.Tables.ObjectTable | |
selected_objects = objectTable.GetSelectedObjects(includeLights=False, includeGrips=False) # type: Iterable[Rhino.DocObjects.RhinoObject] |
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | |
; #Warn ; Enable warnings to assist with detecting common errors. | |
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | |
; ! is Alt. Alt +2 が押されるまで待機ということ。 | |
!2:: | |
SysGet, monitor1, Monitor, 1 | |
SysGet, monitor2, Monitor, 2 |
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | |
; #Warn ; Enable warnings to assist with detecting common errors. | |
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | |
; ! is Alt. Alt +1 が押されるまで待機ということ。 | |
!1:: | |
SysGet, monitor1, Monitor, 1 | |
SysGet, monitor2, Monitor, 2 |