In CLRS, Activity Selection uses a simple greedy rule (pick the earliest finishing activity) and it always gives the optimal answer. No DP needed. I tried the same idea on Weighted Job Scheduling (each job has start, end, profit, pick non-overlapping jobs for max profit). Picking the earliest finishing job first does not give the correct answer here. You need the full DP, i refers ith job: dp[i] = max(dp[i-1], profit[i] + dp[lastNonOverlapping(i)]) Both problems look almost the same. One needs greedy, other one needs DP. Is there a way to tell, just from the problem statement, whether greedy w
More than 40 years ago, the first window managers could arrange windows in "tiling" mode. As in the image below Program Manager. The task is to fill a rectangular space with a certain number of rectangles. Unfortunately, I did not find a description of the algorithm for how to do this.
As a preface to this, I'm fairly novice in VBA only a few months in and I'm working through making a custom userform for email drafting etc. On the userform there is a combo box I fill from a table in a sheet and originally just had it scan through like so: Private Sub UserForm_Initialize() ' Wrote the function "GetTable" to get the table as a list object Set tblTo = GetTable(Tbl_To) Set tblTemplates = GetTable(Tbl_Templates) Dim rng As Range For Each rng In tblTemplates.ListColumns(1).Range ' combo box name With cmboTemplates .AddItem rng.Value End With Next End Sub And I realized Referencing
I'm calling IOConnectCallStructMethod with a struct output, and that output never gets populated unless my DriverKit IOUserClient ExternalMethod returns kIOReturnSuccess. from my app code: size_t outputSize {sizeof(WriteOutput)}; WriteOutput output {0}; kern_return_t ret = IOConnectCallStructMethod(v_connection, static_cast<uint32_t>(ExternalMethodType::ExternalMethodType_Write),&input, inputSize, &output, &outputSize); and my driver UserClient method (dispatched by ExternalMethod) int USBDriverUserClient::writeHandler(OSObject *target, void *reference, IOUserClientMethodArguments *arguments)
I am using Genero Studio 3.21.01 and I find the dependency diagrams (see example below) quite useful. However, any dependency from a project added via the "Add External Dependency" option does show correctly. The external files/project are there but not any arrows/connections indicating a function from one external module is called by a module in the current project: I would like to see the dependencies as within a project: Is there any possibility to change that behaviour? The official 3.21 documentation does not mention any way to change what is included in the dependency diagrams.
As a disclaimer: I'm working on a dark comedy hard-scifi setting with the aim of parodying the likes of Dune, 40k, cyberpunk, analog horror, etc so just accept the ridiculous premise (and likewise i will accept ludicrous yet theoretically plausible answers). Backstory: We have a city-state in decline. Widespread poverty and homelessness, skyrocketing crime rates, high inflation and a severe deficit, a woeful lack of municipal support and social services are just some of the issues facing the local population. There is an aura of desperation and hopelessness across the city. The city officials’
When getting a stream from an API using cURL with CURLOPT_WRITEFUNCTION I can keep the stream alive. A callback function can do things with the data as it comes in. I can't do this with fopen() and fgets() because the stream closes when it receives '' or EOF. I want to constantly check a file that gets appended unpredictably. Something like: $handle = fopen('file:///home/me/myfile', 'r'); while(1){ $line = fgets($handle); echo $line; } with the while looping through existing lines of /home/me/myfile and when it's out of lines, continue looping but not close the stream at EOF. That way if myfil
I'm overlaying a building `.scn` model on a real construction site using ARKit + SceneKit on iPhone 14 Pro (LiDAR). What I have working ARWorldTrackingConfiguration with sceneReconstruction = .mesh (LiDAR) ARGeoTrackingConfiguration for rough GPS-based placement Save/load ARWorldMap with NamedAnchor for session persistence - Manual nudge/rotation via joystick in the UI (coarse alignment) ICP refinement: I extract vertices from ARMeshAnchor, run ICPSolver.run() against the model point cloud, then apply the resulting transform if RMSE < threshold. The problem After ICP converges (~2–3 cm RMSE in
Since <details>/<summary> already has built-in accessibility semantics (the browser exposes an implicit aria-expanded state via the open attribute), do I still need to manually add aria-expanded to be WCAG/ADA compliant? If aria-expanded is required, is there a no-JavaScript solution — or is scripting unavoidable to keep aria-expanded in sync with the open state? details[open] + div { display: block; } div { display: none; } <details name="my-group"> <summary>Utility menu</summary> </details> <div>Menu content</div>
I wasn't sure how to interpret the ARMv6-M Architecture Reference Manual in regards to this matter. When describing WFI wakeup conditions, the reference manual mentions detection of "an asynchronous exception". Obviously, if an interrupt is enabled by writing to ISER, and then the interrupt fires, it causes a WFI wakeup. But if an interrupt is disabled by a write to ICER, and then the interrupt fires; does this cause a WFI wakeup? I am aware that the latter case simply sets the interrupt pending flag (as if by write to ISPR); I just don't know if that would be enough to wake a core from WFI.
I am planning a maintenance and load-balancing procedure for a PolarDB for MySQL Multi-Master (Limitless) cluster. Before using database endpoint switching in production, I want to understand its transaction consistency guarantees. My environment has the following topology: PolarDB for MySQL kernel version: 8.0.x Two read-write nodes: RW1 and RW2 Database-level isolation All application connections use the cluster endpoint The database db1 is initially assigned to RW1 In this architecture, multiple RW nodes share the underlying storage, but a specific database or data object has only one write
I am building an offline-first iOS application that stores searchable records along with photos and videos. A user may create or edit records, add or delete media, and then immediately lock the phone or leave the app. I do not need synchronization to finish immediately. I need eventual, crash-safe synchronization without requiring the user to keep the application in the foreground. What guarantees do iCloud Drive and CloudKit respectively provide for this use case? Please help. I did this for Android using the background worker function, but iOS deliberately prevents this and apparently operat
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
Is it possible to use an external subscription (Claude or openAI) in the Agents panel of VS Code? How do I configure? I can see it supports natively Claude models but I need to use them as part of an active GitHub Copilot subscription while I have as a separate Antrhopic subscription.
Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article? はじめに 日本のオープンデータ、正直かなり充実しています。分析屋・開発者目線で「これ使える」と思えるものだけでも、体感以上に多い印象です。 地図、統計、気象、防災、不動産...
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