AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-1982032

showkey's questions

Martin Hope
showkey
Asked: 2025-02-13 07:42:24 +0800 CST

如何按特定行对文件进行排序并保留标题?

  • 6

raw txt 文件包含以下行:

cat raw.txt
ID         DESCRIPTION
-----      --------------
2          item2
4          item4
1          item1
3          item3

如何按照ID以下格式重新排序?

ID         DESCRIPTION
-----      --------------
1          item1
2          item2
3          item3
4          item4

尝试过sort -n:

cat  raw.txt |sort -n
-----      --------------
ID         DESCRIPTION
1          item1
2          item2
3          item3
4          item4

虚线排在第一行,怎样才能让它排在第二行呢?

shell
  • 1 个回答
  • 19 Views
Martin Hope
showkey
Asked: 2024-12-20 13:15:01 +0800 CST

如何使用 VBA 代码将所有部分列导出为 pdf 文件?

  • 5

sample.xlsx请从我的 dropbox下载。https
://www.dropbox.com/scl/fi/dm7okj2j5l2onlq2lmd6m/sample.xlsx ?rlkey=obm03i1ysexnajay1zzv2jddy&st=tan1kkj1&dl=0

它包含简单数据。 我想使用 VBA 代码将所有列导出到:
在此处输入图片描述
sample.xlsxsample.xlsx

Sub pdf()
    Dim wb As Workbook
    Dim ws As Worksheet
    Dim saveLocation As String
    templePath = "d:\sample.xlsx"
    Set wb = Workbooks.Open(templePath)
    Set ws = wb.Sheets(1)
    With ws.PageSetup
        .Orientation = xlLandscape
    End With
    saveLocation = "d:\sample.pdf"
    ws.ExportAsFixedFormat Type:=xlTypePDF, Filename:=saveLocation
    wb.Close SaveChanges:=False
    Set wb = Nothing
    Set ws = Nothing 
End Sub

该设置.Orientation = xlLandscape无法使所有列都保存sample.pdf。

在此处输入图片描述

如何使用 VBA 代码将所有部分列导出为 pdf 文件?

在此处输入图片描述
在此处输入图片描述

excel
  • 1 个回答
  • 49 Views
Martin Hope
showkey
Asked: 2024-10-20 10:45:19 +0800 CST

为什么不能用getopt赋值?

  • 5

这是我的test.sh:

#!/usr/bin/env bash
arg="default"
TEMP=$(getopt --long been: -n 'test.sh' -- "$@")
eval set -- "$TEMP"
while true ; do
    case "$1" in
        --been)
            echo 'in been option'
            arg="$2"
            shift;;
        --)
            echo 'in the end' 
            shift ; break ;;
    esac
done
echo "$arg"

为 分配值arg:

bash  ./test.sh  --been=xxyyzz
in the end
default

为什么得不到结果>?

bash  ./test.sh  --been=xxxx
in been option
xxxx
bash
  • 1 个回答
  • 42 Views
Martin Hope
showkey
Asked: 2024-10-06 14:17:48 +0800 CST

为什么无法在本地托管我自己的 MathJax 副本?

  • 5

使用 cdn 服务在 html 中呈现 latex。

   <!DOCTYPE html>
   <html>
   <head>
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width">
   <script type="text/javascript" async
     src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML">
   </script>
   <script type="text/x-mathjax-config">
   MathJax.Hub.Config({
     tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]},
   });
   </script>
   </head>
   <body>
   First of all, we can "relax" the $\forall$-Introduction rule : $A \to B \vdash A \to \forall x B$, provided that $x$ is not *free* in $A$.
   </body>
   </html>

所有乳胶都可以在 html 中正常显示。 在此处输入图片描述

我想在本地部署mathjax服务。

直接下载MathJax.js,MathJax.js可以通过以下链接打开:127.0.0.1/wp/MathJax.js,设置src如下:

<script type="text/javascript" async
     src="http://127.0.0.1/wp/MathJax.js?config=TeX-MML-AM_CHTML">
</script>

latex無法顯示。 在此处输入图片描述

可能有些有用的文件还没有下载,所以我把所有的mathjax的文件都git一下,以mathjax官方文档( mathjax official document )为代表,然后把它们全部复制到apache的文档目录中。

git clone https://github.com/mathjax/MathJax.git mathjax

tex-chtml可以在url中打开http://127.0.0.1/mathjax/es5/tex-chtml.js,写入html:

   <!DOCTYPE html>
   <html>
   <head>
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width">
   <script type="text/javascript" async
     src="http://127.0.0.1/mathjax/es5/tex-chtml.js?config=TeX-MML-AM_CHTML">
   </script>
   <script type="text/x-mathjax-config">
   MathJax.Hub.Config({
     tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]},
   });
   </script>
   </head>
   <body>
   First of all, we can "relax" the $\forall$-Introduction rule : $A \to B \vdash A \to \forall x B$, provided that $x$ is not *free* in $A$.
   </body>
   </html>

重新启动我的 apache,firefox 的调试中没有错误信息,但是该行尚未被 mathjax 呈现。

在此处输入图片描述

如何修复?

javascript
  • 1 个回答
  • 38 Views
Martin Hope
showkey
Asked: 2024-10-01 10:38:42 +0800 CST

如何在 Sphinx reST 中写入该行?

  • 5

我想在我的 Sphinx reST 文档中写入如下简单的一行:
在此处输入图片描述

要使用标志写入行:math::

We know that :math:`A \to B \vdash A \to \forall x B`, provided that :math:`x` is not free in :math:`A`.

之后浏览器中显示的外观make html:

在此处输入图片描述

如何才能让它成为一行而没有换行符?
我想使用重组文本语法调整行以获得所需的外观,而不是调整 html 或 css 代码。

html
  • 1 个回答
  • 40 Views
Martin Hope
showkey
Asked: 2024-01-26 19:02:41 +0800 CST

除法的结果是什么数据类型?

  • 6

列出 postgres 中的 round 函数:

\df  round
                         List of functions
   Schema   | Name  | Result data type | Argument data types | Type 
------------+-------+------------------+---------------------+------
 pg_catalog | round | double precision | double precision    | func
 pg_catalog | round | numeric          | numeric             | func
 pg_catalog | round | numeric          | numeric, integer    | func

round 的参数必须是双精度、数字、整数。

select  6::float/3.3 as number;
       number       
--------------------
 1.8181818181818183
(1 row)

如果其数据类型是双精度:

select  round(6::float/3.3,4) as number;
ERROR:  function round(double precision, integer) does not exist
LINE 1: select  round(6::float/3.3,4) as number;
                ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
Time: 0.517 ms

除法的结果是哪种数据类型---- 1.8181818181818183?

postgresql
  • 1 个回答
  • 31 Views
Martin Hope
showkey
Asked: 2024-01-13 09:57:25 +0800 CST

如何在 pgsql 的 \copy 命令中使用变量?

  • 5

在我的 postgresql 的 shell 中,将变量的值设置为“2023-11-01”:

\set date  '2023-11-01'

叫它 :

\echo :'date'
'2023-11-01'
\echo :date
2023-11-01

在选择中使用它

select * from quote where date=:'date';

当日期为时2023-11-01,它输出报价中的所有记录,我想将所有记录复制到/tmp/records.csv:

\copy (select * from quote where date=:'date')  to '/tmp/result.csv' 
ERROR:  syntax error at or near ":"
LINE 1: COPY  ( select * from quote where date=: 'date' ) TO STDOU...

同样的错误:

\copy (select * from quote where date=:date)  to '/tmp/result.csv' 

如何修复它?

postgresql
  • 1 个回答
  • 30 Views
Martin Hope
showkey
Asked: 2024-01-07 10:54:58 +0800 CST

如何在psql中用declare或with子句包装表达式?

  • 5

使用 psql 变量在集合中存储表达式:

\set vix round(100*(high/nullif(low,0)-1),2)

在 select 中调用变量:

select  :vix as vix from quote 
    where date='2023-12-08'  and :vix is not null 
    order by :vix desc  
    limit 10;

它打印如下输出:

   vix   
---------
 1466.53
  502.94
  167.57
  163.67
  150.00
  150.00
  141.13
  133.33
  105.58
  100.00
(10 rows)

在声明中调用变量vix:

DO $$
    DECLARE vix float := round(100*(high/nullif(low,0)-1),2);
BEGIN
    select  vix as vix from quote 
    where date='2023-12-08'  and vix is not null 
    order by vix desc  
    limit 10;
END $$;

它遇到错误:

ERROR:  column "high" does not exist
LINE 1: SELECT round(100*(high/nullif(low,0)-1),2)
                          ^
QUERY:  SELECT round(100*(high/nullif(low,0)-1),2)
CONTEXT:  PL/pgSQL function inline_code_block line 3 during statement block local variable initialization
Time: 0.604 ms

将其放入 with 子句中:

WITH  vix as (
   round(100*(high/nullif(low,0)-1),2)
)
select  vix as vix from quote 
where date='2023-12-08'  and vix is not null 
order by vix desc  
limit 10;

它遇到错误:

ERROR:  syntax error at or near "round"
LINE 2:    round(100*(high/nullif(low,0)-1),2)

如何修复它们?

postgresql
  • 1 个回答
  • 34 Views
Martin Hope
showkey
Asked: 2023-12-31 17:13:34 +0800 CST

如何在右侧添加新的 y 勾?

  • 5

画一个简单的图形和一条红色水平线。

import matplotlib.pyplot as plt
plt.plot([2,3,4,5])
plt.axhline(y = 3.5, color = 'r') 
plt.show()

在此输入图像描述

我想在新的红色水平线的右侧添加一个新的 y 勾,如何制作如下?

在此输入图像描述

python-3.x
  • 1 个回答
  • 29 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    重新格式化数字,在固定位置插入分隔符

    • 6 个回答
  • Marko Smith

    为什么 C++20 概念会导致循环约束错误,而老式的 SFINAE 不会?

    • 2 个回答
  • Marko Smith

    VScode 自动卸载扩展的问题(Material 主题)

    • 2 个回答
  • Marko Smith

    Vue 3:创建时出错“预期标识符但发现‘导入’”[重复]

    • 1 个回答
  • Marko Smith

    具有指定基础类型但没有枚举器的“枚举类”的用途是什么?

    • 1 个回答
  • Marko Smith

    如何修复未手动导入的模块的 MODULE_NOT_FOUND 错误?

    • 6 个回答
  • Marko Smith

    `(表达式,左值) = 右值` 在 C 或 C++ 中是有效的赋值吗?为什么有些编译器会接受/拒绝它?

    • 3 个回答
  • Marko Smith

    在 C++ 中,一个不执行任何操作的空程序需要 204KB 的堆,但在 C 中则不需要

    • 1 个回答
  • Marko Smith

    PowerBI 目前与 BigQuery 不兼容:Simba 驱动程序与 Windows 更新有关

    • 2 个回答
  • Marko Smith

    AdMob:MobileAds.initialize() - 对于某些设备,“java.lang.Integer 无法转换为 java.lang.String”

    • 1 个回答
  • Martin Hope
    Fantastic Mr Fox msvc std::vector 实现中仅不接受可复制类型 2025-04-23 06:40:49 +0800 CST
  • Martin Hope
    Howard Hinnant 使用 chrono 查找下一个工作日 2025-04-21 08:30:25 +0800 CST
  • Martin Hope
    Fedor 构造函数的成员初始化程序可以包含另一个成员的初始化吗? 2025-04-15 01:01:44 +0800 CST
  • Martin Hope
    Petr Filipský 为什么 C++20 概念会导致循环约束错误,而老式的 SFINAE 不会? 2025-03-23 21:39:40 +0800 CST
  • Martin Hope
    Catskul C++20 是否进行了更改,允许从已知绑定数组“type(&)[N]”转换为未知绑定数组“type(&)[]”? 2025-03-04 06:57:53 +0800 CST
  • Martin Hope
    Stefan Pochmann 为什么 {2,3,10} 和 {x,3,10} (x=2) 的顺序不同? 2025-01-13 23:24:07 +0800 CST
  • Martin Hope
    Chad Feller 在 5.2 版中,bash 条件语句中的 [[ .. ]] 中的分号现在是可选的吗? 2024-10-21 05:50:33 +0800 CST
  • Martin Hope
    Wrench 为什么双破折号 (--) 会导致此 MariaDB 子句评估为 true? 2024-05-05 13:37:20 +0800 CST
  • Martin Hope
    Waket Zheng 为什么 `dict(id=1, **{'id': 2})` 有时会引发 `KeyError: 'id'` 而不是 TypeError? 2024-05-04 14:19:19 +0800 CST
  • Martin Hope
    user924 AdMob:MobileAds.initialize() - 对于某些设备,“java.lang.Integer 无法转换为 java.lang.String” 2024-03-20 03:12:31 +0800 CST

热门标签

python javascript c++ c# java typescript sql reactjs html

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve