Pointer Provenance in Rust vs. C++: Pointers Are Not Just Glorified Ints
Comments
Join the discussion →Comments
Join the discussion →I made custom class for filterable JComboBox. I tried with 10000 items and it works pretty well (nothing is laggy) although I won't even need that much items for my usecase. Then I tried implementing highlighting of a matching term. Idea is to match string that I'm typing in textfield to part of item and to highlight that matching part. I implemented it and it works but the problem is that it is laggy (takes a lot of time to open popup and to highlight items) when combobox has apx. 1000 items and more. How can I improve speed so that it is not laggy? FilterableComboBox import javax.swing.*; im
Join the discussion →medibaにバックエンドエンジニアとして所属している@mdbr92です。 肩書はバックエンドエンジニアですが、実際にはフロントエンド・API・バッチ処理などアプリケーション全体の開発やアーキテクチャ選定・開発環境の整備などをよく担当しています。 はじめに 私がこれまで開発に携わったTypeScriptを採用したいくつかのプロダクトでは、tsconfig.json の paths を使ったパスエイリアス設定を利用しています。 パスエイリアス設定を利用して、たとえば ../../../../lib/log.ts のような相対パスでimport文を記述した際の指定ミスや可読性低下を避け、...
Join the discussion →I am currently testing additionalOverflowItems with the expectation that it behaves as follows: Keep UIBarButtonItem instances visible directly on the toolbar as icons whenever there is sufficient space. Only move items into the overflow menu when there isn't enough screen real estate. In iOS 26, additionalOverflowItems behaves exactly as described above. However, in iOS 18, the system tends to aggressively move all UIBarButtonItem instances into the overflow menu regardless of available space. Is this change in layout behavior documented anywhere? Can we rely on iOS 26 and future releases mai
Join the discussion →Comments
Join the discussion →Comments
Join the discussion →I understand this is incredibly incomprehensibly far into the future so any surviving civilization that made it through the degenerate era would be so far ahead of us they would come across as godlike. But if protons do indeed decay could any intelligence no matter who they think they are within the laws of physics become independent of baryonic matter and exist as only leptons and no Baryonic form at all I always thought of post biological life as being baryonic even if post organic.
Join the discussion →My Azure Data Lake Storage folder contains Parquet files (snappy compressed) from Kafka Connect. I made a shortcut from the Azure Data Lake Storage to Fabric Lakehouse and work on the files in Fabric Notebook, using Spark. I combine the many small files to a few bigger files. I tried reading the small files into df, repartitioned it and writing into snappy compressed Parquet (attempt #1). I also tried grouping the small files into my desired size, then read the group and coalesce into 1 (attempt #2). The small files are 9GB, but the target files of both approaches up to 21GB. What do I do wron
Join the discussion →Comments
Join the discussion →I am trying to create an Azure Policy to track the "Send scan results to Log Analytics" Microsoft Defender for Storage setting, and unfortunately, having a lot of trouble finding information on the correct policy rule evaluation paths. Desired Behavior: I'd like the policy to track that the "Send scan results to Log Analytics" option is enabled and that a log analytics workspace has been selected. I'm seeking help on the correct invocation of detail type and existence condition aliases to get this to work. This is what I have so far: "policyRule": { "if": { "field": "type", "equals": "Microsof
Join the discussion →submitted by Orwi to science 20 points | 3 comments https://www.nature.com/articles/d41586-026-03586-y
Join the discussion →Comments
Join the discussion →submitted by homesweethomeMrL to science 45 points | 2 comments https://www.discovermagazine.com/newly-discovered-brittle-star-species-found-beside-a-9-5-million-year-old-whale-fall-49901 cross-posted from: feddit.online/…/newly-discovered-brittle-star-spe… Learn more about a new species of brittle star found beside a 9.5-million-year-old whale carcass in Denmark.
Join the discussion →Comments
Join the discussion →So, cognitive metaphors abound in real world cultures. For an example in most Western cultures, there's the association of motion through time with physical motion forward. We use the turn of phrase "forward in time" to refer to the future, but, in reality, forward motion and passage of time are ultimately disconnected. This can be demonstrated by referencing a similar cognitive metaphor in Chinese cultures, where the future is conceived as being "below" and the past is "above." I think a productive worldbuilding activity, for the purpose of building fictional cultures, is to explore some unus
Join the discussion →Given the following index tensor: id = ([[0, 1], [0, 2], [1,2]]) that corresponds to the tensor: val = ([[a, b, c], [e, f, g], [h, i, j]]) such that element [a, b, c] has an index of [0,1], element [e, f, g] has an index of [0, 2], ectara. How can I return a tensor where in index representation it is new_ten_id = ([[[0, 1] + [0, 2]], [[1, 2] + (-[0, 1])], [(-[0, 2]) + (-[1, 2])]]) and the tensor of values would be new_ten_val = ([[a+e, b+f, c+g], [h-a, i-b, j-c], [-e-h, -f-i, -g-j]]). ----- I have tried the following code: n_part = 3 F_sum_empty = torch.zeros(n_part, 3) F_sum = torch.scatter_a
Join the discussion →Using OpenLayers since 2015, I moved smoothly to every latest version up to v10.7. The bug occurs since v10.8 (and later to v10.11). The instruction that fails -in try...catch- is: import OLMap from 'https://esm.sh/[email protected]/Map.js'; import View from 'https://esm.sh/[email protected]/View.js'; import { fromLonLat, transformExtent} from 'https://esm.sh/[email protected]/proj.js'; function makeView(center, zoom) { try { const OUTPROJ = 'EPSG:3857'; //ol-featureprojection = Pseudo-Mercator const GPSPROJ = 'EPSG:4326'; //geojson-dataprojection = GPS geographic console.log(`OUTPROJ ${OUTPROJ}, zoom ${zoom}, cen
Join the discussion →Since its earliest days, Python allowed dynamically importing modules via builtins.__import__(): np = __import__('numpy') Although this is now discouraged in favour of importlib.import_module(). Python 3.15 introduced lazy imports, with new lazy import and lazy from syntax: lazy import numpy as np Is there an equivalent to __import__() or import_module() to dynamically and lazily import modules? (I've been here and here, but there's no mention of a dynamic mechanism. And the builtin functions page only mentions __import__().)
Join the discussion →Comments
Join the discussion →Comments
Join the discussion →After reading this Q&A, I decided to try using Ellipsis as a function argument default: def func(arg: int = ...): print(arg) However, Pyright complains: Expression of type "EllipsisType" cannot be assigned to parameter of type "int" "EllipsisType" is not assignable to "int" Because ... isn't an int. So I tried using a Union: def func(arg: int | Ellipsis = ...): print(arg) Pyright still complains: Variable not allowed in type expression (variable) Ellipsis: Unknown It only works if the function body is a literal Ellipsis (not print(arg) or even pass): def func(arg: int = ...): # happy pyright!
Join the discussion →estoy aprendiendo Python en el instituto, y tenía que hacer un programa de gestión de varios diccionarios, así que decidí guardarlos todos en varios archivos .json. Sin embargo, los archivos se guardan en la carpeta raíz del curso, no en la carpeta del proyecto. Había definido estas funciones para guardar y cargar los diccionarios: def guardar(dic, e): with open(f"diccionario_{e}.json", "w") as j: json.dump(dic, j, indent=2) def cargar(e): try: with open(f"diccionario_{e}.json") as j: return json.load(j) except (OSError, IOError): return dict() e es el input para decidir cual de los diccionari
Join the discussion →Comments
Join the discussion →I am building a React Native app to manage routers. While demo mode works perfectly and detects the Netis NC63-v4, live mode fails with the error: 'Cannot read property 'getGatewayIPAddress' of null'. The app shows 'Unsupported router at 192.168.1.1'. However, I can log into the router's web interface just fine, so network connectivity is not the issue. I suspect the issue is in my detect.ts file where I parse the gateway or handle API responses from the router. How can I properly handle the gateway lookup for this model? Detect.ts import { BRANDS, RouterInfo } from './types'; interface NetisM
Join the discussion →Comments
Join the discussion →Comments
Join the discussion →I have a question about memory deallocation in a program that uses the fork and exec functions in the child process. I do not know how to free the memory if the exec operation is successful, as the corresponding code is never executed. If the exec operation fails, memory deallocation works correctly. My code is as follows: #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <string.h> #include <wait.h> int main() { int L=50; pid_t pid=fork(); if(pid == 0) { int l=2; ++l; // NULL element char ** v = malloc(sizeof(char **) * l); for(int j=0; j<l-1; j++) { v[j]= malloc(sizeof(char
Join the discussion →This code is an excerpt from a script I wrote: import sys import sqlalchemy as db #import sqlite3,sqlalchemy,sys DBfile = "/etc/SQLAlchemy1_users.db" DBurl = "sqlite:///%s" % DBfile # Defining the Engine try: engine = db.create_engine(DBurl,echo=True) #except (sqlite3.OperationalError,sqlalchemy.exc.OperationalError) as OpenErr: except: sys.stderr.write("ERROR: Cannot open file %s\n" % DBfile) else: print("Database engine created") As part of my testing I'm deliberately trying to create a database file in a directory for which I do not have write permissions. Initially I tried trapping the spe
Join the discussion →Comments
Join the discussion →I have created an iOS keyboard extension bundled with a Capacitor companion app ("editor"). The extension and the editor share an app group such that the editor can pass instructions to the extension using a small config file. Now I want to be able to export word usage data (stored in the extension's UserDefaults.standard space) as JSON to the editor. I understand it that Apple heavily restricts data flow from an extension to the outside world. What I have managed to accomplish so far is this: The user taps a textarea in the editor, which brings up the custom keyboard displaying an "export" bu
Join the discussion →