首页 文章 精选 留言 我的

精选列表

搜索[TDSQL PostgreSQL 版],共10000篇文章
优秀的个人博客,低调大师

Android第二期 - 中国天气预报xml解析版(111)

实习比较忙,也时间写了,就记录一下自己的代码成长吧,希望能帮到你。 MainActivity部分: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 package com.sbs.weather; import java.io.InputStream; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpUriRequest; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.util.EntityUtils; import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.InputSource; import com.sbs.weather.DownImage.ImageCallback; import android.app.Activity; import android.app.ProgressDialog; import android.graphics.Bitmap; import android.graphics.drawable.Drawable; import android.net.NetworkInfo.State; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.provider.ContactsContract.CommonDataKinds.Note; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; import android.widget.TextView; public class Weather extends Activity{ public EditTextETplace; public TextViewTvPlace; public TextViewTvPlace_weather_tomrrow; public TextViewTvPlace_weather_next; public TextViewTvPlace_weather_detail; public Buttonquery; public TextViewplaceName; public ImageViewimView_today1; public ImageViewimView_today2; public ImageViewimView_tomrrow1; public ImageViewimView_tomrrow2; public ImageViewimView_next1; public ImageViewimView_next2; Stringplace; //加载提示框 private ProgressDialogdialog= null ; private final int IS_FINISH= 1 ; private Handlerhandler= new Handler(){ public void handleMessage(Messagemsg){ Stringweather= "" ; Stringweather_tomrrow= "" ; Stringweather_next= "" ; Stringweather_detail= "" ; NodeListn=(NodeList)msg.obj; //NodeListn=newNodeList(); //StringstrResult= //EntityUtils.toString(resp.getEntity()); //Log.i("weather->",strResult); //一华氏度等于9/5摄氏度数值+32 Stringhenan=n.item( 0 ).getChildNodes().item( 0 ).getNodeValue(); Log.i( "省会" ,henan); Stringzhengzhou_1=n.item( 1 ).getChildNodes().item( 0 ) .getNodeValue(); Log.i( "市区" ,zhengzhou_1); Stringtime_4=n.item( 4 ).getChildNodes().item( 0 ).getNodeValue(); Log.i( "时间" ,time_4); Stringwendu_5=n.item( 5 ).getChildNodes().item( 0 ).getNodeValue(); Log.i( "温度" ,wendu_5); Stringduoyun_6=n.item( 6 ).getChildNodes().item( 0 ).getNodeValue(); Log.i( "日期" ,duoyun_6); Stringweifeng_7=n.item( 7 ).getChildNodes().item( 0 ).getNodeValue(); Log.i( "风速" ,weifeng_7); Stringpicture1_8=n.item( 8 ).getChildNodes().item( 0 ) .getNodeValue(); Log.i( "图片1" ,picture1_8); Stringpicture2_9=n.item( 9 ).getChildNodes().item( 0 ) .getNodeValue(); Log.i( "图片2" ,picture2_9); Stringcontent_10=n.item( 10 ).getChildNodes().item( 0 ) .getNodeValue(); Log.i( "今天天气描述" ,content_10); Stringcontent2_11=n.item( 11 ).getChildNodes().item( 0 ) .getNodeValue(); Log.i( "天气小贴士" ,content2_11); Stringtomrrow_12=n.item( 12 ).getChildNodes().item( 0 ) .getNodeValue(); Log.i( "明天气温" ,tomrrow_12); Stringtomrrow_13=n.item( 13 ).getChildNodes().item( 0 ) .getNodeValue(); Log.i( "明天概况" ,tomrrow_13); Stringtomrrow_14=n.item( 14 ).getChildNodes().item( 0 ) .getNodeValue(); Log.i( "明天风向和风力" ,tomrrow_14); Stringtomrrow_15=n.item( 15 ).getChildNodes().item( 0 ) .getNodeValue(); Log.i( "明天图片1" ,tomrrow_15); Stringtomrrow_16=n.item( 16 ).getChildNodes().item( 0 ) .getNodeValue(); Log.i( "明天图片2" ,tomrrow_16); Stringtomrrow2_17=n.item( 17 ).getChildNodes().item( 0 ) .getNodeValue(); Log.i( "后天气温" ,tomrrow2_17); Stringtomrrow2_18=n.item( 18 ).getChildNodes().item( 0 ) .getNodeValue(); Log.i( "后天概况" ,tomrrow2_18); Stringtomrrow2_19=n.item( 19 ).getChildNodes().item( 0 ) .getNodeValue(); Log.i( "后天风向和风力" ,tomrrow2_19); Stringtomrrow2_20=n.item( 20 ).getChildNodes().item( 0 ) .getNodeValue(); Log.i( "后天图片1" ,tomrrow2_20); Stringtomrrow2_21=n.item( 21 ).getChildNodes().item( 0 ) .getNodeValue(); Log.i( "后天图片2" ,tomrrow2_21); Stringzonghe_22=n.item( 22 ).getChildNodes().item( 0 ) .getNodeValue(); Log.i( "介绍" ,zonghe_22); //获得图片url当天的。 StringimgUrl= "http://www.webxml.com.cn/images/weather/" ; StringTodayimgUrl1= null ; TodayimgUrl1=imgUrl +n.item( 8 ).getChildNodes().item( 0 ).getNodeValue(); Log.i( "今天的图片1地址" ,TodayimgUrl1); StringTodayimgUrl2= null ; TodayimgUrl2=imgUrl +n.item( 9 ).getChildNodes().item( 0 ).getNodeValue(); Log.i( "今天的图片2地址" ,TodayimgUrl2); //今天图片异步加载部分 //StringimrUrl=data.getJSONObject(0).get("imrUrl").toString(); DownImageloadimage_today_one= new DownImage(TodayimgUrl1); loadimage_today_one.loadImage( new ImageCallback(){ @Override public void getDrawable(Drawabledrawable){ //TODOAuto-generatedmethodstub imView_today1.setImageDrawable(drawable); } }); DownImageloadimage_today_two= new DownImage(TodayimgUrl2); loadimage_today_two.loadImage( new ImageCallback(){ @Override public void getDrawable(Drawabledrawable){ //TODOAuto-generatedmethodstub imView_today2.setImageDrawable(drawable); } }); //imView_today1.setImageBitmap(Utils.returnBitMap(TodayimgUrl1)); //imView_today2.setImageBitmap(Utils.returnBitMap(TodayimgUrl2)); //获得图片url明天的。 StringTomorrowimgUrl1= null ; TomorrowimgUrl1=imgUrl +n.item( 8 ).getChildNodes().item( 0 ).getNodeValue(); Log.i( "明天的图片1地址" ,TomorrowimgUrl1); StringTomorrowimgUrl2= null ; TomorrowimgUrl2=imgUrl +n.item( 9 ).getChildNodes().item( 0 ).getNodeValue(); Log.i( "明天的图片2地址" ,TomorrowimgUrl1); DownImageloadimage_tomrrow_one= new DownImage(TomorrowimgUrl1); loadimage_tomrrow_one.loadImage( new ImageCallback(){ @Override public void getDrawable(Drawabledrawable){ //TODOAuto-generatedmethodstub imView_tomrrow1.setImageDrawable(drawable); } }); DownImageloadimage_tomrrow_two= new DownImage(TomorrowimgUrl2); loadimage_tomrrow_two.loadImage( new ImageCallback(){ @Override public void getDrawable(Drawabledrawable){ //TODOAuto-generatedmethodstub imView_tomrrow2.setImageDrawable(drawable); } }); //imView_tomrrow1.setImageBitmap(Utils.returnBitMap(TomorrowimgUrl1)); //imView_tomrrow2.setImageBitmap(Utils.returnBitMap(TomorrowimgUrl2)); //获得图片url后天的。 StringNextimgUrl1= null ; NextimgUrl1=imgUrl +n.item( 8 ).getChildNodes().item( 0 ).getNodeValue(); Log.i( "后天的图片1地址" ,NextimgUrl1); StringNextimgUrl2= null ; NextimgUrl2=imgUrl +n.item( 9 ).getChildNodes().item( 0 ).getNodeValue(); Log.i( "后天的图片2地址" ,NextimgUrl2); DownImageloadimage_next_one= new DownImage(NextimgUrl1); loadimage_next_one.loadImage( new ImageCallback(){ @Override public void getDrawable(Drawabledrawable){ //TODOAuto-generatedmethodstub imView_next1.setImageDrawable(drawable); } }); DownImageloadimage_next_two= new DownImage(NextimgUrl2); loadimage_next_two.loadImage( new ImageCallback(){ @Override public void getDrawable(Drawabledrawable){ //TODOAuto-generatedmethodstub imView_next2.setImageDrawable(drawable); } }); //imView_next1.setImageBitmap(Utils.returnBitMap(NextimgUrl1)); //imView_next2.setImageBitmap(Utils.returnBitMap(NextimgUrl2)); //今天天气 weather+=henan; weather+= "/" ; weather+=zhengzhou_1; weather+= "\n" ; weather+=time_4; weather+= "\n" ; weather+=wendu_5; weather+= "\n" ; weather+=duoyun_6; weather+= "\n" ; weather+=weifeng_7; weather+= "\n" ; weather+=content_10; weather+= "\n" ; weather+=content2_11; weather+= "\n" ; //明天天气 weather_tomrrow+=tomrrow_12; weather_tomrrow+= "\n" ; weather_tomrrow+=tomrrow_13; weather_tomrrow+= "\n" ; weather_tomrrow+=tomrrow_14; weather_tomrrow+= "\n" ; //后天天气 weather_next+=tomrrow2_17; weather_next+= "\n" ; weather_next+=tomrrow2_18; weather_next+= "\n" ; weather_next+=tomrrow2_19; weather_next+= "\n" ; //地区介绍 weather_detail+=zonghe_22; weather_detail+= "\n" ; TvPlace.setText(weather); Log.i( "parseedweather->" ,weather); TvPlace_weather_tomrrow.setText(weather_tomrrow); Log.i( "parseedweather_tomrrow->" ,weather_tomrrow); TvPlace_weather_next.setText(weather_next); Log.i( "parseedweather_next->" ,weather_next); TvPlace_weather_detail.setText(weather_detail); Log.i( "parseedweather_detail->" ,weather_detail); if (msg.what==IS_FINISH){ dialog.dismiss(); } }; }; /**Calledwhentheactivityisfirstcreated.*/ @Override public void onCreate(BundlesavedInstanceState){ super .onCreate(savedInstanceState); setContentView(R.layout.main); ETplace=(EditText)findViewById(R.id.place1); query=(Button)findViewById(R.id.query); imView_today1=(ImageView)findViewById(R.id.myImageView_today1); imView_today2=(ImageView)findViewById(R.id.myImageView_today2); imView_tomrrow1=(ImageView)findViewById(R.id.myImageView_tomrrow1); imView_tomrrow2=(ImageView)findViewById(R.id.myImageView_tomrrow2); imView_next1=(ImageView)findViewById(R.id.myImageView_next1); imView_next2=(ImageView)findViewById(R.id.myImageView_next2); TvPlace=(TextView)findViewById(R.id.tvPlace); TvPlace_weather_tomrrow=(TextView)findViewById(R.id.tvPlace_weather_tomrrow); TvPlace_weather_next=(TextView)findViewById(R.id.tvPlace_weather_next); TvPlace_weather_detail=(TextView)findViewById(R.id.tvPlace_weather_detail); placeName=(TextView)findViewById(R.id.placeName); query.setOnClickListener( new Button.OnClickListener(){ public void onClick(Viewv){ new Thread( new MyThread()).start(); dialog.show(); } }); //加载提示框 dialog= new ProgressDialog( this ); dialog.setTitle( "提示" ); dialog.setMessage( "正在下载,请稍后...." ); dialog.setCancelable( false ); } public class MyThread implements Runnable{ @Override public void run(){ //TODOAuto-generatedmethodstub try { place=CntoEn.getFullSpell(ETplace.getText().toString()); Log.i( "Message->" ,place); placeName.setText(place); Stringurl= "http://www.webxml.com.cn/WebServices/WeatherWebService.asmx/getWeatherbyCityName?theCityName=" +place; Log.i( "url->" ,url); DefaultHttpClientclient= new DefaultHttpClient(); HttpUriRequestreq= new HttpGet(url); HttpResponseresp=client.execute(req); HttpEntityent=resp.getEntity(); InputStreamstream=ent.getContent(); DocumentBuilderb=DocumentBuilderFactory.newInstance() .newDocumentBuilder(); Documentd=b.parse( new InputSource(stream)); NodeListn=d.getElementsByTagName( "string" ); Messagemessage=Message.obtain(); message.obj=n; message.what=IS_FINISH; handler.sendMessage(message); } catch (Exceptione){ e.printStackTrace(); } } } } 图片解析公用类: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 package com.sbs.weather; import java.net.URL; import android.graphics.drawable.Drawable; import android.os.Handler; import android.os.Message; public class DownImage{ private Stringimage_path; public DownImage(Stringimage_path){ //TODOAuto-generatedconstructorstub this .image_path=image_path; } public void loadImage( final ImageCallbackcallback){ final Handlerhandler= new Handler(){ @Override public void handleMessage(android.os.Messagemsg){ super .handleMessage(msg); callback.getDrawable((Drawable)msg.obj); }; }; new Thread( new Runnable(){ @Override public void run(){ //TODOAuto-generatedmethodstub try { Drawabledrawable=Drawable.createFromStream( new URL( image_path).openStream(), "" ); //callback.getDrawable(drawable); Messagemessage=Message.obtain(); message.obj=drawable; handler.sendMessage(message); } catch (Exceptione){ //TODO:handleexception e.printStackTrace(); } } }).start(); } //接口回调方式 public interface ImageCallback{ public void getDrawable(Drawabledrawable); } } 汉字转拼音公用类: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 package com.sbs.weather; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Set; /** * 汉字转化为全拼 * *JDK版本:1.4 */ public class CntoEn{ private static LinkedHashMapspellMap= null ; static { if (spellMap== null ){ spellMap= new LinkedHashMap( 400 ); } initialize(); System.out.println( "ChinesetransferSpellDone." ); } private static void spellPut(Stringspell, int ascii){ spellMap.put(spell, new Integer(ascii)); } private static void initialize(){ spellPut( "a" ,- 20319 ); spellPut( "ai" ,- 20317 ); spellPut( "an" ,- 20304 ); spellPut( "ang" ,- 20295 ); spellPut( "ao" ,- 20292 ); spellPut( "ba" ,- 20283 ); spellPut( "bai" ,- 20265 ); spellPut( "ban" ,- 20257 ); spellPut( "bang" ,- 20242 ); spellPut( "bao" ,- 20230 ); spellPut( "bei" ,- 20051 ); spellPut( "ben" ,- 20036 ); spellPut( "beng" ,- 20032 ); spellPut( "bi" ,- 20026 ); spellPut( "bian" ,- 20002 ); spellPut( "biao" ,- 19990 ); spellPut( "bie" ,- 19986 ); spellPut( "bin" ,- 19982 ); spellPut( "bing" ,- 19976 ); spellPut( "bo" ,- 19805 ); spellPut( "bu" ,- 19784 ); spellPut( "ca" ,- 19775 ); spellPut( "cai" ,- 19774 ); spellPut( "can" ,- 19763 ); spellPut( "cang" ,- 19756 ); spellPut( "cao" ,- 19751 ); spellPut( "ce" ,- 19746 ); spellPut( "ceng" ,- 19741 ); spellPut( "cha" ,- 19739 ); spellPut( "chai" ,- 19728 ); spellPut( "chan" ,- 19725 ); spellPut( "chang" ,- 19715 ); spellPut( "chao" ,- 19540 ); spellPut( "che" ,- 19531 ); spellPut( "chen" ,- 19525 ); spellPut( "cheng" ,- 19515 ); spellPut( "chi" ,- 19500 ); spellPut( "chong" ,- 19484 ); spellPut( "chou" ,- 19479 ); spellPut( "chu" ,- 19467 ); spellPut( "chuai" ,- 19289 ); spellPut( "chuan" ,- 19288 ); spellPut( "chuang" ,- 19281 ); spellPut( "chui" ,- 19275 ); spellPut( "chun" ,- 19270 ); spellPut( "chuo" ,- 19263 ); spellPut( "ci" ,- 19261 ); spellPut( "cong" ,- 19249 ); spellPut( "cou" ,- 19243 ); spellPut( "cu" ,- 19242 ); spellPut( "cuan" ,- 19238 ); spellPut( "cui" ,- 19235 ); spellPut( "cun" ,- 19227 ); spellPut( "cuo" ,- 19224 ); spellPut( "da" ,- 19218 ); spellPut( "dai" ,- 19212 ); spellPut( "dan" ,- 19038 ); spellPut( "dang" ,- 19023 ); spellPut( "dao" ,- 19018 ); spellPut( "de" ,- 19006 ); spellPut( "deng" ,- 19003 ); spellPut( "di" ,- 18996 ); spellPut( "dian" ,- 18977 ); spellPut( "diao" ,- 18961 ); spellPut( "die" ,- 18952 ); spellPut( "ding" ,- 18783 ); spellPut( "diu" ,- 18774 ); spellPut( "dong" ,- 18773 ); spellPut( "dou" ,- 18763 ); spellPut( "du" ,- 18756 ); spellPut( "duan" ,- 18741 ); spellPut( "dui" ,- 18735 ); spellPut( "dun" ,- 18731 ); spellPut( "duo" ,- 18722 ); spellPut( "e" ,- 18710 ); spellPut( "en" ,- 18697 ); spellPut( "er" ,- 18696 ); spellPut( "fa" ,- 18526 ); spellPut( "fan" ,- 18518 ); spellPut( "fang" ,- 18501 ); spellPut( "fei" ,- 18490 ); spellPut( "fen" ,- 18478 ); spellPut( "feng" ,- 18463 ); spellPut( "fo" ,- 18448 ); spellPut( "fou" ,- 18447 ); spellPut( "fu" ,- 18446 ); spellPut( "ga" ,- 18239 ); spellPut( "gai" ,- 18237 ); spellPut( "gan" ,- 18231 ); spellPut( "gang" ,- 18220 ); spellPut( "gao" ,- 18211 ); spellPut( "ge" ,- 18201 ); spellPut( "gei" ,- 18184 ); spellPut( "gen" ,- 18183 ); spellPut( "geng" ,- 18181 ); spellPut( "gong" ,- 18012 ); spellPut( "gou" ,- 17997 ); spellPut( "gu" ,- 17988 ); spellPut( "gua" ,- 17970 ); spellPut( "guai" ,- 17964 ); spellPut( "guan" ,- 17961 ); spellPut( "guang" ,- 17950 ); spellPut( "gui" ,- 17947 ); spellPut( "gun" ,- 17931 ); spellPut( "guo" ,- 17928 ); spellPut( "ha" ,- 17922 ); spellPut( "hai" ,- 17759 ); spellPut( "han" ,- 17752 ); spellPut( "hang" ,- 17733 ); spellPut( "hao" ,- 17730 ); spellPut( "he" ,- 17721 ); spellPut( "hei" ,- 17703 ); spellPut( "hen" ,- 17701 ); spellPut( "heng" ,- 17697 ); spellPut( "hong" ,- 17692 ); spellPut( "hou" ,- 17683 ); spellPut( "hu" ,- 17676 ); spellPut( "hua" ,- 17496 ); spellPut( "huai" ,- 17487 ); spellPut( "huan" ,- 17482 ); spellPut( "huang" ,- 17468 ); spellPut( "hui" ,- 17454 ); spellPut( "hun" ,- 17433 ); spellPut( "huo" ,- 17427 ); spellPut( "ji" ,- 17417 ); spellPut( "jia" ,- 17202 ); spellPut( "jian" ,- 17185 ); spellPut( "jiang" ,- 16983 ); spellPut( "jiao" ,- 16970 ); spellPut( "jie" ,- 16942 ); spellPut( "jin" ,- 16915 ); spellPut( "jing" ,- 16733 ); spellPut( "jiong" ,- 16708 ); spellPut( "jiu" ,- 16706 ); spellPut( "ju" ,- 16689 ); spellPut( "juan" ,- 16664 ); spellPut( "jue" ,- 16657 ); spellPut( "jun" ,- 16647 ); spellPut( "ka" ,- 16474 ); spellPut( "kai" ,- 16470 ); spellPut( "kan" ,- 16465 ); spellPut( "kang" ,- 16459 ); spellPut( "kao" ,- 16452 ); spellPut( "ke" ,- 16448 ); spellPut( "ken" ,- 16433 ); spellPut( "keng" ,- 16429 ); spellPut( "kong" ,- 16427 ); spellPut( "kou" ,- 16423 ); spellPut( "ku" ,- 16419 ); spellPut( "kua" ,- 16412 ); spellPut( "kuai" ,- 16407 ); spellPut( "kuan" ,- 16403 ); spellPut( "kuang" ,- 16401 ); spellPut( "kui" ,- 16393 ); spellPut( "kun" ,- 16220 ); spellPut( "kuo" ,- 16216 ); spellPut( "la" ,- 16212 ); spellPut( "lai" ,- 16205 ); spellPut( "lan" ,- 16202 ); spellPut( "lang" ,- 16187 ); spellPut( "lao" ,- 16180 ); spellPut( "le" ,- 16171 ); spellPut( "lei" ,- 16169 ); spellPut( "leng" ,- 16158 ); spellPut( "li" ,- 16155 ); spellPut( "lia" ,- 15959 ); spellPut( "lian" ,- 15958 ); spellPut( "liang" ,- 15944 ); spellPut( "liao" ,- 15933 ); spellPut( "lie" ,- 15920 ); spellPut( "lin" ,- 15915 ); spellPut( "ling" ,- 15903 ); spellPut( "liu" ,-

优秀的个人博客,低调大师

Apple 系统正式版要发布了,有你期待的功能吗?

Apple操作系统每年例行升级时间到,每年都说的那么牛B,不管是IOS还是Mac os功能已经曝光的差不多了,你需要的功能有出现吗? 每年对系统的升级,其实还是很期待的,但是发现,Apple的系统现在越来越关注一些高科技,很多接地气的使用功能一直没有,还是让人很失望的。说一说新版系统对我的吸引力吧。 IOS IOS11的新功能:https://www.apple.com/cn/ios/ios-11/相机扫码这个应该是最喜欢的功能了. 我再也不用通过微信扫码,然后safri打开跳转了。 文件管理App 这个可以期待一下,曾经很尴尬的用Airdrop接收了一个后缀名不太规范的大文件,然后找不到了,不知道存哪里去了,官方的回复是,没有办法管理。我当时了好几天。希望这个新的软件能带来惊喜 新的控制中心 这个也可以期待一下,IOS的控制中心的确很弱,这样算是增强了一点。 Apple ID 可以用手机号码了 这个也比较方便,找回密码方便,哈哈。但是,担心和邮件一样,成为营销的攻击点啊。每天收到N多的垃圾邮件,不会变成垃圾短信吧。 新版dock 家里的iPad唯一用处就是看下电影,其他,真没太大用处。尴尬!新版的dock无感啊。 貌似还有很多其他牛B的功能,AR,基本不知道用来干嘛;Message表情,在国内很尴尬,用iPhone,但是留言都是用微信;邮件,用的是第三方客户端。对于我个人来说,真没有太多的吸引力啊。 Mac OS Mac OS的新功能:https://www.apple.com/cn/macos/high-sierra/ 文件管家暂时不知道和finder有啥区别,新事物,值得等待。 Mac OS的新功能,我仔细翻了5遍,始终没有找到我钟爱的功能,估计我都懒得升级了。再来一次尴尬。 我需要的功能 其实对于Apple 的系统,软件应该是进入了瓶颈期,但是优化的地方还是很多的。当年通过Mac接听iPhone电话这种黑科技带来的惊喜貌似已经两年没出现了。这里列举下我个人非常期待,但是却始终不发布的功能: IOS输入震动反馈 只有键盘声,太弱了,室外听不到,室内担心吵着别人。 电话录音 这个基础功能啊。 增强Mac OS分屏 只能分成2个,我们需要更多啊。最好还能有对应的快捷键支持,相比Windows,这个功能差太远了。 大家还有哪些对于IOS吐槽的功能,欢迎大家回复吐槽。

优秀的个人博客,低调大师

MySQL 8.0.3 RC版即将发布,让我们来看看有哪些变化吧!

【大咖・来了 第7期】10月24日晚8点观看《智能导购对话机器人实践》 MySQL 8.0.3 即将发布 RC 版本,这预示着 8.0 版本离 GA 越来越近了。 下面分享一下 8.0.3 版本的一些重要新特性、新变化: 直接废除 query cache(应该只是关闭入口,自行编译源码的话,还能再次启用) 查询优化器支持直接在 SQL 中利用 SET_VAR 这个 HINT 语法修改某些会话级的选项,比如:- SELECT /*+ SET_VAR(sort_buffer_size = 16M) */ name FROM people ORDER BY name;- INSERT /*+ SET_VAR(foreign_key_checks=OFF) */ INTO t2 VALUES(2); (这个功能超级实用啊,直接在 SQL 内可以修改了,都不用再写一个 SQL,而且还担心会影响别人) 查询优化器现在支持将各个列统计结果直方图存储在 column_statistics 数据字典中,以便构造执行计划。有了这个直方图,就可用于该列和常量的比较判断 查询优化器中新增标记位 use_invisible_indexes,用于控制在构造执行计划时是否考虑不可见索引(invisible indexes)因素 InnoDB 新增备份专用锁,以前 InnoDB 表在线热备时若同时进行 DML 可能导致 InnoDB 文件的快照不一致,有了这个备份锁就不用担心了。备份锁用法是 LOCK INSTANCE FOR BACKUP、UNLOCK INSTANCE,需要有 BACKUP_ADMIN 权限 InnoDB 现在支持表 DDL 的原子性,也就是 InnoDB 表上的 DDL 也可以实现事务完整性了,要么失败回滚,要么成功提交,不至于出现 DDL 时部分成功的问题,此外还支持 crash-safe 特性(这个功能大赞啊) 若是延迟初始化组复制(GR,Group Replication),也就是在 single-primary 模式下,辅助节点上可以通过异步复制通道写入数据,这在正常初始化组复制插件时是不允许的(Bug #26314756,这是个内部 BUG ID,我们看不到的,别费劲了。不过还有***的 github 啊,也能看到相关描述,参见:https://github.com/mysql/mysql-server/commit/acbf1d13ecd1d89557f8ca62116f06e8633dc90d) 系统库 INFORMATION_SCHEMA 中的 FILES、PARTITIONS、REFERENTIAL_CONSTRAINTS 等几个视图被重新实现了一番(这个没说太具体,可能和所有的 DDL 都放入 InnoDB 有关系,不再使用 FRM 文件存储 DDL 信息) 由于外键约束锁功能改造,涉及到外键约束的父表上的列改名功能将暂时被禁用一段时间(估计过几个小版本就能正常用了) InnoDB 通用表空间新增改名语法:ALTER TABLESPACE … RENAME TO(作为 MySQL DBA,貌似没什么人玩通用表空间,可能从 Oracle DBA 转过来更习惯使用吧) MySQL 复制的 slave 节点上,log_slave_updates 选项默认值改为 ON(这个也是比较实用,方便将该 slave 直接作为中继节点使用) 选项 sql_log_bin 的全局作用域被改成回话级作用域,也就是修改本选项只影响本会话,不再影响全局(这个选项一般也是在会话级使用) 选项 max_allowed_packet 的默认值从 4M 提高到 64M(这个貌似比较实在) 选项 event_scheduler 的默认值由 OFF 改成 ON,使得默认启用 event scheduler 功能(我觉得 event 功能挺好的呀,不过貌似没几个人使用 event) 选项 max_error_count 的默认值从 64 提高到 1024(没感觉的说) ***一个,utf8mb4 字符集增加俄语的校验集(新增 utf8mb4_ru_0900_ai_ci、utf8mb4_ru_0900_as_cs 两种 collations set) 一起期待 8.0.3 的发布吧!

优秀的个人博客,低调大师

Hinton 机器学习教程 第一课汉化版完整放送!

作为 AI 从业者,想必你和小编一样都有过类似的经历。 下定决心想要钻研机器学习类的课程,不仅要搞定学术理论,还得应对英语所带来的难题。 为了让广大 AI 青年们不再为英语所累,快速进入学习状态,雷锋网推出了深度学习大牛 Geoffrey Hinton 的《Neutral Network for Machine Learning》中文系列视频课程。本次课程来源于 Hinton 2012 年在多伦多大学的授课实录,适合于对 Machine Learning 有一定基础的同学来进一步学习研究。PS: 出于对 Hinton 知识成果的尊重以及版权的需要,AI 研习社已经获得了 Hinton 教授的亲自授权。 本套课程中,Hinton 重点介绍了人工神经网络在语音识别和物体识别、图像分割、建模语言和人类运动等过程中的应用,及其在机器学习中发挥的

优秀的个人博客,低调大师

《Hadoop实战第2版》——2.5节日志分析及几个小技巧

2.5 日志分析及几个小技巧如果大家在安装的时候遇到问题,或者按步骤安装完成却不能运行Hadoop,那么建议仔细查看日志信息。Hadoop记录了详尽的日志信息,日志文件保存在logs文件夹内。无论是启动还是以后会经常用到的MapReduce中的每一个Job,或是HDFS等相关信息,Hadoop均存有日志文件以供分析。例如:NameNode和DataNode的namespaceID不一致,这个错误是很多人在安装时都会遇到的。日志信息为: java.io.IOException: Incompatible namespaceIDs in /root/tmp/dfs/data:namenode namespaceID = 1307672299; datanode namespaceID = 389959598 若HDFS一直没有启动,读者

优秀的个人博客,低调大师

《Hadoop实战第2版》——2.1节在Linux上安装与配置Hadoop

2.1 在Linux上安装与配置Hadoop在Linux上安装Hadoop之前,需要先安装两个程序:1)JDK 1.6(或更高版本)。Hadoop是用Java编写的程序,Hadoop的编译及MapReduce的运行都需要使用JDK。因此在安装Hadoop前,必须安装JDK 1.6或更高版本。2)SSH(安全外壳协议),推荐安装OpenSSH。Hadoop需要通过SSH来启动Slave列表中各台主机的守护进程,因此SSH也是必须安装的,即使是安装伪分布式版本(因为Hadoop并没有区分开集群式和伪分布式)。对于伪分布式,Hadoop会采用与集群相同的处理方式,即按次序启动文件conf/slaves中记载的主机上的进程,只不过在伪分布式中Salve为localhost(即为自身),所以对于伪分布式Hadoop,SSH一样是必需的。 2.

优秀的个人博客,低调大师

《Hadoop实战第2版》——2.3节在Windows上安装与配置Hadoop

2.3 在Windows上安装与配置Hadoop 2.3.1 安装JDK 1.6或更高版本相对于Linux,JDK在Windows上的安装过程更容易,你可以在http://www.java.com/zh_CN/download/manual.jsp下载到最新版本的JDK。这里再次申明,Hadoop的编译及MapReduce程序的运行,很多地方都需要使用JDK的相关工具,因此只安装JRE是不够的。安装过程十分简单,运行安装程序即可,程序会自动配置环境变量(在之前的版本中还没有这项功能,新版本的JDK已经可以自动配置环境变量了)。 2.3.2 安装CygwinCygwin是在Windows平台下模拟UNIX环境的一个工具,只有通过它才可以在Windows环境下安装Hadoop。可以通过下面的链接下载Cygwin:http://www.cy

优秀的个人博客,低调大师

《SEO的艺术(原书第2版)》——3.6 为原始流量开展SEO

3.6 为原始流量开展SEO 为搜索引擎进行优化,并创建针对关键词的内容,有助于提高网站在关键搜索词上的排名,随着越来越多的人查找、使用和享受你制造的产品,这通常能够带来直接的流量和引用链接。Web上有数千个网站利用这种流量来提供广告,直接从搜索引擎引导的流量中获利。从横幅广告到Google的AdSense等上下文服务,再到分销联盟计划等,网络广告已经成为一个巨大的产业。仅在美国,2012年该行业的价值预计就将达到354亿美元,其中本地广告占89亿美元。下面是从原始流量出发开展SEO时应该考虑的一些因素。何时实施原始流量SEO当你不用在网站上采取行动或者进行金融交易(通常通过广告)就能将流量转化为收益的时候开展。关键词定位这种情况下的关键词定位可能非常广泛。这时的目标一般不是选择具体的关键词,而是创建许多高质量的内容,自然地针对人们

资源下载

更多资源
腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

用户登录
用户注册
修改密码
忘记密码