#StackBounty: #information-theory #kolmogorov-complexity Mutual information between random string and Kolmogorov minimal sufficient sta…

Bounty: 150

What is the mutual information between a random bitstring $R$ and any Kolmogorov minimal structure function $S$? Specifically, is it ever true that $I(R:S)>0$?

I am interested in the case when $S$ is generated by processing $R$ somehow.

I think the answer is either no, or rarely, since if $K(S|R) < K(S)$, then part of the randomness of $R$ describes $S$, so $S$ is not a sufficient statistic.


Get this bounty!!!

#StackBounty: #android #google-maps #react-native-android #android-background #react-native-maps React Native : Google maps service kee…

Bounty: 50

When the app is in foreground everything seems to works fine.But when we force close/kill the app the map service still seems to work even after the MapView has been destroyed.We are running a background service which lets the app run in background.All the foreground services are killed when app is closed but we noticed a huge battery drain when the app is background and when we ran the Android Profiler we got to know that a service from google maps(csi.gstatic.com) is still open/running even in the background.
When researched and got to know that google maps uses the service to load the static content(images..etc) for the map.Typically the service shouldn’t be running when the MapView has been destroyed.

When App is in foregroundWhen app is in backgroun/killed state

The first image is when the app is foreground and service is running normally.
The second image is when the app is background/killed and the service is still running even though the MapView has been destroyed.(The events is fabric service).Is there a way to kill all the services related to the MapView?


Get this bounty!!!

#StackBounty: #18.04 #input-method #japanese Anthy (uim) doesn't convert anything?

Bounty: 50

Anthy, the Japanese input method, doesn’t convert anything. That is, I can’t type any katakana or kanji. I’m using uim, and I set “begin conversion” hotkey as Space Bar.

I tried converting “はんどる” to katakana by pressing Space, and it didn’t work.
I tried converting “いちにち” to kanji by pressing Space, and it also didn’t work.

Why?


Get this bounty!!!

#StackBounty: #artifactory #pypi Extending artifactory's pypi repos with plugins

Bounty: 50

I am trying to migrate a legacy system to use artifactory. However I have two blockers: (1) the old scripts require PyPixmlrpc, which artifactory doesn’t support; (2) they also make use of upload_docs, not supported by artifactory’s pypi implementation either; (3) a smaller issue, the old scripts call register and they expect 200 instead of 204 http status code.

Would it be possible for me to write a plugin to implement this? Looking at https://www.jfrog.com/confluence/display/RTF/User+Plugins I couldn’t find a callback for when POST /api/pypi/<index-name> is requested. If I can make (1) work for the methods we actually use, (2) to just pretend it deployed docs and (3) to respond with the correct status code I will be happy enough.


Get this bounty!!!

#StackBounty: #javascript #syntax #language-design Why is JavaScript UpdateExpression syntax so defined?

Bounty: 50

According to Ecma-262, prefix increment and decrement operators are defined as:

UpdateExpression :
    LeftHandSideExpression ++
    LeftHandSideExpression ‐‐
    ++ UnaryExpression
    ‐‐ UnaryExpression

This is surprising, both that the postfix and prefix operators are defined in the same rule, and that it’s ++ UnaryExpression when surely a unary expression in general is not actually a valid argument for the update operators.

It would seem cleaner and more logical to define the prefix increment and decrement operators in UnaryExpression itself, along with the other prefix operators, and other C syntax languages do this, e.g. the C standard section 6.5.3 defines unary-expression to include the prefix update operators along with the others.

Why does JavaScript define these operators the way it does?


Get this bounty!!!

#StackBounty: #18.04 #input-method #japanese Anthy (uim) doesn't convert anything?

Bounty: 50

Anthy, the Japanese input method, doesn’t convert anything. That is, I can’t type any katakana or kanji. I’m using uim, and I set “begin conversion” hotkey as Space Bar.

I tried converting “はんどる” to katakana by pressing Space, and it didn’t work.
I tried converting “いちにち” to kanji by pressing Space, and it also didn’t work.

Why?


Get this bounty!!!

#StackBounty: #database-design #mongodb Single collection with a key vs multiple collections

Bounty: 50

I am designing the DB for a project, where, I am sure that I would not be querying for data belonging to multiple values of a key x at the same time. All queries will be for sure for a given value of x. Is it better to create a single collection having an index for x, or is it better to create multiple collections having x as part of the collection name?

I want to optimize storage space, and well as ensure reasonable read query performance.


Get this bounty!!!

#StackBounty: #javascript #scroll #mousewheel #gestures #trackpad Prevent page navigation on horizontal scroll

Bounty: 50

I am using a mac trackpad.How to prevent the page going back and next to visited pages on horizontal scroll ?.

I tried to prevent the wheel events but it doesn’t works most of the time.

container.addEventListener('wheel', function(ev) {
    ev.preventDefault();
    ev.stopPropagation();
    return false;
}, {passive: false, capture: true});

even I tried blocking with mousewheel event which also leads to page navigation.


Get this bounty!!!

#StackBounty: #sql #database-design #ddl How to model a limited history of a table

Bounty: 50

Context

I have 3 entities (user, shop and car), a car can only have one regNum, one shopId and one ownerId at a time, that’s why they are embedded in the car table.

create table "user"
(
  id   bigint primary key,
  name varchar(40) not null
);

create table "shop"
(
  id   bigint primary key,
  name varchar(40) not null
);

create table "car"
(
  id      bigint primary key,
  ownerId bigint,
  regNum  varchar(8),
  shopId  bigint,
  price   numeric(10,2),
  constraint foreign key(ownerId) references "user",
  constraint foreign key(shopId) references "shop"
);

Problem

I want to keep history of the car’s regNum, ownerId, shopId and eventually other future fields (but not necessarily all of them).
What’s the best solution (scalability/performance/easeOfUse) ? I have found the ones below, maybe someone has faced the same problem, maybe there is another solution ?

Solution 1

I add as much history tables as I have fields to “watch”.
This seems to be a normalized way to do the job but it also looks pretty complex to maintain, it’s also more greedy as if I modify all fields at once (regNum, shopId and ownerId), I need to insert 3 records (one for each history and so on if I watch other fields later).

create table "carOwner"
(
  id        bigint primary key,
  carId     bigint not null,
  changedAt timestamp not null,
  ownerId   bigint,
  constraint foreign key(carId) references "car",
  constraint foreign key(ownerId) references "user"
);

create table "carShop"
(
  id        bigint primary key,
  carId     bigint not null,
  changedAt timestamp not null,
  shopId    bigint,
  constraint foreign key(carId) references "car",
  constraint foreign key(shopId) references "shop"
);

create table "carRegNum"
(
  id        bigint primary key,
  carId     bigint not null,
  changedAt timestamp not null,
  regNum    varchar(8),
  constraint foreign key(carId) references "car"
);

Solution 2

I keep history in a single table, which is a light snapshot of the car table at a given time. It seems easier to maintain but it’s not precise as I cannot directly see what changed if I don’t have previous record.

create table "carHistory"
(
  id        bigint primary key,
  carId     bigint not null,
  changedAt timestamp not null,
  ownerId   bigint,
  regNum    varchar(8),
  shopId    bigint,
  constraint foreign key(carId) references "car",
  constraint foreign key(shopId) references "shop",
  constraint foreign key(ownerId) references "user"
);


Get this bounty!!!

#StackBounty: #memory #qemu #defragmentation #huge-pages Help understanding main memory fragmentation and hugepages

Bounty: 50

I have a machine that is intended for general use and which I also use to run a QEMU virtual machine. Because the virtual machine should be as performant as possible, I want to back the VM memory with hugepages, ideally 1GB hugepages. The machine has 32GB of ram and I want to provide 16 to the VM. The problem is that during my normal use of the machine, I might need to use all 32GB, so allocating the 16G of hugepages at boot is not an option.

To work around this I have a hook script that allocates the 16G of hugepages when the VM boots. As you might expect, for 1GB hugepages, this fails if the host machine has been used for any amount of time (it seems to work reliably with 2M hugepages though this is not ideal).

What I don’t understand is exactly why this is happening. For example, I can open several applications (browser window, code editor, etc just to force some fragmentation for testing), then close them so that only my desktop is open. My memory usages in this case is around 2.5G/32G.

Is there really no way that the kernel can find 16 contiguous aligned 1G pages out of the remaining 30G of RAM, that seems like very high fragmentation. Furthermore, I can run

$ sudo tee /proc/sys/vm/compact_memory <<<1

to try to defrag the RAM, but even then, I have never successfully allocated 16 1G hugepages for the VM. This in particular is really shocking to me, since after defragging only 2.5G of RAM the remaining 30G still isnt contiguous or aligned.

Can anyone help me understand what I’m misunderstanding about this process? Does this seem like expected behavior? Additionally is there any way to check if compact_memory actually did anything? I don’t see any output in dmesg or similar after running that command.

Please let me know if I can provide any additional details.


Get this bounty!!!