留蓝

文章 评论 浏览 28

留蓝 2025-02-10 07:35:17

打开位于Laravel项目根部中的.env文件,并更新数据库配置以使用mySQL:主要修改是修改sqllite sqllite to mysql编写命令:PHP Artisan迁移

Open the .env file located in the root of your Laravel project and update the database configuration to use MySQL: The main modification is modifying sqllite to mysql and write the command: php artisan migrate

Laravel Sqlite数据库不存在

留蓝 2025-02-10 07:01:22

我发现一个答案如下所示。我只是声明全球变量,其中包含路径,然后在两个名为“ Convertimg”的按钮的另一个函数中访问它。

解决的代码:

from tkinter import *
import tkinter as tk
from PIL import Image, ImageTk
from tkinter import filedialog
import os
import numpy as np


def showImage():
    global fln
    fln = filedialog.askopenfilename(initialdir= os.getcwd(), title = "Choose Image", 
        filetypes= (("JPG files", "*.jpg*"), ("all files", "*.*")))
    img = Image.open(fln)
    img.thumbnail((350,350))
    img  = ImageTk.PhotoImage(img)
    lbl.configure(image= img)
    lbl.image = img
    

root = Tk()
root.title("Browse Image")
root.geometry('300x450')
lbl = Label(root)
lbl.pack()



def convertImg():
    fln1 = fln
    img = Image.open(fln1)
    imageConvert = np.asarray(img)
    print(imageConvert)


frm = Frame(root)
frm.pack(side = BOTTOM, padx= 15, pady= 15)

#first button
btn1 = Button(frm, text= "Choose Another Image", command= lambda : showImage())
btn1.pack()


# path = showImage()
# second button
btn2 = Button(frm, text= "Convert Your Selected Image", command= lambda : convertImg())
btn2.pack()


root.mainloop()

I find out an answer which is shown below. I just declare the variable globally which contains the path and then access it in another function of button two named "ConvertImg".

Solved code:

from tkinter import *
import tkinter as tk
from PIL import Image, ImageTk
from tkinter import filedialog
import os
import numpy as np


def showImage():
    global fln
    fln = filedialog.askopenfilename(initialdir= os.getcwd(), title = "Choose Image", 
        filetypes= (("JPG files", "*.jpg*"), ("all files", "*.*")))
    img = Image.open(fln)
    img.thumbnail((350,350))
    img  = ImageTk.PhotoImage(img)
    lbl.configure(image= img)
    lbl.image = img
    

root = Tk()
root.title("Browse Image")
root.geometry('300x450')
lbl = Label(root)
lbl.pack()



def convertImg():
    fln1 = fln
    img = Image.open(fln1)
    imageConvert = np.asarray(img)
    print(imageConvert)


frm = Frame(root)
frm.pack(side = BOTTOM, padx= 15, pady= 15)

#first button
btn1 = Button(frm, text= "Choose Another Image", command= lambda : showImage())
btn1.pack()


# path = showImage()
# second button
btn2 = Button(frm, text= "Convert Your Selected Image", command= lambda : convertImg())
btn2.pack()


root.mainloop()

如何处理Python' tkinter' GUI声明?

留蓝 2025-02-10 01:34:15

您可以尝试以下命令:

sudo lsof -nP -i4TCP:80

Can you try this command :

sudo lsof -nP -i4TCP:80

如何确定哪个Localhost端口正在运行?

留蓝 2025-02-09 16:06:03

在不同的机器上设置我的开发环境时,遇到了同样的问题。

使用NPM运行服务。它对我有用。

Encountered the same problem when setting up my development environment on different machine.

Use npm run serve instead. It worked to me.

将角从5.0版升级到6.1时,面对NPM错误:未知参数:服务

留蓝 2025-02-09 15:49:59

我认为mattabledatasource对象与您传递给mattabledataSource构造函数的数据数组链接到某种方式。

例如:

dataTable: string[];
tableDS: MatTableDataSource<string>;

ngOnInit(){
   // here your pass dataTable to the dataSource
   this.tableDS = new MatTableDataSource(this.dataTable); 
}

因此,当您必须更改数据时;在原始列表上更改dataTable,然后通过call _UPDATECHANGESUBSCRIPEND()方法tables反映表上的更改。

例如:

this.dataTable.push('testing');
this.tableDS._updateChangeSubscription();

通过Angular 6与我一起工作。

I think the MatTableDataSource object is some way linked with the data array that you pass to MatTableDataSource constructor.

For instance:

dataTable: string[];
tableDS: MatTableDataSource<string>;

ngOnInit(){
   // here your pass dataTable to the dataSource
   this.tableDS = new MatTableDataSource(this.dataTable); 
}

So, when you have to change data; change on the original list dataTable and then reflect the change on the table by call _updateChangeSubscription() method on tableDS.

For instance:

this.dataTable.push('testing');
this.tableDS._updateChangeSubscription();

That's work with me through Angular 6.

角&#x2B;材料 - 如何刷新数据源(MAT -Table)

留蓝 2025-02-09 08:04:35

对我而言,将其添加到&lt;链接中的工作方式如下示例,而不是将其用作CSS文件中的导入URL

   <Head>
          
<link
        href='https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap'
        rel='stylesheet'
      />
</Head>

For me , adding it in <link worked like the example below , rather than using it as import url in css files

   <Head>
          
<link
        href='https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap'
        rel='stylesheet'
      />
</Head>

Google字体部署到Vercel时未加载Next.js

留蓝 2025-02-09 03:42:26

您可以使用扩展方法对其进行配置:

var builder = new DbContextOptionsBuilder();

builder.UseSqlServer(connectionString);

configurator.UseEntityFrameworkCoreAuditStore(builder.Options, "AuditTableName");

You can use the extension method to configure it:

var builder = new DbContextOptionsBuilder();

builder.UseSqlServer(connectionString);

configurator.UseEntityFrameworkCoreAuditStore(builder.Options, "AuditTableName");

大众运输审计SQL DBContext问题

留蓝 2025-02-09 02:15:13
root@jenkins ~]# vim /usr/local/tomcat/conf/context.xml

添加

<Context>
.....
    <Loader jakartaConverter="TOMCAT" />
</Context>

然后在tomcat/bin中

./shutdown.sh
./startup.sh 
root@jenkins ~]# vim /usr/local/tomcat/conf/context.xml

add this

<Context>
.....
    <Loader jakartaConverter="TOMCAT" />
</Context>

then in tomcat/bin

./shutdown.sh
./startup.sh 

请求的资源[/jenkins]不可用

留蓝 2025-02-08 12:19:30

有趣的是,如果您不断向下看堆栈轨道,您会在底部发现此错误:

Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1005E: Type cannot be found 'String'

如果我将表达式更改为:

th:with="urls=${new java.lang.String[]{'/'}}"

一切都对我有效(用Spring Boot Starter 2.6.7进行了测试)。

Interestingly enough, if you keep looking down the stack track you find this error at the bottom:

Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1005E: Type cannot be found 'String'

If I change the expression to:

th:with="urls=${new java.lang.String[]{'/'}}"

Everything works again for me (tested with Spring Boot starter 2.6.7).

评估字符串阵列的弹簧表达式的异常

留蓝 2025-02-08 09:39:08

我要克隆该值,因为

问题是您要克隆记录,但是然后将引用存储到阵列中。由于这些是对克隆记录的引用,因此它们仅活到块结束。

因此,要么:

  • 移动 将属性从克隆(本质上是爆炸)
  • ,也不要使用记录的副本,而是将单个字段从基本vcf_record中复制出来

。您还可以滥用from_utf8_lossy:它始终返回一个参考词,因为它避免分配输入是否有效UTF8(在这种情况下,它基本上只是返回对原始数据的引用)。

I'm cloning the value because

The problem is that you're cloning the record but then you're storing references into your arrays. Since those are references to the cloned record, they only live until the end of the block.

So either:

  • move the attributes out of the clone (essentially explode it)
  • or rather than working with a copy of the record, copy individual fields out of the base vcf_record

Either way you're also misusing from_utf8_lossy: it always returns a reference-ish, because it avoids allocating if the input is valid utf8 (in that case it essentially just returns a reference to the original data).

处理克隆

留蓝 2025-02-08 03:07:51

查看是否可以进行以下内容并适应您的代码,因为这是接近但不完全想要的。

在DBContext

modelBuilder.HasDefaultSchema("dbo");

扩展方法

public static class EntityHelpers
{
    public static string GetTableNameWithScheme<T>(this DbContext context) where T : class
    {
        var entityType = context.Model.FindEntityType(typeof(T));
        var schema = entityType.GetDefaultSchema();
        return $"{schema ?? "(unknown)"}.{entityType.GetTableName()}";
    }
}

示例中

using var context = new YourContext();
Console.WriteLine(context.GetTableNameWithScheme<YourModel>());

See if you can take the following and adapt to your code as this is close but not exactly what you wanted.

In the dbContext

modelBuilder.HasDefaultSchema("dbo");

Extension method

public static class EntityHelpers
{
    public static string GetTableNameWithScheme<T>(this DbContext context) where T : class
    {
        var entityType = context.Model.FindEntityType(typeof(T));
        var schema = entityType.GetDefaultSchema();
        return 
quot;{schema ?? "(unknown)"}.{entityType.GetTableName()}";
    }
}

Example

using var context = new YourContext();
Console.WriteLine(context.GetTableNameWithScheme<YourModel>());

EF5如何从DBSET获取模式和表名称

留蓝 2025-02-08 01:30:07

可以作为回调函数需要这样的函数。

假设您的函数看起来像这样:

void do_something(int param1, char *param2, void (*callback)(void))
{
    // do something with param1 and param2
    callback();
}

此功能接收到随后调用的函数的指针。如果您不需要特别需要将此回调用于任何内容,那么您将传递一个无助的函数:

do_something(3, "test", Nothing);

Such a function could be necessary as a callback function.

Supposed you had a function that looked like this:

void do_something(int param1, char *param2, void (*callback)(void))
{
    // do something with param1 and param2
    callback();
}

This function receives a pointer to a function which it subsequently calls. If you don't particularly need to use this callback for anything, you would pass a function that does nothing:

do_something(3, "test", Nothing);

对无用的函数有任何实际用途吗?

留蓝 2025-02-07 23:31:29

正如 @ZX8754在注释中建议的那样,您可以使用Intersect这样的:

cols <- c('a','b', 'v')
output <- datf[intersect(names(datf), cols)]
output

输出:

  a b
1 1 4
2 2 3
3 3 4

As @zx8754 also suggested in the comments, you can use intersect like this:

cols <- c('a','b', 'v')
output <- datf[intersect(names(datf), cols)]
output

Output:

  a b
1 1 4
2 2 3
3 3 4

执行代码而不是投掷错误

留蓝 2025-02-07 11:40:44
.App {
  background-color: rgb(24, 24, 35);
  height: 100vh;
  width: 100vw;
  display: flex;
}

.innerBox{
  width: 600px;
  height: 300px;
  background-color: red;
  margin: auto;

  display: flex; 
  flex-direction: row;
}

.menu{
  background-color: blue;
  height: 60px;
  width: 300px;
    text-align: center;

}

.content
{
  background-color: orange;
  height: 60px;
    text-align: center;
  width: 300px;
}


/* add This Class*/
.innerBoxContent{
    display:flex;
    aling-item:center;
    justify-content:center;
    
}




import logo from "./logo.svg";
import "./App.css";

function App() {
  return (
    <div className="App">
      <div className="innerBox">
        <div className="innerBoxContent">
          <div className="menu">
            <h1>Menu</h1>
          </div>
          <div className="content">
            <h1>content</h1>
          </div>
        </div>
      </div>
    </div>
  );
}

export default App;
.App {
  background-color: rgb(24, 24, 35);
  height: 100vh;
  width: 100vw;
  display: flex;
}

.innerBox{
  width: 600px;
  height: 300px;
  background-color: red;
  margin: auto;

  display: flex; 
  flex-direction: row;
}

.menu{
  background-color: blue;
  height: 60px;
  width: 300px;
    text-align: center;

}

.content
{
  background-color: orange;
  height: 60px;
    text-align: center;
  width: 300px;
}


/* add This Class*/
.innerBoxContent{
    display:flex;
    aling-item:center;
    justify-content:center;
    
}




import logo from "./logo.svg";
import "./App.css";

function App() {
  return (
    <div className="App">
      <div className="innerBox">
        <div className="innerBoxContent">
          <div className="menu">
            <h1>Menu</h1>
          </div>
          <div className="content">
            <h1>content</h1>
          </div>
        </div>
      </div>
    </div>
  );
}

export default App;

Flexbox行不显示DIV

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

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