精华内容
下载资源
问答
  • 韩美林“七”教学法 韩美林教学生学书法,只用七个:选、拓、临、仿、脱、变、飞。...这像火车道口道岔子,之差,相距千里。 拓:就是描红。不过,大人描红是双勾方法,这主要学习书法中...

    韩美林的“七字”教学法

          韩美林教学生学书法,只用七个字:选、拓、临、仿、脱、变、飞。后来也用在学画和做人上。

          选:就是选择,选志向、选专业、选字帖、选老师......这是一个做人、做学问、起步定向的十字路口......在十字路口上,启蒙老师很重要。这像火车道口的道岔子,一毫之差,相距千里。

          拓:就是描红。不过,大人的描红是双勾的方法,这主要学习书法中的运笔、间架、结体和章法。它像记日记一样,记录你每天看到的新形式、新风格、新形象。

          仿:不看贴,背着写,还要背的像“老师”。这是把拐棍开始扔掉的一个环节。

          脱:这是质变的前兆。在临习了大量的法帖之后,还必须“脱壳”,“写出自己”来。

          变:丑小鸭变成白天鹅。在艺术上变的同时,人品也经历着一个大变动,就像宇宙飞船经过大气层,经得住、熬过来,就完全超越,成一个栋梁之材,熬不住,就完全可能用这一技之长变成个江湖骗子和社交界的明星。

          飞:到了下笔如有神的境界,一是指艺术上到了随心所欲的自由阶段,有自己的立意、笔墨、技法、章法和题材。所谓“逸品”“神品”就是这个阶段的产物。另一方面,飞,也就是超脱,思想境界的超脱,无视那些世俗、名利,除还食人间烟火外,他进入了另一个精神境界。++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    转载于:https://www.cnblogs.com/ysx4221/p/3528105.html

    展开全文
  • 安妮日记读书心得6006篇 想一想,被困在灰暗、狭窄小屋里,看不到光明、呼吸不到新鲜空气,你会以什么样态度来对待呢?能做到安妮那样吗? 这里给大家分享一些关于安妮日记读后感,希望对大家有所帮助。 安妮...
  • 很多时候学习一门语言最有成就感事就是利用它做出自己想要东西,包括小编也不例外,加入 Python 技术作者团队也有大半年久了,今天突发奇想做了个数码管式时间轴,以此来怀念我和Python技术团队奋斗时光...

    很多时候学习一门语言最有成就感的事就是利用它做出自己想要的东西,包括小编也不例外,加入 Python 技术作者团队也有大半年之久了,今天突发奇想做了一个数码管式的时间轴,以此来怀念我和Python技术团队奋斗的时光。废话不多说,直接讲思路上代码,Let’s go go go!

    绘制数码管

    其实平时我们在一些 LED 灯上看到的数字都是由一条条数码管组成的,最常见的是红绿灯数字,首先咱们先将单个数码管绘制出来,代码如下:

    def drawGap(): #绘制数码管间隔
        #提起画笔
        tl.pu()
        # 数码管间隔
        tl.fd(9)
    
    def drawLine(draw):   #绘制单段数码管
        drawGap()
        tl.pendown() \
            if draw else tl.penup()
        tl.fd(40)
        # 开始绘画
        drawGap()
        tl.right(90)

    当然以上代码不会出任何结果,就像我们要画画拿出一张白纸是一样的道理。 接下来我们需要构思 0-9 的数码管要怎么形成?大家一起来想想(想想红绿灯的数字跳转是怎么形成的)…… 其实红绿灯的数字就是由数码管来显示的,数字 8 将数码管全部填满,它由 7 小段数码管构成,其它数字做相应数码管的加减;首先我们需要先绘制7 条数码管,思路清晰后我们需要打草稿上代码,部分代码如下:

    drawLine(True) if d in [2, 3, 4, 5, 6, 8, 9] else drawLine(False)
        drawLine(True) if d in [0, 1, 3, 4, 5, 6, 7, 8, 9] else drawLine(False)
        drawLine(True) if d in [0, 2, 3, 5, 6, 8, 9] else drawLine(False)
        drawLine(True) if d in [0, 2, 6, 8] else drawLine(False)
        tl.left(90)
        #
        drawLine(True) if d in [0, 4, 5, 6, 8, 9] else drawLine(False)
        drawLine(True) if d in [0, 2, 3, 5, 6, 7, 8, 9] else drawLine(False)
        drawLine(True) if d in [0, 1, 2, 3, 4, 7, 8, 9] else drawLine(False)
        tl.left(200)
        tl.penup()
        tl.fd(20)

    调用代码:

    if __name__ == '__main__':
        drawDigit(8)

    显示结果:

    绘制日期数码管

    接下来就要结合时间绘制日期数码管,给绘制的日期设置颜色和字体大小,部分代码如下:

    def drawDate(date):
        tl.pencolor("#AB82FF")
        for i in date: #根据设置的符号分隔年月日
            if i == '-':
                tl.write('年',font=("Arial", 22, "normal"))
                tl.pencolor("#B3EE3A")
                tl.fd(40)
            elif i == '=':
                tl.write('月',font=("Arial", 22, "normal"))
                tl.pencolor("#FFD700")
                tl.fd(40)
            elif i == '+':
                tl.write('日',font=("Arial", 22, "normal"))
            else:
                drawDigit(eval(i))

    计算总天数

    想达到的效果是,输入开始日期和当前日期后自动计算历经天数,经历总天数统计代码如下:

    def all(day):
        tl.goto(-350,-300)
        tl.pencolor("SlateBlue")
        tl.write('总共',font=("Arial", 40, "normal"))
        tl.fd(110)
        for j in day:
            drawDigit(eval(j))
        tl.write('天',font=("Arial", 40, "normal"))
    
    def count(t1, t2, t3):
        t = t1*365
        if t2 in [1, 2]:
            t += t2*30
        if t2 in [3]:
            t = t+91
        if t2 == 4:
            t += 122
        if t2 == 5:
            t += 152
        if t2 == 6:
            t += 183
        if t2 == 7:
            t += 213
        if t2 == 8:
            t += 244
        if t2 == 9:
            t += 275
        if t2 == 10:
            t += 303
        if t2 == 11:
            t += 334
        t += t3
        return(str(t))

    画出当前日期和加入团队日期

    调用方法绘制出当前日期以及加入团队的日期,当前日期使用的是time 模块动态获取现在的日期,代码如下:

    def turtle_date():
        tl.color('MediumTurquoise')
        tl.penup()
        tl.goto(-350,370)
        tl.pendown()
        # 获取到当前日期
        tl.write('今天是:',font=("Arial", 22, "normal"))
        tl.pensize(5)
        tl.penup()
        tl.goto(-350,300)
        tl.pendown()
        drawDate(time.strftime('%Y-%m=%d+',time.gmtime()))
        tl.color('MediumTurquoise')
        tl.penup()
        tl.goto(-350,190)
        tl.pensize(1)
        tl.pendown()
        tl.pencolor("MediumTurquoise")
        tl.write('我加入 Python 团队的时间是:',font=("Arial", 22, "normal"))
        tl.penup()
        tl.goto(-350,110)
        tl.pendown()
        tl.pensize(5)
        # 加入团队的时间
        drawDate('2019-09=03+')
        tl.penup()
        tl.goto(-350,0)
        tl.pensize(1)
        tl.pendown()
        tl.pencolor("MediumTurquoise")
        # 从加入日期到当前日期的月和天数
        tl.write('我和团队成员一起经历了:',font=("Arial", 22, "normal"))
        tl.penup()
        tl.goto(0,-100)
        tl.pensize(1)
        tl.pendown()

    运行结果如下:

    计算时间差

    计算当前时间和加入团队的时间差,部分逻辑代码如下:

    t1 = time.gmtime()
        t2 = t1.tm_year-2019
        t3 = t1.tm_mon-9
        if t3<0:
            t2 -= 1
            t3 += 12
        t4 = t1.tm_mday-3
        if t4 < 0:
            t3 -= 1
            if t1.tm_mon-1 in [1, 3, 5, 7, 8, 10, 12]:
                t4 += 31
            else:
                t4+=30

    最终结果

    最终的纪念日期已经展示,大家可以根据自己的兴趣爱好学习,修行看个人噢!

    爱 Python

    最后我用 Python 给咱们团队实现了一个大大的爱心,希望大家继续努力!

    实现代码如下:

    def love_python():
        word = "Python技术"
        for char in word.split():
            allChar = []
            for y in range(12, -12, -1):
                lst = []
                lst_con = ''
                for x in range(-30, 30):
                    # 心型函数实现
                    formula = ((x * 0.05) ** 2 + (y * 0.1) ** 2 - 1) ** 3 - (x * 0.05) ** 2 * (y * 0.1) ** 3
                    if formula <= 0:
                        lst_con += char[(x) % len(char)]
                    else:
                        lst_con += ' '
                lst.append(lst_con)
                allChar += lst
            print('\n'.join(allChar))
    
    if __name__ == '__main__':
    
        love_python()

    实现效果如下:

    总结

    今天的文章主要运用了turtle 绘图工具实现日期差来纪念一些重要的时日,同时运用了一个心形函数来绘制了一个爱心表白团队成员,因为他们真的很优秀,希望今天能给大家安利到有用的知识!

    展开全文
  • 如果统筹考虑下,现在赚钱还差之千里,而你账户上明明有一笔资金在未来几年内暂无大用外,你会用来做什么?如果你这样问张先生,他会毫不犹豫地告诉你:“买缴费期短、操作灵活寿险产品。”这就是一个家庭年...
    来源: 深圳商报
      
    在深圳,多少年收入可以算作是中产?这是个没有定论的数字,但所有中等收入家庭的财务需求大体是一致的,基本包括购房费用、子女教育费用、养老费用、医疗费用四大类。如果统筹考虑之下,现在赚的钱还差之千里,而你的账户上明明有一笔资金在未来几年内暂无大用外,你会用来做什么?

    如果你这样问张先生,他会毫不犹豫地告诉你:“买缴费期短、操作灵活的寿险产品。”这就是一个家庭年收入40万元、任职于一家高科技企业中层主管、有房有车的中年深圳白领的理财观。
    [B]
    中年“心经”:稳健理财,安全第一[/B]

    张先生有一套自己的理财观念,他称自己是理财保守主义者。因为家庭主要经济来源于固定的薪水,虽然收入稳定,但短期内大幅升高的可能性并不大,所以任何投资上的意外损失都可能造成未来财务的困境。所以,张先生最看重资产的保值增值。

    一般的理财师只会告诉你这种产品的潜能是什么,他不会告诉你“应该买还是不该买”,这是应该由客户自己决定的。目前虽然张先生收支情况良好,基本属于中高档收入阶层人士。但也要看到,现在并非张先生家庭的支付高峰期,目前宽裕的收支情况需要为未来进入支付高峰积蓄资金,而只靠社会统筹的社保与医保,是难以保障一二十年后的子女教育、住院、养老等大额支出。虽然张先生已购住房,但还贷的压力已经使家庭日常可支配资金下降,这都使得张先生在未来可能面临一定的支付风险。

    如今,给家庭做个统筹的寿险规划已不再是少数人的想法。人寿保险可以满足配偶、子女或年老父母未来的生活需要,抵御意外风险的同时,还表达了我们对家人的责任和关怀。然而,购买多少保险才算足够?这很难一概而论。一般来说,家庭寿险规划的“双十定律”得到较为普遍的认可,即“保险额度为家庭年收入十倍,总保支出为家庭年收入10%”最为适宜。而对于高收入和高负债人群,可以以家庭年开销与该人士投资的理财产品的预期回报率的比率来计算。假设一位年开销为10万元的人,理财预期回报率为4%,则他需要的年保额为250万元左右,同时还要根据保险的种类去具体计算。
    [B]
    操作“宝典”:保障组合,增值投资[/B]

    参加工作12年间,现年35岁的张先生家庭账户上累积有近50万元人民币存款。然而就保险而言,人的一生需要七张保单才算完整,即意外险、大病医疗、养老保险、子女的教育及意外保单、避税保单。这样算来,目前张先生的存款做完保单也就做不了别的了。这不仅是张先生一家的困惑。目前国内有千余种人寿保险产品,但人们仍然很难选择出最适合自己的险种。

    专家建议张先生购买20万元保额、三年期交的国寿鸿鑫两全保险;每年8400元保费、20年期交国寿康宁终身保险(重大疾病);再加每年270元保费的附加住院医疗保险。这款保障组合兼顾了家庭理财和健康保障两大需求,保障充分,而且三年以后几乎没有交费的压力,却能享受终身保障。

    国寿鸿鑫两全保险可以为张先生带来40万元的生命保障,每三年1.8万元生存金返还,每年的派发红利,以及80周岁时30万元的养老保障。而三年缴费期正好与张先生工作合同期相吻合。在这段劳动关系相对稳定的期间,张先生通过快速缴清保费的方式解决现有资金的投资问题,避免了未来不可预测的收入波动。

    现阶段我国医疗费用不断上升,如果出现意外,患了重大疾病,则需要一次性支出较多的医疗费用。逐渐步入中年的张先生,不得不开始考虑自己的健康问题,在资金相对宽裕的时期,购买重大疾病保险和健康险势在必行,可以解除后顾之忧。张先生的保障组合中,含有10项重大疾病保障20万元,住院医疗1万元,基本上解决了家庭医疗开支的压力。

    [B]大势“掌法”:远瞻后市,信心保证[/B]

    年初的一项调查显示,国内20家合资寿险公司CEO中有50%最看好投资型产品,其次是分红型产品和保障型产品,各占27%和23%。

    而且与传统寿险产品不同,分红寿险产品在利率上升、保险公司经营成本下降、死亡率下降时,投保人都可以获得分红。

    因此,分红产品可以让投保人在某种程度上规避利率上升的风险。去年人民币升息给理财市场带来不小的波动,分红产品的这种优势凸显。

    再加上今年以来,保险公司获准将外汇存入境外银行或者投资境外债券,保险资金也可以直接进入股市,投资渠道的拓宽,使得保险资金在收益增长获得更大的想象空间。

    一个个利好,显然给了张先生这样的投保人以足够的信心。
    展开全文
  • 说到折线图曲线图,我马上就想到了GitHub上MPAndroidChart,扩展功能强大,本来想用,不过我转念想,就个年度账单,自己写不是几百行代码就搞定了?于是我开始了。先看一下设计图 思考 先考虑需要几种画笔...

    前言

    一说到折线图曲线图,我马上就想到了GitHub上的MPAndroidChart,扩展功能强大,本来想用,不过我转念一想,就一个年度账单,自己写不是几百行代码就搞定了?于是我开始了。先看一下设计图
    在这里插入图片描述

    思考

    • 先考虑需要几种画笔Paint:曲线、字体、网格、背景色、详情背景色
    • 再考虑几个重要的变量:折线单位高度差、横向和纵向Item的高宽度、当年的最高用量、当年的最低用量
    • 需要确定的数据源:当前年份的水表数据集合
    • 需要计算每个月点的坐标位置集合List<PointF>
    • 横向可滑动、选中的点pointFSelected以及点击范围的判定,在每个月峰值某个范围内允许点击。

    必须先了解的知识点

    • Canvas坐标系与绘图坐标系:简单点说Canvas坐标系唯一不变,平常我们使用绘图坐标系(例如canvas的drawLine)。
    • Canvas的save和restore方法:了解了绘图坐标系,应该很好了解,比如我先sava一下(保存当前矩阵),然后调用canvas的旋转,然后使用Paint去绘制,绘制完了,调用restore回到之前没有旋转的画板继续画。
    • VelocityTracker:速度追踪器,主要用跟踪触摸屏事件(flinging事件和其他gestures手势事件)的速率。
    • ViewConfiguration:包含用于UI的标准常量的方法,用于超时,大小和距离。用来判断是否是抛动。
    • Paint使用PathEffect画出虚线
    //两个值分别为循环的实线长度、空白长度
    float[] f = {dp2pxF(5f,context), dp2pxF(2f,context)};
    PathEffect pathEffect = new DashPathEffect(f, 0);
    paint.setPathEffect(pathEffect);
    
    /**
     * dp转pxF
     */
    public static float dp2pxF(float dpValue,Context context) {
        return  TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dpValue, context.getResources().getDisplayMetrics());
    }
    
    • 画渐变背景:通过设置画笔来实现。
    /**
    * 渐变背景画笔
    */
    private Paint backGroundPaint;
    backGroundPaint=new Paint(Paint.ANTI_ALIAS_FLAG);
    //设置抗锯齿
    backGroundPaint.setAntiAlias(true);
    //为Paint设置渐变
    LinearGradient linearGradient=new LinearGradient(pointFMaxCurve.x,pointFMaxCurve.y,pointFList.get(0).x,viewHeight-itemWidth,new int[]{
                    0xFFE1F1FF,0xFFEFF7FF,0xFFFAFCFF},
                    null, Shader.TileMode.CLAMP);
    backGroundPaint.setShader(linearGradient);
    
    • text宽度的自适应:因为数据变化大,所以详情框坐标确认就需要获取text的宽度。思路是这样子:数据都是空字符串时背景框的宽度加上获取text的宽度就是上图用量读数弹框的宽度了。
    /**
         * 精确计算文字宽度
         *
         * @param paint
         * @param str
         * @return 文字长度,像素
         */
        public static int getTextWidth(Paint paint, String str) {
            int iRet = 0;
            if (str != null && str.length() > 0) {
                int len = str.length();
                float[] widths = new float[len];
                paint.getTextWidths(str, widths);
                for (int j = 0; j < len; j++) {
                    iRet += (int) Math.ceil(widths[j]);
                }
            }
            return iRet;
        }
    
    • Path常用Api:如cubicTo画三次贝塞尔曲线、reset清除当前路径、moveTo移动到某个坐标但是移动过程没有痕迹。

    动手

    1. 先定义常量
     /**
         * 折线画笔
         */
        private Paint brokenLinePaint;
    
        /**
         * 坐标画笔
         */
        private Paint coordinatePaint;
    
        /**
         * 圆点画笔
         */
        private Paint circlePaint;
    
        /**
         * 文字画笔(x、y轴)
         */
        private Paint textPaint;
    
        /**
         * 文字画笔(水表详情)
         */
        private Paint textPaintDetail;
    
        /**
         * 渐变背景画笔
         */
        private Paint backGroundPaint;
    
        /**
         * 详情背景画笔
         */
        private Paint backGroundDetailPaint;
    
        /**
         * 背景颜色
         */
        private int backGroundColor= Color.WHITE;
    
        /**
         * 文字画笔颜色
         * 默认:黑色
         */
        private int colorTextPaint= Color.BLACK;
    
        /**
         * 折现画笔颜色
         * 默认:蓝色 0xFF1281FD
         */
        private int  colorBrokenLinePaint=0xFF1281FD;
    
        /**
         * 坐标画笔颜色
         * 默认 灰色 0xFFEEEEEE
         */
        private int colorCoordinatePaint=0xFFEEEEEE;
    
        /**
         * 详情文字背景颜色
         */
        private int colorDetailTextBg=0x66000000;
    
        /**
         * 文字大小
         * 默认11sp
         */
        private float textSize;
    
        /**
         * 水表详情文字大小
         * 默认10sp
         */
        private float textSizeDetail;
    
        /**
         * 单位高度差
         * 默认:itemWidth/unitYItem
         */
        private float unitVerticalGap;
    
        /**
         *  itemWidth对应的用水量(吨)
         */
        private int unitYItem;
    
        /**
         * Y方向有数据的Item个数
         * 默认4个
         */
        private static final int itemYSize=4;
    
        /**
         * 折线图左和下的间距,同横纵单位间隔
         * 默认:42dp
         */
        private int defaultPadding;
        private int itemWidth;
    
        /**
         * 控件期望高度
         * 默认为8个itemWidth
         */
        private int expectViewHeight;
    
        /**
         * 折线点的半径(默认2.5dp的像素)
         */
        private float pointRadius;
    
        private int viewWidth;
        private int viewHeight;
        private int screenWidth;
        private int screenHeight;
    
        /**
         * 曲线路径
         */
        private Path curvePath;
    
        /**
         * 水表详情背景路径
         */
        private Path WaterDetailBgPath;
    
        /**
         * 水表详情背景图范围
         */
        private RectF rectF;
    
        /**
         * 最多用量
         */
        private float maxDosage;
    
        /**
         * 最少用量
         */
        private float minDosage;
    
        /**
         * 数据列表data
         */
        private List<WaterAndElectricMeterDetail> list=new ArrayList<>();
    
        /**
         * 每个月的坐标点集
         */
        private List<PointF> pointFList=new ArrayList<>();
    
        /**
         * 选中的那个点
         */
        private PointF pointFSelected=null;
    
        /**
         * 速度追踪器
         */
        private VelocityTracker velocityTracker;
    
        /**
         * 关于UI的标准常量
         */
        private ViewConfiguration viewConfiguration;
    
        /**
         * Scroller
         */
        private Scroller scroller;
    
    1. 重写View的构造方法,使其最终指向带有3个参数的构造方法
    this(context,null);
    this(context, attrs,0);
    super(context, attrs, defStyleAttr);
    
    1. 构造方法内初始化数据,此步代码略
    2. 重写onMeasure方法,确定宽高,因为高度一开始就是固定的,有需求的小伙伴可以在方法内确定高度。
    3. 重写onDraw方法
        @Override
        protected void onDraw(Canvas canvas) {
            super.onDraw(canvas);
            //画渐变蓝色背景
            drawBackBlue(canvas);
            //画坐标
            drawAxis(canvas);
            //画曲线
            drawCurve(canvas);
            //画小圆点和虚线
            drawPointsAndLine(canvas);
            //画水表详情框
            drawWaterDetailsText(canvas);
        }
    
    1. 写一个公开方法,用于设置元数据
     /**
         * 公开方法,用于设置元数据
         */
        public void setData(List<WaterAndElectricMeterDetail> data) {
            if (data == null) {
                return;
            }
            //数据清理
            list.clear();
            pointFList.clear();
            pointFSelected=null;
    
            this.list = data;
            //计算单位高度差
            calculateGap();
            //获取数据点集
            initPointFData();
            invalidate();
        }
    

    附上GitHub上Demo地址:https://github.com/PengHaiZhuo/MyMiUiWeatherDemo

    后话

    因需求简单,所以很多变量值都写死了,有兴趣的朋友可以自行修改或者通过定义自定义属性来优化。

    非常感谢这个博主分享,提供了思路,参考:https://blog.csdn.net/ccy0122/article/details/76464825

    展开全文
  • 买卖股票最坏时机

    2019-11-16 16:45:41
    给定个数组,它的第i 个元素是支给定股票第 i ...动态规划用来求:某个数组减去它右边的数字得到的个数对之差,求所有数对之差的最大值。 示例1: {2,4,1,16,7,5,11,9} 数对之差最大值为11,是16减去5的结果...
  • 位家长给出了自家孩子一道“1年级数学题”,问题非常简单,就只有5个,问你“4等于多少?”大伙看了题干之后,都觉得这里面要么是等差或者等比数列相关玄机?纷纷揣测其中数学规律,甚至还动笔运算?...
  • 有关于借条格式及范本 借条日常生活中人们都免不了会向别人借钱或别人向你借钱,这时最好就要写...如将买写成卖,将收写成付,虽一字之差,却颠倒是非。如以下借条:“王某借柳某现金50000元,现还欠款5000元”...
  • Ubuntu

    2011-01-08 23:12:00
    次用Ubuntu是有次组织ACM比赛,我们称为 有土闭。后两个,有很差 劲,或者运气很差的意思。李同学起的。 不过,真是容易使用。Sheldon也认为这是最好的操作系统。 插话。李记者啊,我们的代沟解除...
  • 疯狂程序员

    热门讨论 2012-07-18 18:05:32
    比我差的都去了那学校。 王江:我老爸没问题。但我就是这么个人,不轻易去找他的。 土匪:那你这辈子就给毁了。 王江:明天就去办退学。 土匪:你去退,我跟你一起去退。 …… 两人谈得热血沸腾,仿佛他们老爸个...
  • 未梦想奋斗

    2016-03-09 11:15:09
    “放弃”二15笔, “坚持”二16笔, 放弃和坚持就在一笔之差! 差之毫厘,失之千里。 无论你睡多晚, 总有人比你更晚。 无论你起多早, 总有人比你更早。 无论你多努力, 总有人比你更努力。 不管你有...
  • 你活泼可爱,纯真大方,一笔工整清秀的字常常博得老师的赞赏。一个学期来,你一直在不断地进步着,但又一直未能达到老师的目标,别泄气,别松劲,仍需保持足够的信心,多一分勤苦,多一分专注,相信在新的学期里?..
  • 有四分之一的学生学习有自觉性,上课认真听讲,能有感情朗读课文,作业认真完成,书写漂亮规范,喜欢读书,自觉地阅读课外书籍,有五分之一学生,学习主动性较一些,作业要靠督促完成,书写不够规范,不过...
  • 有四分之一的学生学习有自觉性,上课认真听讲,能有感情朗读课文,作业认真完成,书写漂亮规范,喜欢读书,自觉地阅读课外书籍,有五分之一学生,学习主动性较一些,作业要靠督促完成,书写不够规范,不过...
  • 五年级学生学期操行评语 操行评语是一... 你活泼可爱,纯真大方,一笔工整清秀的字常常博得老师的赞赏。一个学期来,你一直在不断地进步着,但又一直未能达到老师的目标,别泄气,别松劲,仍需保持足够的信心,多一?..
  • 醉过方知酒浓,当置身于那幅幅优秀书法作品中,才知道书法爱好者如痴如醉地“求工于一笔之内,寄情于点画之间”那种情结为何! 书法是一门艺术,现在真正欣赏书法还只在书法界搞书法创作专业书法家和书法...
  • 如将买写成卖,将收写成付,虽一字之差,却颠倒是非。如以下借条:“王某借柳某现金50000元,现还欠款5000元”。这里“还”因有两个读音,既可理解为归还,又可解释为尚欠,就十分不规范。 法官审案时,一般按...
  • 2.1.14 SUMXMY2——计算数组对应值之差的平方和 62 2.1.15 SUMX2MY2——计算数组对应值的平方差之和 63 2.1.16 SUMX2PY2——计算数组对应值的平方和之和 63 2.1.17 SERIESSUM——计算基于公式的幂级数之和 64 ...
  • 是,Linux 上有公认 C 语言世界最好编译器 gcc,如果你想得到个效率更高开 发环境(并不一定是最友好,但一定是最强大),我建议你一定要好好熟悉一下 Linux。 三.如何得到Linux? 据我所知...
  • flash shiti

    2014-03-14 10:32:41
    12. 如果导入是图像序列中的一个picture001.bmp 文件,并且序列中其他文件位于相同 文件夹中,则将被识别为图像序列将是下面哪些: □ A. picture001.bmp □ B. picture002.bmp □ C. picture003.bmp □ D. ...
  • Java范例开发大全 (源程序)

    热门讨论 2011-04-27 07:47:22
     实例21 求任意个正数阶乘 35  实例22 求nn次方 35  实例23 利用for循环输出几何图形 36  实例24 杨辉三角 38  3.3 while语句 39  实例25 求1到100之间和 39  实例26 存上100元需要多少天 40 ...
  • java范例开发大全源代码

    热门讨论 2011-10-30 23:31:51
     实例21 求任意个正数阶乘 35  实例22 求nn次方 35  实例23 利用for循环输出几何图形 36  实例24 杨辉三角 38  3.3 while语句 39  实例25 求1到100之间和 39  实例26 存上100元需要多少...
  • java范例开发大全

    2013-03-08 20:06:54
    实例21 求任意个正数阶乘 35 实例22 求nn次方 35 实例23 利用for循环输出几何图形 36 实例24 杨辉三角 38 3.3 while语句 39 实例25 求1到100之间和 39 实例26 存上100元需要多少天 40 实例27 输出100之间...
  • Java范例开发大全(全书源程序)

    热门讨论 2013-04-05 11:50:26
    实例21 求任意个正数阶乘 35 实例22 求nn次方 35 实例23 利用for循环输出几何图形 36 实例24 杨辉三角 38 3.3 while语句 39 实例25 求1到100之间和 39 实例26 存上100元需要多少天 40 实例27 输出...
  • php高级开发教程说明

    2008-11-27 11:39:22
    好的编码和差的编码之间究竟有何区别呢?实际上,这个问题很简单。好的代码(确实好 的代码)能够像本书一样被阅读。你能从任何地方读起,并且能够时刻意识到你所读的这些 行是干什么用的,它们在什么条件下执行,...
  • 电子设计.doc

    2019-05-28 11:58:28
    0083、种智能频率计设计与制作(AVR)proteus仿真+程序资料 0084、音频信号分析仪毕业设计论文资料 0085、应用电子、继电线路设计论文资料 0086、用单片机实现温度远程显示论文资料 0087、远程温度控制系统毕业...
  • 好心不当驴肝肺,不负有心人吧,公开分享论证也不失为正确整体提升自己各方面方法之一 但不要嫌麻烦,尤其是需花钱事上都得用心思考,急切赚他人小便宜,背后却有造成自己大钱财无可挽回损失,实在...
  • 会计理论考试题

    2012-03-07 21:04:40
    A、记录在存储介质上的一组相关信息集合 B、记录在磁盘上的一组相关信息集合 C、记录在磁盘上的一组相关程序集合 D、记录在存储介质上的一组相关程序集合 9.___B___是Windows管理文件特征,与MS-DOS目录...
  • NCStudio 5.4.49

    2015-09-12 20:53:33
    在系统参数厂商参数电机参数中,增加了Z轴最大速度参数设定 "单步"增加减速功能 在NCBoard中改进了暂停时抬刀(落刀)、以及微调算法 V5.4.17 改进了软限位算法,以前版本加减速不正确 V5.4.18 错误...
  • 本项目初衷之一是比对、共享各种文本纠错方法,抛砖引玉作用,如果对大家在文本纠错任务上有一点小小启发就是我莫大荣幸了。 主要使用了多种深度模型应用于文本纠错任务,分别是前面模型小节介绍conv_seq2...

空空如也

空空如也

1 2 3
收藏数 41
精华内容 16
关键字:

一笔之差的字