Check if possible to perform n tasks, each between moment b(i) and e(i) and taking 1 time unit

I have such a task at university: we have n tasks, i-th of them can be done between moment b(i) and e(i). If we decide to perform a task in moment x, we finish performing it in moment x+1. We can perform at most 1 task at a time and we cannot interrupt performing it. Create an algorithm to check if it is possible to perform all the tasks. b(i) and e(i) may not be integers.

I have done some research online, but I haven’t found anything concerning this problem.

Actually I think the following algorithm would work (I haven’t found a counterexample yet):

iterate over all the tasks ordered by increasing e(i) and for each of them try performing it the earliest possible. If cannot, return false. If all tasks are added, return true.

If this algorithm works, how could I prove it?

Disable part of a touchscreen from taking phantom touches

I have a 10.Or G android Oreo device **

  • resolution: 1080×1920
  • density: 480

** This question follows up from here

I’m having problem with lots of ghost touches in the very top 5 mm bar of the screen where touches will register almost 20 times in a minute. Doing the overscan doesnt help at all, because touches will still register, so I am looking to resize my screen with

adb shell wm size 1080*1820

I dont know what to do from here because I’m receiving error

Error: bad size 1080*1820

Help will be greatly appreciated

Invisible files taking up storage on Google Drive?

As you can see from the screenshot, there are no files on My Drive.

My Drive

But the quota of My Drive is 4.7 GB used.

When I click Settings->View items taking up storage, the webpage returns empty result which takes up the 4.7 GB storage.

Reproduce: upload some files to My Drive, then move them to one of Team Drives. But I cannot reproduce every time.

This status has lasted for several hours. Maybe not the backend cache problem?

I’ve also rechecked the differences between files moved from My Drive and files uploaded directly to Team Drive. Nothing useful information.

Why there are invisible files taking up storage of My Drive?

Sql polygon query taking to long to execute

I`m starting with sql geography and I made a query to get all the stored points that are inside a polygon sent, it gets the right results but its taking to long to execute. How can I make a better performance to this query?

PS: I`m using mysql on 5.5.62.

My query:

SELECT id, name FROM geolocations WHERE CONTAINS(GEOMFROMTEXT('POLYGON((-22.892726399999997 -47.05525290000003,-22.891496748403178 -47.05564986693423,-22.8915264 -47.05405289999999,-22.892726399999997 -47.05405289999999,-22.892726399999997 -47.05525290000003))'), coords)   ORDER BY `id` desc LIMIT 30, 10 

Is there a way for a Battle Master to swap out maneuvers without taking more fighter levels?

I currently have an Ancestral Guardian barbarian 8 / Battle Master fighter 3. Some of the maneuvers I selected earlier in this character’s career aren’t working out as well in Tier 3. Battle Master provides one option for swapping them out (PHB, p. 73):

Maneuvers. You learn three maneuvers of your choice […]

You learn two additional maneuvers of your choice at 7th, 10th, and 15th level. Each time you learn new maneuvers, you can also replace one maneuver you know with a different one.

Unfortunately, that would require me to take 4 more levels of fighter, including a dead level at fighter 5. I do not want to advance beyond level 4 in fighter; taking barbarian all the way to level 17 would be even better. Is there a way to swap out maneuvers without taking fighter to level 7?

How do spell lists change if the party levels up without taking a long rest?

I’m playing in a D&D 5e campaign with a bard and a wizard.

Our most recent session ended while we were in the middle of exploring a dungeon. The DM informed us that we leveled up from 4 to 5.

The wizard and bard were excited to get level 3 spell slots for the first time. They began discussing the level 3 spells they were looking forward to casting at the beginning of the next session. I asked, “Don’t you guys need to have a long rest before you can cast new spells, though?”

The bard argued that he doesn’t need a long rest, because he learns spells immediately upon leveling up and doesn’t need to prepare them.

The wizard argued his “number of spells available” count increased immediately upon leveling up, and it wouldn’t make much sense if his actual number of prepared spells stayed the same.

Ultimately, the DM decided that it would be more fun if everyone got access to their new toys at the same time. He permitted the wizard to add a level 3 spell to his prepared spell list.

Who is right? Do bards (and other casters that do not prepare spells) get access to new spells more immediately than wizards (and other casters that prepare spells)?

I looked at Can I use my newly gained limited-use ability right after leveling up?, but “Can a mage use his newly gained 2nd-level spell slot?” seems like a separate matter from “Can a mage use a newly gained spell?”.

How to deal with fear of taking dependencies

The team I’m in creates components that can be used by the company’s partners to integrate with our platform.

As such, I agree we should take extreme care when introducing (third-party) dependencies. Currently we have no third-party dependencies and we have to stay on the lowest API level of the framework.

Some examples:

  • We are forced to stay on the lowest API level of the framework (.net standard). The reasoning behind this is that a new platform could one day arrive that only supports that very low API level.
  • We have implemented our own components for (de)serializing JSON, and are in the process of doing the same for JWT. This is available in a higher level of the framework API.
  • We have implemented a wrapper around the HTTP framework of the standard library because we don’t want to take a dependency on the HTTP implementation of the standard library.
  • All of the code for mapping to/from XML is written “by hand”, again for the same reason.

I feel we are taking it too far. I’m wondering how to deal with this since this I think this greatly impacts our velocity.

Libre Office sometimes taking wrong characters

I’m using LibreOffice on Ubuntu 18.10 since a week and on every document characters are sometimes lost or placed in the wrong way. By that I mean that as I type for example linux it will print lnuix at the screen although I pushed it the right way.

This occurs irregularly. I don’t have necessarily a high CPU use when it occurs (sometimes around 30%).

Does someone knows how to resolve this? For example, can one change the priority of keyboard input?