有没有办法在打开font-lock-mode的缓冲区中突出显示文本中的字符串(但不是所有此类字符串).
我们假设我有一个带有SQL模式的缓冲区,我想在其中突出显示一个字符串.以下代码不起作用
(set-text-properties 10 20 '(face hi-yellow))
Run Code Online (Sandbox Code Playgroud)
我打电话的时候
(font-lock-mode -1)
Run Code Online (Sandbox Code Playgroud)
它工作,但所有sql突出显示消失.
必须有一个解决方案,因为它可以选择一个区域,它将突出显示,但我无法弄清楚如何以编程方式
根据文件
Emacs支持"拖放":将文件放入普通的Emacs窗口,使用该窗口访问该文件.作为例外,将文件放入显示Dired缓冲区的窗口会将文件移动或复制到显示的目录中.
如何在dired模式下禁用文件的移动或复制,以便emacs以任何模式访问文件?
我想知道在一个直接缓冲区中有什么"东西".
例如,Debug是一个"目录":
drwxrwxrwx 0 10-08-2009 17:50调试
Makefile是一个"文件":
-rw-rw-rw-15k 6-03-2009 13:02 Makefile
这是一个"标题"
d:/富/酒吧/调试:
找到一个东西的一种方法是看看面对面是什么.还有另一种方法吗?我怎样才能确定事物的边界?
标准(thing-at-point'文件名)不处理文件名中的空格.
我需要检查是否按下了Shift键.更确切地说,我想设置dired开关取决于是否按下Shift.
(defadvice find-file-noselect (around find-file-noselect-set-switches activate)
(let ((switches dired-listing-switches))
;; check if shift is pressed and set or not an "R" switch
(setq dired-listing-switches "-lhRA")
ad-do-it
(setq dired-listing-switches switches)))
Run Code Online (Sandbox Code Playgroud)
当然,我可以为不同的dired开关提供不同的快捷方式,但我想在为dired选择目录时动态更改我的开关.
在sqlplus中,我可以创建一个只读事务.
set transaction read only;
Run Code Online (Sandbox Code Playgroud)
是否可以创建只读会话?
我想连接到Oracle DB,使用UPDATE和INSERT执行一些测试,但即使在整个会话期间执行commit也不提交它们.
(defmacro cons-stream (a b)
(cons ,a (delay ,b)))
(defmacro delay (expr)
`(memo-proc (lambda () ,expr)))
Run Code Online (Sandbox Code Playgroud)
用Python和Perl的方式做同样的事情是什么?
编辑.是否可以使用这样一个很酷的结构作为流
(define primes (sieve (integers-starting-from 2)))
Run Code Online (Sandbox Code Playgroud)
在Python和Perl等语言中
I have a dataframe with a array column.
val json = """[
{"id": 1, "value": [11, 12, 18]},
{"id": 2, "value": [23, 21, 29]}
]"""
val df = spark.read.json(Seq(json).toDS)
scala> df.show
+---+------------+
| id| value|
+---+------------+
| 1|[11, 12, 18]|
| 2|[23, 21, 29]|
+---+------------+
Run Code Online (Sandbox Code Playgroud)
Now I need to apply different aggregate functions to the value column.
I can call explode and groupBy, for example
df.select($"id", explode($"value").as("value")).groupBy($"id").agg(max("value"), avg("value")).show
+---+----------+------------------+
| id|max(value)| avg(value)|
+---+----------+------------------+
| 1| 18|13.666666666666666|
| 2| 29|24.333333333333332| …Run Code Online (Sandbox Code Playgroud) 我经常需要阅读具有相当简单结构的大XML文件(> 100 MB).我想使用emacs,但它不能很好地支持大文件.我想也许我可以使用一个java应用程序,可以为我做SAX或StAX解析,并为我提供所有必要的操作(例如搜索).在emacs和外部Java应用程序之间进行通信的"正确方法"是什么?
我有以下xml
<?xml version="1.0" encoding="UTF-8"?>
<content>
<artwork classification="12" href="1.jpg"/>
<artwork classification="10" href="2.jpg"/>
</content>
Run Code Online (Sandbox Code Playgroud)
应用 xsl 时
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xlink="http://www.w3.org/1999/xlink"
>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="@href">
<xsl:attribute name="xlink:href">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:template>
</xsl:stylesheet>
Run Code Online (Sandbox Code Playgroud)
它产生
<?xml version="1.0" encoding="UTF-8"?>
<content>
<artwork classification="12" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="1.jpg"/>
<artwork classification="10" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="2.jpg"/>
</content>
Run Code Online (Sandbox Code Playgroud)
而我需要
<?xml version="1.0" encoding="UTF-8"?>
<content xmlns:xlink="http://www.w3.org/1999/xlink">
<artwork classification="12" xlink:href="1.jpg"/>
<artwork classification="10" xlink:href="2.jpg"/>
</content>
Run Code Online (Sandbox Code Playgroud)
我应该如何修改我的 xsl 以获得我需要的结果?
我使用 xalan XSLT 处理器。
我们使用Ivy和Artifactory作为存储库.在Artifactory中,存储了第三方库和我们的发布包.
如果人工制品(第三方或我们的包装)中存在错误,我想知道哪些其他组件可能受到影响.
简而言之,我需要一个反向依赖报告.
通常如何解决类似问题?
我偶尔使用python,抱歉看似微不足道的问题
>>> a = set(((1,1),(1,6),(6,1),(6,6)))
>>> a
set([(6, 1), (1, 6), (1, 1), (6, 6)])
>>> a - set(((1,1)))
set([(6, 1), (1, 6), (1, 1), (6, 6)])
>>> a.remove((1,1))
>>> a
set([(6, 1), (1, 6), (6, 6)])
Run Code Online (Sandbox Code Playgroud)
为什么' -'运算符没有删除元素但是删除了remove?