dd 相关问题


当我调用 Laravel 的 dd() 函数时,foreach() 循环停止迭代

当我像 dd($user->friends()); 那样调用 dd() (死掉并转储)时;我只得到集合中第一条记录的输出。 当我尝试做类似的事情时: foreach($user->friends() as $friend)...


当我调用 Laravel 的 dd() 函数时,脚本执行/foreach() 循环停止

当我像 dd($user->friends()); 那样调用 dd() (死掉并转储)时;我只得到集合中第一条记录的输出。 当我尝试做类似的事情时: foreach($user->friends() as $friend)...


如何通过比较两个日期来打印矩阵

我有一个 Excel 工作表,有两列的值采用“dd-mm-yyyy hh:mm”格式,即 DEP_DATE_TIME(F 列)和 ARR_DATE_TIME(J 列)。行具有相同的“dd-mm-


在 Blade 中显示 Laravel 的 dd() 结果,无需 die -> d(), dump()

我想以与 dd() 函数相同的样式显示会话的内容。 我尝试这样做: {!!转储(会话()->全部())!!} 我收到此错误: ...


dd() 仅显示第一个对象

在map()方法调用中,我想使用dd()来转储,但我只得到第一个对象。 当我在地图函数中使用 print_r() 时,我得到所有对象。 $valeurCategorieCible = $CategoriesItiner...


如何将 DMS 转换为给定格式的弧度:Python 中的 DD-MM-SS [已关闭]

我想知道如何将 DMS 从给定格式 DD-MM-SS 转换为弧度 这个“print (DMStoRAD(47-39-28))”的解应该是 0.831785 谢谢!


如何转换带有多余字符的字符串

如何转换带有多余字符的字符串 字符串 str =“文件-09-01-2024” 模式=“dd-MM-YYYY” 使用带有模式 =“dd-MM-YYYY”的 SimpleDateFormat 我不知道怎么办...


如何在 Laravel 项目中使用 DD() 方法?

我需要知道如何在 Laravel 项目中正确使用 dd() 函数。 例如 - 我有任务来调试我的项目(PHP /Laravel)中的一些代码和功能,这总是需要我


在哪里使用 dd() 函数来调试 Laravel 应用程序?

我需要知道如何在 Laravel 项目中正确使用 dd() 函数。 例如 - 我有任务来调试我的项目(PHP /Laravel)中的一些代码和功能,这总是需要我


Ruby:替换部分包括 $1 $2 $3 并保存在变量中,但使用 gsub 时不会发生插值

(a) 我写的代码。 $str = '909090 aa bb cc dd ee ff 00 12345678 aa bb 12345678 aa bb cc dd ee ff 00 11 22 33 123456 FE 89' 投入 $str $str.gsub!(/\s+/, '') search_1 = 'aa bb cc...


对象数组,不会在 laravel 中的 foreach 中循环

我不确定这真的是一个 Laravel 问题,但是,当我 dd(die and dump) 这个 dd($user->friends()); 时我得到以下信息。我确实注意到这是一个集合。我不确定这是否意味着什么


将 MySQL 时间戳格式化为 mm/dd/yyyy

我得到了一个 MySQL 12 位时间戳(253402214400),可以将其格式化为 mm/dd/yyyy,而无需使用任何语言。数据库字段是长文本类型,这就是我正在做的事情。 选择时间戳;返回...


使用 echo 或 var_dump 循环打印给出三个值,但 dd() 只给出第一个值

我的查询中有一个匹配的行。 echo $结果给出 100 dd($结果) 给出 1 var_dump($result) 给出 int(1) int(0) int(0) 这里发生了什么? 相关代码: $结果= DB::table('答案'...


日期范围 - 当日期保存为 varchar 格式时,检索日期范围内的值时出现问题:DD-MON-YY

在我无法控制的表中,我必须获取日期范围内的值。日期以 dd-mon-yy 的奇怪格式保存为 varchar,例如24 年 1 月 1 日。 我尝试过 TRUNC、TO_D 的组合...


为什么 DateTime.ParseExact 在解析字符串时会抛出异常?

此代码片段生成异常 字符串 t = @"11�3"; 字符串_fmt = @“MM\dd\yyyy”; DateTime l = DateTime.ParseExact(t, _fmt, CultureInfo.InvariantCulture); 例外...


为什么 DateTime.ParseExact 在解析这个文字字符串时会抛出异常?

此代码片段会生成异常: 字符串 t = @"11�3"; 字符串_fmt = @“MM\dd\yyyy”; DateTime l = DateTime.ParseExact(t, _fmt, CultureInfo.InvariantCulture); Exc...


Laravel 的 dd() 仅显示 foreach() 中的第一次迭代

我有像这样的sql命令 $kos = DB::select('SELECT team,round,SUM(points) AS 总积分 WHERE round="first" GROUP by team ORDER BY Total desc, run_rate desc limit 4'); 当我打电话时...


无法在 Typescript 中导出常量

有人可以帮助我吗 我有 2 个文件 main.ts 和 hi.ts 命中: 导出常量你好=“dd”; 主要.ts: 从“./hi”导入{hello}; ... A类{ 公共说你好(){ 控制台.log(“...


如何计算 CheckSum8 Modulo 256

我需要像这个网站一样计算校验和 https://www.scadacore.com/tools/programming-calculators/online-checksum-calculator/ 对于十六进制 313233343536373839 站点计算 DD 用我的函数我得到168,如何


Laravel foreach 循环仅显示带有 dd() 的第一个条目

这可能是一个奇怪的问题,但我需要你的帮助 我可能有一个包含值的数组。 foreach($users 作为 $user) { $name_user = //条件 array_push($firstarray, $name_user ); } 让我们...


Tinylog 中的滚动文件会覆盖每次应用程序启动时的日志文件

我在Kotlin 2.6.2版本中使用tinylog。 这是我的tinylog.properties 文件: writer2 = 滚动文件 writer2.level = 信息 writer2.file = #{tinylog.directory}/log_{日期:yyyy-MM-dd}.{动态:


如何删除第一个“|”对于记事本中选定的句子

我想删除第一个|出现在一些句子中。例如: 啊啊| bbb | ccc |dd | EE | FF gg |嗯|杰杰 |zz | xx |维维 我只想删除“|”在记事本中出现在


PySpark 3.5 中的字符串到日期格式

日期 '2020/12/01' 20201227 '2020/12/03' 无效的 '2020-12-13' 在日期列中,有这些类型的数据,我需要更改yyyy-MM-dd格式 我们如何在 Pyspark 中实现这一目标。 基础...


在 read_csv 中使用数据类型时列会被覆盖吗?

我有一个 example.csv,看起来像 列 1、列 2、d、e AA,1,BB,2 bb,2,aa,1 抄送,3,DD,3 我做 将极坐标导入为 pl 数据类型 = { '汽车':pl.String, '游戏':pl.Int32, '房子' : pl.String, ...


将所有日期的字符串日期快速转换为 R 日期

这个问题已经被问过好几次了,但没有明确的答案:我想将“YYYY-mm-dd”形式的 R 字符串转换为日期。 as.Date 函数非常慢。转换字符...


在 Javafx datepickerskin 上突出显示多天

我正在尝试创建一个小应用程序,让用户执行以下操作: 在文本字段中输入日期,格式为 dd/mm/yyyy 按按钮 显示所选日期并突出显示它加上前 5 个


使用 move-item 递归移动包含具有特定文本的文件的文件夹时出现访问被拒绝错误

我对此摸不着头脑,还没有找到任何可以让它发挥作用的东西。 我有一个具有 root1\yyyy\mm\dd\hh\uniqueid 结构的文件夹树,需要将 uniqueid 子文件夹移动到


如何使用 blazor <InputDate /> 标签使用当地文化来格式化日期

我正在我的 Blazor 应用程序中使用该标签。但是我如何使用我自己的文化来格式化日期? 我正在我的 Blazor 应用程序中使用该标签。但是我如何使用我自己的文化来格式化日期? <InputDate class="form-control" @bind-Value="@ValidDate" @bind-Value:culture="nl-BE" @bind-Value:format="dd/MM/yyyy" /> 问候 迪特尔 答案是@bind-Value:format,就像这样 @page "/" <EditForm Model="@CurrentPerson"> <InputDate @bind-Value="@CurrentPerson.DateOfBirth" @bind-Value:format="dd/MM/yyyy"/> </EditForm> @code { Person CurrentPerson = new Person(); public class Person { public DateTime DateOfBirth { get; set; } = DateTime.Now; } } 还可以选择使用bind-Value:culture。 无法设置InputDate或<input type="date">的格式。这取决于浏览器设置。用户可以更改浏览器的语言。但您无法从 HTML 更改它。如果您确实需要自定义格式,则必须使用InputText或<input type="text">。我建议使用一些 javascript 库,例如 jQuery UI datepicker。 该解决方案对我不起作用。我是这样工作的: @代码{ 仅私人日期? _geboortedatum; private string GeboortedatumFormatted { get => _geboortedatum?.ToString("dd-MM-yyyy") ?? ""; set { if (DateOnly.TryParse(value, out var newDate)) { _geboortedatum = newDate; } } } } 地质学 _geboortedatum" class="text-danger" />


显示输入类型日期的占位符文本

占位符不适用于直接输入类型日期和日期时间本地。 占位符不适用于直接输入类型 date 和 datetime-local。 <input type="date" placeholder="Date" /> <input type="datetime-local" placeholder="Date" /> 该字段在桌面上显示 mm/dd/yyy,而在移动设备上则不显示任何内容。 如何显示 Date 占位符文本? 使用onfocus="(this.type='date')",例如: <input required="" type="text" class="form-control" placeholder="Date" onfocus="(this.type='date')"/> 使用onfocus和onblur...这是一个例子: <input type="text" placeholder="Birth Date" onfocus="(this.type='date')" onblur="if(this.value==''){this.type='text'}"> 在这里,我尝试了 data 元素中的 input 属性。并使用 CSS 应用所需的占位符 <input type="date" name="dob" data-placeholder="Date of birth" required aria-required="true" /> input[type="date"]::before { content: attr(data-placeholder); width: 100%; } /* hide our custom/fake placeholder text when in focus to show the default * 'mm/dd/yyyy' value and when valid to show the users' date of birth value. */ input[type="date"]:focus::before, input[type="date"]:valid::before { display: none } <input type="date" name="dob" data-placeholder="Date of birth" required aria-required="true" /> 希望这有帮助 <input type="text" placeholder="*To Date" onfocus="(this.type='date')" onblur="(this.type='text')" > 这段代码对我有用。只需使用这个即可 对于 Angular 2,你可以使用这个指令 import {Directive, ElementRef, HostListener} from '@angular/core'; @Directive({ selector: '[appDateClick]' }) export class DateClickDirective { @HostListener('focus') onMouseFocus() { this.el.nativeElement.type = 'date'; setTimeout(()=>{this.el.nativeElement.click()},2); } @HostListener('blur') onMouseBlur() { if(this.el.nativeElement.value == ""){ this.el.nativeElement.type = 'text'; } } constructor(private el:ElementRef) { } } 并像下面一样使用它。 <input appDateClick name="targetDate" placeholder="buton name" type="text"> 对于 React,你可以这样做。 const onDateFocus = (e) => (e.target.type = "datetime-local"); const onDateBlur = (e) => (e.target.type = "text"); . . . <input onFocus={onDateFocus} onBlur={onDateBlur} type="text" placeholder="Event Date" /> 我是这样做的: var dateInputs = document.querySelectorAll('input[type="date"]'); dateInputs.forEach(function(input) { input.addEventListener('change', function() { input.classList.add('no-placeholder') }); }); input[type="date"] { position: relative; } input[type="date"]:not(.has-value):before { position: absolute; left: 10px; top: 30%; color: gray; background: var(--primary-light); content: attr(placeholder); } .no-placeholder:before{ content:''!important; } <input type="date" name="my-date" id="my-date" placeholder="My Date"> 现代浏览器使用 Shadow DOM 来方便输入日期和日期时间。因此,除非浏览器出于某种原因选择回退到 text 输入,否则不会显示占位符文本。您可以使用以下逻辑来适应这两种情况: ::-webkit-calendar-picker-indicator { @apply hidden; /* hide native picker icon */ } input[type^='date']:not(:placeholder-shown) { @apply before:content-[attr(placeholder)]; @apply sm:after:content-[attr(placeholder)] sm:before:hidden; } input[type^='date']::after, input[type^='date']::before { @apply text-gray-500; } 我使用了 Tailwind CSS 语法,因为它很容易理解。让我们一点一点地分解它: ::-webkit-calendar-picker-indicator { @apply hidden; /* hide native picker icon */ } 使用其 Shadow DOM 伪元素选择器隐藏本机选择器图标(通常是日历)。 input[type^='date']:not(:placeholder-shown) { @apply before:content-[attr(placeholder)]; @apply sm:after:content-[attr(placeholder)] sm:before:hidden; } 选择所有未显示占位符的 date 和 datetime-local 输入,并且: 默认使用 placeholder 伪元素显示输入 ::before 文本 在小屏幕及以上屏幕上切换为使用 ::after 伪元素 input[type^='date']::after, input[type^='date']::before { @apply text-gray-500; } 设置 ::before 和 ::after 伪元素的样式。


Spring boot + slf4j + log4j + 类 org.apache.logging.slf4j.SLF4JLoggerContext 无法转换为类

我有Spring boot 2.3.1 pom.xml 我有Spring boot 2.3.1 pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.3.1.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>logger</groupId> <artifactId>logger</artifactId> <version>0.0.1-SNAPSHOT</version> <name>logger</name> <description>Demo project for Spring Boot</description> <properties> <java.version>11</java.version> <lombok.version>1.18.12</lombok.version> <log4j.version>1.2.17</log4j.version> <slf4j.version>1.7.30</slf4j.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <artifactId>logback-classic</artifactId> <groupId>ch.qos.logback</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>${lombok.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>${slf4j.version}</version> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>${log4j.version}</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> </project> 班级 @Slf4j @SpringBootApplication public class LoggerApplication { public static void main(String[] args) { log.info("++++++++++++++++++++++++TEST+++++++++++++++++++++++++++++"); SpringApplication.run(LoggerApplication.class, args); } } 应用程序.属性 logging.config=classpath:log4j.properties log4j.properties log4j.rootLogger=INFO, console log4j.appender.console=org.apache.log4j.ConsoleAppender log4j.appender.console.Target=System.out log4j.appender.console.layout=org.apache.log4j.PatternLayout log4j.appender.console.layout.conversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p - %m%n 我尝试寻找解决方案,查看论坛上的类似主题,尝试各种排除依赖项的选项。 线程“main”中的异常 java.lang.ClassCastException:类 org.apache.logging.slf4j.SLF4JLoggerContext 无法转换为类 org.apache.logging.log4j.core.LoggerContext (org.apache.logging.slf4j.SLF4JLoggerContext 和 org.apache.logging.log4j.core.LoggerContext 位于未命名模块中 加载器“应用程序”)位于 我还尝试排除一些依赖项 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <artifactId>logback-classic</artifactId> <groupId>ch.qos.logback</groupId> </exclusion> <exclusion> <groupId>log4j</groupId> <artifactId>*</artifactId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>*</artifactId> </exclusion> <exclusion> <groupId>org.apache.logging.log4j</groupId> <artifactId>*</artifactId> </exclusion> </exclusions> </dependency> 但又出现错误,但现在无法再格式化日志了。 2021-01-13 19:12:15,881 信息 - ++++++++++++++++++++++++测试+++++++++++++++++++++++++++++++ 错误 StatusLogger 无法识别的格式说明符 [d] 错误 StatusLogger 无法识别的转换说明符 [d] 从转换模式中的位置 16 开始。 错误 StatusLogger 无法识别的格式说明符 [线程] 错误 StatusLogger 无法识别的转换说明符 [线程] 从转换模式中的位置 25 开始。 错误 StatusLogger 无法识别的格式说明符 [级别] 错误 StatusLogger 无法识别的转换说明符 [level] 从转换模式中的位置 35 开始。 ... 错误 StatusLogger 无法识别的格式说明符 [n] 错误 StatusLogger 无法识别的转换说明符 [n] 从转换模式中的位置 56 开始。 警告:不支持 sun.reflect.Reflection.getCallerClass。这会影响性能。 任何人都可以有任何想法如何解决它吗? 我找到了解决这个问题的方法。事实证明,问题出在其中一个私有库(elastik 的附加程序)的冲突上。 我执行了命令: mvn dependency:tree 然后找到传递依赖项,并将它们排除在所有类的路径上,以排除日志记录所需的库冲突。 pom.xml <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <artifactId>logback-classic</artifactId> <groupId>ch.qos.logback</groupId> </exclusion> <exclusion> <artifactId>log4j-to-slf4j</artifactId> <groupId>org.apache.logging.log4j</groupId> </exclusion> </exclusions> </dependency> <dependency> <artifactId>springfox-boot-starter</artifactId> <groupId>io.springfox</groupId> <version>3.0.0</version> <exclusions> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>${lombok.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>${log4j.version}</version> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> <version>${version.log4j.core}</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>${slf4j.version}</version> </dependency>


© www.soinside.com 2019 - 2024. All rights reserved.