Sliding Window Dictionary String Matching

Consider the following problem. We are given a set of patterns (strings) $ \Pi = \{\pi_i\}$ , a text $ s$ , and a window length $ k$ . We want a list of all shifts $ 0 \le i \le |s|-k$ such that every pattern in $ \Pi$ is contained in the substring $ s[i:i+k]$ .

Can this be solved in linear- or near-linear-time? It can of course be solved in quadratic time $ O(|s| |\Pi| + \sum |\pi_i|)$ using KMP or Aho-Corasick plus post-processing.

The motivation for this problem is finding matches for a topic (represented by the set of patterns) in a text. In that context it actually makes sense to require the matches to be non-overlapping so I’m also interested in that case, but it might be easier to start with the relaxed version.

I would also be interested in generalizations of the problem that allow for approximate matches of some kind, eg, only requiring a threshold on the size of the subset of matching patterns, allowing matches within given edit distance, or something using hidden Markov models or general probabilistic graphical models. I would be surprised if any such generalization can be solved in subquadratic time though.

Clicking empty content editor webpart throws confirm window

We have a 2013 on-prem setup. We are site collection admin so everything is client-side and javascript, no access to central admin. We have a site using page publishing features and custom page layouts.

On our custom page layouts we have some webpart zones with content editor webparts already on a blank page. When we go to edit the page we get a Click here to add new content to the default empty content editor webparts.

When we click that to add new content we get a confirm/alert window

Leave site?  Changes you made may not be saved.  Leave Cancel 

If we click leave we go to the site’s landing page and if we click cancel we stay on the page and can enter our content into the content editor webpart.

This is confusing for our site users.

I know it must be something we’ve done in some custom code, other sites we have don’t have this issue, but I can’t figure out where to look.

I’ve used the debugger in my browser and can’t really figure out where to add breakpoints or which bit of code to follow. Seems that it is called onbeforeunload, but that is about all I’ve been able to track down.

Anybody know what is going on when you Click here to add new content?

Open VPN in Ubuntu18.04 with restriction which requires a keep-alive window in browser that sends requests every 100 seconds to local address

My institute has a system which requires a keep-alive window that sends requests every 100 seconds to local address “192.xx.xx.xx”. If a request is not sent, the internet access on that room IP is revoked. When VPN is connected, all intranet addresses are inaccessible and so even when you connect to a VPN successfully, the connection will break after around a 100 seconds. Any solutions ?

refresh rate falling back after i close window

video. my refresh rate goes back to 60hz even if i change it in the gnome settings. the video(sorry for the slideshow) shows it. I use 1920×1080 and display port. my gpu is rx 480 nitro+. i have already tried setting it via xrandr. xrandr:

Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384 DisplayPort-0 disconnected (normal left inverted right x axis y axis) DisplayPort-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 544mm x 303mm    1920x1080     60.00*+ 144.00   119.98    99.93    50.00    59.94      1680x1050     59.88      1280x1024     75.02    60.02      1440x900      59.90      1280x800      60.00      1280x720      60.00    50.00    59.94      1024x768     119.93    99.99    75.03    70.07    60.00      832x624       74.55      800x600      119.93    99.86    72.19    75.00    60.32    56.25      720x576       50.00      720x480       60.00    59.94      640x480      119.80    99.83    75.00    72.81    66.67    60.00    59.94      720x400       70.08   HDMI-A-0 disconnected (normal left inverted right x axis y axis) HDMI-A-1 disconnected (normal left inverted right x axis y axis) DVI-D-0 disconnected (normal left inverted right x axis y axis) 

Erros with compiz window manager

I recently started having this issue with Ubuntu Mate 18.04, when I select the macro window manager everything is fine, but when I select the compiz window manager, the top panel having the close, minimize and restore button is gone ! And i can’t even take screenshots while using the compiz window manager. Please help.

Window function in Update statement

Is there a work around to use window functions in update statement

You can populate sample/original table using the code

Create table #table( key1 Char(5), date1 Date, date2 Date );  Insert into #table  Values ('abc','2019-07-22',NULL); Insert into #table Values ('abc','2019-07-23',NULL); Insert into #table Values ('def','2019-07-22',NULL); Insert into #table Values ('ghi','2019-07-22',NULL); Insert into #table Values ('ghi','2019-07-23',NULL); 

I want to partition and Order by key1 – check for NULL in date2 – leave NULL intact if max(date1) over (partition by key1 order by key1) = date1 and change to max(date1) over (partition by key1 order by key1) if the above condition is not true. This is a data vault concept by the way.

Original:

enter image description here

Required:

enter image description here

I tried the below code:

UPDATE #table SET date2 = CASE WHEN MAX(date1) OVER (PARTITION BY key1 ORDER BY key1) = date1    THEN NULL   ELSE MAX(date1) OVER (PARTITION BY key1 ORDER BY key1)) END WHERE date2 IS NULL ; 

I am getting an error like analytic functions not allowed. Please help.

Ubuntu top panel app icons to open app window by double/click except app menu

Top Panel Icons

How to setup Ubuntu desktop to open app window by clicking or double-clicking on Top Panel icons?

When i click on them i see same menu like for right mouse click. Irrational use.

Another strange behavior, when i try open app window from menu by this icons and app in background i see just popup message but not app window.

An anonymous “free space” is showing in the disks window

I want to have only 2 partitions: the 238GB as shown in the picture, and the 262GB, But there is an anonymous “Free space 2.1MB” is coming from somewhere I don’t know. I don’t know how to merge it with the 262GB free space because it should be coming from there not from the 238GB Part; Mean: the 2.1MB should be a part from the 262GB partition, but I’m not sure.

On the another window (the installation type window) it’s showing that I have only 2 partitions.

I don’t know which window I should believe. But I want to get rid of this 2.1MB in some way.

But I don’t want to lose the data stored in the 238GB partition

Installation type window Disks window: anonymous free space Disks window: 238GB enter image description here