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 bool TryAttachVisualStudioDebugger(int processId) | |
| { | |
| try | |
| { | |
| // Get the DTE object for the current Visual Studio instance | |
| var dte = GetCurrentVisualStudioDTE(); | |
| if (dte == null) | |
| return false; | |
| // Get the debugger |
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
| # print all tz_abbreviations from ptz | |
| from datetime import datetime | |
| from zoneinfo import ZoneInfo | |
| # get all tz_abbreviations from ptz | |
| from zoneinfo import available_timezones | |
| tz_abbreviations = {} | |
| utc_now = datetime.utcnow() | |
| for tz in sorted(available_timezones()): | |
| try: | |
| local_time = utc_now.replace(tzinfo=ZoneInfo("UTC")).astimezone(ZoneInfo(tz)) |
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
| # %pip install ifcopenshell | |
| # %pip install ifcpatch | |
| import ifcopenshell | |
| # Load an IFC file | |
| ifc_file = ifcopenshell.open("Snowdon Towers Sample Architectural.ifc") | |
| import ifcpatch | |
| from ifcpatch.recipes import Ifc2Sql | |
| # For SQLite | |
| patcher = Ifc2Sql.Patcher( |
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 fastapi import FastAPI, HTTPException | |
| import duckdb | |
| import pandas as pd | |
| import os | |
| app = FastAPI() | |
| # Kết nối đến DuckDB file (hoặc dùng ':memory:') | |
| conn = duckdb.connect("my_database.duckdb") | |
| @app.get("/") |
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
| $parentKey = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Bluetooth\ExceptionDB\Addrs" | |
| if (Test-Path $parentKey) { | |
| Get-ChildItem -Path $parentKey | ForEach-Object { | |
| Remove-Item -Path $_.PsPath -Recurse -Force | |
| } | |
| Write-Output "All subkeys under 'Addrs' deleted." | |
| } else { | |
| Write-Output "'Addrs' key not found." | |
| } |
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
| public static List<XYZ> ComputeConvexHull(List<XYZ> points) | |
| { | |
| if (points == null || points.Count < 3) | |
| throw new ArgumentException("At least 3 points are required to compute a convex hull"); | |
| List<XYZ> hull = new List<XYZ>(); | |
| // Find the leftmost point | |
| XYZ leftmost = points[0]; | |
| foreach (var point in points) |
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
| import psutil | |
| def get_all_ports(): | |
| ports = set() | |
| for proc in psutil.process_iter(['pid', 'name']): | |
| try: | |
| connections = proc.net_connections() | |
| for conn in connections: | |
| if conn.laddr.port: | |
| ports.add(conn.laddr.port) |
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 Autodesk.Revit.Attributes; | |
| using Autodesk.Revit.DB; | |
| using Autodesk.Revit.UI; | |
| using Autodesk.Revit.UI.Selection; | |
| using Autodesk.Revit.DB.Analysis; | |
| [Transaction(TransactionMode.Manual)] | |
| public class PickCurveAndCreateDirectShape : IExternalCommand | |
| { | |
| public Result Execute( |
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
| class ModelData2 { | |
| constructor(viewer) { | |
| this._modelData = {}; | |
| this._viewer = viewer; | |
| } | |
| init(callback) { | |
| let _this = this; | |
| _this.getAllLeafComponents(function (dbIds) { | |
| let count = dbIds.length; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder