乐学成语——完整实现

2024-03-24 20:10
文章标签 实现 完整 成语 乐学

本文主要是介绍乐学成语——完整实现,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

1.程序列表



2.MainActivity.java

package cn.edu.bztc.happyidiom.activity;import cn.edu.bztc.happyidiom.R;
import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.Window;
import android.widget.TabHost;
@SuppressWarnings("deprecation")public class MainActivity extends TabActivity {private TabHost tabHost;protected void onCreate(Bundle savedInstanceState){super.onCreate(savedInstanceState);requestWindowFeature(Window.FEATURE_NO_TITLE);//取消标题栏setContentView(R.layout.activity_main);tabHost=getTabHost();addTab("study",R.string.title_study,R.drawable.study,StudyActivity.class);addTab("search",R.string.title_search,R.drawable.search,StudyActivity.class);addTab("game",R.string.title_game,R.drawable.game,StudyActivity.class);addTab("save",R.string.title_save,R.drawable.save,StudyActivity.class);addTab("help",R.string.title_help,R.drawable.help,StudyActivity.class);	}@SuppressWarnings("rawtypes")private void addTab(String tag,int title_introduction,int title_icon,Class ActivityClass){tabHost.addTab(tabHost.newTabSpec(tag).setIndicator(getString(title_introduction), getResources().getDrawable(title_icon)).setContent(new Intent(this,ActivityClass)));	}public boolean onCreateOptionsMenu(Menu menu){//inflate the menu;this adds items to the action bar if it is present.getMenuInflater().inflate(R.menu.main, menu);return true;}
}
3.StudyActivity.java

package cn.edu.bztc.happyidiom.activity;import java.util.ArrayList;
import java.util.List;import cn.edu.bztc.happyidiom.R;
import cn.edu.bztc.happyidiom.adapter.CategoryAdapter;
import cn.edu.bztc.happyidiom.entity.Category;import android.app.Activity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import android.widget.Toast;public class StudyActivity extends Activity {private List<Category> categoryList;private String[] category_names;private int[] category_images;@Overrideprotected void onCreate(Bundle savedInstanceState) {// TODO Auto-generated method stubsuper.onCreate(savedInstanceState);setContentView(R.layout.activity_study);initCategories();//初始化类别CategoryAdapter adapter = new CategoryAdapter(this, R.layout.category_item, categoryList);ListView listView=(ListView)findViewById(R.id.lvCategories);listView.setAdapter(adapter);listView.setOnItemClickListener(new OnItemClickListener() {@Overridepublic void onItemClick(AdapterView<?> adapterView, View view, int position,long id) {// TODO Auto-generated method stubswitch(position){case 0:Intent intent=new Intent(StudyActivity.this,StudyAnimalActivity.class);startActivity(intent);break;default:break;}//Category category=categoryList.get(position);//Toast.makeText(StudyActivity.this,category.getName(),Toast.LENGTH_LONG).show();}});}private void initCategories(){categoryList=new ArrayList<Category>();Resources resources=getResources();category_names=resources.getStringArray(R.array.category);category_images=new int[]{R.drawable.category_animal,R.drawable.category_nature,R.drawable.category_human,R.drawable.category_season,R.drawable.category_number,R.drawable.category_fable,R.drawable.category_other};for(int i=0;i<category_names.length;i++){categoryList.add(new Category(category_names[i], category_images[i]));}}@Overridepublic boolean onCreateOptionsMenu(Menu menu) {// TODO Auto-generated method stubgetMenuInflater().inflate(R.menu.study, menu);return true;}}
4.StudyAnimalAcitivity.java

package cn.edu.bztc.happyidiom.activity;import java.util.List;import cn.edu.bztc.happyidiom.R;
import cn.edu.bztc.happyidiom.adapter.AnimalAdapter;
import cn.edu.bztc.happyidiom.dao.AnimalDao;
import cn.edu.bztc.happyidiom.entity.Animal;
import cn.edu.bztc.happyidiom.util.DialogUtil;import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import android.widget.Toast;public class StudyAnimalActivity extends Activity{private List<Animal> animalList;private AnimalDao animalDao;private ListView lvAnimalList;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_animal);initAnimals();lvAnimalList=(ListView)findViewById(R.id.lvAnimalList);AnimalAdapter animalAdapter=new AnimalAdapter(this,R.layout.animal_item,animalList);lvAnimalList.setAdapter(animalAdapter);lvAnimalList.setOnItemClickListener(new OnItemClickListener() {@Overridepublic void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {Animal animal=animalList.get(position);/*定义对话框中提示语句*/String result=animal.getName()+"\n"+animal.getPronounce()+"\n【解释】:"+animal.getExplain()+"\n【近义词】:"+animal.getHomoionym()+"\n【反义词】:"+animal.getAntonym()+"\n【来源】:"+animal.getDerivation()+"\n【示例】:"+animal.getExamples();DialogUtil.showDialog(result,StudyAnimalActivity.this);}});}/*获取成语数据*/private void initAnimals() {animalDao=AnimalDao.getInstance(this);animalList=animalDao.getAllAnimals();}
}

5.StudyAnimalActivity.java

package cn.edu.bztc.happyidiom.activity;import java.util.List;import cn.edu.bztc.happyidiom.R;
import cn.edu.bztc.happyidiom.adapter.AnimalAdapter;
import cn.edu.bztc.happyidiom.dao.AnimalDao;
import cn.edu.bztc.happyidiom.entity.Animal;
import cn.edu.bztc.happyidiom.util.DialogUtil;import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import android.widget.Toast;public class StudyAnimalActivity extends Activity{private List<Animal> animalList;private AnimalDao animalDao;private ListView lvAnimalList;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_animal);initAnimals();lvAnimalList=(ListView)findViewById(R.id.lvAnimalList);AnimalAdapter animalAdapter=new AnimalAdapter(this,R.layout.animal_item,animalList);lvAnimalList.setAdapter(animalAdapter);lvAnimalList.setOnItemClickListener(new OnItemClickListener() {@Overridepublic void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {Animal animal=animalList.get(position);/*定义对话框中提示语句*/String result=animal.getName()+"\n"+animal.getPronounce()+"\n【解释】:"+animal.getExplain()+"\n【近义词】:"+animal.getHomoionym()+"\n【反义词】:"+animal.getAntonym()+"\n【来源】:"+animal.getDerivation()+"\n【示例】:"+animal.getExamples();DialogUtil.showDialog(result,StudyAnimalActivity.this);}});}/*获取成语数据*/private void initAnimals() {animalDao=AnimalDao.getInstance(this);animalList=animalDao.getAllAnimals();}
}
  6.AnimalAdapter.java

package cn.edu.bztc.happyidiom.adapter;import java.util.List;import cn.edu.bztc.happyidiom.entity.Animal;
import cn.edu.bztc.happyidiom.R;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.webkit.WebView.FindListener;
import android.widget.ArrayAdapter;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;public class AnimalAdapter extends ArrayAdapter<Animal>{private int resourceId;private Context context;public AnimalAdapter(Context context, int resource,List<Animal> objects) {super(context,resource, objects);this.context=context;resourceId=resource;}@Overridepublic View getView(int position, View convertView, ViewGroup parent) {final Animal animal =getItem(position);//获取当前项的Animal实例View view;ViewHolder viewHolder;if(convertView==null){//判断是否第一次运行,如果是则进入,并将上下文环境保存进convertViewview=LayoutInflater.from(getContext()).inflate(resourceId,null);viewHolder=new ViewHolder();viewHolder.tvName=(TextView)view.findViewById(R.id.tvName);viewHolder.btnSave=(ImageButton)view.findViewById(R.id.btnSave);viewHolder.btnSave.setFocusable(false);viewHolder.btnSave.setFocusableInTouchMode(false);	viewHolder.btnSave.setOnClickListener(new OnClickListener() {@Overridepublic void onClick(View arg0) {Toast.makeText(context,"你要收藏"+animal.getName()+"吗",Toast.LENGTH_SHORT).show();}});view.setTag(viewHolder);}else{//如果不是第一次运行,convertView不为空,直接取出赋值给viewview=convertView;viewHolder=(ViewHolder) view.getTag();}viewHolder.tvName.setText(animal.getName());//显示成语return view;}class ViewHolder{TextView tvName;ImageButton btnSave;}
}
  7.CategoryAdapter.java

package cn.edu.bztc.happyidiom.adapter;import java.util.List;import cn.edu.bztc.happyidiom.entity.Category;
import cn.edu.bztc.happyidiom.R;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.webkit.WebView.FindListener;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;public class CategoryAdapter extends ArrayAdapter<Category>{private int resourceId;public CategoryAdapter(Context context, int resource,List<Category> categoryList) {super(context,resource, categoryList);resourceId=resource;}public View getView(int position, android.view.View convertView, android.view.ViewGroup parent) {Category category=getItem(position);//获取当前项的Category实例View view;ViewHolder viewHolder;if(convertView==null){view=LayoutInflater.from(getContext()).inflate(resourceId,null);viewHolder=new ViewHolder();viewHolder.categoryImage=(ImageView)view.findViewById(cn.edu.bztc.happyidiom.R.id.category_image);viewHolder.categoryName=(TextView)view.findViewById(cn.edu.bztc.happyidiom.R.id.category_name);view.setTag(viewHolder);	}else{view=convertView;viewHolder=(ViewHolder) view.getTag();}viewHolder.categoryImage.setImageResource(category.getImageId());viewHolder.categoryName.setText(category.getName());return view;}class ViewHolder{ImageView categoryImage;TextView categoryName;}
}
  8.AnimalDao.java

package cn.edu.bztc.happyidiom.dao;import java.util.ArrayList;
import java.util.List;import cn.edu.bztc.happyidiom.db.DBOpenHelper;
import cn.edu.bztc.happyidiom.entity.Animal;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;public class AnimalDao {private static AnimalDao animaiDao;private SQLiteDatabase db;/*将构造方法私有化*/private AnimalDao(Context context){DBOpenHelper dbHelper=new DBOpenHelper(context);db=dbHelper.openDatabase();}/*获取AnimalDao的实例*/public synchronized static AnimalDao getInstance(Context context){if(animaiDao==null){animaiDao=new AnimalDao(context);}return animaiDao;}/*从数据库读取所有的动物类成语*/public List<Animal> getAllAnimals(){List<Animal> list=new ArrayList<Animal>();Cursor cursor=db.query("animal",null,null,null,null,null,null);if(cursor.moveToNext()){do{Animal animal=new Animal();animal.setId(cursor.getInt(cursor.getColumnIndex("_id")));animal.setName(cursor.getString(cursor.getColumnIndex("name")));animal.setPronounce(cursor.getString(cursor.getColumnIndex("pronounce")));animal.setAntonym(cursor.getString(cursor.getColumnIndex("antonym")));animal.setHomoionym(cursor.getString(cursor.getColumnIndex("homoionym")));animal.setDerivation(cursor.getString(cursor.getColumnIndex("derivation")));animal.setExamples(cursor.getString(cursor.getColumnIndex("examples")));animal.setExplain(cursor.getString(cursor.getColumnIndex("explain")));list.add(animal);}while(cursor.moveToNext());}return list;}
}
  9.DBOpenHelper.java

package cn.edu.bztc.happyidiom.db;import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.os.Environment;
import android.util.Log;/*实现将数据库文件从raw目录拷贝到手机里存放数据库的位置*/
public class DBOpenHelper {private final int BUFFER_SIZE=400000;//缓冲区大小public static final String DB_NAME="idioms.db";//保存的数据库文件名public static final String PACKAGE_NAME="cn.edu.bztc.happyidiom";//应用的包名public static final String DB_PATH="/data"+Environment.getDataDirectory().getAbsolutePath()+"/"+PACKAGE_NAME+"/databases";//在手机里存放数据库的位置private Context context;public DBOpenHelper(Context context){this.context=context;}public SQLiteDatabase openDatabase(){try {File myDataPath=new File(DB_PATH);if(!myDataPath.exists()){myDataPath.mkdirs();//如果没有这个目录则创建}String dbfile=myDataPath+"/"+DB_NAME;if(!(new File(dbfile).exists())){//判断数据库文件是否存在,如果不存在则执行导入,否则直接打开数据库InputStream is=context.getResources().openRawResource(cn.edu.bztc.happyidiom.R.raw.idioms);FileOutputStream fos=new FileOutputStream(dbfile);byte[] buffer=new byte[BUFFER_SIZE];int count=0;while((count=is.read(buffer))>0){fos.write(buffer,0,count);}fos.close();is.close();}SQLiteDatabase db=SQLiteDatabase.openOrCreateDatabase(dbfile,null);return db;} catch (FileNotFoundException e) {Log.e("MainActivity","File not found");e.printStackTrace();}catch (IOException e) {Log.e("MainActivity","IO exception");e.printStackTrace();}return null;}
}
  10.Animal.java

package cn.edu.bztc.happyidiom.entity;public class Animal {private int id;private String name;//成语名称private String pronounce;//成语发音private String explain;//成语解释private String antonym;//反义词private String homoionym;//同义词private String derivation;//源自private String examples;//例子public int getId() {return id;}public void setId(int id) {this.id = id;}public String getName() {return name;}public void setName(String name) {this.name = name;}public String getPronounce() {return pronounce;}public void setPronounce(String pronounce) {this.pronounce = pronounce;}public String getExplain() {return explain;}public void setExplain(String explain) {this.explain = explain;}public String getAntonym() {return antonym;}public void setAntonym(String antonym) {this.antonym = antonym;}public String getHomoionym() {return homoionym;}public void setHomoionym(String homoionym) {this.homoionym = homoionym;}public String getDerivation() {return derivation;}public void setDerivation(String derivation) {this.derivation = derivation;}public String getExamples() {return examples;}public void setExamples(String examples) {this.examples = examples;}}
  11.Category.java

package cn.edu.bztc.happyidiom.entity;public class Category {private String name;private int imageId;public Category(String name, int imageId) {super();this.name = name;this.imageId = imageId;}public String getName() {return name;}public int getImageId() {return imageId;}
}
  12.AnimalDaoTest.java

package cn.edu.bztc.happyidiom.test;import java.util.List;import cn.edu.bztc.happyidiom.dao.AnimalDao;
import cn.edu.bztc.happyidiom.entity.Animal;
import android.test.AndroidTestCase;public class AnimalDaoTest extends AndroidTestCase{public void testGetAllAnimals(){AnimalDao animalDao=AnimalDao.getInstance(getContext());List<Animal> animals=animalDao.getAllAnimals();System.out.println(animals.size());for(Animal animal:animals){System.out.println(animal.getName());}}
}
  13.DBOpenHelperTest.java

package cn.edu.bztc.happyidiom.test;import cn.edu.bztc.happyidiom.db.DBOpenHelper;
import android.test.AndroidTestCase;public class DBOpenHelperTest extends AndroidTestCase{public void testDBCopy(){DBOpenHelper dbOpenHelper=new DBOpenHelper(getContext());dbOpenHelper.openDatabase();}
}
  14.DialogUtil.java
package cn.edu.bztc.happyidiom.util;import cn.edu.bztc.happyidiom.R;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;public class DialogUtil {public static void showDialog(String result,Context context){AlertDialog.Builder builder=new AlertDialog.Builder(context);LayoutInflater layoutInflater=LayoutInflater.from(context);View view=layoutInflater.inflate(R.layout.dialog_info, null);builder.setView(view);TextView tvIdiomInfo=(TextView) view.findViewById(R.id.tvIdiomInfo);	tvIdiomInfo.setText(result);builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {			public void onClick(DialogInterface dialog, int which) {// TODO Auto-generated method stubdialog.dismiss();}});builder.create().show();}}
  15.animal_layout_listview.xml

<?xml version="1.0" encoding="utf-8"?>
<layoutAnimation xmlns:android="http://schemas.android.com/apk/res/android"android:animation="@anim/anim_listview"android:animationOrder="random"android:delay="0.2">
</layoutAnimation>
  16.animal_listview.xml

<?xml version="1.0" encoding="utf-8"?>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"android:duration="1000" android:fromAlpha="0.0"android:toAlpha="1.0">   
</alpha>
  17.activity_animal.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent"android:background="@drawable/bg_animal"android:orientation="vertical" ><ListView android:id="@+id/lvAnimalList"android:layout_width="match_parent"android:layout_height="wrap_content"android:layoutAnimation="@anim/anim_layout_listview"android:listSelector="#00000000"></ListView>    </LinearLayout>
  18.activity_main.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"tools:context=".MainActivity" ><TabHostandroid:id="@android:id/tabhost"android:layout_width="match_parent"android:layout_height="match_parent"android:layout_alignParentLeft="true"android:layout_alignParentTop="true"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"><TabWidgetandroid:id="@android:id/tabs"android:layout_width="match_parent"android:layout_height="wrap_content" ></TabWidget><FrameLayout android:id="@android:id/tabcontent"android:layout_width="match_parent"android:layout_height="match_parent"><LinearLayout android:id="@+id/tab1"android:orientation="vertical"android:layout_width="match_parent"android:layout_height="match_parent"></LinearLayout><LinearLayout android:id="@+id/tab2"android:orientation="vertical"android:layout_width="match_parent"android:layout_height="match_parent"></LinearLayout><LinearLayout android:id="@+id/tab3"android:orientation="vertical"android:layout_width="match_parent"android:layout_height="match_parent"></LinearLayout></FrameLayout></LinearLayout>  </TabHost>
</RelativeLayout>
  19.activity_study.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"android:background="@drawable/bg_ling"tools:context=".StudyActivity" ><ListViewandroid:id="@+id/lvCategories"android:layout_width="match_parent"android:layout_height="wrap_content"android:listSelector="#00000000"android:layoutAnimation="@anim/anim_layout_listview"android:layout_alignParentLeft="true"android:layout_alignParentTop="true" ></ListView></RelativeLayout>
  20.animal_item.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent" android:padding="10dp"><TextView android:id="@+id/tvName"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_alignParentLeft="true"android:layout_alignParentTop="true"android:gravity="center"android:text="助人为乐"android:textAppearance="?android:attr/textAppearanceLarge"/><ImageButtonandroid:id="@+id/btnSave"android:layout_width="wrap_content"android:layout_height="wrap_content"android:background="@null"android:layout_alignParentRight="true"android:layout_alignTop="@+id/tvName"android:src="@drawable/btnsave"/>   
</RelativeLayout>
  21.category_item.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent"android:padding="10dp"android:orientation="horizontal" ><ImageView android:id="@+id/category_image"android:layout_width="wrap_content"android:layout_height="wrap_content"   android:src="@drawable/category_animal"/><TextView android:id="@+id/category_name"android:layout_width="wrap_content"android:text="@string/animal"android:layout_height="wrap_content"android:gravity="center"android:textAppearance="?android:attr/textAppearanceLarge"/>
</LinearLayout>
  22.dialog_info.xml

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent" ><LinearLayoutandroid:layout_width="match_parent"android:layout_height="match_parent"android:background="@drawable/bg_ling"android:orientation="vertical" ><TextViewandroid:id="@+id/tvIdiomInfo"android:layout_width="match_parent"android:layout_height="wrap_content"android:text="Medium Text"android:textAppearance="?android:attr/textAppearanceMedium" /></LinearLayout></ScrollView>
  23.strings.xml

<?xml version="1.0" encoding="utf-8"?>
<resources><string name="app_name">happyidiom</string><string name="action_settings">Settings</string><string name="title_study">学习</string><string name="title_search">搜搜</string><string name="title_game">游戏</string><string name="title_save">收藏</string><string name="title_help">帮助</string><string name="animal">动物类</string><string-array name="category"><item>动物类</item><item>自然类</item><item>人物类</item><item>季节类</item><item>数字类</item><item>寓言类</item><item>其它类</item></string-array><string name="title_activity_study_animal">StudyAnimalActivity</string><string name="hello_world">Hello world!</string><string name="title_activity_study">StudyActivity</string><string name="title_activity_main">MainActivity</string></resources>
  24.AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"package="cn.edu.bztc.happyidiom"android:versionCode="1"android:versionName="1.0" ><uses-sdkandroid:minSdkVersion="14"android:targetSdkVersion="17" /><applicationandroid:allowBackup="true"android:icon="@drawable/logo"android:label="@string/app_name"android:theme="@android:style/Theme.NoTitleBar" ><uses-library android:name="android.test.runner" /> <activityandroid:name="cn.edu.bztc.happyidiom.activity.MainActivity"android:label="@string/title_activity_main"><intent-filter>              <action android:name="android.intent.action.MAIN" />               <category android:name="android.intent.category.LAUNCHER" /> </intent-filter></activity><activityandroid:name="cn.edu.bztc.happyidiom.activity.StudyActivity"android:label="@string/title_activity_study" ></activity><activityandroid:name="cn.edu.bztc.happyidiom.activity.StudyAnimalActivity"android:label="@string/title_activity_study_animal" ></activity> </application><instrumentationandroid:name="android.test.InstrumentationTestRunner"android:targetPackage="cn.edu.bztc.happyidiom" ></instrumentation>
</manifest>

























这篇关于乐学成语——完整实现的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/842646

相关文章

大模型研发全揭秘:客服工单数据标注的完整攻略

在人工智能(AI)领域,数据标注是模型训练过程中至关重要的一步。无论你是新手还是有经验的从业者,掌握数据标注的技术细节和常见问题的解决方案都能为你的AI项目增添不少价值。在电信运营商的客服系统中,工单数据是客户问题和解决方案的重要记录。通过对这些工单数据进行有效标注,不仅能够帮助提升客服自动化系统的智能化水平,还能优化客户服务流程,提高客户满意度。本文将详细介绍如何在电信运营商客服工单的背景下进行

hdu1043(八数码问题,广搜 + hash(实现状态压缩) )

利用康拓展开将一个排列映射成一个自然数,然后就变成了普通的广搜题。 #include<iostream>#include<algorithm>#include<string>#include<stack>#include<queue>#include<map>#include<stdio.h>#include<stdlib.h>#include<ctype.h>#inclu

【C++】_list常用方法解析及模拟实现

相信自己的力量,只要对自己始终保持信心,尽自己最大努力去完成任何事,就算事情最终结果是失败了,努力了也不留遗憾。💓💓💓 目录   ✨说在前面 🍋知识点一:什么是list? •🌰1.list的定义 •🌰2.list的基本特性 •🌰3.常用接口介绍 🍋知识点二:list常用接口 •🌰1.默认成员函数 🔥构造函数(⭐) 🔥析构函数 •🌰2.list对象

【Prometheus】PromQL向量匹配实现不同标签的向量数据进行运算

✨✨ 欢迎大家来到景天科技苑✨✨ 🎈🎈 养成好习惯,先赞后看哦~🎈🎈 🏆 作者简介:景天科技苑 🏆《头衔》:大厂架构师,华为云开发者社区专家博主,阿里云开发者社区专家博主,CSDN全栈领域优质创作者,掘金优秀博主,51CTO博客专家等。 🏆《博客》:Python全栈,前后端开发,小程序开发,人工智能,js逆向,App逆向,网络系统安全,数据分析,Django,fastapi

让树莓派智能语音助手实现定时提醒功能

最初的时候是想直接在rasa 的chatbot上实现,因为rasa本身是带有remindschedule模块的。不过经过一番折腾后,忽然发现,chatbot上实现的定时,语音助手不一定会有响应。因为,我目前语音助手的代码设置了长时间无应答会结束对话,这样一来,chatbot定时提醒的触发就不会被语音助手获悉。那怎么让语音助手也具有定时提醒功能呢? 我最后选择的方法是用threading.Time

Android实现任意版本设置默认的锁屏壁纸和桌面壁纸(两张壁纸可不一致)

客户有些需求需要设置默认壁纸和锁屏壁纸  在默认情况下 这两个壁纸是相同的  如果需要默认的锁屏壁纸和桌面壁纸不一样 需要额外修改 Android13实现 替换默认桌面壁纸: 将图片文件替换frameworks/base/core/res/res/drawable-nodpi/default_wallpaper.*  (注意不能是bmp格式) 替换默认锁屏壁纸: 将图片资源放入vendo

C#实战|大乐透选号器[6]:实现实时显示已选择的红蓝球数量

哈喽,你好啊,我是雷工。 关于大乐透选号器在前面已经记录了5篇笔记,这是第6篇; 接下来实现实时显示当前选中红球数量,蓝球数量; 以下为练习笔记。 01 效果演示 当选择和取消选择红球或蓝球时,在对应的位置显示实时已选择的红球、蓝球的数量; 02 标签名称 分别设置Label标签名称为:lblRedCount、lblBlueCount

Kubernetes PodSecurityPolicy:PSP能实现的5种主要安全策略

Kubernetes PodSecurityPolicy:PSP能实现的5种主要安全策略 1. 特权模式限制2. 宿主机资源隔离3. 用户和组管理4. 权限提升控制5. SELinux配置 💖The Begin💖点点关注,收藏不迷路💖 Kubernetes的PodSecurityPolicy(PSP)是一个关键的安全特性,它在Pod创建之前实施安全策略,确保P

工厂ERP管理系统实现源码(JAVA)

工厂进销存管理系统是一个集采购管理、仓库管理、生产管理和销售管理于一体的综合解决方案。该系统旨在帮助企业优化流程、提高效率、降低成本,并实时掌握各环节的运营状况。 在采购管理方面,系统能够处理采购订单、供应商管理和采购入库等流程,确保采购过程的透明和高效。仓库管理方面,实现库存的精准管理,包括入库、出库、盘点等操作,确保库存数据的准确性和实时性。 生产管理模块则涵盖了生产计划制定、物料需求计划、

C++——stack、queue的实现及deque的介绍

目录 1.stack与queue的实现 1.1stack的实现  1.2 queue的实现 2.重温vector、list、stack、queue的介绍 2.1 STL标准库中stack和queue的底层结构  3.deque的简单介绍 3.1为什么选择deque作为stack和queue的底层默认容器  3.2 STL中对stack与queue的模拟实现 ①stack模拟实现