当我尝试在Chrome中更改密码时,总会有一个下拉列表,其中包含"使用密码:"选项.是否可以将其删除?我尝试过autocomplete ="off"和autocomplete ="false"但没有成功.
我有一个压缩方法:
(defn zip-project [project-id notebooks files]
(with-open [out (ByteArrayOutputStream.)
zip (ZipOutputStream. out)]
(doseq [nb notebooks]
(.putNextEntry zip (ZipEntry. (str "Notebooks/" (:notebook/name nb) ".bkr")))
(let [nb-json (:notebook/contents nb)
bytes (.getBytes nb-json)]
(.write zip bytes))
(.closeEntry zip))
(doseq [{:keys [name content]} files]
(.putNextEntry zip (ZipEntry. (str "Files/" name)))
(io/copy content zip)
(.closeEntry zip))
(.finish zip)
(.toByteArray out)))
Run Code Online (Sandbox Code Playgroud)
在我制作一个zip之后,我想将它保存到像/tmp/sample/sample.zip这样的文件中,但我似乎无法做到.这就是我在做的事情:
(defn create-file! [path zip]
(let [f (io/file path)]
(io/make-parents f)
(io/copy zip f)
true))
Run Code Online (Sandbox Code Playgroud)
问题是,当我从终端解压缩时,它说zip文件是空的,如果我使用Archive实用程序解压缩它,它会用cpgz扩展名提取.
我在这做错了什么?
我目前只限制一个国家的地方,但我也想限制一个特定的城市.任何想法如何实现?这是我目前的代码:
var autocomplete,
options = {
types: ['geocode'],
componentRestrictions: {country: 'est'}
};
autocomplete = new google.maps.places.Autocomplete(input, options);
google.maps.event.addListener(autocomplete, 'place_changed', function () {
var place = autocomplete.getPlace().formatted_address;
$(input).attr('value',place);
});
Run Code Online (Sandbox Code Playgroud) 我正在尝试下载 zip 文件,该文件是为了响应使用 Blob 进行的 ajax 调用而存在的,但出现错误“无法加载资源:帧加载中断”。它适用于除 Safari 之外的所有浏览器。这是我的代码:
var xhr = new XMLHttpRequest();
xhr.open('GET', url + '?' + params, true);
xhr.setRequestHeader('X-Authorization', 'Token ' + $localStorage.token);
xhr.responseType = 'arraybuffer';
xhr.onload = function(e) {
if (200 <= this.status && this.status < 300) { // success
var content = this.response;
var anchor = document.createElement('a');
var clickEvent = new MouseEvent('click');
anchor.download = projectName + '.zip';
var blob = new Blob([content], {type: 'application/zip'});
anchor.href = URL.createObjectURL(blob);
anchor.dispatchEvent(clickEvent);
}
};
xhr.send();
Run Code Online (Sandbox Code Playgroud)
有什么建议吗?