任何想法如何init定位(所以引脚被丢弃)GeoComplete?
$("#geocomplete").geocomplete({
map: ".map_canvas",
location: [52.4078567, 16.92718339999999], // is it centring the map, no pin thought
markerOptions: {
draggable: true
},
details: "form",
types: ["geocode", "establishment"]
});
Run Code Online (Sandbox Code Playgroud)
上面的示例确实使地图居中,但它不会丢弃一个引脚.为什么?这里
在线演示.
我正在尝试使用PHPExcel 1.7.8 + CodeIgniter 2.1.3导出XLS文件
但我收到这个错误:
无法加载请求的类:
iofactory
这是我的控制器代码:
//expoxt to excel all admin data
function export_excel_admin()
{
//$data['resultsadmin'] = $this->admin_model->get_all_data_admin();
//var_dump($data['resultsadmin']);
//$this->load->view('administrator/export_excel/export_excel_admin', $data);
$query = $this->db->get('tbl_admin');
if(!$query)
return false;
// Starting the PHPExcel library
$this->load->library('excel');
$this->load->library('PHPexcel/IOFactory');
$objPHPExcel = new PHPExcel();
$objPHPExcel->getProperties()->setTitle("export")->setDescription("none");
$objPHPExcel->setActiveSheetIndex(0);
// Field names in the first row
$fields = $query->list_fields();
$col = 0;
foreach ($fields as $field)
{
$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, 1, $field);
$col++;
}
// Fetching the table data
$row = 2;
foreach($query->result() as …Run Code Online (Sandbox Code Playgroud) 我正在尝试获取AppleScript中文件的最后修改日期。我以为我使用以下方法工作:
set thePath to (((path to documents folder) as text) & "speed.txt")
set modDate to modification date of file thePath
Run Code Online (Sandbox Code Playgroud)
这似乎返回了一个有效值,但是当我将其放入on idle一段代码中时,我得到了:
“无法获得...的类<>”错误
我在其他地方看到了使用建议:
set the modDate to (do shell script "mdls -name kMDItemLasUsedDate " & quoted form of the POSIX path of thePath)
Run Code Online (Sandbox Code Playgroud)
但这又回来了null。关于如何获取修改日期的任何想法?
我正在使用有天赋的聊天库,并希望在初始渲染时使用键盘自动聚焦于输入。我看到有一个命令式函数,focusTextInput但我该如何调用它?
<GiftedChat
{...props}
messages={this.state.messages}
ref={(chat) => this.chat = chat }
onSend={messages => this.onSend(messages)}
user={{
_id: 1,
}}
/>
Run Code Online (Sandbox Code Playgroud)
我尝试设置ref并直接在 do mount 上调用它,但这没有用。
对于 React 项目,我在 schema 文件夹下安装了 Sanity,然后开始向其中添加不同的 JS 文件,但即使其中没有代码,我也会在每个 js 文件的标头中收到错误。
我也尝试过
npm install --save-dev @babel/preset-react
Run Code Online (Sandbox Code Playgroud)
但没有成功。
我开始观看 Clever Programmer 的 Uniswap 视频,但由于错误而无法继续。
我正在尝试解析一个 HTML 文件,该文件已在 Automator 中转换为 TXT 文件。
我之前使用 Automator 从网站下载了 HTML 文件,现在我正在努力解析源代码。
最好,我只想获取表格的信息,并且需要对 1800 个不同的 HTML 文件重复此操作。
这是源代码的示例:
</head>
<body>
<div id="header">
<div class="wrapper">
<span class="access">
<div id="fb-root"></div>
<span class="access">
Gold Account: <a class="upgrade" title="Account Details" href="http://www.hedge-professionals.com/account-details.html" >Active </a> Logged in as Edward | <a href="javascript:void(0);" onclick='logout()' class="logout">Sign Out</a>
</span>
</span>
</div><!-- /wrapper -->
</div><!-- /header -->
<div id="masthead">
<div class="wrapper">
<a href="http://www.hedge-professionals.com" ><img src="http://www.hedge-professionals.com/images/hedgep_logo_white.png" alt="Hedge Professionals Database" width="333" height="46" class="logo" border="0" /></a>
<div id="navigation">
<ul>
<li ><a href='http://www.hedge-professionals.com/dashboard.html' >Dashboard</a></li> …Run Code Online (Sandbox Code Playgroud) 我试图弄清楚什么是最好的,如果可以完成,以及需要的方法来拍摄上传的图像并在 CSS 中为拇指修剪图像。如果不能在纯 CSS 中完成,在 JavaScript/jQuery 中完成的方法是什么?图像的大小可能不同,但我正在寻找一种方法,使图像在 center 上呈方形,然后缩小以适合。下面的例子:
此图像为 413 x 300。

如果此图像从左侧和右侧修剪为投资组合缩略图,它将是 300 X 300:

然后需要为拇指缩小图像 200 x 200 或拇指设置为显示的任何值:

编辑
我的理解,如果#img_preview{width:200px;}应用它会导致这个:

我正在寻找一种解决方案,以按创建日期yy-mm-dd而不是 Mac 和 Ubuntu 的实际日期来重命名文件。我已经知道如何使用 AppleScript 创建一个应用程序并每小时调用它,launchd当文件被发送到存储库时,Ubuntu 使用 CRON 作业进行存储,而这些文件在文件的开头没有创建日期。
我可以通过今天的日期重命名文件:
for file in *.zip; do
mv -n "$file" "$(date +%Y%m%d_"$file")"
done
Run Code Online (Sandbox Code Playgroud)
但是当我尝试:
for f in *.zip; do
D=$(stat -n '%Y%m%d' $f)
mv -v "$f" "$D_$f"
done
Run Code Online (Sandbox Code Playgroud)
没发生什么事。我可以用来stat foobar.zip获取文件的日期,但是有没有办法可以为创建日期执行此操作,因此当我编写条件以测试是否不存在应用创建日期的日期时?我有点记得能够date -r在 Ubuntu 中做,但在 Mac 上不可用。我已经在 SO、AskUbuntu 和 Unix 上进行了搜索,但是我找不到可以让我选择执行此操作的解决方案。我考虑过测试stat和awk设置为变量D并以这种方式重命名。
我想知道是否有一种简便的方法可以将AppleScript列表转换为分隔每个项目的字符串。我可以以一种我想要的更长的方式来实现这一目标,所以我想知道是否有一种简单的方法可以实现这一目标。基本上,我想获取一个清单,例如{1,2,3}将其转换为string "1, 2, 3"。我可以做类似下面的事情,但是在结果字符串后面导致逗号:
set myList to {"1.0", "1.1", "1.2"}
set Final to ""
if (get count of myList) > 1 then
repeat with theItem in myList
set Final to Final & theItem & ", "
end repeat
end if
Run Code Online (Sandbox Code Playgroud) 如果有超过 100 个 flake8 错误,我想对 PR 发表评论,但它不会禁用合并按钮。
我的方法是这样的:
name: Flake8 Check
on: [pull_request]
jobs:
flake8:
name: Flake8 Check
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v1
with:
python-version: 3.6
- name: Install dependency
run: pip install flake8
- name: Flake8
id: flake
run: echo "::set-output name=number::$(flake8 --config=tools/dev/.flake8 --count -qq)"
- name: comment PR
uses: unsplash/comment-on-pr@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
msg: "There are ${{ steps.flake.outputs.number }} Flake8 errors which is a …Run Code Online (Sandbox Code Playgroud) axios.post我在使用相同的正文发送两次相同的请求时遇到问题。我尝试用谷歌搜索这个问题,但一无所获。我该如何修复它?
应用程序.js
import logo from './logo.svg';
import './App.css';
import Register from "./register";
import SendToken from "./sendToken";
import {BrowserRouter, Routes, Route} from "react-router-dom";
import Confirmation from "./Confirmation";
import {useParams} from "react-router-dom";
function App() {
return (
<BrowserRouter>
<div>
<Routes>
<Route path="/registration" element={<Register/>}/>
<Route path="/confirmation" element={<Confirmation/>}/>
<Route path="/account/registrationConfirm/:data" element={<SendToken/>}/>
</Routes>
</div>
</BrowserRouter>
);
}
export default App;
Run Code Online (Sandbox Code Playgroud)
发送令牌.js
import axios from 'axios';
const SendToken = () => {
let parts = window.location.href.split('/');
let length = parts.length;
let token = parts[length - …Run Code Online (Sandbox Code Playgroud)