我有下面的图片框,我用条形码填充,然后尝试打印。
这是代码:
private void button1_Click(object sender, EventArgs e)
{
printDocument1.OriginAtMargins = true;
printDocument1.DocumentName = "TEST IMAGE PRINTING";
printDialog1.Document = printDocument1;
printDialog1.ShowDialog();
printDocument1.Print();
}
private void printDocument1_PrintPage_1(object sender, PrintPageEventArgs e)
{
System.Drawing.Graphics formGraphics = System.Drawing.Graphics.FromImage(picpdf417.Image);
}
Run Code Online (Sandbox Code Playgroud) 步骤 1:生成 25 位十进制数字的 Pi 并将其保存到 output.txt 文件中。
from decimal import *
#Sets decimal to 25 digits of precision
getcontext().prec = 25
def factorial(n):
if n<1:
return 1
else:
return n * factorial(n-1)
def chudnovskyBig(): #http://en.wikipedia.org/wiki/Chudnovsky_algorithm
n = 1
pi = Decimal(0)
k = 0
while k < n:
pi += (Decimal(-1)**k)*(Decimal(factorial(6*k))/((factorial(k)**3)*(factorial(3*k)))* (13591409+545140134*k)/(640320**(3*k)))
k += 1
pi = pi * Decimal(10005).sqrt()/4270934400
pi = pi**(-1)
file = open('output.txt', 'w', newline = '')
file.write(str(Decimal(pi)))
file.close()
print("Done.")
#return pi
chudnovskyBig()
Run Code Online (Sandbox Code Playgroud)
步骤 2:我打开此文件并使用正则表达式查找特定字符串的所有匹配项。
import …Run Code Online (Sandbox Code Playgroud) 今天,我使用 SQLyog Community Edition 创建了一个表的 SQL 备份。然后我尝试针对 Digital Ocean 上最新的 MySQL 8 托管数据库运行创建的查询。
查询:
CREATE TABLE tblUsers (
id bigint unsigned NOT NULL AUTO_INCREMENT,
subscriberId bigint unsigned DEFAULT NULL,
user varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
password varchar(64) DEFAULT NULL,
created timestamp NULL DEFAULT NULL,
modified timestamp NULL DEFAULT NULL,
status varchar(16) DEFAULT NULL,
privilege varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
firstName varchar(64) DEFAULT NULL,
lastName varchar(64) DEFAULT NULL,
address1 varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci …Run Code Online (Sandbox Code Playgroud) 我试图找出为什么我可以让我的实时搜索工作但它返回mysql表的所有结果,无论我输入什么.也许你可以帮忙吗?
我正在尝试获取上一个请求并在每个keyup上启动一个新请求.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Help Tool 2.0</title>
<link type="text/css" rel="stylesheet" href="assets/css/index.css" />
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
</head>
<body>
<script type="text/javascript">
$(function(){
$('#search-box').keyup(function() {
$("#results").html('');
var xhr;
var keywords = $(this).val();
if(xhr != null) xhr.abort();
xhr = $.get("search.php", {q: keywords}, function() {
//alert("success");
})
.success(function(data) {
xhr = null;
//alert("second success");
$("#results").html(data);
})
});
});
</script>
<input id="search-box" name="q" type="text" />
<div id="results"></div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
和PHP:
<?php
include_once ('database_connection.php');
if(isset($_GET['q'])){
$keyword = trim($_GET['q']) …Run Code Online (Sandbox Code Playgroud) 我有一个评论框,基本上是一个textarea.我将cols属性设置为113 cols,它在Firefox中看起来不错,但在chrome或IE9中却看起来不错.
然后我将字体更改为固定宽度字体,并且所有3个浏览器都正确显示它.关于它的事情是,它只是丑陋.
你有什么想法,为什么它只能正确计算Firefox中的列宽而不是其他列的宽度?
谢谢.
这是CSS:
#wrap_mid #nav_body .entry_container .comment_new_container .ta_new_comment
{
border: 1px solid #d5d5d5;
border-radius: 3px;
color: #999;
font-family: Arial, Helvetica, sans-serif;
font-size: small;
padding: 3px 4px;
width: 795px;
resize: none;
}
Run Code Online (Sandbox Code Playgroud)
这是HTML:
<div class="comment_new_container">
<img src="img/avatar45.png" />
<textarea class="ta_new_comment" cols="113" rows="0">Write a comment...</textarea>
<!-- Float fix -->
<div class="clear"> </div>
</div> <!-- END comment_new_container -->
Run Code Online (Sandbox Code Playgroud)
这是JQuery:
<script type="text/javascript">
$(function(){
$(".ta_new_comment").autoGrow();
});
</script>
Run Code Online (Sandbox Code Playgroud)
这是JQuery插件:
/*!
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* <jevin9@gmail.com> wrote this file. As …Run Code Online (Sandbox Code Playgroud) 我正在制作一个聊天程序,并决定使用Tkinter作为界面。
我想在C#中轻轻松松,但是Tkinter对我来说是新的。
基本上,我有一个带有Entry控件和Text控件的表单。
我想知道如何在用户按下Enter键后将文本从Entry控件追加到Text控件。
到目前为止,这是我的代码:
from tkinter import *
class Application:
def hello(self):
msg = tkinter.messagebox.askquestion('title','question')
def __init__(self, form):
form.resizable(0,0)
form.minsize(200, 200)
form.title('Top Level')
# Global Padding pady and padx
pad_x = 5
pad_y = 5
# create a toplevel menu
menubar = Menu(form)
#command= parameter missing.
menubar.add_command(label="Menu1")
#command= parameter missing.
menubar.add_command(label="Menu2")
#command= parameter missing.
menubar.add_command(label="Menu3")
# display the menu
form.config(menu=menubar)
# Create controls
label1 = Label(form, text="Label1")
textbox1 = Entry(form)
#command= parameter missing.
button1 = Button(form, text='Button1')
scrollbar1 = …Run Code Online (Sandbox Code Playgroud) 首先,我想让人们知道,虽然有类似的问题标记为:
Google Charts API:始终在图表中显示数据点值
...在网站上,我似乎无法使用它的解决方案,因为我的图表是使用arrayToDataTable提供的.
这是我的代码:
function drawChart1998() {
var data = google.visualization.arrayToDataTable([
['Year', 'Index Trend'],
['1/3', 1236777],
['1/7', 834427],
['1/10', 2164890],
['1/14', 1893574],
['1/17', 2851881],
['1/21', 359504],
['1/24', 2264047],
['1/28', 3857933],
['1/31', 2197402],
['2/4', 2469935],
['2/7', 1651752],
['2/11', 4710582],
['2/14', 1565803],
['2/18', 345499],
['2/21', 2817319],
['2/25', 733242],
['2/28', 1485788],
['3/4', 1091181],
['3/7', 4477498],
['3/11', 490931],
['3/14', 3905556],
['3/18', 475417],
['3/21', 1512729],
['3/25', 1782796],
['3/28', 4778434]
]);
var options = {
curveType: "function",
title: '1998 Results',
vAxis: {viewWindow: …Run Code Online (Sandbox Code Playgroud) 我刚刚下载了flatpickr,它是 JavaScript 中的日期时间选择器。
我试图弄清楚如何使用两个日期时间选择器,它们需要相互依赖以避免数据范围选择错误。
到目前为止我有:
确保用户只能选择 2019 年的日期。inputText1 的时间始终为 00:00:00。
去做:
使用 inputText1 onChange 事件将 inputText2 minDate 设置为等于 inputText1 minDate。
inputText2 时间必须始终以 23:59:59 结束
$(document).ready(function(){
$("#inputText1").flatpickr({
minDate: "2019-01",
maxDate: "2019-12",
dateFormat: "Y-m-d H:i:S",
// When this input changes, we set a min start date for input2 always equal or greater than from date.
onChange: function(selectedDates, dateStr, instance) {
$("#reportFromCustom").html(dateStr);
// Any ideas?
//$("#inputText2").flatpickr({ minDate: dateStr });
}
});
$("#inputText2").flatpickr({
dateFormat: "Y-m-d 23:59:59", …Run Code Online (Sandbox Code Playgroud)以下代码返回结果集的字段名称。我也希望它返回值。我怎样才能做到这一点?
while ($row = mysqli_fetch_assoc($result)) {
foreach( $row as $field => $name) {
echo $field."<br>";
}
}
Run Code Online (Sandbox Code Playgroud)