StackOverflow上的编程趋势

allowtransparency="true" frameborder="0" scrolling="no" src="http://hits.sinajs.cn/A1/weiboshare.html?url=http%3A%2F%2Fwww.csdn.net%2Farticle%2F2013-07-08%2F2816144-StackOverflow-Programming-Trends&type=3&count=&appkey=&title=%E7%9B%B8%E4%BF%A1%E6%AF%8F%E4%B8%AA%E7%A8%8B%E5%BA%8F%E5%91%98%E9%83%BD%E7%9F%A5%E9%81%93StackOverflow%E9%97%AE%E7%AD%94%E7%BD%91%E7%AB%99%EF%BC%8C%E6%9C%AC%E6%96%87%E4%BD%9C%E8%80%85dodgy_coder%E9%80%9A%E8%BF%87StackExchange%20Data%20Explorer%20Query%E6%94%B6%E9%9B%86%E4%BA%86%E8%AF%A5%E7%BD%91%E7%AB%99%E4%B8%8A%E6%8E%92%E5%90%8DTOP%2025%E7%9A%84%E7%BC%96%E7%A8%8B%E6%A0%87%E7%AD%BE%EF%BC%8C%E8%BF%99%E4%BA%9B%E6%A0%87%E7%AD%BE%E4%BB%8E%E4%BE%A7%E9%9D%A2%E5%8F%8D%E6%98%A0%E4%BA%86%E4%B8%80%E5%AE%9A%E7%9A%84%E7%BC%96%E7%A8%8B%E8%B6%8B%E5%8A%BF%E3%80%82&pic=&ralateUid=&language=zh_cn&rnd=1466163789182" width="22" height="16">摘要:相信每个程序员都知道StackOverflow问答网站,本文作者dodgy_coder通过StackExchange Data Explorer Query收集了该网站上排名TOP 25的编程标签,这些标签从侧面反映了一定的编程趋势。

上面这个动态图表显示了2010年1月~2013年6月期间,StackOverflow网站中排名前25的编程标签对应的问答数的变化情况。y轴显示了TOP 25标签每月所占的问答比例。图中黑色的I型标志则显示了最小值和最大值。

从图中可以获悉,综合排名第一是C#,不过呈现出下降趋势,其最高值达到了13%,其他靠前的标签还有Java、JavaScript、PHP。其中两大移动平台Android和iOS,最高值分别是9%和5%,而它们所对应的最低值分别为稍高于2%和0。

趋势

下面所列出的仅仅是排名最前的25个标签,只是反映某种趋势,与上面的图表没有冲突。

  • 上升:JavaScript、Android、jQuery、HTML、CSS、json
  • 稳定:Java、PHP、Python
  • 下降:C#、ASP .NET、.Net、SQL Server
  • 标签取代:iOS取代iPhone

数据源

这些数据是通过运行StackExchange Data Explorer Query的一个分支版本来收集的。

另外,这里还有一份csv格式的原始数据,里面显示了每个月的问题数量(不是百分比),数据截止时间是2013年6月。


点击查看大图

上面这幅图表是由sdfjkl整理而来的数据集。

来自:dodgy_coder博客

展开阅读全文

stackoverflow的问题

12-20

我写一个定制的menu控件,控件里用了topmenu,submenu,menuitem这几个对象(类),每个类都代表一个层次的菜单。但是这里有一个stackoverflow的问题,总是得不到解决,希望那位大虾指点一下。部分程序如下:rnrnrnClass menurnrn rnrn //前面的没有问题,就不贴出来了rnrn public void AddTopmenu(Topmenu tm)rnrn private ArrayList topmenus=new ArrayList();rnrn rn rn if (tm !=null)rn this.topmenus.Add(tm);rn rn rn rn rnrnrnrnClass Topmenurnrn private ArrayList submenus=new ArrayList();rnrn rnpublic void AddSubmenu(Submenu sm)rn rn rn this.submenus.Add(sm);rn rn rnrnrnrnrnrnrnrnrnrnrnClass Submenurnrnrnrn //与这里无关,就省略了rnrnrnrnrnrn 结果在新建了一个webapplication之后,把这个控件放如form中后,我在page-load事件中写入下面的代码:rnrnprivate void Page_Load(object sender, System.EventArgs e)rn rn // 在此处放置用户代码以初始化页面rn Topmenu tm=new Topmenu("sina1","sina");rn Menu1.AddTopmenu(tm);rn Submenu sm=new Submenu("xix","hehe");rn rn rn tm.AddSubmenu(sm); //这一行就有问题了,出现stackoverflow的错误rnrn rnrn 这里我大致说一下我的menu的实现原理:rn 在每一个上层菜单对象里放入一个arraylist的成员来存储下一级的菜单,便于在输出的时候可以通过这个成员来输出下一级的菜单,但是这里就出现了这个overflow的问题,请大峡指点一二,谢谢了,如果方便,请留下您的联系方式,qq或者emailrn 论坛

搜索二叉树 stackoverflow

12-28

struct.hrn[code=c]rn#ifndef _struct_Hrn#define _struct_Hrntypedef struct Road_info rn unsigned short data_size; //数据大小 2bytern unsigned int LinkID; //道路编号 4bytern unsigned short road_size; //道路名称的尺寸 2byte rn //以下是NODE中的数据 4bytern unsigned int linkid; //番号 3-0rn unsigned int brunch; //分岔路 6-4rn unsigned int roadnameflag; //路标 7rn char *roadname; //道路名称 rnRoad_info;rnrn typedef struct Roadrn struct Road_info stRoadRec; //节点数据rn struct Road* next; //下一节点rnRoad;rnrn#endifrn[/code]rnrnrnMap_Tree.hrnrn[code=c]rn#includern#include "struct.h"rnrnrnrnrntypedef struct Map_Treern struct Map_Tree *left;rn struct Map_Tree *right;rn unsigned int data;rn*Map_tree;rnrnMap_tree CreatTree_byLinkId( Road *head, int position); //使用递归建立二叉树 Linkid部分rnMap_tree HalfSearch_byLinkId(Map_tree point, int findnode); //二叉树二分查找方式rnrnvoid show_byLinkd(Road *head);rn[/code]rnrnMap_Tree.crn[code=c]rn#include"Map_Tree.h"rnrnvoid show_byLinkd(Road *head)rnrn Map_tree root=NULL;rn Map_tree point=NULL;rn time_t a,b;rn char Run_time[80];rn unsigned int findnode;rn Road *temp;rnrnrn root=CreatTree_byLinkId(head,1);rn printf("请输入您所想要查询的LinkId:\n");rn scanf("%d",&findnode);rnrn a=time(NULL);rn strftime(Run_time,79,"%H:%M:%S",localtime(&a));rnrnrn point=HalfSearch_byLinkId(root,findnode);//用二分法查找二叉树rn if(point!=NULL)rn printf("#linkid=%d\n",head->stRoadRec.LinkID);rn printf("roadnameflag=%d\n",head->stRoadRec.roadnameflag);rn printf("brunch=%d\n",head->stRoadRec.brunch);rn printf("dispclass=%d\n",head->stRoadRec.linkid);rn printf("roadname=%s#\n",head->stRoadRec.roadname);rn temp->stRoadRec.LinkID=head->stRoadRec.LinkID;rn temp->stRoadRec.roadnameflag=head->stRoadRec.roadnameflag;rn temp->stRoadRec.brunch=head->stRoadRec.brunch;rn temp->stRoadRec.linkid=head->stRoadRec.linkid;rn temp->stRoadRec.roadname = head->stRoadRec.roadname;rn rn elsern printf("error:未找到结果!!\n");rnrn b=time(NULL);rn strftime(Run_time,79,"%H:%M:%S",localtime(&b));rnrn printf("本次查找用时%d 秒.\n",b-a); rnrnrnrnMap_tree CreatTree_byLinkId(Road *head, int position)rnrn Map_tree newnode; //声明新节点指针rnrn if(head->next==NULL) //递归的终止条件rn return NULL;rn elsern //建立新节点的内存空间rn newnode = (Map_tree) malloc(sizeof(Road));rnrn //建立节点内容rn newnode->data =head->stRoadRec.LinkID;rn //递归建立左子树rn newnode->left = CreatTree_byLinkId(head, 2*position);rn //递归建立右子树rn newnode->right = CreatTree_byLinkId(head, 2*position+1);rn return newnode; //返回树的位置rn rnrnrnMap_tree HalfSearch_byLinkId(Map_tree point, int findnode)rnrn while(point!=NULL)rn rn if(point->data==findnode)rn return point;//找到了该结点rn elsern if(point->data>findnode)rn point=point->left;rn elsern point=point->right;rn rn return NULL;rnrn[/code]rnrn在建立树的时候 stackoverflow了 一共有6万多条数据,链表rn现在不知道怎么解决,对 stack 不是很理解rn应该怎么办?? 论坛

类方法 stackoverflow

03-16

请问:rn我声明了一个类,其中有对数据库的添加,删除,修改等方法。rnrn在程序中,调用删除运行正常,调用添加和删除后,程序就死了,delphi的cpu占用率变高了。rnrn把这两个方法的实现部分注释掉,提示stack overflowrnrn类声明如下 //添加部分有2个子过程,rntypern //员工rn TEmployee = class (TObject)rn privatern Fid : Integer; //idrn FCode : string; // 编码rn FName : string; // 姓名rn FDepID : Integer; //部门idrn FMob : string; //移动电话rn FTel : string; //电话rn FEMail : string; //电子邮件rn FOicq : string; //Oicqrn FMSN : string; //MSNrn FBal : Real; //余额rn FRemark : string; //备注rn FDepName : string; //部门名称rn FQuery : TADOQuery;rn publicrn procedure Setid(const Val : Integer);rn procedure SetCode(const Val : string);rn procedure SetName(const Val : string);rn procedure SetDepID(const Val : Integer);rn procedure SetMob(const Val : string);rn procedure SetTel(const Val : string);rn procedure SetEmail(const Val : string);rn procedure SetOicq(const Val : string);rn procedure SetMSN(const Val : string);rn procedure SetBal(const Val : Real);rn procedure SetRemark(const Val : string);rn procedure SetDepName(const Val : string);rnrn property id : Integer read Fid write Setid;rn property Code : string read FCode write SetCode;rn property Name : string read FName write SetName;rn property DepID : Integer read FDepID write SetDepID;rn property Mob : string read FMob write SetMob;rn property Tel : string read FTel write SetTel;rn property EMail : string read FEMail write SetEMail;rn property Oicq : string read FOicq write SetOicq;rn property MSN : string read FMSN write SetMSN;rn property Bal : Real read FBal write SetBal;rn property Remark : string read FRemark write SetRemark;rn property DepName : string read FDepName write SetDepName;rnrn function Insert : Boolean;rn function Amend (id : Integer): Boolean;rn function Delete (id : Integer) : Boolean;rn procedure GetAllField(const xQuery : TADOQuery);rnrn constructor create; rn destructor destroy; override;rn end;rnrn//初始化rnconstructor TEmployee.create;rnbeginrn inherited create;rn FQuery := TADOQuery.Create(nil);rn FQuery.Connection := dm.con1;rnend;rnrn//修改rnfunction TEmployee.Amend(id : Integer): Boolean;rnbeginrn Result := False;rn if id >0 thenrn beginrn tryrn with FQuery dorn beginrn Close;rn SQL.Clear;rn SQL.Add('insert into dm_yg set ygxm=:ygxm,depid=:depid,stdh=:stdh,');rn SQL.Add('ggdh=:ggdh,dzyx=:dzyx,qq=:qq,msn=:msn,bz=:bz,zhje=:zhje where [id]=:id');rn Parameters.ParamByName('ygxm').Value := FName;rn Parameters.ParamByName('depid').Value := FDepID;rn Parameters.ParamByName('stdh').Value := FMob;rn Parameters.ParamByName('ggdh').Value := FTel;rn Parameters.ParamByName('dzyx').Value := FEMail;rn Parameters.ParamByName('qq').Value := FOicq;rn Parameters.ParamByName('msn').Value := FMSN;rn Parameters.ParamByName('bz').Value := FRemark;rn Parameters.ParamByName('zhje').Value := FBal;rn Parameters.ParamByName('id').Value := id;rn ExecSQL;rn end;rn Result := True;rn exceptrn Application.MessageBox('修改失败,请重新运行程序!', MB_Title, MB_OK +rn MB_ICONSTOP + MB_TOPMOST);rn Result:= False;rn end;rn end; rnend;rnrnrn//从数据库删除rnfunction TEmployee.Delete(id : Integer): Boolean;rnbeginrn Result := False;rn if ID > 0 thenrn beginrn tryrn with FQuery dorn beginrn if Application.MessageBox('是否删除该项数据?', MB_Title, MB_YESNO + MB_ICONQUESTION + MB_TOPMOST) = IDNO then Exit;rn with FQuery dorn beginrn Close;rn SQL.Clear;rn SQL.Add('select * from dm_yg where [id]=:id');rn Parameters.ParamByName('id').Value := ID;rn Open;rnrn if RecordCount > 0 thenrn beginrn if Application.MessageBox('该数据项正被其他数据使用,是否删除?', MB_Title, MB_YESNO + MB_ICONWARNING + MB_TOPMOST) = IDNO then Exit;rn Close;rn SQL.Clear;rn SQL.Add('delete from dm_yg where [id]=:id');rn Parameters.ParamByName('id').Value := ID;rn ExecSQL;rn end;rn end;rn end;rn Result := True;rn exceptrn Application.MessageBox('无法删除,请重新运行程序!', MB_Title, MB_OK +rn MB_ICONSTOP + MB_TOPMOST);rn Result:=False;rn end;rn end;rnend;rnrn//析构rndestructor TEmployee.destroy;rnbeginrn rn FQuery.Close;rn FreeAndNil(FQuery);rn inherited;rnend; rnrn 论坛

没有更多推荐了,返回首页