- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>3.8.1</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.6.4</version>
</dependency>
<dependency>
<groupId>com.xuxueli</groupId>
<artifactId>xxl-job-core</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.20</version>
</dependency>
xxl:
job:
login:
address: http://192.168.31.91:18080/xxl-job-admin
username: admin
password: 123456
XxlJobActuatorManagerInfo
@Data
@NoArgsConstructor
@AllArgsConstructor
public class XxlJobActuatorManagerInfo {
private Integer recordsFiltered;
private Integer recordsTotal;
private List<XxlJobGroup> data;
}
XxlJobGroup
@Data
@NoArgsConstructor
@AllArgsConstructor
public class XxlJobGroup {
private int id;
private String appname;
private String title;
private int addressType; // 执行器地址类型:0=自动注册、1=手动录入
private String addressList; // 执行器地址列表,多地址逗号分隔(手动录入)
private Date updateTime;
// registry list
private List<String> registryList; // 执行器地址列表(系统注册)
public List<String> getRegistryList() {
if (addressList!=null && addressList.trim().length()>0) {
registryList = new ArrayList<String>(Arrays.asList(addressList.split(",")));
}
return registryList;
}
}
XxlJobInfo
@Data
@NoArgsConstructor
@AllArgsConstructor
public class XxlJobInfo {
private int id; // 主键ID
private int jobGroup; // 执行器主键ID
private String jobDesc;
private String jobCron; //corn表达式
private Date addTime;
private Date updateTime;
private String author; // 负责人
private String alarmEmail; // 报警邮件
private String scheduleType; // 调度类型
private String scheduleConf; // 调度配置,值含义取决于调度类型
private String misfireStrategy; // 调度过期策略
private String executorRouteStrategy; // 执行器路由策略
private String executorHandler; // 执行器,任务Handler名称
private String executorParam; // 执行器,任务参数
private String executorBlockStrategy; // 阻塞处理策略
private int executorTimeout; // 任务执行超时时间,单位秒
private int executorFailRetryCount; // 失败重试次数
private String glueType; // GLUE类型 #com.xxl.job.core.glue.GlueTypeEnum
private String glueSource; // GLUE源代码
private String glueRemark; // GLUE备注
private Date glueUpdatetime; // GLUE更新时间
private String childJobId; // 子任务ID,多个逗号分隔
private int triggerStatus; // 调度状态:0-停止,1-运行
private long triggerLastTime; // 上次调度时间
private long triggerNextTime; // 下次调度时间
}
XxlJobResponseInfo
@Data
@NoArgsConstructor
@AllArgsConstructor
public class XxlJobResponseInfo {
private Integer code;
private String msg;
private String content;
}
XxlJobTaskManagerInfo
@Data
@NoArgsConstructor
@AllArgsConstructor
public class XxlJobTaskManagerInfo {
private Integer recordsFiltered;
private Integer recordsTotal;
private List<XxlJobInfo> data;
}
@Data
@NoArgsConstructor
@AllArgsConstructor
public class HttpClientConfig {
private String url;
private String username;
private String password;
private String oauthToken;
private int connectionTimeout = 60000;
private int requestTimeout = 60000;
private int webSocketPingInterval;
private int maxConcurrentRequestsPerHost = 30;
private int maxConnection = 40;
private String httpProxy;
private String httpsProxy;
private String proxyUsername;
private String proxyPassword;
private String userAgent;
private TlsVersion[] tlsVersions = new TlsVersion[]{TLS_1_2};
private String[] noProxy;
public static final String HTTP_PROTOCOL_PREFIX = "http://";
public static final String HTTPS_PROTOCOL_PREFIX = "https://";
}
package com.mye.xxljobtest.util;
import okhttp3.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpMethod;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.MalformedURLException;
import java.net.Proxy;
import java.net.URL;
import java.util.Arrays;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import static okhttp3.ConnectionSpec.CLEARTEXT;
public class HttpClientUtils {
private static final Logger logger = LoggerFactory.getLogger(HttpClientUtils.class);
/**
* json传输方式
*/
private static final MediaType JSON = MediaType.parse("application/json; charset=utf-8");
private static volatile OkHttpClient client;
public static Headers doLoginRequest(HttpClientConfig config, Map<String, String> params) {
try {
OkHttpClient client = getInstance(config);
FormBody.Builder builder = new FormBody.Builder();
for (Map.Entry<String, String> param : params.entrySet()) {
builder.add(param.getKey(), param.getValue());
}
FormBody formBody = builder.build();
Request request = new Request.Builder().url(config.getUrl()).post(formBody).build();
Response response = client.newCall(request).execute();
if (response.isSuccessful() && response.body() != null) {
System.out.println(JsonUtil.objectToJson(response));
return response.headers();
} else if (response.body() != null){
return null;
}
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
public static String doFormRequest(HttpClientConfig config, Map<String, String> params, String cookie) {
try {
OkHttpClient client = getInstance(config);
FormBody.Builder builder = new FormBody.Builder();
for (Map.Entry<String, String> param : params.entrySet()) {
builder.add(param.getKey(), param.getValue());
}
FormBody formBody = builder.build();
Request request = new Request.Builder().url(config.getUrl()).header("Cookie", cookie).post(formBody).build();
Response response = client.newCall(request).execute();
if (response.isSuccessful() && response.body() != null) {
System.out.println(JsonUtil.objectToJson(response));
return response.body().string();
} else if (response.body() != null){
return response.body().string();
}
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
public static String doRequest(HttpClientConfig config, HttpMethod method, Map<String, String> headers, String body) {
try {
OkHttpClient client = getInstance(config);
//创建请求
RequestBody requestBody = RequestBody.create(JSON, StringUtils.isEmpty(body) ? "" : body);
Request.Builder builder = new Request.Builder();
if (!CollectionUtils.isEmpty(headers)) {
logger.info("headers : " + headers);
builder.headers(Headers.of(headers));
}
Request request = builder.method(method.name(), requestBody).url(config.getUrl()).build();
Response response = client.newCall(request).execute();
if (response.isSuccessful() && response.body() != null) {
return response.body().string();
} else if (response.body() != null){
return response.body().string();
}
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
/**
* 双重检查单例
* @param config OkHttpClient配置
* @return okHttpClient
*/
public static OkHttpClient getInstance(HttpClientConfig config) {
if (client == null) {
synchronized (OkHttpClient.class) {
if (client == null) {
client = createHttpClient(config);
}
}
}
//拿到client之后把认证信息重新加一遍
client.newBuilder().addInterceptor(chain -> {
Request request = chain.request();
if (StringUtils.hasText(config.getUsername()) && StringUtils.hasText(config.getPassword())) {
Request authReq = chain.request().newBuilder().addHeader("Authorization", Credentials.basic(config.getUsername(), config.getPassword())).build();
return chain.proceed(authReq);
} else if (StringUtils.hasText( config.getOauthToken())) {
Request authReq = chain.request().newBuilder().addHeader("Authorization", "Bearer " + config.getOauthToken()).build();
return chain.proceed(authReq);
}
return chain.proceed(request);
});
return client;
}
private static OkHttpClient createHttpClient(final HttpClientConfig config) {
try {
OkHttpClient.Builder httpClientBuilder = new OkHttpClient.Builder();
httpClientBuilder.followRedirects(true);
httpClientBuilder.followSslRedirects(true);
if (config.getConnectionTimeout() > 0) {
httpClientBuilder.connectTimeout(config.getConnectionTimeout(), TimeUnit.MILLISECONDS);
}
if (config.getRequestTimeout() > 0) {
httpClientBuilder.readTimeout(config.getRequestTimeout(), TimeUnit.MILLISECONDS);
}
if (config.getWebSocketPingInterval() > 0) {
httpClientBuilder.pingInterval(config.getWebSocketPingInterval(), TimeUnit.MILLISECONDS);
}
if (config.getMaxConcurrentRequestsPerHost() > 0) {
Dispatcher dispatcher = new Dispatcher();
dispatcher.setMaxRequestsPerHost(config.getMaxConcurrentRequestsPerHost());
httpClientBuilder.dispatcher(dispatcher);
}
if (config.getMaxConnection() > 0) {
ConnectionPool connectionPool = new ConnectionPool(config.getMaxConnection(), 60, TimeUnit.SECONDS);
httpClientBuilder.connectionPool(connectionPool);
}
// Only check proxy if it's a full URL with protocol
if (config.getUrl().toLowerCase().startsWith(HttpClientConfig.HTTP_PROTOCOL_PREFIX) || config.getUrl().startsWith(HttpClientConfig.HTTPS_PROTOCOL_PREFIX)) {
try {
URL proxyUrl = getProxyUrl(config);
if (proxyUrl != null) {
httpClientBuilder.proxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyUrl.getHost(), proxyUrl.getPort())));
if (config.getProxyUsername() != null) {
httpClientBuilder.proxyAuthenticator((route, response) -> {
String credential = Credentials.basic(config.getProxyUsername(), config.getProxyPassword());
return response.request().newBuilder().header("Proxy-Authorization", credential).build();
});
}
}
} catch (MalformedURLException e) {
throw new IllegalArgumentException("Invalid proxy server configuration", e);
}
}
if (config.getUserAgent() != null && !config.getUserAgent().isEmpty()) {
httpClientBuilder.addNetworkInterceptor(chain -> {
Request agent = chain.request().newBuilder().header("User-Agent", config.getUserAgent()).build();
return chain.proceed(agent);
});
}
if (config.getTlsVersions() != null && config.getTlsVersions().length > 0) {
ConnectionSpec spec = new ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS)
.tlsVersions(config.getTlsVersions())
.build();
httpClientBuilder.connectionSpecs(Arrays.asList(spec, CLEARTEXT));
}
return httpClientBuilder.build();
} catch (Exception e) {
throw new IllegalArgumentException("创建OKHTTPClient错误", e);
}
}
private static URL getProxyUrl(HttpClientConfig config) throws MalformedURLException {
URL master = new URL(config.getUrl());
String host = master.getHost();
if (config.getNoProxy() != null) {
for (String noProxy : config.getNoProxy()) {
if (host.endsWith(noProxy)) {
return null;
}
}
}
String proxy = config.getHttpsProxy();
String http = "http";
if (http.equals(master.getProtocol())) {
proxy = config.getHttpProxy();
}
if (proxy != null) {
return new URL(proxy);
}
return null;
}
}
package com.mye.xxljobtest.util;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONUtil;
import com.mye.xxljobtest.jobcore.*;
import okhttp3.Headers;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* xxl-job api 操作工具类
* @author hl
* @date 2022/8/1 14:05
*/
@Component
public class XxlJobApiUtils {
private static final Logger logger = LoggerFactory.getLogger(XxlJobApiUtils.class);
@Value("${xxl.job.login.address}")
private String xxlJobLoginAddress;
@Value("${xxl.job.login.username}")
private String xxlJobLoginUserName;
@Value("${xxl.job.login.password}")
private String xxlJobLoginPassword;
/**
* 启动xxl-job任务管理
* @param taskId 任务管理id
*/
public void startTask(Integer taskId){
//获取登录cookie
HttpClientConfig clientConfig = new HttpClientConfig();
String cookie = loginTaskCenter(clientConfig);
//创建参数
Map<String, String> form = new HashMap<>();
form.put("id", "" + taskId);
clientConfig.setUrl(xxlJobLoginAddress + "/jobinfo/start");
String result = HttpClientUtils.doFormRequest(clientConfig, form, cookie);
XxlJobResponseInfo info = JSONUtil.toBean(JSONUtil.parseObj(result), XxlJobResponseInfo.class);
if (ObjectUtil.isNull(info) || info.getCode() != HttpStatus.OK.value()){
logger.error(info.getMsg(),new RuntimeException());
}
}
/**
* 删除 xxl-job任务管理
* @param id 任务id
*/
public void deleteTask(Integer id){
//获取登录cookie
HttpClientConfig clientConfig = new HttpClientConfig();
String cookie = loginTaskCenter(clientConfig);
//创建任务管理参数
Map<String, String> form = new HashMap<>();
form.put("id", id + "");
clientConfig.setUrl(xxlJobLoginAddress + "/jobinfo/remove");
String result = HttpClientUtils.doFormRequest(clientConfig, form, cookie);
XxlJobResponseInfo info = JSONUtil.toBean(JSONUtil.parseObj(result), XxlJobResponseInfo.class);
if (ObjectUtil.isNull(info) || info.getCode() != HttpStatus.OK.value()){
logger.error(info.getMsg(),new RuntimeException());
}
}
/**
* 编辑 xxl-job任务管理
* @param xxlJobInfo 查询参数
*/
public void editTask(XxlJobInfo xxlJobInfo){
//获取登录cookie
HttpClientConfig clientConfig = new HttpClientConfig();
String cookie = loginTaskCenter(clientConfig);
//创建任务管理参数
Map<String, String> form = new HashMap<>();
form.put("id",xxlJobInfo.getId() + "");
form.put("jobGroup", xxlJobInfo.getJobGroup() + "");
form.put("jobDesc", xxlJobInfo.getJobDesc());
form.put("executorRouteStrategy", "ROUND");
form.put("jobCron", xxlJobInfo.getJobCorn());
form.put("glueType", "BEAN");
form.put("executorHandler", xxlJobInfo.getExecutorHandler());
form.put("executorBlockStrategy", "SERIAL_EXECUTION");
form.put("author", "mye");
clientConfig.setUrl(xxlJobLoginAddress + "/jobinfo/update");
String result = HttpClientUtils.doFormRequest(clientConfig, form, cookie);
XxlJobResponseInfo info = JSONUtil.toBean(JSONUtil.parseObj(result), XxlJobResponseInfo.class);
if (ObjectUtil.isNull(info) || info.getCode() != HttpStatus.OK.value()){
logger.error(info.getMsg(),new RuntimeException());
}
}
/**
* 查询所有的task
* @param xxlJobInfo
* @return
*/
public XxlJobTaskManagerInfo selectAllTask(XxlJobInfo xxlJobInfo) {
//获取登录cookie
HttpClientConfig clientConfig = new HttpClientConfig();
String cookie = loginTaskCenter(clientConfig);
//创建任务管理参数
Map<String, String> form = new HashMap<>();
form.put("jobGroup", xxlJobInfo.getJobGroup() + "");
form.put("triggerStatus", "-1");
clientConfig.setUrl(xxlJobLoginAddress + "/jobinfo/pageList");
String result = HttpClientUtils.doFormRequest(clientConfig, form, cookie);
return JSONUtil.toBean(JSONUtil.parseObj(result), XxlJobTaskManagerInfo.class);
}
/**
* 查询 xxl-job任务管理
* @param xxlJobInfo 查询参数
*/
public XxlJobTaskManagerInfo selectTask(XxlJobInfo xxlJobInfo){
//获取登录cookie
HttpClientConfig clientConfig = new HttpClientConfig();
String cookie = loginTaskCenter(clientConfig);
//创建任务管理参数
Map<String, String> form = new HashMap<>();
form.put("jobGroup", xxlJobInfo.getJobGroup() + "");
form.put("jobDesc", xxlJobInfo.getJobDesc());
form.put("executorHandler", xxlJobInfo.getExecutorHandler());
form.put("author", xxlJobInfo.getAuthor());
form.put("triggerStatus", "-1");
clientConfig.setUrl(xxlJobLoginAddress + "/jobinfo/pageList");
String result = HttpClientUtils.doFormRequest(clientConfig, form, cookie);
XxlJobTaskManagerInfo info = JSONUtil.toBean(JSONUtil.parseObj(result), XxlJobTaskManagerInfo.class);
if (ObjectUtil.isNull(info) || CollectionUtil.isEmpty(info.getData())){
logger.error("xxl-job任务管理不存在",new RuntimeException());
}
return info;
}
/**
* 创建任务管理
* @param xxlJobInfo 创建参数
*/
public XxlJobResponseInfo createTask(XxlJobInfo xxlJobInfo){
//获取登录cookie
HttpClientConfig clientConfig = new HttpClientConfig();
String cookie = loginTaskCenter(clientConfig);
//创建任务管理参数
Map<String, String> form = new HashMap<>();
form.put("jobGroup", xxlJobInfo.getJobGroup() + "");
form.put("jobDesc", xxlJobInfo.getJobDesc());
form.put("executorRouteStrategy", "ROUND");
form.put("jobCron", xxlJobInfo.getJobCorn());
form.put("glueType", "BEAN");
form.put("executorHandler", xxlJobInfo.getExecutorHandler());
form.put("executorBlockStrategy", "SERIAL_EXECUTION");
form.put("author", "mye");
//创建任务管理
clientConfig.setUrl(xxlJobLoginAddress + "/jobinfo/add");
String result = HttpClientUtils.doFormRequest(clientConfig, form, cookie);
XxlJobResponseInfo info = JSONUtil.toBean(JSONUtil.parseObj(result), XxlJobResponseInfo.class);
if (ObjectUtil.isNull(info) || info.getCode() != HttpStatus.OK.value()){
logger.error(info.getMsg(),new RuntimeException());
}
return info;
}
/**
* 删除执行器
*/
public void deleteActuator(XxlJobGroup xxlJobGroup) {
//获取登录cookie
HttpClientConfig clientConfig = new HttpClientConfig();
String cookie = loginTaskCenter(clientConfig);
//创建查询执行器管理器参数
Map<String, String> form = new HashMap<>();
form.put("id", xxlJobGroup.getId() + "");
//创建执行器管理器地址
clientConfig.setUrl(xxlJobLoginAddress + "/jobgroup/remove");
String result = HttpClientUtils.doFormRequest(clientConfig, form, cookie);
XxlJobResponseInfo info = JSONUtil.toBean(JSONUtil.parseObj(result), XxlJobResponseInfo.class);
if (ObjectUtil.isNull(info) || info.getCode() != HttpStatus.OK.value()) {
logger.error(info.getMsg(), new RuntimeException());
}
}
/**
* 编辑执行器
*/
public void editActuator(XxlJobGroup xxlJobGroup){
//获取登录cookie
HttpClientConfig clientConfig = new HttpClientConfig();
String cookie = loginTaskCenter(clientConfig);
//创建查询执行器管理器参数
Map<String, String> form = new HashMap<>();
form.put("appname", xxlJobGroup.getAppname());
form.put("title", xxlJobGroup.getTitle());
form.put("addressType", xxlJobGroup.getAddressType() + "");
form.put("id", xxlJobGroup.getId() + "");
//创建执行器管理器地址
clientConfig.setUrl(xxlJobLoginAddress + "/jobgroup/update");
String result = HttpClientUtils.doFormRequest(clientConfig, form, cookie);
XxlJobResponseInfo info = JSONUtil.toBean(JSONUtil.parseObj(result), XxlJobResponseInfo.class);
if (ObjectUtil.isNull(info) || info.getCode() != HttpStatus.OK.value()){
logger.error(info.getMsg(),new RuntimeException());
}
}
/**
* 查询执行器 (appname 和 title 都是模糊查询)
* @param xxlJobGroup XxlJobGroup
* @return xxlJobGroup 集合
*/
public List<XxlJobGroup> selectActuator(XxlJobGroup xxlJobGroup){
//获取登录cookie
HttpClientConfig clientConfig = new HttpClientConfig();
String cookie = loginTaskCenter(clientConfig);
//创建查询执行器管理器参数
Map<String, String> form = new HashMap<>();
form.put("appname", xxlJobGroup.getAppname());
form.put("title", xxlJobGroup.getTitle());
//创建执行器管理器地址
clientConfig.setUrl(xxlJobLoginAddress + "/jobgroup/pageList");
String result = HttpClientUtils.doFormRequest(clientConfig, form, cookie);
XxlJobActuatorManagerInfo info = JSONUtil.toBean(JSONUtil.parseObj(result), XxlJobActuatorManagerInfo.class);
if (CollectionUtil.isEmpty(info.getData())){
throw new RuntimeException("该执行器管理器不存在:" + xxlJobGroup.getAppname());
}
return info.getData();
}
/**
* 创建执行器
*
* @param xxlJobGroup 创建参数
*/
public XxlJobResponseInfo createActuator(XxlJobGroup xxlJobGroup) {
//获取登录cookie
HttpClientConfig clientConfig = new HttpClientConfig();
String cookie = loginTaskCenter(clientConfig);
//创建执行器管理器参数
Map<String, String> form = new HashMap<>();
form.put("appname", xxlJobGroup.getAppname());
form.put("title", xxlJobGroup.getTitle());
form.put("addressType", xxlJobGroup.getAddressType() + "");
//创建执行器管理器地址
clientConfig.setUrl(xxlJobLoginAddress + "/jobgroup/save");
String result = HttpClientUtils.doFormRequest(clientConfig, form, cookie);
XxlJobResponseInfo info = JSONUtil.toBean(JSONUtil.parseObj(result), XxlJobResponseInfo.class);
if (ObjectUtil.isNull(info) || info.getCode() != HttpStatus.OK.value()){
logger.error(info.getMsg(),new RuntimeException());
}
return info;
}
/**
* 登录任务调度平台
*
* @param clientConfig clientConfig
* @return cookie
*/
public String loginTaskCenter(HttpClientConfig clientConfig) {
Map<String, String> loginForm = new HashMap<>();
clientConfig.setUrl(xxlJobLoginAddress + "/login");
clientConfig.setUsername(xxlJobLoginUserName);
clientConfig.setPassword(xxlJobLoginPassword);
loginForm.put("userName", xxlJobLoginUserName);
loginForm.put("password", xxlJobLoginPassword);
Headers headers = HttpClientUtils.doLoginRequest(clientConfig, loginForm);
assert headers != null;
return headers.get("Set-Cookie");
}
}
我正在努力做到这一点 在我的操作中从数据库获取对象列表(确定) 在 JSP 上打印(确定) 此列表作为 JSP 中的可编辑表出现。我想修改然后将其提交回同一操作以将其保存在我的数据库中(失败。当我使用
我有以下形式的 Linq to Entities 查询: var x = from a in SomeData where ... some conditions ... select
我有以下查询。 var query = Repository.Query() .Where(p => !p.IsDeleted && p.Article.ArticleSections.Cou
我正在编写一个应用程序包,其中包含一个主类,其中主方法与GUI类分开,GUI类包含一个带有jtabbedpane的jframe,它有两个选项卡,第一个选项卡包含一个jtable,称为jtable1,第
以下代码产生错误 The nested query is not supported. Operation1='Case' Operation2='Collect' 问题是我做错了什么?我该如何解决?
我已经为 HA redis 集群(2 个副本、1 个主节点、3 个哨兵)设置了本地 docker 环境。只有哨兵暴露端口(10021、10022、10023)。 我使用的是 stackexchange
我正在 Desk.com 中构建一个“集成 URL”,它使用 Shopify Liquid 模板过滤器语法。对于开始日期为 7 天前而结束日期为现在的查询,此 URL 需要包含“开始日期”和“结束日期
你一定想过。然而情况却不理想,python中只能使用类似于 i++/i--等操作。 python中的自增操作 下面代码几乎是所有程序员在python中进行自增(减)操作的常用
我需要在每个使用 github 操作的手动构建中显示分支。例如:https://gyazo.com/2131bf83b0df1e2157480e5be842d4fb 我应该显示分支而不是一个。 最佳答
我有一个关于 Perl qr 运算符的问题: #!/usr/bin/perl -w &mysplit("a:b:c", /:/); sub mysplit { my($str, $patt
我已经使用 ArgoUML 创建了一个 ERD(实体关系图),我希望在一个类中创建两个操作,它们都具有 void 返回类型。但是,我只能创建一个返回 void 类型的操作。 例如: 我能够将 book
Github 操作仍处于测试阶段并且很新,但我希望有人可以提供帮助。我认为可以在主分支和拉取请求上运行 github 操作,如下所示: on: pull_request push: b
我正在尝试创建一个 Twilio 工作流来调用电话并记录用户所说的内容。为此,我正在使用 Record,但我不确定要在 action 参数中放置什么。 尽管我知道 Twilio 会发送有关调用该 UR
我不确定这是否可行,但值得一试。我正在使用模板缓冲区来减少使用此算法的延迟渲染器中光体积的过度绘制(当相机位于体积之外时): 使用廉价的着色器,将深度测试设置为 LEQUAL 绘制背面,将它们标记在模
有没有聪明的方法来复制 和 重命名 文件通过 GitHub 操作? 我想将一些自述文件复制到 /docs文件夹(:= 同一个 repo,不是远程的!),它们将根据它们的 frontmatter 重命名
我有一个 .csv 文件,其中第一列包含用户名。它们采用 FirstName LastName 的形式。我想获取 FirstName 并将 LastName 的第一个字符添加到它上面,然后删除空格。然
Sitecore 根据 Sitecore 树中定义的项目名称生成 URL, http://samplewebsite/Pages/Sample Page 但我们的客户有兴趣降低所有 URL(页面/示例
我正在尝试进行一些计算,但是一旦我输入金额,它就会完成。我只是希望通过单击按钮而不是自动发生这种情况。 到目前为止我做了什么: Angular JS - programming-fr
我的公司创建了一种在环境之间移动文件的复杂方法,现在我们希望将某些构建的 JS 文件(已转换和缩小)从一个 github 存储库移动到另一个。使用 github 操作可以实现这一点吗? 最佳答案 最简
在我的代码中,我创建了一个 JSONArray 对象。并向 JSONArray 对象添加了两个 JSONObject。我使用的是 json-simple-1.1.jar。我的代码是 package j
我是一名优秀的程序员,十分优秀!