external scripts – How do I log in a user?

I want to log in Drupal 8 users from an external PHP file. I am trying the following code.

use DrupalCoreDrupalKernel;
use SymfonyComponentHttpFoundationRequest;
use DrupaluserUserInterface;
//$autoloader = include('/vendor/autoload.php');
$autoloader = require_once __DIR__ . '/vendor/autoload.php'; 
$kernel = new DrupalKernel('prod', $autoloader);

$request = Request::createFromGlobals();
$response = $kernel->handle($request);

// ID of the user.
$uid = 100; 
$user = DrupaluserEntityUser::load($uid);

// This is required to call user_login_finalize here.


$kernel->terminate($request, $response);

When I run it, I get the following error.

TypeError: Argument 1 passed to user_login_finalize() must implement interface DrupaluserUserInterface, null given, called in /var/www/html/stocksee/public_html/component/login.php on line 22 in user_login_finalize() (line 554 of core/modules/user/user.module).

Please help me.

unity – Strategy for temporarily blocking user input

As DMGregory noted, a Canvas Group is an easy way to control interactivity for a group of UI controls. Just assign the Canvas Group to the parent containing your UI controls, and update the interactable property:

canvasGroup.interactable = false;

As for user interaction with non-UI GameObjects, there are several approaches depending on how you process input:

  • Update() does not run if the MonoBehaviour is disabled. For example:
public class ClickableGameObject : MonoBehaviour {
    void Update() {
        if (Input.GetMouseButtonDown(0)) {
            //handle click here

clickableGO.enabled = false; //disables the Update() function
  • For other functions like OnMouseDown() or OnPointerClick(), you’ll need a flag you can check to see if the input should be disabled. There are several ways to do this. Here are a few examples:
//This solution is clean but may require you to call `Interactable = true;` or `Interactable = false;` 
//on many objects depending on your game structure.
public class ClickableGameObject : MonoBehaviour {
    (SerializeField) private bool interactable = true;
    public bool Interactable { get => interactable; set => interactable = value; }

    void OnMouseDown() {
        if (!interactable) return;
        //handle click here
//this solution uses a global static variable, which is generally bad practice,
//but can save a lot of effort in this case:
public static class UserInput {
    public static bool InputEnabled {get; set;} = true;

public class ClickableGameObject : MonoBehaviour {
    void OnMouseDown() {
        if (!UserInput.InputEnabled) return;
        //handle click here
//this solution is a compromise between the above two solutions
public class UserInputSettings {
    public bool InputEnabled {get; set;} = true;

public class ClickableGameObject : MonoBehaviour {
    public UserInputSettings InputSettings { get; set; }
    void OnMouseDown() {
        if (!InputSettings.InputEnabled) return;
        //handle click here

//create the settings instance before instantiating your GameObjects
UserInputSettings settings = new UserInputSettings();

//assign the settings to your GameObjects immediately after instantiating them
ClickableGameObject clickableGO1 = Instantiate(clickableGOPrefab);
clickableGO1.InputSettings = settings;
ClickableGameObject clickableGO2 = Instantiate(clickableGOPrefab);
clickableGO2.InputSettings = settings;

//affects all GameObjects we've assigned the settings to
settings.InputEnabled = false;

user accounts – With Sharepoint hosted Excel file I’m getting the error message “trouble signing in” when trying “Open in Desktop App”

I’m unable to Open any Excel files on my Desktop Excel App from Sharepoint “Open in App” or Excel online “Open in Desktop App”.

I’m able to log into my company’s Sharepoint, and Office365 with my business credentials using my company login, which for the sake of argument I’ll call Frank@mycompany.com. I have an old personal hotmail account that I use on my desktop, Frank****@hotmail.com. And I have Excel Professional 2010 Desktop installed.

When I try to open an excel file from Sharepoint on my desktop with “Open in App” or “Open in Desktop App”, I get the sign in error as pictured below. Where even though signed in as Frank@mycompany.com Excel is stating that User acccount Frank**@hotmail.com** does not exist in tenant ‘Mycompany’.

I’m using a newly installed Edge browser that doesn’t have me signed in on anything with my personal email, Frank**@hotmail.com**, so where is Excell getting Frank**@hotmail.com**, and why does it think I should be singing in with that, instead of opening it and singing in with my company credentials, Frank@mycompany.com?

Excel does explicately ask for a sign in, it just does this automatically. Also, I can download the Excel file from Sharepoint or Excel online and open it with my desktop Excel with no problems.

Anyways, I appreciate the help.

enter image description here

forms – How can I deal with diverse gender identities in user profiles?

I was having a discussion with my housemate who is a data analyst by trade, and the conclusion that we came to is that there are two sensible options here, depending on the amount of work you personally want to do (we’re assuming here that the collection of gender data is actually useful to you, rather than simply of interest in which case it is almost always better to leave it out).

The simple option is to have three or four discrete options: Female, Male, Other, and possibly Prefer not to say. In my experience, this is the most acceptable option for gathering data while being both simple and inclusive – it acknowledges that there are people who don’t fit the gender binary, allows users to select a different option, and doesn’t overload your cisgendered users with lots of options. It also allows people to completely opt out if they really don’t want to answer (the standard objection is that it’ll negatively impact your data collection, but in practice it probably doesn’t make much of a difference). Note that if gender identity is particularly important to your application, then this may not be the most sensible or inclusive option.

The ideal but more complex option is to have a textbox and suck it up – it’s a data sanitisation problem. A simple find/replace on your dataset will be able to lump your users into a group of man/male/boy responses, a group of woman/female/girl responses, and a group of assorted other responses. Crucially if you’re doing demographic analysis, whatever is left over probably isn’t statistically significant at an individual level so in your analysis it is acceptable to put them in an internal Other category. You can then preserve that minority data for further study should you find you need it.

Alternatively, as noted in the comments, it may be possible to combine the two approaches. Once a user selects your Other option, you could then display a text box which allows them to specify their gender identity exactly. This has the benefit of minimising cognitive load on cisgendered users while also capturing specific minority data. The downsides are that you may still run into issues sanitising this data to make it useful, and your form must be able to handle revealing a hidden element.

Gender is the correct label for this field, from a descriptive point of view and from a data collection point of view. You’d be surprised how many people think it’s hilarious to answer Sex: with “Yes please”.

If you choose to go with the simple dropdown/radio button approach, then Other is probably the most appropriate label for the third group. It is easily understandable, and non-exclusive in terms of what it might represent. Transgender is probably not an appropriate label here unless you include additional ones because it excludes people outside the binary who are not transgender or who do not view the label as appropriate for them, and it doesn’t actually tell you the respondent’s gender (transgender just tells you their gender is not the same as their assigned sex at birth). The problem with the use of the word “other” is that it is exclusionary and can potentially feel like the user is being shoved into a box of leftovers – not an ideal experience! For that reason, a text box is probably preferred if you want to make sure you’re being inclusive.

Think Outside The Box mirrors these recommendations and has some other interesting guidelines for form construction.

automation – Automate adding members to sharepoint site (user needs to be in owner group of 22 collections)

Im the sca for 20+ collections in sp2013 on-prem. I frequently have to add a new person as owner to all 20+ collections. I’d like to automate this process, or at least find a way to shave off some of the clicking around. I was thinking of experimenting with browser automation / python. All ideas welcomed. Thanks!

What’s the best way to migrate data from multiple user profiles on a Samsung tablet?

I have a Samsung galaxy tab s4 with several user profiles. I bought a new Samsung galaxy tab s6 lite that I would like to migrate to. However, when I used smart switch, it only transfers the admin account without the additional user profiles. Smart switch does not seem to support user profiles at all. Third party apps like CloneIT don’t seem to connect. Is the normal method in this case manually copying everything by hand? What is the best way to migrate multiple user profile data to a new Samsung tablet?

web crawlers – Error on public website when web scraping is called through my personal user agent

I’m brand new to coding and have finished making a simple program to web scrape some stock websites for particular data. The simplified code looks like this:

headers = {'User-Agent': 'Personal_User_Agent'}

fv = f"https://finviz.com/quote.ashx?t=JAGX"

r_fv = requests.get(fv, headers=headers)
soup_fv = BeautifulSoup(r_fv.text, 'html.parser')
fv_ticker_title = soup_fv.find('title')

The website would not work until I created a user agent, but then it worked fine. I then creating a website through python’s local host which also worked fine, and so I thought I was ready to make the website public via “python anywhere”.

However, when I went to create the public website, the program shuts down every time I go to access information through web scraping (i.e. using the user_agent). I didn’t like the idea of using my user agent for a public domain, but I couldn’t find out how other people who web scrape go about this problem when a user agent is required for a public domain. Any advice!?

user expectation – Primary/Secondary button placement pattern

This recently came up at my company too. Some HIPPO decided that primary buttons should be set flush right. Yet everywhere else on our site, primary buttons are flush left, with the secondary button adjacent to the right. At least that’s the pattern for right-to-left languages. For Arabic and Hebrew, it’s flipped.

All the sources I found agree that there should only be ONE primary button per page or modal, but they do not agree on the order. See:

Since there is no rule, I would go with consistency here. Follow the standard placement of buttons that’s already on your site; don’t surprise your visitors with a novel layout.

How to remove specific user from item level permission through Rest API using power automate

There is a REST endpoint to remove user permissions from list item.

Use this endpoint:


Replace <userID> with the actual user ID.

Microsoft documentation: Users, groups, and roles REST API reference

transactions – Keeping Track of User Deposits with Bitcoin

Can someone explain why it “is fairly easy” to do this in Bitcoin”?

I hope you already read what all things you need to do as a workaround in other chains that use accounts.

How to create a new address in bitcoin core:


Doesn’t Bitcoin also require UTXO Sweep when consolidating BTC from many addresses to one address?

UTXO consolidation is only preferred if you have lot of small inputs. Small here depends on amounts normally used while sending BTC from that wallet. If I have 1000 UTXOs in my wallet with each 0.01-0.02 BTC and I normally send 0.01-0.02 BTC in one transaction, I may not consolidate anything and spend them separately when required.

If at any point any business has lot of very small inputs, they can be consolidated when mempool is clear with 1-5 sat/vByte without affecting business assuming if you are running a business with so many transactions, must have other UTXOs to spend.


Consolidation after coinjoin also kills privacy and few other cases so it’s always up to an individual to decide how he wants to spend UTXOs. Coin control features in lot of bitcoin wallets provide users with the freedom to easily select UTXOs for a transaction.

I was under the impression that BTC does not allow multiple public addresses corresponding to a single private key?

There can be multiple addresses associated with the same private key: What is the relationship between a Bitcoin Private Key / Public Key / Address?

Not related to tracking deposit but still relevant to understand basic differences:

Batching is easier and cheaper in bitcoin: https://ethereum.stackexchange.com/questions/71261/how-to-transfer-ether-from-one-account-to-multiple-account/

Tx count and fees of UTXO chains can’t be compared with account based chains (Few websites exist trying to spread misinformation). Below link explains the reasons and lot of people use coinmetrics data: https://coinmetrics.io/on-data-and-certainty/

Bitcoin doesn’t have failed transactions: Do we have failed transactions in bitcoin?