我正在尝试构建一个插件,允许管理员添加有关特定包的数据(就像创建用户一样)。在前端,我将有一个表单,允许访问者使用管理员分配给该包的 id 搜索特定包。
我使用 php 构建了系统并且它工作正常。现在我想把它变成一个 WordPress 插件,我发现很难将表单数据发送到插件激活时创建的 wpdb 表(wp_demo)。
这是表格:
function registration_init(){
echo '<form action="demo.php" method="post" />';
echo "<h1>Britchi Tracking</h1>";
echo '<p>';
echo 'Costumers Name (required) <br/>';
echo '<input type="text" name="cname" placeholder="Emmanuel John"/>';
echo '</p>';
echo '<p>';
echo 'Tracking number (required) <br/>';
echo '<input type="text" name="ctracking" placeholder="EEX28PDS"/>';
echo '</p>';
echo '<p>';
echo 'Email (required) <br/>';
echo '<input type="email" name="cemail" placeholder="Email"/>';
echo '</p>';
echo '<p>';
echo 'Recived Port (required) <br/>';
echo '<input type="text" name="crport" placeholder="Brazil Port"/>';
echo '</p>';
echo '<p>'; …Run Code Online (Sandbox Code Playgroud) 我正在学习 Azure 事件中心。我从这个链接https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-dotnet-standard-getstarted-send下载了一个简单的应用程序。但是当我尝试发送消息时,它给了我这个错误:
10/23/2018 11:11:13 PM > 例外:放置令牌失败。状态代码:404,状态描述:无法找到消息实体“sb://demo.servicebus.windows.net/myTeam”。TrackingId:[我的跟踪 ID], SystemTracker:iot-bd-madness.servicebus.windows.net:IoT-BD-Madness, Timestamp:10/23/2018 5:11:18 PM。
在 Azure 事件中心仪表板中,所有传入请求(从控制台应用程序发送)都可以通过图表看到。但是当我在控制台应用程序中尝试时,这些请求实际上都失败了
注意:给定的连接字符串不是真实的
public class Program
{
private static EventHubClient eventHubClient;
private const string EventHubConnectionString = "Endpoint=sb://iot-bd-madness.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
private const string EventHubName = "Iot-Bd-Madness";
public static void Main(string[] args)
{
MainAsync(args).GetAwaiter().GetResult();
}
private static async Task MainAsync(string[] args)
{
// Creates an EventHubsConnectionStringBuilder object from a the connection string, and sets the EntityPath.
// Typically the connection string should have the Entity Path in it, …Run Code Online (Sandbox Code Playgroud) 我有一个通用处理程序函数,它接受一个事件,可以是鼠标事件,也可以是触摸事件。然后它将逻辑委托给适当的函数。不过,Typescript 会抛出错误,因为显然mouseEvent !== touchEvent.
function handleStopDrag(e: MouseEvent | TouchEvent) {
switch (e.type) {
case 'mouseup':
// Error: Argument of type 'MouseEvent | TouchEvent' is not assignable to parameter of type 'MouseEvent'.
handleMouseUp(e)
break
case 'touchcancel':
case 'touchend':
// Error: Argument of type 'MouseEvent | TouchEvent' is not assignable to parameter of type 'TouchEvent'.
handleTouchEnd(e)
break
}
}
function handleMouseUp(e: MouseEvent){ ... }
function handleTouchEnd(e: TouchEvent) { ... }
Run Code Online (Sandbox Code Playgroud)
我如何根据上面的检查来声明事件类型是特定类型?或者是否有更好的方法来格式化我的代码以指定事件类型?
我正在开发一个 React Native 应用程序。我的代码没有错误,但它面临构建问题。当我执行命令react-native run-android 时,我在 Metro Bundler 中收到错误。错误说:
UnhandledPromiseRejectionWarning: Failed to start watch mode.
Run Code Online (Sandbox Code Playgroud)
我还尝试使用命令 add watchman 将$yarnWatchman 添加到 node_modules 。我收到提示说它已被弃用。
我应该如何解决该错误?
我的 package.json 包含以下内容:
"dependencies": {
"expo": "^25.0.0",
"native-base": "^2.3.7",
"react": "16.2.0",
"react-native": "0.52.0",
"react-native-vector-icons": "^4.5.0",
"react-navigation": "^1.0.0-beta.27",
"watchman": "^1.0.0"
}
"devDependencies": {
"babel-jest": "22.1.0",
"babel-preset-react-native": "4.0.0",
"jest": "22.1.3",
"react-test-renderer": "16.2.0"
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试通过 Visual Studio 升级我的 Service Fabric 应用程序。
我最终不得不使用 diff 包方法来确保只有我更改的服务在升级中。
我是通过删除不需要的文件的命令文件完成的。
现在我遇到了另一个错误,由于缺乏细节而令人讨厌:
Start-ServiceFabricApplicationUpgrade : Default service descriptions can not be modified as part of upgrade. Modified
2>default service: fabric:/MYAPPLICATION/MYSERVICE. To allow it, set
2>EnableDefaultServicesUpgrade to true.
Run Code Online (Sandbox Code Playgroud)
我到底把这个放在哪里?
请注意,这是来自 Visual Studio。
我很少在使用 PowerShell 时获得任何乐趣。
我已经看到了对 Update-ServiceFabricService CmdLet 的引用,但是没有关于我需要做什么的更多信息。
我在应用程序清单中尝试过这个,但没有成功:
<?xml version="1.0" encoding="utf-8"?>
<ApplicationManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ApplicationTypeName="MyServiceFabricApplication.ServiceFabricType" ApplicationTypeVersion="7.0.0" xmlns="http://schemas.microsoft.com/2011/01/fabric">
<Parameters>
<Parameter Name="EnableDefaultServicesUpgrade" DefaultValue="true" />
<Parameter Name="MyParameter" DefaultValue="value" />
Parameters>
<ServiceManifestImport>
<ServiceManifestRef ServiceManifestName="MyServiceFabricApplication.Service1.ServiceFabricPkg" ServiceManifestVersion="4.0.0" />
<ConfigOverrides>
<ConfigOverride Name="Config">
<Settings>
<Section Name="appSettings">
<Parameter Name="MyParameter" …Run Code Online (Sandbox Code Playgroud) 我无法理解这些指数:
0000 0000= -126而不是-127(即0-127)?
1111 1111多少?0 1111 1111 0000 0000 0000 0000 0000 000等于无穷大?我对这一切都很陌生,所以请用简单的术语解释!谢谢!
我是新的 Dynamics CRM。我的项目包括表单提交和验证。我计划使用带有 Redux 前端的 React 和 CRM 的服务来构建一个产品。
构建 CRM Web 资源的 CRM 最佳实践是什么 谁能指导我?
https://github.com/sonomapartners/web-resources-with-react
import 'babel-polyfill';
import React from 'react';
import ReactDOM from 'react-dom';
import CaseSummary from './components/CaseSummary.jsx';
window.addEventListener('load', function onLoad() {
ReactDOM.render( <CaseSummary />,
document.getElementById("container") );
});
Run Code Online (Sandbox Code Playgroud) 我正在编写一个使用 Azure 媒体播放器的 React/TypeScript 项目。根据引用播放器下的文档,我应该能够像这样引用播放器:
var myPlayer = amp('vid1');
Run Code Online (Sandbox Code Playgroud)
然后我得到一个编译器错误:
TypeScript error in C:/<file path>/<file name>.tsx(47,17):
Cannot find namespace 'amp'. TS2503
Run Code Online (Sandbox Code Playgroud)
我看到这是一个 TypeScript 错误,但文档是为 JavaScript 编写的。
所以我尝试打字稿:
let player: amp.Player = amp("player");
Run Code Online (Sandbox Code Playgroud)
同样的编译器错误。
如何在我的 React/TypeScript 项目中引用 AMP 播放器?
namespaces azure typescript azure-media-services azure-media-player
我正在做一些可访问性测试。在网站上,他们有一个注册表并使用表单验证技术。错误文本显示在表单域下,其中表单域中插入的数据无效。目前,错误文本会即时出现,而不是在表单提交中。当您用 Tab 键浏览表单时,会出现错误。
按照设计,在表单字段数据有效之前,表单提交按钮不可见。因此,目前无法对表单提交进行错误检查。
在这种情况下,什么被认为是“最佳实践”?我觉得他们需要改变这个表格的设计方式来满足 WCAG。
在字段上使用 aria-describeby 并与错误消息相关联似乎没有什么意义,因为在错误出现时,用户已移动到新字段。他们是否应该希望显示提交按钮,然后在表单提交失败时允许宣布错误?或者屏幕上的错误文本更改是否存在另一个问题,但没有更改提醒屏幕阅读器?
string o=null;
Console.WriteLine($"Hello World '{o}'");
Run Code Online (Sandbox Code Playgroud)
这输出:
你好世界 ''
我想明确地为空值写“null”。
string o=null;
Console.WriteLine($"Hello World '{o??"null"}'");
Run Code Online (Sandbox Code Playgroud)
这就是这样做的:
你好世界“空”
但如果o不是类型string(或Object),则会生成编译错误。例如:
Array o=null;
Console.WriteLine($"Hello World '{o??"null"}'");
Run Code Online (Sandbox Code Playgroud)
编译错误运算符'??' 不能应用于“Array”和“string”类型的操作数
达到预期结果的最佳方法是什么?遗憾的是您无法修改$句柄的方式null,因为它似乎是硬编码的使用方式String.EmptyString
c# null conditional-operator null-coalescing-operator string-interpolation
c# ×3
azure ×2
typescript ×2
dynamics-crm ×1
ieee ×1
namespaces ×1
null ×1
php ×1
react-native ×1
reactjs ×1
watchman ×1
wcag2.0 ×1
wordpress ×1