[原创] Apache Pig问题:Encountered IOException. org.apache.pig.tools.parameters.ParseException: Encountered ""

查看更多Apache Pig的教程请点击这里

运行Pig脚本时报错:

Error before Pig is launched
----------------------------
ERROR 2997: Encountered IOException. org.apache.pig.tools.parameters.ParseException: Encountered "<EOF>" at line 1, column 8.
Was expecting one of:
    <IDENTIFIER> ...
    <OTHER> ...
    <LITERAL> ...
    <SHELLCMD> ...
java.io.IOException: org.apache.pig.tools.parameters.ParseException: Encountered "<EOF>" at line 1, column 8.
Was expecting one of:
    <IDENTIFIER> ...
    <OTHER> ...
    <LITERAL> ...
    <SHELLCMD> ...

        at org.apache.pig.impl.PigContext.doParamSubstitution(PigContext.java:408)
        at org.apache.pig.Main.runParamPreprocessor(Main.java:783)
        at org.apache.pig.Main.run(Main.java:446)
        at org.apache.pig.Main.main(Main.java:158)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Caused by: org.apache.pig.tools.parameters.ParseException: Encountered "<EOF>" at line 1, column 8.
文章来源:https://www.codelast.com/
这个问题有可能有多种原因,比如某行漏写了语句结尾的分号。这里我遇到的是另一个原因:调用该Pig脚本的shell脚本,用 -p "xxx=$X" 这种形式传参时,参数为空,修正参数为空的问题即可解决。

阅读更多

[原创] Flutter相关配置

Flutter是什么?

Flutter是Google开源的移动应用程序SDK,一份代码可以同时生成iOS和Android两个高性能、高保真的应用程序。
Flutter目标是使开发人员能够交付在不同平台上都感觉自然流畅的高性能应用程序。我们兼容滚动行为、排版、图标等方面的差异。

在Ubuntu系统下,从零开始运行起来第一个Flutter程序不是那么容易的事情,有一些tricky的配置可能会浪费你很多时间。

阅读更多

解决LaTeX for WordPress插件在PHP 7.0下失效的问题

最近WordPress管理后台提示我升级WordPress版本到5.2.1,但由于5.2.1最低要求的PHP版本是5.6,我使用的PHP比这个版本还低,因此只能升级PHP版本,同时又考虑到现在PHP 7比较主流,因此我从PHP 5.4直接升到了PHP 7。

阅读更多

[原创] 如何把一块硬盘上的Ubuntu系统完整复制到另一块硬盘上?

最近我的Ubuntu台式机每隔两三天就会进入一种硬盘狂读+点击鼠标无反应的死机状态,由于SSD已经用了很多年,我非常担心它会随时挂掉,导致数据丢失的惨剧发生,于是我提前预防,买了块同品牌、同容量的SSD来替换它。但是从头开始重装系统+配置各种软件的过程实在太痛苦了,所以我决定做一次全盘复制,这样就能省去很多时间。

阅读更多

[原创] Ubuntu终端使用Privoxy代理

在Ubuntu下,除了浏览器之外,为了能在系统全局层面上自动使用代理访问那些“不存在的网站”,有一个常用的做法就是,在Chrome的SwitchyOmega插件里的“自动切换”情景模式下“导出PAC”,得到一个PAC文件,放在磁盘的某个路径下(假设为:/home/codelast/OmegaProfile__.pac),然后在Ubuntu系统的网络设置里如下设置:

阅读更多

[原创] 解决Ubuntu 无法用 apt-get install 安装任何软件(dpkg: error processing package xxx)的问题

Ubuntu不知道什么原因,不能用 apt-get install 安装任何软件了,并且在屏幕上输出海量错误信息,非常迷惑人,例如下面这一例:

insserv: Starting vpnagentd_init depends on plymouth and therefore on system facility `$all' which can not be true!
insserv: There is a loop between service vpnagentd_init and mountkernfs if started
insserv:  loop involving service mountkernfs at depth 1
insserv: Starting vpnagentd_init depends on plymouth and therefore on system facility `$all' which can not be true!
......
insserv: Starting vpnagentd_init depends on plymouth and therefore on system facility `$all' which can not be true!
insserv: There is a loop between service vpnagentd_init and dns-clean if started
insserv:  loop involving service dns-clean at depth 1
......
insserv: Starting vpnagentd_init depends on plymouth and therefore on system facility `$all' which can not be true!
insserv: exiting now without changing boot order!
update-rc.d: error: insserv rejected the script header
dpkg: error processing package binfmt-support (--configure):
 subprocess installed post-installation script returned error exit status 1
No apport report written because MaxReports is reached already
                                                              Processing triggers for initramfs-tools (0.122ubuntu8.10) ...
update-initramfs: Generating /boot/initrd.img-4.13.0-32-generic
Errors were encountered while processing:
 udev
 grub-common
 grub2-common
 grub-pc-bin
 grub-pc
 resolvconf
 binfmt-support
E: Sub-process /usr/bin/dpkg returned an error code (1)

这里只列出了部分错误信息,实际上输出的内容极多,多得让人眼都瞎。

阅读更多

[原创] 解决Selenium的"failed to change window state to maximized" 窗口最大化问题

OS:Ubuntu 16.04.3 LTS
JDK:1.8.0_60
Selenium:3.0.0
Chrome:61.0.3163.100

本文描述了用JAVA编程控制Selenium时,遇到的“failed to change window state to maximized, current state is normal”错误的解决方法。

阅读更多

[原创] 解决Linux系统上由于程序占用的文件描述符(file descriptor)过多导致的异常问题

 
前几天发现服务器上的一个JAVA程序表现很不对劲,运行起来特别“慢”,仔细一看程序的日志,发现里面有Exception抛出,提示“too many open files”,由于无论是读写文件还是创建网络连接,都需要占用文件描述符(fd),于是怀疑是服务器上的某个程序占用的资源没有释放,达到了系统设置的上限从而导致程序异常。

阅读更多

[原创] 在树莓派3上使用微软ELL嵌入式学习库(5)

OS: Arch Linux ARM
ELL:写本文时GitHub中的最新版
TensorFLow: v1.1.0

本文是上一篇文章的续文。
微软于2017年6月底发布了一个主要用于嵌入式系统(例如,树莓派,ARM Cortex-M0等)的机器学习库ELLEmbedded Learning Library嵌入式学习库)。
在之前的文章中,我大费周章,终于在树莓派上把ELL的demo跑起来了,但它实用吗?在本文中,我将简单地测试一下使用Darknet model的inference速度和精度。

阅读更多

[原创] ELL(Embedded Learning Library,微软嵌入式学习库)文章合集

微软于2017年6月底发布了一个主要用于嵌入式系统(例如,树莓派,ARM Cortex-M0等)的机器学习库ELLEmbedded Learning Library嵌入式学习库),旨在把部分云端的机器学习计算转移到嵌入式设备上进行。
本系列文章记录了在树莓派3代上把ELL demo跑起来的过程中遇到的各种问题以及解决办法。

➤ 在树莓派3上使用微软ELL嵌入式学习库(1)

➤ 在树莓派3上使用微软ELL嵌入式学习库(2)

➤ 在树莓派3上使用微软ELL嵌入式学习库(3)

➤ 在树莓派3上使用微软ELL嵌入式学习库(4)

➤ 在树莓派3上使用微软ELL嵌入式学习库(5)

阅读更多

[原创] 在树莓派3上使用微软ELL嵌入式学习库(4)

本文是上一篇文章的续文。
微软于2017年6月底发布了一个主要用于嵌入式系统(例如,树莓派,ARM Cortex-M0等)的机器学习库ELLEmbedded Learning Library嵌入式学习库)。
为了在树莓派上跑起来ELL的demo,需要先在PC上做大量工作,前几篇文章正是记录了这个过程中遇到的种种问题。
从本文开始,我们终于可以把工作转到树莓派上了——不枉前面克服的所有困难,这一刻,我们离成功是如此之近。
注:本文的所有操作,都是在树莓派上运行的。

阅读更多

[原创] 在树莓派3上跑ELL的demo报错:ImportError: build/_darknetReference.so: undefined symbol: cblas_sgemm

OS:Arch Linux ARM
gcc version:7.1.1 20170516 (GCC)

微软于2017年6月底发布了一个主要用于嵌入式系统(例如,树莓派,ARM Cortex-M0等)的机器学习库ELLEmbedded Learning Library嵌入式学习库)。
本文主要介绍了在树莓派上跑ELL的demo程序时,遇到的一个“undefined symbol: cblas_sgemm”问题的解决办法。

阅读更多

[原创] 在树莓派3上使用微软ELL嵌入式学习库(3)

本文是上一篇文章的续文。
微软于2017年6月底发布了一个主要用于嵌入式系统(例如,树莓派,ARM Cortex-M0等)的机器学习库ELLEmbedded Learning Library嵌入式学习库)。
在前几篇文章中,我在Ubuntu PC上对ELL里现成可用的model进行了测试,虽然由于我台式机太老旧的原因,运行速度相当之慢,不过它终究跑通了demo,下一步,我们需要在台式机上,把ELL的model编译到目标平台上——在这里,目标平台指的就是树莓派3。
注:本文的所有操作,都是在台式机上运行的。

阅读更多