android小项目之新闻客户端四

2023-10-31



基于Android小巫新闻客户端开发---显示新闻详细内容UI设计

   2013年2月27日,天气潮湿!!!

   距上一次写的主界面业务逻辑实现,已经过来11天,小巫觉得拖得太久了,所以决定尽量把所有的内容介绍完,好完成这个任务,因为小巫已经开学了,将会有更加重的任务等着。在发表前面几章博客之前,小巫已经把项目源代码共享了,这里稍微提一下关于这个项目的部署的问题吧,因为可能在你们的机器上难免会出点问题,小巫之前把整个软件测试调通也花了不少时间,主要是服务端的问题,跟数据库的连接可能会出错,因为在我的机器上安装的MySQL所建立的用户和密码可能不一样,需要在服务端,修改一下连接数据库的配置文件。

这里可能要修改的地方有:端口号、用户名、密码,这需要根据各位童鞋自己配置MySQL的时候为准。

还有一点,是关于编码的问题:这个web项目所使用的编码格式是utf-8,因为MyEclipse默认的编码格式是GBK,这就需要到【Window】->【Preference】->【General】->【Workspace】然后修改encoding为utf-8,这样程序就不会出现乱码问题了。这要MyEclipse配好服务器,把项目部署到Tomcat中,我想应该没问题了。如果出现问题的话,小巫也无法一下子回答,那就要靠你们自己寻找原因吧。

那好回到博客正题!!!---显示新闻详细内容UI界面的设计

效果如下:

  

因为在动手开发小巫新闻客户端是打算为小巫所在的学校开发一个新闻客户端,专门用来显示我们学校的新闻,后来发现实现起来意义不大,后来改了名字,以小巫命名这个新闻客户端,所以这里显示为华广新闻,希望不要介意。

要实现整个界面效果需要3个xml文件:

1.newsdetail_layout.xml,

2.newsbody_layout.xml,

3.news_reply_frame_layout.xml

具体实现需要看看代码:

/newsdetail_layout.xml

  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <!-- 最外层界面布局是RelativeLayout -->  
  3. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"  
  4.     android:id="@id/newsdetail_layout"  
  5.     android:layout_width="match_parent"  
  6.     android:layout_height="match_parent"  
  7.     android:background="@drawable/main_background"  
  8.      >  
  9.      <!--  
  10.             标题栏用RelativeLayout,包含一个向前查看按钮、向后查看按钮  
  11.             一个TextView, 一个跟帖按钮  
  12.     -->  
  13.     <RelativeLayout   
  14.         android:id="@id/newsdetail_titlebar_layout"  
  15.         android:layout_width="match_parent"  
  16.         android:layout_height="wrap_content"  
  17.         android:background="@drawable/image_titlebar_background"  
  18.         >  
  19.         <Button   
  20.             android:id="@id/newsdetail_titlebar_previous"  
  21.             android:layout_width="wrap_content"  
  22.             android:layout_height="wrap_content"  
  23.             android:layout_alignParentLeft="true"  
  24.             android:layout_marginTop="7.0dip"  
  25.             android:layout_marginLeft="5.0dip"  
  26.             android:background="@drawable/newsdetail_titlebar_btn_privious_selector"  
  27.             />  
  28.         <Button  
  29.             android:id="@id/newsdetail_titlebar_next"  
  30.             android:layout_width="wrap_content"  
  31.             android:layout_height="wrap_content"  
  32.             android:layout_alignParentRight="true"  
  33.             android:layout_marginRight="5.0dip"  
  34.             android:layout_marginTop="7.0dip"  
  35.             android:background="@drawable/newsdetail_titlebar_btn_next_selector"  
  36.             />  
  37.         <Button  
  38.             android:id="@id/newsdetail_titlebar_comments"  
  39.             android:layout_width="wrap_content"  
  40.             android:layout_height="wrap_content"  
  41.             android:layout_alignParentRight="true"  
  42.             android:layout_marginRight="50.0dip"  
  43.             android:layout_marginTop="10.0dip"  
  44.             android:text="0跟帖"  
  45.             android:textColor="@color/white"  
  46.             android:background="@drawable/newsdetail_titlebar_btn_comments_selector" />  
  47.         <TextView  
  48.             android:id="@id/newsdetail_titlebar_title"  
  49.             android:layout_width="wrap_content"  
  50.             android:layout_height="wrap_content"  
  51.             android:layout_alignBaseline="@id/newsdetail_titlebar_previous"  
  52.             android:layout_marginLeft="20dip"  
  53.             android:layout_toRightOf="@id/newsdetail_titlebar_previous"  
  54.             android:text="校内"  
  55.             android:textColor="@color/white"  
  56.             android:textSize="18.0sp" />  
  57.      </RelativeLayout>  
  58.       <!-- 用于翻页的的ViewFlipper -->  
  59.       <ViewFlipper  
  60.         android:id="@id/news_body_flipper"  
  61.         android:layout_width="match_parent"  
  62.         android:layout_height="match_parent"  
  63.         android:layout_below="@id/newsdetail_titlebar_layout"  
  64.         android:layout_marginBottom="40.0dip" >  
  65.     </ViewFlipper>  
  66.   
  67.     <include  
  68.         android:id="@id/comment_reply_frame"  
  69.         android:layout_width="match_parent"  
  70.         android:layout_height="wrap_content"  
  71.         android:layout_alignParentBottom="true"  
  72.         layout="@layout/news_reply_frame_layout" />  
  73.   
  74. </RelativeLayout>  
<?xml version="1.0" encoding="utf-8"?>
<!-- 最外层界面布局是RelativeLayout -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@id/newsdetail_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/main_background"
     >
     <!--
         	标题栏用RelativeLayout,包含一个向前查看按钮、向后查看按钮
		 	一个TextView, 一个跟帖按钮
    -->
    <RelativeLayout 
        android:id="@id/newsdetail_titlebar_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/image_titlebar_background"
        >
        <Button 
            android:id="@id/newsdetail_titlebar_previous"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_marginTop="7.0dip"
            android:layout_marginLeft="5.0dip"
            android:background="@drawable/newsdetail_titlebar_btn_privious_selector"
            />
        <Button
            android:id="@id/newsdetail_titlebar_next"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_marginRight="5.0dip"
            android:layout_marginTop="7.0dip"
            android:background="@drawable/newsdetail_titlebar_btn_next_selector"
            />
        <Button
            android:id="@id/newsdetail_titlebar_comments"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_marginRight="50.0dip"
            android:layout_marginTop="10.0dip"
            android:text="0跟帖"
            android:textColor="@color/white"
            android:background="@drawable/newsdetail_titlebar_btn_comments_selector" />
        <TextView
            android:id="@id/newsdetail_titlebar_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBaseline="@id/newsdetail_titlebar_previous"
            android:layout_marginLeft="20dip"
            android:layout_toRightOf="@id/newsdetail_titlebar_previous"
            android:text="校内"
            android:textColor="@color/white"
            android:textSize="18.0sp" />
     </RelativeLayout>
	  <!-- 用于翻页的的ViewFlipper -->
	  <ViewFlipper
        android:id="@id/news_body_flipper"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@id/newsdetail_titlebar_layout"
        android:layout_marginBottom="40.0dip" >
    </ViewFlipper>

    <include
        android:id="@id/comment_reply_frame"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        layout="@layout/news_reply_frame_layout" />

</RelativeLayout>

这个布局文件用到了<include>标签,它的作用是将另一个布局文件包含进来,这样可以实现代码的复用,因为下面的回复栏,在查看评论的界面也需要用到。这是这段代码需要注意的地方,其他的就不多说了。


/newsbody_layout.xml

  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
  3.     xmlns:wwj="http://schemas.android.com/apk/res/com.xiaowu.news"  
  4.     android:id="@id/news_body_layout"  
  5.     android:layout_width="match_parent"  
  6.     android:layout_height="match_parent"  
  7.     android:orientation="vertical" >  
  8.     <!-- android:fadingEdge="none"的作用解析  
  9.         设置拉滚动条时 ,边框渐变的放向。none(边框颜色不变)  
  10.         ,horizontal(水平方向颜色变淡),vertical(垂直方向颜色变淡) -->  
  11.     <ScrollView   
  12.         android:id="@id/news_body_scrollview"  
  13.         android:layout_width="match_parent"  
  14.         android:layout_height="match_parent"  
  15.         android:background="#FFE7E7E7"  
  16.         android:fadingEdge="none"  
  17.         >  
  18.         <LinearLayout   
  19.             android:layout_width="match_parent"  
  20.             android:layout_height="wrap_content"  
  21.             android:orientation="vertical"  
  22.             >  
  23.               
  24.             <LinearLayout  
  25.                 android:layout_width="match_parent"  
  26.                 android:layout_height="wrap_content"  
  27.                 android:orientation="vertical"  
  28.                 >  
  29.                 <TextView   
  30.                     android:id="@id/news_body_title"  
  31.                     android:layout_width="match_parent"  
  32.                     android:layout_height="wrap_content"  
  33.                     android:layout_marginLeft="12.0dip"  
  34.                     android:layout_marginTop="12.0dip"  
  35.                     android:textColor="#FF272727"  
  36.                     android:textSize="18.0sp"  
  37.                     android:textStyle="bold"  
  38.                     />  
  39.                 <TextView   
  40.                     android:id="@id/news_body_ptime_source"  
  41.                     android:layout_width="match_parent"  
  42.                     android:layout_height="wrap_content"  
  43.                     android:layout_marginLeft="12.0dip"  
  44.                     android:layout_marginRight="12.0dip"  
  45.                     android:layout_marginTop="9.0dip"  
  46.                     android:textColor="#FF888888"  
  47.                     android:textSize="12.0sp"  
  48.                     />  
  49.                 <ImageView  
  50.                     android:layout_width="match_parent"  
  51.                     android:layout_height="wrap_content"  
  52.                     android:layout_marginTop="8.0dip"  
  53.                     android:src="@drawable/image_widget_hot_list_separator_line"   
  54.                     />  
  55.                 <ProgressBar   
  56.                     android:id="@id/news_body_detail_loding"  
  57.                     style="?android:attr/progressBarStyleLarge"  
  58.                     android:layout_width="16.0dip"  
  59.                     android:layout_height="16.0dip"  
  60.                     android:layout_marginLeft="152.0dip"  
  61.                     android:layout_marginTop="10.0dip"  
  62.                     android:clickable="false"  
  63.                     android:visibility="gone"  
  64.                     />  
  65.   
  66.             </LinearLayout>  
  67.             <com.xiaowu.news.ConstomTextView  
  68.                 android:id="@id/news_body_details"  
  69.                 android:layout_width="match_parent"  
  70.                 android:layout_height="wrap_content"  
  71.                 android:layout_marginTop="5.0dip"  
  72.                 android:textColor="#ff000000"   
  73.                 wwj:image_width="200dip"  
  74.                 wwj:image_height="52dip"/>  
  75.   
  76.         </LinearLayout>  
  77.           
  78.     </ScrollView>  
  79.   
  80. </LinearLayout>  
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:wwj="http://schemas.android.com/apk/res/com.xiaowu.news"
    android:id="@id/news_body_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >
    <!-- android:fadingEdge="none"的作用解析
    	设置拉滚动条时 ,边框渐变的放向。none(边框颜色不变)
    	,horizontal(水平方向颜色变淡),vertical(垂直方向颜色变淡) -->
    <ScrollView 
        android:id="@id/news_body_scrollview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#FFE7E7E7"
        android:fadingEdge="none"
        >
        <LinearLayout 
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            >
            
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                >
                <TextView 
                    android:id="@id/news_body_title"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="12.0dip"
                    android:layout_marginTop="12.0dip"
                    android:textColor="#FF272727"
                    android:textSize="18.0sp"
                    android:textStyle="bold"
                    />
                <TextView 
                    android:id="@id/news_body_ptime_source"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="12.0dip"
                    android:layout_marginRight="12.0dip"
                    android:layout_marginTop="9.0dip"
                    android:textColor="#FF888888"
                    android:textSize="12.0sp"
                    />
                <ImageView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="8.0dip"
                    android:src="@drawable/image_widget_hot_list_separator_line" 
                    />
                <ProgressBar 
                    android:id="@id/news_body_detail_loding"
                    style="?android:attr/progressBarStyleLarge"
                    android:layout_width="16.0dip"
                    android:layout_height="16.0dip"
                    android:layout_marginLeft="152.0dip"
                    android:layout_marginTop="10.0dip"
                    android:clickable="false"
                    android:visibility="gone"
                    />

            </LinearLayout>
            <com.xiaowu.news.ConstomTextView
                android:id="@id/news_body_details"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="5.0dip"
                android:textColor="#ff000000" 
                wwj:image_width="200dip"
                wwj:image_height="52dip"/>

        </LinearLayout>
        
    </ScrollView>

</LinearLayout>

这段代码只有一个需要特别注意的,因为这是在这个项目后期才添加上的内容:自定义TextView和异步更新加载图片,这跟之前有所差别,因为这里包含了一个自定义的组件,ConstomTextView,上面代码已经写的很清楚了。如果有点不明白的话,来看小巫之前所发表的一篇文章,希望有所帮助:http://blog.csdn.net/wwj_748/article/details/8195975

/news_reply_frame_layout.xml

  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
  3.     android:id="@id/news_reply_layout"  
  4.     android:layout_width="match_parent"  
  5.     android:layout_height="wrap_content"  
  6.     android:layout_gravity="bottom"  
  7.     android:background="@drawable/image_toolbar_background"  
  8.     android:orientation="horizontal"  
  9.     android:visibility="visible"   
  10.      >  
  11.     <LinearLayout   
  12.         android:id="@id/news_reply_edit_layout"  
  13.         android:layout_width="match_parent"  
  14.         android:layout_height="wrap_content"  
  15.         android:layout_gravity="center"  
  16.         android:orientation="horizontal"  
  17.         android:visibility="gone"  
  18.         >  
  19.         <EditText  
  20.             android:id="@id/news_reply_edittext"  
  21.             android:layout_width="260.0dip"  
  22.             android:layout_height="wrap_content"  
  23.             android:layout_marginTop="2.0dip"  
  24.             android:hint="@string/et_reply"  
  25.             android:maxLength="500" />  
  26.   
  27.         <Button  
  28.             android:id="@id/news_reply_post"  
  29.             android:layout_width="58.0dip"  
  30.             android:layout_height="42.0dip"  
  31.             android:text="@string/reply_post"   
  32.             android:textColor="@color/white"  
  33.             android:background="@drawable/btn_send_reply_selector"/>  
  34.     </LinearLayout>  
  35.     <LinearLayout  
  36.         android:id="@id/news_reply_img_layout"  
  37.         android:layout_width="wrap_content"  
  38.         android:layout_height="wrap_content"  
  39.         android:layout_marginLeft="5.0dip"  
  40.         android:layout_marginTop="3.0dip"  
  41.         android:gravity="center"  
  42.         android:orientation="horizontal"   
  43.         android:visibility="visible">  
  44.   
  45.         <ImageButton  
  46.             android:id="@id/news_reply_img_btn"  
  47.             android:layout_width="wrap_content"  
  48.             android:layout_height="wrap_content"  
  49.             android:layout_marginLeft="20.0dip"  
  50.             android:layout_weight="1.60"  
  51.             android:background="#00000000"  
  52.             android:src="@drawable/news_reply_img_btn_background" />  
  53.         <ImageButton  
  54.             android:id="@id/news_share_btn"  
  55.             android:layout_width="wrap_content"  
  56.             android:layout_height="wrap_content"  
  57.             android:layout_marginLeft="10.0dip"  
  58.             android:background="#00000000"  
  59.             android:src="@drawable/newsdetail_toolbar_btn_share_selector" />  
  60.         <ImageButton  
  61.             android:id="@id/news_favorites_btn"  
  62.             android:layout_width="wrap_content"  
  63.             android:layout_height="wrap_content"  
  64.             android:layout_marginLeft="10.0dip"  
  65.             android:background="#00000000"  
  66.             android:src="@drawable/newsdetail_toolbar_favorites_selector" />  
  67.     </LinearLayout>  
  68. </LinearLayout>  
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@id/news_reply_layout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom"
    android:background="@drawable/image_toolbar_background"
    android:orientation="horizontal"
    android:visibility="visible" 
     >
    <LinearLayout 
        android:id="@id/news_reply_edit_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:orientation="horizontal"
        android:visibility="gone"
        >
        <EditText
            android:id="@id/news_reply_edittext"
            android:layout_width="260.0dip"
            android:layout_height="wrap_content"
            android:layout_marginTop="2.0dip"
            android:hint="@string/et_reply"
            android:maxLength="500" />

        <Button
            android:id="@id/news_reply_post"
            android:layout_width="58.0dip"
            android:layout_height="42.0dip"
            android:text="@string/reply_post" 
            android:textColor="@color/white"
            android:background="@drawable/btn_send_reply_selector"/>
    </LinearLayout>
	<LinearLayout
        android:id="@id/news_reply_img_layout"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="5.0dip"
        android:layout_marginTop="3.0dip"
        android:gravity="center"
        android:orientation="horizontal" 
        android:visibility="visible">

        <ImageButton
            android:id="@id/news_reply_img_btn"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="20.0dip"
            android:layout_weight="1.60"
            android:background="#00000000"
            android:src="@drawable/news_reply_img_btn_background" />
        <ImageButton
            android:id="@id/news_share_btn"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10.0dip"
            android:background="#00000000"
            android:src="@drawable/newsdetail_toolbar_btn_share_selector" />
        <ImageButton
            android:id="@id/news_favorites_btn"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10.0dip"
            android:background="#00000000"
            android:src="@drawable/newsdetail_toolbar_favorites_selector" />
    </LinearLayout>
</LinearLayout>


这个布局,没有什么难点,在这里小巫也不过多浪费口舌。

总之一句,试过就知道了,如果觉得整个项目有难度,并不适合初学者,各位童鞋可以择重学习。


本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

android小项目之新闻客户端四 的相关文章

随机推荐

  • Vue + Element UI+Scss + Vuex一键换肤 , 一键换字体大小 ,动态替换全局主题颜色

    一 前言 其实我这个写法每个UI库都通用 不局限于ElementUI 看明白思路就知道怎么写了 一键换肤 动态替换全局主题颜色功能已经实现很久了 在项目验收的时候出现了一个小问题 想改动一下 于是来记录一下 前段时间公司项目里需要实现一键换
  • get 和 post 的区别

    使用场景 GET请求一般用于向服务器请求数据 POST请求一般用于向服务器提交数据 请求参数的位置 GET请求通常将参数放在URL的 query 中 POST 请求通常会将数据放在请求体 body 中 GET请求通常将参数放在URL的 qu
  • unity 2D中,实现点击按钮可以游戏暂停的效果

    在Unity 2D中 可以通过以下步骤和代码来设置一个按钮 实现游戏暂停的效果 创建一个空对象 命名为 GameManager 用于管理游戏状态 在GameManager对象上添加一个脚本 命名为 PauseManager 在脚本中添加以下
  • 简述“自顶向下,逐步求精”——面向过程程序设计方法

    引入 所谓 自顶向下 逐步求精 的程序设计方法 网络上有着如下的说法 一者是百度百科所述 另一者则为维基百科的说法 自顶向下设计 一种逐步求精的设计程序的过程和方法 对要完成的任务进行分解 先对最高层次中的问题进行定义 设计 编程和测试 而
  • C# 联合Halcon开发的完整项目案例(三套完整源码)附下载连接

    C 联合Halcon开发的完整项目案例 三套完整源码 点我下载三套项目源码 1 C 联合Halcon开发的程序 一整套源码 相机点胶定位 图像采集 数据查询相机间通讯具体情况如下图所示 案例注释详细 方便二次开发 2 C Halcon Vi
  • 从零开发校园商铺平台(SSM到SpringBoot)一.开发准备,实体类设计与表创建

    依山傍水房树间 行也安然 住也安然 一条耕牛半顷田 收也凭天 荒也凭天 雨过天晴驾小船 鱼在一边 酒在一边 夜晚妻子话灯前 今也谈谈 古也谈谈 日上三竿犹在眠 不是神仙 胜似神仙 一 开发准备 创建maven项目 解决项目报错 新增pom
  • Chrome插件(扩展)开发全攻略

    目录 写在前面 仓库说明 前言 什么是Chrome插件 学习Chrome插件开发有什么意义 为什么是Chrome插件而不是Firefox插件 开发与调试 核心介绍 manifest json content scripts backgrou
  • qRegisterMetaType

    如果要在Qt信号槽中使用自定义类型 需要注意使用qRegisterMetaType对自定义类型进行注册 当然在不跨线程时使用自定义类型signal slot来传递 可能不会出现什么问题 一旦涉及跨线程就很容易出错 回想下信号槽的作用就是用来
  • 机器学习——朴素贝叶斯分类器及sklearn实现

    前言 参考 机器学习 简单介绍朴素贝叶斯分类器 机器学习专栏 机器学习专栏 文章目录 一 贝叶斯定理 二 贝叶斯分类法 三 sklearn实现贝叶斯分类 一 贝叶斯定理 贝叶斯定理 Bayes theorem 是概率论中的一个定理 描述在已
  • Metasploit search参数

    msfvenom 参数 q快速启动msf 不显示banner信息 x加载模块代码 p payload lt payload gt 指定需要使用的payload 攻击荷载 也可以使用自定义payload 几乎是支持全平台的 l list mo
  • ThinkPHP3.2.3关闭调试模式及做些修改

    1 首先在入口文件中关闭调试模式 开启调试模式 建议开发阶段开启True 部署阶段注释或者设为false define APP DEBUG false 2 修改 Conf config php 异常页面的模板文件 TMPL EXCEPTIO
  • Cookie与Session深入理解(一)——Cookie

    基本操作 HttpServletRequest request HttpServletResponse response 1 获取cookies Cookie cookieList request getCookies 2 根据cookie
  • 力扣312题:戳气球

    力扣312题 戳气球 题目描述 有 n 个气球 编号为0 到 n 1 每个气球上都标有一个数字 这些数字存在数组 nums 中 现在要求你戳破所有的气球 戳破第 i 个气球 你可以获得 nums i 1 nums i nums i 1 枚硬
  • 机器学习深度学习数据集大汇总

    寻找一个好用的数据集需要注意一下几点 数据集不混乱 否则要花费大量时间来清理数据 数据集不应包含太多行或列 否则会难以使用 数据越干净越好 清理大型数据集可能非常耗时 应该预设一个有趣的问题 而这个问题又可以用数据来回答 数据集发布平台 A
  • linux安装pycharm详细步骤

    一 用xftp远程根据把解压后的安装包文件上传到指定目录 opt module 然后 cd opt module pycharm community linux 2018 1 4 bin 执行以代码 chmod u x pycharm sh
  • C++小游戏---坦克大战(二)(加入传送门)--附完整代码

    目录 素材整理 穿越草地 坦克穿越草地 子弹穿越草地 传送门 判定形式 生成传送门 传送坦克 关卡模式 效果展示 总结 完整代码 上一篇坦克大战居然意外获得了一些关注 正好最近也完善了一些功能 同时也加入了一些自己想到的新元素 主要是关于穿
  • 基于Matlab实现图像去噪技术(附上完整源码+图像+程序运行说明)

    图像去噪是数字图像处理中一个重要的问题 它的目标是恢复由于噪声引起的图像质量下降 噪声可以由各种原因引起 如图像传感器的不完美性能 图像传输过程中的干扰等 在实际应用中 图像去噪技术被广泛应用于医学图像处理 计算机视觉 图像识别等领域 本文
  • vim

    three basic mode of vim command mode also is default mode all the alphanumeric keys are bound to commands Typing dd will
  • 【数据库】封锁技术

    一 前言 数据库的并发操作通常会带来三个问题 丢失更新 读脏数据 不可重复读 解决这些问题就需要用到数据库的封锁机制进行控制 但封锁机制的引入又引起了一系列问题 性能下降 死锁等 1 丢失更新 一个事务的更新覆盖了其他事务的更新结果 例如用
  • android小项目之新闻客户端四

    基于Android小巫新闻客户端开发 显示新闻详细内容UI设计 2013年2月27日 天气潮湿 距上一次写的主界面业务逻辑实现 已经过来11天 小巫觉得拖得太久了 所以决定尽量把所有的内容介绍完 好完成这个任务 因为小巫已经开学了 将会有更