Transfer Locking & Protection from Excel to Google Sheets

A few questions:

  1. Is there a way to transfer the sheet locking and protection (and the cell locking) to Sheets?
  2. Is it possible to lock cells in Sheets, as in Excel? And I am specifically referring to the locking function. In other words, to prevent users even being able to click on protected cells and viewing the formulae.
  3. Is there a way to see how a prohibited user will see and use the Sheets file, once locked?

Thnx in Advance.

What script unlocks this locking script?

I don’t understand how the OP_PUSH works – where does it push from and does it push it onto the top of the stack? I thought script operations read from the top of the stack so I’d read the top item and push it back onto the stack which does nothing?

As I understand it, the script is separate from the stack. The script is read left to right and it’s instructions operate on the stack.

So you start with your program pointer at far left of script and with an empty stack.

Then script instructions 0100 (OP_PUSH1 0x00) would push the value 0x00 from the script onto the top of the stack. The stack would then contain 0x00 and the program pointer would point to the right of the 0x00 in the script.

As Buruk pointed out, your script is incorrect and wouldn’t function as you intend.

I believe you need a locking script


which is


with an unlocking script of


which is

OP-PUSH1 0x08

or implicitly

 0108 ...  01030105939C

 OP-PUSH1 0x08   ...  OP_PUSH1 0x03 OP_PUSH1 0x05 OP_ADD OP_NUMEQUAL

which we can work through step by step thus:

script interpretation of highlighted opcode stack after opcode executed
010801030105939D OP_PUSH1 0x08 08
010801030105939D OP_PUSH1 0x03 03 08
010801030105939D OP_PUSH1 0x05 05 03 08
010801030105939D OP_ADD 08 08
010801030105939C OP_NUMEQUAL TRUE


  • script is like machine-code
  • interpretation is like assembly language
  • top of stack is to left

applications – Screensaver without locking screen

I am looking for a solution that runs screensaver or turns off the screen when idle without locking the phone.

Most common scenario: Open messagaing app. Write with friend. Screensaver pops or screen turns off. Someone replies then application shows automatically.

I have note4 with android 6.0.1 and I can’t turn off auto screen lock in settings. I have fingerprint configured and I don’t want to change it. Also, Stay awake developer option is not a solution because screen just dims and its dangerous for amoled.

Is it possible to configure screen to work like that?
Is there any application for that?

notebooks – Locking cell groups

Imagine I have a notebook divided into multiple groups of code cells which are set as initialization groups. I then have a single cell which evaluates a function program() that yields an interactive tool (for example via Manipulate) which internal functions are defined in the initialization groups. Something like

enter image description here

If these groups are collapsed, is it possible to lock them so that when I share the notebook the code in these groups remains hidden and private and the only accessible cell is the one to run the program?

sql server – Why are my Select queries locking under RCSI

I have a SQL Server 2019 database running in compatibility mode 100. We have Read Committed Snapshot Isolation turned on, which I’ve verified as being on. I have a particular SELECT query that is not running under RCSI and am at a loss as to why. I’ve checked individual transaction setting and we dont really change from the default (RCSI). I know NOLOCK can throw a query out of RCSI as well and we have none in our codebase. What else can I look for that would be causing this?
The tables this query is using pretty central to our processing, and the lock waits are all IU locks.

when testing the query, it runs in milliseconds, something is definitely keeping it from starting.

screen – What is surface locking and unlocking in Pygame?

Surface locking allows you to directly access the pixel data of accelerated surfaces. It’s not so much about improving performance. Rather, an accelerated surface already has performance improvements, but it comes with a trade off of requiring locking & unlocking if you’re going to directly change its data.

All of the built in Pygame functions will automatically lock and unlock the Surface data as needed. So for basic blitting, you don’t need to worry about it.

When might you need it? Let’s say you had some code that required multiple get_at() &/or set_at() calls. Each such call requires locking & unlocking the surface & according to the docs:

Getting and setting pixels one at a time is generally too slow to be used in a game or realtime situation.

In that situation, it would likely be more performant to lock the surface once, perform any required reads & writes to the pixel data and then unlock it.

Here’s what the the docs say about locking:

On accelerated Surfaces, the pixel data may be stored in volatile video memory or nonlinear compressed forms. When a Surface is locked the pixel memory becomes available to access by regular software. Code that reads or writes pixel values will need the Surface to be locked.

Surfaces should not remain locked for more than necessary. A locked Surface can often not be displayed or managed by pygame.

Not all Surfaces require locking. The mustlock() method can determine if it is actually required. There is no performance penalty for locking and unlocking a Surface that does not need it.

All pygame functions will automatically lock and unlock the Surface data as needed. If a section of code is going to make calls that will repeatedly lock and unlock the Surface many times, it can be helpful to wrap the block inside a lock and unlock pair.

It is safe to nest locking and unlocking calls. The surface will only be unlocked after the final lock is released.

What is screen locking and unlocking in Pygame?

I’ve read a little about screen locking and unlocking in pygame in Beginning Game Development with Python and Pygame. However, I still don’t understand it.

I’ve read that it can improve the game performance, so I’m wondering about its other advantages.

So overall, what are the main uses of screen locking and unlocking ?

How does it improve performance ?

Is it necessary to lock and unlock the screen everytime I blit an image into it ?


Here is a part of the passage that I read in that book :

Whenever Pygame draws onto a surface, it first has to be locked. When a surface is locked, Pygame has full control over the surface and no other process on the computer can use it until it is unlocked. Locking and unlocking happens automatically whenever you draw onto a surface, but it can become inefficient if Pygame has too many locks and unlocks.


I’m mostly wondering about manual screen locks and unlocks and not just about automatic ones and btw to lock and unlock a surface manually, all is needed is:

# applying some changes to that surface

unity – How to set transform.up without locking the y-axis?

I’m trying to make an object’s transform.up to a normal of the raycastHit point. I tried using this line of code:

transform.up = Vector3.Lerp(transform.up, normal, 1 * Time.deltaTime);

This works well but locks the y-axis rotation as a result the object can’t rotate and just keeps going forward. I tried using Quaternion.LookRotation. But I couldn’t make it affect the object’s rotation. Here is what I tried:

bodyRotation = Quaternion.LookRotation(transform.forward, normal);
transform.rotation = Quaternion.Slerp(transform.rotation, bodyRotation, 100 * Time.deltaTime);

How can I set the transform.up without locking the y-axis?

java – Locking a DB table and waiting for writing/reading it from a web application

I’m working on a web application using Spring (Java and JPA + Hibernate) and I was wondering if there is a way of locking a MYSQL table and then when another web service (or even another thread from the same application) tries to read or write the locked table it waits for it to be unlocked.

For example, imagine a use case (transaction) that needs to read a value and then increment it. There is a concurrency problem, because 2 or more threads at the same time are trying to read+write the same table.

Do I have to program it manually? Is that possible with java or using any of his libraries?