:Expected BEGIN_ARRAY求大神们

12-03 01:40:58.903 3439-3456/? E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
Process: com.h954gmail.y.cnch, PID: 3439
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 1 path $
at com.google.gson.Gson.fromJson(Gson.java:899)
at com.google.gson.Gson.fromJson(Gson.java:852)
at com.google.gson.Gson.fromJson(Gson.java:801)
at com.h954gmail.y.cnch.fragment.HomeFragment$1.onResponse(HomeFragment.java:88)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:126)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 1 path $
at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:350)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:80)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
at com.google.gson.Gson.fromJson(Gson.java:887)
at com.google.gson.Gson.fromJson(Gson.java:852) 
at com.google.gson.Gson.fromJson(Gson.java:801) 
at com.h954gmail.y.cnch.fragment.HomeFragment$1.onResponse(HomeFragment.java:88) 
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:126) 
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
at java.lang.Thread.run(Thread.java:818) 

                                                                                                    求解!!

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
加急求解Expected BEGIN_ARRAY but was STRING
加急求解:Expected BEGIN_ARRAY but was STRING at line 1 column 1 path $ ![![图片说明](https://img-ask.csdn.net/upload/201808/13/1534137196_670067.png)图片说明](https://img-ask.csdn.net/upload/201808/13/1534137176_287535.png)![图片说明](https://img-ask.csdn.net/upload/201808/13/1534137224_13256.png) 以上是错误和目录 我在网上也百度了不少,但都说是jons 的问题,鄙人也是刚刚入门安卓的菜鸟一只,还请各路大神救救我,帮我看看是什么问题 代码两三页,这里贴着不方便 +QQ948677543 小弟在此谢过!谢过! 谢过! ``` ```
Gson解析Json数据出现了异常
在用Gson解析如下Json的时候 String jsonStr = "{code:403,msg:无查询好友信息,result:[]}"; 解析代码为: Gson son = new Gson(); MessageInfo info = son.fromJson(jsonStr, MessageInfo.class); System.out.println(info.getCode()); System.out.println(info.getResult()); System.out.println(info.getMsg()); MessageInfo.java private int code; private String msg; private Result result; result为空的时候,就会出现异常 com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 31 望大神帮下忙,解决下,这个怎么来解析
gson将json格式的字符串转成java对象,json字符串中long怎么转变不会报错?
# gson将json格式的字符串转成java对象,json字符串中long怎么转变不会报错? public static void main(String[] args) { long timel=12323232L; SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String time=sdf.format(timel); System.out.println(time);//正常 Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd HH:mm:ss").create(); String obj="[{\"name\":\"caochuankui\",\"time\":"+timel+"}]"; JSONArray objo=new JSONArray(obj); GsonTest gt=gson.fromJson(objo.toString(), GsonTest.class);//报错 System.out.println(gt.getTime()); } } 错误信息如下: 1970-01-01 11:25:23 Exception in thread "main" com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $ at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:200) at com.google.gson.Gson.fromJson(Gson.java:810) at com.google.gson.Gson.fromJson(Gson.java:775) at com.google.gson.Gson.fromJson(Gson.java:724) at com.google.gson.Gson.fromJson(Gson.java:696) at com.pagecofig.util.GsonTest.main(GsonTest.java:67) Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $ at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:387) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:189) ... 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); 请教一下各位大神,是哪里处理的不好
json解析json解析json解析
解析json出错 Expected BEGIN_ARRAY but was STRING at line 1 column 861 不知道怎么解析 这是返回的json: [{"Id":4,"ProductCode":"W003","ProductName":"智能钱包1号","ProductSName":"智能钱包1号","Description":"沿海银行推出的人民币理财系列产品,主要投资于优质信托融资项目、银行间债券市场的高信用等级债券等金融工具、理财计划、银行存款、承兑汇票等金融产品。期限灵活多选,并通过多种有效投资组合保障投资者的收益稳定可靠","Days":0,"TotalRaisedAmount":0.000000,"HasRaisedAmount":0.000000,"RaisedPercent":0.0,"RaisingStartDate":null,"RaisingEndDate":null,"ActualEstablishDate":null,"ProudctValueDate":null,"ProductDueDate":null,"EstimateCreditableDate":null,"ProductTypeId":2,"ProductTypeName":"IntelligentWallet","GoldExchangeName":"天安金交所","BankName":"沿海银行","BaseAmount":1.000000,"AdditionalAmount":1.000000,"PersonMaxAmount":0.000000,"Remark":null,"TDays":1,"TDaysForRedemption":1,"NearlySevenRate":4.320000,"MaxNearlySevenRate":0.000000,"MinNearlySevenRate":0.000000,"AmountPerMillion":1.150000,"IsNewComerBuy":true,"IsLimitTimeBuy":false,"StartDate":null,"EndDate":null,_"ProfitRule"_:"[{"Lv": 0,"Period": 7,"AmountPerMillion":1.15,"Rate": 4.51},{"Lv": 1,"Period": 15,"AmountPerMillion":1.16,"Rate": 4.52},{"Lv": 2,"Period": 30,"AmountPerMillion":1.17,"Rate": 4.53},{"Lv": 3,"Period": 45,"AmountPerMillion":1.18,"Rate": 4.54},{"Lv": 4,"Period": 60,"AmountPerMillion":1.19,"Rate": 4.55},{"Lv": 5,"Period": 75,"AmountPerMillion":1.20,"Rate": 4.56},{"Lv": 6,"Period": 90,"AmountPerMillion":1.21,"Rate": 4.57},{"Lv": 7,"Period": 120,"AmountPerMillion":1.22,"Rate": 4.58}]","HtmlBuyRule":null,"HtmlRedemptionRule":null,"HtmlProfitRule":null,"HtmlAssetRule":null} 这个是我的bean类: private int Id; private String ProductCode; private String ProductName; private String ProductSName; private String Description; private int Days; private double TotalRaisedAmount; private double HasRaisedAmount; private double RaisedPercent; private Object RaisingStartDate; private Object RaisingEndDate; private Object ActualEstablishDate; private Object ProudctValueDate; private Object ProductDueDate; private Object EstimateCreditableDate; private int ProductTypeId; private String ProductTypeName; private String GoldExchangeName; private String BankName; private double BaseAmount; private double AdditionalAmount; private double PersonMaxAmount; private Object Remark; private int TDays; private int TDaysForRedemption; private double NearlySevenRate; private double MaxNearlySevenRate; private double MinNearlySevenRate; private double AmountPerMillion; private boolean IsNewComerBuy; private boolean IsLimitTimeBuy; private Object StartDate; private Object EndDate; private List<Object> ProfitRule; private Object HtmlBuyRule; private Object HtmlRedemptionRule; private Object HtmlProfitRule; private Object HtmlAssetRule; 然后错误是出在这一行: dqlcproductEntityList = gson.fromJson(string, new TypeToken<List<ZnqbEntity>>(){}.getType()); 有没有大神知道怎么回事 是不是bean不对 主要看那个ProfitRule错误是Expected BEGIN_ARRAY but was STRING at line 1 column 861
本人计算机编程初学者,在国外学习,给的作业不知如何入门求大神解读
以下是题目联系 求大神指导一二 # 此问题如何进行编写 The TextBook class. Fields (Instance Variables): The class should have three private fields: one of type String to represent the title of the text book, one of type int to represent the length of the book in chapters, and one of type int to represent the number of the last chapter to be read (i.e. the number of chapters read so far). Constructor Method: The class should provide a constructor method with two parameters, one of type String and the other of type int. The first parameter represents the title of the book and the second its length in chapters. The constructor should therefore initialise a TextBook object by setting the title of the book to the specified String, and the length of the book to the specified int. In addition, the number of the last chapter read should initially be set to zero (as nothing has been read at this point) Other Methods: A TextBook object should also have the following public methods associated with it: • a method getTitle() that returns the String that represents the title of the book. • a void method readNextChapter() that 'reads' the next chapter of the book (if this is possible): i.e. it should cause the 'last chapter' field to be increased by one, but only if there are chapters left to be read! If there are no more chapters left to read (i.e. the last chapter read was the final chapter of the book) then it should simply print out a suitable warning message. • a boolean method isFinished() that returns true if there are no chapters of the book left to read and false otherwise. • a void method closeBook() that resets the last chapter read field to zero (i.e. it is used to return the book to its initial state, ready for the next person to begin reading it). • a void method describe() that prints out a simple description of the text book, with the book title and number of chapters left to read, e.g.: "Programming with Java with 4 chapters left to read" The LibraryCard Class Fields (Instance Variables): Your implementation of the LibraryCard class should provide the following private fields: • an int field that holds the limit on the number of books that the card can be used to borrow. • an int field that holds the number of books that have been borrowed on the card so far. • a String field that holds a card reference, for e.g. "cardID 3", "cardID 27" or "cardID 94". Constructor: The constructor method should take two int parameters: the first is used to set the limit on the number of books that can be borrowed with the card. • the second is used to set the card reference. Note: the card reference should be a String of the form "cardID NUM", where NUM is the actual value of the second formal parameter of the constructor. The constructor should also initialise the 'number of books borrowed' field as 0 when the card is constructed. Methods: There are four methods in addition to the constructor: a method with signature public void swipe() which when invoked, increases the number of books borrowed on the card by one. • a method with signature public boolean expired() which returns true if no more books can be borrowed on the card, and false otherwise. • a method with signature public String getCardRef() that returns the value of the card reference field. • a method with signature public void describe() that prints out a description of the card, for e.g. "Library card cardID 27 with 3 books left". The Library Class Fields (Instance Variables): Your implementation of the Library class should declare the following private fields: A field TextBook[] bookShelf which holds the library's collection of TextBook objects. • You will also find it useful to have an int field (called nextBook or something similar) which indicates the position on the bookShelf where the next TextBook object can be found (the next one available for borrowing when someone presents a valid library card). • an int field representing the number of borrowers who have been issued with library cards. Constructor: The class should have a constructor with a single integer parameter which determines the maximum number of TextBook objects that may be held on the library's bookShelf. Note: A problem here is to set up the Library object up so that it contains TextBook objects in an array. There are several steps in Java to setting up an array of objects: 1. Declare a variable of the appropriate type (in this case it is just the field bookShelf). 2. Create an array and store it in the variable (at this point it is an array of nulls). 3. Fill the array up with suitable objects (for which you will need to use a suitable loop statement) A further issue is how to construct the TextBook objects that are put into the bookShelf array. One simple possibility is to give all the books the same title and number of chapters. A better possibility would be to give the books different titles, for example "text book 1", "text book 2","text book 3" and so one (the number of chapters can still be the same for each book). This is fairly simple to do as you can keep track of the number of each book as you go through the loop statement. Methods: The class has the following methods in addition to the constructor: a method with signature public LibraryCard issueCard() that when invoked issues (i.e. returns) a new LibraryCard object. The method should increment the count of the number of library borrowers by 1. Note: to issue a new LibraryCard it is necessary to provide two int parameter values (see description of LibraryCard constructor, above). The limit on borrowing can be fixed with a small int value, such as 5. However, the card identity number should be unique to each card, so you need to find a way of setting the actual parameter value to a different int value each time a new card is constructed. (Hint: think about numbering the cards sequentially, according to the number of borrowers. So, the first card issued might be given the reference "cardID 0", the next card "cardID 1", and so on.) • A method with signature public TextBook borrowBook(LibraryCard card), which allows a book to be borrowed from the library if a valid (i.e. non-expired) LibraryCard is presented. If there are still books left to be borrowed in the library and the card object has not expired, then the method should return the next TextBook object from the bookShelf array (and otherwise, it should return the null object). The method should also 'remove' the TextBook object from the bookShelf (by setting the array location to null) and increment the field that indicates the location of the next book that may be borrowed. Finally, the method should ensure that the library card is 'swiped' to record that a book has been borrowed. (Note: you may also wish to ensure that your method behaves sensibly if passed a null LibraryCard object.) • a method with signature public void returnBook(TextBook book) that allows a book to be handed back to the library. The method will need to put the book back in the bookShelf array. Note: it is important that it should do this in such a way that there are no 'gaps' on the shelf, and you may find that the pointer to the next book to be borrowed is again useful here. Once the TextBook has been put back in the array, the method will also need to change the 'next book' pointer appropriately. • a method with signature public void describe() that, as usual, is responsible for printing out a description of the object. In this case, an example of the sort of message that should be printed out is: "The library has 15 books left on the shelf and has issued 7 library cards". Testing Having written the classes make sure that they work properly. Get one or more instances of the classes onto the BlueJ workbench and check that they behave the way that they should. For example, what happens if you try to borrow a book with an invalid card, or when there are no books left on the book shelf? Make sure that you can only borrow as many books from the library as were put on the book shelf in the first place, and that library card expires once it has been swiped up to its limit. Use BlueJ's inspect facility to check that text books borrowed from the library really are removed from the bookShelf array, and so on. Layout and Code Style It is important to make sure that you lay out your code properly. In particular make sure that everything is indented properly, and that opening and closing braces are lined up. Also make sure you use meaningful variable names and follow the Java naming conventions (i.e. follow capitalisation conventions). Note that no comments are required at this stage (we will be looking at commenting later). Marking Scheme 50 marks awarded in all. class TextBook: (12 marks overall) Fields: 2 marks for correct work. Constructor: 2 marks for correct work. Methods: 8 marks in all for correct work. Methods getTitle() and closeBook() are worth 1 mark each. Method isFinished(), describe() and readChapter() carry 2 marks each. All marks lost for a method if it is completely incorrect, incoherent or missing. Lose 1 mark is isFinished() does the right thing but redundantly. Similarly, lose 1 mark for describe() if it uses more than a single print statement. For reachChapter(), the conditional expression should not allow a chapter to be read if the book is finished. class LibraryCard: (worth 15 marks overall) Fields: 2 marks for correct work. Constructor: 3 marks for correct work. Methods: 10 marks for work as per the spec. Methods describe() and getCardRef() are worth 2 marks each; methods swipe() and expired() are worth 3 marks each; Marks lost for use of incorrect return types, or over-use of conditional statements in method expired() etc. class Library: (worth 23 marks overall) Fields: 2 marks for correct work. Marks lost for missing out a field or failing to make it private or of the correct type. Constructor: 4 marks for correct work. Marks lost for failing to initialise fields appropriately. Note that a loop is needed to initialise the bookShelf[] array. Marls lost for getting the bounds on the loop wrong or failing to build a new TextBook object to assign to each location. One mark lost for failing to give each book a unique title (same number of chapters is fine). Methods: 17 marks for correct work. Methods returnBook() and describe() earn 3 marks each; method issueCard() is worth 4 marks, and method borrowBook(LibraryCard card) is worth 7. Marks lost for a method if it is completely incorrect or missing. Marks also lost for failing to implement a method as described in the brief (e.g check that borrowers field is incremented when a card is issued, and that the LibraryCard gets a unique card reference number. Marks lost if the the returnBook(TextBook book) method doesn't put books back in the way specified in the brief. Layout & Commenting: Code should be laid out clearly and systematically. Indentation should be used, and a consistent and sensible bracketing convention adopted throughout. Marks are lost for weird, unsystematic, inconsistent or obscure layout. Comments are not expected.
在中国程序员是青春饭吗?
今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...
《MySQL 性能优化》之理解 MySQL 体系结构
本文介绍 MySQL 的体系结构,包括物理结构、逻辑结构以及插件式存储引擎。
程序员请照顾好自己,周末病魔差点一套带走我。
程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。
复习一周,京东+百度一面,不小心都拿了Offer
京东和百度一面都问了啥,面试官百般刁难,可惜我全会。
Java 14 都快来了,为什么还有这么多人固守Java 8?
从Java 9开始,Java版本的发布就让人眼花缭乱了。每隔6个月,都会冒出一个新版本出来,Java 10 , Java 11, Java 12, Java 13, 到2020年3月份,...
达摩院十大科技趋势发布:2020 非同小可!
【CSDN编者按】1月2日,阿里巴巴发布《达摩院2020十大科技趋势》,十大科技趋势分别是:人工智能从感知智能向认知智能演进;计算存储一体化突破AI算力瓶颈;工业互联网的超融合;机器间大规模协作成为可能;模块化降低芯片设计门槛;规模化生产级区块链应用将走入大众;量子计算进入攻坚期;新材料推动半导体器件革新;保护数据隐私的AI技术将加速落地;云成为IT技术创新的中心 。 新的画卷,正在徐徐展开。...
轻松搭建基于 SpringBoot + Vue 的 Web 商城应用
首先介绍下在本文出现的几个比较重要的概念: 函数计算(Function Compute): 函数计算是一个事件驱动的服务,通过函数计算,用户无需管理服务器等运行情况,只需编写代码并上传。函数计算准备计算资源,并以弹性伸缩的方式运行用户代码,而用户只需根据实际代码运行所消耗的资源进行付费。Fun: Fun 是一个用于支持 Serverless 应用部署的工具,能帮助您便捷地管理函数计算、API ...
讲真,这两个IDE插件,可以让你写出质量杠杠的代码
周末躺在床上看《拯救大兵瑞恩》 周末在闲逛的时候,发现了两个优秀的 IDE 插件,据说可以提高代码的质量,我就安装了一下,试了试以后发现,确实很不错,就推荐给大家。 01、Alibaba Java 代码规范插件 《阿里巴巴 Java 开发手册》,相信大家都不会感到陌生,其 IDEA 插件的下载次数据说达到了 80 万次,我今天又贡献了一次。嘿嘿。 该项目的插件地址: https://github....
Python+OpenCV实时图像处理
目录 1、导入库文件 2、设计GUI 3、调用摄像头 4、实时图像处理 4.1、阈值二值化 4.2、边缘检测 4.3、轮廓检测 4.4、高斯滤波 4.5、色彩转换 4.6、调节对比度 5、退出系统 初学OpenCV图像处理的小伙伴肯定对什么高斯函数、滤波处理、阈值二值化等特性非常头疼,这里给各位分享一个小项目,可通过摄像头实时动态查看各类图像处理的特点,也可对各位调参、测试...
2020年一线城市程序员工资大调查
人才需求 一线城市共发布岗位38115个,招聘120827人。 其中 beijing 22805 guangzhou 25081 shanghai 39614 shenzhen 33327 工资分布 2020年中国一线城市程序员的平均工资为16285元,工资中位数为14583元,其中95%的人的工资位于5000到20000元之间。 和往年数据比较: yea...
为什么猝死的都是程序员,基本上不见产品经理猝死呢?
相信大家时不时听到程序员猝死的消息,但是基本上听不到产品经理猝死的消息,这是为什么呢? 我们先百度搜一下:程序员猝死,出现将近700多万条搜索结果: 搜索一下:产品经理猝死,只有400万条的搜索结果,从搜索结果数量上来看,程序员猝死的搜索结果就比产品经理猝死的搜索结果高了一倍,而且从下图可以看到,首页里面的五条搜索结果,其实只有两条才是符合条件。 所以程序员猝死的概率真的比产品经理大,并不是错...
害怕面试被问HashMap?这一篇就搞定了!
声明:本文以jdk1.8为主! 搞定HashMap 作为一个Java从业者,面试的时候肯定会被问到过HashMap,因为对于HashMap来说,可以说是Java集合中的精髓了,如果你觉得自己对它掌握的还不够好,我想今天这篇文章会非常适合你,至少,看了今天这篇文章,以后不怕面试被问HashMap了 其实在我学习HashMap的过程中,我个人觉得HashMap还是挺复杂的,如果真的想把它搞得明明白...
毕业5年,我问遍了身边的大佬,总结了他们的学习方法
我问了身边10个大佬,总结了他们的学习方法,原来成功都是有迹可循的。
python爬取百部电影数据,我分析出了一个残酷的真相
2019年就这么匆匆过去了,就在前几天国家电影局发布了2019年中国电影市场数据,数据显示去年总票房为642.66亿元,同比增长5.4%;国产电影总票房411.75亿元,同比增长8.65%,市场占比 64.07%;城市院线观影人次17.27亿,同比增长0.64%。 看上去似乎是一片大好对不对?不过作为一名严谨求实的数据分析师,我从官方数据中看出了一点端倪:国产票房增幅都已经高达8.65%了,为什...
推荐10个堪称神器的学习网站
每天都会收到很多读者的私信,问我:“二哥,有什么推荐的学习网站吗?最近很浮躁,手头的一些网站都看烦了,想看看二哥这里有什么新鲜货。” 今天一早做了个恶梦,梦到被老板辞退了。虽然说在我们公司,只有我辞退老板的份,没有老板辞退我这一说,但是还是被吓得 4 点多都起来了。(主要是因为我掌握着公司所有的核心源码,哈哈哈) 既然 4 点多起来,就得好好利用起来。于是我就挑选了 10 个堪称神器的学习网站,推...
这些软件太强了,Windows必装!尤其程序员!
Windows可谓是大多数人的生产力工具,集娱乐办公于一体,虽然在程序员这个群体中都说苹果是信仰,但是大部分不都是从Windows过来的,而且现在依然有很多的程序员用Windows。 所以,今天我就把我私藏的Windows必装的软件分享给大家,如果有一个你没有用过甚至没有听过,那你就赚了????,这可都是提升你幸福感的高效率生产力工具哦! 走起!???? NO、1 ScreenToGif 屏幕,摄像头和白板...
阿里面试,面试官没想到一个ArrayList,我都能跟他扯半小时
我是真的没想到,面试官会这样问我ArrayList。
曾经优秀的人,怎么就突然不优秀了。
职场上有很多辛酸事,很多合伙人出局的故事,很多技术骨干被裁员的故事。说来模板都类似,曾经是名校毕业,曾经是优秀员工,曾经被领导表扬,曾经业绩突出,然而突然有一天,因为种种原因,被裁员了,...
大学四年因为知道了这32个网站,我成了别人眼中的大神!
依稀记得,毕业那天,我们导员发给我毕业证的时候对我说“你可是咱们系的风云人物啊”,哎呀,别提当时多开心啦????,嗯,我们导员是所有导员中最帅的一个,真的???? 不过,导员说的是实话,很多人都叫我大神的,为啥,因为我知道这32个网站啊,你说强不强????,这次是绝对的干货,看好啦,走起来! PS:每个网站都是学计算机混互联网必须知道的,真的牛杯,我就不过多介绍了,大家自行探索,觉得没用的,尽管留言吐槽吧???? 社...
良心推荐,我珍藏的一些Chrome插件
上次搬家的时候,发了一个朋友圈,附带的照片中不小心暴露了自己的 Chrome 浏览器插件之多,于是就有小伙伴评论说分享一下我觉得还不错的浏览器插件。 我下面就把我日常工作和学习中经常用到的一些 Chrome 浏览器插件分享给大家,随便一个都能提高你的“生活品质”和工作效率。 Markdown Here Markdown Here 可以让你更愉快的写邮件,由于支持 Markdown 直接转电子邮...
看完这篇HTTP,跟面试官扯皮就没问题了
我是一名程序员,我的主要编程语言是 Java,我更是一名 Web 开发人员,所以我必须要了解 HTTP,所以本篇文章就来带你从 HTTP 入门到进阶,看完让你有一种恍然大悟、醍醐灌顶的感觉。 最初在有网络之前,我们的电脑都是单机的,单机系统是孤立的,我还记得 05 年前那会儿家里有个电脑,想打电脑游戏还得两个人在一个电脑上玩儿,及其不方便。我就想为什么家里人不让上网,我的同学 xxx 家里有网,每...
2020 年,大火的 Python 和 JavaScript 是否会被取而代之?
Python 和 JavaScript 是目前最火的两大编程语言,但是2020 年,什么编程语言将会取而代之呢? 作者 |Richard Kenneth Eng 译者 |明明如月,责编 | 郭芮 出品 | CSDN(ID:CSDNnews) 以下为译文: Python 和 JavaScript 是目前最火的两大编程语言。然而,他们不可能永远屹立不倒。最终,必将像其他编程语言一...
史上最全的IDEA快捷键总结
现在Idea成了主流开发工具,这篇博客对其使用的快捷键做了总结,希望对大家的开发工作有所帮助。
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
这种新手都不会范的错,居然被一个工作好几年的小伙子写出来,差点被当场开除了。
谁是华为扫地僧?
是的,华为也有扫地僧!2020年2月11-12日,“养在深闺人不知”的华为2012实验室扫地僧们,将在华为开发者大会2020(Cloud)上,和大家见面。到时,你可以和扫地僧们,吃一个洋...
Idea 中最常用的10款插件(提高开发效率),一定要学会使用!
学习使用一些插件,可以提高开发效率。对于我们开发人员很有帮助。这篇博客介绍了开发中使用的插件。
AI 没让人类失业,搞 AI 的人先失业了
最近和几个 AI 领域的大佬闲聊 根据他们讲的消息和段子 改编出下面这个故事 如有雷同 都是巧合 1. 老王创业失败,被限制高消费 “这里写我跑路的消息实在太夸张了。” 王葱葱哼笑一下,把消息分享给群里。 阿杰也看了消息,笑了笑。在座几位也都笑了。 王葱葱是个有名的人物,21岁那年以全额奖学金进入 KMU 攻读人工智能博士,累计发表论文 40 余篇,个人技术博客更是成为深度学习领域内风向标。 ...
2020年,冯唐49岁:我给20、30岁IT职场年轻人的建议
点击“技术领导力”关注∆每天早上8:30推送 作者|Mr.K 编辑| Emma 来源|技术领导力(ID:jishulingdaoli) 前天的推文《冯唐:职场人35岁以后,方法论比经验重要》,收到了不少读者的反馈,觉得挺受启发。其实,冯唐写了不少关于职场方面的文章,都挺不错的。可惜大家只记住了“春风十里不如你”、“如何避免成为油腻腻的中年人”等不那么正经的文章。 本文整理了冯...
作为一名大学生,如何在B站上快乐的学习?
B站是个宝,谁用谁知道???? 作为一名大学生,你必须掌握的一项能力就是自学能力,很多看起来很牛X的人,你可以了解下,人家私底下一定是花大量的时间自学的,你可能会说,我也想学习啊,可是嘞,该学习啥嘞,不怕告诉你,互联网时代,最不缺的就是学习资源,最宝贵的是啥? 你可能会说是时间,不,不是时间,而是你的注意力,懂了吧! 那么,你说学习资源多,我咋不知道,那今天我就告诉你一个你必须知道的学习的地方,人称...
那些年,我们信了课本里的那些鬼话
教材永远都是有错误的,从小学到大学,我们不断的学习了很多错误知识。 斑羚飞渡 在我们学习的很多小学课文里,有很多是错误文章,或者说是假课文。像《斑羚飞渡》: 随着镰刀头羊的那声吼叫,整个斑羚群迅速分成两拨,老年斑羚为一拨,年轻斑羚为一拨。 就在这时,我看见,从那拨老斑羚里走出一只公斑羚来。公斑羚朝那拨年轻斑羚示意性地咩了一声,一只半大的斑羚应声走了出来。一老一少走到伤心崖,后退了几步,突...
一个程序在计算机中是如何运行的?超级干货!!!
强烈声明:本文很干,请自备茶水!???? 开门见山,咱不说废话! 你有没有想过,你写的程序,是如何在计算机中运行的吗?比如我们搞Java的,肯定写过这段代码 public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } ...
【蘑菇街技术部年会】程序员与女神共舞,鼻血再次没止住。(文末内推)
蘑菇街技术部的年会,别开生面,一样全是美女。
那个在阿里养猪的工程师,5年了……
简介: 在阿里,走过1825天,没有趴下,依旧斗志满满,被称为“五年陈”。他们会被授予一枚戒指,过程就叫做“授戒仪式”。今天,咱们听听阿里的那些“五年陈”们的故事。 下一个五年,猪圈见! 我就是那个在养猪场里敲代码的工程师,一年多前我和20位工程师去了四川的猪场,出发前总架构师慷慨激昂的说:同学们,中国的养猪产业将因为我们而改变。但到了猪场,发现根本不是那么回事:要个WIFI,没有;...
为什么程序猿都不愿意去外包?
分享外包的组织架构,盈利模式,亲身经历,以及根据一些外包朋友的反馈,写了这篇文章 ,希望对正在找工作的老铁有所帮助
Java校招入职华为,半年后我跑路了
何来 我,一个双非本科弟弟,有幸在 19 届的秋招中得到前东家华为(以下简称 hw)的赏识,当时秋招签订就业协议,说是入了某 java bg,之后一系列组织架构调整原因等等让人无法理解的神操作,最终毕业前夕,被通知调往其他 bg 做嵌入式开发(纯 C 语言)。 由于已至于校招末尾,之前拿到的其他 offer 又无法再收回,一时感到无力回天,只得默默接受。 毕业后,直接入职开始了嵌入式苦旅,由于从未...
世界上有哪些代码量很少,但很牛逼很经典的算法或项目案例?
点击上方蓝字设为星标下面开始今天的学习~今天分享四个代码量很少,但很牛逼很经典的算法或项目案例。1、no code 项目地址:https://github.com/kelseyhight...
​两年前不知如何编写代码的我,现在是一名人工智能工程师
全文共3526字,预计学习时长11分钟 图源:Unsplash 经常有小伙伴私信给小芯,我没有编程基础,不会写代码,如何进入AI行业呢?还能赶上AI浪潮吗? 任何时候努力都不算晚。 下面,小芯就给大家讲一个朋友的真实故事,希望能给那些处于迷茫与徘徊中的小伙伴们一丝启发。(下文以第一人称叙述) 图源:Unsplash 正如Elsa所说,职业转换是...
强烈推荐10本程序员必读的书
很遗憾,这个春节注定是刻骨铭心的,新型冠状病毒让每个人的神经都是紧绷的。那些处在武汉的白衣天使们,尤其值得我们的尊敬。而我们这些窝在家里的程序员,能不外出就不外出,就是对社会做出的最大的贡献。 有些读者私下问我,窝了几天,有点颓丧,能否推荐几本书在家里看看。我花了一天的时间,挑选了 10 本我最喜欢的书,你可以挑选感兴趣的来读一读。读书不仅可以平复恐惧的压力,还可以对未来充满希望,毕竟苦难终将会...
作为一个程序员,内存的这些硬核知识你必须懂!
我们之前讲过CPU,也说了CPU和内存的那点事儿,今天咱就再来说说有关内存,作为一个程序员,你必须要懂的哪那些硬核知识! 大白话聊一聊,很重要! 先来大白话的跟大家聊一聊,我们这里说的内存啊,其实就是说的我们电脑里面的内存条,所以嘞,内存就是内存条,数据要放在这上面才能被cpu读取从而做运算,还有硬盘,就是电脑中的C盘啥的,一个程序需要运行的话需要向内存申请一块独立的内存空间,这个程序本身是存放在...
非典逼出了淘宝和京东,新冠病毒能够逼出什么?
loonggg读完需要5分钟速读仅需 2 分钟大家好,我是你们的校长。我知道大家在家里都憋坏了,大家可能相对于封闭在家里“坐月子”,更希望能够早日上班。今天我带着大家换个思路来聊一个问题...
牛逼!一行代码居然能解决这么多曾经困扰我半天的算法题
春节假期这么长,干啥最好?当然是折腾一些算法题了,下面给大家讲几道一行代码就能解决的算法题,当然,我相信这些算法题你都做过,不过就算做过,也是可以看一看滴,毕竟,你当初大概率不是一行代码解决的。 学会了一行代码解决,以后遇到面试官问起的话,就可以装逼了。 一、2 的幂次方 问题描述:判断一个整数 n 是否为 2 的幂次方 对于这道题,常规操作是不断这把这个数除以 2,然后判断是否有余数,直到 ...
用前端5分钟写一个在线m3u8在线播放器
&lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="UTF-8"&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt; &lt;meta http-equiv="X...
Spring框架|JdbcTemplate介绍
文章目录一、JdbcTemplate 概述二、创建对象的源码分析三、JdbcTemplate操作数据库 一、JdbcTemplate 概述 在之前的web学习中,学习了手动封装JDBCtemplate,其好处是通过(sql语句+参数)模板化了编程。而真正的JDBCtemplete类,是Spring框架为我们写好的。 它是 Spring 框架中提供的一个对象,是对原始 Jdbc API 对象的简单...
立即提问