我尝试git-auto-commit-mode
根据本手册进行安装。
(add-to-list 'load-path "/Users/kuna/Library/git-auto-commit-mode-master")
但作为输出我得到:
>
>
>
Run Code Online (Sandbox Code Playgroud)
我需要安装程序来帮助我在更改某些文件、添加新文件或删除文件时测试自动提交。
我应该怎么做才能安装它并尝试它是如何工作的?我对做这样的事情很陌生。需要非常简单和基本的答案。谢谢
我需要在背景图像上添加透明的彩色图层.我尝试用rgba做这个但没有结果.
我现在得到的是:
page-heading {
background: rgba(36, 70, 105, 0.74) url("../images/samples/bg3.jpg") no-repeat fixed 50% 0px / cover;
opacity: 0.9;
position: relative;
text-align: center;
padding: 72px 0px;
}
Run Code Online (Sandbox Code Playgroud)
我知道背景颜色是无法加载图像时的后备颜色.如何以正确的方式在其上添加图层?
我有两节课:
template <class T1, class T2>
class foo{
//something here
}
class bar{
bar()=delete;
bar(const foo& a): a(a){}
private:
foo a;
}
Run Code Online (Sandbox Code Playgroud)
此代码无效.
但是,我怎样才能实现这样的目标呢?
我知道我应该告诉我们使用的是什么类型foo
.但实际上,我不允许默认构造函数.所以,我不能让的对象bar
,而不给它合适的foo
.为什么我要告诉编译器什么是T1
和T2
呢?
我有一个基于UNIX的perl项目,其中一个main.pl
文件进一步使用了一些用户定义的perl模块.我想为我的perl项目添加许可.最好的方法是什么?
我使用以下链接在Safari中打开一个URL :
https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=XXXXXXXXXX&lc=PL&item_name=Donate%20Field%20Service&amount=\(amount)¤cy_code=\(currency)&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted
Run Code Online (Sandbox Code Playgroud)
我的客户(来自乌克兰)表示,它始终以波兰语开放.为什么?它不应该是浏览器的本地语言吗?
我将iOS的设置更改为英语,但该网站仍以波兰语打开.
在隐身模式下,仍然存在相同的情况:
我有一个简单的地图视图:
@IBOutlet private var mapView: MKMapView!
Run Code Online (Sandbox Code Playgroud)
然后我一个接一个地添加注释:
mapView.addAnnotation(Annotation(user: user))
Run Code Online (Sandbox Code Playgroud)
并向他们展示:
mapView.showAnnotations(mapView.annotations, animated: true)
Run Code Online (Sandbox Code Playgroud)
我也实现了这个方法:
func mapView(_ mapView: MKMapView, clusterAnnotationForMemberAnnotations memberAnnotations: [MKAnnotation]) -> MKClusterAnnotation {
print(memberAnnotations)
return MKClusterAnnotation(memberAnnotations: memberAnnotations)
}
Run Code Online (Sandbox Code Playgroud)
但这根本不被召唤.为什么?
我只需要替换:
<p>
, <div>
和
\n<p>
, \n<div>
在字符串中替换一个单一的模式。是否可以?
let string = "<p>hello</p> my <div>Doggy</div>"
let newString = string.replacingOccurrences(of: "<p>", with: "\n<p>").replacingOccurrences(of: "<div>", with: "\n<div>")
Run Code Online (Sandbox Code Playgroud)
正则表达式有更好的解决方案吗?
任何人都可以帮助我理解下面while()
循环中写入条件的方式:
请找到以下代码:
int fun () {
static int x = 5;
x--;
pritnf("x = %d\n", x);
return x;
}
int main () {
do {
printf("Inside while\n");
} while (1==1, fun());
printf("Main ended\n");
return 0;
}
Output:
Inside while
x = 4
Inside while
x = 3
Inside while
x = 2
Inside while
x = 1
Inside while
x = 0
Main ended
Run Code Online (Sandbox Code Playgroud)
此外,我有以下代码和输出惊喜:
int fun () {
static int x = 5;
x--;
printf("x = %d\n", …
Run Code Online (Sandbox Code Playgroud) 这是我尝试做的:
if let path = Bundle.main.path(forResource: "file_1", ofType: "json"), let url = URL(string: path) {
do {
let data = try Data(contentsOf: url, options: Data.ReadingOptions.mappedIfSafe)
} catch {
print("error: \(error)")
}
}
Run Code Online (Sandbox Code Playgroud)
我得到的是:
错误:错误域= NSCocoaErrorDomain代码= 256“无法打开文件“ file_1.json”。” UserInfo = {NSURL = / var / containers / Bundle / Application / 195E2A54-5B47-44E2-92AC-25B4074A43D1 / Parser.app / file_1.json}
如何解决此错误?
该文件存在于我的项目目录中:
假设我有字符串数组:
["A12[1]", "A13[1]", "A14[1]"]
我需要找到最长的公共前缀A1
和后缀[1]
。
其他例子:
["9-b", "10-b", "11-b"]
-> 后缀-b
,无前缀
["A12", "A14", "A6"]
-> 前缀A
,无后缀
如何遍历数组以查找数组中每个字符串的结尾和开头?