In 1931 Kurt Gödel used elementary arithmetics to build a universal programming language for encoding arbitrary proofs, given an arbitrary enumerable set of axioms. He went on to construct self-referential formal statements that claim their own unprovability, using Cantor's diagonalization trick  to demonstrate that formal systems such as traditional mathematics are either flawed in a certain sense or contain unprovable but true statements .
Since Gödel's exhibition of the fundamental limits of proof and computation, and Konrad Zuse's subsequent construction of the first working programmable computer (1935-1941), there has been a lot of work on specialized algorithms solving problems taken from more or less general problem classes. Apparently, however, one remarkable fact has so far escaped the attention of computer scientists: it is possible to use self-referential proof systems to build optimally efficient yet conceptually very simple universal problem solvers.
Many traditional problems of computer science require just one problem-defining input at the beginning of the problem solving process. For example, the initial input may be a large integer, and the goal may be to factorize it. In what follows, however, we will also consider the more general case where the problem solution requires interaction with a dynamic, initially unknown environment that produces a continual stream of inputs and feedback signals, such as in autonomous robot control tasks, where the goal may be to maximize expected cumulative future reward  (examples in Section 3.2). This may require the solution of essentially arbitrary problems.
Neither Levin's universal search  nor its incremental extension, the Optimal Ordered Problem Solver [38,40], nor Solomonoff's recent ideas  are `universal enough' for such general setups, and our earlier self-modifying online learning systems [29,32,44,43,45] are not necessarily optimal. Hutter's recent AIXI model  does execute optimal actions in very general environments evolving according to arbitrary, unknown, yet computable probabilistic laws, but only under the unrealistic assumption of unlimited computation time. AIXI's asymptotically optimal, space/time-bounded cousin AIXI  may be the system conceptually closest to the one pesented here. In discrete cycle of AIXI's lifetime, action results in perception and reward , where all quantities may depend on the complete history. Using a universal computer such as a Turing machine , AIXI needs an initial offline setup phase (prior to interaction with the environment) to examine all proofs of length at most , filtering out those that identify programs (of maximal size and maximal runtime per cycle) which not only could interact with the environment but which for all possible interaction histories also correctly predict a lower bound of their own expected reward. In cycle , AIXI then runs all programs identified in the setup phase (at most ), finds the one with highest self-rating, and executes its corresponding action. The problem-independent setup time (where almost all of the work is done) is , and the online computation time per cycle is . AIXI is related to Hutter's `fastest' algorithm for all well-defined problems (HSEARCH ) which also uses a general proof searcher, and also is asymptotically optimal in a certain sense. Assume discrete input/output domains , a formal problem specification (say, a functional description of how integers are decomposed into their prime factors), and a particular (say, an integer to be factorized). HSEARCH orders all proofs of an appropriate axiomatic system by size to find programs that for all provably compute within time bound . Simultaneously it spends most of its time on executing the with the best currently proven time bound . It turns out that HSEARCH is as fast as the fastest algorithm that provably computes for all , save for a constant factor smaller than (arbitrary ) and an -specific but -independent additive constant . That is, HSEARCH and AIXI boast an optimal order of complexity. This somewhat limited notion of optimality, however, can be misleading despite its wide use in theoretical computer science, as it hides the possibly huge but problem-independent constants which could make AIXI and HSEARCH practically infeasible.
Our novel Gödel machine1derives its name and its power from exploiting provably useful changes of any part of its own code in self-referential fashion. Its theoretical advantages over previous approaches can be traced back to the fact that its notion of optimality is less restricted and that it has no unmodifiable software at all. Its bootstrap mechanism is based on a simple idea. We provide it with an axiomatic description of (possibly stochastic) environmental properties and of its goals and means. The latter not only include some initial problem soving strategy but also a systematic proof searcher seeking an algorithm for modifying the current Gödel machine together with a formal proof that the execution of this algorithm will improve the Gödel machine, according to some utility function or optimality criterion represented as part of the goals. In particular, utility may take into account expected computational costs of proof searching and other actions, to be derived from the axioms. The self-improvement strategy is not `greedy': assuming consistency of the axiomatic system, some self-improvement's usefulness will be provable only if it can be shown that the current proof searcher will not find an even better self-improvement sufficiently quickly. In this sense any executed self-improvement will be globally optimal--it will be the best of all possible relevant self-improvements, relative to the given resource limitations and the initial proof search strategy.
Unlike AIXI and HSEARCH, the Gödel machine can improve the proof searcher itself. Unlike HSEARCH it does not waste time on finding programs that provably compute for all when the current is the only object of interest. While the hardwired brute force theorem provers of AIXI and HSEARCH systematically search in raw proof space--they can hide the proof search cost (exponential in proof size) in their asymptotic optimality notation [16,15]--the initial, not yet self-improved Gödel machine already produces many proofs much faster as it searches among online proof techniques: proof-generating programs that may read the Gödel machine's current state. Hence, unlike AIXI, the Gödel machine can profit from online proof search which may exploit information obtained through interaction with the environment.
This approach raises several unconventional issues concerning the connection between syntax and semantics though. Proofs are just symbol strings produced from other symbol strings according to certain syntactic rules. Such a symbol string, however, may be interpreted in online fashion as a statement about the computational costs of the program that computes it (a semantic issue), and may suggest a Gödel machine-modifying algorithm whose execution would be semantically useful right now as the proof is being created. The proof searcher must deal with the fact that the utility of certain self-modifications may depend on the remaining lifetime, and with the problem of producing the right proof at the right time.
Section 2 will formally describe details of a particular Gödel machine, focusing on its novel aspects, skipping over well-known standard issues treated by any proof theory textbook. Section 2.2.1 will introduce the essential instructions invoked by proof techniques to compute axioms and theorems and to relate syntax to semantics. Section 2.3 will describe one possible initialization of the Gödel machine's proof searcher: Bias-Optimal Proof Search (BIOPS) uses a variant of the already mentioned Optimal Ordered Problem Solver OOPS [38,40] to efficiently search the space of proof techniques. Section 3 will discuss the Gödel machine's limitations, possible types of self-improvements, and additional differences from previous work.


I'm experiencing packet loss when trying to play online. But support is saying that everything is ok.
Here is my uotrace log:
Host Name IP Address Hop Ping Time Ping Avg % Loss Pkts r/s Ping best/worst
* Unknown Host * 192.168.0.1 1 1ms 1ms 0% 101 / 101 1ms / 2ms
* Unknown Host * 220.127.116.11 2 9ms 9ms 1% 99 / 101 7ms / 24ms
be-10007-rur01.santaclara.ca.sfba.comcast.net 18.104.22.168 3 8ms 9ms 1% 99 / 101 7ms / 25ms
be-232-rar01.santaclara.ca.sfba.comcast.net 22.214.171.124 4 9ms 10ms 3% 97 / 101 8ms / 27ms
be-299-ar01.santaclara.ca.sfba.comcast.net 126.96.36.199 5 10ms 13ms 2% 98 / 101 8ms / 201ms
* Unknown Host * 188.8.131.52 6 10ms 11ms 3% 97 / 101 9ms / 32ms
* Unknown Host * 0.0.0.0 7 0ms
* Unknown Host * 0.0.0.0 8 0ms
* Unknown Host * 184.108.40.206 9 80ms 81ms 2% 98 / 101 79ms / 96ms
* Unknown Host * 220.127.116.11 10 77ms 76ms 2% 98 / 101 73ms / 95ms
* Unknown Host * 18.104.22.168 11 75ms 77ms 2% 98 / 101 74ms / 144ms
easo.ea.com 22.214.171.124 12 74ms 75ms 0% 100 / 100 74ms / 93ms
My connection is hardwired to router+modem(almost new netgear c6250), reboot & factory reset do nothing I'm seeing packet loss all the time. Here is modem stats:
It's not a game issue because switching to tethering from a mobile phone internet shows no packet loss at all:
The game is absolutely unplayable with such packet loss. Is there any way to fix this issue?
So I've bought Arris SB6190 tried wired - still packet loss, changed it on Motorola mb7621 tried wired - still packet loss. Last test couple of minutes ago:
I have connection stated as 75/5 but here are my speed test results:
Did you ever get help from xfinity on this? I have the same issues in Memphis. They literally put advertisements on Facebook for gamers but they can't resolve packet loss issues. It's beyond a joke at this point that this company is so incompetent.


For the game of Master Mind it has been proven that no more than five moves are required in the worst case.
One such algorithm was published in the Journal of Recreational Mathematics; in '70 or '71 (I think), which always solved the 4 peg problem in 5 moves. Knuth later published an algorithm which solves the problem in a shorter number of moves - on average - but can take six guesses on certain combinations.
In 1994, Kenji Koyama and Tony W. Lai found, by exhaustive search that is the optimal strategy in the expected case. This strategy may take six guesses in the worst case. A strategy that uses at most five guesses in the worst case is also shown. This strategy requires guesses.
Donald E. Knuth. The Computer as Master Mind. J. Recreational Mathematics, 9 (1976-77), 1-6.
Kenji Koyama, Tony W. Lai. An optimal Mastermind Strategy. J. Recreational Mathematics, 1994.


Tags / university of utah
Reimagine Symposium Banner A thing for a thing. Promoting an environmental symposium in Montana. View @2x!
Humanities Tattoo This is part of a fun project I did as part of a promotional campaign for the College of Humanities at the University of Utah. We will be using thi...


was a Pilot Project that aimed to implement an integrated
coastal zone management system in the Adriatic
Sea, consisting of a predictive circulation module and a river
basin and wastewater management module. The aim was the prediction of coastal
current variability in Near Real Time (NRT), and the monitoring and modeling
of a river basin and wastewater system in a test site.
This Project involves directly
three Nations bordering the Northern Adriatic Sea (Italy, Slovenia
and Croatia) and French institutions.
This project is supported by
the Italian Ministry for the Environment
and Territory (Department
for Global Environment, International and Regional Conventions).
Project leader: INGV
(Istituto Nazionale di Geofisica e Vulcanologia)
Scientific Co-ordinator: Prof. Nadia Pinardi
(University of Bologna, Italy)
Project Manager: Dr. Sergio
Castellari (INGV, Rome, Italy)
OGS - Istituto
Nazionale di Oceanografia e di Geofisica Sperimentale, Trieste
is acting as partner 9 (P9).


Let's write all the positive integer numbers one after another from $$$1$$$ without any delimiters (i.e. as a single string). It will be the infinite sequence starting with 123456789101112131415161718192021222324252627282930313233343536...

Your task is to print the $$$k$$$-th digit of this sequence.


In recent years, Python has grown significantly as a programming language. In order to meet expectations of modern web developers and data engineers, it has introduced necessary solutions and advanced implementations to become even more flexible than ever before. But little did we know that Python still keeps many of its precious gems out of sight. In this article I would like to promote one of them, a healthy alternative to Abstract Base Classes (ABC) and inheritance – Protocols, which is not as new a concept as one would imagine.
Abstract Base Class (ABC) example
Python implements class inheritance in its own way. The dedicated module
abc allows creating abstract classes and declaring abstract methods to organize structure for our data models within the project. To show its capabilities, in the following example, we have created a simple service to organize a “Home Zoo”. The structure of the files is the following:
animal.py we keep our simple
Animal parent class with two abstract methods. We inherit from it in
Cat classes kept in the
Implemented child classes are the following:
Both child classes inherit directly from the
Animal parent class, implementing both of its methods. Next, we have a
feeding.py file where a simple function
feeding_time() takes an
Animal instance as a parameter and runs the
feed() method declared in a class.
service.py we have created our service class for a home zoo:
HomeZooService keeps the register of
Animal abstract class instances as well as allows adding new animals. Any class that inherits from the parent
Animal class and implements all of its methods might be used and stored within our service. To present how it works, let us take a look at the
Objects provided to
HomeZooService are the child classes of the
Animal parent class. The result of running
main() function is following:
As one could imagine, everything works properly since overridden methods in child classes were executed. The solution proposed in this example seems elegant, yet simple and straightforward. Creation of parent and child classes structure looks perfectly fine.
The advantage of defining abstract classes is that we create a blueprint of a common interface, in this case the interface is a set of methods. Therefore, all child classes must implement mentioned functions. This allows us to take advantage of the polymorphism mechanism and program other parts of code to an interface not an implementation. Thanks to that we are able to store and use any child class (e.g.
Dog), while defining our input as an instance of the parent class (in our case:
There are a few problems, though, that someone curious may point out. Firstly, removing any of the overridden methods in child classes will instantaneously cause trouble. Besides IDE warnings, we will not be able to instantiate any new object:
This creates some issues as our child classes are much dependent on the parent class. On one hand, this is just what we wanted in the first place – straightforward inheritance, on the other hand, we strengthened coupling in our code, making classes, objects and methods more dependent on each other. Python interpreter has created a relation between parent and child classes based on inheritance stated in the definition of
Dog and it sees that it does not implement all necessary methods at the moment of object instantiating, thus executing our code will throw a following error:
Animal class import is required in most of the files, including children classes. It is not a terrible mistake, but it strengthens the dependency between different parts in the code.
Last and probably most critical issue is the fact that each part of the code requires a specified interface as an input. For instance, the function
feeding_time() only uses the
feed() method of the
Animal class but right now it has to accept the whole object as a parameter. Our example is fairly simple, but imagine that the parent class implements more than 10 methods – most of the functionalities provided in the input interface (the
Animal object) would basically become redundant in the scope of this function. We could potentially separate
Animal into smaller classes but it would unnecessarily complicate our code design. Also, multiple inheritance is rarely a good idea, especially in such simple applications.
Luckily, there is a way to solve these issues as well as organize and simplify our code, reduce coupling and loose dependencies in existing files. The solution is called “Protocols”.
Protocols are not a new concept, even in Python. Introduced in version 3.8 as an alternative to Abstract Base Classes, they rely on structural typing. In this mechanism, Python interpreter checks the structure of the object (its methods, attributes etc.) to determine whether it can be used in a specific function/class and the types match. This strategy, based on comparing objects and checking their types, has a specific name in dynamically typed languages (such as Python): duck typing. It follows a very simple rule:
| If it walks like a duck and it quacks like a duck, then it must be a duck.
It means that if two objects have the same methods and attributes, Python will treat them as the same type. For comparison, ABCs use nominal typing, where object relationship is defined by inheritance stated deliberately in our class definition (e.g.
Protocols are, therefore, interfaces which help define what is expected as an input of our methods. Hopefully, by using them we might be able to avoid problems mentioned before and improve our code design.
So, let us make a few changes to the
Animal parent class. This time we will be using Python’s inbuilt
The code has not changed all that much. We remove the
abc package link and still keep our methods, but this time we write
... instead of the implementation which is a standardized Protocols method notation. Now, let us apply changes to the
We removed all links to the parent class here – we do not need them anymore. Thanks to the use of Protocol in
Animal, we reduced import dependency in new classes. It also means that any changes to them will not instantaneously raise warnings or errors. This is due to the fact that neither
Cat is directly linked to the
Animal class anymore, loosening the coupling as well as making them much more independent and flexible. We will show how this would affect our application in a moment.
For the other files, we do not need to change any of the code we had before, external function and service class will still require
Animal instance as an input. The execution method and its result will also not change at all.
The real difference emerges when we remove one of the methods in
Cat classes, same as we did before, and run the code. The result is presented below:
This time our code did not crash on instantiating an object but on executing a not implemented method of the
Animal Protocol. It shows a very important conclusion for the use of Protocols – their main focus is. Thanks to the duck typing mechanism, we are able to instantiate the object without an error, while being focused on using an instance.
This example has shown that Protocols provide us with a defined interface to other parts of the program that may require it in some way. The solution is not only simple and elegant but also beneficial as we were able to easily reduce coupling between different parts of code. But the real advantage of using them will be discovered in a few extra steps.
There is room for further improvement in our code. One of the problems that was raised before was not adjusting the input interface for a specific function. This issue might be solved by providing dedicated Protocols as interfaces.
Let us show an example of the
feeding_time() function. The truth is that all this function needs as an input is an object that implements the
feed() method, the rest is irrelevant. Here lies the true beauty of using Protocols, as we may prepare a specified interface just for this function. Let us create new Protocol class:
Now, let us use it in
Although the change is not spectacular, it gives a very interesting result: the application execution is the same. It also successfully limited the interface use and definition in the application. What we have just implemented suits very nicely into the “Interface Segregation” rule, known in SOLID principles, stating that no part of the application should depend on methods it does not require. All in all, Protocol usage will result in elegant, well organized code.
Obviously, there are situations where Protocol implementation might not be our first choice, especially when the operation of our service focuses on instance creation. The flexibility that Protocols provide is based on Python’s dynamic typing, meaning that types are checked in the runtime. Therefore, we lose straightforward information from the inheritance that our subclass does not implement all necessary methods. This might be crucial when instantiating the objects plays a very important role in our application.
Also, no inheritance means no class hierarchy. When we see a subclass inheriting from its parent, it is much easier to determine the structure and purpose of its use, making it a good source of design documentation. With Protocols, we do not have such easy and clear options since any subclass is basically a stand-alone entity, identified as an appropriate input only at a runtime (although modern IDEs provide tools to statically check the types before code execution).
The “Home Zoo” example obviously could be extended, providing new functions or services that will all require a specific input. Right now it seems intuitive that each one of them might have its own dedicated Protocol, the only requirement we would need are the classes that implement methods defined within the interface.
To summarize, Protocols seem very similar to Abstract Base Classes, they have different uses in terms of application design, though. They handle dependency problems differently – while ABCs, depending on class hierarchy, focus on instance creation, Protocols are dedicated for instance usage thanks to the duck typing mechanism. The capability to split interfaces in order to fit a specific part of the application cannot be overestimated and even though it is achievable using multiple inheritance, with Protocols it seems much more natural and elegant. Last but not least, most modern Python IDEs support use of Protocols by checking the implementation of the required functions, allowing easy and organized application designing.
- Protocols are an intuitive alternative to ABCs.
- They reduce coupling and dependencies in code.
- They create an adjustable interface for each functionality.
- No class hierarchy requires more careful usage and less explicit code documentation.
- When the main goal is instance creation – ABCs are still a better and safer choice.


Since Boboniu finished building his Jianghu, he has been doing Kungfu on these mountains every day.

Boboniu designs a map for his $$$n$$$ mountains. He uses $$$n-1$$$ roads to connect all $$$n$$$ mountains. Every pair of mountains is connected via roads.

For the $$$i$$$-th mountain, Boboniu estimated the tiredness of doing Kungfu on the top of it as $$$t_i$$$. He also estimated the height of each mountain as $$$h_i$$$.

A path is a sequence of mountains $$$M$$$ such that for each $$$i$$$ ($$$1 \le i < |M|$$$), there exists a road between $$$M_i$$$ and $$$M_{i+1}$$$. Boboniu would regard the path as a challenge if for each $$$i$$$ ($$$1\le i<|M|$$$), $$$h_{M_i}\le h_{M_{i+1}}$$$.

Boboniu wants to divide all $$$n-1$$$ roads into several challenges. Note that each road must appear in exactly one challenge, but a mountain may appear in several challenges.

Boboniu wants to minimize the total tiredness to do all the challenges. The tiredness of a challenge $$$M$$$ is the sum of tiredness of all mountains in it, i.e. $$$\sum_{i=1}^{|M|}t_{M_i}$$$.

He asked you to find the minimum total tiredness. As a reward for your work, you'll become a guardian in his Jianghu.


This framework has been renamed to ThingFlow. The latest repo is at https://github.com/mpi-sws-rse/thingflow-python. Please go there.
Ant Events is a (Python3) framework for building IOT event processing dataflows. The goal of this framework is to support the creation of robust IoT systems from reusable components. These systems must account for noisy/missing sensor data, distributed computation, and the need for local (near the data source) processing.
The fundamental abstractions in Ant Events are event streams, which are push-based sequences of sensor data readings, and elements, which are reusable components to generate, transform, or consume the events on these streams. Elements can have simple, stateless logic (e.g. filter events based on a predicate) or implement more complex, stateful algorithms, such as Kalman filters or machine learning. Ant Events integrates with standard Python data analytics frameworks, including NumPy, Pandas, and scikit-learn. This allows dataflows involving complex elements to be developed and refined offline and then deployed in an IoT environment using the same code base.
Ant Events primarily uses an event-driven programming model, building on
asyncio module. In addition to being a natural programming model for
realtime sensor data, it reduces the potential resource consumption of Ant
Events programs. The details of event scheduling are handled by the framework.
Separate threads may be used on the "edges" of a dataflow, where elements
frequently interact with external components that have blocking APIs.
To give the flavor of Ant Events, below is a short code snippet for the Raspberry Pi that reads a light sensor and then turns on an LED if the running average of the last five readings is greater than some threshold:
lux = LuxSensor() lux.select(lambda e: e.val).running_avg(5)\ .select(lambda v: v > THRESHOLD).GpioPinOut()
The first line creates an element representing sensor object and the second line
creates a pipeline of elements to process the data from the element. The
select element extracts the data value from the sensor event, the
running_avg element averages the values, the next
select element converts
the value to a a boolean based on the threshold, and the
turns on the LED based on the value of the boolean.
Ant Events does not have any required external dependendencies, so, in theory at least, it can be run just about anywhere you can run Python 3. It has been tested on the Raspberry Pi (Rasbian distribution), Desktop Linux, and MacOSX. In a desktop environment, you might find the Anaconda Python distribution helpful, as it comes with many data analytics tools (e.g. Jupyter, NumPy, Pandas, and scikit-learn) pre-installed.
Ant Events has been ported to Micropython, so that it can run on very small
devices, like the ESP8266. Since these devices have stringent memory
requirements, the code base has been stripped down to a core for the
Micropython port. The port is in this repository under the
Installing Ant Events
We recommend installing into a
virtualenv rather than directly into the
system's Python. To install, first run the
activate script of your chosen
virtual environment, and go to the
antevents-python directory. Then run:
python3 setup.py install
In the future, we will have support for installing from the Python Package Index, PyPi.
You can also run the Ant Events code in-place from the git repository by adding
the full path to the
antevents-python directory to your
is how the tests and the examples are run.
The layout of the files in the Ant Events code repository (the
directory) is as follows:
README.RST- this file, top level documentation
Makefile- builds the source distribution and documentation; can run the tests
setup.py- used to install the core code into a python environment
antevents/- the core code. This is all that will get installed in a production system
antevents/base.py- the core definitions and base classes of antevents
antevents/adapters- reader and writer elements that talk to the outside world
antevents/linq- elements for filter pipelines, in the style of Microsoft's Linq framework
docs/- documentation, in restructured text (.rst) format.
tests/- the tests. These can be run in-place.
examples/- examples and other documentation.
examples/notebooks- examples that use Jupyter
micropython/- port of Ant Events core to Micropython
To learn more about AntEvents, look at the
docs/ subdirectory. In
tutorial.rst is a good starting point.
There is a separate repository with larger AntEvents examples. It is at https://github.com/mpi-sws-rse/antevents-examples.
The architecture was heavily influenced by Microsoft's Rx (Reactive Extensions) framework and the Click modular router. We started by trying to simplfy Rx for the IoT case and remove some of the .NETisms. A key addition was the support for multiple topics, which makes more complex dataflows possible.


The Queen of England has n trees growing in a row in her garden. At that, the i-th (1 ≤ i ≤ n) tree from the left has height ai meters. Today the Queen decided to update the scenery of her garden. She wants the trees' heights to meet the condition: for all i (1 ≤ i < n), ai + 1 - ai = k, where k is the number the Queen chose.

Unfortunately, the royal gardener is not a machine and he cannot fulfill the desire of the Queen instantly! In one minute, the gardener can either decrease the height of a tree to any positive integer height or increase the height of a tree to any positive integer height. How should the royal gardener act to fulfill a whim of Her Majesty in the minimum number of minutes?


/**
 * Copyright (c) 2020 Neka-Nat
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 * IN THE SOFTWARE.
**/
#pragma once

#include "cupoch/geometry/boundingvolume.h"
#include "cupoch/geometry/geometry.h"
#include "cupoch/geometry/geometry_base.h"
#include "cupoch/geometry/trianglemesh.h"
#include "cupoch_pybind/cupoch_pybind.h"
#include "cupoch_pybind/geometry/geometry.h"

using namespace cupoch;

template <class GeometryT = geometry::Geometry>
class PyGeometry : public GeometryT {
public:
    using GeometryT::GeometryT;
    GeometryT& Clear() override {
        PYBIND11_OVERLOAD_PURE(GeometryT&, GeometryT, );
    }
    bool IsEmpty() const override { PYBIND11_OVERLOAD_PURE(bool, GeometryT, ); }
};

template <class Geometry3DBase = geometry::GeometryBase<3>>
class PyGeometry3D : public PyGeometry<Geometry3DBase> {
public:
    using PyGeometry<Geometry3DBase>::PyGeometry;
    Eigen::Vector3f GetMinBound() const override {
        PYBIND11_OVERLOAD_PURE(Eigen::Vector3f, Geometry3DBase, );
    }
    Eigen::Vector3f GetMaxBound() const override {
        PYBIND11_OVERLOAD_PURE(Eigen::Vector3f, Geometry3DBase, );
    }
    Eigen::Vector3f GetCenter() const override {
        PYBIND11_OVERLOAD_PURE(Eigen::Vector3f, Geometry3DBase, );
    }
    geometry::AxisAlignedBoundingBox GetAxisAlignedBoundingBox()
            const override {
        PYBIND11_OVERLOAD_PURE(geometry::AxisAlignedBoundingBox,
                               Geometry3DBase, );
    }
    Geometry3DBase& Transform(const Eigen::Matrix4f& transformation) override {
        PYBIND11_OVERLOAD_PURE(Geometry3DBase&, Geometry3DBase, transformation);
    }
};

template <class Geometry2DBase = geometry::GeometryBase<2>>
class PyGeometry2D : public PyGeometry<Geometry2DBase> {
public:
    using PyGeometry<Geometry2DBase>::PyGeometry;
    Eigen::Vector2f GetMinBound() const override {
        PYBIND11_OVERLOAD_PURE(Eigen::Vector2f, Geometry2DBase, );
    }
    Eigen::Vector2f GetMaxBound() const override {
        PYBIND11_OVERLOAD_PURE(Eigen::Vector2f, Geometry2DBase, );
    }
};


We always struggled to serve you with the best online calculations, thus, there's a humble request to either disable the AD blocker or go with premium plans to use the AD-Free version for calculators.
Disable your Adblocker and refresh your web page 😊
Table of Content
|1||What Is A Board Foot In Lumber (BF)?|
|2||Board Foot Formula:|
|3||Board Foot Units:|
|5||How To Calculate Board Feet?|
|6||What do you mean by the term “Surface Measure”?|
|7||What is meant by nominal measurement?|
|8||How do you define lineal measurement?|
An online two’s complement calculator allows you to calculate 2’s complement of the given decimal, binary or hexadecimal number. No doubt, number conversion is complicated to express but the 2s complement calculator changes the entered number into one’s complement, two’s complement, signed binary to decimal, and hexadecimal. The twos complement converter can convert numbers with 4-bit, 8-bit, 12-bit, and 16-bit representations, and add custom representations for the binary conversion.
There is a simple mathematical operation on different binary numbers and used in computing as the method of signed number representation. To get 2’s complement of a binary system, just transpose the certain number and add one to the LSB (Least Significant Bit) of given results.
For instance, to convert decimal to 2’s complement, we have a number (20)10 which is equal to (0001 0100)2. Now convert 1 to 0 and 0 to 1, so number is 1110 1011 and add 1 in one’s complement to get two’s 1110 1011 +1 = 1110 1100.
Well, it doesn’t matter whether you have decimal or hexadecimal numbers, an online two’s complement converter allows you to convert any number into binary number as well as apply the mathematical operation.
When it comes to two’s complement calculations, our 2s complement calculator helps you to perform different conversions. Let’s take a look to get a better understanding:
To get a 1s complement of any decimal number, the converter changes the given decimal or hexadecimal number into binary form and simply inverts the number.
Elaborate 1’s complement of 80.
(80)10 = (0101 0000)2
Now, invert the number
(0101 0000)2 = 1010 1111
To convert decimal to 2’s complement, you just enter a number as an input, the twos complement calculator converts the entered value into a binary system, then apply the 1s complement operation on it and add 1 to the LSB of the given result.
Find 2s complement of 80.
(80)10 = (0101 0000)2
By applying 1’s complement operation
(0101 0000)2 = 1010 1111
So, add 1 to the least significant bit
1010 1111 + 1 = 1011 0000
There are many direct or indirect methods to convert any signed decimal to binary number. But 2’s complement calculator takes the input from a user and changes it into a binary number by using a decimal to binary formula.
However, An Online Binary Calculator allows you to do arithmetic operations on two binary numbers as well as with 8, 10 & 16 base numbers.
Convert 112 into a binary number.
First perform short division by 2 with a reminder.
|112 ÷ 2 = 56||0|
|56 ÷ 2 = 28||0|
|28 ÷ 2 = 14||0|
|14 ÷ 2 = 7||0|
|7 ÷ 2 = 3||1|
|3 ÷ 2 = 1||1|
|1 ÷ 2 = 0||1|
Now, write a reminder in reverse order (bottom to top), this will be 1110000 which is equal to decimal integer 112.
To convert a decimal number to hexadecimal you need to divide the number by 16 and write down the remainder in hexadecimal, divide the result again and again by 16 until the result is 0. Now, the hex value is a sequence of reminders from bottom to top. Moreover, by using a two’s complement calculator you can make these calculations in a very efficient way.
Convert 256 decimal to hex.
|Division||Results||Remainder in hex|
|256 / 16||16||0|
|16 / 16||1||0|
|1 / 16||0||1|
Now the answer is (256)16 = (100)10
To convert the binary numbers into 1’s complement, you need to enter a binary, decimal, or hexadecimal number as an input, then an online calculator simply changes that value in the binary form then inverts the given number.
Find the 1s complement of 1110 0000.
The binary number is (1110 0000)2 and apply this mathematical operation.
(1110 0000)2 = 0001 1111
The 2s complement converter will convert the binary number into 2’s complement and transpose the binary number as well as add 1 to the LSB of the given result.
Find the 2s complement of 1110 0000.
Now, the binary number is (1110 0000)2, and inverts the number
(1110 0000)2 = 0001 1111
So time to add 1 to the LSB of this result
0001 1111 + 1 = 0010 0000
In order to turn a binary number into a decimal number, each bit is a power of 2. This means every binary number has a power of 2 with the rightmost position of 2^0.
Find the decimal number of a binary number (1010)_2?
The binary (1010)_2 can be written as follows:
(1 * 2^3) + (0 * 2^2) + (1 * 2^1) + (0 * 2^0)
8 + 0 + 2 + 0 = 10
So, the decimal number of (1010)_2 is 10.
Two’s complement calculator convert signed binary to hex, you need to remember each hexadecimal number represents four binary digits and makes the group in sets of four. In such cases don’t have enough digits to make up the set of 4 digits, then add extra 0’s to make a group.
This online calculator can do all these calculations instantly by using the standard formula of convert numbers from binary to hexadecimal. Furthermore, the Rounding Calculator allows you to round numbers up or down to nearest ones, tenths, hundredths, thousandths, ten thousand, hundred thousand.
Convert (10001110)_2 to (8E)_16.
firstly, convert 8 bit binary into groups of (1000) and (1110) into hexadecimal.
So, 8E is equal to 10001110.
In order to convert a hexadecimal number into one’s complement, the 1s complement calculator first changes the hex number into a binary number and transposes the given result.
For instance, 8E is equal to 10001110, then apply the 1’s complement operation on it by inverting the binary number. So the one’s complement of 8E is 01110001.
The 2’s complement calculator takes the 1s complement of hexadecimal number and adds 1 into the given results. If the one’s complement of 8E is 01110001 then our calculator adds 1’s in this number, so the 2s complement of 01110001 is equal to 01110010.
If you need to convert hexadecimal numbers into binary, 2’s complement converter will convert letter values of hexadecimal(0, …,9, A, …, F) into their decimal equivalents and change them into the power of two (8, 4, 2, or 1). Furthermore, write down 1 below the power of two that are used and write 0 that is not used.
The online hexadecimal two’s complement converter will convert a hex number into binary or octal, then it converts into a decimal number. If the hex number is 8E and its binary number is 01110001 then an online calculator changes this number into decimal which is 142.
Adding 2s complement is very easy. It’s just like the addition of the ordinary binary numbers. The only difference here is that you deal with two’s complement form of the binary numbers. Moreover, you can also use our best two’s complement addition calculator for adding twos complement in a fragment of seconds.
Let us resolve a couple of examples to represent the addition as follows:
Example # 01:
Add the following binary two’s complements:
Here we have:
(1010100)_2 + (0010100)_2
The free 2s complement addition calculator also goes for displaying the same answer but in seconds that saves you a lot of time.
Example # 02:
Convert 13 and 12 to their equivalent two’s complements and add them.
First of all, we will determine the binary form of the given numbers:
13 = 1111
12 = 1100
Computing 1’s complement:
13 = 1111 = 0000
12 = 1100 = 0011
Computing 2’s complement:
(0000) + 1
(0011) + 1
Adding 2s complements:
(0001) + (1100)
In case you feel a hurdle during calculations, let this free 2’s complement addition calculator fade them away for you.
Subtracting two’s complement is reciprocal to that of addition. All you need to follow is the ordinary binary subtraction rules. The free 2s complement subtraction calculator also follows the rules to perform subtraction of two’s complements.
Get through the example below to understand how the 2’s complement subtraction is carried out.
Example # 01:
Subtract the following two’s complements:
Here we have:
(10111) – (10000)
Which is our required answer that could also be cross-checked by using our best two’s complement subtraction calculator.
The 2’s complement calculator works as follows to find the 2s complement of entered values, add, or subtract them. Let’s take a look at its working!
This 2s complement calculator displays the following results:
The free two’s complement addition calculator performs:
The number system is a technique which used to work and represent numbers is called a number system. Some most common number systems are binary, decimal, octal, and hexadecimal, etc.
In signed notation or Two’s complement representation, the first bit of number tells about the sign. If a number with a leading 1 shows negative while leading 0 denotes a positive value. So, in 8-bit, we can write any number from negative 128 to positive 127.
For conversion of signed binary to decimal is simple, but multiply -1 with the leading digit instead of 1. For instance,
Decimal = – 1*2^7 + 0*2^6 + 1*2^5 + 1*2^4 + 1*2^3+ 0*2^2 + 1*2^1 + 1*2^0
Decimal = – 128 + 32 + 16 + 8 + 2 + 1 = -69
The result of subtracting the given numbers is -1100 that could also be verified by using 2s complement subtraction calculator.
Hence, two’s complement calculator makes all complement-related calculations just handy. Find the 2s complement of any number manually is a very difficult task because it needs many conversions to get accurate results. So, it’s a great platform for K-12 educators and professionals to learn and apply the examples for learning different types of conversions in the number system.
From the source of Wikipedia: Converting from two’s complement representation, From the ones’ complement, Working from LSB towards MSB.
From the source of Tutorials Point: 2’s Complement of a Binary Number, Uses of 2’s Complement Binary Numbers, Range of Numbers.
From the source of Cornell: Conversion from Two’s Complement, Arithmetic with Two’s Complement, Why Inversion and Adding One Works.


There are n cities located along the one-way road. Cities are numbered from 1 to n in the direction of the road.

The i-th city had produced pi units of goods. No more than si units of goods can be sold in the i-th city.

For each pair of cities i and j such that 1 ≤ i < j ≤ n you can no more than once transport no more than c units of goods from the city i to the city j. Note that goods can only be transported from a city with a lesser index to the city with a larger index. You can transport goods between cities in any order.

Determine the maximum number of produced goods that can be sold in total in all the cities after a sequence of transportations.


You hold the interesting details for yourself. Is this a a wireless mouse/keyboard combination, or a standard wired mouse with a standard wired keyboard? Standard, there's not a single common factor between the two.
It looks like hardware, but please tell more.
I keep losing control of my mouse--the red light just turns off completely and does not respond to movement at all. A few minutes after that I lose control of my keyboard too--the lights turn off and it does not respond. Usually when I notice the mouse is out I'll restart using the keyboard before it dies too. When I reboot everything starts as normal, but it continually does this. I'm not sure if this is a hardware thing or not, but any advice would be appreciated. =)


The objective here is to show the process to create soft edges inside a video projector output.
Go inside any
This section describes how to configure Smode processors in order to configure your output(s) and also make some nice and smooth stage pre-visualisations
of your project, either one embedded inside a
Virtual video projectors of Smode stage, used for real life mapping, usually directly connected to the Outputs
or a standalone processor, like we did in the
Create a single display project with a Warped output
Objective : Create a project with a single content map and a single output
Now all you have to do is to add a
Define a 2D Mask applicable on any 2D Renderer or 2D Modifier
on the processor and go inside the mask parameters add a feather to one of it's edges. Any masks can be used to create a soft edge, either a placement, radial or a polygonal maks. But usually we use a simple
Solid mask that has a 2D Placement
Inside the feather parameters of the mask you'll see an "exponent" value, try to change that parameter to create nicer soft edges, depending on the context.
Here is a soft edge added over the Processor of a video Projector:
Here is a soft edge added over a composition set with a
Placement defined by a quad using perspective interpolation
inside the Processor of a video Projector. As you see, if the Mask is put on the perspective composition, soft edges will follow the warp.
Now if you have many VP inside your stage simulation, you can go in Simulation mode and lock the view to simulate the soft edges:
Note that you can also use the
Add inner and outer soft-edges
effect to create soft edges. The interest of this is that you can create soft edges with color so it can help you see exactly what you are doing.
If you use vioso, go check this topic:
Create a Multi Video-projectors dome with a Vioso calibration
Build a 6 Video-projectors dome setup with Vioso calibration file (www.vioso.com)


We need a toolbar for our site that will have a search box, drop down menu. We would like it to be an auto install toolbar. The more complicated part of this project is we need a replicating toolbar for our affialtes. we want to give our affilates toolbars to distribute. so we will need some system that will allow us to add in the affilates code and then create them a toolbar for them to distribute. i dont know how to achomplish this. please if you have a solution or questions ask on the PMB.


New Year is coming, and Jaehyun decided to read many books during 2015, unlike this year. He has n books numbered by integers from 1 to n. The weight of the i-th (1 ≤ i ≤ n) book is wi.

As Jaehyun's house is not large enough to have a bookshelf, he keeps the n books by stacking them vertically. When he wants to read a certain book x, he follows the steps described below.

1. He lifts all the books above book x.
2. He pushes book x out of the stack.
3. He puts down the lifted books without changing their order.
4. After reading book x, he puts book x on the top of the stack.

He decided to read books for m days. In the j-th (1 ≤ j ≤ m) day, he will read the book that is numbered with integer bj (1 ≤ bj ≤ n). To read the book, he has to use the process described in the paragraph above. It is possible that he decides to re-read the same book several times.

After making this plan, he realized that the total weight of books he should lift during m days would be too heavy. So, he decided to change the order of the stacked books before the New Year comes, and minimize the total weight. You may assume that books can be stacked in any possible order. Note that book that he is going to read on certain step isn't considered as lifted on that step. Can you help him?


I found a thread a while back about a person who either made a replica or got a hold of a casting of the Doctor Doom mask used in the production of The Fantastic Four (1994). I recently went to revisit the thread only to find a page that said it could not find the thread I was looking for. I then searched google images hoping to find a picture from the thread, and finally! I had found it, only to be greeted by the same error screen. I was able to get the url of one of the images, I'll paste it here: https://www.therpf.com/forums/threads/doomed-roger-corman-dr-doom-mask-1994-ready.243400/page-6 all help is appreciated, I hope it's possible to locate it somehow, I very much would like to get my hands on a casting of it for myself.


Google Monday released a product called "Open Data Browser" (Public Data Explorer) search tools to official data, some of the common search requests for the production of charts, visual form to reflect a more intuitive search results.
"Open Data Browser" by Google and the World Bank and other statistical agencies to launch, in the google labs intuitive class data chart. The search tool provides schools, population, crime, and even building data charts to help users understand some trend information.
Meanwhile, according to analysis of the data search, google search also announced the highest number of public data information, which compared the school and the unemployment rate as the most frequently searched for information on public data, followed by the demographic, business and salaries and other sharp . This information can be carried out by mobile chart shows data changes over time.
And google to launch the "Open Data Browser" The search tools include the World Bank, the United States Bureau of Labor Statistics, U.S. Census Bureau, the Organization for Economic Cooperation and Development, California Department of Education, the European Bureau of Statistics, the U.S. Centers for Disease Control and U.S. Bureau of Economic Analysis.
As a member of Google Labs, Google Public Data Explror can bring their own tools for a variety of charts and maps to help people make use of the 80 public data sources and statistical surveys, such as embedded below the statistics show that in the past 47 years countries with economies in most of the average life expectancy and the number of births per woman. Through the scroll bar you can see the data in the annual process of change in a very practical and intuitive. These charts are generated from Google acquired Gapminder Foundation year's Trendalyzer technology, then Google will these technologies into a Google Spreadsheets to Motion Chart and Visualization API in.


Novel–The Legendary Mechanic–The Legendary Mechanic
Chapter 1266 Travelling Feidin icicle cagey
The Makers of Canada: Bishop Laval
Since he spoke, Han Xiao smiled inside of a praising way.
After recording these a.s.sailants, he had dug within the impressive cleverness by interrogation and looking at of memories. Every one of the Calamity Grades that attacked Kevin were definitely working on requests along with quietly operated the galactic pirates that had been wandering around close by, patiently waiting to intercept Kevin.
In earlier times, since he was concered about the possibility of a rapid loss of Karlot as a result of remarkable modifications in the plot, he failed to insist upon poaching him. Having said that, ever since somebody was focusing the Beyond Level A seed products, they could not pin the blame on him for accomplishing t.i.t for tat.
Han Xiao rubbed his brows, his thoughts wandering before he suddenly considered some thing.
Easygoing Atelier Life ~May And The Fluffy Miniature Garden~
Han Xiao nodded. “That’s proper. Companies that have the motivation and the expertise to do this are few and far somewhere between. The Very Legend Cl.you.s.ter Alliance is likewise suspicious.”
Primarily, Karlot was required to become the pillar of the dynasty, the good news is that they had commenced this fiasco, they ought to not blame him for this!
Fundamental Reward: 8 billion Encounter, +20 Favorability of rescued targets, 2 Randomly Incentives, 1 Blank Personality Summon Charge card.
As he spoke, Han Xiao smiled inside a praising manner.
“Even so, whenever we don’t cease this, the seed products will suffer wonderful casualties, which is certainly not favorable in our hiring of new Beyond Level As. Then why not this? Don’t they wish to sign up for the various Beyond Quality A agencies? We’ll check with those businesses to privately deliver folks to shield and escort them. This is certainly rationalized in identify.”
Feidin demonstrated a powerless term. He experienced already reconciled to the point that he was obviously a application to get used.
“Oh? You’re praoclaiming that someone is seeking over the Beyond Class A seeds?”
There had been no Beyond Class A a.s.sociation within his earlier daily life, and Sanctum Revival was stored under wraps, therefore the Beyond Standard A plant seeds were definitely not intercepted. This was the first time Han Xiao got came across this type of situation, not knowing what the three Universal Cultures would even do.
“The 3 Worldwide Societies have quite the solid response to this. Having the capacity to coexist in harmony is usually a tube dreamâ€¦ Anyhow, the variation enhance went on for almost fifty years, therefore, the players ought to be lower back soon. I’m worried designed to bring about another explosion.”
“You’ve received a great worth this point. While not your notice, we might had to wait till many seeds journeyed lacking before we recognized a little something was incorrect. My final decision to possess you choose to go as well as Aurora had been a great move!”
“Also, the three Worldwide Societies ended up clear they had missing the monopoly selling point of experiencing Greatest Understanding. The a.s.sociation can give whatever they can offer, and also the inclusion in the Sanctum Revival, it will likely be complicated so that they can entice new abilities. On the other hand, the a.s.sociation did not even require any advertis.e.m.e.nt to attract new talents. Once they do nothing, the problem will surely get worse, so as opposed to resting and seeing, it’s better to deliver these Loss of life Fighters to kill folks and ruin whatever they can’t get.
He felt that Feidin was the ideal intelligence official. Plenty of people obtained to locate points, however it was the exact contrary for Feidin. Even if he were definitely simply to lie down every day, he would still have the capacity to run into key intelligence, as if it was an automated method for him.
“Passing away fighters without any history? For you to teach up eight Calamity Levels as Loss of life fighters from an early time, this really is no compact organization. The idea teaching should really be a kind of brainwas.h.i.+ng that could have a long term effects on the Calamity Grades. This should actually be engineering at or over the Celebrity Cl.u.s.ter degree.”
Vision Purpose: Make an effort to prevent the shopping in the Beyond Grade A plant seeds.
Han Xiao’s brows rose. “To imagine you’re inserting a great deal benefits during this matter. It appears as though you also know the symptom in this.”
As inferred, there had been a very high likelihood that there existed a few hunter group. At present, there are lots of Beyond Class A seed products rus.h.i.+ng to the Flickering Planet from each Celebrity Niche, so that the orchestrators behind the curtain had been very likely to deploy interception troops. These Beyond Grade A seed products would be in peril, as not all of them could be so blessed to move in to the best milkmaid of your universe.
“Privately dispersing it on the seeds is sufficient. This reports must not be distributed over a big scaleâ€¦ When we uncover it now, the most joyful will be the Awesome Celebrity Cl.you.s.ter Alliance. I don’t would like to rip off all pretenses while using three Standard Civilizations, neither do I wish to be utilized as a weapon from the Awesome Superstar Cl.u.s.ter Alliance. Let’s concentrate on coverage 1st. For now, we are going to stay away from clash whenever possible.”
“The three Standard Cultures have quite the strong reaction to this. Having the capacity to coexist in equilibrium is usually a tubing dreamâ€¦ Anyhow, the type up-date went on for up to fifty years, hence the people should be backside quickly. I’m hesitant that may induce another blast.”
Han Xiao closed up the screen. The amount of this intention had not been ample to inspire him anymore. Nowadays, he compensated even more awareness to the challenge by itself.
“Ok.” Feidin paused for just a moment. “Even so, this result compel will come across fights along with the shopping squad. Can we prefer to distribute this news to make the seed products careful, as well offering a warning to your human being behind the curtain?”
Needless to say, he could not overlook the probability there was someone fis.h.i.+ng in the muddied oceans, so Han Xiao failed to immediately hop to some verdict. Instead, he merely a.s.sumed it to be the secret surgery in the three Widespread Societies or maybe the Awesome Celebrity Cl.you.s.ter Alliance.
“The objective of the a.s.sociation is primarily to settle the disputes relating to the Beyond Quality As, hence the Calamity Standard is not inside our opportunity. Nominally, it is really not suitable for us to cross the limit and supply a.s.sistanceâ€¦”
“Converse in great detail, I wish to know every thing.” Han Xiao placed along the parts in the palm, his phrase transforming solemn.
Objective Objective: Try and stop the searching from the Beyond Standard A plant seeds.
Novel–The Legendary Mechanic–The Legendary Mechanic


CA Performance Management monitors, stores, analyses, and displays a massive amount of information, for assuring service quality across large, complex, multi-technology, multi-vendor network infrastructure. The solution helps the largest networks successfully monetize service offerings while lowering the cost and complexity of service.
CA Spectrum is a services and infrastructure management system, that monitors the state of managed elements. Status information such as fault and performance data, from these elements is collected and stored. However, where Spectrum excels is how it uses this data, as CA Spectrum constantly analyses this information, to track conditions within the computing infrastructure. Using its industry leading fault intelligence, if an abnormal condition is detected, the product isolates it, alerts you, and presents the possible causes and solutions.


You are given a chessboard of size $$$n \times n$$$. It is filled with numbers from $$$1$$$ to $$$n^2$$$ in the following way: the first $$$\lceil \frac{n^2}{2} \rceil$$$ numbers from $$$1$$$ to $$$\lceil \frac{n^2}{2} \rceil$$$ are written in the cells with even sum of coordinates from left to right from top to bottom. The rest $$$n^2 - \lceil \frac{n^2}{2} \rceil$$$ numbers from $$$\lceil \frac{n^2}{2} \rceil + 1$$$ to $$$n^2$$$ are written in the cells with odd sum of coordinates from left to right from top to bottom. The operation $$$\lceil\frac{x}{y}\rceil$$$ means division $$$x$$$ by $$$y$$$ rounded up.

For example, the left board on the following picture is the chessboard which is given for $$$n=4$$$ and the right board is the chessboard which is given for $$$n=5$$$.

You are given $$$q$$$ queries. The $$$i$$$-th query is described as a pair $$$x_i, y_i$$$. The answer to the $$$i$$$-th query is the number written in the cell $$$x_i, y_i$$$ ($$$x_i$$$ is the row, $$$y_i$$$ is the column). Rows and columns are numbered from $$$1$$$ to $$$n$$$.


Last month I was lucky enough to move house. In the rush to pack everything into boxes and hire a moving company this blog was one of the last things on my mind. And so, unfortunately my Raspberry Pi has stayed in the cupboard for the best part of a month, and because of this my blog has been offline for about as long. I didn’t really think about it until I met my friend Frosty and he mentioned my post about the band. Someone actually read my blog! Who would have thought? And then I remembered the Pi sitting in my drawer, my blog dead…
As an IT professional, I owe it to myself to have a working personal site. So I’ve decided to take my own advice upgrade to the cloud!
When Amazon launched their Lightsail service about a couple of years ago, I didn’t take much notice of it. It’s not really aimed at the enterprise customers who I normally deal with, and you can normally get the same functionality out of marketplace AMIs with EC2. However, for my own project, the pricing is rather good. AWS offer you a basic VPS (virtual private server) with 20Gb of SSD storage for as little as $3.50 per month. This is about half the price of standard EC2 – the simple monthly calculator comes to $6.44 / mo when using a t3.nano with 20Gb of GP2 storage (I no longer qualify for free tier).
Setting up was fairly easy. When you log into the AWS console and find the lightsail service, you get redirected to a much simplified console. AWS are clearly targeting Lightsail towards hobbyists, novices and people who don’t want to know the inner workings of EC2.
IP addresses and DNS
Rather than pay extra for a static IP address I chose to continue using DuckDNS in the same way as on my Raspberry Pi. I would run a script on the instance every hour, which would update the DuckDNS record, to which the DNS name of my blog is mapped with a CNAME record. This code snippet shows how you can set up your server to update dynamic DNS records with DuckDNS and cron.
# Setup duck DNS (as root) DUCK_DOMAIN=( Your DuckDNS.org domain, without .duckdns.org ) DUCK_TOKEN=( Your DuckDNS.org token ) mkdir /var/log/duckdns/ echo '#!/bin/bash' > /usr/local/bin/duckdns echo "echo url=\"https://www.duckdns.org/update?domains=$DUCK_DOMAIN&token=$DUCK_TOKEN&ip=\" | curl -s -k -o /var/log/duckdns/duck.log -K -" >> /usr/local/bin/duckdns chmod 755 /usr/local/bin/duckdns crontab -l > mycron echo "0 0 * * * /usr/local/bin/duckdns >/dev/null 2>&1" >> mycron crontab mycron rm mycron
Migrating the data from my old site was fairly easy. I used a plugin called UpdraftPlus to take backups of my old site, all I had to do was import the backups and restore the site. All my plugins, posts, images, everything was transported over.
One of the things which used to annoy me when running WordPress on my Raspberry Pi was that it didn’t have enough RAM to run all the plugins I wanted to (if I went over the limit, MySQL would fail rather gracelessly bringing the site down). This isn’t a problem now as I have 500 Mb to use on my VPS.
Making it homely
One of the things I really liked about my PI was the personalised splash screen when I log in. I set this up using the MOTD module as well as some custom scripts and packages. Since Lightsail wordpress runs on Ubuntu, this was very easy to replicate.
I use a module called neofetch to display some basic system stats when I log in, a module called TOILET to print my name in big shiny letters, and the GNU fortune module so that any shell session starts out with a bit of silliness.
# Setup MOTD apt-get install fortune cowsay toilet -y add-apt-repository ppa:dawidd0811/neofetch && apt-get update -y && apt-get install neofetch cat <<EOF > config/update-motd.d/10-hello #! /bin/bash toilet --metal -f pagga "PLAUSIN" neofetch /usr/games/fortune EOF chmod 755 /etc/update-motd.d/* echo "" > /etc/motd rm /etc/update-motd.d/10-uname
So that about wraps it up! Now that my blog is (hopefully) more up than down, hopefully you can expect a few more posts from me.


Alice and Bob came up with a rather strange game. They have an array of integers $$$a_1, a_2,\ldots, a_n$$$. Alice chooses a certain integer $$$k$$$ and tells it to Bob, then the following happens:

- Bob chooses two integers $$$i$$$ and $$$j$$$ ($$$1 \le i < j \le n$$$), and then finds the maximum among the integers $$$a_i, a_{i + 1},\ldots, a_j$$$;
- If the obtained maximum is strictly greater than $$$k$$$, Alice wins, otherwise Bob wins.

Help Alice find the maximum $$$k$$$ at which she is guaranteed to win.


Meta Super User
to customize your list.
more stack exchange communities
Start here for a quick overview of the site
Detailed answers to any questions you might have
Discuss the workings and policies of this site
Software to manage ideas that lets you branch things out [closed]
I can't remember the name of it, but there is open source software that lets your organize your ideas, but letting you create leaf nodes from your main idea. What is this type of software called, so ...
May 16 '12 at 3:00
newest mind-mapping open-source questions feed
Hot Network Questions
How to handle player knowledge when they fumble a knowledge roll
Why don't game developers release their source code?
How to toggle between ascending and descending in List.sort() of custom type?
How to explain Heartbleed without technical terms?
Looping through an Excel document in C#
Applying and interviewing for a faculty position without intent of accepting position
How much cash can you carry in a European Union domestic flight?
How another popular language would avoid having to use factory pattern while managing similar complexity as in Java/JEE?
Is "The MSO/MSE Split is soon underway" grammatically correct?
Why did early telephones use a rotary dial instead of 10 individual buttons?
Example of a sequence with more than one limit.
Why do Disney parents usually die?
Why guitar sounds smoother in high frets?
Resources for Creating a Home-Brewed Alchemy System Using Real World Herbs?
Something of value that is worthless in the current context?
Why didn't Stark sue the government for stealing his armour in Iron Man 2
Proof about prime numbers
Just found out my 13 year old girl is Bi and dating a 17 year old girl in an "open" relationship. Huh? Now what?
Can I use vodka to clean my keyboard?
Is it possible that "A counter-example exists but it cannot be found"
Pass ID into URL for newform.aspx?
Does `sl` ever show the current directory?
How to retain vested employees?
Why are there so many human Borg?
more hot questions
Life / Arts
Culture / Recreation
TeX - LaTeX
Unix & Linux
Ask Different (Apple)
Geographic Information Systems
Science Fiction & Fantasy
Seasoned Advice (cooking)
Personal Finance & Money
English Language & Usage
Mi Yodeya (Judaism)
Cross Validated (stats)
Theoretical Computer Science
Meta Stack Overflow
Stack Overflow Careers
site design / logo © 2014 stack exchange inc; user contributions licensed under
cc by-sa 3.0


The Chip8 is the target software project for those which want to start code an emulator. This project is another example of this "machine". The language choosed was Java and to render stuffs was used Java2D, there is a chance to make one render engine using jogl. (in the future). An simply debugger system is offered too. A two notation disassembler (David Winter & Michael Toren) is inside too.
Thanks for all info on the Internet (mainly to these authors Winter and Toren) and thanks very very very much to runawayprisoner (from forums.ngemu.com) thus like to emutalk chip8 thread.
Emutalk Chip8 Thread
Ngemu Chip8 Thread
Copyright © 2013 Black Duck Software, Inc. and its contributors, Some Rights Reserved. Unless otherwise marked, this work is licensed under a Creative Commons Attribution 3.0 Unported License . Ohloh ® and the Ohloh logo are trademarks of Black Duck Software, Inc. in the United States and/or other jurisdictions. All other trademarks are the property of their respective holders.


Eric is a full featured Python and Ruby editor and IDE, written in Python. It is based on the cross platform Qt GUI toolkit, integrating the highly flexible Scintilla editor control. It is designed to be usable as an everyday quick and dirty editor as well as being usable as a professional project management tool, integrating many advanced features that Python offers the professional coder. Eric includes a plug-in system, which allows easy extension of the IDE functionality with plug-ins downloadable from the net. Current stable versions are Eric4 based on Qt4 and Python 2 and Eric5 based on Python 3 and Qt4.
GNU libmicrohttpd is a small C library for embedding HTTP server functionality into other applications. It is reentrant, fast, supports HTTP 1.1, and permits listening on multiple ports. The API is simple and still powerful enough to allow programmers to use the entire HTTP feature set. SSL/TLS support is available as an option.
Forban is a P2P file sharing application for link-local and local area networks. Forban works independently from the Internet and uses only the local area capabilities to announce, discover, search, or share files. Forban relies on HTTP and is opportunistic, meaning that it replicates any files of interest seen in its proximity. The Forban protocols are minimalistic to ease the production of other implementations.
The Open Real-Time Ethernet (ORTE) is an implementation of the Real-Time Publish-Subscribe (RTPS) communication protocol. RTPS is a new application layer protocol targeted to real-time communication areas, and is built on the top of standard UDP stack. Since there are many TCP/IP stack implementations under many operating systems, and RTPS does not have any other special hardware or software requirements, it should be easily ported to many target platforms. Because it uses only UDP, it retains control of timing and reliability.
MyMediaLite is a lightweight, multi-purpose library of recommender system algorithms. It addresses the two most common scenarios in collaborative filtering: rating prediction (e.g. on a scale of 1 to 5 stars), and item prediction from implicit feedback (e.g. from clicks or purchase actions). It contains dozens of recommender engines, including state-of-the-art matrix factorization methods. It also supports real-time updates to the recommender engines, storing engines to disk and reloading them again, and several evaluation measures to compare the accuracy of different recommender system methods. Three command-line programs that offer most of the functionality contained in the library are included.
pyHIDS is a host-based intrusion detection system. It uses an RSA signature to check the integrity of its database. Alerts are written in the logs of the system, and can be sent via email to a list of users or on IRC channels (through the irker IRC client). You can define rules to specify files to be checked periodically.


There is a grid, consisting of $$$2$$$ rows and $$$n$$$ columns. The rows are numbered from $$$1$$$ to $$$2$$$ from top to bottom. The columns are numbered from $$$1$$$ to $$$n$$$ from left to right. Each cell of the grid contains an arrow pointing either to the left or to the right. No arrow points outside the grid.

There is a robot that starts in a cell $$$(1, 1)$$$. Every second, the following two actions happen one after another:

1. Firstly, the robot moves left, right, down or up (it can't try to go outside the grid, and can't skip a move);
2. then it moves along the arrow that is placed in the current cell (the cell it ends up after its move).

Your task is to determine whether the robot can reach the cell $$$(2, n)$$$.


"magical landscape inside of a jar, by Alexander Fedosav"
"landscape inside of a jar"
"Hyper detailed digital matte painting, concept art, hyperrealism, 16k resolution, Cinema 4D, 8k resolution, maximalist trending on artstation, behance HD, a masterpiece, by Stephan Martiniere"
"film noir, bright, neon"
"by David A. Hardy and Julia Pott"
Join the conversation


The new pedestrian zone in Moscow city center consists of $$$n$$$ squares connected with each other by $$$n - 1$$$ footpaths. We define a simple path as a sequence of squares such that no square appears in this sequence twice and any two adjacent squares in this sequence are directly connected with a footpath. The size of a simple path is the number of squares in it. The footpaths are designed in a such a way that there is exactly one simple path between any pair of different squares.

During preparations for Moscow City Day the city council decided to renew ground tiles on all $$$n$$$ squares. There are $$$k$$$ tile types of different colors, numbered from $$$1$$$ to $$$k$$$. For each square exactly one tile type must be selected and then used to cover this square surface. To make walking through the city center more fascinating, it was decided to select tiles types for each square in such a way that any possible simple path of size exactly $$$k$$$ contains squares with all $$$k$$$ possible tile colors.

You need to find out whether it is possible to place the tiles this way or not.