我知道那里 有 很多的分支同步的问题,和差 之间的git的命令,但我发现很难知道什么是这个正确的过程。
我是 GitHub 上一个存储库的维护者。我团队中的一名成员克隆了该存储库,创建了一个new-feature分支,将该new-feature分支推送到 GitHub 存储库,并创建了一个拉取请求以将其合并到master. 我批准了拉取请求并将其合并到masterGitHub 网站上。
将这个“新主”拉下来以更新我的本地存储库以便我的本地目录同步、干净且无需重写任何历史记录的正确过程是什么?
git pull--> 本质上是git fetch然后git merge...进入我所在的分支?git pull --rebase--> 本质上是一个git fetchthen git rebase?git fetch然后git merge origin/master--> 与选项 1 相同?git fetch然后git rebase origin/master--> 与选项 2 相同?我想创建一个组和用户使用salt状态文件,但我不知道组,gid,用户,uid,sshkey,直到我需要执行我想作为参数传入的salt状态文件.
我已经阅读了有关Pillar创建变量的内容.如何在执行前创建支柱?
/srv/salt/group.sls:
{{ name }}:
group.present:
- gid: {{ gid }}
- system: True
Run Code Online (Sandbox Code Playgroud)
命令行:
salt 'SaltStack-01' state.sls group name=awesome gid=123456
Run Code Online (Sandbox Code Playgroud) 我的数据是:
>>> ts = pd.TimeSeries(data,indexconv)
>>> tsgroup = ts.resample('t',how='sum')
>>> tsgroup
2014-11-08 10:30:00 3
2014-11-08 10:31:00 4
2014-11-08 10:32:00 7
[snip]
2014-11-08 10:54:00 5
2014-11-08 10:55:00 2
Freq: T, dtype: int64
>>> tsgroup.plot()
>>> plt.show()
Run Code Online (Sandbox Code Playgroud)
indexconv是使用转换的字符串datetime.strptime。
这样的情节非常前卫(这些不是我的实际情节):

我如何像这样平滑它:

我知道本文中scipy.interpolate提到的内容(这是我从中获取图像的地方),但是如何将其应用于熊猫时间序列?
我发现了一个名为Vincent的很棒的库,可以处理Pandas,但它不支持Python 2.6。
我正在绘制一个包含三个子图的图:
fig = plt.figure(fignum)
ax11 = plt.subplot2grid((2,2), (0,0))
ax12 = plt.subplot2grid((2,2), (0,1))
ax13 = plt.subplot2grid((2,2), (1,0), colspan=2)
ax13.axis('off')
Run Code Online (Sandbox Code Playgroud)
我使用 Pandas 来处理数据,并且想要绘制条形图、饼图和表格。我正在这样做:
d = pd.Series(data,index)
#plotting the first subplot
d.plot(kind='bar',ax=ax11)
#plotting the second one and adjusting size of labels and percentages
(wedges, texts, autotexts) = ax12.pie(d,labels=d.index,autopct='%1.1f%%')
ax12.axis('equal')
for t in texts:
t.set_size(7)
for t in autotexts:
t.set_size(7)
#plotting the third axes, the table
ax13.table(cellText=table,colLabels=columns,loc='bottom')
Run Code Online (Sandbox Code Playgroud)
结果是这样的:

如何通过不让标签重叠来使饼图看起来更好?我尝试添加图例,但它覆盖了图表,我什至不知道它是否最终出现在我指定的位置:
ax12.legend(index,loc='lower right',fontsize=7)
Run Code Online (Sandbox Code Playgroud)

有没有办法将图例移到饼图下方的空白区域中?一旦图例看起来不错,我就会从饼图本身中删除标签。
我正在按照本指南开始使用 Jekyll:使用 Jekyll 在本地设置您的 GitHub Pages 站点,但我正在针对 GitHub Enterprise 执行此操作。我的存储库位于https://github.company.com/myorg/myrepo,GitHub 页面来自https://pages.github.company.com/myorg/myrepo(或https://github.company.com/pages/myorg/myrepo)。
bundle exec jekyll new . --force教程中的步骤创建了一个简单的模板站点,我进行了修改_config.yml以包含以下内容:
baseurl: ""
url: "https://pages.github.company.com/myorg/myrepo"
repository: "myorg/myrepo"
Run Code Online (Sandbox Code Playgroud)
但是在我运行之后bundle exec jekyll serve,我看到它发布到公共 GitHub 上:
Generating...
GitHub Metadata: No GitHub API authentication could be found. Some fields may be missing or have incorrect data.
GitHub Metadata: GET https://api.github.com/repos/myorg/myrepo: 404 - Not Found // See: https://developer.github.com/v3
GitHub Metadata: GET https://api.github.com/repos/myorg/myrepo/pages: 404 - Not Found …Run Code Online (Sandbox Code Playgroud) 我正在创建一个添加iptables规则的公式/状态文件:
ipt_allow:
iptables.append:
- table: filter
- chain: INPUT
- jump: ACCEPT
- match: state
- connstate: 'NEW,ESTABLISHED'
- dport: 6666
- proto: tcp
- source: 'ip1, ip2, ip3, ...'
Run Code Online (Sandbox Code Playgroud)
我不想硬编码IP地址source.ip1,, ip2和ip3是与谷物相匹配的爪牙的IP地址role:role1.这样一来,如果我role1在路上添加更多的碎片,那么一旦我重新运行这个状态文件,它们就会被添加到iptables规则中.我该怎么做呢?
我在PySpark中使用JayDeBeAPI(Apache Spark Python API),这是我的代码的开头(注意,我实际上是通过PySpark的交互式shell运行所有这些).
import jaydebeapi
import jpype
conn = jaydebeapi.connect('org.apache.phoenix.jdbc.PhoenixDriver',
['jdbc:phoenix:hostname', '', ''])
Run Code Online (Sandbox Code Playgroud)
我正在查询Apache Phoenix,它是Apache HBase的SQL"前端".
这是我的SQL查询的Python代码:
curs = conn.cursor()
curs.execute('select "username",count("username") from "random_data" GROUP BY "username"')
curs.fetchall()
Run Code Online (Sandbox Code Playgroud)
我得到的输出对于所有行都是这样的:
(u'Username', <jpype._jclass.java.lang.Long object at 0x25d1e10>)
Run Code Online (Sandbox Code Playgroud)
如何修复它以便它实际显示返回列(count列)的值?
从Apache Phoenix数据类型页面,count列的数据类型是BIGINT,它被映射到java.lang.Long,但由于某种原因jpype不显示结果.
python setup.py install当我下载它时,我得到JayDeBeAPI 0.1.4和JPype 0.5.4.2 .
python ×4
github ×2
plot ×2
salt-stack ×2
apache-spark ×1
charts ×1
git ×1
github-pages ×1
jaydebeapi ×1
jdbc ×1
jekyll ×1
jinja2 ×1
jpype ×1
matplotlib ×1
pandas ×1
pie-chart ×1