我有以下HTML结构:
<div id="container">
<div class='label-item-text drag' data-type='text'>
<div>Right click on me and check the HTML of the duplicated</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
而我正在尝试复制里面的项目#container.不幸的是,我没有按预期工作.
A)我的代码复制了里面的所有项目,实际上我只选了一个
B)我不能正确复制
复制所有项目的代码如下.
$('#container').append($dragRightClick.parent().html());
Run Code Online (Sandbox Code Playgroud)
好了,parent()的$dragRightClick是#container,让我明白为什么它复制的所有项目的原因...
我想复制的只是里面的div #container,这意味着:
<div class='label-item-text drag' data-type='text'>
<div>Right click on me and check the HTML of the duplicated</div>
</div>
Run Code Online (Sandbox Code Playgroud)
但到目前为止我所得到的只是:
<div>Right click on me and check the HTML of the duplicated</div>
Run Code Online (Sandbox Code Playgroud)
以下代码输出上面的代码:
console.log("Clone: " + $dragRightClick.clone().html());
console.log("HTML: " + $dragRightClick.html());
Run Code Online (Sandbox Code Playgroud)
您可以在JSFiddle中查看完整的问题.
我正在尝试使用 Bearer Token 创建 API,但我无法弄清楚:
route::middleware('auth:api')做route::middleware('auth:api')所以,我的Routes\Api.php文件中有以下代码:
Route::get('/login', function (Request $request)
{
if(Auth::guard()->attempt(['email' => $request->email, 'password' => $request->password]) == FALSE)
return response()->json(['status' => FALSE]);
$user = Users::select('id', 'name', 'api_token', 'created_at')->where('email', $request->email)->firstOrFail();
return response()->json(['status' => TRUE, 'user' => $user]);
});
Route::middleware('auth:api')->get('/bookings', function (Request $request)
{
return response()->json(['its working!']);
});
Run Code Online (Sandbox Code Playgroud)
我能够成功连接到路由/login并检索api_token. 现在必须在/bookings路由中使用此令牌才能进行身份验证。
我正在为middleware('auth:api')验证我的 CURL 标头Authorization: Bearer zzzzzzzzz,但它不起作用。
所以基本上我需要了解如何更改背后的代码逻辑,auth:api或者我是否应该创建一个新的中间件并检查请求标头?
我一直在尝试根据我的共享首选项设置加载不同的页面,但没有成功。
基于在 stackoverflow 中找到的几篇文章,我最终得到了以下解决方案:
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:testing/screens/login.dart';
import 'package:testing/screens/home.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
Widget page = Login();
Future getSharedPrefs() async {
String user = Preferences.local.getString('user');
if (user != null) {
print(user);
this.page = Home();
}
}
@override
void initState() {
super.initState();
this.getSharedPrefs();
}
@override
Widget build(BuildContext context) {
return MaterialApp(home: this.page);
}
}
class Preferences {
static SharedPreferences local;
/// Initializes …Run Code Online (Sandbox Code Playgroud) 我使用 VSCode 创建了一个模拟器用于 Flutter 编程目的,一切都很好,除了我不能使用自己的键盘在 TextFields 上书写,我被迫使用 android 的嵌入键盘。
我目前正在使用AdminLTE模板。
但是我在三级菜单上苦苦挣扎。我刚刚尝试使用和不使用我正在使用的该插件,并且我无法弄清楚自己在做什么,因为我的第三级菜单没有显示。
还有一张显示正在发生的事情的图像。

我已经读过,自从启动bootstrap 3以来dropdown-submenu,我就尝试使用它,但没有成功。
<ul class="dropdown-menu">
<li><a href="#">Login</a></li>
<li class="dropdown-submenu">
<a tabindex="-1" href="#">More options</a>
<ul class="dropdown-menu">
<li><a tabindex="-1" href="#">Second level</a></li>
<li class="dropdown-submenu">
<a href="#">More..</a>
<ul class="dropdown-menu">
<li><a href="#">3rd level</a></li>
<li><a href="#">3rd level</a></li>
</ul>
</li>
</ul>
</li>
</ul>
Run Code Online (Sandbox Code Playgroud)
我尝试使用连接从多个表中选择总数时遇到问题.结果COUNT不正确.
我有三张桌子:
Customers
id -> Primary/Autoincrement
name
Documents
id -> Primary/Autoincrement
customer_id
Documents_items
id -> Primary/Autoincrement
document_id
Run Code Online (Sandbox Code Playgroud)
我想获得按客户名称分组的文件和文件项目总数.
SELECT cust.name,
COUNT(doc.id),
COUNT(item.id)
FROM customers AS cust
INNER JOIN documents AS doc ON doc.customer_id = cust.id
INNER JOIN documents_items AS item ON item.document_id = doc.id
GROUP BY cust.name
Run Code Online (Sandbox Code Playgroud)
问题是结果COUNT(doc.id)等于结果COUNT(item.id)不正确.
您可以在SQLFiddle中看到错误的演示示例.
输入示例:
INSERT INTO customers VALUES('John')
INSERT INTO documents VALUES(1)
INSERT INTO documents_items VALUES(1), VALUES(1)
Run Code Online (Sandbox Code Playgroud)
预期产量:
Name | Total Docs | Total …Run Code Online (Sandbox Code Playgroud) Krypton曾经是一个购买项目,但现在它在Github上展示了个人和商业项目.
https://github.com/ComponentFactory/Krypton
我正在使用Visual Studio 2012,这个组件似乎可以在这个版本中工作,因为我引用:
包含所有控件和组件的完整源代码以及Visual Studio的2005,2008和2010版本的Visual Studio项目和解决方案文件.如果您使用的是较新版本的Visual Studio,您仍然可以加载解决方案,它将编译得很好.
我已经下载了github文件,我有一堆dll文件.我已将这些dll文件添加到我的Visual Studio工具箱中.
会发生什么事情是成功添加项目但是当我将它们拖放到表单中时它们不会出现.我已经尝试过Buttons,DataGridViews等,它们都不起作用.
我运行时项目没有显示错误.我错过了什么?
我需要加密一些 SOAP 标头字段,并且我目前在使用 PHP 5.6 版本的项目中使用以下代码。
function getBaseEncoded($data, $key)
{
$size = $this->pkcs5_pad($data, mcrypt_get_block_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB));
$iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB), MCRYPT_RAND);
$result = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $size, MCRYPT_MODE_ECB, $iv);
return trim(base64_encode($result));
}
private function pkcs5_pad($text, $blocksize)
{
$pad = $blocksize - (strlen($text) % $blocksize);
return $text . str_repeat (chr($pad), $pad);
}
Run Code Online (Sandbox Code Playgroud)
发生的情况是,现在我手头有一个类似的项目,但使用 PHP 7,并且不推荐使用 MCRYPT 函数,我需要将其切换到 OPENSSL_ENCRYPT。
下面的代码是我的第一次尝试:
function getBaseEncoded($data, $key)
{
$result = openssl_encrypt($data, 'AES-128-ECB', $key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING);
return trim(base64_encode($result));
}
Run Code Online (Sandbox Code Playgroud)
但我现在收到一个 SOAP 错误消息
SoapFault => 无法连接到主机
它让我思考问题是否出在我的新功能上?
我的通知在 android 中工作没有任何问题,但在 iOS 中我无法弄清楚似乎是什么问题。
我正在使用firebase_messaging插件,并在我的main.dart输入:
@override
void initState() {
super.initState();
if (Platform.isIOS)
this.fbaseMessaging.requestNotificationPermissions(
IosNotificationSettings(sound: true, badge: true, alert: true),
);
}
Run Code Online (Sandbox Code Playgroud)
当用户登录时,我获取令牌:
fbaseMessaging.getToken().then((token) {
// Updates the user account
});
Run Code Online (Sandbox Code Playgroud)
我已经在 Xcode Simulator、TestFlight 的 iOS 设备以及已发布的版本中进行了测试,但从未收到任何通知,也不知道如何调试问题出在哪里。
遵循了几个教程,例如:
我正在上传一个 iPhone 图像 - 由 iPhone 相机垂直拍摄 - 尺寸为2448x3264并且因为这个尺寸太高(?),当我创建600x360它的拇指时它会自动旋转到水平。
我试过什么没有成功:
fit功能resize功能crop功能upsize和aspectRatio方法height和使用 null onwidthwidth和使用 null onheight拇指的最大高度必须为360,如果宽度不是 ,我就可以了600。
$imageResize = Image::make($originalFile);
$imageResize->fit(600, 360, function ($constraint)
{
$constraint->upsize();
});
$imageResize->save($thumbPath);
Run Code Online (Sandbox Code Playgroud)
我的目标是:
我怎样才能做到这一点?