What is google docs solution to handling multiple users editing and reading at the same time?

I have always been curious as to how google solved the solution of real time collaboration in their google docs product where they allow multiple users to edit and read the same document in real time.

I believe this is very similar to the well known readers and writers problem.

In some of the solutions that i have seen, we would need a mutex of some kind whereby the writers will have exclusive lock to the document itself and readers will not be able to read the document at all.

But in the google docs case, it is quite interesting whereby another user can read the document in real time and two users can both edit the same document at the same time without any conflicts which is very impressive to me.

Is it possible for a Turing machine to halt without reading the complete input string?

Is it possible for a Turing machine to halt without reading the complete input string. Suppose there is a string “adc” preceded and succeeded by infinite number of blanks. Can a Turing machine halt after reading just “a” and never touching “dc” or any of the blanks. If yes, will this string be accepted or rejected?

Apparmor enforce mode prevents Firefox from reading U2F security key

When the default apparmor profile for Firefox is set to enforce mode, it blocks Firefox access to security keys. Disabling the profile restores access.

Rules that I’ve tried and failed:

  • /sys/devices/** r,
  • #include <abstractions/dbus>
  • dbus send bus=system path=/org/freedesktop/RealtimeKit1 interface=org.freedesktop.DBus.Properties member=Get peer=(name=org.freedesktop.RealtimeKit1)

Can someone help me craft rules to allow Firefox access security keys?

kern.log:

Sep 17 19:07:01 user-pc kernel: [21606.295620] usb 7-2: new full-speed USB device number 4 using uhci_hcd Sep 17 19:07:01 user-pc kernel: [21606.487632] usb 7-2: New USB device found, idVendor=1050, idProduct=0120, bcdDevice= 4.33 Sep 17 19:07:01 user-pc kernel: [21606.487636] usb 7-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0 Sep 17 19:07:01 user-pc kernel: [21606.487638] usb 7-2: Product: Security Key by Yubico Sep 17 19:07:01 user-pc kernel: [21606.487639] usb 7-2: Manufacturer: Yubico Sep 17 19:07:01 user-pc kernel: [21606.495139] hid-generic 0003:1050:0120.0005: hiddev0,hidraw2: USB HID v1.10 Device [Yubico Security Key by Yubico] on usb-0000:00:1d.1-2/input0 Sep 17 19:07:34 user-pc kernel: [21639.275573] audit: type=1400 audit(1568714854.720:331): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/firefox/firefox{,*[^s][^h]}" pid=21659 comm="apparmor_parser" Sep 17 19:07:34 user-pc kernel: [21639.275577] audit: type=1400 audit(1568714854.724:332): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/firefox/firefox{,*[^s][^h]}//lsb_release" pid=21659 comm="apparmor_parser" Sep 17 19:07:34 user-pc kernel: [21639.275580] audit: type=1400 audit(1568714854.724:333): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/firefox/firefox{,*[^s][^h]}//sanitized_helper" pid=21659 comm="apparmor_parser" Sep 17 19:07:41 user-pc kernel: [21645.812202] audit: type=1107 audit(1568714861.260:334): pid=1061 uid=103 auid=4294967295 ses=4294967295 msg='apparmor="DENIED" operation="dbus_method_call"  bus="system" path="/org/freedesktop/RealtimeKit1" interface="org.freedesktop.DBus.Properties" member="Get" mask="send" name="org.freedesktop.RealtimeKit1" pid=21662 label="/usr/lib/firefox/firefox{,*[^s][^h]}" peer_pid=1858 peer_label="unconfined" Sep 17 19:07:41 user-pc kernel: [21645.812202]  exe="/usr/bin/dbus-daemon" sauid=103 hostname=? addr=? terminal=?' Sep 17 19:07:42 user-pc kernel: [21646.966062] audit: type=1107 audit(1568714862.416:335): pid=1061 uid=103 auid=4294967295 ses=4294967295 msg='apparmor="DENIED" operation="dbus_method_call"  bus="system" path="/org/freedesktop/RealtimeKit1" interface="org.freedesktop.DBus.Properties" member="Get" mask="send" name="org.freedesktop.RealtimeKit1" pid=21703 label="/usr/lib/firefox/firefox{,*[^s][^h]}" peer_pid=1858 peer_label="unconfined" Sep 17 19:07:42 user-pc kernel: [21646.966062]  exe="/usr/bin/dbus-daemon" sauid=103 hostname=? addr=? terminal=?' 

Site Refused to connect while PDF document reading in Embed Tag an other website

I am using SharePoint 2013 and I am facing the issue to display the PDF Document in embed tag.

Error Showing:

  1. SharePoint Site Refused Connect in Embed.

  2. Refused to display ‘http://SITE/HR/EmployeeDoc/Passport.pdf’ in a frame because it set multiple ‘X-Frame-Options’ headers with conflicting values (‘SAMEORIGIN, Allow-From’). Falling back to ‘deny’. IN Console Log.

Note :

it was continuously working from last 3 year perfectly and i am getting this Error only from 3 Days.

I did not change anything from last 5 months inside the process, inside the SharePoint Master Page OR any permission.

Only PDF Document not displaying, Images showing perfectly. and if i am accessing the PDF URL Direct in address bar than there is no issue at all.

can any buddy suggest me why it’s refusing and please provide the solution.

Kindly Please help me to solve this issue.

Thank You.

Reading the first line

Below is a .txt file that I am reading in and need to use for information. I want my function to read in the top number as an integer(how many numbers are in the following row) so that I can use a for loop later on. The problem lies in how that top number is defined. Trying to put in listSize = file.txt[0] yields a seemingly random number, running my for loop an undesired amount of times. Here is the file:

Line 1: 4 Line 2: 5 8 9 2

How would I write a code in C++ that reads in just that first line so that I could assign that number to a variable, say “listSize”, to ultimately use for a for loop?

SharePoint JS Button Ribbon is not reading functions

I am trying to add a new button to the ribbon in my list. The button shows fine but no action is taken, the main idea is this button will update status column that have In Progress Status to Finished and whenever i select a line in a list that contain the status Complete the button will not be clickable anymore.

The problem is the button is not clickable so i think there is a mistake in the code, and maybe the issue from CountDictionary.

Code Pastebin

Console Error:

    Refused to display 'https://MYURL' in a frame because it set 'X-Frame-Options' to 'deny'. core.js:1 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/. GetTenantAppData @ core.js:1 InsertFeatureMenuItems @ core.js:1 BuildMenu @ core.js:1 BuildMenuWithInit @ core.js:1 $  21_0 @ sp.core.js:2 $  1a_0 @ sp.core.js:2 $  1c_0 @ sp.core.js:2 canHandleECBCommand @ sp.core.js:2 canHandleCommand @ sp.ribbon.js:2 canHandleCommand @ sp.ribbon.js:2 callCommandHandlerForEnabled @ cui.js:1 canHandleCommand @ cui.js:1 callCommandHandlerForEnabled @ cui.js:1 isCommandEnabled @ cui.js:1 isRootCommandEnabled @ cui.js:1 $  3x_1 @ cui.js:1 pollForStateAndUpdateInternal @ cui.js:1 $  AK_0 @ cui.js:1 $  4i_0 @ cui.js:1 $  4i_0 @ cui.js:1 $  4i_0 @ cui.js:1 $  4i_0 @ cui.js:1 $  4i_0 @ cui.js:1 $  4i_0 @ cui.js:1 $  4i_0 @ cui.js:1 $  4i_0 @ cui.js:1 pollForStateAndUpdate @ cui.js:1 $  8L_0 @ cui.js:1 $  Cu_1 @ cui.js:1 (anonymous) @ ScriptResource.axd?d=TA1MgOAPt2S0wFM8dFG-wuWKHg2XaPc6-84eJp7FP_67rlJqh_Fy_X-jkn5ziwJMbCkOJ41oX9o_cKAJX0xzg0HbwlWBEFNuArPY86NsLzD6R_SKXL-QjG-le6rEuZZHL1xOiP3frbFnmLL3MqFYYdqlsNUyoNBczQFixGIl_YkLIm7HCn1_2zKXUNLUgAZm0&t=ffffffffa580202a:5 onDataReturned @ cui.js:1 (anonymous) @ ScriptResource.axd?d=TA1MgOAPt2S0wFM8dFG-wuWKHg2XaPc6-84eJp7FP_67rlJqh_Fy_X-jkn5ziwJMbCkOJ41oX9o_cKAJX0xzg0HbwlWBEFNuArPY86NsLzD6R_SKXL-QjG-le6rEuZZHL1xOiP3frbFnmLL3MqFYYdqlsNUyoNBczQFixGIl_YkLIm7HCn1_2zKXUNLUgAZm0&t=ffffffffa580202a:5 (anonymous) @ ScriptResource.axd?d=TA1MgOAPt2S0wFM8dFG-wuWKHg2XaPc6-84eJp7FP_67rlJqh_Fy_X-jkn5ziwJMbCkOJ41oX9o_cKAJX0xzg0HbwlWBEFNuArPY86NsLzD6R_SKXL-QjG-le6rEuZZHL1xOiP3frbFnmLL3MqFYYdqlsNUyoNBczQFixGIl_YkLIm7HCn1_2zKXUNLUgAZm0&t=ffffffffa580202a:5 completed @ ScriptResource.axd?d=TA1MgOAPt2S0wFM8dFG-wuWKHg2XaPc6-84eJp7FP_67rlJqh_Fy_X-jkn5ziwJMbCkOJ41oX9o_cKAJX0xzg0HbwlWBEFNuArPY86NsLzD6R_SKXL-QjG-le6rEuZZHL1xOiP3frbFnmLL3MqFYYdqlsNUyoNBczQFixGIl_YkLIm7HCn1_2zKXUNLUgAZm0&t=ffffffffa580202a:5 _onReadyStateChange @ ScriptResource.axd?d=TA1MgOAPt2S0wFM8dFG-wuWKHg2XaPc6-84eJp7FP_67rlJqh_Fy_X-jkn5ziwJMbCkOJ41oX9o_cKAJX0xzg0HbwlWBEFNuArPY86NsLzD6R_SKXL-QjG-le6rEuZZHL1xOiP3frbFnmLL3MqFYYdqlsNUyoNBczQFixGIl_YkLIm7HCn1_2zKXUNLUgAZm0&t=ffffffffa580202a:5 XMLHttpRequest.send (async) executeRequest @ ScriptResource.axd?d=TA1MgOAPt2S0wFM8dFG-wuWKHg2XaPc6-84eJp7FP_67rlJqh_Fy_X-jkn5ziwJMbCkOJ41oX9o_cKAJX0xzg0HbwlWBEFNuArPY86NsLzD6R_SKXL-QjG-le6rEuZZHL1xOiP3frbFnmLL3MqFYYdqlsNUyoNBczQFixGIl_YkLIm7HCn1_2zKXUNLUgAZm0&t=ffffffffa580202a:5 executeRequest @ ScriptResource.axd?d=TA1MgOAPt2S0wFM8dFG-wuWKHg2XaPc6-84eJp7FP_67rlJqh_Fy_X-jkn5ziwJMbCkOJ41oX9o_cKAJX0xzg0HbwlWBEFNuArPY86NsLzD6R_SKXL-QjG-le6rEuZZHL1xOiP3frbFnmLL3MqFYYdqlsNUyoNBczQFixGIl_YkLIm7HCn1_2zKXUNLUgAZm0&t=ffffffffa580202a:5 invoke @ ScriptResource.axd?d=TA1MgOAPt2S0wFM8dFG-wuWKHg2XaPc6-84eJp7FP_67rlJqh_Fy_X-jkn5ziwJMbCkOJ41oX9o_cKAJX0xzg0HbwlWBEFNuArPY86NsLzD6R_SKXL-QjG-le6rEuZZHL1xOiP3frbFnmLL3MqFYYdqlsNUyoNBczQFixGIl_YkLIm7HCn1_2zKXUNLUgAZm0&t=ffffffffa580202a:5 runQuery @ cui.js:1 $  Bc_1 @ cui.js:1 (anonymous) @ ScriptResource.axd?d=TA1MgOAPt2S0wFM8dFG-wuWKHg2XaPc6-84eJp7FP_67rlJqh_Fy_X-jkn5ziwJMbCkOJ41oX9o_cKAJX0xzg0HbwlWBEFNuArPY86NsLzD6R_SKXL-QjG-le6rEuZZHL1xOiP3frbFnmLL3MqFYYdqlsNUyoNBczQFixGIl_YkLIm7HCn1_2zKXUNLUgAZm0&t=ffffffffa580202a:5 doDelayedInit @ cui.js:1 set_selected @ cui.js:1 $  Ae_2 @ cui.js:1 $  AI_2 @ cui.js:1 (anonymous) @ ScriptResource.axd?d=TA1MgOAPt2S0wFM8dFG-wuWKHg2XaPc6-84eJp7FP_67rlJqh_Fy_X-jkn5ziwJMbCkOJ41oX9o_cKAJX0xzg0HbwlWBEFNuArPY86NsLzD6R_SKXL-QjG-le6rEuZZHL1xOiP3frbFnmLL3MqFYYdqlsNUyoNBczQFixGIl_YkLIm7HCn1_2zKXUNLUgAZm0&t=ffffffffa580202a:5 b @ ScriptResource.axd?d=TA1MgOAPt2S0wFM8dFG-wuWKHg2XaPc6-84eJp7FP_67rlJqh_Fy_X-jkn5ziwJMbCkOJ41oX9o_cKAJX0xzg0HbwlWBEFNuArPY86NsLzD6R_SKXL-QjG-le6rEuZZHL1xOiP3frbFnmLL3MqFYYdqlsNUyoNBczQFixGIl_YkLIm7HCn1_2zKXUNLUgAZm0&t=ffffffffa580202a:5 Show 5 more frames VM1354:1 Uncaught ReferenceError: EnableFinishedButton is not defined     at eval (eval at $  39_1 (sp.ribbon.js:2), <anonymous>:1:12)     at SP.Ribbon.CommandUIExtensionPageComponent.$  39_1 (sp.ribbon.js:2)     at SP.Ribbon.CommandUIExtensionPageComponent.canHandleCommand (sp.ribbon.js:2)     at CUI.Page.CommandDispatcher.callCommandHandlerForEnabled (cui.js:1)     at CUI.Page.CommandDispatcher.isCommandEnabled (cui.js:1)     at SP.Ribbon.PageManager.isRootCommandEnabled (cui.js:1)     at CUI.Ribbon.$  3x_1 (cui.js:1)     at CUI.Controls.Button.pollForStateAndUpdateInternal (cui.js:1)     at CUI.Controls.Button.$  AK_0 (cui.js:1)     at CUI.ControlComponent.$  4i_0 (cui.js:1) 

Any idea how could i fix it ?

Thank you !

Redirection cannot open for reading

I ran the following command and I am not able to understand why I am getting this error :

tail /var/log/fontconfig.log 1 >> /home/myuser/b.log tail: cannot open '1' for reading: No such file or directory 

File fontconfig.log exists and directory myuser exists too. However , this command works :

tail /var/log/fontconfig.log >> /home/myuser/b.log 

Here , I have removed 1. Can any body explain why I am getting this error ? Also, If we don’t mention any standard file descriptors like I did not mentioned 1 what does it take then ?

[ Psychology ] Open Question : I’m aroused by watching videos, images, reading and writing about unconscious women, having seizures or other medical problems. Is it wrong?

I’m a woman, I’m 20 and I’m bisexual. Ever since I was around 12, I’ve been aroused by videos of women being knocked unconcious, CPR, seizures and other medical issues. I’ve even started writing about celebrities that I have crushes on going through these problems. Recently, when I read about actress Emilia Clarke having an aneurysm, I wrote about my favorite actress, Gal Gadot having an aneurysm in the middle of a premiere. I also go on deviant art and search for images of unconscious and passed out women. I don’t ever want to hurt anyone or do anything without their consent, I just enjoy this on videos and literature. Is this weird?

Ubuntu does not start after the upgrade / error: failure reading sector 0x0 from `cd0′

A couple of days ago, I launched on my Ubuntu 16.04 LTS laptop

username@username~$  > sudo apt upgrade 

, then minimized the terminal and after a while turned off the laptop, forgetting to check whether the terminal completed the command. The next time I turned on the laptop, as always grub met me, I typed

grub> exit 

as always and chose the fourth option in Boot Manager (as always) (UEFI Onboard LAN IPv4 (50-9A-4C-B3-C9-0B)).
I expected that, as always, the Unity shell would meet me, I would enter my password and start working. But this did not happen, I got 3 errors, after which grub instantly appeared. I did not even have time to read what kind of errors. I recorded these errors on the camcorder and looked at the pause what errors they were and read them:

error: failure reading sector 0x0 from `cd0' error: failure reading sector 0x0 from `cd0' error: no such device: b3e461d6rced4-45a8-afe4-2094d34ae956 

That is the problem, I cannot start the system.

What I tried to do to solve the problem: I don’t understand this, but I saw a tip on the site to make a bootable USB flash drive: I made it with Ubuntu 16.04.6 (Downloaded from the official Ubuntu site). I started the laptop with it, chose Try Ubuntu without installing, but at the end a black screen was highlighted and nothing happened (I left the laptop for 30 minutes, but nothing changed).
After that, I turned off the laptop and selected Check disk for defects. The result showed Check finished: errors found in 7 files!.

The other options in Boot Manager is:
HDD1-ubuntu (TOSHIBA MQ01ABD100)
HDD2-ubuntu (TOSHIBA MQ01ABD100)
UEFI Onboard LAN IPv6 (50-9A-4C-B3-c(-0B)

First one returning me the same errors as fourth (which I tell about the beginning of this text)
Second one returning me the menu with 4 options:
Ubuntu
Advanced options for Ubuntu
System setup
Restore Ubuntu 16.04 to factory state

If I choose ‘Ubuntu’, then I have a blinking capslock indicator and about of 20 lines of text, in which the last one is

[   0.721315] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on onknown-block(0,0) 

and after this nothing happened.
Third one returning me the same errors as fourth (which I tell about the beginning of this text).