Author archives: admin

RSS feed of admin

C语言、C++、C# 、JAVA和Python 新手选择及相关资料分享

C语言、C++、C# 、JAVA和Python 新手选择及相关资料分享

1、C语言

C语言通常用于系统编程、嵌入式系统和需要高性能的应用程序,如操作系统、驱动程序和游戏引擎。优点是高性能、可移植性强、对硬件的底层控制、广泛的库和工具支持。缺点是相对较低级,需要手动管理内存,开发速度相对较慢。就业C语言仍然在系统编程领域有很高的需求,但对开发人员的技能要求较高。

相关资料:

C语言简介

C语言集成开发环境

C语言入门教程

C语言编写代码语法

C语言注释作用写法及示例代码

C语言变量

C语言常量

C语言存储类型

C语言数据类型

C语言运算符

C语言条件语句(If else)

C语言 switch case 语句

C语言while循环语句

C语言 for循环语句

C语言 break和continue关键字

C语言 数组

C语言函数

C语言作用域

C语言递归

C语言枚举(enum)

C语言指针

C语言指针变量的加减及比较

C语言指针数组

C语言函数指针和指针函数

C语言字符串 ...

Continue reading

Python Introduction

Python 是一个高层次的结合了解释性、编译性、互动性和面向对象的脚本语言。

Python 的设计具有很强的可读性,相比其他语言经常使用英文关键字,其他语言的一些标点符号,它具有比其他语言更有特色语法结构。

Continue reading

jquery grep(),inArray(), map() and join() in javascript

1.jquery grep(): Filtered through an array

   eg.
       var array = [1,2,3,4,5,6,7,8,9];
       var filterarray = $.grep(array,function(value){
           return value > 5;//filter out of more than 5
       });
       for(var i=0;i<filterarray.length;i++){
           alert(filterarray[i]);
       }
       for (key in filterarray){
           alert(filterarray[key]);
       }

2.jquery inArray ...

Continue reading

Python list

Python list

a.Method for creating a list

     1.create list
     eg.
        >>> a=["python",25,89.9]
        >>> a
        ["python",25,89.9]
     2.list index   
     eg.
        >>> a=["python",25,89.9]
        >>> a[0]
        'python'
        >>> a[1]
        25
        >>> a[2]
        89.9
        >>> a[-1]
        89.9
        #get the index ...

Continue reading

Between the characters and numbers in Python is how to compare the size?

Between the characters and numbers in Python is how to compare the size?

1. any two objects can be compared

2. The same type of objects (instances), if it is digital type (int/float/long/complex), in accordance with the simple size to compare; if is non numeric type and class (type) definition of the ...

Continue reading

Python set

1.Method for creating a set

 1)s={1,"python"}
 2)s=set("python") or s=set([1,"python"])
   ps. set to list: 
                   lst=list(s)
       list to set(can remove duplicate elements from the set):
                   s=set([1,"python"])  
       Create an immutable set in "frozenset"

2.Common method of set

 1)add 
    eg.
    b ...

Continue reading

Implementation of Case Swithch syntax in Python

Python itself has no switch statement, there are 3 kinds of Solutions:

1.use dictionary

cases = {
           case1: do_some_stuff1,
           case2: do_some_stuff2,
           ...
           caseN: do_some_stuffN,
         }
cases.get(var, do_default_stuff)()

2.use lambda

result = {
  'a': lambda x: x * 5,
  'b': lambda x: x + 7,
  'c': lambda x: x - 2
}[value](x)

3.Beck Brian provides a class switch to ...

Continue reading

Python basic usage of pickle

Python pickle

import pickle

#dumps(object) :Object serialization
lista=["john","levi","kate"]
listb=pickle.dumps(lista)
#print listb

#loads(string) :The object is restored, and the object type is restored to the original format.
listc=pickle.loads(listb)
#print listc

#dump(object,file) :To store objects in a file.
group1=("cat","is","kkkk")
f1=file ...

Continue reading

Python basic grammar

python basic grammar

1.Constant and Variable

   1)Constant
    eg.
      import const
      const.value=5
      print const.value
      const.value=6
   2)Variable
     eg.
        a=1

2.Number and string

   1)Single quotation mark
     eg. a='string'
   2)Double quotation marks
     eg. b="string"
   3)Three single quotation marks (output special characters)
     eg. c='''string ...

Continue reading

Python read and write files

Python read and write file

1.Python read and write file

fr=open("readfile.txt","r")  
fw=open("writefile.txt","w")

print fr.readline()  
print fr.tell()

print fr.readlines()  
fw.write("===write line===")  
fw.close()

fr.seek(0,0) #The first parameter represents the number of bytes, after which a parameter represents the relative ...

Continue reading