I'm implementing a C# WindowsForms application in the following environment. VisualStudio2022 .NET 9.0 Vortice.Direct2D1 (3.8.3) I requested code from Copilot to draw fonts using Direct2D in Windows.Forms, and received the following code. using Vortice.Direct2D1; using Vortice.DirectWrite; using Vortice.Mathematics; using Vortice; namespace WinFormsFlickeringSample { public partial class Form1 : Form { private ID2D1Factory _d2dFactory; private IDWriteFactory _dwFactory; private ID2D1HwndRenderTarget _renderTarget; private IDWriteTextFormat _textFormat; private ID2D1SolidColorBrush _brush; publ
Sizing info is a class that has properties orientation, device screen and the screen size. I am just trying to understand the code below: final Widget Function(BuildContext context, SizingInfo sizingInfo) builder; How would one use the sizingInfo for responsive and adaptive design?
The plot of Glasser's function (see Wolfram Math World) $g(x)=\int_0^x \sin(t \sin(t))dt$ produces the positive integers. Is there a function $P(x)=\int_0^x h(t) dt$ whose plot produces only primes in a similar way?. Circular functions $h(t)$ do not seem to work.
When I run npm i a-package package.json contains a new line at the end, but when I format that file with Json Language Feature the default json formatter of vscode, that line is removed. This causes unnecessary conflicts within our environment because we also formatOnSave config. If the last developer saved the package.json, the line gets removed, if they installed a package, the line comes back. There is an issue related to it: https://github.com/npm/npm/issues/18545 but it isn't solved and npm moved its cli to another repo. Json default formatter doesn't have an option to add a new line at t
I have a Flutter app with a repository that has these methods: Future<List<Station>> getAllStations(); Future<Station> getStationDetail(String id); The problem is that getAllStations() returns the base station list, but the incident reports are not always loaded. For some features, I need a list where every station already includes its full details, including its reports. What is the simplest way to create a getAllDetailedStations() method in the repository?
I am going to develop a large application in .Net 8.0 Clean Architecture. Web APIs will be consumed by React Application and Mobile Application.Heavy reports processing, bulk insert, update, upload will be handled by application layer. Complex business logics will be handled by stored procedures. I am observing that I am just doing rewriting and populating entities models unnecessary from Dtos, I want to populated DTOs via procedures output and vice versa in case of insert update. Will this a good approach for a enterprise level application?
I am trying to set up a call table referring to class methods but I cannot find the appropriate languade solution. # class instruction table for assembler # class variable instrList contains instruction, # followed by a reference to a class function/method that return the size class Instr(): instrList=[ ["DATA", self.data_l], ["EQU", self.nul_l], ["LDK" , self.two_l], ["LDKL", self.four_l], ] def __init__(self): sorted(self.instrList) for instr in instrList: print(instr) def size(self, line): # here come code that finds the matching entry in the instrList # and then call entry[1](line[3]) to r
Recently, World Leaks published documents on the dark web related to Apple’s 630G hardware. Would it be possible to use this hardware documentation as a reference to design a RISC-V-based operating system similar to iOS, with the same level of smooth performance as iOS and a feature set as extensive as Android?
I downloaded the source code from https://www.codeweavers.com/crossover/source but I don't know how to compile it. After extracting there are a lot of folders in it. Does compiling it requires manual creation of make files? I already have Xcode installed on my Mac. I suspect that compiling it requires compilation of the individual components?
I am working on a React app using react-router-dom. I have a layout component that renders a Navbar, an Outlet, and also accepts children. I also have a reusable Hero component for page headers. The code works, but I am confused about the correct structure. Should a layout component use Outlet, children, or both? Also, should reusable page components like Hero be kept separate from the routing layout? Here are the relevant files: import { Navigate, Outlet, Route, Routes, useLocation } from "react-router-dom"; import { useAuth } from "../context/AuthContext"; import Navbar from "../components/N
I have been trying to include bash command substitution in the Arguments tab of Run or Debug Configuration, but contrary to applying this from a bash shell in with the built program, no substitution (e.g. -a $(date +%s) is performed, and hence the program under development raises an error during getopt parsing. I'm wondering a bit about that. Apparently, - when executed from within Eclipse - the program gets the arguments without the bash layer. Thinking about that: yes, bash isn't needed to execute a program. Question: is it possible to establish this such, that command substitution is done b
I am trying to create a custom WordPress template, and I want to combine two PHP snippets. I would like to display a list of 3 posts with a number emoji prefixed to each title. Example desired output: 1️⃣ POST TITLE 1 2️⃣ POST TITLE 2 3️⃣ POST TITLE 3 Part 1: <?php /** * Template Name: emojis LINKS SCRAPPER */ global $post; $counter = 1; $myposts = get_posts( array( 'orderby' => 'rand', 'posts_per_page' => 3, 'offset' => 0, 'category' => 187 ) ); if ( $myposts ) { foreach ( $myposts as $post ) : setup_postdata( $post ); ?> // ...do something... <?php the_title(); ?> <?php endforeach; wp_reset_
I need to replicate a SAS behaviour in PySpark. In SAS the merge between two datasets is not a 1*1 key merge but a m*n key merge involving multiple keys. The datasets can have many-to-many join keys. In SAS the merge is an iteration of 5 loops, each a different one. There are 5 key fields on which the merge happens, after each iteration one key from 5 are reduced: Iteration 1 Key - a, b, c, d, g Iteration 2 Key - a, b, c, d Iteration 3 Key - a, b, c, Iteration 4 Key - a, b Iteration 5 key - a deal table (right): a b c d g deal_id NYB Subs CI Corporate Wholesale 1 abcefgh NYB Subs CI Corporate
I have an use case where I need to replicate a sas behaviour into pyspark. In Sas, the Merge between two datasets are happening and its not 1*1 key merge. Its a m*n key merge involving multiple keys. What I meant is, the datasets can have many to many join keys. In sas, the merge is happening in a iteration of 5 loop each loop is having a different. There are 5 keys fields on which the Merge happens, after each iteration the one key from the 5 keys are reduced. Iteration 1 Key - a, b, c, d, g Iteration 2 Key - a, b, c, d Iteration 3 Key - a, b, c, Iteration 4 Key - a, b Iteration 5 key - a dea
I'm using Aspose Words for automated mail merging and we have several templates (.dot files) that have an included template (mostly in the footer using the {INCLUDETEXT} tag). This "sub" template is used for having a standard footer across multiple parent templates. The problem is that the merge fields in this sub-template are not populated during the merge operation. This works when using MS Word to do the merge but Aspose just treats it like regular text insertion so the merge document will just insert the sub-template along with the mail merge fields as raw text (e.g. <<FIRSTNAME>> <<LASTNA
When I try to deploy my Google Cloud Run application inside Google Cloud Shell today, there comes a strange error that confused me. The same deployment command worked for me for a long time. It appears now it is fetching some account that is having a similar username as my account from Google side, and giving an error during the deployment. My account is XXXXXXX2005 but it is showing an error fetching email address df380dc9e5|[email protected]. However, a new build in Cloud Build is successfully triggered as shown in the build list. I masked some details in the log, but the idea should be
So, I am taking the Google Data Analytics class and I'm learning about using SQL and BigQuery. Some of these examples got me questioning how they work though. Take this for instance, so I know the FROM statement sets the warehouse orders dataset as an alias 'orders'. But the JOIN statement? It seems to call on the warehouse dataset and join it with the orders dataset based off the fact both datasets have a warehouse ID in them. I understand what it does, just not the why. What does the ON function do here? Why the warehouse after the dataset id? Is it another alias? I am just a little confused
I'm building a price comparison application for the US and UK. The app should allow users to search for a product (for example "iPhone 16 Pro") and compare prices across multiple retailers such as Amazon, Walmart, Target, Best Buy, Costco, and others. The product data I need includes: Product title Current price Product image Description/specifications Product URL Store name Availability (if available) My current idea is to build my own backend API that stores normalized product data and serves it to my mobile/web app. Instead of integrating with each retailer individually, I'm looking for a r
I moved my code over Delphi versions without change. The upgrade from Delphi 10.4 to Delphi 13 failed my DUnitX testcases. Working code Delphi 10.4: assert.AreEqual(aList.Count, 3, 'Items count OK ?'); New working code Delphi 13.1: assert.AreEqual<Integer>(aList.Count,Integer(3), 'Items count OK ?'); The compiler cannot determine the type parameter for the generic any longer. Has my old solution been wrong?
When I set a LazyRow inside a LazyColumn, I was able to hide the LazyRow on the first row by scrolling to the list on the second row and focusing on it, but when I scroll horizontally, the LazyRow that was hidden reappears. When I scroll horizontally, the `LaunchedEffect` with `focusedIndex` set isn't being called, and I don't understand why the scroll position automatically resets. focusedIndex = remember {mutableStateOf<Int?>(null)} LazyColumn( state = listState, modifier = Modifier .fillMaxSize() .weight(1f), contentPadding = PaddingValues( top = 0.dp, bottom = 0.dp ), ) { itemsIndexed(data
What I'm trying to do Run gemini-3.1-flash-lite as a remote model in BigQuery ML (ML.GENERATE_TEXT / AI.GENERATE) from a dataset in the EU, keeping all processing in the EU for GDPR reasons. gemini-2.5-flash-lite works fine this way. gemini-3.1-flash-lite does not — and I've narrowed down why, but can't find a supported way around it from within BigQuery. Setup Dataset location: eu (multi-region) Cloud Resource connection created in eu, its service account granted roles/aiplatform.user APIs enabled: bigquery, bigqueryconnection, aiplatform gemini-2.5-flash-lite remote model in the same dataset
I am building an e-commerce app using Android Kotlin Jetpack Compose with Admin Panel. If an admin updates the status of order, how will my android app know the status of the order to send a push notification? My notifications are working when the app is in awake mode and places an order. I want push notifications like amazon and flipkart; it should always show a notification of order status even if the app is not running in the foreground. Here is my code implemented for notification: class MyFirebaseService : FirebaseMessagingService() { override fun onNewToken(token: String) { super.onNewTo
The drag works just how I'd like it to, but I'd like it not to trigger open link when dragged. I've tried fiddling around with my little knowledge of JavaScript, however I just can't seem to get it to work how I'd like it to. Here's the code I'm working with: // here you tell InteractJS which class of items you'd like to be draggable interact('.draggable') .draggable({ listeners: { // when a user drags the object ('on dragmove') run this function move: dragMoveListener, // call this function on every dragend event end (event) { console.log("item dropped!") } } }) function dragMoveListener (eve
The Sparkplug 3.0.0 spec states that a host application must open a client connection to the MQTT server with a will message for spBv1.0/STATE/application_id and payload {"online": false, "timestamp": <millis>}, subscribe to its own spBv1.0/STATE/application_id topic, then publish to that topic with {"online": true, "timestamp": <millis>}. In a high-availability setup there would be multiple instances of the host application that each need their own client connection to the MQTT broker. When one of those instances crashes, the broker would publish its will message with "online": false, conflic
I'm making a personal website; and I wanted to make some buttons that link to other pages, but I don't know how to get them aligned. I have 6 total buttons, but they are not the same size, and they aren't spaced evenly in either direction. How can I get them to line up in a 2*3 order? I want there to be 3 rows each containing 2 buttons but I don't know how to do that and make it spaced evenly. Thank you and sorry for my bad question format. Here is a picture of what it looks like: Here is a rough idea of what i want it to look like: Here's the code snippet: #menue { border: 3px solid; border-c
I want to set up a MongoDB architecture using only two physical servers, without the possibility of adding a third server or an external arbitrator. My System: Server 1 will be my main server and everything will be written to it. Server 2 will be my backup server and will copy data from Server 1. I want Server 2 to automatically become "writable" when Server 1 completely shuts down or crashes. My Questions: I only have two servers. Is it possible for MongoDB's own system to automatically make the second server "writable" when the first server completely shuts down or crashes? In other words, c
I am trying to understand whether the following C++ program has well-defined behavior. #include <bits/stdc++.h> using namespace std; int main() { int a = 15, b = 10; int *p = &a, *q = &b; *p-- += b ^ ~--a; *p += 2; cout << a << ", " << b; } My question is not primarily about the program's output, but about what p points to after p--. Since p initially points to a, after the expression *p-- += b ^ ~--a; p is decremented. Does C++ guarantee that p will then point to b, assuming a and b are local variables declared one after the other? Or does p point to an unrelated memory location, making the n
In a multi-tenant RAG platform where each tenant owns isolated vector indexes, what are the trade-offs between per-tenant ANN indexes versus a shared index with metadata filtering when considering retrieval latency, embedding drift, and operational costs?