非常久没写东西了。今天来总结下有关android调查问卷的需求实现。

转载请加地址:http://blog.csdn.net/jing110fei/article/details/46618229

先上效果图

个人分析,最好是用动态布局载入来实现,好了。说思路。将这总体分为3块

最外面这个布局里面。依据第二层问题的数量来动态生成布局,增加在第一层布局里面,

然后再依据问题下答案的数量来动态生成布局。增加第二层布局里面,思路这么透彻,想想还有些小激动呢。

先建造三个实体类

  1. public class Page {
  2. //问卷id
  3. private String pageId;
  4. //问卷状态
  5. private String status;
  6. //问卷主题
  7. private String title;
  8. //题目
  9. private ArrayList<Quesition> quesitions;
  10.  
  11. public ArrayList<Quesition> getQuesitions() {
  12. return quesitions;
  13. }
  14. public void setQuesitions(ArrayList<Quesition> quesitions) {
  15. this.quesitions = quesitions;
  16. }
  17.  
  18. public String getPageId() {
  19. return pageId;
  20. }
  21. public void setPageId(String pageId) {
  22. this.pageId = pageId;
  23. }
  24. public String getStatus() {
  25. return status;
  26. }
  27. public void setStatus(String status) {
  28. this.status = status;
  29. }
  30. public String getTitle() {
  31. return title;
  32. }
  33. public void setTitle(String title) {
  34. this.title = title;
  35. }
  36.  
  37. }
  1. public class Quesition {
  2. //题目id
  3. private String quesitionId;
  4. //单选多选标识
  5. private String type;
  6. //题目
  7. private String content;
  8. //选项
  9. private ArrayList<Answer> answers;
  10. //是否解答
  11. private int que_state;
  12.  
  13. public int getQue_state() {
  14. return que_state;
  15. }
  16. public void setQue_state(int que_state) {
  17. this.que_state = que_state;
  18. }
  19.  
  20. public String getQuesitionId() {
  21. return quesitionId;
  22. }
  23. public void setQuesitionId(String quesitionId) {
  24. this.quesitionId = quesitionId;
  25. }
  26. public String getType() {
  27. return type;
  28. }
  29. public void setType(String type) {
  30. this.type = type;
  31. }
  32. public String getContent() {
  33. return content;
  34. }
  35. public void setContent(String content) {
  36. this.content = content;
  37. }
  38. public ArrayList<Answer> getAnswers() {
  39. return answers;
  40. }
  41. public void setAnswers(ArrayList<Answer> answers) {
  42. this.answers = answers;
  43. }
  44.  
  45. }
  1. public class Answer {
  2. //答案id
  3. private String answerId;
  4. //答案主体
  5. private String answer_content;
  6. //答案是否被解答
  7. private int ans_state;
  8.  
  9. public int getAns_state() {
  10. return ans_state;
  11. }
  12. public void setAns_state(int ans_state) {
  13. this.ans_state = ans_state;
  14. }
  15. public String getAnswerId() {
  16. return answerId;
  17. }
  18. public void setAnswerId(String answerId) {
  19. this.answerId = answerId;
  20. }
  21. public String getAnswer_content() {
  22. return answer_content;
  23. }
  24. public void setAnswer_content(String answer_content) {
  25. this.answer_content = answer_content;
  26. }
  27.  
  28. }

建造这三个实体类的目的是为了在做demo的时候直接通过假数据来尽可能的贴近项目。使demo完毕后能尽快的移植进项目。

以下来看看布局,总工用到了3个布局。

首先是activity_main.xml

  1. <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
  2. xmlns:tools="http://schemas.android.com/tools"
  3. android:layout_width="match_parent"
  4. android:layout_height="match_parent"
  5. android:background="#e6e4e3" >
  6.  
  7. <LinearLayout
  8. android:layout_width="match_parent"
  9. android:layout_height="match_parent"
  10. android:orientation="vertical"
  11.  
  12. >
  13.  
  14. <LinearLayout
  15. android:layout_width="match_parent"
  16. android:layout_height="wrap_content"
  17. android:background="#EA5514"
  18. android:orientation="horizontal" >
  19. <ImageView
  20. android:id="@+id/test_back"
  21. android:layout_width="wrap_content"
  22. android:layout_height="wrap_content"
  23. android:layout_gravity="left|center_vertical"
  24. android:layout_marginLeft="5dp"
  25. android:padding="5dp"
  26. android:background="@drawable/ic_back_white"
  27.  
  28. />
  29. <TextView
  30. android:layout_width="0dp"
  31. android:layout_height="wrap_content"
  32. android:layout_weight="1"
  33. android:text="调查问卷"
  34. android:textSize="18sp"
  35. android:textColor="@android:color/white"
  36. android:layout_gravity="center"
  37. android:gravity="center"/>
  38. </LinearLayout>
  39. <TextView
  40. android:id="@+id/txt_title"
  41. android:layout_width="match_parent"
  42. android:layout_height="wrap_content"
  43. android:textSize="10sp"
  44. android:layout_marginTop="40dp"
  45. android:layout_marginLeft="30dp"
  46. android:textColor="#898989"
  47. />
  48. <LinearLayout
  49. android:id="@+id/lly_test"
  50. android:layout_width="match_parent"
  51. android:layout_height="wrap_content"
  52. android:orientation="vertical">
  53.  
  54. </LinearLayout>
  55. <LinearLayout
  56. android:layout_width="match_parent"
  57. android:layout_height="wrap_content"
  58. android:orientation="vertical"
  59. >
  60. <Button
  61. android:id="@+id/submit"
  62. android:layout_width="wrap_content"
  63. android:layout_height="wrap_content"
  64. android:layout_marginTop="50dp"
  65. android:layout_marginBottom="30dp"
  66. android:text="提交"
  67. android:textSize="20sp"
  68. android:textColor="@android:color/white"
  69. android:layout_gravity="center"
  70. android:gravity="center"
  71. android:background="@drawable/button_submit"/>
  72. </LinearLayout>
  73. </LinearLayout>
  74.  
  75. </ScrollView>

id为lly_test的布局就是终于要增加的目的布局

然后是quesition_layout.xml

  1. <?xml version="1.0" encoding="utf-8"?
  2.  
  3. >
  4. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  5. android:layout_width="match_parent"
  6. android:layout_height="wrap_content"
  7. android:orientation="vertical"
  8. android:paddingTop="35dp"
  9.  
  10. >
  11. <TextView
  12. android:id="@+id/txt_question_item"
  13. android:layout_width="match_parent"
  14. android:layout_height="wrap_content"
  15. android:textSize="14sp"
  16. android:textColor="#3e3a39"
  17. android:layout_marginLeft="45dp"
  18. />
  19. <LinearLayout
  20. android:id="@+id/lly_answer"
  21. android:layout_width="match_parent"
  22. android:layout_height="wrap_content"
  23. android:orientation="vertical"
  24. android:layout_marginLeft="30dp"
  25. android:layout_marginRight="30dp"
  26. android:layout_marginTop="10dp"
  27.  
  28. android:background="@drawable/shape_dialog_radius_all"
  29. >
  30.  
  31. </LinearLayout>
  32.  
  33. </LinearLayout>

//然后是answer_layout.xml

  1. <?
  2.  
  3. xml version="1.0" encoding="utf-8"?>
  4. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  5. android:layout_width="match_parent"
  6. android:layout_height="30dp"
  7. android:orientation="vertical"
  8. >
  9. <LinearLayout
  10. android:id="@+id/lly_answer_size"
  11. android:layout_width="match_parent"
  12. android:layout_height="match_parent"
  13. android:orientation="horizontal"
  14. >
  15. <ImageView
  16. android:id="@+id/image"
  17. android:layout_width="wrap_content"
  18. android:layout_height="wrap_content"
  19. android:layout_margin="10dp"/>
  20. <TextView
  21. android:id="@+id/txt_answer_item"
  22. android:layout_width="match_parent"
  23. android:layout_height="wrap_content"
  24. android:textSize="12sp"
  25. android:textColor="#595757"
  26. android:layout_gravity="center_vertical"
  27. />
  28. </LinearLayout>
  29. <View
  30. android:id="@+id/vw_line"
  31. android:layout_width="match_parent"
  32. android:layout_height="1dp"
  33. android:background="#9EA0A0"
  34. >
  35.  
  36. </View>
  37. </LinearLayout>

然后是主要代码。长久不写博客,有点生疏了,大家顺着思路来看,凝视也差点儿相同详尽,假设有不明确的再讨论

  1. public class MainActivity extends Activity {
  2. private LinearLayout test_layout;
  3. private Page the_page;
  4. //答案列表
  5. private ArrayList<Answer> the_answer_list;
  6. //问题列表
  7. private ArrayList<Quesition> the_quesition_list;
  8. //问题所在的View
  9. private View que_view;
  10. //答案所在的View
  11. private View ans_view;
  12. private LayoutInflater xInflater;
  13. private Page page;
  14. //以下这两个list是为了实现点击的时候改变图片。由于单选多选时情况不一样。为了方便控制
  15. //存每一个问题下的imageview
  16. private ArrayList<ArrayList<ImageView>> imglist=new ArrayList<ArrayList<ImageView>>();
  17. //存每一个答案的imageview
  18. private ArrayList<ImageView> imglist2;
  19. @Override
  20. protected void onCreate(Bundle savedInstanceState) {
  21. super.onCreate(savedInstanceState);
  22. setContentView(R.layout.activity_main);
  23. xInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  24. //假数据
  25. initDate();
  26. //提交按钮
  27. Button button=(Button)findViewById(R.id.submit);
  28. button.setOnClickListener(new submitOnClickListener(page));
  29. }
  30. private void initDate() {
  31. //假数据
  32. // TODO Auto-generated method stub
  33. Answer a_one=new Answer();
  34. a_one.setAnswerId("0");
  35. a_one.setAnswer_content("男");
  36. a_one.setAns_state(0);
  37. Answer a_two=new Answer();
  38. a_two.setAnswerId("1");
  39. a_two.setAnswer_content("女");
  40. a_two.setAns_state(0);
  41.  
  42. Answer a_three=new Answer();
  43. a_three.setAnswerId("3");
  44. a_three.setAnswer_content("是");
  45. a_three.setAns_state(0);
  46. Answer a_four=new Answer();
  47. a_four.setAnswerId("4");
  48. a_four.setAnswer_content("不是");
  49. a_four.setAns_state(0);
  50.  
  51. Answer a_three1=new Answer();
  52. a_three1.setAnswerId("3");
  53. a_three1.setAnswer_content("是");
  54. a_three1.setAns_state(0);
  55. Answer a_four1=new Answer();
  56. a_four1.setAnswerId("4");
  57. a_four1.setAnswer_content("不是");
  58. a_four1.setAns_state(0);
  59.  
  60. ArrayList<Answer> answers_one=new ArrayList<Answer>();
  61. answers_one.add(a_one);
  62. answers_one.add(a_two);
  63.  
  64. ArrayList<Answer> answers_two=new ArrayList<Answer>();
  65. answers_two.add(a_one);
  66. answers_two.add(a_two);
  67. answers_two.add(a_three);
  68. answers_two.add(a_four);
  69.  
  70. ArrayList<Answer> answers_three=new ArrayList<Answer>();
  71. answers_three.add(a_one);
  72. answers_three.add(a_two);
  73. answers_three.add(a_three);
  74. answers_three.add(a_four);
  75. answers_three.add(a_three1);
  76. answers_three.add(a_four1);
  77.  
  78. Quesition q_one=new Quesition();
  79. q_one.setQuesitionId("00");
  80. q_one.setType("0");
  81. q_one.setContent("1、您的性别:");
  82. q_one.setAnswers(answers_one);
  83. q_one.setQue_state(0);
  84.  
  85. Quesition q_two=new Quesition();
  86. q_two.setQuesitionId("01");
  87. q_two.setType("1");
  88. q_two.setContent("2、您是党员吗?");
  89. q_two.setAnswers(answers_two);
  90. q_two.setQue_state(0);
  91.  
  92. Quesition q_three=new Quesition();
  93. q_three.setQuesitionId("03");
  94. q_three.setType("1");
  95. q_three.setContent("3、您是dsfsdfsd吗?");
  96. q_three.setAnswers(answers_three);
  97. q_three.setQue_state(0);
  98.  
  99. ArrayList<Quesition> quesitions=new ArrayList<Quesition>();
  100. quesitions.add(q_one);
  101. quesitions.add(q_two);
  102. quesitions.add(q_three);
  103.  
  104. page=new Page();
  105. page.setPageId("000");
  106. page.setStatus("0");
  107. page.setTitle("第一次调查问卷");
  108. page.setQuesitions(quesitions);
  109. //载入布局
  110. initView(page);
  111. }
  112. private void initView(Page page) {
  113. // TODO Auto-generated method stub
  114. //这是要把问题的动态布局增加的布局
  115. test_layout=(LinearLayout)findViewById(R.id.lly_test);
  116. TextView page_txt=(TextView)findViewById(R.id.txt_title);
  117. page_txt.setText(page.getTitle());
  118. //获得问题即第二层的数据
  119. the_quesition_list=page.getQuesitions();
  120. //依据第二层问题的多少,来动态载入布局
  121. for(int i=0;i<the_quesition_list.size();i++){
  122. que_view=xInflater.inflate(R.layout.quesition_layout, null);
  123. TextView txt_que=(TextView)que_view.findViewById(R.id.txt_question_item);
  124. //这是第三层布局要增加的地方
  125. LinearLayout add_layout=(LinearLayout)que_view.findViewById(R.id.lly_answer);
  126. //推断单选-多选来实现后面是*号还是*多选,
  127. if(the_quesition_list.get(i).getType().equals("1")){
  128. set(txt_que,the_quesition_list.get(i).getContent(),1);
  129. }else{
  130. set(txt_que,the_quesition_list.get(i).getContent(),0);
  131. }
  132. //获得答案即第三层数据
  133. the_answer_list=the_quesition_list.get(i).getAnswers();
  134. imglist2=new ArrayList<ImageView>();
  135. for(int j=0;j<the_answer_list.size();j++){
  136. ans_view=xInflater.inflate(R.layout.answer_layout, null);
  137. TextView txt_ans=(TextView)ans_view.findViewById(R.id.txt_answer_item);
  138. ImageView image=(ImageView)ans_view.findViewById(R.id.image);
  139. View line_view=ans_view.findViewById(R.id.vw_line);
  140. if(j==the_answer_list.size()-1){
  141. //最后一条答案以下不要线是指布局的问题
  142. line_view.setVisibility(View.GONE);
  143. }
  144. //推断单选多选载入不同选项图片
  145. if(the_quesition_list.get(i).getType().equals("1")){
  146. image.setBackgroundDrawable(getResources().getDrawable(R.drawable.multiselect_false));
  147. }else{
  148. image.setBackgroundDrawable(getResources().getDrawable(R.drawable.radio_false));
  149. }
  150. Log.e("---", "------"+image);
  151. imglist2.add(image);
  152. txt_ans.setText(the_answer_list.get(j).getAnswer_content());
  153. LinearLayout lly_answer_size=(LinearLayout)ans_view.findViewById(R.id.lly_answer_size);
  154. lly_answer_size.setOnClickListener(new answerItemOnClickListener(i,j,the_answer_list,txt_ans));
  155. add_layout.addView(ans_view);
  156. }
  157. /*for(int r=0; r<imglist2.size();r++){
  158. Log.e("---", "imglist2--------"+imglist2.get(r));
  159. }*/
  160.  
  161. imglist.add(imglist2);
  162.  
  163. test_layout.addView(que_view);
  164. }
  165. /*for(int q=0;q<imglist.size();q++){
  166. for(int w=0;w<imglist.get(q).size();w++){
  167. Log.e("---", "共同拥有------"+imglist.get(q).get(w));
  168. }
  169. }*/
  170.  
  171. }
  172. private void set(TextView tv_test, String content,int type) {
  173. //为了载入问题后面的* 和*多选
  174. // TODO Auto-generated method stub
  175. String w;
  176. if(type==1){
  177. w = content+"*[多选题]";
  178. }else{
  179. w = content+"*";
  180. }
  181.  
  182. int start = content.length();
  183. int end = w.length();
  184. Spannable word = new SpannableString(w);
  185. word.setSpan(new AbsoluteSizeSpan(25), start, end,
  186. Spannable.SPAN_INCLUSIVE_INCLUSIVE);
  187. word.setSpan(new StyleSpan(Typeface.BOLD), start, end,
  188. Spannable.SPAN_INCLUSIVE_INCLUSIVE);
  189. word.setSpan(new ForegroundColorSpan(Color.RED), start, end,
  190. Spannable.SPAN_INCLUSIVE_INCLUSIVE);
  191. tv_test.setText(word);
  192. }
  193. class answerItemOnClickListener implements OnClickListener{
  194. private int i;
  195. private int j;
  196. private TextView txt;
  197. private ArrayList<Answer> the_answer_lists;
  198. public answerItemOnClickListener(int i,int j, ArrayList<Answer> the_answer_list,TextView text){
  199. this.i=i;
  200. this.j=j;
  201. this.the_answer_lists=the_answer_list;
  202. this.txt=text;
  203.  
  204. }
  205. //实现点击选项后改变选中状态以及相应图片
  206. @Override
  207. public void onClick(View arg0) {
  208. // TODO Auto-generated method stub
  209. //推断当前问题是单选还是多选
  210. /*Log.e("------", "选择了-----第"+i+"题");
  211. for(int q=0;q<imglist.size();q++){
  212. for(int w=0;w<imglist.get(q).size();w++){
  213. // Log.e("---", "共同拥有------"+imglist.get(q).get(w));
  214. }
  215. }
  216. Log.e("----", "点击了---"+imglist.get(i).get(j));*/
  217.  
  218. if(the_quesition_list.get(i).getType().equals("1")){
  219. //多选
  220. if(the_answer_lists.get(j).getAns_state()==0){
  221. //假设未被选中
  222. txt.setTextColor(Color.parseColor("#EA5514"));
  223. imglist.get(i).get(j).setBackgroundDrawable(getResources().getDrawable(R.drawable.multiselect_true));
  224. the_answer_lists.get(j).setAns_state(1);
  225. the_quesition_list.get(i).setQue_state(1);
  226. }else{
  227. txt.setTextColor(Color.parseColor("#595757"));
  228. imglist.get(i).get(j).setBackgroundDrawable(getResources().getDrawable(R.drawable.multiselect_false));
  229. the_answer_lists.get(j).setAns_state(0);
  230. the_quesition_list.get(i).setQue_state(1);
  231. }
  232. }else{
  233. //单选
  234.  
  235. for(int z=0;z<the_answer_lists.size();z++){
  236. the_answer_lists.get(z).setAns_state(0);
  237. imglist.get(i).get(z).setBackgroundDrawable(getResources().getDrawable(R.drawable.radio_false));
  238. }
  239. if(the_answer_lists.get(j).getAns_state()==0){
  240. //假设当前未被选中
  241. imglist.get(i).get(j).setBackgroundDrawable(getResources().getDrawable(R.drawable.radio_true));
  242. the_answer_lists.get(j).setAns_state(1);
  243. the_quesition_list.get(i).setQue_state(1);
  244. }else{
  245. //假设当前已被选中
  246. the_answer_lists.get(j).setAns_state(1);
  247. the_quesition_list.get(i).setQue_state(1);
  248. }
  249.  
  250. }
  251. //推断当前选项是否选中
  252.  
  253. }
  254.  
  255. }
  256. class submitOnClickListener implements OnClickListener{
  257. private Page page;
  258. public submitOnClickListener(Page page){
  259. this.page=page;
  260. }
  261. @Override
  262. public void onClick(View arg0) {
  263. // TODO Auto-generated method stub
  264. //推断是否答完题
  265. boolean isState=true;
  266. //终于要的json数组
  267. JSONArray jsonArray = new JSONArray();
  268. //点击提交的时候,先推断状态,假设有未答完的就提示。假设没有再把每条答案提交(包括问卷ID 问题ID 及答案ID)
  269. //注:不用管是否是一个问题的答案,就以答案的个数为准来提交上述格式的数据
  270. for(int i=0;i<the_quesition_list.size();i++){
  271. the_answer_list=the_quesition_list.get(i).getAnswers();
  272. //推断是否有题没答完
  273. if(the_quesition_list.get(i).getQue_state()==0){
  274. Toast.makeText(getApplicationContext(), "您第"+(i+1)+"题没有答完", Toast.LENGTH_LONG).show();
  275. jsonArray=null;
  276. isState=false;
  277. break;
  278. }else{
  279. for(int j=0;j<the_answer_list.size();j++){
  280. if(the_answer_list.get(j).getAns_state()==1){
  281. JSONObject json = new JSONObject();
  282. try {
  283. json.put("psychologicalId", page.getPageId());
  284. json.put("questionId", the_quesition_list.get(i).getQuesitionId());
  285. json.put("optionId", the_answer_list.get(j).getAnswerId());
  286. jsonArray.put(json);
  287. } catch (JSONException e) {
  288. // TODO Auto-generated catch block
  289. e.printStackTrace();
  290. }
  291. }
  292. }
  293. }
  294.  
  295. }
  296. if(isState){
  297. if(jsonArray.length()>0){
  298. Log.e("af", jsonArray.toString());
  299. for(int item=0;item<jsonArray.length();item++){
  300. JSONObject job;
  301. try {
  302. job = jsonArray.getJSONObject(item);
  303. Log.e("----", "pageId--------"+job.get("pageId"));
  304. Log.e("----", "quesitionId--------"+job.get("quesitionId"));
  305. Log.e("----", "answerId--------"+job.get("answerId"));
  306. } catch (JSONException e) {
  307. // TODO Auto-generated catch block
  308. e.printStackTrace();
  309. } // 遍历 jsonarray 数组。把每一个对象转成 json 对象
  310.  
  311. }
  312.  
  313. }
  314.  
  315. }
  316.  
  317. }
  318. }
  319.  
  320. }

人不能懒惰啊,以后要多多总结。欢迎大家讨论。

android 实现调查问卷-单选-多选的更多相关文章

  1. Android开发技巧——自定义单选或多选的ListView

    这篇其实应该是属于写自定义单选或多选的ListView的基础教程,无奈目前许多人对此的实现大多都绕了远路,反而使得这正规的写法倒显得有些技巧性了. 本文原创,转载请注明在CSDN上的出处: http: ...

  2. JavasScript实现调查问卷插件

    原文:JavasScript实现调查问卷插件 鄙人屌丝程序猿一枚,闲来无事,想尝试攻城师是感觉,于是乎搞了点小玩意.用js实现调查问卷,实现了常规的题型,单选,多选,排序,填空,矩阵等. 遂开源贴出来 ...

  3. SpinnerViewPop【PopWindow样式(单选)、Dialog样式(单选+多选)的下拉菜单】

    版权声明:本文为HaiyuKing原创文章,转载请注明出处! 前言 对下拉菜单的文本区域和列表区域进行了封装.包括两种展现方式:popwindow(单选).dialog(单选+多选) 因为该封装需要在 ...

  4. [SAP ABAP开发技术总结]选择屏幕——按钮、单选复选框

    声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...

  5. "琳琅满屋"调查问卷 心得体会及结果分析

    ·关于心得体会       当时小组提出这个校园二手交易市场的时候,就确定了对象范围,仅仅是面向在校大学生,而且在我们之前就已经有了很多成功的商品交易的例子可以让我们去借鉴,再加上我们或多或少的有过网 ...

  6. 关于“Durian”调查问卷的心得体会

    这周我们做了项目着手前的客户需求调查,主要以调查问卷的方式进行.其实做问卷调查并不是想象中的那么简单,首先要确定问卷调查的内容,每一个问题都要经过深思熟虑,字字斟酌,既要切合问卷主要目的,又要简洁扼要 ...

  7. 从Adobe调查问卷看原型设计工具大战

    近年国内外原型设计工具新品频出,除了拥趸众多的老牌Axure在RP 8之后没有什么大的动作,大家都拼了命地在出新品.今天 inVision 的 Craft 出了 2.0 的预告视频,明天 Adobe ...

  8. 微信小程序button选中改样式-实现单选/多选

    小程序实现多button单选/多选 红色为选中状态 单选 多选 ①wxss /* pages/button-select/button-select.wxss */ .button_container ...

  9. Scrum立会报告+燃尽图(十一月十七日总第二十五次):设计调查问卷;修复上一阶段bug

    此作业要求参见:https://edu.cnblogs.com/campus/nenu/2018fall/homework/2284 项目地址:https://git.coding.net/zhang ...

随机推荐

  1. ZOJ 2967 Colorful Rainbows

    暴力. 先删掉一些边,平行的线只保留$b$最大的.然后暴力,每次放入第$i$条边,和还没有被完全覆盖的边都算一遍,更新一下. #pragma comment(linker, "/STACK: ...

  2. Java 获取JVM内存和物理内存信息

    package com.sysinfo; public class MonitorInfo { /** jvm可使用内存. */ private long totalMemory; /** jvm剩余 ...

  3. 26、Flask实战第26天:cms用户模型定义

    编辑cms.models.py from exts import db from datetime import datetime class CMSUser(db.Model): __tablena ...

  4. 关于windows环境下cordova命令行无法启动adb.exe的解决办法

    使用phonegap开发手机APP,常常需要更改代码之后进行调试,使用安卓模拟器每次启动非常缓慢,而且不能保证最终在真机上的效果.所以一般都采用真机进行调试. 搭建真机的调试环境这里就不再赘述了,网上 ...

  5. 解决在jqmobi框架上使用mobiscroll控件的bug问题

    jqmobi(appframework)框架的好处主要是它很轻量级,用在手机上占用内存较小,实际表现较为流畅,这也是它区别于jQuery mobile的一大特色,上一篇博客中提供了在它上面使用日期控件 ...

  6. 写的模块和方法 wap 和 pc

    createjs 画了一个曲线功能 rem 的适配方式 $.fn.stop 方法, zepto 没有的, 对于 2d的旋转 变形 还有 移动都可以停下来, 做动画的属性存储, getComputedS ...

  7. BZOJ 3022 [Balkan2012]The Best Teams(扫描线+线段树)

    [题目链接] http://www.lydsy.com/JudgeOnline/problem.php?id=3022 [题目大意] 给定n个球员,第i个球员年龄为AGEi,水平为SKILLi. 没有 ...

  8. [转]JSP中常见的Tomcat报错错误解析(二)

    jsp常见错误代码文章分类:Java编程 jsp常见错误代码你用的是weblogic还是tomcat服务器.?出现404和500错误是初学jsp的朋友经常遇到的问题. IIS状态代码的含义 概要 当用 ...

  9. Manthan, Codefest 16 A. Ebony and Ivory 水题

    A. Ebony and Ivory 题目连接: http://www.codeforces.com/contest/633/problem/A Description Dante is engage ...

  10. JS对象和数组

    /* 数组和对象 [JavaScript 权威指南 第五版] */ /* 对象: 是一个无序属性集合, 每个属性都有自己的名字和值 */ /* 创建对象简单方法, 对象直接量 */ var obj = ...