我正在学习Java,但我遇到了问题.我创建了6个不同的类,每个类都有自己的main()方法.我想.jar为每个类创建可执行文件,即6个可执行.jar文件.
到目前为止我试过了
java -jar cf myJar.jar myClass.class
Run Code Online (Sandbox Code Playgroud)
我得到'无法访问jarfile cf'.我做错了什么,但我不知道是什么.如果这意味着什么,我也在使用Eclipse IDE.
我想sql.gz用SSH 将文件插入我的数据库.我该怎么办?
例如,我有一个名称为电话号码的数据库numbers.sql.gz,这种类型的文件是什么以及如何将此文件导入我的数据库?
哪个有效?SSH://或Git://(文件压缩)
我在Git中理解,git协议是智能的,因为在通信的两端都有一个协议代理来压缩文件传输,从而通过有效地利用网络带宽实现更快的克隆.
从O'Reilly的书中我发现了以下陈述.
For secure, authenticated connections, the Git native
protocol can be tunneled over an SSH connection using
the following URL templates:
ssh: //[user@]example.com[:port]/path/to/repo.git
ssh: //[user@]example.com/path/to/repo.git
ssh: //[user@]example.com/~user2/path/to/repo.git
ssh: //[user@]example.com/~/path/to/repo.git*
Run Code Online (Sandbox Code Playgroud)
我不确定作者是否意味着他说的话.他谈到git协议通过SSH进行隧道传输.
从我的角度来看,除非你连接到git端口(代理端口),否则协议不起作用.SSH仅仅是未压缩的文件传输.
但是根据作者的说法,如果我们使用SSH,他说git协议是通过它进行隧道传输的.那么在GIT中SSH更智能吗?
冯C,谢谢你的回答."网络协议(HTTP和Git)通常是只读的"Git可以rw在你运行deamon时制作--enable=receive-pack.
以下是我的担忧.
当他们说git协议是智能的时,他们就意味着当你执行git clone时,git服务器代理会压缩发送回客户端的数据,因此克隆应该更快.在我的用例中,我将在香港设置git服务器并在圣何塞和其他国家使用它.因此,我希望由于延迟问题而在网络上保持高效.
所以我的问题是,当我使用时,我git clone ssh://user@server/reposloc也获得了git协议的好处吗?根据O'Reilly作者的书,他的意思是git通过ssh进行隧道传输,那么当我没有在服务器上运行git守护进程时,git协议如何工作.
所以使用SSh:// xyz ...它是否同时给出了ssh和git协议的好处?
提前感谢您的答案.
我正在使用git,然后将提交消息和其他位作为JSON有效负载发布到服务器.
目前我有:
MSG=`git log -n 1 --format=oneline | grep -o ' .\+'`
Run Code Online (Sandbox Code Playgroud)
它将MSG设置为:
Calendar can't go back past today
Run Code Online (Sandbox Code Playgroud)
然后
curl -i -X POST \
-H 'Accept: application/text' \
-H 'Content-type: application/json' \
-d "{'payload': {'message': '$MSG'}}" \
'https://example.com'
Run Code Online (Sandbox Code Playgroud)
我真正的JSON有另外两个领域.
这样可以正常工作,但是当我有一个提交消息(例如上面带有撇号的提交消息)时,JSON无效.
如何逃脱bash所需的角色?我不熟悉这种语言,所以不知道从哪里开始.更换'有\'会做的最小,我怀疑这份工作.
我想在尝试运行之前检查函数是否存在.这是我的代码:
if ($.isFunction(myfunc())) {
console.log("function exist, run it!!!");
}
Run Code Online (Sandbox Code Playgroud)
但是,当该功能不可用时,我收到错误:
myfunc未定义
我怎样才能进行检测?这是我的工作测试:http://jsfiddle.net/3m3Y3/
我一直在研究那些打算与对象一起使用的代码,而不是真正关心对象的类型.我想输入提示,正在编写的方法需要任何类型的对象,但遇到了一些困难.
我试过function myFunc (object $obj),function myFunc (stdClass $obj)但当我尝试传递对象时,这两个都会产生错误:
可捕获致命错误:传递给MyClass :: MyFunc()的参数1必须是对象的实例,给出ObjectActualClass的实例
同样的事情发生stdClass,以及
我错过了什么?我认为所有未明确继承自另一个类的类继承自stdClass,这意味着PHP中每个类的基类都是stdClass.这不是这种情况吗?
我正在使用git版本1.5.6.3,似乎git没有注意到文件夹的模式更改
#create a test repository with a folder with 777 mode
:~$ mkdir -p test/folder
:~$ touch test/folder/dummy.txt
:~$ cd test
:~/test$ chmod 777 folder/
#init git repository
:~/test$ git init
Initialized empty Git repository in ~/test/.git/
:~/test$ git add .
:~/test$ git commit -m 'commit a directory'
Created initial commit 9b6b21a: commit a directory
0 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 folder/dummy.txt
#change folder permission to 744
:~/test$ chmod 744 folder/
:~/test$ git status
# On …Run Code Online (Sandbox Code Playgroud) 我有一些我存储在myfunc.php中的Magento商店的自定义PHP函数,我需要从几个不同的.phtml文件中获取它.我怎么做?
我的意思是我可以使用绝对路径,但这会很脏并且在迁移到另一台服务器时可能会出现问题.
现在我坚持:
require('/home/myuser/public_html/app/design/frontend/default/mytheme/myfunc.php');
Run Code Online (Sandbox Code Playgroud)
如何以编程方式引用皮肤路径(/ home/myuser/public_html/app/design/frontend/default/mytheme /)?
我试过了
git diff 13.1_dev sale_edit > patch.diff
Run Code Online (Sandbox Code Playgroud)
然后我尝试git apply patch.diff在另一个分支,但我得到补丁不适用.如何从差异中创建补丁文件,我可以使用git apply?
收到的错误:
$ git apply --ignore-space-change --ignore-whitespace diff.diff
diff.diff:9: trailing whitespace.
diff.diff:10: trailing whitespace.
function set_change_sale_date()
diff.diff:12: space before tab in indent.
$this->sale_lib->set_change_sale_date($this->input->post('change_sale_date'));
diff.diff:14: trailing whitespace.
diff.diff:15: trailing whitespace.
function set_change_sale_date_enable()
warning: application/controllers/sales.php has type 100755, expected 100644
error: patch failed: application/controllers/sales.php:520
error: application/controllers/sales.php: patch does not apply
warning: application/language/english/sales_lang.php has type 100755, expected 100644
error: patch failed: application/language/english/sales_lang.php:134
error: application/language/english/sales_lang.php: patch does not apply
warning: application/libraries/Sale_lib.php has …Run Code Online (Sandbox Code Playgroud) 我正在尝试为自定义模块实现一些配置设置.我设法在左侧导航栏中添加了一个标签和一个部分.但是当我想打开一个部分时,我得到一个404错误页面而没有任何进一步的信息.
到目前为止,我已经尝试了任何工作来阅读博客,示例等,但我找不到错误.也许你们中的某个人可以向我解释我做错了什么.
我的adminhtml.xml:
<?xml version="1.0" ?>
<config>
<resources>
<admin>
<children>
<system>
<children>
<config>
<children>
<tempest_section translate="title" module="Tempest">
<title>Tempest</title>
</tempest_section>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</config>
Run Code Online (Sandbox Code Playgroud)
我的config.xml:
<?xml version="1.0"?>
<config>
<modules>
<Polyvision_Tempest>
<version>0.1.0</version>
</Polyvision_Tempest>
</modules>
<global>
<helpers>
<Tempest>
<class>Polyvision_Tempest_Helper</class>
</Tempest>
</helpers>
</global>
<admin>
<routers>
<adminhtml>
<args>
<modules>
<tempest before="Mage_Adminhtml">Polyvision_Tempest_Adminhtml</tempest>
</modules>
</args>
</adminhtml>
</routers>
</admin>
<adminhtml>
<menu>
<menu1 translate="title" module="Tempest">
<title>polyvision</title>
<sort_order>60</sort_order>
<children>
<menuitem1 module="Tempest">
<title>Tempest - Export</title>
<action>adminhtml/tempest_main</action>
</menuitem1>
</children>
</menu1>
</menu>
</adminhtml>
<default>
<tempest> …Run Code Online (Sandbox Code Playgroud)