c3p0遇到报错: 对实体 "serverTimezone" 的引用必须以 ';' 分隔符结尾”

已将&修改但仍然报错“对实体 "serverTimezone" 的引用必须以 ';' 分隔符结尾”

<property name="jdbcUrl">jdbc:mysql://localhost:3306/chapter02?useSSL=true&amp;serverTimezone=UTC</property>

甚至尝试删掉此文件依旧是这样报错

四月 09, 2019 6:27:47 下午 com.mchange.v2.log.MLog
信息: MLog clients using java 1.4+ standard logging.
[Fatal Error] :7:94: 对实体 "serverTimezone" 的引用必须以 ';' 分隔符结尾。
四月 09, 2019 6:27:47 下午 com.mchange.v2.c3p0.cfg.C3P0Config
警告: XML configuration disabled! Verify that standard XML libs are available.
org.xml.sax.SAXParseException; lineNumber: 7; columnNumber: 94; 对实体 "serverTimezone" 的引用必须以 ';' 分隔符结尾。
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121)
at com.mchange.v2.c3p0.cfg.C3P0ConfigXmlUtils.extractXmlConfigFromInputStream(C3P0ConfigXmlUtils.java:148)
at com.mchange.v2.c3p0.cfg.C3P0ConfigXmlUtils.extractXmlConfigFromDefaultResource(C3P0ConfigXmlUtils.java:131)
at com.mchange.v2.c3p0.cfg.DefaultC3P0ConfigFinder.findConfig(DefaultC3P0ConfigFinder.java:62)
at com.mchange.v2.c3p0.cfg.C3P0Config.(C3P0Config.java:104)
at com.mchange.v2.c3p0.impl.PoolBackedDataSourceBase.(PoolBackedDataSourceBase.java:49)
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.(AbstractPoolBackedDataSource.java:74)
at com.mchange.v2.c3p0.ComboPooledDataSource.(ComboPooledDataSource.java:134)
at com.mchange.v2.c3p0.ComboPooledDataSource.(ComboPooledDataSource.java:130)
at com.mchange.v2.c3p0.ComboPooledDataSource.(ComboPooledDataSource.java:207)
at cn.itcast.jdbc.example.Example05.(Example05.java:8)

四月 09, 2019 6:27:48 下午 com.mchange.v2.c3p0.C3P0Registry banner
信息: Initializing c3p0-0.9.2.1 [built 20-March-2013 11:16:28 +0000; debug? true; trace: 10]
四月 09, 2019 6:27:48 下午 com.mchange.v2.c3p0.cfg.C3P0Config getUnspecifiedUserProperties
警告: named-config with name 'itcast' does not exist. Using default-config.
四月 09, 2019 6:27:48 下午 com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource getPoolManager
信息: Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> itcast, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> null, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hge13ba2gdkdl1e9vvli|65b3120a, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> null, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, preferredTestQuery -> null, properties -> {}, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, userOverrides -> {}, usesTraditionalReflectiveProxies -> false ]
四月 09, 2019 6:28:19 下午 com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask run
警告: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@1c02988a -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception:
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getDriver(DriverManager.java:315)
at com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataSource.java:240)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:131)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:156)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:145)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:200)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1086)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1073)
at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:44)
at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1810)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:648)

四月 09, 2019 6:28:19 下午 com.mchange.v2.resourcepool.BasicResourcePool forceKillAcquires
警告: Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@6bc168e5 is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.
Exception in thread "main" java.sql.SQLException: Connections could not be acquired from the underlying database!
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:118)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:689)
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:140)
at cn.itcast.jdbc.example.Example05.main(Example05.java:12)
Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1418)
at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:606)
at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:526)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutAndMarkConnectionInUse(C3P0PooledConnectionPool.java:755)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:682)
... 2 more

1个回答

原来只是因为我problems没有清理。如果没有problem窗口可以通过window-show view打开

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
多层次的json格式的字符串解析,如何定义实体,如何进行解析呢
{"cancelState"=>0, "exist"=>false, "imei"=>"808A7478", "imsi"=>"460036021168236", "invadeId"=>10473, "operator"=>2, "posinfo"=>"一监监舍", "recordDate"=>1468927282000, "slArea"=>{"areaGrade"=>2, "areaId"=>13, "areaName"=>"垦华", "areaOrder"=>12, "slArea"=>{"areaGrade"=>1, "areaId"=>15, "areaName"=>"清河分局", "areaOrder"=>1, "slArea"=>{"areaGrade"=>0, "areaId"=>1, "areaName"=>"北京管理局", "areaOrder"=>1}}}}
设计json数据的实体类和获取值的问题
如何设计下方json数据的实体类,以及怎么获取tableData值呢? ``` { "tableData": [{ "EntID": "123", "UserID": "abc", "AppID": "appleo544421354", "Secret": "90000001", "BSN": "BSN20191223555551", "PageSize": "20", "PageIndex": "1", "GoodsID": "g155568772", "BaseID": "" }] } ```
C#怎么解析一段字符串
我的字符串格式是这样的,也可以说是Json字符串,有没有什么方法可以把这段字符串给解析成成实体类,求大神指教啊 ``` [{"OrderID":"0","No":"1","Item1":"0","Item2":"600","Item3":"100","Item4":"0","Item5":"10","Item6":"200","Item7":"200","Item8":"300","Item9":"0","Item10":"0","ContelNameAndTel":"","Item1m":"2300","Item2m":"300","Item3m":"100","Item4m":"300","OrganizeID":"0","ID":"17094","Jhbh":"","Jhrq":"2015/1/8 0:00:00","Iffb":"0","Jdfmc":"辰达集团 (海口市外办)","Ydr":"","Ydrdh":"","Sfzh":"","Ifxyydr":"0","Contact":"","ContactTel":"","Krrs":"3","MLPlanID":"0","Jhhx":"","Ifly":"0","Ysld":"","Xxly":"","Zdfwy":"","Fzr":"","Remark":"","Ifsybj":"0","Fjfwry":"","FjfwryID":"0","Fjkssj":"","Fjjssj":"","Fwkssj":"","Fwjssj":"","Ghzt":"0","Jszt":"0","Ddfy":"1410","Mdfy":"3100","DdfyDouble":"0","MdfyDouble":"0","Cph":"","State":"0","DelState":"0","CreateName":"","CreateDate":"0001/1/1 0:00:00","Ifmj":"0","Sxrs":"1","ServiceTypeId":"","ServiceTypeName":"","ServiceStateId":"","ServiceStateName":"","ProtectionTypeId":"","ProtectionTypeName":"","WebUserId":"","WebUserSubId":"","Hbh":"","Hblb":"0","Hkgssx":"0","Ddhx":"","PaymentId":"","PaymentName":"贵宾卡","HadTypeId":"","HadTypeName":"其它","VipRoomId":"","VipRoomName":"","HadNatureId":"","HadNatureName":"","VipRoomTypeId":"","VipRoomTypeName":"","AppUserID":"0","AppUserName":"","PlanModel":"","CustomerName":"","Position":"","Unit":"","QianDR":"","JieDY":"","DanJH":"","IFHaveMeals":"0","HaveMealsNo":"0","IfReservedSeating":"0","IfSeated":"0","TheBellboyID":"0","TheBellboyName":"","TheBellboyNo":"0","TheBellboyM":"0","YsRS":"2","Fwy":"","fwList":"","Yby":"","ybList":"","MainCustomer":"Sébastien Hamel&#40;Sebastien Hamel&#41;(塞巴斯蒂安·哈梅尔)、Pam McConnell、Elena Pierce、Simon Langerlier","MainPosition":"加拿大城镇联盟国际关系部主席","MainSeat":"","SxCustomer":"","VipCar":"","carList":"","CardTypeName":"","IsSign":"0","IsSendSms":"0"}] ```
spring-data-elasticsearch 一对多
现在有三个实体类 关系是一个产品有多个属性 一个属性有多个属性值 如下: 实体类EsProduct: ``` @Document(indexName = "product", type = "productInfo",shards = 2,replicas = 1,refreshInterval = "-1") public class EsProduct implements Serializable { private static final long serialVersionUID = 2372551074091780419L; @Id private Long id; @Field(analyzer = "ik_max_word",type = FieldType.Text) private String productSn; private Long brandId; @Field(analyzer = "ik_max_word",type = FieldType.Text) private String brandName; private Long productCategoryId; @Field(analyzer = "ik_max_word",type = FieldType.Text) private String productName; private Long sale; @Field(analyzer = "ik_max_word",type = FieldType.Text) private String subTitle; private BigDecimal price; @Field(analyzer = "ik_max_word",type = FieldType.Text) private String keywords; private List<EsProductAttribute> attributeList; private EsProductCategory productCategorie; ``` 实体类EsProductAttribute: ``` public class EsProductAttribute implements Serializable { private static final long serialVersionUID = 4965902919813623705L; @Id private Long id; @Field(analyzer = "ik_max_word",type = FieldType.Text) private String paProductAttributeName;//属性名称 private List<EsProductAttributeValue> attributeValues; ``` 实体类EsProductAttributeValue: ``` public class EsProductAttributeValue implements Serializable { private static final long serialVersionUID = 6713756365860464751L; private Long id; @Field(analyzer = "ik_max_word",type = FieldType.Text) private String pavProductAttributeValue; ``` 之前的搜索是这样的,可以成功搜索 控制层代码: ``` @ApiOperation(value = "简单搜索:根据关键字,品牌名称或者产品名称,产品编号,副标题搜索(字符串:Text类型最大拆分)") @RequestMapping(value = "/search/keyword", method = RequestMethod.GET) @ResponseBody public CommonResult<CommonPage<EsProduct>> searchKeyword(@RequestParam(required = false) String keyword, @RequestParam(required = false, defaultValue = "0") Integer pageNum, @RequestParam(required = false, defaultValue = "5") Integer pageSize) { Page<EsProduct> esProductPage = esProductService.searchKeyword(keyword, pageNum, pageSize); return CommonResult.success(CommonPage.restPage(esProductPage)); } ``` 业务实现层代码: ``` @Autowired private EsProductRepository productRepository; @Override public Page<EsProduct> searchKeyword(String keyword, Integer pageNum, Integer pageSize) { Pageable pageable = PageRequest.of(pageNum, pageSize); return productRepository.findByKeywordsOrProductNameOrBrandNameOrProductSnOrSubTitle(keyword,keyword,keyword,keyword,keyword,pageable); } ``` EsProductRepository接口 ``` public interface EsProductRepository extends ElasticsearchRepository<EsProduct, Long> { /** * 根据关键字,产品名称,品牌名称,产品编号搜索 * @param keywords * @param productName * @param brandName * @param page * @return */ Page<EsProduct> findByKeywordsOrProductNameOrBrandNameOrProductSnOrSubTitle(String keywords,String productName,String brandName,String productSn,String subTitle,Pageable page); } ``` 都可以成功搜索 但是在进行属性和属性值搜索的时候告诉我说在EsProduct中找不到paProductAttributeName,我一想有道理,然后改变策略 单独写了一个接口测试 控制层 ``` @ApiOperation(value = "属性和属性值搜索、筛选、排序") @ApiImplicitParam(name = "sort", value = "排序字段:0->按相关度;1->按销量;2->价格从低到高;3->价格从高到低", defaultValue = "0", allowableValues = "0,1,2,3", paramType = "query", dataType = "integer") @RequestMapping(value = "/search", method = RequestMethod.GET) @ResponseBody public CommonResult<CommonPage<EsProduct>> search(@RequestParam(required = false) String keyword, @RequestParam(required = false, defaultValue = "0") Integer pageNum, @RequestParam(required = false, defaultValue = "5") Integer pageSize, @RequestParam(required = false, defaultValue = "0") Integer sort) { Page<EsProduct> esProductPage = esProductService.search(keyword,pageNum, pageSize, sort); return CommonResult.success(CommonPage.restPage(esProductPage)); } ``` 业务实现层: ``` @Override public Page<EsProduct> search(String keyword,Integer pageNum, Integer pageSize,Integer sort) { Pageable pageable = PageRequest.of(pageNum, pageSize); //将连接条件和聚合函数等组合 NativeSearchQueryBuilder nativeSearchQueryBuilder = new NativeSearchQueryBuilder(); //分页 nativeSearchQueryBuilder.withPageable(pageable); //搜索 if (StringUtils.isEmpty(keyword)) { nativeSearchQueryBuilder.withQuery(QueryBuilders.matchAllQuery()); } else { List<FunctionScoreQueryBuilder.FilterFunctionBuilder> filterFunctionBuilders = new ArrayList<>(); //QueryBuilders:简单的静态工厂”导入静态”使用。主要作用是查询条件(关系),如区间\精确\多值等条件 //属性名称 filterFunctionBuilders.add(new FunctionScoreQueryBuilder.FilterFunctionBuilder(QueryBuilders.matchQuery("paProductAttributeName", keyword), ScoreFunctionBuilders.weightFactorFunction(2))); //属性值 filterFunctionBuilders.add(new FunctionScoreQueryBuilder.FilterFunctionBuilder(QueryBuilders.matchQuery("value", keyword), ScoreFunctionBuilders.weightFactorFunction(2))); //产品名称 // filterFunctionBuilders.add(new FunctionScoreQueryBuilder.FilterFunctionBuilder(QueryBuilders.matchQuery("productName",keyword), // ScoreFunctionBuilders.weightFactorFunction(2))); // //关键字 // filterFunctionBuilders.add(new FunctionScoreQueryBuilder.FilterFunctionBuilder(QueryBuilders.matchQuery("keywords", keyword), // ScoreFunctionBuilders.weightFactorFunction(2))); // //产品编号 // filterFunctionBuilders.add(new FunctionScoreQueryBuilder.FilterFunctionBuilder(QueryBuilders.matchQuery("productSn", keyword), // ScoreFunctionBuilders.weightFactorFunction(2))); FunctionScoreQueryBuilder.FilterFunctionBuilder[] builders = new FunctionScoreQueryBuilder.FilterFunctionBuilder[filterFunctionBuilders.size()]; filterFunctionBuilders.toArray(builders); FunctionScoreQueryBuilder functionScoreQueryBuilder = QueryBuilders.functionScoreQuery(builders) .scoreMode(FunctionScoreQuery.ScoreMode.SUM) .setMinScore(2); nativeSearchQueryBuilder.withQuery(functionScoreQueryBuilder); } // //排序 // if(sort==1){ // //按销量从高到低 // nativeSearchQueryBuilder.withSort(SortBuilders.fieldSort("sale").order(SortOrder.DESC)); // }else if(sort==2){ // //按价格从低到高 // nativeSearchQueryBuilder.withSort(SortBuilders.fieldSort("price").order(SortOrder.ASC)); // }else if(sort==3){ // //按价格从高到低 // nativeSearchQueryBuilder.withSort(SortBuilders.fieldSort("price").order(SortOrder.DESC)); // }else{ // //按相关度 // nativeSearchQueryBuilder.withSort(SortBuilders.scoreSort().order(SortOrder.DESC)); // } nativeSearchQueryBuilder.withSort(SortBuilders.scoreSort().order(SortOrder.DESC)); NativeSearchQuery searchQuery = nativeSearchQueryBuilder.build(); LOGGER.info("DSL:{}", searchQuery.getQuery().toString()); return productRepository.search(searchQuery); } ``` es中的数据是: ``` { "code": 200, "message": "操作成功", "data": { "pageNum": 0, "pageSize": 5, "totalPage": 4, "total": 17, "list": [ { "id": 40, "productSn": "C146179 ", "brandId": null, "brandName": "PSA(信昌电陶)", "productCategoryId": 54, "productName": "贴片电容/220nF(224)±10%250V编带", "sale": 1000, "subTitle": "贴片电容", "price": null, "keywords": "贴片电容/220nF(224) ±10% 250V 编带 ", "attributeList": [ { "id": 49, "paProductAttributeName": "容值", "attributeValues": [ { "id": 240, "pavProductAttributeValue": "0.1pf" }, { "id": 241, "pavProductAttributeValue": "0.2pf" }, { "id": 242, "pavProductAttributeValue": "0.25pf" }, { "id": 243, "pavProductAttributeValue": "0.3pf" }, { "id": 244, "pavProductAttributeValue": "0.4pf" } ] }, { "id": 51, "paProductAttributeName": "额定电压", "attributeValues": [ { "id": 290, "pavProductAttributeValue": "4v" }, { "id": 292, "pavProductAttributeValue": "10v" }, { "id": 296, "pavProductAttributeValue": "30v" } ] } ], "productCategorie": { "id": 54, "productCategoryName": "贴片电容" } }, { "id": 41, "productSn": "C394163 ", "brandId": null, "brandName": "PSA(信昌电陶)", "productCategoryId": 54, "productName": "贴片电容/10nF(103) ±10% 1KV", "sale": 1000, "subTitle": "贴片电容", "price": null, "keywords": "贴片电容/10nF(103) ±10% 1KV ", "attributeList": [ { "id": 49, "paProductAttributeName": "容值", "attributeValues": [ { "id": 245, "pavProductAttributeValue": "0.5pf" }, { "id": 246, "pavProductAttributeValue": "0.6pf" }, { "id": 247, "pavProductAttributeValue": "0.68pf" } ] }, { "id": 50, "paProductAttributeName": "精度", "attributeValues": [ { "id": 272, "pavProductAttributeValue": "+0.05pf" }, { "id": 273, "pavProductAttributeValue": "+0.1pf" }, { "id": 274, "pavProductAttributeValue": "+0.25pf" } ] }, { "id": 51, "paProductAttributeName": "额定电压", "attributeValues": [ { "id": 291, "pavProductAttributeValue": "6.3v" }, { "id": 293, "pavProductAttributeValue": "16v" }, { "id": 297, "pavProductAttributeValue": "35v" } ] } ], "productCategorie": { "id": 54, "productCategoryName": "贴片电容" } }, { "id": 44, "productSn": "C342641 ", "brandId": null, "brandName": "TDK", "productCategoryId": 54, "productName": "贴片电容/47nF(473) ±5% 100V 编带", "sale": 1000, "subTitle": "贴片电容", "price": null, "keywords": "贴片电容/47nF(473) ±5% 100V 编带 ", "attributeList": [ { "id": 49, "paProductAttributeName": "容值", "attributeValues": [ { "id": 254, "pavProductAttributeValue": "1.3pf" }, { "id": 255, "pavProductAttributeValue": "1.4pf" }, { "id": 256, "pavProductAttributeValue": "2pf" }, { "id": 257, "pavProductAttributeValue": "2.1pf" } ] }, { "id": 50, "paProductAttributeName": "精度", "attributeValues": [ { "id": 278, "pavProductAttributeValue": "+5%" } ] } ], "productCategorie": { "id": 54, "productCategoryName": "贴片电容" } }, { "id": 48, "productSn": "C11366 ", "brandId": null, "brandName": " AVX", "productCategoryId": 55, "productName": "钽电容/22uF(226) ±10% 10V", "sale": 1000, "subTitle": "钽电容", "price": null, "keywords": "钽电容/22uF(226) ±10% 10V ", "attributeList": [ { "id": 49, "paProductAttributeName": "容值", "attributeValues": [ { "id": 269, "pavProductAttributeValue": "0.1pf" }, { "id": 270, "pavProductAttributeValue": "0.2pf" } ] }, { "id": 50, "paProductAttributeName": "精度", "attributeValues": [ { "id": 271, "pavProductAttributeValue": "+0.02pf" }, { "id": 284, "pavProductAttributeValue": "-20%,+80%" } ] } ], "productCategorie": { "id": 55, "productCategoryName": "钽电容" } }, { "id": 52, "productSn": "C391913 ", "brandId": null, "brandName": "SAMYOUNG(韩国三莹)", "productCategoryId": 56, "productName": "贴片电解电容/10uF ±20% 50V", "sale": 1000, "subTitle": "贴片电解电容", "price": null, "keywords": "贴片电解电容/10uF ±20% 50V ", "attributeList": [], "productCategorie": { "id": 56, "productCategoryName": "贴片电解电容" } } ] } } ``` 然后搜索了半天一点反应也没有,也没有头绪,求助大神指点
关于破解版运行地图不显示的问题
``` <script src="JS/FusionCharts.js"></script> var ditu = new FusionCharts("../fusionchartsJS/maps/FCMap_Shandong.swf", "myMap", "530", "250", "0"); ditu.setJSONData({ "map": { "animation": "1", "showbevel": "1",//是否显示3D地图 "showcanvasborder": "0",//是否显示实体的边框 "bgAlpha": "0",//设置整个地图的背景透明度 "includeNameInLabels": "1",//是否在labels中显示实体名称 "useSNameInLabels": "1",//是否在labels活实体名称中用简写来表示0全拼,1简体 "useSNameInToolTip": "0",//是否在提示文本中用简写来表示 "clickURL": "",//整个地图可以作为一个热点,指向一个URL,链接必须符合FusionMaps的格式 "aboutMenuItemLabel": "济南网奇",//右键about信息上的文本 "aboutMenuItemLink": "http://www.glywzn.com/",//about信息上的文本连接 "showToolTip": "1",//是否显示提示信息 "usehovercolor": "1", "canvasbordercolor": "FFFFFF",//实体边框的颜色 "bordercolor": "FFFFFF",//边界线颜色 "showlegend": "0",//是否显示图例 "showshadow": "0",//是否显示阴影 "legendposition": "BOTTOM",//图例的位置,下面或右边BOTTOM or RIGHT "legendborderalpha": "0",//图例边框透明度 "legendbordercolor": "ff0000",//图例边框颜色 "legendallowdrag": "0",//是否允许拖动图例 "legendshadow": "0",//是否显示图例阴影 "caption": "",//标题 "connectorcolor": "000000", "fillalpha": "80", "hovercolor": "CCCCCC", "showborder": "0" }, "colorrange": { "minvalue": "0", "startlabel": "Low", "endlabel": "High", "code": "e44a00", "gradient": "1", "color": [ { "maxvalue": "30000", "displayvalue": "Average", "code": "f8bd19" }, { "maxvalue": "100000", "code": "6baa01" } ] }, "data": [ { "id": "1", "value": "4576", "color": "ff00ff", "displayValue":"济南", "toolText": "jinan,济南,110" }, { "id": "2", "value": "4690", "toolText": "qingdao,青岛,72" }, { "id": "3", "value": "63399", "toolText": "binzhou,滨州,53" }, { "id": "4", "value": "69388", "toolText": "dezhou,德州,52" }, { "id": "5", "value": "51941", "toolText": "dongying,东营,39" }, { "id": "6", "value": "78390", "toolText": "heze,菏泽,16" }, { "id": "7", "value": "30423", "toolText": "jining,济宁,17" }, { "id": "8", "value": "32060", "toolText": "laiwu,莱芜,36" }, { "id": "9", "value": "60884", "toolText": "liaocheng,聊城,51" }, { "id": "10", "value": "56716", "toolText": "linyi,临沂,31" }, { "id": "11", "value": "40076", "toolText": "rizhao,日照,28" }, { "id": "12", "value": "49531", "toolText": "taian,泰安,88" }, { "id": "13", "value": "76502", "toolText": "weifang,潍坊,49" }, { "id": "14", "value": "67124", "toolText": "qingdao,青岛,72" }, { "id": "15", "value": "95890", "toolText": "yantai,烟台,26" }, { "id": "16", "value": "84236", "toolText": "zaozhuang,枣庄,31" }, { "id": "17", "value": "84236", "toolText": "zibo,淄博,25" } ] }); ditu.setTransparent(true); ditu.render("chartdiv3"); ``` 我感觉我代码没有问题。 不知道哪里得问题,![图片说明](https://img-ask.csdn.net/upload/201511/23/1448274785_73485.png) JS下载地址 [](http://download.csdn.net/detail/duyeguang/8269653 "") http://download.csdn.net/detail/duyeguang/8269653 SWF文件没损坏,不要怀疑。
Recyclerview嵌套recyclerview的深坑,我坐在Recyclerview这个坑里很久了,仰望天空希望能把我拉上去。
Recyclerview嵌套recyclerview的深坑,对于一个新手来说怎么也上不去,特来邀请键盘中的高手高高手,拉拉我; ## 第一个Recyclerview布局: ``` <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/area_LinearLayout" android:layout_width="match_parent" android:layout_height="match_parent" android:focusable="true" android:focusableInTouchMode="true" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="40dp" android:background="@drawable/drawable_black_one" android:orientation="horizontal" android:layout_margin="3dp"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="5dp" android:layout_gravity="center" android:text="" android:textColor="@drawable/drawable_white_pure" android:lines="1" android:layout_weight="1"/> <TextView android:layout_width="1dp" android:layout_height="30dp" android:layout_gravity="center" android:layout_margin="5dp" android:background="@color/whiteness" /> <TextView android:id="@+id/peers_location_TextView" android:layout_width="70dp" android:layout_height="40dp" android:layout_marginLeft="5sp" android:layout_marginRight="10dp" android:ellipsize="end" android:gravity="center" android:text="" android:textColor="@color/whiteness" android:textSize="14sp" android:lines="1" android:textStyle="bold" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="3dp" > <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" > <ImageView android:layout_width="20dp" android:layout_height="20dp" android:layout_alignParentTop="true" android:layout_alignParentEnd="true" android:layout_marginTop="0dp" android:layout_marginEnd="10dp" android:scaleType="fitStart" android:src="@drawable/location" /> </RelativeLayout> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="40dp" android:background="@drawable/drawable_black_one" android:layout_gravity="center" android:focusable="true" android:focusableInTouchMode="true" android:layout_margin="3dp"> <EditText android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_margin="1dp" android:background="@color/text_white" android:hint="行业人员" android:textSize="13dp" android:gravity="center" android:lines="1" android:layout_weight="1"/> <TextView android:layout_width="50dp" android:layout_height="wrap_content" android:text="搜索" android:textSize="14dp" android:layout_marginLeft="14dp" android:layout_gravity="center" android:textColor="@color/whiteness" android:layout_margin="5dp" android:gravity="center"/> </LinearLayout> <android.support.v7.widget.RecyclerView android:id="@+id/user_info_layout" android:layout_width="match_parent" android:layout_height="match_parent" /> </LinearLayout> ``` ## 在第一个Recycleview的item里面嵌套了第二个Recyclerview不知道这样对不对? ``` <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <LinearLayout android:id="@+id/portrait" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal"> <ImageView android:id="@+id/user_portrait" android:layout_width="50dp" android:layout_height="50dp" android:layout_margin="5dp" android:src="@drawable/em_default_avatar" /> <LinearLayout android:layout_width="fill_parent" android:layout_height="match_parent" android:layout_weight="1" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="20dp" android:layout_marginTop="5dp" android:gravity="clip_horizontal"> <TextView android:id="@+id/user_industry" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:background="@drawable/dialog_circular_whiteness" android:ellipsize="end" android:gravity="center" android:text="建筑" android:textColor="@color/colorPrimary" android:textSize="14sp" android:textStyle="bold" /> <TextView android:id="@+id/user_name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom" android:layout_marginLeft="5dp" android:background="@drawable/dialog_circular_whiteness" android:ellipsize="end" android:gravity="center" android:text="努力改变自己" android:textColor="#323232" android:textSize="10sp" android:textStyle="bold" /> <TextView android:id="@+id/name_voip" android:layout_width="20dp" android:layout_height="wrap_content" android:layout_gravity="center" android:ellipsize="end" android:gravity="center" android:text="voip" android:textColor="@color/text_pink" android:textSize="7sp" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="35dp"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="努力改变自己" android:textSize="12dp" /> </LinearLayout> </LinearLayout> <RelativeLayout android:layout_width="60dp" android:layout_height="match_parent" android:gravity="center"> <TextView android:id="@+id/user_location" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="20dp" android:background="@drawable/dialog_circular_whiteness" android:text="" android:textSize="12dp" android:textStyle="bold" /> </RelativeLayout> </LinearLayout> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <LinearLayout android:layout_width="fill_parent" android:layout_height="match_parent" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1"> **<!-- 导入RecyclerView-->** <android.support.v7.widget.RecyclerView android:id="@+id/user_peesr_info" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> <LinearLayout android:layout_width="fill_parent" android:layout_height="10dp"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="right" android:text="访问:10000人" android:textSize="8dp" /> </LinearLayout> </LinearLayout> </LinearLayout> ``` ## 第一个Recyclerview的适配器: ``` public class Home_RecyclerView_Adapter extends RecyclerView.Adapter<Home_RecyclerView_Adapter.myViewHodler> { private Context context; private LinkedList<Home_list_get_set> LinkedList; public LinkedList<User_Recruitment_get_set> mLinkedList; public Home_list_get_set mHome_list_get_set; //创建构造函数 public Home_RecyclerView_Adapter(Context context, LinkedList<Home_list_get_set> industrytitlegetsetList) { //将传递过来的数据,赋值给本地变量 this.context = context;//上下文 this.LinkedList = industrytitlegetsetList;//实体类数据ArrayList } /** * 创建viewhodler,相当于listview中getview中的创建view和viewhodler * * @param parent * @param viewType * @return */ @Override public myViewHodler onCreateViewHolder(ViewGroup parent, int viewType) { RecyclerView user_peesr_info;//自定义recyclerveiw的适配器 //创建自定义布局 // View itemView = View.inflate(context, R.layout.peers_list_item, null);//用这个布局item宽高无效 // myViewHodler itemView = new myViewHodler(LayoutInflater.from(context).inflate(R.layout.peers_list_item, parent, false)); View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.peers_list_item, parent, false); user_peesr_info = view.findViewById (R.id.user_peesr_info); //给嵌套的RecyclerView设置适配器 User_Recruitment_Adapter user_recruitment_adapter = new User_Recruitment_Adapter (context,mLinkedList); user_peesr_info.setAdapter (user_recruitment_adapter); user_peesr_info.setLayoutManager (new LinearLayoutManager (context, LinearLayoutManager.HORIZONTAL, false)); //给嵌套的RecyclerView设置item的分割线 user_peesr_info.addItemDecoration (new DividerItemDecoration (context, DividerItemDecoration.HORIZONTAL)); return new myViewHodler(view); // return itemView; } /** * 绑定数据,数据与view绑定 * * @param holder * @param position */ @SuppressLint("ClickableViewAccessibility") @Override public void onBindViewHolder(myViewHodler holder, int position) { //根据点击位置绑定数据 mHome_list_get_set = LinkedList.get(position); // holder.mItemGoodsImg; holder.user_name.setText(mHome_list_get_set.getUser_name()); holder.user_industry.setText(mHome_list_get_set.getUser_work()); // holder.user_portrait.setImageDrawable (data.getHead_portait ());//改为下面Glide获取图上 Glide.with(context) .load(mHome_list_get_set.getHead_portait ())//图片信息 .apply(RequestOptions.bitmapTransform(new CircleCrop ()))//设置圆形 .into(holder.user_portrait);//设置到那个部位 holder.name_voip.setText(mHome_list_get_set.getUser_Vip()); holder.user_location.setText(mHome_list_get_set.getUser_location()); } /** * 得到总条数 * * @return */ @Override public int getItemCount() { // return LinkedList.size(); return LinkedList == null ? 0 : LinkedList.size(); } //自定义viewhodler class myViewHodler extends RecyclerView.ViewHolder { private ImageView user_portrait; private TextView user_name; private TextView user_industry; private TextView name_voip; private TextView user_location; public RecyclerView user_peesr_info;//自定义recyclerveiw的适配器 public myViewHodler(View itemView) { super(itemView); user_peesr_info = itemView.findViewById (R.id.user_peesr_info); user_portrait = itemView.findViewById(R.id.user_portrait); user_name = itemView.findViewById(R.id.user_name); user_industry = itemView.findViewById(R.id.user_industry); name_voip = itemView.findViewById(R.id.name_voip); user_location = itemView.findViewById(R.id.user_location); user_portrait.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //可以选择直接在本位置直接写业务处理 //Toast.makeText(context,"点击了xxx",Toast.LENGTH_SHORT).show(); //此处回传点击监听事件 if (onItemClickListener != null) { onItemClickListener.OnItemClick(v, LinkedList.get(getLayoutPosition())); } } }); } public View getItemView() { return itemView; } } /** * 设置item的监听事件的接口 */ public interface OnItemClickListener { /** * 接口中的点击每一项的实现方法 * * @param view 点击的item的视图 * @param data 点击的item的数据 */ public void OnItemClick(View view, Home_list_get_set data); } //需要外部访问,所以需要设置set方法,方便调用 private OnItemClickListener onItemClickListener; public void setOnItemClickListener(OnItemClickListener onItemClickListener) { this.onItemClickListener = onItemClickListener; } ``` ## 第二个Recyclerview的适配器: ``` public class User_Recruitment_Adapter extends RecyclerView.Adapter<User_Recruitment_Adapter.myViewHodler> { public LinkedList<User_Recruitment_get_set> m_LinkedList; private Context context; public User_Recruitment_get_set mUser_Recruitment_get_set; //创建构造函数 public User_Recruitment_Adapter(Context context, LinkedList<User_Recruitment_get_set> mLinkedList) { //将传递过来的数据,赋值给本地变量 this.context = context;//上下文 this.m_LinkedList = mLinkedList; } @NonNull @Override public myViewHodler onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) { View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.user_peers_recruitment_item, viewGroup, false); return new myViewHodler(view); } @Override public void onBindViewHolder(@NonNull myViewHodler myViewHodler, int i) { mUser_Recruitment_get_set = m_LinkedList.get(i); myViewHodler.recruitment.setText (mUser_Recruitment_get_set.getRecruitment ()); } @Override public int getItemCount() { return m_LinkedList == null ? 0 : m_LinkedList.size(); } public class myViewHodler extends RecyclerView.ViewHolder { private TextView recruitment; public myViewHodler(@NonNull View itemView) { super (itemView); recruitment = itemView.findViewById(R.id.recruitment); } } } ``` ## 现问题是嵌套里面的Recyclerview无显示内容?我该如何写?
GSON解析JAVABEAN返回空值
{ "ErrorMessage": null, "ResponseData": { "Data": [ { "DeviceTypeConfigId": "1", "DeviceTypeName": "1", "SensorInfos": [ { "SensorCode": "AirTemperature", "SensorConfigId": 1, "SensorName": "空气温度", "ValueType": "Value" }, { "SensorCode": "AirHumidity", "SensorConfigId": 2, "SensorName": "空气湿度", "ValueType": "Value" }, { "SensorCode": "CarbonDioxide", "SensorConfigId": 3, "SensorName": "二氧化碳", "ValueType": "Value" }, { "SensorCode": "Radiance", "SensorConfigId": 4, "SensorName": "辐射强度", "ValueType": "Value" }, { "SensorCode": "SoilTemperature", "SensorConfigId": 5, "SensorName": "土壤温度", "ValueType": "Value" }, { "SensorCode": "SoilHumidity", "SensorConfigId": 6, "SensorName": "土壤湿度", "ValueType": "Value" } ] } ], "Index": 1, "PageSize": 1, "TotalCount": 8 } } 这是服务器返回的JSON数据,在转换的时候我是这样写的 jsonObject = new JSONObject(responseInfo.result); JsonsRootBean jsonsRootBean=gson.fromJson(responseInfo.result, JsonsRootBean.class); .Responsedata res=jsonsRootBean.getResponsedata(); System.out.println("--res-----"+res); 控制台中显示res 返回的值为NULL,请问这是为什么呢,实体类我已经写好了
关于Gson解析对象时对象值为“”如何处理
Json String为 {"result":"success","total":10344,"rows":[{"name":"John","age":15,"geo":{"altitude":0,"longitude":62.2000707,"latitude":34.3184831}},{"name":"Alex","age":25,"geo":{"longitude":-121.7464929,"altitude":0,"latitude":36.9123101}},{"name":"Alex","age":25,"geo":""}]},这里在bejson生成实体类的时候生成了Geo类,但是在使用Gson的时候解析到第三组数据的时候会报异常。请问这种情况应该怎么处理。 求各位大神指教!!
java 嵌套json如何转成list集合
#嵌套json jsonstr="{ "grade":"一班", "studentnum":"3", "student":[{ "xh":"0313001", "name":"zhangsan", "chengji": [{"ceyan":"one","yuwen":"71","shuxue":"72","yingyu":"73"},{"ceyan":"two","yuwen":"76","shuxue":"77","yingyu":"78"}], "xh":"0313002", "name":"lisi", "chengji":[{"ceyan":"one","yuwen":"81","shuxue":"82","yingyu":"83"},{"ceyan":"one","yuwen":"86","shuxue":"87","yingyu":"88"}], "xh":"0313003", "name":"wangswu", "chengji":[{"ceyan":"one","yuwen":"91","shuxue":"92","yingyu":"93"},{"ceyan":"one","yuwen":"96","shuxue":"97","yingyu":"98"}] }] }" #定义的JavaBean实体类 public class JsonRootBean { private String grade; private String studentnum; private List<Student> student; public void setGrade(String grade) { this.grade = grade; } public String getGrade() { return grade; } public void setStudentnum(String studentnum) { this.studentnum = studentnum; } public String getStudentnum() { return studentnum; } public void setStudent(List<Student> student) { this.student = student; } public List<Student> getStudent() { return student; } } public class Student { private String xh; private String name; private List<Chengji> chengji; public void setXh(String xh) { this.xh = xh; } public String getXh() { return xh; } public void setName(String name) { this.name = name; } public String getName() { return name; } public void setChengji(List<Chengji> chengji) { this.chengji = chengji; } public List<Chengji> getChengji() { return chengji; } } public class Chengji { private String cyss; private String yuwen; private String shuxue; private String yingyu; public void setCyss(String cyss) { this.cyss = cyss; } public String getCyss() { return cyss; } public void setYuwen(String yuwen) { this.yuwen = yuwen; } public String getYuwen() { return yuwen; } public void setShuxue(String shuxue) { this.shuxue = shuxue; } public String getShuxue() { return shuxue; } public void setYingyu(String yingyu) { this.yingyu = yingyu; } public String getYingyu() { return yingyu; } } #该如何转换啊?
使用Gson框架制作Json时遇到的字符转义问题
第一次做后台遇到一个Json格式的问题,刚开始得到的JsonArray格式如下: [{"id":8,"account":"123456","password":"123456","name":"啦啦啦"},{"id":9,"account":"10086","password":"123456","name":"哈哈哈"}] 在返回给前端时需要弄成一个JsonObject,于是我写了一个实体类ReturnData,里面只有一个String data,然后使用Gson中的方法(json就是上面的jsonArray): ``` ReturnData returnData = new ReturnData(json); String gsonResult = gson.toJson(returnData); ``` 但是在转换时,Gson自动帮我添加了转义字符,最后结果如下: {"data":"[{\"id\":8,\"account\":\"123456\",\"password\":\"123456\",\"name\":\"啦啦啦\"} 有没有大神知道为什么会自动出现这样的转义字符,以及好一点的解决办法。
oracle数据库报错ORA-00904: "A"."国资账面价值": 标识符无效
select * from ( select rownum RowIndex, a.车辆标识 as 车牌,a.编号,a.sim卡号码,a.通讯模块序列号 ,a.车载类型 as 车载设备类型,c.类型名称 as 车载设备类型名称 ,a.车辆类型id as 车辆类型 ,e.fvehicletypename||'|'||e.ftypeclassification as 车辆类型名称 ,a.型号,d.型号名,to_char(a.注册日期,'yyyy-mm-dd') as 注册日期,a.核载人数,a.车架号,a.发动机号,a.车牌分类,a.备注,b.所属实体名称 ,a.排气量,a.国资账面价值 from 车辆实体信息表 a LEFT OUTER JOIN 实体所属关系表 b ON a.车辆标识 = b.实体名称 LEFT OUTER JOIN 车载类型信息表 c ON a.车载类型 = c.类型编号 LEFT OUTER JOIN 车辆型号信息表 d ON a.型号 = d.型号 LEFT OUTER JOIN 车辆类型信息表 e ON a.车辆类型id=e.fid where 1=1 {0} {1} {2} {3} {4} ) t where t.rowindex between :StartRowIndex and :EndRowIndex 求大神看看这个sql语句哪里的问题
vue的vuescroll插件苹果手机滑动不了,安卓手机没有问题
大佬们救助啊!!! ```<template> <div style="margin-top:-80px;"> <div class="page__hd"> <div class="weui-form-preview__ft"> <label class="weui-form-preview__btn weui-form-preview__btn_default"> <span @click="toIndex" style="color:rgb(0, 0, 0);">&lt;返回</span> </label> <label type="submit" class="weui-form-preview__btn weui-form-preview__btn_primary" href="javascript:" style="color:rgb(0, 0, 0);" >{{this.zqName}}合同</label> <label type="submit" class="weui-form-preview__btn weui-form-preview__btn_primary" style="color:rgb(0, 0, 0);" @click="select" > 筛选 <img src="../assets/000.png" height="20px" width="20px" /> </label> </div> </div> <div class="pr-wrap_tra" style=" overflow-y: scroll;touch-action: pan-y;-webkit-overflow-scrolling: touch;"> <div class="wrap-part_tra first_tra" > <vuescroll ref="vs" :ops="ops" @refresh-start="handleRS" @load-before-deactivate="handleLBD" @refresh-before-deactivate="handleRBD" @load-start="handleLoadStart" > <div v-for="item in ContractList" :key="item.dictid"> <div class="contractList_css_tra"> <div class="list_css_tra" @click="jumppage(item.dictid)"> <span style="float:left;">{{item.farmername}}</span> <span style="float:right;" v-if=" item.isrecord=== 0">糖厂未上报</span> <span style="float:right;" v-if=" item.isrecord=== 1">乡政府退回</span> <span style="float:right;" v-if=" item.isrecord=== 2">县政府退回</span> <span style="float:right;" v-if=" item.isrecord=== 5">糖厂已上报</span> <span style="float:right;" v-if=" item.isrecord=== 6">乡政府已上报</span> <span style="float:right" v-if=" item.isrecord=== 7">县政府已备案</span> <br /> <span style="color:#4169E1;float:left;margin-top: -5px;">({{item.ocnum}})</span> <!-- <p style="float:left; font-size:15px; color:#C0C0C0; margin-top: 5px" >&nbsp;&nbsp;{{item.signdate}}</p> --> <br /> <hr style="width: 100%;" /> <div class="tr_css_tra"> <table class="table_css_tra"> <tr class="title_tra"> <td>种植面积</td> <td>种植产量</td> <td>风险值</td> </tr> <tr class="content_tra"> <td>{{item.area?item.area.toFixed(2):0}} <span style="font-weight:bold;font-size: 13px;">亩</span> </td> <td>{{item.yeild?item.yeild.toFixed(2):0}} <span style="font-weight:bold;font-size: 13px;">吨</span></td> <td v-if=" item.isrecord == 0"> <span style="font-weight:bold;font-size: 13px;">-</span></td> <td v-if=" item.isrecord > 0 && item.matchstate ==0"> <span style="font-weight:bold;font-size: 13px;">计算中</span></td> <td v-if=" item.isrecord > 0 && item.matchstate ==1"> {{item.riskevaluation}} <span style="font-weight:bold;font-size: 13px;">%</span></td> </tr> </table> </div> <hr style="width: 100%;" /> <span style="float:left; margin-top: 10px; ">{{item.departname?item.departname:''}}</span> <span style="float:right; margin-top: 10px;">详情></span> </div> </div> </div> <div id="nodata" style="display:none">{{this.context}}</div> </vuescroll> </div> </div> </div> </template> <script> import vuescroll from "vuescroll"; import farmers from "@/api/farmers"; import indexApi from "@/api/index"; import Vue from "vue"; import axios from "axios"; export default { name: "myvuescroll", props: { // 语言 lang: { default: "zh" // en }, // 距离底部触发自动加载的距离 autoLoadDistance: { default: 10 }, // 是否开启下拉刷新 isRefresh: { default: true }, // 是否开启上拉加载 isPushLoad: { default: true }, // 数据是否全部加载完成 true为全部加载完成 noData: { default: false }, // 下拉刷新开始 refreshStart: { default: () => {} }, // 下拉刷新完成之后 refreshDeactivate: { default: () => {} }, // 上拉开始 loadStart: { default: () => {} }, // 上拉完成之后 loadDeactivate: { default: () => {} } }, components: { vuescroll }, data() { const config = {}; const ops = { vuescroll: { mode: "slide", pullRefresh: { enable: this.isRefresh }, pushLoad: { enable: this.isPushLoad, auto: true, //是否自动触发加载 autoLoadDistance: this.autoLoadDistance } } }; if (this.lang == "zh") { ops.vuescroll.pullRefresh.tips = { deactive: "下拉刷新", active: "释放刷新", start: "刷新中...", beforeDeactive: "刷新成功!" }; ops.vuescroll.pushLoad.tips = { deactive: "上拉加载", active: "释放加载", start: "加载中...", beforeDeactive: "加载成功!" }; } return { ops, config, pageNo: 1, isfirstload: false, end: 0, is: true, ContractList: [], zqName: "", minrisk: 0, maxrisk: 0, farmersName: "", contractCode: "", record: "", data: {}, zqCode: "", departCode: "", xzCode:"", user:{}, sx:true, xl:true, presser:'', context:'', //, maxarea:0, // minarea:0, // isrecord:0, // ocnum:0, // farmername:'' }; }, // created: function() { // this.myInstalHomeFun(); // }, created:function(){ this.user = this.$route.params.user; this.zqCode = this.$route.params.zqCode; this.departCode = this.$route.params.departCode; this.xzCode=this.$route.params.xzCode; this.zqName = this.$route.params.zqName; this.presser = this.$route.params.presser; }, mounted: function() { this.minrisk = this.$route.params.minrisk; this.maxrisk = this.$route.params.maxrisk; this.farmersName = this.$route.params.farmersName; this.contractCode = this.$route.params.contractCode; this.record = this.$route.params.record; this.FarmersContractList(); //需要触发的函数 // alert(this.minrisk) // alert(this.maxrisk) // alert(this.farmersName) // alert(this.contractCode) // alert(this.record) }, methods: { // FarmersContractList() { // let _this = this; // axios({ // url: // "/api/cloudec/fo/order/OrderContractController/GetOrderContractPage", // method: "post", // data: { // pageNo: 1, // pageSize: 10 // this.data=this.$route.query; // // this.maxarea=this.$route.query.maxarea; // // this.minarea=this.$route.query.minarea; // // this.isrecord=this.$route.query.isrecord; // // this.ocnum=this.$route.query.ocnum; // // this.farmername=this.$route.query.farmername; // }, // 刷新开始 // vsInstance vm===this // refreshDom === 刷新dom handleRS(vsInstance, refreshDom, done) { if (this.refreshStart) { this.refreshStart(done); } else { //this.setDone1(done); done(); } }, // 刷新完之后 handleRBD(vm, loadDom, done) { if (this.refreshDeactivate) { this.refreshDeactivate(done); } else { setTimeout(() => { this.setDone1(done); }, 600); } }, // 上拉开始 handleLoadStart(vm, dom, done) { if (this.loadStart) { this.loadStart(done); } else { if (this.isfirstload) { //this.setDone(done); done(); } else { done(); this.isfirstload = true; } } }, // 上拉完成后 handleLBD(vm, loadDom, done) { if (!this.$parent.noData) { if (this.loadDeactivate) { this.loadDeactivate(done); } else { setTimeout(() => { this.setDone(done); //done(); }, 600); } } else { setTimeout(() => { this.setDone(done); //done(); }, 600); } }, // 手动触发 外部通过ref触发 // type load 为加载 refresh 为刷新 trigger(type = "load") { this.$refs["vs"].triggerRefreshOrLoad(type); }, setDone(done) { if(this.sx){ this.pageNo++; this.FarmersContractList(); } done(); }, setDone1(done) { if(this.xl){ this.xl=false; this.ContractList = []; this.is=true; this.pageNo = 1; this.FarmersContractList(); } done(); }, FarmersContractList(done) { let _this = this; if (_this.is) { indexApi.FarmersContractList(this.pageNo,this.maxrisk,this.minrisk,this.record,this.contractCode,this.farmersName,this.departCode, this.zqCode,this.presser,this.xzCode,this.zj) .then(function(response) { // response.data中获取ResponseData实体 // alert(response); if(response.data.pageSize==0){ _this.context="暂无数据"; } for (var i = 0; i < response.data.page.dataList.length; i++) { _this.sx=false; _this.xl=false; _this.ContractList.push(response.data.page.dataList[i]); } _this.sx=true; _this.xl=true; if (response.data.page.totalPage == _this.pageNo) { _this.is = false; _this.context="暂无更多数据"; } //_this.ContractList = response.data.page.dataList; }) .catch(function(error) { // 发生错误 }); } else { //document.getElementById("nodata").style.display = "block"; } }, select() { this.$router.replace({ name: "select", params: { user: this.user, departCode:this.departCode, zqCode:this.zqCode, xzCode:this.xzCode, zqName:this.zqName, presser:this.presser } }); }, jumppage(val) { this.$router.replace({name: "contractInfo", params: { user: this.user,dictid: val, departCode:this.departCode, zqCode:this.zqCode, xzCode:this.xzCode, zqName:this.zqName, presser:this.presser}}); }, toIndex(){ this.$router.replace({name: "index"+this.user.wxUserInfo.userType, params: { user: this.user}}); } } }; </script> <style> .pr-wrap_tra { display: flex; height: calc(93vh); justify-content: center; width: 100%; } .pr-wrap_tra .wrap-part_tra { height: 100%; width: 100%; } .pr-wrap_tra .wrap-part_tra .first_tra { width: 100%; width: 100%; } .contractList_css_tra { position: relative; margin: 0 auto; width: 90%; height: 170px; background-color: #ffffff; border-radius: 5px; padding: 10px 10px 10px 10px; box-shadow: 5px 5px 10px 2px#DCDCDC; margin-bottom: 20px; } .tr_css_tra { margin: 10px 10px 10px 10px; /* border: 1px solid red; */ } /* .table_tra { width: 100%; text-align: center; margin-top: 50px; position: relative; margin: 0 auto; } */ .content_tra { color: #045ce4; } .table_css_tra{ width: 100%; text-align: center; margin-top: 50px; position: relative; margin: 0 auto; } </style> ```
将数据库中查出的数据,存入自己写的一个json格式中,该怎么做?
将数据库中查出的数据,存入自己写的一个json格式中,该怎么做?需要将自己 定义的json格式写个实体类吗?要的话该怎么写,是要将这个json数据传到前台解析的 { "attendance": [ { "name": "....", "show": [ { "date": [ { "am": "08:00" }, { "pm": "17:40" }, { "is": "0" } ] }, { "date": [ { "am": "08:00" }, { "pm": "17:40" }, { "is": "1" } ] } ] } ] }
对实体 "characterEncoding" 的引用必须以 ';' 分隔符结尾。
Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession. ### Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 15; columnNumber: 87; 对实体 "characterEncoding" 的引用必须以 ';' 分隔符结尾。 at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8) at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:32) at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:16) at com.dao.TestMybatis.main(TestMybatis.java:19) Caused by: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 15; columnNumber: 87; 对实体 "characterEncoding" 的引用必须以 ';' 分隔符结尾。 at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:238) at org.apache.ibatis.parsing.XPathParser.<init>(XPathParser.java:102) at org.apache.ibatis.builder.xml.XMLConfigBuilder.<init>(XMLConfigBuilder.java:40) at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:29) ... 2 more Caused by: org.xml.sax.SAXParseException; lineNumber: 15; columnNumber: 87; 对实体 "characterEncoding" 的引用必须以 ';' 分隔符结尾。 at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327) at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1472) at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanAttributeValue(XMLScanner.java:913) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanAttribute(XMLDocumentFragmentScannerImpl.java:1548) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1315) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2784) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:841) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339) at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:236) ... 5 more
Android解析JSON数组,如果里面有两个数组,要怎么处理
项目中遇到服务器给的文档里面有两个数组 这样 { "code":200, "message":"调用成功", "data":{ "mem_message_records":[ { "message_disease_typeid":"1", "message_disease_type":"心血管系统" }, { "message_disease_typeid":"2", "message_disease_type":"外围血管疾病" }, { "message_disease_typeid":"3", "message_disease_type":"脑血管疾病" }, { "message_disease_typeid":"4", "message_disease_type":"肺部疾病" }, { "message_disease_typeid":"5", "message_disease_type":"代谢疾病" }, { "message_disease_typeid":"6", "message_disease_type":"周围神经疾病" }, { "message_disease_typeid":"7", "message_disease_type":"其他疾病" } ], "mem_message_recordss":[ [ { "message_diseaseid":"1", "message_disease":"冠状动脉疾病" }, { "message_diseaseid":"2", "message_disease":"心绞痛" }, { "message_diseaseid":"3", "message_disease":"心肌梗死" }, { "message_diseaseid":"4", "message_disease":"冠状动脉血运重建" }, { "message_diseaseid":"5", "message_disease":"充血性心力衰竭" } ], [ { "message_diseaseid":"6", "message_disease":"闭塞性周围动脉粥样硬化" }, { "message_diseaseid":"7", "message_disease":"血栓行静脉炎" } ], [ { "message_diseaseid":"8", "message_disease":"脑血栓" }, { "message_diseaseid":"9", "message_disease":"短暂性脑供血不足" }, { "message_diseaseid":"10", "message_disease":"脑出血" } ], [ { "message_diseaseid":"11", "message_disease":"慢性支气管炎" }, { "message_diseaseid":"12", "message_disease":"慢性阻塞性肺病" }, { "message_diseaseid":"13", "message_disease":"支气管哮喘" }, { "message_diseaseid":"14", "message_disease":"间质性肺病" }, { "message_diseaseid":"15", "message_disease":"囊性肺纤维化" } ], [ { "message_diseaseid":"16", "message_disease":"1型糖尿病" }, { "message_diseaseid":"17", "message_disease":"2型糖尿病" }, { "message_diseaseid":"18", "message_disease":"糖尿病肾病" } ], [ { "message_diseaseid":"19", "message_disease":"糖尿病性周围精神病" }, { "message_diseaseid":"20", "message_disease":"自主神经性病变" } ], [ { "message_diseaseid":"21", "message_disease":"高血压" }, { "message_diseaseid":"22", "message_disease":"视网膜病变" }, { "message_diseaseid":"23", "message_disease":"恶性肿瘤" }, { "message_diseaseid":"24", "message_disease":"脑卒中" }, { "message_diseaseid":"25", "message_disease":"重性精神疾病" }, { "message_diseaseid":"26", "message_disease":"结核病" }, { "message_diseaseid":"27", "message_disease":"肝炎" }, { "message_diseaseid":"28", "message_disease":"先天畸形" }, { "message_diseaseid":"29", "message_disease":"其它" } ] ] } } 下面是我构建的实体类 这是最里层的两个, //疾病名称 public class JiBingdataname { private String message_diseaseid; private String message_disease; } //疾病类型 public class JiBingdata { private String message_disease_type; private String message_disease_typeid; } //外一层 public class JiBinglist { private List<JiBingdata> mem_message_records; private List<JiBingdataname> mem_message_recordss; } //最外层 public class JiBingbean { private String code; private String message; private JiBinglist data; } 下面是我的解析代码 //解析JSON数据 private class Mythread extends Thread { @Override public void run() { System.out.println("....启动线程"); //网络请求路径 String path = HttpInfo.PATH + HttpInfo.GET_JIBINGLIST + HttpInfo.ID; String jsonString = HttpUtils.getJsonContent(path); Gson gson = new Gson(); System.out.println("------------------------" + path); //解析json数据 jiBingbean = gson.fromJson(jsonString, JiBingbean.class); System.out.println("....启动线程" + jiBingbean); //解析成功后发送msg给UI主线程 Message msg = new Message(); msg.what = 101; myHandler.sendMessage(msg); } } 但是出现这样的问题 java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 520 path $.data.mem_message_recordss[0] logcat日志错误指向这一行, jiBingbean = gson.fromJson(jsonString, JiBingbean.class); 请教一下各位大神,是哪里处理的不好
求大佬帮助!java后端怎么构造这种json?
有2个实体类,一个是学生基本信息(主键学生id), 还有一个是学生成绩表(有一个字段学生id 通过 ``` select * from grade where id=20 查出来的是多行 ``` ``` { "data": [{ "name": "张三", "sex": "男", "grade": { "chinses": [{ "one": "88", "two": "98", "three": "95", "four": "55" }], "math": [{ "one": "88", "two": "98", "three": "95", "four": "55" }] } }] } ``` 但是,这2个实体类怎么搞 不知道怎么关联 可以 分别 select * from XX 然后 new Gson().tojson(集合) 或者 JSONArray.parseArray(JSON.toJSONString(list)); 这前端需要的json数据格式还有很大的差距 好像要在实体类中私有化 list 或者 map 然后该怎么操作呢........................
swagger2 测试后端实体接收不到
{ "content": "string", "createTime": "2017-10-12T03:21:07.192Z", "id": "string", "title": "string", "userId": "string" } 参数形式
请教如何把带日期的json如何转换实体类
``` { "result": { "PackageDetails": [ { "PackageId": 95523, "BeforehandBookingDay": 0, "PackageSaleInfoDetails": { "04/26/2017 00:00:00": { "RetailPrice": 1, "DistributionSalePrice": 582, "InventoryRemainder": 50, "InventoryStats": 0, "OpeningSale": false, "TcDirectPrice": 622, "BreakfastDetailList": [] }, "06/25/2017 00:00:00": { "RetailPrice": 1, "DistributionSalePrice": 582, "InventoryRemainder": 50, "InventoryStats": 0, "OpeningSale": false, "TcDirectPrice": 622, "BreakfastDetailList": [] } }, "ReserveTime": "18:00:00" } ], "LineId": 34187 }, "ret_code": "200", "err_msg": null } ---------------- 我自己转的实体类是 public class Request<T> { public T result { get; set; } public string ret_code { get; set; } public string err_msg { get; set; } } public class PackageDetailsObj { public List<PackageDetailsItem> PackageDetails { get; set; } public int LineId { get; set; } } public class PackageDetailsItem { public int PackageId { get; set; } public int BeforehandBookingDay { get; set; } public PackageSaleInfoDetailsObj PackageSaleInfoDetails { get; set; } public string ReserveTime { get; set; } } public class PackageSaleInfoDetailsObj { Dictionary<string, PackageSaleInfoDetailsItem> PackageSaleInfoDetails { get; set; } } public class PackageSaleInfoDetailsItem { public int RetailPrice { get; set; } public int DistributionSalePrice { get; set; } public int InventoryRemainder { get; set; } public int InventoryStats { get; set; } public string OpeningSale { get; set; } public int TcDirectPrice { get; set; } public List<string> BreakfastDetailList { get; set; } } 但是类PackageDetailsItem 的 public PackageSaleInfoDetailsObj PackageSaleInfoDetails { get; set; } 转换出来为null,我是用 Newtonsoft.Json; 转的。 ```
请问这样的json格式该怎样解析?具体的实体类该怎么定义?每个item的属性个数不一样,这样该怎么定义属性?
{ "result":"200",//String类型,成功时返回200 "newsList": [ { "type":1,//type为1时是新闻,2是广告,3、图酷 "title":"",//新闻标题 "img":“",//新闻中图片的地址 "intro":"",//新闻简介 "url":""//点击新闻跳转的地址 }, { "type":3,//图酷 "imgsTitle":"",//图集的标题 "imgsId":"",//图集的id "imgsNum":3,//图片的总数量 "imgsUrl":["","",""]//图片的地址 }, { "type":2,//广告 "imgs":["","",""],广告的图片 "title":"",//广告的标题 "cssType":"1",//css样式 "spread":"",//推广文案 "intro":"",//简介 "url":""//点击广告跳转的url } ], "pageNo":1,//当前页 "endPage"://最后页 }
爬虫福利二 之 妹子图网MM批量下载
爬虫福利一:27报网MM批量下载    点击 看了本文,相信大家对爬虫一定会产生强烈的兴趣,激励自己去学习爬虫,在这里提前祝:大家学有所成! 目标网站:妹子图网 环境:Python3.x 相关第三方模块:requests、beautifulsoup4 Re:各位在测试时只需要将代码里的变量 path 指定为你当前系统要保存的路径,使用 python xxx.py 或IDE运行即可。
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 顺便拉下票,我在参加csdn博客之星竞选,欢迎投票支持,每个QQ或者微信每天都可以投5票,扫二维码即可,http://m234140.nofollow.ax.
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入 假设现有4个人...
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 欢迎 改进 留言。 演示地点跳到演示地点 html代码如下`&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;music&lt;/title&gt; &lt;meta charset="utf-8"&gt
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。 1. for - else 什么?不是 if 和 else 才
数据库优化 - SQL优化
前面一篇文章从实例的角度进行数据库优化,通过配置一些参数让数据库性能达到最优。但是一些“不好”的SQL也会导致数据库查询变慢,影响业务流程。本文从SQL角度进行数据库优化,提升SQL运行效率。 判断问题SQL 判断SQL是否有问题时可以通过两个表象进行判断: 系统级别表象 CPU消耗严重 IO等待严重 页面响应时间过长
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 c/c++ 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7
通俗易懂地给女朋友讲:线程池的内部原理
餐厅的约会 餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”我楞了一下,心里想女朋友今天是怎么了,怎么突然问出这么专业的问题,但做为一个专业人士在女朋友面前也不能露怯啊,想了一下便说:“我先给你讲讲我前同事老王的故事吧!” 大龄程序员老王 老王是一个已经北漂十多年的程序员,岁数大了,加班加不动了,升迁也无望,于是拿着手里
经典算法(5)杨辉三角
杨辉三角 是经典算法,这篇博客对它的算法思想进行了讲解,并有完整的代码实现。
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹
面试官:你连RESTful都不知道我怎么敢要你?
面试官:了解RESTful吗? 我:听说过。 面试官:那什么是RESTful? 我:就是用起来很规范,挺好的 面试官:是RESTful挺好的,还是自我感觉挺好的 我:都挺好的。 面试官:… 把门关上。 我:… 要干嘛?先关上再说。 面试官:我说出去把门关上。 我:what ?,夺门而去 文章目录01 前言02 RESTful的来源03 RESTful6大原则1. C-S架构2. 无状态3.统一的接
JDK12 Collectors.teeing 你真的需要了解一下
前言 在 Java 12 里面有个非常好用但在官方 JEP 没有公布的功能,因为它只是 Collector 中的一个小改动,它的作用是 merge 两个 collector 的结果,这句话显得很抽象,老规矩,我们先来看个图(这真是一个不和谐的图????): 管道改造经常会用这个小东西,通常我们叫它「三通」,它的主要作用就是将 downstream1 和 downstre...
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看
SQL-小白最佳入门sql查询一
不要偷偷的查询我的个人资料,即使你再喜欢我,也不要这样,真的不好;
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // doshom...
【图解经典算法题】如何用一行代码解决约瑟夫环问题
约瑟夫环问题算是很经典的题了,估计大家都听说过,然后我就在一次笔试中遇到了,下面我就用 3 种方法来详细讲解一下这道题,最后一种方法学了之后保证让你可以让你装逼。 问题描述:编号为 1-N 的 N 个士兵围坐在一起形成一个圆圈,从编号为 1 的士兵开始依次报数(1,2,3…这样依次报),数到 m 的 士兵会被杀死出列,之后的士兵再从 1 开始报数。直到最后剩下一士兵,求这个士兵的编号。 1、方...
致 Python 初学者
欢迎来到“Python进阶”专栏!来到这里的每一位同学,应该大致上学习了很多 Python 的基础知识,正在努力成长的过程中。在此期间,一定遇到了很多的困惑,对未来的学习方向感到迷茫。我非常理解你们所面临的处境。我从2007年开始接触 python 这门编程语言,从2009年开始单一使用 python 应对所有的开发工作,直至今天。回顾自己的学习过程,也曾经遇到过无数的困难,也曾经迷茫过、困惑过。开办这个专栏,正是为了帮助像我当年一样困惑的 Python 初学者走出困境、快速成长。希望我的经验能真正帮到你
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,...
程序员:我终于知道post和get的区别
是一个老生常谈的话题,然而随着不断的学习,对于以前的认识有很多误区,所以还是需要不断地总结的,学而时习之,不亦说乎
GitHub标星近1万:只需5秒音源,这个网络就能实时“克隆”你的声音
作者 | Google团队 译者 | 凯隐 编辑 | Jane 出品 | AI科技大本营(ID:rgznai100) 本文中,Google 团队提出了一种文本语音合成(text to speech)神经系统,能通过少量样本学习到多个不同说话者(speaker)的语音特征,并合成他们的讲话音频。此外,对于训练时网络没有接触过的说话者,也能在不重新训练的情况下,仅通过未知...
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU...
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1...
程序员把地府后台管理系统做出来了,还有3.0版本!12月7号最新消息:已在开发中有github地址
第一幕:缘起 听说阎王爷要做个生死簿后台管理系统,我们派去了一个程序员…… 996程序员做的梦: 第一场:团队招募 为了应对地府管理危机,阎王打算找“人”开发一套地府后台管理系统,于是就在地府总经办群中发了项目需求。 话说还是中国电信的信号好,地府都是满格,哈哈!!! 经常会有外行朋友问:看某网站做的不错,功能也简单,你帮忙做一下? 而这次,面对这样的需求,这个程序员...
网易云6亿用户音乐推荐算法
网易云音乐是音乐爱好者的集聚地,云音乐推荐系统致力于通过 AI 算法的落地,实现用户千人千面的个性化推荐,为用户带来不一样的听歌体验。 本次分享重点介绍 AI 算法在音乐推荐中的应用实践,以及在算法落地过程中遇到的挑战和解决方案。 将从如下两个部分展开: AI算法在音乐推荐中的应用 音乐场景下的 AI 思考 从 2013 年 4 月正式上线至今,网易云音乐平台持续提供着:乐屏社区、UGC...
【技巧总结】位运算装逼指南
位算法的效率有多快我就不说,不信你可以去用 10 亿个数据模拟一下,今天给大家讲一讲位运算的一些经典例子。不过,最重要的不是看懂了这些例子就好,而是要在以后多去运用位运算这些技巧,当然,采用位运算,也是可以装逼的,不信,你往下看。我会从最简单的讲起,一道比一道难度递增,不过居然是讲技巧,那么也不会太难,相信你分分钟看懂。 判断奇偶数 判断一个数是基于还是偶数,相信很多人都做过,一般的做法的代码如下...
【管理系统课程设计】美少女手把手教你后台管理
【文章后台管理系统】URL设计与建模分析+项目源码+运行界面 栏目管理、文章列表、用户管理、角色管理、权限管理模块(文章最后附有源码) 1. 这是一个什么系统? 1.1 学习后台管理系统的原因 随着时代的变迁,现如今各大云服务平台横空出世,市面上有许多如学生信息系统、图书阅读系统、停车场管理系统等的管理系统,而本人家里就有人在用烟草销售系统,直接在网上完成挑选、购买与提交收货点,方便又快捷。 试想,若没有烟草销售系统,本人家人想要购买烟草,还要独自前往药...
4G EPS 第四代移动通信系统
目录 文章目录目录4G 与 LTE/EPCLTE/EPC 的架构E-UTRANE-UTRAN 协议栈eNodeBEPCMMES-GWP-GWHSSLTE/EPC 协议栈概览 4G 与 LTE/EPC 4G,即第四代移动通信系统,提供了 3G 不能满足的无线网络宽带化,主要提供数据(上网)业务。而 LTE(Long Term Evolution,长期演进技术)是电信领域用于手机及数据终端的高速无线通...
相关热词 c# 二进制截断字符串 c#实现窗体设计器 c#检测是否为微信 c# plc s1200 c#里氏转换原则 c# 主界面 c# do loop c#存为组套 模板 c# 停掉协程 c# rgb 读取图片
立即提问