Design of a synchronized clock

I was living in a country where Internet wasn’t that fast so the younger me had the following idea for compressing data

Let say 2 parties want to send data to each other, we know that data can be represented by a number literally any data no matter the size can be just a giant number.

So let say the 2 parties have this perfect synchronized clock and a very fast one, I mean a clock that can count billions of billions ( equivalent of gbits of data ) in a short amount of time.

So for party 1 to send data to party 2 it only need to send 2 messages : start counting and stop counting.

So any data can be sent using only 2 bits lol.

How hard is it to design that clock ?

To how many odd keystones can one Spiritomb be synchronized?

Spiritombs have the "Keystone Warp" capability, which says the following:

Spiritomb carries around with it an Odd Keystone. Trainers may collect additional Odd Keystones as they travel. They may then synchronize them with a Spiritomb for the cost of 2 Tutor Points. A Spiritomb may then freely teleport between any Odd Keystones within 10 meters as a Standard Action.

Do these 2 tutor points need to be paid for each individual Odd Keystone? Or is this a total price that allows a trainer to synchronize any amount of Odd Keystones that they have managed to gather with their Spiritomb?

ClientIP in SharePoint unified audit log is strange for entries where OneNote is being synchronized

We are analyzing the unified audit logs from SharePoint and some records have a ClientIP that when resolved, point to a location where the user could not have possibly been. For example, our company is based in Africa, but the IP address of some users show as being in Ireland or India.

This seems to be the case when user agents are “onenotemodernsynccontentsync”.

So why is the IP address being recorded as Microsoft Corporation in a foreign country instead of the actual user’s ISP IP address like all other records?

Can i create a synchronized folder that is a physical separate entity on Windows?

I want to create a folder in my machine that is different from the net remote shared folder and I want it’s content to be automatically synchronized with the net folder.

First I thought it would be cool If the folder could read for content that it is on the remote net folder that it is not yet in my folder and copy that content into my folder. But I don’t want content that is in my folder and it’s not in the remote folder to be deleted from my folder.

To be honest I don’t know if it is possible. I never came to an ideal like this so I never did or tried something like that but I can’t recall seeing something like that in Windows.

I’m using Windows 7 but I think it would be better if theres was a way that it is compatible with more modern OS like Windows 8.1 and especially Windows 10

Finding the shortest path for synchronized pawns in a maze

I’ve been trying to wrap my head around this problem, and I just cant get it.

  • We have an a × b matrix where every cell corresponds to either an empty space, denoted with a dot, or a wall, denoted with X
  • There are two pawns in different locations within the maze, their movements are synchronized and they must leave the maze (it has multiple exits) in the same move
  • If one moves and the other is up against a wall, its a valid move and the other one stays in place
  • The goal is to write an algorithm that finds the lowest possible moves to get both out of the maze at the same time, of O(ab)^2) time complexity

I got some advice to use BFS for this problem, but I don’t get how it would deal with all of the backtracking that has to be done. I’ve included two visualizations with the correct paths labeled to help explain the problem.

  • EXAMPLE 1 – Pawn starting positions shown as blue squares

Example 1

  • EXAMPLE 2 – Pawn starting position shown as blue square and red square

Example 2

What If I Need Conditional/Overriding (synchronized) .yml Config Install With a Custom Module?

With D8, the appropriate method for adding fields during install with a custom module is with the config system and .yml files in a config/install directory.

I have a module for user theming I like to use for new D8 site installs, it adds hooks, templates, fields.

With a minimal install, this module provides the field and storage config for the user.user.user_picture field, as well as the entity_form_display and entity_view_display for compact and token view modes for the user.

I also include some custom fields such as first_name and last_name.

Obviously, with a standard install, this module will get the errors that the user.user.user_picture config already exists among others.

I would really prefer that the config overwrites the display config for the view modes, but would take them just being ignored on install if it already exists.

Is there a method following the Drupal config system to get conditional, or overriding, (synchronized) config during install? Or do I need to use the features module?

Is there a definitive approach for this?

iTunes does not play non-Apple Music songs which were synchronized with iCloud Music Library on Windows

I’m facing the following scenario: I live in a country where a certain album from a band I like isn’t available on most (if not all) streaming services. I own a physical copy of the album, and I have imported it to my computer and storage clouds.

When evaluating Apple Music, I noticed that on the Mac I’m able to upload songs to the cloud (iCloud Music Library). I thought “this is it, Apple Music is going to be great!”.

However, on my Windows PC, while I’m able to download the songs, I’m not able to play them using iTunes specifically. Every other music player works just fine for the same file iTunes should have no issues reproducing. The songs show up on the library, together with all other musics and playlists I have access, but then when I click the play button over the song, iTunes just get stuck on 0:00. If I try to play another song, then it will play it just fine, as long as it is not a song downloaded from iCloud Music Library.

So why iCloud Music Library exists, if the player doesn’t allow me to play it? Or is this a bug? I noticed that the first song of the album is playing just fine, but all the other songs are not.

I’ve checked the iTunes folder permissions for the current user, and I have full access to it.

Object’s retain count in influenced by ‘@synchronized’

I found that the retain count of an object created inside the @synchronized block will be difference with an object created outside the @synchronized block.

Case 1: create inside the @synchronized block, the retain count of observer is 2:

- (NSUInteger)mv_observeKeyPath:(NSString *)keyPath                   withBlock:(MVKVOBlock)block                     options:(NSKeyValueObservingOptions)options {     @synchronized (lock) {         MVKVOProxy *observer = [MVKVOProxy observerWithTarget:self keyPath:keyPath block:block];         // po [observer performSelector:@selector(retainCount)] is 2         [self addObserver:observer forKeyPath:keyPath options:options context:NULL];         return observer.observerID;     } } 

Case 2: create outside the @synchronized block, the retain count of observer is 1:

- (NSUInteger)mv_observeKeyPath:(NSString *)keyPath                   withBlock:(MVKVOBlock)block                     options:(NSKeyValueObservingOptions)options {     MVKVOProxy *observer = [MVKVOProxy observerWithTarget:self keyPath:keyPath block:block];     @synchronized (lock) {         // po [observer performSelector:@selector(retainCount)] is 1         [self addObserver:observer forKeyPath:keyPath options:options context:NULL];         return observer.observerID;     } } 

I know an object return by a method will be wrapped with objc_retainAutoreleasedReturnValue and objc_retainAutoreleasedReturnValue. It is used for optimization with useless [[obj autorelase] retain].

The method defination of objc_retainAutoreleasedReturnValue is:

id objc_retainAutoreleasedReturnValue(id obj) {     if (acceptOptimizedReturn() == ReturnAtPlus1) return obj;      return objc_retain(obj); } 

I have debugged and stepped into assembly code and found that, in case 2 objc_retain will not be called.

The method objc_retainAutoreleasedReturnValue of is:

id objc_retainAutoreleasedReturnValue(id obj) {     if (acceptOptimizedReturn() == ReturnAtPlus1) return obj;      return objc_retain(obj); } 

In both cases, objc_retain will be called.

Therefore, in case 1, the method call stack is [[observer autorelaase] retain], in case 2, the method call stack is [observer autorelaase]. Is it strange? Why does @synchronized has effect against ARC?

How to play two videos side by side synchronized in VLC

I need to play two videos side by side synchronized in VLC. I found answer below but it just opens one window and when I right-click in the video and go video/audio I can switch between the video/audio which run both at the same time but it is still in one window so I see/hear only one at the time. Any idea what extra setting can cause this? Using VLC 3.0.4. on win7.

How to play multiple videos side-by-side synchronized?

P.S. I would comment on existing question but I do not have enough reputation for that.