My Python training script that runs as a single Slurm job imports a model at startup and trains it multiple times with different random seeds: train.py: from model import MyModel for seed in [1, 2, 3, 4, 5]: model = MyModel() model.train(seed) model.py: from feature import FeatureExtractor class MyModel: def __init__(self): self.feature = FeatureExtractor() def train(self, seed): print(f"Training seed {seed}") feature.py: class FeatureExtractor: def __init__(self): print("Version 1") I submit Slurm Job A which starts running train.py. While Job A is still running (for example, after it finishe
We have a Django-based microservices application that uses JWT for authentication. To avoid calling the Customer Service on every request, our JWT access token contains user metadata such as customerId, username, email, and phoneNumber. When a user updates their profile (e.g., changes their email or phone number) from one session, we immediately issue a new JWT containing the updated information for that session. However, all of the user's other active sessions continue using their existing JWTs, which now contain stale data until those tokens expire. Reducing the access token expiry (e.g., to
All of my old scripts are written procedural and in writing a new one I've learned that curl_close() is deprecated and that a curl object is closed automatically. But do I have to rewrite all that stuff and my new stuff in OOP for this to be valid? Or does it not matter? Object Oriented makes no sense to me and I'd much prefer to keep doing what I've been doing.
I am currently making a page on my website, in which you can scroll between profiles of staff in the company I am developing for. This scrolling is horizontal. Currently, I have 5 items that I can scroll between, but my page is only allowing me to scroll to three different items. Additionally, when I use the inspect tool on my browser, the structure is showing two items outside of my viewport, but my html does not reflect that. const list = document.querySelector('.list'); const items = Array.from(document.querySelectorAll('.item')); const indicators = Array.from(document.querySelectorAll('.in
I've created an analytics dashboard in Perplexity Computer, it updates when I manually upload a CSV file. I'd like to automate this process. Is it possible to connect a Google Sheet or Notion database as the dashboard's data source so that whenever new data is added or existing data is updated, the dashboard automatically refreshes and reflects the latest information without requiring a manual CSV upload?
In OpenERP, an OSV object can return something which can open a new view or activate an action. For instance, sale.order has manual_invoice method which returns the following: return { 'name': _('Customer Invoices'), 'view_type': 'form', 'view_mode': 'form', 'view_id': [res_id], 'res_model': 'account.invoice', 'context': "{'type':'out_invoice'}", 'type': 'ir.actions.act_window', 'nodestroy': True, 'target': 'current', 'res_id': inv_ids and inv_ids[0] or False, } and it opens an invoice form view in the same window. I've seen 'view_id': [res_id], being changed to 'views': [(id2, 'form')], and o
I am designing a Laravel application that handles millions of daily requests with a MySQL database containing tables with hundreds of millions of rows. A common requirement is adding or modifying columns on high-traffic tables. For example: ALTER TABLE user_events ADD COLUMN metadata JSON NULL; On large tables this can cause metadata locks, replication lag, increased IO, and unpredictable downtime. The application cannot tolerate API downtime, Long-running database locks, Blocking writes and Replica lag causing stale reads. What is the correct strategy for performing schema changes safely in t
To prepare for a migration from Jackson 2 to Jackson 3, I am starting by making a simple demo project in Jackson 3. I started by creating an instance of the JsonFactory, but then tried to create a JsonParser and got confused. If you look at the documentation, you'll see that all of the public methods in JsonFactory that return instances of JsonParser first require you to give them an instance of ObjectReadContext. Then, I read the migration guide, but all I could see was that jackson-databind provides an instance of ObjectReadContext, called DeserializationContext. But I am not using jackson-d
My client is having issues with their legacy system (ASP.NET webforms) sending emails as they are bottlenecking. So I made the code asynchronous (eg. await smtpClient.SendMailAsync(newMail);) and this works, but I'm now being told that the delay may be on the client (receiver) side as their server does not seem to want to receive too many emails at once from the same email address. Therefore, they are asking if I can add code to send 20 emails, then wait 5 minutes, then send another 20 until they have all been sent. Can someone please tell me how I do this?
I'm working on a kernel module where I need to allocate a few gigabytes of memory. I want the allocation to fail rather than sleep if it cannot be satisfied immediately. However, I haven't been able to find any documentation stating whether __vmalloc(size, GFP_NOWAIT) is actually guaranteed not to sleep. The only relevant information I've found is this comment in the kernel source: https://github.com/torvalds/linux/blob/master/mm/vmalloc.c#L3987-L3988 I'd like to double-check my understanding with people who are more familiar with this part of the kernel. Thanks!
Can Microsoft Graph create online meetings using moderated meeting templates? I’m trying to create online meetings with moderation using Microsoft Graph. I can see that Microsoft Graph provides a meetingTemplateId value that can be used for a template. However, the documentation I’m finding mainly describes custom meeting templates, and I’m unsure whether built-in/non-custom templates support moderated meetings. Is it possible to create a moderated online meeting using non-custom meeting templates with Graph? If yes, once the template is applied, how are moderators specified/assigned? I don’t
Our custom element is created successfully and the Verified Review Collector script loads correctly, but the onReady callback is never invoked. Is onReady still expected to fire in the current version of verifiedreviewcollector/main.js, or has the integration flow changed? added <script src="https://reviewcollection.trustpilot.com/verifiedreviewcollector/main.js" async></script> in index.html <div class="trustpilot-step"> <h4>Thanks for your review!</h4> <p>Would you also leave us a verified review on Trustpilot?</p> <trustbox-verified-review-collector id="tp-verified-widget" class="trustpilot
I'm using Shopify's "Buy Button" to embed a product collection on a website but I'm having some trouble customising certain parts of it. The main issue is a vertical scrollbar on the modal when you click into a product. It doesn't need it and it makes the page jump horizontally so I need to figure out a way to remove/hide it. Proving difficult as its an iframe but I'm sure there must be a way. I also want to make the close button thicker, something like 400 weight. All of this is possible to fix in the console but as it's an iframe CSS doesn't work. See my Codepen <div id='collection-component
Definitions of 'rigid' tyvar have varied a bit over time. The critical requirement is the tyvar appears in a user-supplied signature: Instead of “user-specified type”, we use the briefer term rigid type to describe a type that is completely specified, in some direct fashion, by a programmer-supplied type annotation. [from 2005 'Simple unification-based type inference for GADTs' §3] ... every programmer-written type signature (including one that contains free scoped type variables) denotes a rigid type; that is, the type is fully known to the type checker, and no inference is involved. Then con
I am importing data stored in XML from an SQL Server table into a temp table (#). Sample form data: <ABCDE xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Z.Data.ActivityEvent" i:type="DepartmentConversationInfo"> <XYZ xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" /> <AppId i:nil="true" /> <DepartmentId i:nil="true" /> <DepartmentProfileId i:nil="true" /> <EmployeeId>235</EmployeeId> <EmployeeStatusId>65</EmployeeStatusId> <ApplicationFormId>39</ApplicationFormId> </ABCDE> The XML has namespaces. What I do when there i
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 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 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