小编jav*_*dba的帖子

Intellij如何放大/缩小

intellij键映射说

Zoom in: Keypad +  =  
Zoom out Keypad - - 
Run Code Online (Sandbox Code Playgroud)

但它们没有效果.有人这个有用吗?

新信息:现在我添加了更多的键绑定:

Zoom in: Alt-Shift-= 
Zoom out:  Alt-Shift-minus
Run Code Online (Sandbox Code Playgroud)

但这些仍然没有效果.在IJ中放大/缩小甚至可以工作吗?

zoom intellij-idea

68
推荐指数
7
解决办法
7万
查看次数

何时/如何最终删除"标记为删除"的主题?

我发出了删除主题的命令:

./bin/kafka-topics.sh --zookeeper localhost:2181 --delete --topic  vip_ips_alerts
Run Code Online (Sandbox Code Playgroud)

它似乎给出了一个快乐的回应:

[2014-05-31 20:58:10,112] INFO zookeeper state changed (SyncConnected) (org.I0Itec.zkclient.ZkClient)
Topic "vip_ips_alerts" queued for deletion.
Run Code Online (Sandbox Code Playgroud)

但是现在10分钟后,主题仍然出现在--list命令中:

./bin/kafka-topics.sh --zookeeper localhost:2181 --list
vip_ips_alerts - marked for deletion
Run Code Online (Sandbox Code Playgroud)

那是什么意思呢?当将话题被真正删除?我该如何加快这个过程?

apache-kafka

67
推荐指数
4
解决办法
7万
查看次数

运行基本tensorflow示例时出错

我刚刚在ubuntu上重新安装了最新的tensorflow:

$ sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.7.1-cp27-none-linux_x86_64.whl
[sudo] password for ubuntu: 
The directory '/home/ubuntu/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/ubuntu/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If …
Run Code Online (Sandbox Code Playgroud)

python ubuntu tensorflow

66
推荐指数
2
解决办法
8万
查看次数

如何在pyspark中将DataFrame转换回普通RDD?

我需要使用

(rdd.)partitionBy(npartitions, custom_partitioner)
Run Code Online (Sandbox Code Playgroud)

DataFrame上不可用的方法.所有DataFrame方法仅引用DataFrame结果.那么如何从DataFrame数据创建RDD呢?

注意:这是从1.2.0开始的更改(在1.3.0中).

从@dpangmao的答案更新:方法是.rdd.我有兴趣了解(a)它是否公开以及(b)性能影响是什么.

那么(a)是肯定的和(b) - 你可以在这里看到有重要的性能影响:必须通过调用mapPartitions创建一个新的RDD :

dataframe.py中(注意文件名也改变了(是sql.py):

@property
def rdd(self):
    """
    Return the content of the :class:`DataFrame` as an :class:`RDD`
    of :class:`Row` s.
    """
    if not hasattr(self, '_lazy_rdd'):
        jrdd = self._jdf.javaToPython()
        rdd = RDD(jrdd, self.sql_ctx._sc, BatchedSerializer(PickleSerializer()))
        schema = self.schema

        def applySchema(it):
            cls = _create_cls(schema)
            return itertools.imap(cls, it)

        self._lazy_rdd = rdd.mapPartitions(applySchema)

    return self._lazy_rdd
Run Code Online (Sandbox Code Playgroud)

python apache-spark pyspark

48
推荐指数
3
解决办法
8万
查看次数

使用"as select"或"like"创建配置单元表,并指定分隔符

有可能做一个

create table <mytable> as select <query statement>

运用

row format delimited fields terminated by '|';
Run Code Online (Sandbox Code Playgroud)

或做一个

create table <mytable> like <other_table> row format delimited fields terminated by '|';

语言手册似乎表明没有......但是我曾经在过去做过这件事.

hive create-table sql-like

39
推荐指数
2
解决办法
10万
查看次数

如何使用visual studio代码显示隐藏文件

"打开文件"对话框中Visual Studio Code没有显示隐藏文件.例如,查看我的主目录时,没有.显示任何文件:

在此输入图像描述

我确实查看了该settings.json文件,但没有找到任何适用的设置.那么 - 如何vscode正确配置?

visual-studio-code

39
推荐指数
5
解决办法
2万
查看次数

在intellij中运行程序时模拟stdin的输入

有没有办法将命令行参数配置为intellij进行stdin重定向?

有点像:

运行| 编辑运行配置| 脚本参数

/shared/java/paf-rules.properties 2 < /shared/java/testdata.csv
Run Code Online (Sandbox Code Playgroud)

scala intellij-idea io-redirection

38
推荐指数
2
解决办法
2万
查看次数

如何从命令行为Spark示例设置主地址

注意: 作者正在寻找在运行涉及源代码更改的Spark示例时设置Spark Master的答案,而是仅在可能的情况下从命令行完成的选项.

让我们考虑BinaryClassification示例的run()方法:

  def run(params: Params) {
    val conf = new SparkConf().setAppName(s"BinaryClassification with $params")
    val sc = new SparkContext(conf)
Run Code Online (Sandbox Code Playgroud)

请注意,SparkConf没有提供任何配置SparkMaster的方法.

从Intellij运行此程序时,使用以下参数:

--algorithm LR --regType L2 --regParam 1.0 data/mllib/sample_binary_classification_data.txt
Run Code Online (Sandbox Code Playgroud)

发生以下错误:

Exception in thread "main" org.apache.spark.SparkException: A master URL must be set
in your configuration
    at org.apache.spark.SparkContext.<init>(SparkContext.scala:166)
    at org.apache.spark.examples.mllib.BinaryClassification$.run(BinaryClassification.scala:105)
Run Code Online (Sandbox Code Playgroud)

我还尝试添加Spark Master网址(尽管代码似乎不支持它..)

  spark://10.213.39.125:17088   --algorithm LR --regType L2 --regParam 1.0 
  data/mllib/sample_binary_classification_data.txt
Run Code Online (Sandbox Code Playgroud)

--algorithm LR --regType L2 --regParam 1.0 spark://10.213.39.125:17088
data/mllib/sample_binary_classification_data.txt
Run Code Online (Sandbox Code Playgroud)

两者都不适用于错误:

Error: Unknown argument 'data/mllib/sample_binary_classification_data.txt'
Run Code Online (Sandbox Code Playgroud)

这里是参考解析 - 它与SparkMaster没有任何关系:

val parser = …
Run Code Online (Sandbox Code Playgroud)

intellij-idea apache-spark

32
推荐指数
5
解决办法
5万
查看次数

如何从pyspark设置hadoop配置值

SparkContext的Scala版本具有该属性

sc.hadoopConfiguration
Run Code Online (Sandbox Code Playgroud)

我已成功使用它来设置Hadoop属性(在Scala中)

例如

sc.hadoopConfiguration.set("my.mapreduce.setting","someVal")
Run Code Online (Sandbox Code Playgroud)

然而,SparkContext的python版本缺少该访问器.有没有办法将Hadoop配置值设置为PySpark上下文使用的Hadoop配置?

scala apache-spark pyspark

32
推荐指数
2
解决办法
2万
查看次数

如何恢复intellij Run/Debug窗口/标签的默认布局?

我不小心关闭了"运行/调试"面板的"调试器"选项卡.然后在尝试恢复它时,我想要恢复其他更改.如何回到原点?

在此输入图像描述

intellij-idea

30
推荐指数
2
解决办法
9256
查看次数