落花随流水

文章 评论 浏览 30

落花随流水 2025-02-20 21:56:32

您的代码没有击中elif阻止

您的 和elif块的原因。

它应该检查codon_sequence [i]等于兴趣的字符串。

if(codon_sequence[i]=="UUU" or codon_sequence[i]=="UUC" or codon_sequence[i]=="TTT" or codon_sequence[i]=="TTC"):

取而代
如果条件始终为 true 。
,这将导致第一个
因此,您永远不会击中elif块。

如果语句是:编写的更好方法是:

if codon_sequence[i] in ["UUU", "UUC", "TTT", "TTC"]:
    print("Phe_")

Reason why your code is not hitting the elif blocks

Your if and elif blocks should look like this.
It should check if codon_sequence[i] is equal to a string of interest.

if(codon_sequence[i]=="UUU" or codon_sequence[i]=="UUC" or codon_sequence[i]=="TTT" or codon_sequence[i]=="TTC"):

Instead you have an or condition against just plain strings like UUC.
This will result in the first if condition always being True.
Thereby you will never hit the elif block.

Also a better way of writing the if statement would be:

if codon_sequence[i] in ["UUU", "UUC", "TTT", "TTC"]:
    print("Phe_")

Elifs条件在我的计划中不起作用

落花随流水 2025-02-20 19:22:09

您需要指定扩展名。这是在JS中,但我认为类似的逻辑适用于扑朔迷离:

import { Magic } from 'magic-sdk';
import { SolanaExtension } from '@magic-ext/solana';

const magic = new Magic('YOUR_API_KEY', {
  extensions: [
    new SolanaExtension({
      rpcUrl: 'SOLANA_RPC_NODE_URL',
    }),
  ],
});

注意:Didtoken将始终遵守以太坊方法,但现在公共密钥将成为Solana公共密钥。

You need to specify the extension. This is in JS, but I believe similar logic applies to flutter:

import { Magic } from 'magic-sdk';
import { SolanaExtension } from '@magic-ext/solana';

const magic = new Magic('YOUR_API_KEY', {
  extensions: [
    new SolanaExtension({
      rpcUrl: 'SOLANA_RPC_NODE_URL',
    }),
  ],
});

NOTE: The didToken will always adhere to the Ethereum method, but now the public key will be a Solana public key.

如何将魔术身份验证与扑朔迷离并将Solana作为我们的区块链?

落花随流水 2025-02-20 12:12:03

您在Monobehaviourpuncallbacks的后背上向后退。它必须是小写

You uppercased b in backs in MonoBehaviourPunCallbacks. It must be lowercase

我的代码有什么问题,即时通讯使用Photon Pun 2 Unity

落花随流水 2025-02-20 05:49:34
<input type='date' min="2019-01-02" max='2023-01-02' />
<input type='date' min="2019-01-02" max='2023-01-02' />

我该如何设置Max&amp; React表单输入类型的最小值=“日期”

落花随流水 2025-02-20 00:13:48

不幸的是,当前在PYPI上没有M1的车轮,请改用Conda安装。

问题是在跟踪在这里

Unfortunately there are currently no wheels avaiable for M1 on pypi, please install with conda instead.

The problem is being tracked here

Mac:Mach-O文件上的PyreadStat导入错误,但是一个不兼容的体系结构(Have&#x27; x86_64&#x27;,需要

落花随流水 2025-02-19 23:47:39

使用“ nofollow noreferrer”>可选链接

{{exple?.[0]?.completeAdress?.[0]?.city}}

?操作员就像。链式操作员,除了如果引用为nullish(无效或未定义),则没有引起错误,而是具有未定义的返回值的短路。当与函数调用一起使用时,如果给定函数不存在,它将返回未定义。
因为在您的应用程序生活中的某个时刻,尚不存在一些嵌套的属性。

Use optional chaining

{{exple?.[0]?.completeAdress?.[0]?.city}}

The ?. operator is like the . chaining operator, except that instead of causing an error if a reference is nullish (null or undefined), the expression short-circuits with a return value of undefined. When used with function calls, it returns undefined if the given function does not exist.
Because at some moment in your app life, some nested property didn't exist yet.

访问嵌套对象属性时错误

落花随流水 2025-02-19 20:03:24

您应该使用唯一的container_name,然后仔细检查一个HDFS DataNode独特的变量的Env文件,但是是的,您要复制该部分。

但是,无论如何,您的一个主机是一个失败的点,因此在一个磁盘上的两个数据台之间设置复制不会是有益的

You should use a unique container_name and double check the env file for variables unique to one HDFS datanode, but yes, you'd copy that section.

However, your one host is a single point of failure, anyway, so setting up replication between two datanodes on one disk wouldn't be beneficial

将多个datanodes添加到Docker-Compose

落花随流水 2025-02-19 14:27:43

该错误应通过

解决
npm I -D @types/stypled -components @最新

This error should be resolved with

npm i -D @types/styled-components@latest

找不到模块的声明文件。

落花随流水 2025-02-19 02:08:58

仔细阅读您的问题,我认为这就是您要实现的目标。
在代码中添加了评论以进行更改。

struct ContentView: View {
    
    @State var f1: String = ""
    @State var f2: String = ""
    @State var f3: String = ""
    @FocusState var focused: Bool // changed to Bool as youre only intersted in focussing field 1
    
    func isFormEmpty() -> Bool {
        return f1.isEmpty && f2.isEmpty && f3.isEmpty
    }
    
    var body: some View {
        HStack {
            TextField("3", text: $f3)
                .frame(width: 44, height: 44)
                .background(.ultraThinMaterial, in: RoundedRectangle(cornerRadius: 8, style: .continuous))
            
                .disabled(f1.isEmpty || f2.isEmpty)
            
            TextField("2", text: $f2)
                .frame(width: 44, height: 44)
                .background(.ultraThinMaterial, in: RoundedRectangle(cornerRadius: 8, style: .continuous))
            
                .disabled(f1.isEmpty)
            
            TextField("1", text: $f1)
                .frame(width: 44, height: 44)
                .background(.ultraThinMaterial, in: RoundedRectangle(cornerRadius: 8, style: .continuous))
            
                .focused($focused) // added focus
            
                .onChange(of: f1) { newValue in
                    
                    if f1.count == 1 { return } // first letter input > do nothing
                    
                    if f1.count == 0 { // delete was pressed
                        f1 = f2.first?.description ?? ""
                        f2 = f3.first?.description ?? ""
                        f3 = ""
                        return
                    }
                    
                    f1 = String(f1.prefix(2))
                    
                    if f2.isEmpty {
                        f2 = f1.first?.description ?? ""
                    } else if f3.isEmpty {
                        f3 = f2.first?.description ?? ""
                        f2 = f1.first?.description ?? ""
                    }
                    f1.removeFirst()
                }
        }
        // common modifiers can be here
        .font(.headline.weight(.semibold))
        .keyboardType(.numberPad)
        .multilineTextAlignment(.center)

        .overlay (
            Color.primary
                .opacity(isFormEmpty() && !focused ? 0.01 : 0)
                .onTapGesture {
                    focused = true
                }
        )
    }
}

Carefully reading your question I think this is what you want to achieve.
Added comments in the code for changes.

enter image description here

struct ContentView: View {
    
    @State var f1: String = ""
    @State var f2: String = ""
    @State var f3: String = ""
    @FocusState var focused: Bool // changed to Bool as youre only intersted in focussing field 1
    
    func isFormEmpty() -> Bool {
        return f1.isEmpty && f2.isEmpty && f3.isEmpty
    }
    
    var body: some View {
        HStack {
            TextField("3", text: $f3)
                .frame(width: 44, height: 44)
                .background(.ultraThinMaterial, in: RoundedRectangle(cornerRadius: 8, style: .continuous))
            
                .disabled(f1.isEmpty || f2.isEmpty)
            
            TextField("2", text: $f2)
                .frame(width: 44, height: 44)
                .background(.ultraThinMaterial, in: RoundedRectangle(cornerRadius: 8, style: .continuous))
            
                .disabled(f1.isEmpty)
            
            TextField("1", text: $f1)
                .frame(width: 44, height: 44)
                .background(.ultraThinMaterial, in: RoundedRectangle(cornerRadius: 8, style: .continuous))
            
                .focused($focused) // added focus
            
                .onChange(of: f1) { newValue in
                    
                    if f1.count == 1 { return } // first letter input > do nothing
                    
                    if f1.count == 0 { // delete was pressed
                        f1 = f2.first?.description ?? ""
                        f2 = f3.first?.description ?? ""
                        f3 = ""
                        return
                    }
                    
                    f1 = String(f1.prefix(2))
                    
                    if f2.isEmpty {
                        f2 = f1.first?.description ?? ""
                    } else if f3.isEmpty {
                        f3 = f2.first?.description ?? ""
                        f2 = f1.first?.description ?? ""
                    }
                    f1.removeFirst()
                }
        }
        // common modifiers can be here
        .font(.headline.weight(.semibold))
        .keyboardType(.numberPad)
        .multilineTextAlignment(.center)

        .overlay (
            Color.primary
                .opacity(isFormEmpty() && !focused ? 0.01 : 0)
                .onTapGesture {
                    focused = true
                }
        )
    }
}

创建自定义文本字段

落花随流水 2025-02-18 20:02:18

根据DB2的平台和版本,您可以考虑使用 创建蒙版 如果可用。这将确保始终掩盖数据,而无需在每个应用程序中进行。

快速搜索似乎表明甲骨文也有类似的支持-data-redaction.html#GUID-82EA9712-387C-4D3A-BB72-F64A707C67CA“ rel =“ nofollow noreferrer”> REDACTION 。甲骨文中的掩盖似乎与子集,并将数据导出到Dev/Test。

您真的需要两个RDBM的解决方案吗?

而且,如果您真的想滚动,则需要提供一些您想要返回的蒙版价值的示例。

编辑

这是代码的一部分。 PK_Person具有BIGINT作为数据类型。更新
person.t_person set pk_person = regexp_replace(pk_person,'[0-9]',
'*')pk_person在('117888')

无效的情况下,您无法将bigint列设置为字符串。这也不是掩盖的工作方式。掩盖通常是指从数据库中读取数据时发生的过程。

Depending on the platform and version of Db2, you might consider using CREATE MASK if available. That would ensure the data is always masked without needing to do it in every application.

A quick search seems to indicate the Oracle also has similar support but they call it redaction. Masking in oracle seems to be tied into subsetting and exporting data from production to DEV/TEST.

Do you really need a solution for both RDBMs?

And if you really want to roll your own, you need to provide some examples of the masked value you want returned.

EDIT

Here is a part of the code. PK_PERSON has BIGINT as datatype. update
Person.T_PERSON set PK_PERSON = REGEXP_REPLACE(PK_PERSON, '[0-9]',
'*') where PK_PERSON in ('117888')

That's not going to work, you can't set a BIGINT column to a string. That's also not how masking works. Masking generally refers to a process that happens when the data is read out of the DB.

Bigint的Regexp_replace的替代方案

落花随流水 2025-02-18 06:11:56

您可以使用这样的行为:

public enum DisplayDefaultTextMode
{
    TextBoxTextEmpty,
    TextBoxDisabledAndTextEmpty
}

public class DefaultTextBoxValueBehavior : Behavior<TextBox>
{
    public DisplayDefaultTextMode DisplayMode { get; set; } = DisplayDefaultTextMode.TextBoxDisabledAndTextEmpty;

    public string DefaultText
    {
        get => (string)GetValue(DefaultTextProperty);
        set => SetValue(DefaultTextProperty, value);
    }

    public static readonly DependencyProperty DefaultTextProperty =
        DependencyProperty.Register(
            nameof(DefaultText),
            typeof(string),
            typeof(DefaultTextBoxValueBehavior),
            new PropertyMetadata(string.Empty));

    protected override void OnAttached()
    {
        base.OnAttached();

        AssociatedObject.Loaded += OnLoaded;

        AssociatedObject.TextChanged += OnTextChanged;
        AssociatedObject.IsEnabledChanged += OnIsEnabledChanged;
    }

    protected override void OnDetaching()
    {
        base.OnDetaching();

        AssociatedObject.Loaded -= OnLoaded;
        AssociatedObject.TextChanged -= OnTextChanged;
        AssociatedObject.IsEnabledChanged -= OnIsEnabledChanged;
    }

    private void OnLoaded(object sender, RoutedEventArgs e) => SetDefaultTextIfNeeded();

    private void OnTextChanged(object sender, TextChangedEventArgs e)
    {
        if (AssociatedObject.Text?.Length == 0 && e.Changes.Any(c => c.RemovedLength > 0))
        {
            //ignore since we expect the user to cleare the field for futher input
        }
        else
            SetDefaultTextIfNeeded();
    }

    private void OnIsEnabledChanged(object sender, DependencyPropertyChangedEventArgs e) => SetDefaultTextIfNeeded();

    private void SetDefaultTextIfNeeded()
    {
        if (CheckShouldSetDefaultText())
            SetDefaultText();
    }

    private bool CheckShouldSetDefaultText()
    {
        if (DisplayMode == DisplayDefaultTextMode.TextBoxTextEmpty)
            return string.IsNullOrEmpty(AssociatedObject.Text);
        else
            return string.IsNullOrEmpty(AssociatedObject.Text) && !AssociatedObject.IsEnabled;
    }

    private void SetDefaultText()
    {
        AssociatedObject.TextChanged -= OnTextChanged;
        AssociatedObject.Text = DefaultText;
        AssociatedObject.TextChanged += OnTextChanged;
    }
}

用法示例:

xmlns:i="http://schemas.microsoft.com/xaml/behaviors"

<TextBox>
    <i:Interaction.Behaviors>
        <behaviors:DefaultTextBoxValueBehavior
            DisplayMode="TextBoxDisabledAndTextEmpty"
            DefaultText="Default text"/>
        </i:Interaction.Behaviors>
</TextBox>

NB!您可以在行为中定义displayMode属性,以设置默认文本显示。如果您设置displayDefaultTextMode.textboxtextempty如果TexBox文本为空或空,则将设置默认文本。如果您设置displayDefaultTextMode.textboxdisabledandtextempty Defualt Text将仅设置为带有空文本的禁用文本框。

希望这对您有帮助。

You can use behavior like this:

public enum DisplayDefaultTextMode
{
    TextBoxTextEmpty,
    TextBoxDisabledAndTextEmpty
}

public class DefaultTextBoxValueBehavior : Behavior<TextBox>
{
    public DisplayDefaultTextMode DisplayMode { get; set; } = DisplayDefaultTextMode.TextBoxDisabledAndTextEmpty;

    public string DefaultText
    {
        get => (string)GetValue(DefaultTextProperty);
        set => SetValue(DefaultTextProperty, value);
    }

    public static readonly DependencyProperty DefaultTextProperty =
        DependencyProperty.Register(
            nameof(DefaultText),
            typeof(string),
            typeof(DefaultTextBoxValueBehavior),
            new PropertyMetadata(string.Empty));

    protected override void OnAttached()
    {
        base.OnAttached();

        AssociatedObject.Loaded += OnLoaded;

        AssociatedObject.TextChanged += OnTextChanged;
        AssociatedObject.IsEnabledChanged += OnIsEnabledChanged;
    }

    protected override void OnDetaching()
    {
        base.OnDetaching();

        AssociatedObject.Loaded -= OnLoaded;
        AssociatedObject.TextChanged -= OnTextChanged;
        AssociatedObject.IsEnabledChanged -= OnIsEnabledChanged;
    }

    private void OnLoaded(object sender, RoutedEventArgs e) => SetDefaultTextIfNeeded();

    private void OnTextChanged(object sender, TextChangedEventArgs e)
    {
        if (AssociatedObject.Text?.Length == 0 && e.Changes.Any(c => c.RemovedLength > 0))
        {
            //ignore since we expect the user to cleare the field for futher input
        }
        else
            SetDefaultTextIfNeeded();
    }

    private void OnIsEnabledChanged(object sender, DependencyPropertyChangedEventArgs e) => SetDefaultTextIfNeeded();

    private void SetDefaultTextIfNeeded()
    {
        if (CheckShouldSetDefaultText())
            SetDefaultText();
    }

    private bool CheckShouldSetDefaultText()
    {
        if (DisplayMode == DisplayDefaultTextMode.TextBoxTextEmpty)
            return string.IsNullOrEmpty(AssociatedObject.Text);
        else
            return string.IsNullOrEmpty(AssociatedObject.Text) && !AssociatedObject.IsEnabled;
    }

    private void SetDefaultText()
    {
        AssociatedObject.TextChanged -= OnTextChanged;
        AssociatedObject.Text = DefaultText;
        AssociatedObject.TextChanged += OnTextChanged;
    }
}

Usage example:

xmlns:i="http://schemas.microsoft.com/xaml/behaviors"

<TextBox>
    <i:Interaction.Behaviors>
        <behaviors:DefaultTextBoxValueBehavior
            DisplayMode="TextBoxDisabledAndTextEmpty"
            DefaultText="Default text"/>
        </i:Interaction.Behaviors>
</TextBox>

N.B! You can define DisplayMode property in the behavior to set up default text appearence. If you set DisplayDefaultTextMode.TextBoxTextEmpty default text will be set if texbox text is null or empty. And if you set DisplayDefaultTextMode.TextBoxDisabledAndTextEmpty defualt text will be set only to the disabled textbox with empty text.

Hope it will be helpful for you.

仅在WPF中为禁用的文本框设置默认文本

落花随流水 2025-02-18 00:34:54

只需更改.htaccess即可解决问题:

在root 1中更改两个文件。 .htaccess ,2。 .index.php

,然后在公共文件夹1中更改两个文件。 .htaccess ,2。 .index.php

根文件夹

.htaccess

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

RewriteEngine On

# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ ^$1 [N]

RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
RewriteRule ^(.*)$ public/$1

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php

根文件夹

index.php

<?php

/**
 * Laravel - A PHP Framework For Web Artisans
 *
 * @package  Laravel
 * @author   Taylor Otwell <[email protected]>
 */

$uri = urldecode(
    parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
);

// This file allows us to emulate Apache's "mod_rewrite" functionality from the
// built-in PHP web server. This provides a convenient way to test a Laravel
// application without having installed a "real" web server software here.
/*if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) {
    return false;
}*/
require_once __DIR__.'/public/index.php';

公共文件夹

.htaccess

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Send Requests To Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

公共文件夹

index.php

<?php

use Illuminate\Contracts\Http\Kernel;
use Illuminate\Http\Request;

define('LARAVEL_START', microtime(true));

/*
|--------------------------------------------------------------------------
| Check If The Application Is Under Maintenance
|--------------------------------------------------------------------------
|
| If the application is in maintenance / demo mode via the "down" command
| we will load this file so that any pre-rendered content can be shown
| instead of starting the framework, which could cause an exception.
|
*/

if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) {
    require $maintenance;
}

/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader for
| this application. We just need to utilize it! We'll simply require it
| into the script here so we don't need to manually load our classes.
|
*/

require __DIR__.'/../vendor/autoload.php';

/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request using
| the application's HTTP kernel. Then, we will send the response back
| to this client's browser, allowing them to enjoy our application.
|
*/

$app = require_once __DIR__.'/../bootstrap/app.php';

$kernel = $app->make(Kernel::class);

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

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

找到解决方案和欢呼...
快乐的编码..

Just Change the .htaccess and the problem is solved:

Change Two files in root 1..htaccess, 2. .index.php

And Change Two files in public folder 1..htaccess, 2. .index.php

Root Folder

.htaccess

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

RewriteEngine On

# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ ^$1 [N]

RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
RewriteRule ^(.*)$ public/$1

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php

Root Folder

index.php

<?php

/**
 * Laravel - A PHP Framework For Web Artisans
 *
 * @package  Laravel
 * @author   Taylor Otwell <[email protected]>
 */

$uri = urldecode(
    parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
);

// This file allows us to emulate Apache's "mod_rewrite" functionality from the
// built-in PHP web server. This provides a convenient way to test a Laravel
// application without having installed a "real" web server software here.
/*if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) {
    return false;
}*/
require_once __DIR__.'/public/index.php';

Public Folder

.htaccess

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Send Requests To Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

Public Folder

index.php

<?php

use Illuminate\Contracts\Http\Kernel;
use Illuminate\Http\Request;

define('LARAVEL_START', microtime(true));

/*
|--------------------------------------------------------------------------
| Check If The Application Is Under Maintenance
|--------------------------------------------------------------------------
|
| If the application is in maintenance / demo mode via the "down" command
| we will load this file so that any pre-rendered content can be shown
| instead of starting the framework, which could cause an exception.
|
*/

if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) {
    require $maintenance;
}

/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader for
| this application. We just need to utilize it! We'll simply require it
| into the script here so we don't need to manually load our classes.
|
*/

require __DIR__.'/../vendor/autoload.php';

/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request using
| the application's HTTP kernel. Then, we will send the response back
| to this client's browser, allowing them to enjoy our application.
|
*/

$app = require_once __DIR__.'/../bootstrap/app.php';

$kernel = $app->make(Kernel::class);

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

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

Find the solution and cheers...
Happy Coding..

在服务器中部署Laravel项目而不更改公共文件夹路径

落花随流水 2025-02-17 16:04:34

社区不和谐中的项目贡献者之一阐明了上述istitle:true解决方案需要在选项区域的列定义之后:

class parent_1_table extends Model {
    static associate(models) {
    }
  }
  parent_table.init({
    id: {
      type: Sequelize.BIGINT,
      primaryKey: true,
      autoIncrement: true,
    },
    proper_name: {
      type: Sequelize.STRING(32),
      // isTitle: true, * not here
    },
  }, {
    sequelize,
    properties: { // put these display options here!
      proper_name: {
        isTitle: true,
      },
    },
    modelName: 'parent_table',
    timestamps: false,
    createdAt: false,
    updatedAt: false,
    freezeTableName: true,
    tableName: 'parent_table',
  });

One of the project contributors in the community Discord clarified the above isTitle: true solution needs to be AFTER the column definitions in the options area:

class parent_1_table extends Model {
    static associate(models) {
    }
  }
  parent_table.init({
    id: {
      type: Sequelize.BIGINT,
      primaryKey: true,
      autoIncrement: true,
    },
    proper_name: {
      type: Sequelize.STRING(32),
      // isTitle: true, * not here
    },
  }, {
    sequelize,
    properties: { // put these display options here!
      proper_name: {
        isTitle: true,
      },
    },
    modelName: 'parent_table',
    timestamps: false,
    createdAt: false,
    updatedAt: false,
    freezeTableName: true,
    tableName: 'parent_table',
  });

自定义adminj中的外键相关表值的显示值

落花随流水 2025-02-17 16:00:55

当前,您没有比较两个数组的相应索引,因为您已经定义了具有两个不同变量的循环的双重循环。
在您的代码上方,它循环遍历WordArray的每个元素,并比较每个WordArray元素的CROCKEGESS数组的每个元素。

为了获得想要的东西,您只想拥有一个用于循环的循环,该循环会迭代n时间,其中n是较小的数组的长度。

Currently you are not comparing the corresponding indices of the two arrays, because you have defined a double for loop with two different variables.
With your code above it loops through each element of wordArray and compares every element of correctGuesses array for each wordArray element.

To get what you want, you only want to have one for loop which iterates n-times where n is the length of the smaller array.

即使它进入if循环,也不将值输入到数组中

落花随流水 2025-02-17 11:39:50

如果通过串联连接的振荡器表示耦合振荡器,则很简单,它只是要以矩阵形式编写系统。

假设您将要建模一个类似的系统:

|    k1             K            k2    |
|-/\/\/\/\-(m1)-/\/\/\/\-(m2)-/\/\/\/\-|
|                                      |

使用两个质量m1m2和三个强度的弹簧k1k2 < /代码>和k

M @ x''(t) + K @ x(t) = 0

首先,导入所需的库:

import numpy as np
from scipy import integrate
import matplotlib.pyplot as plt

然后以其矩阵形式描述您的设置:

m1 = 5
m2 = 1

k1 = 1
k2 = 5
K = 10

M = np.array([
    [m1, 0],
    [0, m2]
])

K = np.array([
    [k1 + K, -K],
    [-K, k2 + K]
])

Minv = np.linalg.inv(M)

W = Minv @ K 

现在将线性二阶ode系统减少到一阶方程的等效系统中,就像您对一维情况一样:

def system(t, y, w):
    n = w.shape[0]
    return np.hstack([y[n:2*n], -w @ y[0:n]])

选择IVP的初始条件并将其集成为通常:

t = np.linspace(0, 20, 10000)
solution = integrate.solve_ivp(system, [t.min(), t.max()], y0=[0, 0, -1, 1], args=(W,), t_eval=t)

确认求解器的成功:

  message: 'The solver successfully reached the end of the integration interval.'
     nfev: 590
     njev: 0
      nlu: 0
      sol: None
   status: 0
  success: True

最终渲染解决方案以查看系统的行为:

“在此处输入图像说明”

If by oscillator connected in series you mean coupled oscillators, then it is simple, it is just about writing your system in a matrix form.

Let's say you are about to model a system like:

|    k1             K            k2    |
|-/\/\/\/\-(m1)-/\/\/\/\-(m2)-/\/\/\/\-|
|                                      |

With two masses m1, m2 and three springs of strength k1, k2 and K.

M @ x''(t) + K @ x(t) = 0

First, import required libraries:

import numpy as np
from scipy import integrate
import matplotlib.pyplot as plt

Then describe your setup in its matrix form:

m1 = 5
m2 = 1

k1 = 1
k2 = 5
K = 10

M = np.array([
    [m1, 0],
    [0, m2]
])

K = np.array([
    [k1 + K, -K],
    [-K, k2 + K]
])

Minv = np.linalg.inv(M)

W = Minv @ K 

Now reduce the linear second order ODE system into the equivalent system of first order equations as you did for the one dimensional case:

def system(t, y, w):
    n = w.shape[0]
    return np.hstack([y[n:2*n], -w @ y[0:n]])

Chose the initial conditions for the IVP and integrate as usual:

t = np.linspace(0, 20, 10000)
solution = integrate.solve_ivp(system, [t.min(), t.max()], y0=[0, 0, -1, 1], args=(W,), t_eval=t)

Confirm the solver succeed:

  message: 'The solver successfully reached the end of the integration interval.'
     nfev: 590
     njev: 0
      nlu: 0
      sol: None
   status: 0
  success: True

Finally render the solution to check out the behaviour of your system:

enter image description here
enter image description here
enter image description here

如何将3个谐波振荡器串联连接?

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文