How do I create a Google Drive file or folder shortcut in Google Drive on Android? (see question)

In the desktop web application, this is accomplished by navigating to the file, clicking on it, and pressing Shift + Z.

Is there a way to achieve the same functionality on Android? Either within the Google Drive app or in some other way?

NOTE: When I go to a file that is in multiple locations in the Google Drive app and go to: Options -> Details, I can see all of the file's locations and also remove locations, but I can't seem to add them add locations in this menu.

external PHP scripts – create a cron job to automatically clear the cache

I'm trying to clear the cache automatically with a cron job, but it didn't work.
I just debug in the browser under this link website-url / cronjob.php.
I think it's a syntax problem, I tried shorten the tables from the database.

As you can see in the code below, I tried two methods but none worked.

Drupal::database()->truncate('cache_config')->execute();
mysql_query('TRUNCATE TABLE yqxq_cache_config');
mysql_query('TRUNCATE TABLE yqxq_cache_container');
mysql_query('TRUNCATE TABLE yqxq_cache_data');
mysql_query('TRUNCATE TABLE yqxq_cache_default');
mysql_query('TRUNCATE TABLE yqxq_cache_discovery');
mysql_query('TRUNCATE TABLE yqxq_cache_dynamic_page_cache');
mysql_query('TRUNCATE TABLE yqxq_cache_entity');
mysql_query('TRUNCATE TABLE yqxq_cache_menu');
mysql_query('TRUNCATE TABLE yqxq_cache_render');
mysql_query('TRUNCATE TABLE yqxq_cache_toolbar');
?>

What do I need to change for this script to work?

Database – Create a backup of the MySQL database with a special name

I'm on a project and maybe you can help me:

I put you in a situation: my database is called school and it contains the tables students and teachers

I want to create an event that backs up the database.

The new database would like to call it school_bk _ "" copy date "".

I have 2 problems here:

  1. I can't use () or curdate () to name a database now

  2. Phpmyadmin creates the copy of the database, but does not display the commands it executes to interpret and use

Make sure I can't use mysqldump when using an event

I'm happy to hear about something

script – How to create and solve a bip199 htlc with python-bitcoinlib

When I play with this script, I want to understand how to create and redeem a bip199 htlc. However, this script fails on the OP_EQUALVERIFY and I can’t understand why.

import bitcoin
import bitcoin.rpc
from bitcoin import SelectParams
from bitcoin.core import b2x, lx, b2lx, COIN, COutPoint, CMutableTxOut, CMutableTxIn, CMutableTransaction, Hash160
from bitcoin.core.script import CScript, OP_DUP, OP_IF, OP_ELSE, OP_ENDIF, OP_HASH160, OP_EQUALVERIFY, OP_CHECKSIG, SignatureHash, SIGHASH_ALL
from bitcoin.core.script import OP_DROP, OP_CHECKLOCKTIMEVERIFY, OP_SHA256, OP_TRUE
from bitcoin.core.scripteval import VerifyScript, SCRIPT_VERIFY_P2SH
from bitcoin.wallet import CBitcoinAddress, CBitcoinSecret

import hashlib
from hashlib import sha256

SelectParams('regtest')
proxy = bitcoin.rpc.Proxy()

preimage = bytes(b'preimage'.hex(), 'utf8')
h = sha256(preimage).digest()

recipientpubkey = proxy.getnewaddress()
senderpubkey = proxy.getnewaddress()
seckey = proxy.dumpprivkey(recipientpubkey)

lockduration = 10
blocknum = proxy.getblockcount()
redeemblocknum = blocknum + lockduration

txin_redeemScript = CScript((
            OP_IF,
                OP_SHA256, h, OP_EQUALVERIFY,OP_DUP, OP_HASH160, recipientpubkey,
            OP_ELSE,
                redeemblocknum, OP_CHECKLOCKTIMEVERIFY, OP_DROP, OP_DUP, OP_HASH160, bytes(Hash160(seckey.pub)),
            OP_ENDIF,
                OP_EQUALVERIFY, OP_CHECKSIG
          ))


txin_scriptPubKey = txin_redeemScript.to_p2sh_scriptPubKey()

txin_p2sh_address = CBitcoinAddress.from_scriptPubKey(txin_scriptPubKey)
p2sh = str(txin_p2sh_address)

amount = 1.0*COIN

fund_tx = proxy.sendtoaddress(txin_p2sh_address, amount)

txinfo = proxy.gettransaction(fund_tx)
details = txinfo('details')(0)
vout = details('vout')

txin = CMutableTxIn(COutPoint(fund_tx, vout))

default_fee = 0.001*COIN
txout = CMutableTxOut(amount - default_fee, recipientpubkey.to_scriptPubKey())

tx = CMutableTransaction((txin), (txout))

sighash = SignatureHash(txin_redeemScript, tx, 0, SIGHASH_ALL)

sig = seckey.sign(sighash) + bytes((SIGHASH_ALL))

txin.scriptSig = CScript((sig, seckey.pub, preimage, preimage, txin_redeemScript))

VerifyScript(txin.scriptSig, txin_scriptPubKey, tx, 0, (SCRIPT_VERIFY_P2SH,))

txid = proxy.sendrawtransaction(tx)

Data – Create a custom DateListPlot

We have the following data

Clear["Global`*"];

data = TimeSeries[{1, 2, 1, 2, 0, 0, 0, 2, 21, 15, 21, 7, 11, 5, 10, 18, 73, 38, 103, 21, 
                   35, 31, 46, 31, 35, 94, 71, 48, 78, 71, 74, 95}, {"Feb 26, 2020"}];

plot = DateListPlot[{data}, Mesh -> All, ImageSize -> 500]

I want to do the following: Create new time series data, where each value is added to the previous ones, and thus generate cumulative data. In our case, we should have data

{1, 3, 4, 6, 6, 6, 6, 8, 29, 44, ...}

Any ideas?

How do I create a configuration file for the Systemd Service Unit for the MySQL server?

I am trying to start MySQL Server 5.7 with systemd for the first time after installation. The manual states that a configuration file should be created in / usr / lib / systemd / system However, this subdirectory does not exist (I'm on Ubuntu 04/18). I follow this guide:

https://dev.mysql.com/doc/mysql-secure-deployment-guide/5.7/de/secure-deployment-post-install.html#secure-deployment-systemd-startup

To configure the MySQL installation for use with systemd:

  1. Add a Systemd Service Unit configuration file with details about the MySQL service. The file is called mysqld.service and is located in / usr / lib / systemd / system.
shell> cd /usr/lib/systemd/system
shell> touch mysqld.service
shell> chmod 644 mysqld.service

Since I do not have the & # 39; system & # 39; from systemd, I just created the file mysql.service directly in / usr / lib / systemd.
After following the rest of the instructions, I had to:

shell> systemctl start mysqld

but it failed with:

Failed to enable unit: Unit file mysqld.service does not exist.

Would someone please explain what I did wrong? Thanks a lot.

Site Column – Create a "subject" field with a different inner name

I'm trying to create a website column named "Subject" or enter managed metadata. I first created the column with the name "vrdSubject" and then tried to rename the column to "Subject". However, the following error still appears:

"The column name you entered is already in use or is reserved".

I renamed the other subject field that is immediately available to Subject1 and then tried to add my column, but it didn't work. Do I have to delete the subject "out of the box"? Can't we have two columns with different inner names but the same display nanme?

I'll create a professional QR code and barcode for $ 5 for you

I will create a professional QR code and barcode for you

Hello customers,

I would like to provide the QR codes for different customer needs. I will offer different types of QR codes at a reasonable price.I can provide QR codes : –

  • URL
  • TELEPHONE NUMBER.
  • TEXT
  • MAIL
  • SMS
  • VCARD
  • MECARD
  • YOUTUBE
  • LOCATION
  • FACEBOOK
  • wireless Internet access
  • TWITTER
  • EVENT

c ++ context create OpenGL 4 for WinAPI (core & new style context)

I am trying to create OpenGL 4.2 in core mode for OS Windows (with WinAPI) in a new context. My code is work:

#include 
#include 
#include 
#include 

using GLchar = char;
using DEBUGPROC = void (APIENTRY*)(GLenum source,
    GLenum type,
    GLuint id,
    GLenum severity,
    GLsizei length,
    const GLchar * message,
    const void* userParam);
using GlDebugMessageCallback = void(APIENTRY*)(DEBUGPROC callback,
    const void* userParam);
using WglCreateContextAttribsARB = HGLRC(APIENTRY*)(HDC, HGLRC, const int*);
using WglSwapIntervalEXT = BOOL(WINAPI*)(int interval);

#define GL_DEBUG_SOURCE_API               0x8246
#define GL_DEBUG_SOURCE_WINDOW_SYSTEM     0x8247
#define GL_DEBUG_SOURCE_SHADER_COMPILER   0x8248
#define GL_DEBUG_SOURCE_THIRD_PARTY       0x8249
#define GL_DEBUG_SOURCE_APPLICATION       0x824A
#define GL_DEBUG_SOURCE_OTHER             0x824B
#define GL_DEBUG_TYPE_ERROR               0x824C
#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D
#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR  0x824E
#define GL_DEBUG_TYPE_PORTABILITY         0x824F
#define GL_DEBUG_TYPE_PERFORMANCE         0x8250
#define GL_DEBUG_TYPE_OTHER               0x8251
#define GL_DEBUG_TYPE_MARKER              0x8268
#define GL_DEBUG_TYPE_PUSH_GROUP          0x8269
#define GL_DEBUG_TYPE_POP_GROUP           0x826A
#define GL_DEBUG_SEVERITY_NOTIFICATION    0x826B
#define GL_DEBUG_LOGGED_MESSAGES          0x9145
#define GL_DEBUG_SEVERITY_HIGH            0x9146
#define GL_DEBUG_SEVERITY_MEDIUM          0x9147
#define GL_DEBUG_SEVERITY_LOW             0x9148
#define GL_DEBUG_OUTPUT                   0x92E0
#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB            0x00000001
#define WGL_CONTEXT_DEBUG_BIT_ARB                   0x0001
#define WGL_CONTEXT_FLAGS_ARB                       0x2094
#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB      0x0002
#define WGL_CONTEXT_LAYER_PLANE_ARB                 0x2093
#define WGL_CONTEXT_MAJOR_VERSION_ARB               0x2091
#define WGL_CONTEXT_MINOR_VERSION_ARB               0x2092
#define WGL_CONTEXT_PROFILE_MASK_ARB                0x9126

LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
void APIENTRY glDebugOutput(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam);

int width = 750;
int height = 500;

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
    // init window
    WNDCLASSEX wc;
    HWND hwnd;
    MSG msg;
    ZeroMemory(&wc, sizeof(WNDCLASSEX));
    wc.cbSize = sizeof(WNDCLASSEX);
    wc.lpfnWndProc = WndProc;
    wc.hInstance = hInstance;
    wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)(COLOR_GRAYTEXT);
    wc.lpszClassName = "windowGL";
    wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
    if (!RegisterClassEx(&wc))
        return 0;
    hwnd = CreateWindowEx(
        WS_EX_CLIENTEDGE,
        "windowGL",
        "The title Win32GL",
        WS_OVERLAPPEDWINDOW,
        CW_USEDEFAULT, CW_USEDEFAULT, width, height,
        NULL, NULL, hInstance, NULL);

    // init gl
    HGLRC hRC;
    HDC hDC = GetDC(hwnd);
    int pf = 0;
    PIXELFORMATDESCRIPTOR pfd = { 0 };
    pfd.nSize = sizeof(pfd);
    pfd.nVersion = 1;
    pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
    pfd.iPixelType = PFD_TYPE_RGBA;
    pfd.cColorBits = 24;
    pfd.cDepthBits = 16;
    pfd.iLayerType = PFD_MAIN_PLANE;
    pf = ChoosePixelFormat(hDC, &pfd);
    SetPixelFormat(hDC, pf, &pfd);

    int flags() = { WGL_CONTEXT_MAJOR_VERSION_ARB, 4,
        WGL_CONTEXT_MINOR_VERSION_ARB, 4,
        WGL_CONTEXT_FLAGS_ARB, WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB | WGL_CONTEXT_DEBUG_BIT_ARB,
        WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB,
        0 };

    // make context
    HGLRC TempRC = wglCreateContext(hDC);
    wglMakeCurrent(hDC, TempRC);
    WglCreateContextAttribsARB wglCreateContextAttribsARB = (WglCreateContextAttribsARB)wglGetProcAddress("wglCreateContextAttribsARB");
    hRC = wglCreateContextAttribsARB(hDC, 0, flags);
    wglMakeCurrent(hDC, hRC);
    wglDeleteContext(TempRC);

    // vsync
    WglSwapIntervalEXT wglSwapIntervalEXT = (WglSwapIntervalEXT)wglGetProcAddress("wglSwapIntervalEXT");
    wglSwapIntervalEXT(0);

    // gl debug
    glEnable(GL_DEBUG_OUTPUT);
    GlDebugMessageCallback glDebugMessageCallback = (GlDebugMessageCallback)wglGetProcAddress("glDebugMessageCallbackARB");
    glDebugMessageCallback(glDebugOutput, 0);

    ShowWindow(hwnd, nCmdShow);
    UpdateWindow(hwnd);
    try
    {
        while (true)
        {
            if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
            {
                if (msg.message == WM_QUIT)
                    break;
                TranslateMessage(&msg);
                DispatchMessage(&msg);
            }
            else
            {
                glClearColor(0.8f, 0.5f, 0.9f, 1.0f);
                glClear(GL_COLOR_BUFFER_BIT);
                SwapBuffers(hDC);
            }
        }
    }
    catch (const std::exception & e)
    {
        MessageBox(NULL, e.what(), "Error!", MB_ICONERROR);
        return -1;
    }
    return 0;
}


LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
    switch (msg)
    {
    case WM_CLOSE:
        DestroyWindow(hwnd);
        break;
    case WM_DESTROY:
        PostQuitMessage(0);
        break;
    case WM_SIZE:
        width = LOWORD(lParam);
        height = HIWORD(lParam);
        glViewport(0, 0, width, height);
        break;
    default:
        return DefWindowProc(hwnd, msg, wParam, lParam);
    }
    return 0;
}

void APIENTRY glDebugOutput(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam)
{
    if (id == 131169 || id == 131185 || id == 131218 || id == 131204)
        return;

    std::stringstream error;
    error << "---------------" << std::endl;
    error << "Debug message (" << id << "): " << message << std::endl;

    switch (source)
    {
    case GL_DEBUG_SOURCE_API:
        error << "Source: API";
        break;
    case GL_DEBUG_SOURCE_WINDOW_SYSTEM:
        error << "Source: Window System";
        break;
    case GL_DEBUG_SOURCE_SHADER_COMPILER:
        error << "Source: Shader Compiler";
        break;
    case GL_DEBUG_SOURCE_THIRD_PARTY:
        error << "Source: Third Party";
        break;
    case GL_DEBUG_SOURCE_APPLICATION:
        error << "Source: Application";
        break;
    case GL_DEBUG_SOURCE_OTHER:
        error << "Source: Other";
        break;
    }
    error << std::endl;

    switch (type)
    {
    case GL_DEBUG_TYPE_ERROR:
        error << "Type: Error";
        break;
    case GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR:
        error << "Type: Deprecated Behaviour";
        break;
    case GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR:
        error << "Type: Undefined Behaviour";
        break;
    case GL_DEBUG_TYPE_PORTABILITY:
        error << "Type: Portability";
        break;
    case GL_DEBUG_TYPE_PERFORMANCE:
        error << "Type: Performance";
        break;
    case GL_DEBUG_TYPE_MARKER:
        error << "Type: Marker";
        break;
    case GL_DEBUG_TYPE_PUSH_GROUP:
        error << "Type: Push Group";
        break;
    case GL_DEBUG_TYPE_POP_GROUP:
        error << "Type: Pop Group";
        break;
    case GL_DEBUG_TYPE_OTHER:
        error << "Type: Other";
        break;
    }
    error << std::endl;

    switch (severity)
    {
    case GL_DEBUG_SEVERITY_HIGH:
        error << "Severity: high";
        break;
    case GL_DEBUG_SEVERITY_MEDIUM:
        error << "Severity: medium";
        break;
    case GL_DEBUG_SEVERITY_LOW:
        error << "Severity: low";
        break;
    case GL_DEBUG_SEVERITY_NOTIFICATION:
        error << "Severity: notification";
        break;
    }
    error << std::endl;
    error << std::endl;

    throw std::runtime_error("Error render OpenGL: n" + error.str());
}

All error handling has been skipped. Work app and render image.

Do I correctly create the context in the new style?

Thanks a lot