首页 文章 精选 留言 我的

精选列表

搜索[医疗数据中台],共10000篇文章
优秀的个人博客,低调大师

关系型数据抽取到hive中

操作步骤 1.建立外表 CREATE external TABLE t_rk_baseinfo_5kwexternal ( ROW_ID STRING, SYNC_SIGN STRING, SYNC_ERROR_DESC STRING, OperateType STRING, SYNC_Date STRING, XiaQuCode STRING, Name STRING, NameEN STRING, NameUsed STRING, Sex STRING, Nation STRING, Birthday STRING, BirthPlace STRING, Age STRING, Native STRING, Nationality STRING, IdcardType STRING, Idcard STRING, IdcardBeginDate STRING, IdcardEndDate STRING, Political STRING, MaritalStatus STRING, Faith STRING, MilitaryService STRING, Height STRING, Weight STRING, BloodType STRING, Mobile STRING, Telephone STRING, RegionAddress STRING, Address STRING, PostCode STRING, EMail STRING, Health STRING, FamliyDiseaseHis STRING, IdDeath STRING, DeathDate STRING, Type STRING, PersonGuid STRING, HabCode STRING, AgeArea STRING, HouseholdType STRING, Education STRING, baidulat STRING, baidulng STRING) row format delimited fields terminated by ‘\t’; ; 2.文件抽取至HDFS 3.创建事务表 clustered by (ROW_ID) into 3 buckets stored as orc TBLPROPERTIES (‘transactional’=’true’); 备用:LOAD DATA INPATH ‘/path/to/local/files’ into table t_rk_baseinfo; 4.hdfs到外表 5.外表到事务表 insert into 事务表 select * from 外表;

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

Android动态刷新listview中的数据

之前一直困扰listview刷新后位置的问题,现在才明白,原来不能重新设置listview的adapter,而应该用notifyDataSetChanged()来刷新,这样位置就不会置顶。 下面做了一个测试的例子,点击最后一条记录,会增加一条新的记录, 代码如下: 1.TestAdapter package com.TestAdapter; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import android.app.Activity; import android.content.Context; import android.os.Bundle; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.AbsListView.OnScrollListener; import android.widget.AdapterView.OnItemClickListener; import android.widget.AdapterView.OnItemSelectedListener; import android.widget.AbsListView; import android.widget.ImageView; import android.widget.ListView; import android.widget.SimpleAdapter; import android.widget.TextView; import android.widget.Toast; public class TestAdapter extends Activity { /** Called when the activity is first created. */ private int[] images ; private ListView listview; private MyAdapter adapter; List<Map<String,Integer>> al; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); images = new int[]{android.R.drawable.ic_btn_speak_now, android.R.drawable.alert_light_frame, android.R.drawable.arrow_down_float, android.R.drawable.arrow_up_float, android.R.drawable.btn_star_big_off, android.R.drawable.btn_star_big_on, android.R.drawable.button_onoff_indicator_off, android.R.drawable.button_onoff_indicator_on, android.R.drawable.checkbox_off_background, android.R.drawable.checkbox_on_background, android.R.drawable.ic_btn_speak_now, android.R.drawable.ic_delete}; listview = (ListView)findViewById(R.id.listview); al = new ArrayList<Map<String,Integer>>(); for(int i=0; i<12; i++){ HashMap<String,Integer > map = new HashMap<String,Integer>(); map.put(""+i, images[i]); al.add(map); } adapter = new MyAdapter(this, al, R.layout.list_item, new String[]{"imageview", "tv"}, new int[]{R.id.imageview, R.id.tv}); listview.setAdapter(adapter); listview.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> arg0, View arg1, int count, long arg3) { if(adapter.getCount()==count+1){ HashMap<String ,Integer> map = new HashMap<String, Integer>(); map.put(""+(adapter.mItemList.size()), android.R.drawable.ic_dialog_email); al.add(map); adapter.mItemList = al; adapter.notifyDataSetChanged(); Toast.makeText(TestAdapter.this, "正在刷新", Toast.LENGTH_SHORT).show(); } } }); } private class MyAdapter extends SimpleAdapter{ int count = 0; private List<Map<String, Integer>> mItemList; public MyAdapter(Context context, List<? extends Map<String, Integer>> data, int resource, String[] from, int[] to) { super(context, data, resource, from, to); mItemList = (List<Map<String, Integer>>) data; if(data == null){ count = 0; }else{ count = data.size(); } } public int getCount() { return mItemList.size(); } public Object getItem(int pos) { return pos; } public long getItemId(int pos) { return pos; } @Override public View getView(int position, View convertView, ViewGroup parent) { Map<String ,Integer> map = mItemList.get(position); int image = map.get(""+position); View view = super.getView(position, convertView, parent); ImageView imageview = (ImageView)view.findViewById(R.id.imageview); TextView tv = (TextView)view.findViewById(R.id.tv); imageview.setBackgroundResource(image); tv.setText(""+position); return view; } } } 2.main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <ListView android:id="@+id/listview" android:layout_width="fill_parent" android:layout_height="wrap_content" ></ListView> </LinearLayout> 3.list_item.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <ImageView android:id="@+id/imageview" android:layout_width="wrap_content" android:layout_height="wrap_content"> </ImageView> <TextView android:id="@+id/tv" android:layout_width="fill_parent" android:layout_height="wrap_content" ></TextView> </LinearLayout> 本文转自 wws5201985 51CTO博客,原文链接:http://blog.51cto.com/wws5201985/786470,如需转载请自行联系原作者

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

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应用均可从中受益。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册