求大神!! SpringbootAdmin2.1.4 解析gson类型的json出错

springboot2.1.4版本.

默认使用json转换器gson(spring.http.converters.preferred-json-mapper=gson),

使用springbootAdmin监控时,

beans会报错Forgot to register a type adapter?

图片说明

问题:springbootAdmin使用默认的jackson没问题,怎么能兼容gson?

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
为什么的图片点击隐藏效果没有实现,是哪里出了问题,求大神解答!

``` <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>首页</title> <style type="text/css"> body{ margin:0; padding:0;} .total{ width:960px; margin:0 auto;} .main,.footer,.head{ font-size:30px;} .head{ height:100px; background:#ccc} .main{ height:485px; background:#FCC} .footer{ height:50px; background:#9CF} /*广告样式*/ .pic{ width:100%; height:100%; background-color:rgba(0,0,0,0.5); position:fixed; top:0px; right:0px; } .adv{ position:fixed; top:60px; left:360px; } </style> </head> <body> <!--应用jQuery--> <script type="text/javascript" src="js/jquery-3.0.0.js"></script> <script type="text/javascript"> $(".adv").click(function(){ $(".adv").hide(); $(".pic").hide(); }); </script> <!--悬浮广告--> <div class="pic"> <img src="img/103-160Q509544OC.jpg" class="adv"> </div> <div class="total"> <div class="head">jquery-2.1.4 (注!jquery-2.0以上版本不再支持IE 6/7/8)</div> <div class="main">jquery-2.1.4 (注!jquery-2.0以上版本不再支持IE 6/7/8)</div> <div class="footer">jquery-2.1.4 (注!jquery-2.0以上版本不再支持IE 6/7/8)</div> </div> </body> </html> ```

jQuery中ajax请求数据时候json格式报错

我在用ajax请求数据的时候报错了 报错信息如下: ![图片说明](https://img-ask.csdn.net/upload/201805/18/1526632076_427193.png) 请求的数据一共四个,id title link addtime 百度查了下有人说格式错误,可是我感觉没错啊 后面经过测试发现是link这个数据有问题 当我取消link的输出时ajax请求就不报错了 如下图: ![图片说明](https://img-ask.csdn.net/upload/201805/18/1526632200_252507.png) 求解

springboot2.1.4 + jpa + hibernate 使用aop注解形式实现多数据源管理 可能懒加载出现问题求大神解答

最近项目中使用springboot2.1.4 + jpa + hibernate 使用aop注解形式实现多数据源管理,用的就是网上大多数人使用的一套代码,但是我在项目中使用后发现如果配置 spring配置文件 application.yml 中open-in-view: false 跨数据源查询正常,但是保存或者修改失败原因是事务没有提交,一旦把open-in-view改成true则不能跨数据源查询,修改保存正常事务正常提交求解,具体代码如下实现 1. application.yml ``` spring: ## 数据库配置 #datasource: #driver-class-name: com.mysql.jdbc.Driver #url: jdbc:mysql://192.168.101.125:3306/cdv?useSSL=false&characterEncoding=utf-8 #username: root #password: 123456 #url: jdbc:mysql://127.0.0.1:3306/boot-jpa-back-sys2?useSSL=false&characterEncoding=utf-8 #username: root #password: datasource: test1: driver-class-name: com.mysql.jdbc.Driver jdbc-url: jdbc:mysql://192.168.101.125:3306/cdv?useSSL=false&characterEncoding=utf-8 username: root password: 123456 type: com.alibaba.druid.pool.DruidDataSource test2: driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver jdbc-url: jdbc:sqlserver://192.168.101.125:1433;database=Test; username: sa password: Zqvideo123 type: com.alibaba.druid.pool.DruidDataSource ## jpa配置 jpa: show-sql: true hibernate: #ddl-auto: update properties: hibernate.dialect: com.common.mysql.MySQLDialectUTF8 hibernate.format_sql: false open-in-view: false ``` DataSourceAsepct ``` package com.common.db; import java.lang.reflect.Method; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Pointcut; import org.aspectj.lang.reflect.MethodSignature; import org.springframework.core.annotation.Order; import org.springframework.stereotype.Component; @Aspect @Component @Order(0) public class DataSourceAsepct { //加载数据源 @Pointcut("@annotation(com.common.db.DataSourceSet)") // @AfterThrowing(pointcut="@annotation(com.common.db.DataSource)", throwing= "error") public void pointCut(){ } @Before("pointCut()") public void before(JoinPoint joinPoint) { Object target = joinPoint.getTarget(); MethodSignature signature = (MethodSignature) joinPoint.getSignature(); DataSourceEnum dataSource = DataSourceEnum.DEFAULT; try { Method method = target.getClass().getMethod(signature.getName(), signature.getParameterTypes()); if (method.isAnnotationPresent(DataSourceSet.class)) { DataSourceSet annotation = method.getAnnotation(DataSourceSet.class); dataSource = annotation.value(); } } catch (NoSuchMethodException e) { e.printStackTrace(); } //实现aop切换数据源 System.out.println("aop切换数据源:" + dataSource.getName()); DataSourceHolder.setDataSource(dataSource); } // @After("pointCut()") @AfterThrowing(pointcut="@annotation(com.common.db.DataSourceSet)", throwing= "error") public void after() { DataSourceHolder.clearDataSource(); String v = DataSourceHolder.getDataSource(); System.out.println(v); } } ``` DataSourceConfig ``` package com.common.db; import java.util.HashMap; import java.util.Map; import javax.sql.DataSource; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.jdbc.DataSourceBuilder; import org.springframework.boot.jta.atomikos.AtomikosDataSourceBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; import org.springframework.jdbc.datasource.DataSourceTransactionManager; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.jta.JtaTransactionManager; @Configuration public class DataSourceConfig { //连接数据库db1 @Bean("test1") @ConfigurationProperties("spring.datasource.test1") public DataSource test1() { return DataSourceBuilder.create().build(); } //连接数据库db2 @Bean("test2") @ConfigurationProperties("spring.datasource.test2") public DataSource test2() { return DataSourceBuilder.create().build(); } @Bean("dynamicDataSource") @Primary public DataSource dynamicDataSource() { DynamicDataSource dataSource = new DynamicDataSource(); dataSource.setDefaultTargetDataSource(test1()); Map<Object, Object> dataSourceMap = new HashMap<>(2); dataSourceMap.put(DataSourceEnum.TEST1.getName(), test1()); dataSourceMap.put(DataSourceEnum.TEST2.getName(), test2()); dataSource.setTargetDataSources(dataSourceMap); return dataSource ; } @Bean public PlatformTransactionManager transactionManager() { return new DataSourceTransactionManager(dynamicDataSource()); } } ``` DataSourceEnum ``` package com.common.db; import lombok.AllArgsConstructor; import lombok.Getter; @AllArgsConstructor @Getter public enum DataSourceEnum { DEFAULT("test1"), TEST1("test1"), TEST2("test2"); private String name; } ``` DataSourceHolder ``` package com.common.db; public class DataSourceHolder { private static final ThreadLocal<String> DS_HOLDER = new ThreadLocal<>(); public static void setDataSource(DataSourceEnum dataSource) { DS_HOLDER.set(dataSource.getName()); } public static String getDataSource() { return DS_HOLDER.get(); } public static void clearDataSource() { DS_HOLDER.remove(); } } ``` DataSourceSet ``` package com.common.db; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) @Documented public @interface DataSourceSet { //枚举 DataSourceEnum value(); } ``` DynamicDataSource ``` package com.common.db; import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource; public class DynamicDataSource extends AbstractRoutingDataSource { @Override protected Object determineCurrentLookupKey() { //基于aop切换数据源 System.out.println("dynamic datasource 切换数据源" + DataSourceHolder.getDataSource()); return DataSourceHolder.getDataSource(); } } ``` 测试调用 ``` server层 @Override @DataSourceSet(DataSourceEnum.TEST1) public String test1(Long id) { String s = programRepository.findids(id); System.out.println(s); return s; } @Override @DataSourceSet(DataSourceEnum.TEST2) public String test2(Long id) { String s = testRepository.findids1(id); System.out.println(s); return s; } ``` ``` Controller层 @PostMapping("/test") @ResponseBody public ResultVo test(Long id) { id = 1l; String beProgram1 = programService.test1(id); System.out.println(222); id=2l; String beProgram = testService.test2(id); System.out.println(333); return ResultVoUtil.success(beProgram+beProgram1); } ```

求教在jquery2.1.4中的getJSON是怎么用的;下面的为什么不能执行

$("#letter-b a").on("click",function(event){ event.preventDefault(); $.getJSON('test22_b.json',function(data){ alert(1); var html = ''; $.each(data,function(entryIndex,entry){ html += '<div class="entry">'; html += '<h3 class="term">' + entry.term + '</h3>'; html += '<div class="part">' + entry.part + '</div>'; html += '<div class="definition">'; html += entry.definition; html += '</div>'; html += '</div>'; }); $('#dictionary').html(html); }); });

SpringBoot +MybatisPlus +activiti整合版本冲突,有没有整合没冲突的组合,求推荐!

SpringBoot+MybatisPlus+activiti整合时因该是出现了版本冲突问题 我用的版本: SpringBoot 2.1.4 MybatisPlus 3.1.1 activiti 5.21.0 启动报错 ![图片说明](https://img-ask.csdn.net/upload/201908/28/1566985960_344424.png) 将MybatisPlus版本换成3.1.0和3.1.2都不行 又将activiti版本换成6.0也不行。有没有推荐的

用npm安装package.json时出现错误

我是在win8 64bit上面操作,本来安装的nodejs是64位的, npm install时一直出现错误,上网查后有说要安装32位的,而且需要安装vs, 于是我卸载64的node又安装32的node,又安装vs2012, 然后又npm install 出现如下异常: ``` npm WARN optional dep failed, continuing fsevents@0.3.8 \ > spawn-sync@1.0.13 postinstall E:\project2\shijuan\node_modules\node-sass\node_modules\sas modules\spawn-sync > node postinstall \ > node-sass@3.2.0 install E:\project2\shijuan\node_modules\node-sass > node scripts/install.js Binary downloaded and installed at E:\project2\shijuan\node_modules\node-sass\vendor\win32- > node-sass@3.2.0 postinstall E:\project2\shijuan\node_modules\node-sass > node scripts/build.js ` E:\project2\shijuan\node_modules\node-sass\vendor\win32-ia32-14\binding.node ` exists. testing binary. Binary is fine; exiting. \ > bufferutil@1.1.0 install E:\project2\shijuan\node_modules\webpack-dev-server\node_modules > node-gyp rebuild | (venv) Think@RESEARCH E:\project2\shijuan\node_modules\webpack-dev-server\node_modules\sock > if not defined npm_config_node_gyp (node "C:\Program Files (x86)\nodejs\node_modules\npm\ e rebuild ) 在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。 bufferutil.cc 正在创建库 E:\project2\shijuan\node_modules\webpack-dev-server\node_modules\socket.io\ util .expb 和对象 E:\project2\shijuan\node_modules\webpack-dev-server\node_modules\socket.io\n 正在生成代码 已完成代码的生成 bufferutil.vcxproj -> E:\project2\shijuan\node_modules\webpack-dev-server\node_modules\so se\\bufferutil.node | > utf-8-validate@1.1.0 install E:\project2\shijuan\node_modules\webpack-dev-server\node_mod f-8-validate > node-gyp rebuild / (venv) Think@RESEARCH E:\project2\shijuan\node_modules\webpack-dev-server\node_modules\sock ate > if not defined npm_config_node_gyp (node "C:\Program Files (x86)\nodejs\node_modules\npm\ e rebuild ) 在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。 validation.cc 正在创建库 E:\project2\shijuan\node_modules\webpack-dev-server\node_modules\socket.io- ild\ Release\validation.lib 和对象 E:\project2\shijuan\node_modules\webpack-dev-server\node_mo tf -8-validate\build\Release\validation.exp 正在生成代码 已完成代码的生成 validation.vcxproj -> E:\project2\shijuan\node_modules\webpack-dev-server\node_modules\so lidate\build\Release\\validation.node > utf-8-validate@1.1.0 install E:\project2\shijuan\node_modules\webpack-dev-server\node_mod > node-gyp rebuild (venv) Think@RESEARCH E:\project2\shijuan\node_modules\webpack-dev-server\node_modules\sock > if not defined npm_config_node_gyp (node "C:\Program Files (x86)\nodejs\node_modules\npm\ e rebuild ) 在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。 validation.cc 正在创建库 E:\project2\shijuan\node_modules\webpack-dev-server\node_modules\socket.io\ lida tion.lib 和对象 E:\project2\shijuan\node_modules\webpack-dev-server\node_modules\socket.i va lidation.exp 正在生成代码 已完成代码的生成 validation.vcxproj -> E:\project2\shijuan\node_modules\webpack-dev-server\node_modules\so elease\\validation.node > bufferutil@1.1.0 install E:\project2\shijuan\node_modules\webpack-dev-server\node_modules util > node-gyp rebuild (venv) Think@RESEARCH E:\project2\shijuan\node_modules\webpack-dev-server\node_modules\sock > if not defined npm_config_node_gyp (node "C:\Program Files (x86)\nodejs\node_modules\npm\ e rebuild ) 在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。 bufferutil.cc 正在创建库 E:\project2\shijuan\node_modules\webpack-dev-server\node_modules\socket.io- Rele ase\bufferutil.lib 和对象 E:\project2\shijuan\node_modules\webpack-dev-server\node_module ru til\build\Release\bufferutil.exp 正在生成代码 已完成代码的生成 bufferutil.vcxproj -> E:\project2\shijuan\node_modules\webpack-dev-server\node_modules\so il\build\Release\\bufferutil.node vinyl-named@1.1.0 node_modules\vinyl-named └── through@2.3.8 manifest-revision-webpack-plugin@0.0.5 node_modules\manifest-revision-webpack-plugin └── walk@2.3.9 (foreachasync@3.0.0) coffee-script@1.9.3 node_modules\coffee-script superagent@1.3.0 node_modules\superagent ├── extend@1.2.1 ├── methods@1.0.1 ├── cookiejar@2.0.1 ├── component-emitter@1.1.2 ├── reduce-component@1.0.1 ├── mime@1.3.4 ├── qs@2.3.3 ├── debug@2.2.0 (ms@0.7.1) ├── readable-stream@1.0.27-1 (inherits@2.0.1, isarray@0.0.1, string_decoder@0.10.31, core-u ├── formidable@1.0.14 └── form-data@0.2.0 (async@0.9.2, combined-stream@0.0.7, mime-types@2.0.14) ``` 其实看上去也成功了很多,但是前面那几个异常怎么解决呢?谢谢各位 package.json如下 ``` { "repository": { "type": "git", "url": "" }, "license": "MIT", "description": "Project Shijuan", "scripts": { "start": "node_modules/.bin/webpack-dev-server --config conf/webpack.config.js --progress --colors --port 5001 --content-base build/public", "build": "node_modules/.bin/webpack --config conf/webpack.config.js --progress --profile --colors" }, "dependencies": { "amazeui": "^2.4.2", "babel-core": "^5.4.7", "babel-loader": "^5.1.3", "coffee-loader": "^0.7.2", "coffee-script": "^1.9.3", "css-loader": "^0.15.6", "echarts": "^2.2.7-beta7", "extract-text-webpack-plugin": "^0.8.1", "file-loader": "^0.8.4", "html-loader": "^0.3.0", "jquery": "^2.1.4", "manifest-revision-webpack-plugin": "^0.0.5", "node-sass": "^3.2.0", "postcss-loader": "^0.5.1", "sass-loader": "^2.0.0", "style-loader": "^0.12.3", "superagent": "^1.3.0", "url-loader": "^0.5.6", "vinyl-named": "^1.1.0", "vue": "^0.12.10", "vue-loader": "^2.1.1", "vue-validator": "^1.4.0", "webpack": "^1.10.0", "webpack-dev-server": "^1.9.0", "zrender": "ecomfe/zrender" } } ```

JQuery 开关灯问题,求大神指点

为啥点击只能使之变黑,再点就没反应了呀。。。 ``` <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title></title> <meta charset="utf-8" /> <script src="scripts/jquery-2.1.4.min.js"></script> <script type="text/javascript"> $(function () { $("#kgd").click(function () { $(document.body).toggleClass("night"); //没有就加,有就移除 }); }); </script> <style type="text/css"> .night{background-color:black;} </style> </head> <body> <input value="开关灯" id="kgd" type="button" /> </body> </html> ```

如何将完成的json表单中的数据发送到php数据库

<div class="post-text" itemprop="text"> <p>I want to run a code that allows automatic sending of the completed json form when internet connection is detected in the device. My ids for each of the question are dynamically generated. How do i send data on click of my submit button to the database while checking if there is internet connection if all my ids are dynamic?</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Form Page&lt;/title&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt; &lt;link rel="stylesheet" type="text/css" href="css/style.css" /&gt; &lt;link rel="stylesheet" type="text/css" href="css/panel2.css" /&gt; &lt;link rel="stylesheet" type="text/css" href="css/jquery.mobile-1.4.5.min.css"&gt; &lt;script src="js/jquery-2.1.4.min.js"&gt;&lt;/script&gt; &lt;script src="js/jquery.mobile-1.4.5.min.js"&gt;&lt;/script&gt; &lt;script src="js/rotation.js"&gt;&lt;/script&gt; &lt;!-- /rotation--&gt; &lt;script src="js/panel2.js"&gt;&lt;/script&gt; &lt;!-- /panel2--&gt; &lt;script type="text/javascript" src="cordova.js"&gt;&lt;/script&gt; &lt;script src="form.json"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;script src="js/fullscreen.js"&gt;&lt;/script&gt; &lt;!-- /fullscreen--&gt; &lt;div data-role="page" id="demo-page" data-url="demo-page"&gt; &lt;div data-role="header" data-theme="b"&gt; &lt;h1&gt;&lt;/h1&gt; &lt;a href="#left-panel" data-icon="carat-r" data-iconpos="notext" data-shadow="false" data-iconshadow="false" class="ui-nodisc-icon"&gt;Open left panel&lt;/a&gt; &lt;/div&gt;&lt;!-- /header --&gt; &lt;div role="main" class="ui-content jqm-content jqm-fullwidth" id="form-panel"&gt; &lt;h3 class="textaligncenter"&gt;This is a Form&lt;/h3&gt; &lt;div id="questions"&gt; &lt;/div&gt; &lt;script&gt; var array = JSON.parse(arrayQuestions); console.log(array); for(var i=0;i&lt;array.length;i++){ var question = array[i]; var questionDiv = document.createElement("div"); var html = "&lt;form&gt;"; html = question.question + " &lt;br&gt; "; var choices = question.choices; for(j=0;j&lt;choices.length;j++){ var choicesOpt = choices[j]; if(question.type == "radio") { html += "&lt;fieldset data-role=\"controlgroup\"&gt;"; html += "&lt;input type=\"radio\" name=\"" +i+ "\" id=\"" +i+choicesOpt+ "\" value=\"" +choicesOpt+ "\" /&gt;&lt;label for=\"" +i+choicesOpt+ "\"&gt;" +choicesOpt+ "&lt;/label&gt;"; html += "&lt;/fieldset&gt;"; } else if(question.type == "checkbox"){ html += "&lt;fieldset data-role=\"controlgroup\"&gt;"; html += "&lt;input type=\"checkbox\" name=\"" +i+ "\" id=\"" +i+choicesOpt+ "\" value=\"" +choicesOpt+ "\" /&gt;&lt;label for=\"" +i+choicesOpt+ "\"&gt;" +choicesOpt+ "&lt;/label&gt;"; html += "&lt;/fieldset&gt;"; } else if(question.type == "textbox"){ html += "&lt;input type=\"text\" data-clear-btn=\"true\" name=\"" +i+ "\" id=\"" +i+choicesOpt+ "\" value=\"" +choicesOpt+ "\"&gt;"; } else { html += "&lt;textarea name=\"" +i+ "\" id=\"" +i+choicesOpt+ "\"&gt;&lt;/textarea&gt;"; } html += ""; } html += "&lt;/form&gt;"; // html += "&lt;input type=\"button\" onclick=\"myFunction()\" value=\"Submit form\"&gt;&lt;/form&gt;"; questionDiv.innerHTML = html + "&lt;br&gt;"; document.getElementById('questions').appendChild(questionDiv); } &lt;/script&gt; &lt;script&gt; var buttonDiv = document.createElement("div"); var buttonHtml = "&lt;input type=\"button\" onclick=\"saveFunction()\" id=\"save\" value=\"Save Form\"&gt;&lt;/form&gt;"; buttonHtml += "&lt;input type=\"button\" onclick=\"submitFunction()\" id=\"submit\" value=\"Submit Form\"&gt;&lt;/form&gt;"; buttonDiv.innerHTML = buttonHtml + "&lt;br&gt;"; document.getElementById('questions').appendChild(buttonDiv); document.addEventListener("deviceready",onDeviceReady, false); document.addEventListener("online", OnlineEvent, false); document.addEventListener("offline", OnDeviceOffline, false); function onDeviceReady() { } function OnlineEvent(){ alert("You are online"); // $('#submit').on('click', function () { // $.ajax({ // url: "connection.php", // type: "POST", // data: { // choice: $('#"\" value=\"" +choicesOpt+ "\" ').val(), // // } // datatype: "json", // success: function (status) { // if (status.success == false) { // //alert a failure message // } else { // alert("Successfully submitted"); // } // } // }); // }); } function OnDeviceOffline(){ alert("You are offline"); } function saveFunction() { //Save storage here // window.location.href='status.html'; if (OnlineEvent()== true){ $('#submit').on('click', function () { $.ajax({ url: "connection.php", type: "POST", data: { choice: $('#"\" value=\"" +choicesOpt+ "\" ').val(), } datatype: "json", success: function (status) { if (status.success == false) { //alert a failure message } else { alert("Successfully submitted"); } } }); }); } } function submitFunction() { if (OnlineEvent()== true){ alert("Storage code here, send to server"); // STORAGE FUNCTION CODE HERE alert("Your form is successfully submitted!"); window.location.href='previewform.html';} } &lt;/script&gt; &lt;/div&gt;&lt;!-- /content --&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; &lt;?php $choice = json_decode($_POST['&lt;script&gt;choicesOpt&lt;/script&gt;']); //And this is how, i suppose, we will add the values to my table 'sample' $sql = "INSERT INTO answers (choicesOpt) "; $sql .= "VALUES ('$choicesOpt')"; if (!mysql_query($sql, $con)) { die('Error: ' . mysql_error()); } else { echo "Answers stored"; } mysql_close($con); ?&gt; </code></pre> </div>

从服务器读取文本文件(Json)并发送到客户端(Javascript)

<div class="post-text" itemprop="text"> <p>I am facing problem by using "JSON.stringify" and "Json.parse" for string. The application uses client broweser via Javascript to read a textfile (JSON string) from server via PHP.</p> <p>The problem is that after I used "stringify", the output of the string printed as follow:</p> <pre><code>" \t {\"employees\":[{\"firstName\":\"John\",\"lastName\":\"Doe\" },{\"firstName\":\"Anna\",\"lastName\":\"Smith\" },{\"firstName\":\"Peter\",\"lastName\":\"Jones\" }]} " </code></pre> <ul> <li>If not using "stringify", it printed as same as the original text in the text file. </li> <li><p>If I use "JSON.stringify" then "Json.parse" it show error as below:</p> <p>Unexpected token &lt; in JSON at position 0 at JSON.parse ()</p></li> </ul> <p>The code are the following:</p> <h2>Sample of textfile:</h2> <p>{"employees":[{"firstName":"John","lastName":"Doe" },{"firstName":"Anna","lastName":"Smith" },{"firstName":"Peter","lastName":"Jones" }]}</p> <h2>HTML with Javascript page:</h2> <pre><code> &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.min.js"&gt;&lt;/script&gt; &lt;script&gt; var text = '{"employees":[' + '{"firstName":"John","lastName":"Doe" },' + '{"firstName":"Anna","lastName":"Smith" },' + '{"firstName":"Peter","lastName":"Jones" }]}'; function printEmployee() { obj = JSON.parse(text); var selEmployee = document.getElementById("selEmployee"); document.getElementById("demo").innerHTML = obj.employees[selEmployee.selectedIndex].firstName + " " + obj.employees[selEmployee.selectedIndex].lastName; } function postToPhp() { var dataString = JSON.stringify(text); $.post("processJson.php", { dataString }, function(data,status){ alert("Data: " + data + " Status: " + status); }); } function postAsyncGet() { getToPhp() .then(viewGetResult); } function getToPhp() { var dataString; $.get("readJson.php", { dataString }, function(data,status){ alert("Data: " + data + " Status: " + status); viewGetResult(data); }); } function viewGetResult(dataString) { var jsonstr = JSON.stringify(dataString.trim()); //var obj = JSON.parse(dataString); document.getElementById("demo").innerHTML = dataString; var selEmployee = document.getElementById("selEmployee"); //document.getElementById("demo").innerHTML = //obj.employees[selEmployee.selectedIndex].firstName + " " + //obj.employees[selEmployee.selectedIndex].lastName; } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;h2&gt;Create Object from JSON String&lt;/h2&gt; &lt;label&gt; Select an Employee: &lt;/label&gt; &lt;select id = "selEmployee"&gt; &lt;option value = "1" selected="selected"&gt;1&lt;/option&gt; &lt;option value = "2"&gt;2&lt;/option&gt; &lt;option value = "3"&gt;3&lt;/option&gt; &lt;/select&gt; &lt;p&gt;&lt;a href="#" onclick="printEmployee();"&gt;Print Me!&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="#" onclick="postToPhp();"&gt;Post Me to PHP!&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="#" onclick="getToPhp();"&gt;Get from PHP!&lt;/a&gt;&lt;/p&gt; &lt;p id="demo"&gt;&lt;/p&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <h2>PHP Code</h2> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.min.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;?php $obj = json_decode($_POST["dataString"]); echo $obj-&gt;var; $myfile = fopen("newfile.txt", "w") or die("Unable to open file!"); fwrite($myfile, $obj ); fclose($myfile); ?&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> </div>

求大神帮忙:python pymssql模块安装成功,import pymssql 出错

pip list pymssql 2.1.4 windows系统 64位,python 3.7.4版本 import pymssql DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working

前台报了这么个错,json数据都有,网上找了好久都找不到,众神谁来帮帮我!!

Uncaught SyntaxError: Unexpected token d in JSON at position 0 at JSON.parse (<anonymous>) at Object.formatItemParamData [as formatter] (eval at <anonymous> (http://localhost:8080/js/jquery-easyui-1.4.1/jquery.min.js:2:2620), <anonymous>:4:19) at Object.renderRow (http://localhost:8080/js/jquery-easyui-1.4.1/jquery.easyui.min.js:9986:13) at Object.render (http://localhost:8080/js/jquery-easyui-1.4.1/jquery.easyui.min.js:9919:26) at _5f6 (http://localhost:8080/js/jquery-easyui-1.4.1/jquery.easyui.min.js:8837:18) at http://localhost:8080/js/jquery-easyui-1.4.1/jquery.easyui.min.js:9422:1 at Object.success (http://localhost:8080/js/jquery-easyui-1.4.1/jquery.easyui.min.js:10128:1) at j (http://localhost:8080/js/jquery-easyui-1.4.1/jquery.min.js:2:27244) at Object.fireWith [as resolveWith] (http://localhost:8080/js/jquery-easyui-1.4.1/jquery.min.js:2:28057) at x (http://localhost:8080/js/jquery-easyui-1.4.1/jquery.min.js:4:21843)

在codeigniter 2.1.4中设置文件目录和文件权限

<div class="post-text" itemprop="text"> <p>I am using <code>codeigniter version 2.1.4</code> for my website. I am trying to create directories whenever a user signs up for an account.</p> <p>For example: After recieving the success status from a signup function.</p> <pre><code>//Right after the signup, i am trying to do this to create directories. $dirname = base_url().'uploads/'.$this-&gt;input-&gt;post('username').'/'; if(!is_dir($dirname)){ echo 'not a directory'; mkdir(base_url().'uploads/'.$this-&gt;input-&gt;post('username').'/'); }else{ echo 'is directory: '.$dirname; } </code></pre> <p>Would be great if someone helps me out so that i can set the file permissions successfully. Thanks.</p> </div>

如何将jquery-1.10.2.js和jQuery-2.1.4.min.js包含在一起

<div class="post-text" itemprop="text"> <p>Hello I am including jQuery-2.1.4.min.js and jquery-1.10.2.js together but I am getting error:</p> <blockquote> <p>custom.js:375 Uncaught TypeError: $(...).autocomplete is not a function</p> </blockquote> <p>If i remove jQuery-2.1.4.min.js then i m getting error in one price ranger. So i can not remove any one JS.</p> <p>So how to use both so that my price ranger and autocomplete functionality works ?</p> <p><strong>Script:</strong></p> <pre><code>&lt;script src="//code.jquery.com/jquery-1.10.2.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="mydirectorypath/js/jQuery-2.1.4.min.js"&gt;&lt;/script&gt; </code></pre> <p><strong>By Above code I am getting error $(...).autocomplete is not a function</strong> </p> </div>

PHP MYSQL JSON Phonegap登录应用程序

<div class="post-text" itemprop="text"> <p>I was trying to make a Phonegap App which has a simple login form, which should ideally connect to a PHP form, and retrieve the user role.</p> <p>I would like to clarify following things:</p> <ol> <li>My Login Page, written in PHP works fine.</li> <li><p>When given the proper credentials as Get parameters, it returns the right JSON tags :</p> <pre><code>{"update":true,"msg":"","role":"admin"} </code></pre></li> </ol> <p>Here is my Phonegap App HTML code. Kindly assist me on where I am going wrong. Assume that the username is username and password is password.</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" /&gt; &lt;link rel="stylesheet" type="text/css" href="css/index.css" /&gt; &lt;title&gt;Hello World&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;div class="app"&gt; &lt;form&gt; &lt;input id="username" name="username"placeholder="Email"&gt;&lt;/input&gt; &lt;input id="password" name="password"type="password" placeholder="Password"&gt;&lt;/input&gt; &lt;input type="button" value="Login" id="btnLogin"/&gt; &lt;/form&gt; &lt;div id="myDate"&gt;&lt;/div&gt; &lt;/div&gt; &lt;script type="text/javascript" src="cordova.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="js/index.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="js/jquery-2.1.4.min.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function() { $("#btnLogin").click(function() { $( "#myDate" ).text( "Reached Here" ); $.ajax({ url:"https://myurl.com/api-file.php", type:"GET", dataType:"json", data:{username:"username",password:"password"}, ContentType:"application/json", success:function(response) { alert(JSON.stringify(response)); }, error: function(error) { alert(JSON.stringify(error)); } }) }); }); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>How the App should perform is, when I click the button, it calls the jquery code, which generates an AJAx request to the php file and retrieves a JSON string, which I intend to only pop as alert, as of now.</p> <p>However, clicking the button does absolutely nothing.</p> <p>I am hardcoding the username and password now but can and will take it from fields later on. Need to test this first before I do that though. Kindly assist on where am I going wrong.</p> </div>

python 安装 pymssql 库时报错

安装第三方库 ``` pip install pymssql Traceback (most recent call last): File "c:\users\XXX\appdata\local\programs\python\python37\lib\site-packages\pip\_vendor\urllib3\response.py", line 425, in _error_catcher yield File "c:\users\XXX\appdata\local\programs\python\python37\lib\site-packages\pip\_vendor\urllib3\response.py", line 507, in read data = self._fp.read(amt) if not fp_closed else b"" File "c:\users\XXX\appdata\local\programs\python\python37\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 62, in read data = self.__fp.read(amt) File "c:\users\XXX\appdata\local\programs\python\python37\lib\http\client.py", line 457, in read n = self.readinto(b) File "c:\users\XXX\appdata\local\programs\python\python37\lib\http\client.py", line 501, in readinto n = self.fp.readinto(b) File "c:\users\XXX\appdata\local\programs\python\python37\lib\socket.py", line 589, in readinto return self._sock.recv_into(b) File "c:\users\XXX\appdata\local\programs\python\python37\lib\ssl.py", line 1071, in recv_into return self.read(nbytes, buffer) File "c:\users\XXX\appdata\local\programs\python\python37\lib\ssl.py", line 929, in read return self._sslobj.read(len, buffer) socket.timeout: The read operation timed out During handling of the above exception, another exception occurred: Traceback (most recent call last): File "c:\users\XXX\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\cli\base_command.py", line 153, in _main status = self.run(options, args) File "c:\users\XXX\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\commands\install.py", line 382, in run resolver.resolve(requirement_set) File "c:\users\XXX\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\legacy_resolve.py", line 201, in resolve self._resolve_one(requirement_set, req) File "c:\users\XXX\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\legacy_resolve.py", line 365, in _resolve_one abstract_dist = self._get_abstract_dist_for(req_to_install) File "c:\users\XXX\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\legacy_resolve.py", line 313, in _get_abstract_dist_for req, self.session, self.finder, self.require_hashes File "c:\users\XXX\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\operations\prepare.py", line 194, in prepare_linked_requirement progress_bar=self.progress_bar File "c:\users\XXX\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\download.py", line 465, in unpack_url progress_bar=progress_bar File "c:\users\XXX\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\download.py", line 316, in unpack_http_url progress_bar) File "c:\users\XXX\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\download.py", line 551, in _download_http_url _download_url(resp, link, content_file, hashes, progress_bar) File "c:\users\XXX\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\download.py", line 253, in _download_url hashes.check_against_chunks(downloaded_chunks) File "c:\users\XXX\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\utils\hashes.py", line 80, in check_against_chunks for chunk in chunks: File "c:\users\XXX\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\download.py", line 223, in written_chunks for chunk in chunks: File "c:\users\XXX\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\utils\ui.py", line 160, in iter for x in it: File "c:\users\XXX\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\download.py", line 212, in resp_read decode_content=False): File "c:\users\XXX\appdata\local\programs\python\python37\lib\site-packages\pip\_vendor\urllib3\response.py", line 564, in stream data = self.read(amt=amt, decode_content=decode_content) File "c:\users\XXX\appdata\local\programs\python\python37\lib\site-packages\pip\_vendor\urllib3\response.py", line 529, in read raise IncompleteRead(self._fp_bytes_read, self.length_remaining) File "c:\users\XXX\appdata\local\programs\python\python37\lib\contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "c:\users\XXX\appdata\local\programs\python\python37\lib\site-packages\pip\_vendor\urllib3\response.py", line 430, in _error_catcher raise ReadTimeoutError(self._pool, None, "Read timed out.") pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='pypi.tuna.tsinghua.edu.cn', port=443): Read timed out. ``` 也下载了 wordcloud-1.6.0-cp37-cp37m-win_amd64.whl python版本是3.7 64位

在ubuntu服务器5.3.6-13ubuntu3.6上安装xdebug 2.1.4

<div class="post-text" itemprop="text"> <p>I have tried to install xdebug on my ubuntu server machine and it's not working. The reason I know it's not working is that the output of var_dump is not colorized, nor can I connect to it using netbeans.</p> <p>I followed the tailored instructions on how to install xdebug on</p> <pre><code>http://xdebug.org/wizard.php </code></pre> <p>Here is what the output of my phpinfo analysis was:</p> <pre><code>Xdebug installed: no Server API: Apache 2.0 Handler Windows: no Zend Server: no PHP Version: 5.3.6-13 Zend API nr: 220090626 PHP API nr: 20090626 Debug Build: no Thread Safe Build: no Configuration File Path: /etc/php5/apache2 Configuration File: /etc/php5/apache2/php.ini Extensions directory: /usr/lib/php5/20090626 </code></pre> <p>The name of the file that wizard recommended was xdebug-2.1.4.tgz</p> <p>The output of phpize was</p> <pre><code>Configuring for: PHP Api Version: 20090626 Zend Module Api No: 20090626 Zend Extension Api No: 220090626 </code></pre> <p>My phpinfo now does show xdebug installed, here is how it looks like:</p> <p><img src="https://i.stack.imgur.com/euwbo.png" alt="enter image description here"></p> <p>Here is what I have in my php.ini</p> <pre><code>zend_extension = /usr/lib/php5/20090626/xdebug.so xdebug.profiler_output_dir = "/var/log/apache2/xdebug" xdebug.profiler_output_name = "cachegrind.out.%p" xdebug.profiler_enable =1 xdebug.profiler_append=1 xdebug.extended_info=1 xdebug.remote_enable=1 xdebug.remote_handler="dbgp" xdebug.remote_mode=req xdebug.remote_host=192.168.2.13 xdebug.remote_port=9000 ;xdebug.idekey=xdebug xdebug.idekey=netbeans-xdebug xdebug.remote_connect_back=1 xdebug.remote_log="/var/log/apache2/xdebug_remote.log" xdebug.show_exception_trace=0 xdebug.show_local_vars=9 xdebug.show_mem_delta=0 </code></pre> <p>The output of lsb_release -a on my computer is</p> <pre><code>No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 11.10 Release: 11.10 Codename: oneiric </code></pre> <p>PHP version shown on phpinfo is 5.3.6-13ubuntu3.6</p> </div>

使用AJAX / JSON进行PHP验证

<div class="post-text" itemprop="text"> <p>My validation is in my php script encoded in json, I'm not sure how to implement it in my main JavaScript function. I'm using regular expressions to in my php script to validate the form criteria, I need to pass this to the JavaScript file and return a success massage for for each form id.<br> this is what I have so far.</p> <p></p><div class="snippet" data-lang="js" data-hide="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function() { $("#submit").click(function() { // Clear any success or error messages $("#success").html(""); $("#errors").empty(); //make an AJAX call here, and set error or success accordingly $.post('backend.php',{act:'validate'}, function(getData) { //unsure about this function } }); // prevents submit button default behavior return false; }); });</code></pre> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt; &lt;head&gt; &lt;/head&gt; &lt;body&gt; &lt;h1&gt;Form Validation&lt;/h1&gt; &lt;form id="PersonForm"&gt; Name: &lt;input id="name" type ="text" name="name"&gt;&lt;/input&gt; &lt;br&gt;&lt;br&gt; Postal Code: &lt;input id="postal" type ="text" name="postal"&gt;&lt;/input&gt; &lt;br&gt;&lt;br&gt; Phone Number: &lt;input id="phone" type ="text" name="phone"&gt;&lt;/input&gt; &lt;br&gt;&lt;br&gt; Address: &lt;input id="address" type ="text" name="address"&gt;&lt;/input&gt; &lt;br&gt;&lt;br&gt; &lt;input type="submit"&gt;&lt;/input&gt; &lt;/form&gt; &lt;div id= "content"&gt;&lt;/div&gt; &lt;a href="frontend.html"&gt;Refresh&lt;/a&gt; &lt;a id="InsertDefault" href="#"&gt;Insert Default Data&lt;/a&gt; &lt;br&gt;&lt;br&gt; &lt;p id='msg'&gt;&lt;/p&gt; &lt;ul id="errors"&gt;&lt;/ul&gt; &lt;p id="success"&gt;&lt;/p&gt; &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="main.js" type="text/javascript"&gt;&lt;/script&gt; &lt;/body&gt; &lt;/html&gt;</code></pre> </div> </div> <pre><code>&lt;?php if ($_REQUEST['act'] == 'validate') { $validateData = array(); if (preg_match("/^[A-Za-z]{3,20}$/",$_REQUEST['name'])) $validateData['name'] = 1; else $validateData['name'] = 0; if (preg_match("/^[0-9]{10}$/",$_REQUEST['phone'])) $validateData['phone'] = 1; else $validateData['phone'] = 0; if (preg_match("/^[A-Z][0-9][A-Z][0-9][A-Z][0-9]$/", $_REQUEST['postal'])) $validateData['postal'] = 1; else $validateData['postal'] = 0; if (preg_match("/^[0-9]{3} [A-Za-z]{3,10} Street$/", $_REQUEST['address'])) $validateData['address'] = 1; else $validateData['address'] = 0; echo json_encode($validateData); } else echo "Should not happen"; ?&gt; </code></pre> </div>

net::ERR_INCOMPLETE_CHUNKED_ENCODING

jquery-1.7.2.js:8288; POST ->http://localhost:8089/caihongshop-brandruzhu/test/testLoad/781; net::ERR_INCOMPLETE_CHUNKED_ENCODING. 昨天做java web开发时遇到了一个比较烦的错误,一直解决不了,前端框架使用的springmvc,Ajax请求加载数据返回json,如果使用post方式就chrome开发者工具就报这个错误,get方式能正常输出json,忙了一下午也没找到错误原因,有同样遇到这个问题的吗?具体错误如下:jquery-1.7.2.js:8288 POST http://localhost:8089/caihongshop-brandruzhu/test/testLoad/781 net::ERR_INCOMPLETE_CHUNKED_ENCODINGsend @ jquery-1.7.2.js:8288jQuery.extend.ajax @ jquery-1.7.2.js:7767(anonymous function) @ test-view.js:5fire @ jquery-1.7.2.js:1075self.fireWith @ jquery-1.7.2.js:1193jQuery.extend.ready @ jquery-1.7.2.js:435DOMContentLoaded @ jquery-1.7.2.js:949![图片说明](https://img-ask.csdn.net/upload/201603/31/1459387531_347969.png)。注意:返回json时controller中使用@ResponseBody解析的pojo实体类有点小复杂(里边有几个manytoone映射关系),感觉问题就在这里,因为个人使用了简单的实体类返回就没有问题。

android studio 混淆文件配置

![据说android studio 默认将libs的第三方jar包忽略混淆,所以就没有将类似#-libraryjars libs/umeng-analytics-v5.2.4.jar的操作写入到配置文件,只是将-keep class com.umeng.**{*;}和忽略警告的操作写入配置文件。但是发现gradle在.idea/libraries中引入了其他很多jar包以及这些包的存储地址。刚好程序报错中的com.b.a.a.a 就是指的idea/libraries中的一个包中的类,即为com.loopj.android.http.AsyncHttpClient,不知道怎么在混淆配置文件中忽略这些包的混淆。最后通过配置,发现这些包还是被混淆了,不知道怎么才能配置好这些包不被混淆](https://img-ask.csdn.net/upload/201511/10/1447140316_8891.jpg) 下面是我的配置文件: -optimizationpasses 5 -dontusemixedcaseclassnames -verbose -dontpreverify -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* -keepattributes *Annotation* -keepattributes Signature -keep class android.**{*;} -keep public class * extends android.view -keep public class * extends android.app.Fragment -keep public class * extends android.app.Activity -keep public class * extends android.app.Application -keep public class * extends android.app.Service -keep public class * extends android.content.BroadcastReceiver -keep public class * extends android.content.ContentProvider -keep public class * extends android.app.backup.BackupAgentHelper -keep public class * extends android.preference.Preference -keep public class * extends android.support.V4.** -keep public class * extends android.vending.licensing.ILicensingService -dontwarn android.support.v4.** -keep class * extends android.support.v4.**{*;} -dontwarn android.support.v7.** -keep class * extends android.support.v7.**{*;} /* 将libs文件下的三方包忽略混淆*/ -keep class com.mob.logcolletor.**{ *;} -dontwarn com.mob.tools.** -keep class com.mob.tools.**{ *;} -dontwarn com.mob.baidu.** -keep class com.mob.baidu.**{ *;} -dontwarn cn.sharesdk.framework.** -keep class cn.sharesdk.framework.**{ *;} -dontwarn cn.sharesdk.system.email.** -keep class cn.sharesdk.system.email.**{ *;} -dontwarn cn.sharesdk.tencent.qq.** -keep class cn.sharesdk.tencent.qq.**{ *;} -dontwarn cn.sharesdk.system.text.** -keep class cn.sharesdk.system.text.**{ *;} -dontwarn cn.sharesdk.wechat.friends.** -keep class cn.sharesdk.wechat.friends.**{ *;} -dontwarn cn.sharesdk.wechat.utils.** -keep class cn.sharesdk.wechat.utils.**{ *;} -dontwarn cn.sharesdk.wechat.favorite.** -keep class cn.sharesdk.wechat.favorite.**{ *;} -dontwarn cn.sharesdk.wechat.moments.** -keep class cn.sharesdk.wechat.moments.**{ *;} -dontwarn com.tencent.** -keep class com.tencent..**{ *;} -keep public interface com.mob.logcolletor.** -keep public interface com.mob.tools.** -keep public interface com.mob.baidu.** -keep public interface cn.sharesdk.framework.** -keep public interface cn.sharesdk.system.email.** -keep public interface cn.sharesdk.tencent.qq.** -keep public interface cn.sharesdk.system.text.** -keep public interface cn.sharesdk.wechat.friends.** -keep public interface cn.sharesdk.wechat.utils.** -keep public interface cn.sharesdk.wechat.favorite.** -keep public interface cn.sharesdk.wechat.moments.** -keepclasseswithmembernames class * { native <methods>; } -keepclassmembers public class * extends android.view.View { void set*(***); *** get*(); } -keepclasseswithmembernames class * { void onClick*(...); } -keepclasseswithmembernames class * { *** *Callback(...); } -keepclasseswithmembernames class * { public <init>(android.content.Context,android.util.AttributeSet,int); } -keepclasseswithmembernames class * { public <init>(android.content.Context,android.util.AttributeSet); } -keepclassmembers class * extends android.app.Activity { public void *(android.view.View); } -keepclassmembers enum * { public static **[] values(); public static ** valueOf(java.lang.String); } -keep class * implements android.os.Parcelable { public static final android.os.Parcelable$Creator *; } -keep class org.apache.http.**{*;} -keepclassmembers class **.R$* { public static <fields>; } /* 将External Libraries文件下的三方包忽略混淆*/ -libraryjars $USER_HOME$/.gradle/caches/modules-2/files-2.1/com.loopj.android/android-async-http/1.4.8/77bbfe240e437ecb396d982afa0d3bd4f9090ba7/android-async-http-1.4.8.jar -libraryjars $USER_HOME$/.gradle/caches/modules-2/files-2.1/com.loopj.android/android-async-http/1.4.8/ec314dce534e83c93364388d023625bb8e605e38/android-async-http-1.4.8-sources.jar! -libraryjars build/intermediates/exploded-aar/com.soundcloud.android/android-crop/1.0.0/jars/classes.jar -libraryjars build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.0/jars/classes.jar -libraryjars $USER_HOME$/Documents/androidWorkSpace/android-sdk-macosx/extras/android/m2repository/com/android/support/appcompat-v7/23.0.0/appcompat-v7-23.0.0-sources.jar -libraryjars $USER_HOME$/.gradle/caches/modules-2/files-2.1/com.jakewharton/butterknife/7.0.1/d5d13ea991eab0252e3710e5df3d6a9d4b21d461/butterknife-7.0.1.jar -libraryjars $USER_HOME$/.gradle/caches/modules-2/files-2.1/com.jakewharton/butterknife/7.0.1/ad53343e57ae0969aaf451a19eef381abe2ad3a1/butterknife-7.0.1-sources.jar -libraryjars build/intermediates/exploded-aar/com.android.support/cardview-v7/23.0.0/jars/classes.jar -libraryjars $USER_HOME$/Documents/androidWorkSpace/android-sdk-macosx/extras/android/m2repository/com/android/support/cardview-v7/23.0.0/cardview-v7-23.0.0-sources.jar -libraryjars build/intermediates/exploded-aar/com.android.support/design/23.0.0/jars/classes.jar -libraryjars $USER_HOME$/.gradle/caches/modules-2/files-2.1/com.github.bumptech.glide/glide/3.6.1/86b122e640af09b0723e1fa44083c354ba6d9089/glide-3.6.1.jar -libraryjars $USER_HOME$/.gradle/caches/modules-2/files-2.1/com.github.bumptech.glide/glide/3.6.1/c84c6f18844d9ae76308619008d40277de5e77d3/glide-3.6.1-sources.jar -libraryjars $USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.code.gson/gson/2.3/5fc52c41ef0239d1093a1eb7c3697036183677ce/gson-2.3.jar -libraryjars $USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.code.gson/gson/2.3/21e31b9298ed677b17fcac6dd0eb0a82ec35adc2/gson-2.3-sources.jar -libraryjars $USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpcore/4.3.2/31fbbff1ddbf98f3aa7377c94d33b0447c646b6e/httpcore-4.3.2.jar -libraryjars $USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpcore/4.3.2/4809f38359edeea9487f747e09aa58ec8d3a54c5/httpcore-4.3.2-sources.jar -libraryjars build/intermediates/exploded-aar/com.rengwuxian.materialedittext/library/2.1.4/jars/classes.jar -libraryjars $USER_HOME$/.gradle/caches/modules-2/files-2.1/com.nineoldandroids/library/2.4.0/e9b63380f3a242dbdbf103a2355ad7e43bad17cb/library-2.4.0.jar -libraryjars $USER_HOME$/.gradle/caches/modules-2/files-2.1/com.nineoldandroids/library/2.4.0/83d41901478fa8795254244acbafd03f14224dab/library-2.4.0-sources.jar -libraryjars build/intermediates/exploded-aar/com.orhanobut/logger/1.10/jars/classes.jar -libraryjars build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.0.0/jars/classes.jar -libraryjars $USER_HOME$/Documents/androidWorkSpace/android-sdk-macosx/extras/android/m2repository/com/android/support/recyclerview-v7/23.0.0/recyclerview-v7-23.0.0-sources.jar -libraryjars $USER_HOME$/Documents/androidWorkSpace/android-sdk-macosx/extras/android/m2repository/com/android/support/support-annotations/23.0.0/support-annotations-23.0.0.jar -libraryjars $USER_HOME$/Documents/androidWorkSpace/android-sdk-macosx/extras/android/m2repository/com/android/support/support-annotations/23.0.0/support-annotations-23.0.0-sources.jar -libraryjars build/intermediates/exploded-aar/com.android.support/support-v4/23.0.0/jars/classes.jar -libraryjars build/intermediates/exploded-aar/com.android.support/support-v4/23.0.0/jars/libs/internal_impl-23.0.0.jar -libraryjars $USER_HOME$/Documents/androidWorkSpace/android-sdk-macosx/extras/android/m2repository/com/android/support/support-v4/23.0.0/support-v4-23.0.0-sources.jar -dontwarn com.loopj.android.http.** -keep class com.loopj.android.http.**{ *;} -dontwarn com.baidu.** -keep class com.baidu.**{ *;} -dontwarn com.bumptech.glide.** -keep class com.bumptech.glide.**{ *;} -dontwarn com.google.gson.** -keep class com.google.gson.http.**{ *;} -dontwarn com.nineoldandroids.** -keep class com.nineoldandroids.**{ *;} -dontwarn com.orhanobut.logger.** -keep class com.orhanobut.logger.**{ *;} -dontwarn com.rengwuxian.materialedittext.** -keep class com.rengwuxian.materialedittext.**{ *;} -dontwarn com.soundcloud.android.crop.** -keep class com.soundcloud.android.crop.**{ *;} -ignorewarning -dump class_files.txt -printseeds seeds.txt -printusage unused.txt -printmapping mapping.txt

大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了

大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

springboot+jwt实现token登陆权限认证

一 前言 此篇文章的内容也是学习不久,终于到周末有时间码一篇文章分享知识追寻者的粉丝们,学完本篇文章,读者将对token类的登陆认证流程有个全面的了解,可以动态搭建自己的登陆认证过程;对小项目而已是个轻量级的认证机制,符合开发需求;更多精彩原创内容关注公主号知识追寻者,读者的肯定,就是对作者的创作的最大支持; 二 jwt实现登陆认证流程 用户使用账号和面发出post请求 服务器接受到请求后使用私...

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

程序员写出这样的代码,能不挨骂吗?

当你换槽填坑时,面对一个新的环境。能够快速熟练,上手实现业务需求是关键。但是,哪些因素会影响你快速上手呢?是原有代码写的不够好?还是注释写的不够好?昨夜...

外包程序员的幸福生活

今天给你们讲述一个外包程序员的幸福生活。男主是Z哥,不是在外包公司上班的那种,是一名自由职业者,接外包项目自己干。接下来讲的都是真人真事。 先给大家介绍一下男主,Z哥,老程序员,是我十多年前的老同事,技术大牛,当过CTO,也创过业。因为我俩都爱好喝酒、踢球,再加上住的距离不算远,所以一直也断断续续的联系着,我对Z哥的状况也有大概了解。 Z哥几年前创业失败,后来他开始干起了外包,利用自己的技术能...

优雅的替换if-else语句

场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

2020阿里全球数学大赛:3万名高手、4道题、2天2夜未交卷

阿里巴巴全球数学竞赛( Alibaba Global Mathematics Competition)由马云发起,由中国科学技术协会、阿里巴巴基金会、阿里巴巴达摩院共同举办。大赛不设报名门槛,全世界爱好数学的人都可参与,不论是否出身数学专业、是否投身数学研究。 2020年阿里巴巴达摩院邀请北京大学、剑桥大学、浙江大学等高校的顶尖数学教师组建了出题组。中科院院士、美国艺术与科学院院士、北京国际数学...

为什么你不想学习?只想玩?人是如何一步一步废掉的

不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

早上躺尸,晚上干活:硅谷科技公司这么流行迟到?

硅谷科技公司上班时间OPEN早已不是什么新鲜事,早九晚五是常态,但有很多企业由于不打卡,员工们10点、11点才“姗姗来迟”的情况也屡见不鲜。 这种灵活的考勤制度为人羡慕,甚至近年来,国内某些互联网企业也纷纷效仿。不过,硅谷普遍弹性的上班制度是怎么由来的呢?这种“流行性迟到”真的有那么轻松、悠哉吗? 《动态规划专题班》 课程试听内容: 动态规划的解题要领 动态规划三大类 求最值/计数/可行性 常...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

终于懂了TCP和UDP协议区别

终于懂了TCP和UDP协议区别

Python爬虫,高清美图我全都要(彼岸桌面壁纸)

爬取彼岸桌面网站较为简单,用到了requests、lxml、Beautiful Soup4

无代码时代来临,程序员如何保住饭碗?

编程语言层出不穷,从最初的机器语言到如今2500种以上的高级语言,程序员们大呼“学到头秃”。程序员一边面临编程语言不断推陈出新,一边面临由于许多代码已存在,程序员编写新应用程序时存在重复“搬砖”的现象。 无代码/低代码编程应运而生。无代码/低代码是一种创建应用的方法,它可以让开发者使用最少的编码知识来快速开发应用程序。开发者通过图形界面中,可视化建模来组装和配置应用程序。这样一来,开发者直...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

Java岗开发3年,公司临时抽查算法,离职后这几题我记一辈子

前几天我们公司做了一件蠢事,非常非常愚蠢的事情。我原以为从学校出来之后,除了找工作有测试外,不会有任何与考试有关的事儿。 但是,天有不测风云,公司技术总监、人事总监两位大佬突然降临到我们事业线,叫上我老大,给我们组织了一场别开生面的“考试”。 那是一个风和日丽的下午,我翘着二郎腿,左手端着一杯卡布奇诺,右手抓着我的罗技鼠标,滚动着轮轴,穿梭在头条热点之间。 “淡黄的长裙~蓬松的头发...

大胆预测下未来5年的Web开发

在2019年的ReactiveConf 上,《Elm in Action》的作者Richard Feldman对未来5年Web开发的发展做了预测,很有意思,分享给大家。如果你有机会从头...

立即提问
相关内容推荐