码迷,mamicode.com
首页 > 编程语言
Java修饰符
Java语言提供了很多修饰符,主要分为以下两类:访问修饰符非访问修饰符修饰符用来定义类、方法或者变量,通常放在语句的最前端。我们通过下面的例子来说明:public class className { // ...}private boolean myFlag;static final doubl.....
分类:编程语言   时间:2015-07-03 00:03:26    阅读次数:195
js获取数组的最后一个元素
摘自:开源it在js里面如何获取一个数组的最后一个元素呢?这里总结了两种方法,有需要的朋友可以看看。(1)js内置pop方法pop() 方法用于删除并返回数组的最后一个元素,注意这里在获取了数组的最后一个元素的同时也将原数组的最后一个元素给删除了。如果数组已经为空,则该方法不改变数组,并返回 und...
分类:编程语言   时间:2015-07-03 00:01:47    阅读次数:162
2015第27周三Java内存模型
自己写的代码,6个月不看也是别人的代码,自己学的知识也同样如此,学完的知识如果不使用或者不常常回顾,那么还不是自己的知识。要认识java线程安全,必须了解两个主要的点:java的内存模型,java的线程同步机制。特别是内存模型,java的线程同步机制很大程度上都是基于内存模型而设定的。浅谈java内...
分类:编程语言   时间:2015-07-03 00:02:32    阅读次数:179
Python 2.7.9 Demo - isinstance
#coding=utf-8#!/usr/bin/pythona = 'abc';print isinstance(a, str);
分类:编程语言   时间:2015-07-03 00:02:05    阅读次数:207
Test语言编译器V1.0
感觉这个挺好耍的,书上的代码有错误,而且功能有限。一、词法分析特点:(1)可对中文进行识别:(2)暂不支持负数,可以在读入‘-'时进行简单标记后就能对简单负数进行识别了。#include #include #include #include using namespace std;#define K...
分类:编程语言   时间:2015-07-03 00:02:01    阅读次数:417
通过指针访问C++对象的私有成员
C/C++, 对象, 访问私有成员
分类:编程语言   时间:2015-07-02 23:57:20    阅读次数:239
SWIFT推送之本地推送(UILocalNotification)
本地推送通知是通过实例化UILocalNotification实现的。要实现本地化推送可以在AppDelegate.swift中添加代码实现,本事例是一个当App进入后台时推送一条消息给用户。1.首先在didFinishLaunchingWithOptions方法内添加代码,IOS8推送消息首先要获...
分类:编程语言   时间:2015-07-02 23:56:17    阅读次数:5167
Python 2.7.9 Demo - 三元表达式
#coding=utf-8#!/usr/bin/pythonimport logging;a = 'abc';print 'Y' if isinstance(a, str) else 'N';
分类:编程语言   时间:2015-07-02 23:54:30    阅读次数:166
Python 2.7.9 Demo - 获取调用的参数
#coding=utf-8#!/usr/bin/pythonimport sys;print("The command line parameters are : ");for i in range(0, len(sys.argv)) : print str(i) + ' -> ' +...
分类:编程语言   时间:2015-07-02 23:55:48    阅读次数:162
Javascript为元素添加事件处理函数
document.getElementById("test").onclick = function(){ ...};
分类:编程语言   时间:2015-07-02 23:53:59    阅读次数:150
java时间处理工具类--DateUtils
package com.hexiang.utils;/** * @(#)DateUtil.java * * * @author kidd * @version 1.00 2007/8/8 */import java.util.*;import java.text.*;import java.sql....
分类:编程语言   时间:2015-07-02 23:55:39    阅读次数:285
Python 2.7.9 Demo - 015.元组的定义、取值、遍历
#coding=utf-8#!/usr/bin/pythonfinal_list = ('a', 1, 'b', 2, 'c', 3);print final_list[0];print final_list[1:3];print final_list * 2;print final_list + ...
分类:编程语言   时间:2015-07-02 23:55:03    阅读次数:158
JavaScript 用new创建对象的过程
在JavaScript中创建自定义对象都需要用new运算符,那么创建对象的过程是什么样的呢?例如现在有如下构造函数:function Person(name) { this.name = name;}Person.prototype = { constructor: Person, ...
分类:编程语言   时间:2015-07-02 23:52:34    阅读次数:179
Python 2.7.9 Demo - JSON的编码、解码
#coding=utf-8#!/usr/bin/pythonimport json;dict = {};dict['name'] = 'nick';dict['say'] = 'hello world...';dict['age'] = '20';dict_json = repr(dict);pri...
分类:编程语言   时间:2015-07-02 23:53:23    阅读次数:238
Python 2.7.9 Demo - ini文件的读、写
ini文件[weixin_info]hello = Nick Huang#coding=utf-8#!/usr/bin/pythonimport ConfigParser;cp = ConfigParser.ConfigParser();cp.read('027.99.config.ini');he...
分类:编程语言   时间:2015-07-02 23:54:16    阅读次数:239
javascript 函数(2)
一、什么是函数 函数的作用,可以写一次代码,然后反复地重用这个代码。 比如:我们要完成多组数和的功能。 var?sum; sum?=?3+2; alert(sum); sum=7+8; alert(sum); .......?????//不停地重复这两行代码...
分类:编程语言   时间:2015-07-02 22:46:56    阅读次数:153
LeetCode219 ContainsDuplicateII java题解
题目: Given an array of integers and an integer k, find out whether there there are two distinct indices i and j in the array such that nums[i] = nums[j] and the difference between i and j is a...
分类:编程语言   时间:2015-07-02 22:47:39    阅读次数:192
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!