Caching – Map synchronization algorithm

Suppose I have two Map Instances in JavaScript (or HashMap in Java or Dictionary in C #), A and B. I want to sync B to A, so B is a copy of A. I can not copy the reference and do not want to delete and re-add all keys. I want B to be available and mostly accurate during processing. What is the most efficient algorithm for this?

I am looking for a general algorithm for cache synchronization while the second cache remains available. This seems to be the same as dealing with cards.

litecoin – Buy a small amount of Bitcoin with a virtual map

I want to buy bulk ads from and the amount is totaled to $ 1 (excluding transaction fees), but somehow they do not accept cards as a direct payment. Now I know that I obviously can not use Bitcoin for micropayments, but I can use Litcoin, but even then, how would I buy so little LTC with a ticket as if I wanted to spend $ 5, but the minimum is $ 50 most sites I just think that you buy a very unpopular old coin and then trade it against shapeshift, but even to buy Dogecoin, I need $ 50. How is cryptocurrency micro payment possible?

Unit – Recommended data structure for storage and quick access to infinite, piece-based elevation map terrain

I want to create a chunk-based heightmap terrain in Unity.
I've already set up a basic multifractal simplex noise and am working on it that I can generate height fields and meshes at runtime … but only one at a time.

I'm trying to figure out how best to store and access each block. I have already worked out some methods to convert global positions into chunk coordinates and chunk-local barycentric triangular coordinates so that I can interpolate heights. I've used this to create a way to beam a ray from the camera space to space over the mesh and traverse the intersections in the x / z plane until the intersection is found in elevation – position yourself on the terrain without having to install collision networks for each chunk, and use Unity's Raycasting. Everything works fine.

I'm just a bit clueless about how to implement the main infinite grid memory from which I generate chunk meshes.

This is planned to serve a game with an isometric perspective that reveals the world, while units investigate the fog of war over time … with the ability to move the camera through the uncovered terrain relatively quickly There may be limited possibilities to unload previously generated chunks. It's going to be an ever-growing dataset (so I'll probably have to look for ways to minimize memory).

I think I can either:

  1. For the entire site, create a two-dimensional array of float values ​​(or perhaps short values ​​of 64 KB in height) and dynamically resize the array as the X / Z boundaries move backward. Generate only the terrain mesh in chunks to keep any mesh chunk below the Unity 64k vertex boundary.
  2. Create a grid manager class with a kind of dynamic data structure that stores and instantiates / references map chunk objects, each containing its own (res * res) -large elevation map array.
  3. Something else?

I'm assuming Option 2 has the most mileage, but I'm not sure what kind of dynamic data structure to use. I would guess a kind of key / object pair structure in which the key is created from the block coordinates.

Suppose I want to access altitude values ​​quickly and consistently across chunk boundaries. I think I need a way to access chunks. That's almost as fast as looking up arrays for indices and the complexity of O (1).
Or maybe a way to cache recently accessed chunks or chunks near the camera? Or pointer to her or something?

As you can probably tell, I'm pretty new to Spielev, but I have a VFX background, so I'm familiar with 3D geometry math and basic scripts. However, when it comes to designing / structuring / implementing a game, I'm an absolute novice, so references to relevant tutorials and the like are welcome.

Agile Algebraic Geometry – When is a monomial rational map birational on projective space?

To let $ k $ be an algebraically closed map $ 0 $,

To the $ alpha: = (a_1, … a_ {n + 1}) in mathbb N ^ {n + 1} _ { ge 0} $ , To let $ bar x ^ { alpha}: = x_1 ^ {a_1} … x_ {n + 1} ^ {a_ {n + 1}} in k (x_1, …, x_ {n + 1} ) $,

Consider a rational map $ f = (f_1: …: f_ {n + 1}): mathbb P ^ n to mathbb P ^ n $ where everyone

$ f_i = bar x ^ { alpha_i} $ for some $ alpha_i in mathbb N ^ {n + 1} _ { ge 0} $ and each one $ f_i $ has just mitgeagt degree $ d ge 1 $,

I'm looking for a moderately elementary proof that $ f $ is birational if and only then $ det ( alpha_1 … alpha_ {n + 1}) = pm d $ ,

I would very much appreciate it if at least I could get such proof $ n = 2 $,

Thank you in advance.

map – attach to each string in a list with mapping

I have a list of 100 things:

endings = ".w_" <> ToString[#] <> "_cold.r_0" <> ".xvg" & /@ Table[i, {i, 0, 99, 1}]

And I'm trying to add 20 different prefixes to the 100 elements, so I have a list of lists, 20 lists of 100 elements each.

When I try to match endings:

all = {"t_" <> ToString[#] <> endings} & /@ Table[i, {i, 0, 95, 5}]

I get a list of 20 lists, each of length 1. The thing to which I attach "t_" <> ToString[#]
is only appended to the beginning of the long string for each list. I have to add it to every element in the ends.

I tried to play with the {} when I did the mapping, to no avail.
is there any clever way to do this in Mathematica?

Material Design – How can we change call-to-actions on a map without complicating and prolonging the user's learning process?

We are designing a new dashboard for our platform, which will ask users for specific services, and our providers will submit offers for user requests.
When a request is submitted by a user, it should wait until the service provider responds to the request. As you may have guessed, the CTA buttons change depending on the provider or user response. for example: The user can process his request until an offer has been submitted. but after that edit buttons does not do anything anymore.
Here are 2 solutions for this kind of situation:

  1. Disable buttons that are disabled in this state
  2. Remove disabled CTA buttons and replace them with buttons that perform specific tasks

Take a look at the uploaded images for a better understanding:Status 1 (user requested and before submitting an offer from providers

State 2 (providers have made an offer on request)

Users should find out about maps that we have developed for their needs. Changing the CTA buttons in each state (which is necessary) makes the learning process more and more difficult!
What should we do about it?

jsp – 404 was not found in the servlet map

My problem is that an Apache project deployed in weblog contains a deployment descriptor web.xml and an association like this


and as far as you know, it works well
Now it has to go to Maven and I'm developing with Tomcat, but in the URL pattern, if I put it this way:


Tomcat throws me a mistake servlet and will not let me lift
In my opinion, I correct it as follows


and let me lift, I mean, I just add the diagonal at the beginning and let me lift, but if I want to access the path
localhost / mycontext / servlet
I get the 404 error.
I've already tried other combinations like


and it still gives me 404,
This servlet is achieved by a form of the type
method = post
action = "servlet"
Do you know if a transition between servlet versions has taken place? or weblogic gives a different handling of mappings and paths ?, thanks

maps – Map API with PHP

Hi! Does anyone know how to use Open Street Maps with PHP? He must give an address, give me the longitude and latitude and then show me a mark on this map. If anyone knows how it works, it could be another API (Google Maps requires a credit card to register and I do not have a kkk)

functional programming – rearrange elements in a map

I'm trying to build a module called timeline, which looks like a drag-and-drop list. If a timeline is given, someone can add elements continuously (I do not want to remove or update any elements here) and eventually decide to move one list item before another. (For the sake of brevity, I'm currently not concerned with moving one item after another.)

I want to know if the way I expressed my code is easy to think about and if there are other algorithms that I can be inspired by.

You can copy both modules here in IEX:

defmodule Timeline.Item do
  defstruct time: nil,
            title: nil,
            notes: nil,
            tags: ()

defmodule Timeline do
  alias Timeline.Item

  defstruct entries: %{}, auto_id: 0

  def add(%Timeline{entries: entries} = timeline, %Item{} = item) do
    auto_id = timeline.auto_id + 1

      entries: Map.put_new(entries, auto_id, item),
      auto_id: auto_id

  def reorder(
        %Timeline{auto_id: auto_id} = timeline,
      ) do
    from_item = Map.get(timeline.entries, from)
    difference = to - from

    case difference do
      1 ->

      _ ->
        # filter everyone before TO to and subtract 1 from their id,
        # except if they're the item intending to move
        map2 =
          Enum.filter(timeline.entries, fn {k, _v} -> k < to && k != from end)
          |> {k, v} ->
            case k do
              k when k == 0 -> {k, v}
              k when k == 1 -> {k, v}
              k when k > 1 -> {k - 1, v}
          |> Enum.reduce(%{}, fn {k, v}, acc ->
            Map.put(acc, k, v)

        map1 = Map.put(timeline.entries, to - 1, from_item)
        new_entries = Map.merge(map1, map2)

          entries: new_entries,
          auto_id: auto_id


Create a timeline and add elements:

timeline = %Timeline{} |> Timeline.add(%Timeline.Item{title: "1"})
timeline = timeline |> Timeline.add(%Timeline.Item{title: "2"})
timeline = timeline |> Timeline.add(%Timeline.Item{title: "3"})
timeline = timeline |> Timeline.add(%Timeline.Item{title: "4"})
timeline = timeline |> Timeline.add(%Timeline.Item{title: "5"})

Reorder the items by placing item 2 before Point 5.

timeline = timeline |> Timeline.reorder(2, 5)

The result is:

  auto_id: 5,
  entries: %{
    1 => %Timeline.Item{notes: nil, tags: (), time: nil, title: "1"},
    2 => %Timeline.Item{notes: nil, tags: (), time: nil, title: "3"},
    3 => %Timeline.Item{notes: nil, tags: (), time: nil, title: "4"},
    4 => %Timeline.Item{notes: nil, tags: (), time: nil, title: "2"},
    5 => %Timeline.Item{notes: nil, tags: (), time: nil, title: "5"}