我正在编写一个分析html文件的bash脚本,我想获取每个单元的内容<tr>...</tr>.所以我的命令看起来像:
$ tr -d \\012 < price.html | grep -oE '<tr>.*?</tr>'
Run Code Online (Sandbox Code Playgroud)
但它似乎grep给了我以下结果:
$ tr -d \\012 < price.html | grep -oE '<tr>.*</tr>'
Run Code Online (Sandbox Code Playgroud)
我怎么能.*不贪心?
我有一个使用该类的 LaTeX 文档
\documentclass[12pt,a4paper]{scrbook}
Run Code Online (Sandbox Code Playgroud)
我更改了一些用于定位浮动的参数:
\renewcommand{\topfraction}{1} %default: 0.7
\renewcommand{\bottomfraction}{1} %default: 0.3
\renewcommand{\textfraction}{0.1} %default: 0.2
\renewcommand{\floatpagefraction}{1} %default: 0.6
\setcounter{topnumber}{3}
\setcounter{bottomnumber}{3}
Run Code Online (Sandbox Code Playgroud)
我有两个图形,它们应该彼此放在一起并填充一页。我不知道为什么,但是因为 LaTeX 总是将两个图形分割在两个页面上,所以我将两个图形放入一个figure环境中。[ht]无论我使用还是[p]带有两个图形的图形移动到本章末尾都没有关系。我没有收到任何过度警告。所以我认为这可能不是这个数字太大的原因。
\begin{figure}[p]
\centering
\includegraphics{graphic1.pdf}
\newcaption{caption 1} % <-- using \usepackage{picins}
\label{fig:pic1}
\vspace{5mm}
\includegraphics{graphic2.pdf}
\newcaption{caption 2}
\label{fig:pic2}
\end{figure}
Run Code Online (Sandbox Code Playgroud)
有没有人可以解释 LaTeX 的行为并推荐一个解决方案。
我是编程chrome扩展的新手,这将是我的第一个扩展.
我想要的:现在我想为页面做一个pageAction,如果显示某个html标签.要做一个pageAction,似乎我必须知道当前选项卡的TabID,所以我尝试了这个,这不起作用(参见代码中的注释):
manifest.json(工作正常,只是为了向您展示我的清单的样子)
{
"manifest_version":2,
"name":"ExtensionName",
"description":"Description",
"version":"1.0",
"page_action":{
"default_icon":"icon.png",
},
"content_scripts":[
{
"matches":[
"http://www.domain.com/page.aspx"
],
"js":["searchTag.js"],
"run_at":"document_idle",
"all_frames":false
}
]
}
Run Code Online (Sandbox Code Playgroud)
searchTag.js(代码或多或少像Arithmomaniac一样回答如何从后台页面获取当前tabId)
if (document.getElementById("idIWant")) {
var currentTab;
alert(currentTab); //this works and gives an alert with "undefined"
//now the alert in the function callback doesn't work
chrome.tabs.query(
{currentWindow: true, active: true},
function(tabArray) {
alert(tabArray[0].id);
currentTab = tabArray[0].id;
}
)
}
Run Code Online (Sandbox Code Playgroud)
那我的代码出了什么问题?看来我没有正确使用chrome.tabs.query(),但我没有看到它.
我找到了几个关于这个任务的线程,但是所有这些都没有真正帮助我,或者我没有足够的经验来理解它.
我正在使用mysql并有两个表user和user_rh.我想要一个用户名的列表(按名称排序),其中包含相应的条目数user_rh.
`user` `user_rh`
------------------ ------------------
| `uid` | `name` | | `uid` | `zaid` |
------------------ ------------------
| 1 | Bob | | 2 | 4 |
| 2 | John | | 2 | 7 |
| 3 | Fred | | 3 | 2 |
| 4 | Peter | ------------------
------------------
Run Code Online (Sandbox Code Playgroud)
所以结果应该是这样的:
--------------------
| `name` | `count` |
--------------------
| Bob | 0 |
| Fred | 1 |
| …Run Code Online (Sandbox Code Playgroud)