我从同一个表中的2个DB列中提取数据,以HTML格式填充下拉菜单.虽然我确实获得了两个数据,但我似乎无法用空格分隔它们.下面的代码是我这样做的一般尝试,但我尝试更改和省略空格的引号以及用单引号和双引号括起firstname和lastname.但似乎没有任何效果.到目前为止我离开了:Firstnamelastname.
<?php
//db connection
mysql_connect('localhost', 'root', "");
mysql_select_db('recy');
$sql = "SELECT CONCAT(firstname,' ',lastname) FROM technicians";
$result = mysql_query($sql);
echo "<select name='firstname',' ','lastname'>";
while ($row = mysql_fetch_array($result)) {
echo "<option value'" . $row['CONCAT(firstname,' ',lastname)'] . "'>" . ucwords($row['CONCAT(firstname,' ',lastname)']) . "</option>";
}
echo "</select>";
?>
Run Code Online (Sandbox Code Playgroud)
任何建议或建议表示赞赏.
我想制作一个矢量无缝 tiel 以在inkscape 中使用以应用于对象。我没有制作无缝瓷砖以导出为位图或 png 的问题,它们在 GIMP 中运行良好,但是当我按照制作无缝矢量瓷砖的指南时,a la:http : //tavmjong.free.fr/INKSCAPE/MANUAL/html /TilePattern.html我在瓷砖之间显示接缝。我还使用了彩色背景,这可能是问题的一部分,因为上面链接中的示例是用白色背景(与接缝颜色相同)完成的。
但有趣的是,大约一年前,我在inkscape、透明背景中制作了一些无缝图案,然后可以将其应用于透明对象并放置在我想要应用该图案的对象的顶部。但对于我的生活,我不记得我是怎么做到的。这实际上是最好的、最通用的解决方案,如果有人有一个链接到另一个 tut shouwing 如何制作这样的图案并将它们保存在inkscape中以与inkscape一起使用,我会很高兴阅读它。
====
编辑:
这个链接被证明对实现我想要的非常有用:http : //www.verysimpledesigns.com/vectors/inkscape-tutorial-seamless-patterns.html ?。它绕过了填充和阴影窗口中的整个inkscape 图案选择器,您可以创建您想要的任何大小的矢量平铺图案,然后将其剪辑到另一个对象上。完美且有用,可在未来重复使用。
似乎很奇怪,因为inkscape 中的这个bug 似乎可以追溯到11 年前,是的,11 年前没有更多具有类似解决方案的站点!!!嘘。我知道这是开源和免费的,但是拜托,平铺模式是一个相当普遍的要求,11 年忽略这样的错误似乎有点过头了。我想很多买不起 AI 的人会满足于光栅平铺模式,但没有必要。
我想为一个 atm 创建一个自动 GnuPG 密钥生成脚本,尽管他们运行 ubuntu,但使用 CLI 感觉不舒服。此外,其他人管理他们的计算机,使其保持最新状态并保持良好的运行状态,因此他们也没有 root/sudo 访问权限。我真的很想尝试并尽可能避免通过电话指示进行操作……去过太多次了,不知道那是什么 PITA!
因此,我大量借鉴了我在 gnupg.org 论坛上找到的示例(我认为?)来编写此脚本。gpg --gen-key --batch但一旦运行该命令,无论 3 或 4 分钟内生成多少鼠标活动,它似乎都不会执行任何操作。顺便说一句,所有 echo 语句只是指示脚本进度的临时方法,这并不是很远。
#!/bin/bash
# First run give your server some work, otherwise gpg won't be able to generator random bytes.
#sudo rngd -r /dev/urandom
#no sudo so:
echo -e "\nYou need to begin moving your mouse continuously and in random patterns for as long as it takes to generate a new key. This could take a minute or …Run Code Online (Sandbox Code Playgroud) 这是我要格式化的示例文本块:
<tr><td></td><td>tear a cat in, to make all split.</td><td></td></tr>
<tr><td></td><td class="tdci">The raging rocks</td><td></td></tr>
<tr><td></td><td class="tdci">The foolish Fates.</td></tr>
<tr><td></td><td>This was lofty! Now name the rest of the players.</td><td></td></tr>
Run Code Online (Sandbox Code Playgroud)
在脚本中使用这两个'sed'命令:
sed -ri '/^<tr><td><\/td><td>/N;s/(\n<tr><td><\/td><td class="tdci">)/\n<tr><td>\ <\/td><\/tr>\1/' "$f" #insert table row with empty data fields (blank line) above first line with 'class="tdci"'
sed -ri '/^<tr><td><\/td><td class="tdci">/N;s/(\n<tr><td><\/td><td>)/\n<tr><td>\ <\/td><\/tr>\1/' "$f" #insert table row with empty data fields (blank line) after last line with 'class="tdci"'
Run Code Online (Sandbox Code Playgroud)
这是结果:
<tr><td></td><td>tear a cat in, to make all split.</td><td></td></tr>
<tr><td> </td></tr>
<tr><td></td><td class="tdci">The raging rocks</td><td></td></tr> …Run Code Online (Sandbox Code Playgroud)