algorithms – Fast query on the number of elements in a quarter plane

A 2D Fenwick tree can solve this in $O(log^2 N)$ time and $O(N^2)$ space for both update and query, when your coordinates are integers and $N$ is the size of the maximum coordinate.

Fenwick trees are nice for competitive programming because they have a really compact implementation, for example in C++:

typedef unsigned long long uw;
uw lsb(uw x) { return x & -x; }
uw  up(uw x) { return x + lsb(x); }
uw  dn(uw x) { return x - lsb(x); }

template<class T> struct Fenwick2D {
  uw n; std::vector<std::vector<T>> b;
  Fenwick2D(uw n) : n(n), b(n+1, std::vector<T>(n+1)) { }

  void increase(uw x, uw y_, T v) {
    for (; x <= n; x = up(x))
      for (uw y = y_; y <= n; y = up(y))
        b(x)(y) += v;

  T prefix_sum(uw x, uw y_) {
    T s = 0;
    for (; x >= 1; x = dn(x))
      for (uw y = y_; y >= 1; y = dn(y))
        s += b(x)(y);
    return s;

And this shows your example from the question:

int main(int argc, char** argv) {
    Fenwick2D<int> fw(4);
    fw.increase(1, 1, 1);
    fw.increase(2, 2, 1);
    fw.increase(1, 2, 1);
    fw.increase(3, 2, 1);
    std::cout << fw.prefix_sum(1, 1) << "n";
    std::cout << fw.prefix_sum(2, 2) << "n";
    std::cout << fw.prefix_sum(3, 3) << "n";
    return 0;

This data structure is more general than your problem as well. In general it can increase any grid element $g_{x,y}$ by value $v$ (which decreases for negative $v$), and ask the value of the lower quadrant prefix sum $sum_{ileq x}sum_{jleq y} g_{i,j}$ for any $x, y$. Note that this means you can get area sums as well using 4 queries by the inclusion-exclusion principle.

transformation – How to scale major and minor radius of a quarter torus

I am dealing with quarter toruses as in the image below. My issue is i need to be able scale its major radius and minor radius seperately using a scale matrix. However, when i use a regular transformation matrix like:

    scaleX, 0, 0, 0,
    0, scaleY, 0, 0,
    0, 0, scaleZ, 0,
    0, 0, 0, 1;

It scales both radiuses. Is there are way i can do this seperately? I cant get my head around how this would be possible? Thank you in advance.
enter image description here

quarter rack colocation in houston,tx and/or virginia/washington dc

anyone have list of providers to look for quarter rack colocation

#1. houston, tx


#2. washington dc or virginia area

should … | Read the rest of

cheapest quarter rack colocation in the United States

i am looking for offers for the cheapest/best value quarter rack colocation in the United States

below are what am looking for but anything close to it is good, doesn’t have to be exactly that

quarter rack

10Amp @ 120V usable power

/28 ipv4 + /64 ipv6

30TB @ 1 Gbps port

the economy is heading downhill and trying to reduce costs as last resort

so please reply with the cheapest providers out there or DM also

looked at colo offers section but nothing catches my eyes in terms of price

again don’t care what location, just want cheapest price possible


Linux: 1080p external screen desktop only covers a quarter screen [Using xrandr]

I used to use Ubuntu for my development environment, since I have a new workstation that I have decided to switch to Manjaro, with a KDE GUI.

When I used Gnome, I used a tool called xrandr-extend to give me the ability to use both the 4k screen of my laptop and my external 1080p screen without suffering from the usual scaling problems. It works well; I had no problems with xrandr-extend in Gnome. In Manjaro, however, I have a problem that I cannot solve.

The problem lies in the desktop on the external screen:

Desk with external display

As you can see, three quarters of the screen are black, while the desk accommodates the last quarter of the screen.

I think it may have something to do with the fact that I am compressing the screen by 2 in the xrandr-extend configuration. I am doing this to achieve the optimum degree of scale to use applications on the screen. However, if this is the case, how can I maintain the level of scale that I need while the entire desktop instance on the external screen covers the entire width and length of that screen?

To my knowledge, I have filled in the configuration file correctly:

primary = eDP-1
hdmi = HDMI-1
vga = DP-1

primary = eDP1
hdmi = HDMI1
vga = DP1

primary = 3840, 2180
hdmi = 1920, 1080
vga = 1920, 1200

hdmi =  2

The console logs generated when I execute the command to extend and scale the external screen:

[dukejm@duke-pc ~]$ xrandr-extend -n hdmi                 
xrandr --auto
xrandr --listmonitors
xrandr --output eDP1 --auto --output HDMI1 --auto --panning 3840x2160+3840+0 --scale 2.0x2.0 --right-of eDP1
Monitors: 2
 0: +*eDP1 3840/350x2160/190+0+0  eDP1
 1: +HDMI1 1920/530x1080/300+3840+0  HDMI1
[dukejm@duke-pc ~]$ xrandr-extend -n hdmi
xrandr --auto
xrandr --listmonitors
xrandr --output eDP1 --auto --output HDMI1 --auto --panning 3840x2160+3840+0 --scale 2.0x2.0 --right-of eDP1
Monitors: 2
 0: +*eDP1 3840/350x2160/190+0+0  eDP1
 1: +HDMI1 3840/530x2160/300+3840+0  HDMI1

Google Calendar: How to add a school schedule (explaining the lack of lessons between the dates of the quarter)?

I am trying to add my school schedule to the Google calendar, but the weekly replay options do not explain that there are no lessons between the terms. Nor have I found a way to eliminate multiple events at once (i.e., vacation lessons)

Thanks for any help.

Facebook ad rates have risen in the fourth quarter of 2017 |

Facebook ad rates have risen in the fourth quarter of 2017.

Let's talk about why and some solutions to avoid wasting your Facebook ad dollars.

During the fourth quarter of each year, we see an increase in ad rates on the Facebook ad platform.

The reason for this is that we have more people spending money during this time of year, which attracts more companies to the market.

Facebook ad auctions are filled with people looking to bid on ad inventory, and are also willing to pay the maximum to access the inventory.
As a result, ad rates rise in all areas.

You have some solutions to this challenge.
1. Know your numbers. You have to know your cold numbers. Knowing your CPA, LTV and even AOY is essential at this time of year
2. Create attractive offers Creating a compelling offer is key. Try to find out what your customer really wants and how you can make him act on the offers.
3. Test your assumptions. Start testing all your assumptions with a part of your budget. Then try again.

The change in Facebook's fourth quarter ad rate is preparing us for higher ad rates in 2018.

Get ready and get ready.

ServerStrong: 1V SSV KVM VPS for $ 9 / quarter and more in Los Angeles, CA!

Alex from ServerStrong recently presented his first offer to us. We thought the offers seemed pretty attractive to KVM, so here they are. They offer SSV KVM VPS based in Los Angeles and have three exclusive exclusive plans for the LEB community. Since everything works with SSD storage, we hope that these plans provide a very high disk performance, the ideal scene for those looking for something powerful 🙂 As always, we want to hear your comments, so if you decide to buy a ServerStrong plan! Please be sure to share your experience below!

Your WHOIS is public, and you can find your legal and legal documents here. They accept PayPal, credit cards, Alipay and Cryptocurrency (Bitcoin, Litecoin, Ethereum) as payment methods available for you to choose.

This is what they had to say:

"ServerStrong is a web hosting provider that runs on an infrastructure with SSD. We believe in providing a high value service, and we do this by always providing 24×7 assistance, as well as ensuring that the entire infrastructure of our server runs only on top-notch equipment. This means that you will not find us in every corner: we use the best Intel Xeon processors, the Supermicro server chassis, enterprise-class SSDs, high-end RAID controllers and much more to offer a quality service to our Customers: because we realize that performance is fundamental in this era.

Our servers are currently located in Los Angeles, California; We plan to expand to additional locations later this year (comments are welcome). For the time being, enjoy our offers of SSD KVM VPS and contact us if you need a customized plan created. "

Here are the offers:


  • 1 CPU Core
  • 1024MB (1GB) RAM
  • 15GB SSD storage
  • 2000GB bandwidth
  • 1Gbps network
  • KVM / SolusVM
  • Access to the SolusVM API
  • Docker supported
  • $ 9 / qtr or $ 19 / year
  • [ORDER]


  • 2 CPU cores
  • 3072MB (3GB) RAM
  • 30 GB of SSD storage
  • 3000GB bandwidth
  • 1Gbps network
  • KVM / SolusVM
  • Access to the SolusVM API
  • Docker supported
  • $ 35 / year
  • [ORDER]


  • 4 CPU cores
  • 4096MB (4GB) RAM
  • 50 GB of SSD storage
  • 10,000GB bandwidth
  • 1Gbps network
  • KVM / SolusVM
  • Access to the SolusVM API
  • Docker supported
  • $ 49 / year
  • [ORDER]


Los Angeles, CA – Telecommunications Building
IPv4 test: 107,175,180.6
Test file: 100MB | 1000MB

KVM host nodes
– DUAL Intel Xeon E5-2670v2 40x 2.50 GHz
– 256 GB of RAM
– Samsung Pro SSD & # 39; s
– RAID controller LSI 9361-4i
– 1Gbps dual network link

Please let us know if you have any questions / comments and enjoy!

Find the diameter of a quarter circle cut.

Imagine that you cut a circle horizontally in half. Now do this again. Now you have the upper quarter of a circle with a width of 30. How can you calculate the diameter of the full circle?

Clemson defeats Alabama to win the national championship

Unlike 2017, when a touchdown pass from Deshaun Watson to Hunter Renfrow was needed with a second left to secure a victory over Alabama,

His victory on Monday night over Alabama ended shortly after the fourth quarter began with a 44-16 victory over the Crimson Tide.

Tagovailoa recovered on the next run and found Jeudy for a long touchdown to tie the game at 7-7. But he threw his second interception of the day in the second quarter and with Tide losing 21-16.

read more