写在前面的话

从去年离职回家到现在也有一段时间了,曾经到昨天为止问过我有关这个问题的朋友有很多,索性今天写篇文档记录一下.省得下次还有朋友问题这样的问题.或者避免还有朋友可能会出现这样的问题.让朋友做到提前预防的目的.从而做到减少重要文件(数据)丢失的损失.现在就索性整理几篇文章来特别说明一下.下次碰到了就直接发链接就可以了.

特别说明

A.    下面的讨论的系统都是在windows系统上(XP和XP以上的系统)

B.     在没有特别的说明下只本文只讨论硬盘的问题和常规保养以及提前预防和备份数据

C.    不讨论在病毒或者木马或者安装了不兼容的软件(驱动).或者软件(驱动)冲突造成的情况下造成的一些怪异类似硬盘问题的问题.

D.    硬盘的日常保养说的是机械硬盘 (用SSD的土豪请饶开)

E.    电脑(计算机)是非常非常非常笨的一种电器


不废话先上干货


    1.先废话机械硬盘变拖慢电脑产生的原因之-----碎片产生来龙去脉(啰嗦的直接跳过)

应该用过电脑的朋友都会在抱怨说我的电脑用了一段时间越来越慢了.因为我身边就有好多朋友在抱怨这个问题.当然造成电脑运行慢的原因有非常多.但是在这里我只讨论和分析一下硬盘造成电脑运行慢的问题.

硬盘的主要功能就是保存数据(各种文件)的.文件有一个重要的指标就是size(大小).在这里我们先简单的啰嗦下.一块新硬盘电脑是无法使用的.要使用的话我们先要给这块新硬盘做两个操作:

a.     分区  

先我们把一块新硬盘看作是一张很大的白纸.分区就相当于要把这张白纸装订成多少个本子,每个本子的尺寸(大小,如 A4 A5 B5 A6 A3)也就是你看到 我的电脑(计算机) 里有多少个盘(如 C盘 D盘等), 每个盘的大小(如多少G).

b.  格式化  

一块新硬盘分区后还要做的一个动作就是格式化 格式化就是来把装订成的本子就成什么样的本子.如 横格 竖格 网格 格子 方格 田子等(win硬盘分区的格式有 FAT  EXFAT  FAT32  NTFS 常见的是 NTFS)

                   一块新硬盘做了上面两个动作后就可以用了.但是电脑是很笨的.如要是要格式化的时候你把设置的是格子本.这样的话分区所有的格子的大小是一样的(一个格子本的整本的格子大小是一样的).这样我们要向分区里写数据(文件)的话就像在格子本上写字一样.但是文件有大小的.要是文件巧合可以在一个格子里写完就只占一个格子的地方.但是非常多的情况是要几个甚至几十 几百或更多的格子去写(当然你要是用圆珠笔这样的笔在格子本上写,写完了这个本子只能看了,正常情况下是不能在写的了.这样的存储装置在电脑上叫只读存储ROM,这样的本子(存储)只能写一次可以读多次,但是我们的硬盘不是这样的,就好比是用铅笔在格子本上写字).要是有时你觉得有一段话(文件)没有用了,你就用橡皮擦擦了(把文件删除)请注意了,硬盘造成电脑慢的原因就要出来了.您在看看,电脑你保存文件电脑就在空白的格子上写数据,你删除文件电脑就在这个文件对应的格子上擦除这些格子就成空白的(目前就这么理解吧,其实擦除你也知道很费时间的,电脑再笨也不会这么干,这里非常重要涉及到后面的数据恢复)想想你要是在电脑上频繁的删除文件写文件.会造成什么可的情况呢.就是会如一个文件可能会保存在这个本子(分区)的不同是页码(区域)中.当你在去看(读)这个文件时就要来回翻好多好多遍.(机械硬盘的原理不多说,但是他在分区的不同区域去读数据比在一个本子上翻页找文字还要慢NN倍) 这样的话相信聪明的您就明白你的电脑为什么会在没有安装什么新的软件,而且没有中毒,也没有上什么不可描述的网站后还会变慢了吧.

 

机械硬盘的保养之-------碎片的优化

      在上面啰嗦了一大堆后.聪明的你也许就会想到要是能有一个工具可以定期去把分散的文件整理到一起就可以了.其实这样的工具MS早就提供了.在要整理的磁盘分区点 右键 à属性打属性对话框点开工具标签如下图:


然后点 优化(O) 按钮 打开 windows 磁盘整理工具如下图:

看到这里聪明的看官肯定就知道要整理那个分区, 就点先选那个分区选中他然后点 优化(O) 按钮

这里是MS给WIN系统自带的磁盘优化工具.但是个人推荐一个很优秀的工具(我从XP用到了WIN10).这个软件叫Smart Defrag,软件如下:

 

这个软件还可以设置成定时任务去自动整理您电脑上的碎片.


2.防患于未然之-------给硬盘做体检

       平均每年至少有5次有朋友问我硬盘的数据怎么恢复.自己也碰见过.曾经在公司工作,辛辛苦苦加班加点写了一周的源码.没有提交到SVN上,在一个周一的上午一开机硬盘给我来了个罢工.害得自己又加班加点去写编码.所以在自己和身边朋友的一次次的血的教训下(有几次朋友问题的是服务器的磁盘挂了如何恢复).把自己的经验记下来,希望能帮助到大家.

机械硬盘的理论寿命是3万小时以上,但是硬盘的容量越大寿命就越短,还就是PC硬盘的制作工艺和服务器的硬盘的制作工艺有很大的差别(毕竟价格就摆在那里相差这么大).  还有就是万一硬盘坏了.在质保期内厂家都是给你换新的.(不要觉得是件好事.有时候数据比硬盘要贵N次方,我曾经买了一个2T的移动硬盘,辛辛苦苦把自己的重要资料复制进去加上整理,一共花了几天几夜.结果两个多月坏了,我寄到售后去,结果那边二话不说给我邮一个新的回来.各位能想想我收到货的那时候的心情吗.幸好自己有重要数据保存多份的习惯).好了废话不多说了.先上图

当您看到上面三张图片的时个你就会建议我 把 一个300G的和一个500G的这两个硬盘的重要数据做备份了吧.应为这两次硬盘已经开始有严重的错误.天知道他什么时候来个罢工.

看到这里聪明的看倌朋友您应该知道了吧

 1.电脑的硬盘要定期做一下磁盘碎片整理

 2.重要的数据最好保存多份(鸡蛋不能放在同一个篮子里)

 3.定期用HDTune这样的软件来检查一下硬盘的健康度.在适当的情况下可以考虑淘汰问题严重的硬盘.

 4.最好不要用电脑的重启功能.如果要重启的话建议先关机,等电脑的电源彻底关闭后.停顿15到30秒左右在开机.


夜深了祝各位朋友晚安.还有下面两篇明天贴上

个人电脑数据的安全防护之------<可恶的坏道你给我滚>

个人电脑数据的安全防护之------<闲话数据恢复>


    孩子特喜欢跳舞,以前下的视频看了好次了.想换短一点的新一点的视频.做为一个10多年的码农.是不可能手动一个个文件去下载的.当然想要一个方便的方法去下载自己想要的视频了.所以就想到了python.因为python在这方面有天生的优势.好了废话不多说先上几张图片看看效果.

下面言归正传来谈谈具体的细节。

第一步 我们打开 https://www.toutiao.com/ 搜素关键词 如 儿童舞蹈 

第二步 打开  开发者工具  把搜索结果页面移动到 最下面 就会看到有 ?offset=20&format=json......这样的连接  如下图片

通过分析发现 这个连接是用来异步获取搜索结果的具体参数如说明如下:

            "offset": nPages,             #记录的开始数字 0开始  0 20 40 60 具体见 count 字段  默认是每页有20条记录但是每面多多少少有些广告

           "format": "json",             #返回的数据类型

           "keyword": serchStr,          #要搜索的关键词

           "autoload": "true",           #html网页获取记录后是否自动显示的页面里

           "count": "20",                #每次请求返回的记录大小(建议和前台的页面保持一致) 我设置其他的,他们的的服务器也只每次返回20条记录

           "cur_tab": "2",               #前面页面的标签(可以用2不用管他 和前台的页面保持一致)

           "from": "search_tab",         #提交搜索的前面页面的表单名(不用管他就用这个 也就是cur_tab 2)

           "callback": JSARRNAME         #Json数据返回后前台页面JS代码里数组的名字这个我改了一个 他的太长了点 看不习惯 @_@

          这个说明具体见 net\DownVideo.py里的 DownVideoMgr类的GetParas方法

然后在看一下这个连接返回的数据:

当时一看乐了,是mp4的地址,这不是非常非常简单吗.从网上用python下个文件就几行代码的事情.这样的话就非常快速的加上了下载文件的方法:

class VideoItem(object):
    #视频的标题
    title = ""
    #视频的URL  
    url   = "" 
    #初始化方法
    # _title 视频的标题
    # _url   视频的地址    
    def __init__(self, _title, _url):
        self.title = _title
        self.url = _url

class DownVideoMgr(object):
     #根据url保存文件
    #参数:
    #       url      mp4文件的URL 
    #       loactFile   本地保存的路径
    #返回值:
    #        True    下载成功
    #        False    下载失败
    def SaveUrl2File(self, url, loactFile):  
        bRet = True
        try:
            request = urllib2.Request(url, headers=headers)
            response = urllib2.urlopen(request) 
            data = response.read() 
            with open(loactFile, "wb") as code:   
                code.write(data) 
        except Exception as e:
            print e
            bRet = False
        return bRet

然后当时就想在写个写一个获取页面JSON返回的视频记录数据的方法然后就完成了.想到了就一鼓作气继续写了下面这几个方法:

   #获取打开页面的结果
    #参数:
    #       url  打开网页的地址 
    #返回值:
    #       成功 打开页面的结果
    #       失败 空字符串
    def GetWebRet(self, url):
        htmlStr = ""
        try:
            request = urllib2.Request(url, headers=headers)
            response = urllib2.urlopen(request)
            htmlStr = response.read()
        except Exception as e:
            print e
            bRet = False
            htmlStr = ""
        return htmlStr

    #获取搜索的结果
    #参数:
    #       seachKey  搜索的关键词 
    #       nPage     第几页
    #返回值:
    #       成功 搜索的JSON结果
    #       失败 空字符串
    def GetSeachRet(self, seachKey, nPage):        
        url = httpBase + self.GetParas(seachKey, nPage)
        jsonStr = self.GetWebRet(url)
        if (len(jsonStr) > 10):
            jsonStr = jsonStr[len(JSARRNAME) + 1:-1]
        return jsonStr

#根据KEY返回JSON对象的里值
    # jsObj json对象
    # key   json对象的key    
    #参数:
    #       jsObj json对象
    #       key   json对象的key
    #返回值:
    #       成功 要是KEY存在就返回对应的值
    #       失败 要是KEY不存在返回空字符串
    def GetJsonItemData(self, jsObj, key):
        if jsObj.has_key(key):
            return jsObj[key]
        return ''


    #根据JSON字符串获取视频记录信息
    #参数:
    #       jsonStr json字符串    
    #返回值:
    #       VideoItem  列表
    def GetVItem(self, jsonStr):
        jsObj = json.loads(jsonStr)
        itemsize = len(jsObj['data'])
        videoList = []
        for i in range(0, itemsize): 
            tmpJs = jsObj['data'][i]
            #.decode('raw_unicode-escape').encode('utf-8')
            title = u"" + self.GetJsonItemData(tmpJs, 'title')
            url = u"" +  self.GetJsonItemData(tmpJs, 'url')
            if url.find("wukong.com/question") > 0:
                url = ""

            if len(title) > 0 and len(url) > 0 :
                tItem = VideoItem(title, url)
                videoList.append(tItem);
        return videoList

    #获取搜索的结果
    #参数:
    #       seachKey  搜索的关键词 
    #       nStart    从第几条记录开始获取
    #返回值:
    #        VideoItem  列表  
    def GetVideoItem(self, seachKey, nStart):
        jsonStr = self.GetSeachRet(seachKey, nStart)
        return self.GetVItem(jsonStr)

写到这里心里想现在就差一个主方法了,然后开打电脑放这里让他自动下载.我可以关闭显示器睡觉去了.当时想想就心里乐开了.马上加了个非常简单的方法如:

    #根据VideoItem下载视频
    #参数:
    #       vItem    流媒体信息
    #       可以通过 GetVideoItem 方法获取
    #返回值:
    #        True    下载成功
    #        False    下载失败 
    def DownVideoItem(self, vItem):
        fileSavePaht = self.sBaseFilePath + vItem.title.encode("gbk") + ".mp4"
        if os.path.exists(fileSavePaht):
            if self.isFileOver:
                try:
                    os.remove(fileSavePaht)
                except Exception as e:
                    print e
                    return False
            else:
                return True 
        return self.SaveUrl2File(vItem.url, fileSavePaht) 

        
def Test(): 
    DowObj  = DownVideoMgr()    
    keyS = "儿童舞蹈教学"
    vArrList = []
    for i in range(0, 201, 20):
        vItem = DowObj.GetVideoItem(keyS, i) 
        for r in vItem :
            vArrList.append(r)  

    for r in vArrList :
        DowObj.DownVideoItem(r)

if __name__ == '__main__':
    Test()

写到这里然后高高兴兴的打开cmd 执行了 python xxxx.py  结果才发现是我高兴的太早了 以mp4结尾的文件有,但是更多的是流媒体格式的.

如:

title:"儿童舞蹈《爵士girl》"

url:"http://toutiao.com/group/6528510675289899527/"

然后打开下面这个url 一看视频是可以播放的.继续按F12 有video标签如 下图片:


里面有src属性,打开这个src属性一看是流媒体的地址,用这个地址可以用上面的SaveUrl2File 方法下载.一看又来劲了(当时的心情比吃NNN条 士**架 还有劲)

这样是不是打开 打开前面获取里的 http://toutiao.com/group/6528510675289899527/ 这个URL页面就可以获取到这个 video 标签里的属性吗? 不就是在加一个流程的事情吗,easy.

GetWebRet 这个方法上面早就写好了 我就直接用就可了.

然后写了个小测试程序如下:

dObj  = DownVideoMgr()
htmlStr = dObj.GetWebRet("http://toutiao.com/group/6528510675289899527/")
nStart = htmlStr.find("video")
print nStart

结果一运行 输出-1  我以为夜深了我眼睛太累了就搽了一下眼睛检查了几次代码在执行,结果死活还是-1.我想这不是我程序的问题吧.应该是那个页面的问题,这个video标签是JS动态生成的.然后就打开那个页面点右键查看源码.

果然是JS动态生成的.想算了.懒得分析JS了.但是又想一下前面写了这么多,费了这么多时间和精力现在放弃对不起孩子渴望看舞蹈视频的那种眼神.然后就继续分析这个页面和里面的JS代码加引用的JS文件.然后在眼睛上抹了几次的清凉油的结果下终于找到下面这一段JS,在http://s3.pstatp.com/tt_player/player/tt2-player.js这个脚本文件里(注JS给我格式化了.原页面里的JS压缩了没有换行):+

分析这段JS源码后加了下面几个方法和修改了部分方法

    #根据流媒体的网页地址获取流媒体的srcID
    #参数:
    #       url     流媒体的网页地址
    #返回值:
    #        True    返回流媒体的src
    #        False   返回空字符串
    def GetStreamingVideoID(self, url):
        htmlStr = self.GetWebRet(url)
        if len(htmlStr) < 5: -1=""> 0:
            nEnd = htmlStr.find(",", nStart) 

        if nEnd > 10: 
            strID = htmlStr[nStart+len(strFindSrart)+2 : nEnd-1]         
        
        return strID
        

    #获取随机数    
    #参数: 无 
    #返回值:
    #        随机数字符串
    def GetRandPara(self):
        randStr = bytes(random.random()) [2:]
        return randStr

    #获取CRC检验右移的值  
    #参数:
    #       val    右移的值 
    #        n     右移的值的位数
    #返回值:
    #         右移动的结果
    def GetCrcValue(self, val, n):
        return val >> n if val >= 0 else (val + 0x100000000) >> n

 
    #根据视频的ID获取真实播放地址的API地址
    #参数:
    #       vID        流媒体的ID 
    #       vID 可以通过 GetStreamingVideoID 这个方法获取
    #返回值:
    #        获取真实播放地址的API地址
    def GetStreamAPIUrl(self, vID):
        r = self.GetRandPara()   
        jsUrl = 'http://i.snssdk.com/video/urls/v/1/toutiao/mp4/%s' % vID 
        n = urlparse.urlparse(jsUrl).path + '?r=' + r 
        c = binascii.crc32(n)  
        s = self.GetCrcValue(c, 0)

        return jsUrl + '?r=' + r + '&s=' + bytes(s)

    # 获取真实播放地址的API获取真实的流媒体播放地址
    #参数:
    #       url        流媒体的获取API的地址
    #       url 可以通过 GetStreamAPIUrl 这个方法获取
    
    #返回值:
    #        True    流媒体真实地址
    #        False    空字符串
    def GetStreamSrc(self, url):
        vID = self.GetStreamingVideoID(url)
        src = self.GetStreamAPIUrl(vID)
        jsonStr = self.GetWebRet(src)
		
        vUrl = ""
        strFindSrart = "main_url" 
        nStart = jsonStr.find(strFindSrart) 

        nEnd = -1
        if nStart > 0:
            nEnd = jsonStr.find(",", nStart)

        if nEnd > 10: 
            vUrl = jsonStr[nStart+len(strFindSrart)+2 : nEnd-1]         
        
        videourl = base64.b64decode(vUrl)
        return videourl

    #根据流媒体的地址下载流媒体文件
    #参数:
    #       url        流媒体的Src地址
    #       file     本地保存的路径
    #返回值:
    #        True    下载成功
    #        False    下载失败 
    def DownStreamVideo(self, url, file):
        videoUrl = self.GetStreamSrc(url)
        return self.SaveUrl2File(videoUrl, file)

    #根据VideoItem下载视频
    #参数:
    #       vItem    流媒体信息
    #       可以通过 GetVideoItem 方法获取
    #返回值:
    #        True    下载成功
    #        False    下载失败 
    def DownVideoItem(self, vItem):
        fileSavePaht = self.sBaseFilePath + vItem.title.encode("gbk") + ".mp4"
        if os.path.exists(fileSavePaht):
            if self.isFileOver:
                try:
                    os.remove(fileSavePaht)
                except Exception as e:
                    print e
                    return False
            else:
                return True 

        if vItem.IsMp4(): 
            return self.SaveUrl2File(vItem.url, fileSavePaht)
        else: 
            return  self.DownStreamVideo(vItem.url, fileSavePaht)

到这步了 采集的功能基本上完成了,但是想到要是有个界面可以给我父母也可以找一些视频下载下来给我孩子看也是件美事(考虑到我这个民工不在家的时候,下载的视频孩子看厌烦了要换新的)

然后就用wx做了个简单的界面

就是上面的图片里的界面

详细源码见:  gitee

    

计算机历史博物馆将在 4 月 28 日授予 EPROM 发明者 Dov Frohman-Bentchkowsky,软件企业家 Dame Stephanie Shirley 以及 Python 语言作者 Guido van Rossum 会员奖(Fellow Award)。

Guido van Rossum 创建了 Python 语言并负责 Python 的开发进程。此外,他也在领导和管理 Python 社区。

计算机历史博物馆从 1987 年起每年颁发会员奖,授予其创意改变世界和影响今天所有人类的人。Rossum 创造的 Python 语言自 1991 年发布以来已演变为程序员强大而灵活且易于学习的“瑞士军刀”,被用于机器学习、金融、教育、视频游戏、科学技术、数学、物理和工程等领域。

作为语言作者,Rossum 本人有“仁慈独裁者”(Benevolent Dictator For Life-BDFL) 的称号。意思是他仍然关注 Python 的开发进程,并在必要的时刻做出决定。

参考:Solidot

文章来源:https://www.oschina.net/news/93674/guido-van-rossum-achieves-computerhistory-fellowawards



Kivy简介

Kivy 是一套 Python 下的跨平台快速应用开发框架,对于多点触控有着良好的支持。不用深入学习 Java 或 Object C 即可开发流行智能手机平台应用。

Kivy 依据允许商业使用 LGPLv3 协议发布,支持 Linux, Windows, MacOSX, Android 和 iOS 平台,原生支持各个平台的输入设备协议,包括多点触控;其图形核心围绕 OpenGL ES2 构建,可以充分利用目标平台的 GPU 加速。

当前最新版本是1.72.

官方网站:http://kivy.org/#home


安装测试

环境:Ubuntu 12.04 64bit 

1.下载源码包



下载好之后解压到 将压缩包解压到 /usr/local/lib 下面。


2.安装依赖

终端运行

sudo apt-get install python-setuptools python-pygame python-opengl \
python-gst0.10 python-enchant gstreamer0.10-plugins-good python-dev \
build-essential libgl1-mesa-dev libgles2-mesa-dev cython


3.安装&跑Demo

把解压后的文件夹名字改一下,直接

终端执行

cd /usr/local/lib/

sudo easy_install Kivy



在Kivy的examples中有很多的例子,例如:

3Drendering

python /3Drendering/main.py



Shader



最后来个HelloWorld: copy

  1. import kivy  

  2. kivy.require('1.4.1')  

  3.   

  4. from kivy.app import App   

  5. from kivy.uix.button import Button   

  6.   

  7. class HeiBoyApp(App):  

  8.     """docstring for MyApp"""  

  9.     def build(self):  

  10.         return Button(text='Hello World')  

  11.   

  12. if __name__ == '__main__':  

  13.     HeiBoyApp().run()  


运行:python test.py 


结果就是一个窗口里面有一个超级大的Button。





Android下跑kivy

可以看看Google play上kivy的demo:

Kivy Lanucher:https://play.google.com/store/apps/details?id=org.kivy.pygame

Kivy demos for Android下载后放到/sdcard/kivy文件夹中就可以运行了,效果还算不错。

下面来手动编译一下 python on Android 。

这里环境采用的是官网提供的virtual box的ubuntu的镜像,因为这个东西的编译环境配置起来实在是太太麻烦了。

在ubuntu中创建一个ubuntu的虚拟机然后将镜像加载进去就可以了。

下面开始编译。


0.更新cython

编译的时候需要将cython升级到最新版。

sudo pip install --upgrade cython


1.下载源码

git clone git://github.com/kivy/python-on-android


2.设置包package

终端cd到python-on-android中运行

./distribute.sh -m "kivy"

运行成功的话在dist文件夹下面会出现一个default文件夹,里面就是一个工程模板。


3.编译

编译单个应用:

终端cd到default文件夹中,执行:

./build.py --dir ~/code/kivy/examples/demo/touchtracer \
--package org.demo.touchtracer \
--name "Kivy Touchtracer" --version 1.1.0 debug 

编译一个launcher

lancher 会自动搜索sdcard/kivy目录下的工程,并给出工程列表,可以选择执行。

./build.py --launcher
--package org.demo.touchtracer \
--name "Kivy launcher" --version 1.1.0 debug 


编译好之后在bin文件夹下就会出现一个apk,放到手机中就可以安装了。



TIOBE Index for February 2018

February Headline: The last gasp attempt of Visual Basic to score?

If you look closely at this month's publication, Visual Basic.NET and classic Visual Basic are doing great. This is really surprising. About 2 years ago we stated in an interview about the TIOBE index that it was a matter of some years before Visual Basic would have disappeared. Visual Basic is considered the programming language for newbies in the field of programming and rapid prototyping. That's why it has a bad image among expert programmers. Despite all this, Visual Basic seems to survive. Last week Mads Torgersen of Microsoft announced that they will stop with the co-evolution strategy of C# and Visual Basic. This means that Visual Basic will fall behind if compared to new C# features. Let's see whether Visual Basic can take this new punch and keep on surviving.

IMPORTANT NOTE. SQL has been added again to the TIOBE index since February 2018. The reason for this is that SQL appears to be Turing complete. As a consequence, there is no recent history for the language and thus it might seem the SQL language is rising very fast. This is not the case.

The TIOBE Programming Community index is an indicator of the popularity of programming languages. The index is updated once a month. The ratings are based on the number of skilled engineers world-wide, courses and third party vendors. Popular search engines such as Google, Bing, Yahoo!, Wikipedia, Amazon, YouTube and Baidu are used to calculate the ratings. It is important to note that the TIOBE index is not about the best programming language or the language in which most lines of code have been written.

The index can be used to check whether your programming skills are still up to date or to make a strategic decision about what programming language should be adopted when starting to build a new software system. The definition of the TIOBE index can be found here.

Feb 2018Feb 2017ChangeProgramming LanguageRatingsChange
11
Java14.988%-1.69%
22
C11.857%+3.41%
33
C++5.726%+0.30%
45changePython5.168%+1.12%
54changeC#4.453%-0.45%
68changeVisual Basic .NET4.072%+1.25%
76changePHP3.420%+0.35%
87changeJavaScript3.165%+0.29%
99
Delphi/Object Pascal2.589%+0.11%
1011changeRuby2.534%+0.38%
11-changeSQL2.356%+2.36%
1216changeVisual Basic2.177%+0.30%
1315changeR2.086%+0.16%
1418changePL/SQL1.877%+0.33%
1513changeAssembly language1.833%-0.27%
1612changeSwift1.794%-0.33%
1710changePerl1.759%-0.41%
1814changeGo1.417%-0.69%
1917changeMATLAB1.228%-0.49%
2019changeObjective-C1.130%-0.41%


Ratings (%)JavaCC++PythonC#Visual Basic .NETPHPJavaScriptDelphi/Object PascalRuby200220042006200820102012201420162018051015202530Sunday, Apr 7, 2013 C++: 9.714%TIOBE Programming Community IndexSource: www.tiobe.com


Other programming languages

The complete top 50 of programming languages is listed below. This overview is published unofficially, because it could be the case that we missed a language. If you have the impression there is a programming language lacking, please notify us at tpci@tiobe.com. Please also check the overview of all programming languages that we monitor.

PositionProgramming LanguageRatings
21SAS1.112%
22Dart1.018%
23Scratch0.939%
24Logo0.786%
25Erlang0.739%
26LabVIEW0.715%
27Transact-SQL0.651%
28COBOL0.631%
29D0.532%
30ABAP0.532%
31Lua0.522%
32Scala0.506%
33Fortran0.483%
34Ada0.462%
35Scheme0.460%
36Lisp0.420%
37Prolog0.332%
38Apex0.316%
39Ladder Logic0.299%
40Bash0.295%
41OpenEdge ABL0.249%
42Clojure0.231%
43Haskell0.228%
44Kotlin0.202%
45Ring0.197%
46Rust0.196%
47F#0.194%
48Hack0.190%
49Groovy0.189%
50Julia0.189%

The Next 50 Programming Languages

The following list of languages denotes #51 to #100. Since the differences are relatively small, the programming languages are only listed (in alphabetical order).

  • (Visual) FoxPro, 4th Dimension/4D, ActionScript, Alice, Applescript, Arc, ATLAS, Awk, BBC BASIC, bc, Bourne shell, C shell, CL (OS/400), Common Lisp, Crystal, Elixir, Elm, Forth, Icon, Io, J, J#, Korn shell, LiveCode, Maple, ML, MOO, MQL4, NATURAL, NXT-G, OCaml, OpenCL, Oz, PL/I, PostScript, PowerShell, Programming Without Coding Technology, Pure Data, Q, Racket, REXX, RPG (OS/400), S, Simulink, SPARK, Stata, Tcl, VBScript, Verilog, VHDL



This Month's Changes in the Index

This month the following changes have been made to the definition of the index:

  • After some discussion with Eberhard Tscheuschner we had to admit that SQL is Turing complete because of its Common Table Expressions feature. In 2004 we decided the opposite, but now SQL is back and started at position 11.

  • Joek van Montfort suggested to add Snap! as a programming language to the TIOBE index. Snap! meets all requirements and has been added. It is currently at position 166.

  • Some people observed the unexpected rise of the programming language Crystal. Dominik Picheta sorted out why this happened: programming crystals is a popular occult hobby nowadays. We rechecked all Crystal programming pages and 39% of them turned out to be not related to the programming language. This has been adjusted in the definition. As a consequence Crystal dropped from position 62 to 91.

  • There are lots of mails that still need to be processed. As soon as there is more time available your mail will be answered. Please be patient.



Very Long Term History

To see the bigger picture, please find below the positions of the top 10 programming languages of many years back. Please note that these are averagepositions for a period of 12 months.

Programming Language2018201320082003199819931988
Java121118--
C2122111
C++3433225
Python476122616-
C#5579---
Visual Basic .NET613-----
JavaScript798721--
PHP8645---
Perl9854311-
Ruby1010919---
Objective-C1834547---
Ada28151714772
Lisp31121413643
Pascal13614199711313

Programming Language Hall of Fame

The hall of fame listing all "Programming Language of the Year" award winners is shown below. The award is given to the programming language that has the highest rise in ratings in a year. 

YearWinner
2017medal C
2016medal Go
2015medal Java
2014medal JavaScript
2013medal Transact-SQL
2012medal Objective-C
2011medal Objective-C
2010medal Python
2009medal Go
2008medal C
2007medal Python
2006medal Ruby
2005medal Java
2004medal PHP
2003medal C++



Bugs & Change Requests

This is the top 5 of most requested changes and bugs. If you have any suggestions how to improve the index don't hesitate to send an e-mail to tpci@tiobe.com.

  1. Apart from " programming", also other queries such as "programming with ", " development" and " coding" should be tried out.

  2. Add queries for other natural languages (apart from English). The idea is to start with the Chinese search engine Baidu. This has been implemented partially and will be completed the next few months.

  3. Add a list of all search term requests that have been rejected. This is to minimize the number of recurring mails about Rails, JQuery, JSP, etc.

  4. Start a TIOBE index for databases, software configuration management systems and application frameworks.

  5. Some search engines allow to query pages that have been added last year. The TIOBE index should only track those recently added pages.



Frequently Asked Questions (FAQ)

  • Q: Am I allowed to show the TIOBE index in my weblog/presentation/publication?

    A: Yes, the only condition is to refer to its original source "www.tiobe.com".

  • Q: How may I nominate a new language to be added to the TIOBE index?

    A: If a language meets the criteria of being listed (i.e. it is Turing complete and has an own Wikipedia entry that indicates that it concerns a programming language) and it is sufficiently popular (more than 5,000 hits for +" programming" for Google), then please write an e-mail to tpci@tiobe.com.

  • Q: I would like to have the complete data set of the TIOBE index. Is this possible?

    A: We spent a lot of effort to obtain all the data and keep the TIOBE index up to date. In order to compensate a bit for this, we ask a fee of 5,000 US$ for the complete data set. The data set runs from June 2001 till today. It started with 25 languages back in 2001, and now measures more than 150 languages once a month. The data are available in comma separated format. Please contact sales@tiobe.com for more information.

  • Q: Why is the maximum taken to calculate the ranking for a grouping, why not the sum?

    A: Well, you can do it either way and both are wrong. If you take the sum, then you get the intersection twice. If you take the max, then you miss the difference. Which one to choose? Suppose somebody comes up with a new search term that is 10% of the original. If you take the max, nothing changes. If you take the sum then the ratings will rise 10%. So taking the sum will be an incentive for some to come up with all kinds of obscure terms for a language. That's why we decided to take the max.

    The proper way to solve this is is of course to take the sum and subtract the intersection. This will give rise to an explosion of extra queries that must be performed. Suppose a language has a grouping of 15 terms, then you have to perform 32,768 queries (all combinations of intersections). So this seems not possible either... If somebody has a solution for this, please let us know.

  • Q: What happened to Java in April 2004? Did you change your methodology?

    A: No, we did not change our methodology at that time. Google changed its methodology. They performed a general sweep action to get rid of all kinds of web sites that had been pushed up. As a consequence, there was a huge drop for languages such as Java and C++. In order to minimize such fluctuations in the future, we added two more search engines (MSN and Yahoo) a few months after this incident.

  • Q: Why is YouTube used as a search engine for the TIOBE index?

    A: First of all, YouTube counts for less than 10% of all ratings, so it has hardly any influence on the index. YouTube has been added as an experiment. It qualified for the TIOBE index because of its high ranking on Alexa. YouTube is a young platform (so an indicator for popularity) and there are quite some lectures, presentations, programming tips and language introductions available on YouTube.