我是Git的新手.我的客户要求我在我的系统中安装git并告诉我传递ssh密钥(id_rsa.pub).我转移密钥并注册,之后我们就可以下载应用了.
然后我们决定转向Fedora 14(Linux).我们再次安装了git,我们再次将密钥转移到服务器中注册到客户端.但现在客户提到我们可以使用相同的密钥.
是否可以使用相同的密钥?
我尝试了以下步骤:(一旦git安装在Fedora中.)
ssh-keygen -t rsa -C "your_email@youremail.com" (与Windows操作系统上使用的电子邮件ID相同)git clone git@git.xyz.com:x2.git但没有运气.
当我尝试:
git clone git@git.xyz.com:x2.git
Cloning into x2...
ssh: connect to host git.xyz.com port 22: connection timed out
fatal: The remote end hung up unexpectedly.
Run Code Online (Sandbox Code Playgroud)
有人可以帮助我理解和解决这个问题吗?锁定访问还有其他问题吗?
提前致谢.
有人可以提供最简单的解决方案将整数转换为表示其相关二进制数字的整数数组.
Input => Output
1 => [1]
2 => [2]
3 => [2,1]
4 => [4]
5 => [4,1]
6 => [4,2]
One way is :
Step 1 : 9.to_s(2) #=> "1001"
Step 2 : loop with the count of digit
use / and %
based on loop index, multiply with 2
store in a array
Run Code Online (Sandbox Code Playgroud)
还有其他直接或更好的解决方案吗?
>> "aaaaaafbfbfsjjseew".scan(/(.)/)
=> [["a"], ["a"], ["a"], ["a"], ["a"], ["a"], ["f"], ["b"], ["f"], ["b"], ["f"], ["s"], ["j"], ["j"], ["s"], ["e"], ["e"], ["w"]]
>> "aaaaaafbfbfsjjseew".scan(/((.))/)
=> [["a", "a"], ["a", "a"], ["a", "a"], ["a", "a"], ["a", "a"], ["a", "a"], ["f", "f"], ["b", "b"], ["f", "f"], ["b", "b"], ["f", "f"], ["s", "s"], ["j", "j"], ["j", "j"], ["s", "s"], ["e", "e"], ["e", "e"], ["w", "w"]]
>> "aaaaaafbfbfsjjseew".scan(/((.)\2*)/)
=> [["aaaaaa", "a"], ["f", "f"], ["b", "b"], ["f", "f"], ["b", "b"], ["f", "f"], ["s", "s"], ["jj", "j"], ["s", …Run Code Online (Sandbox Code Playgroud)