我是一个全新的java新手,我有这个问题.我尝试解码Json,为了做到这一点,我想导入这些包:
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
Run Code Online (Sandbox Code Playgroud)
"导入无法解决"......这些软件包是否已不可用,或者我是否必须做其他事情才能使它们正常工作?
Thanx提前.
我想要一个带有 js 单击的按钮datatable row,但我的代码被datatables paging系统默认数据表选项破坏了。单击仅适用于第一个数据表页面。我唯一的想法是禁用分页并创建可滚动数据表,但我更愿意保留分页以获得更好的用户体验。
数据表示例:
<table id="data_tables">
<thead>
<tr>
<td>Action</td>
<td>Name</td>
<td>Surname</td>
<tr>
</thead>
<tbody>
<!-- Datarow 1 -->
<tr>
<td><input type='button' class='my_button' data-id='1' value='click' /></td>
<td>John</td>
<td>Wayne</td>
</tr>
<!-- Datarow 2 -->
<tr>
<td><input type='button' class='my_button' data-id='2' value='click' /></td>
<td>Clark</td>
<td>Kent</td>
</tr>
</tbody>
</table>
Run Code Online (Sandbox Code Playgroud)
单击事件处理程序
//simple on() in jquery would do the trick in normal <table>
$( ".my_button" ).on( "click", function() {
var id = $(this).attr("data-id");
alert(id);
});
Run Code Online (Sandbox Code Playgroud)
有办法解决这个问题吗?或者可能是数据表API解决方案?
这是我第一个问自己关于stackoverflow的问题 - 这个网站已经帮了我很多次了.请理解:)
我有jqPlot的问题看起来很简单,但它似乎不是.
我想在Y轴(ticks)中给出静态字符名称.Y轴值来自Y轴上的实际高度.我想创建名称,如:值1,值2,值3,值4,值5 ...而不是(例如)1.5,3.0,4.5,7.0,100.0 ...
是否可以单独使用jqPlot配置.我不能看到这样的选项,但也许有一个,我会感到惭愧:).
预先感谢您的任何帮助.
(编辑)这是我使用的完整代码:
var plot2 = $.jqplot('chart2', [line_oczekiwana_srednia, line_sd_plus_1, line_sd_plus_2, line_sd_plus_3, line_sd_plus_4, line_sd_minus_1, line_sd_minus_2, line_sd_minus_3, line_sd_minus_4, line1, line_WEST4, ], {
animate: true,
title:'OLYMPUS LEVEL 1 0029 : Kontrola biochemii. Typ materia?u: Surowica',
axes:{
xaxis:{
renderer:$.jqplot.DateAxisRenderer,
tickOptions:{
formatString:'%#d-%m-%y %#H:%M',
angle: -30,
},
tickRenderer:$.jqplot.CanvasAxisTickRenderer,
label:'Zakres czasu kontroli',
labelOptions:{
fontFamily:'Helvetica',
fontSize: '14pt'
},
labelRenderer: $.jqplot.CanvasAxisLabelRenderer
},
yaxis:{
numberTicks: 9,
ticks:[3.6284,3.6863,3.7442,3.8021,3.8600,3.9179,3.9758,4.0337,4.0916],
renderer:$.jqplot.LogAxisRenderer,
tickOptions:{
showGridline: false,
**formatString:'SDx:%.1f',**
labelPosition: 'middle',
angle:-0,
},
tickRenderer:$.jqplot.CanvasAxisTickRenderer,
labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
labelOptions:{
fontFamily:'Helvetica',
fontSize: '14pt' …Run Code Online (Sandbox Code Playgroud) 我从URL有这个Json:
{
"type":"FeatureCollection",
"features":
[
{
"type":"Feature",
"properties":
[
{
"type":"colliers",
"thumb":"upload\/estate\/135\/thumb_1. Prologis Park Wroclaw I.jpg",
"name_pl":"Prologis Park Wroc\u0142aw I",
"name_en":"Prologis Park Wroc\u0142aw I",
"completearea":"167 000",
"completeareaunit":"m2",
"workingarea":"",
"workingareaunit":"m2",
"id_type":"3",
"id":"135",
"lon":16.939201369628,
"lat":51.037378299619,
"images":["public\/upload\/estate\/135\/1. Prologis Park Wroclaw I.jpg"]
}
],
"geometry":
{
"type":"Point",
"coordinates":[16.939201369628,51.037378299619]
},
"crs":
{
"type":"name",
"properties":{"name":"urn:ogc:def:crs:OGC:1.3:CRS84"}
}
},
{
"type":"Feature",
"properties":
[
{
"type":"colliers",
"thumb":"upload\/estate\/136\/thumb_2. Prologis Park Wroclaw III.jpg",
"name_pl":"Prologis Park Wroc\u0142aw III",
"name_en":"Prologis Park Wroclaw III",
"completearea":"129 500",
"completeareaunit":"m2",
"workingarea":"",
"workingareaunit":"m2",
"id_type":"3",
"id":"136",
"lon":16.928386702881,
"lat":51.105440250407,
"images": …Run Code Online (Sandbox Code Playgroud) 当你有字符串键时,很容易从JSON获得一个值,但如果你有这样的情况怎么办:
{
"images":["URL1"]
}
Run Code Online (Sandbox Code Playgroud)
而阵列里面没有钥匙?我用这个代码:
JSONArray imagesArr = propertiesjsonObject.getJSONArray("images");
for (int y=0; i<imagesArr.length(); y++)
{
JSONObject imagesJsonObject = imagesArr.getJSONObject(y);
String str_image_url = imagesJsonObject.get("HOW TO GET THE VALUES HERE?");
}
Run Code Online (Sandbox Code Playgroud)
可以说它非常容易.很抱歉,但我找不到合适的例子.PS.我用:import org.json.JSONArray; import org.json.JSONObject;
PS2:目前阵列中只有一个元素,但将来我可能会有更多元素.
我有这个代码:
public TextView main_text;//begining of the class
main_text = (TextView) findViewById(R.id.TextMain); //inside OnCreate
main_text.setEnabled(false); //inside button handler
Run Code Online (Sandbox Code Playgroud)
而现在是Xml的一部分
<TextView
android:id="@+id/TextMain"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="left"
android:textColor="#FFFFFF"
android:text="@string/home_load" >
</TextView>
Run Code Online (Sandbox Code Playgroud)
为什么SetEnable不起作用?它应该是显而易见的.
我有一个数据库,其中有多个公司名称。我需要进行查询以查找:公司名称、条目数、最新条目的日期。
最好按最新条目的日期排序(但我什至可以在 Excel 中排序)
SELECT
/*this is the list of companies with distinct name */
DISTINCT(K.COMPANY) AS company_name,
/*where I count entries*/
(SELECT COUNT(KK.COMPANIES) FROM COMPANIES KK
WHERE KK.COMPANY = K.company_name) AS company_count,
/*where I try to get newest entry date*/
(SELECT TOP 1 ENTRY_DATE FROM COMPANIES KKK
WHERE KKK.COMPANY = K.company_name
ORDER BY KKK.ENTRY_DATE DESC) AS company_date
FROM
COMPANIES K
WHERE
K.ENTRY_DATE > '20211004 00:00:00'
ORDER BY
K.ID_KAMSOFT DESC
Run Code Online (Sandbox Code Playgroud)
我收到错误:
无效的列名
在子查询中。基本上,子查询看不到条件中外部查询的数据xxx.COMPANY = K.company_name。
它应该非常简单,但它不起作用。
我有一个连接到web服务的php系统,获取数据并根据该数据生成txt文件... - 这一切都在数据结束时自动进行.
问题是:客户想要自己输入一些值 - 比如......每次读取一条mssql记录时,他想要为自己的系统更改id(每次系统运行时都有很多记录).
所以基本上他需要一个如此容易在js中创建的提示框.
但是有没有办法在php循环中创建任何类型的brompt框?
我正在用c ++加载一个delphi dll.当我使用char*作为缓冲区的函数(char*作为过程的参数给出)时,我只得到垃圾数据.当我有返回char*的函数时,一切都很好.
我是c ++的新手,我花了很多时间试图解决这个问题.请帮忙.
一切都在下面的代码中解释.我已经有3个功能来展示我的意思.
缓冲区有问题的示例函数是:DLL_PingConnection(var avXml:PChar):Boolean; - 它返回true/false,作为参数,它需要缓冲区并且函数在缓冲区中完成,应该有有效的xml(但只有垃圾)
#include <windows.h> //this will load delphi dll
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <string.h>
using namespace std;
// ------------------------------------------------ pointers on functions inside Delphi DLL (32 bits)
typedef bool(*TYPE_DLL_SetLicense)(char*, char*); //initialize dll stuff - I load licence from a file into char* - everything works fine
typedef bool(*TYPE_DLL_PingConnection)(char*); //the char* is buffer - I give empty char* as parameter and I should get correct xml with serwer data - …Run Code Online (Sandbox Code Playgroud)