小编Par*_*o63的帖子

在移动设备中看不到引导程序导航栏切换按钮

我在我的网站上使用twitter Bootstrap,它上面有一个固定的导航栏.当我在桌面浏览器中调整窗口大小时,一切都很好.当我在移动设备上打开同一个站点时,我可以看到navbar-brand但不能切换按钮.我发布截图以便更好地理解(第一个是桌面firefox,第二个是android):

这是桌面浏览器调整大小 和移动截图 这真让我抓狂!!!

代码:

.navbar-floating {
  background: black;
  color: #5b5656;
  width: 100%;
  border-radius: 0;
}
.navbar-floating .navbar-brand {
  color: #810000;
  font-size: 20px;
  text-transform: uppercase;
}
.navbar-floating .navbar-brand:after {
  content: ' | ';
  color: #810000;
  position: relative;
  top: -3px;
}
#floating-nav {
  position: fixed;
  /* display: none; */
  top: 0;
  width: 100%;
  height: 50px;
}
#floating-nav.navbar {
  min-height: 1px;
}
#floating-nav ul li a {
  font-size: 20px;
}
#floating-nav ul li a:hover {
  background: none;
}
Run Code Online (Sandbox Code Playgroud)
<link rel="stylesheet" type="text/css" …
Run Code Online (Sandbox Code Playgroud)

html javascript css jquery twitter-bootstrap

6
推荐指数
1
解决办法
1万
查看次数

UTF-8 在 Tomcat 服务器中运行的 Java 应用程序中不起作用

我正在开发一个 Java 应用程序。我需要在 Java Web 应用程序中获取 UTF-8 编码以支持孟加拉语 (\xe0\xa6\xac\xe0\xa6\xbe\xe0\xa6\x82\xe0\xa6\xb2\xe0\xa6\xbe) 文本。我做了以下事情:

\n

Tomcat的server.xml

\n
<Connector port="8080"\n    protocol="HTTP/1.1"\n    connectionTimeout="20000"\n    redirectPort="8443"\n    URIEncoding="UTF-8" />\n\n<Connector executor="tomcatThreadPool"\n    port="8080"\n    protocol="HTTP/1.1"\n    connectionTimeout="20000"\n    redirectPort="8443"\n    URIEncoding="UTF-8" />\n\n<Connector protocol="AJP/1.3"\n    address="::1"\n    port="8009"\n    redirectPort="8443"\n    URIEncoding="UTF-8" />\n
Run Code Online (Sandbox Code Playgroud)\n

catalina.bat 文件中的 JVM defaultCharset

\n
set JAVA_OPTS=%JAVA_OPTS% -Dfile.encoding=UTF-8\n
Run Code Online (Sandbox Code Playgroud)\n

application.properties 中的属性

\n
spring.datasource.url=jdbc:mysql://localhost:3306/database_name?useUnicode=true\\&characterEncoding=UTF-8\nspring.datasource.tomcat.connection-properties=useUnicode=true;characterEncoding=UTF-8\n\nspring.http.encoding.charset=UTF-8\nspring.http.encoding.enabled=true\nspring.http.encoding.force=true\n\nserver.tomcat.uri-encoding=UTF-8\nspring.webflux.multipart.headers-charset=UTF-8\nspring.thymeleaf.encoding=UTF-8\n
Run Code Online (Sandbox Code Playgroud)\n

html 文件中的元标记

\n
<!doctype html>\n<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/extras/spring-security">\n    <head>\n        <meta charset="utf-8">\n    </head>\n\n    <body>\n    </body>\n</html>\n
Run Code Online (Sandbox Code Playgroud)\n

表单标签支持 utf-8

\n
<form enctype="multipart/form-data" accept-charset="UTF-8" action="#" th:action="@{/create}" th:object="${object}" th:method="POST">\n    <div class="form-group">\n        <label for="name" class="col-form-label">Name</label>\n        <input type="text" …
Run Code Online (Sandbox Code Playgroud)

java encoding tomcat utf-8 spring-boot

6
推荐指数
2
解决办法
4324
查看次数

如何比较来自 PySpark 数据帧的记录

我想比较 2 个数据框,我想根据以下 3 个条件提取记录。

  1. 如果记录匹配,则“SAME”应出现在新列 FLAG 中。
  2. 如果记录不匹配,如果它来自 df1(假设为 No.66),则 'DF1' 应出现在 FLAG 列中。
  3. 如果记录不匹配,如果它来自 df2(假设为 No.77),则 'DF2' 应出现在 FLAG 列中。这里需要考虑和验证整个RECORD。记录明智的比较。
    此外,我需要使用 PySpark 代码检查数百万条记录。

df1:

No,Name,Sal,Address,Dept,Join_Date
11,Sam,1000,ind,IT,2/11/2019
22,Tom,2000,usa,HR,2/11/2019
33,Kom,3500,uk,IT,2/11/2019
44,Nom,4000,can,HR,2/11/2019
55,Vom,5000,mex,IT,2/11/2019
66,XYZ,5000,mex,IT,2/11/2019
Run Code Online (Sandbox Code Playgroud)

df2:

No,Name,Sal,Address,Dept,Join_Date
11,Sam,1000,ind,IT,2/11/2019
22,Tom,2000,usa,HR,2/11/2019
33,Kom,3000,uk,IT,2/11/2019
44,Nom,4000,can,HR,2/11/2019
55,Xom,5000,mex,IT,2/11/2019
77,XYZ,5000,mex,IT,2/11/2019
Run Code Online (Sandbox Code Playgroud)

预期输出:

No,Name,Sal,Address,Dept,Join_Date,FLAG
11,Sam,1000,ind,IT,2/11/2019,SAME
22,Tom,2000,usa,HR,2/11/2019,SAME
33,Kom,3500,uk,IT,2/11/2019,DF1
33,Kom,3000,uk,IT,2/11/2019,DF2
44,Nom,4000,can,HR,2/11/2019,SAME
55,Vom,5000,mex,IT,2/11/2019,DF1
55,Xom,5000,mex,IT,2/11/2019,DF2
66,XYZ,5000,mex,IT,2/11/2019,DF1
77,XYZ,5000,mex,IT,2/11/2019,DF2
Run Code Online (Sandbox Code Playgroud)

我加载了如下所示的输入数据,但不知道如何继续。

df1 = pd.read_csv("D:\\inputs\\file1.csv")

df2 = pd.read_csv("D:\\inputs\\file2.csv")
Run Code Online (Sandbox Code Playgroud)

任何帮助表示赞赏。谢谢。

python-3.x apache-spark-sql pyspark

3
推荐指数
1
解决办法
4765
查看次数

Spring Boot 2.2.0.RELEASE 未映射 thymeleaf 放置和删除请求

从 Spring Boot 2.1.6.RELEASE 升级到 2.2.0.RELEASE 后,在嵌入式 Tomcat 上执行放置和删除时,我的基于 Thymeleaf 的页面失败。获取和发布工作正常。

我在 Chrome 开发者工具中看到正在发送以下请求:

请求网址:https://localhost:8443/notifications/1 请求方法:POST

请求正文包含 _method="put" 和 _csrf 令牌。

有趣的是,我的集成测试(用 @SpringBootTest 注释)正在通过。

Spring Boot Actuator 显示 /notifications/{notificationId} 已映射到 PUT。

切换回 2.1.6.RELEASE 可以解决该问题。

我的 Thymeleaf 表单定义如下:

<form id="notificationForm" th:action="@{/notifications/{notificationId}(notificationId=${notification.id})}" th:object="${notification}" th:method="put" class="needs-validation" novalidate autocomplete="off">
Run Code Online (Sandbox Code Playgroud)

我的控制器方法注释如下:

  @PutMapping("/notifications/{notificationId}")
  public String updateNotification(@PathVariable("notificationId") final Long notificationId,
      @Valid @ModelAttribute(name = NOTIFICATION_MODEL_ATTRIBUTE) final NotificationDto notificationDto,
      final BindingResult result, final Model model, final RedirectAttributes attributes) 
Run Code Online (Sandbox Code Playgroud)

当我执行删除时,控制台中会显示以下堆栈跟踪:

org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'POST' not supported
    at org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping.handleNoMatch(RequestMappingInfoHandlerMapping.java:201)
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.lookupHandlerMethod(AbstractHandlerMethodMapping.java:421) …
Run Code Online (Sandbox Code Playgroud)

thymeleaf spring-boot

3
推荐指数
1
解决办法
2469
查看次数