码迷,mamicode.com
首页 > 编程语言
Helloworld之Spring依赖注入/控制反转(DI/IoC)版
Helloworld之Spring依赖注入/控制反转(DI/IoC)版 作者:雨水, 日期:2014-10-29 摘要:本文主要用于培训初学者理解Spring中的依赖注入的基本概念. 先介绍依赖注入的基本概念,然后以构造器注入为例实现了Helloworld实例。 Spring依赖注入/控制反转 在我们通常的编程中,如果类A要依赖类B,通常是由A来创建一个B的实例。而Sp...
分类:编程语言   时间:2014-10-29 13:00:06    阅读次数:204
python中变量命名
一 综述:  二 全局变量(包括函数和类): (1)正常变量x: *通过module.x可以使用。 *通过from module import *可以使用。 (2)以"_"开头变量x: *通过module.x可以使用。 *通过from module import *不能使用。 *通过from module import x可以使用。 (3)以"...
分类:编程语言   时间:2014-10-29 12:55:41    阅读次数:278
Java - replace a character at a specific index in a string?
String are immutable in Java. You can't change them.You need to create a new string with the character replaced.String myName = "domanokz";String newN...
分类:编程语言   时间:2014-10-29 12:54:16    阅读次数:292
并查集算法
擒贼先擒王 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 10 using namespace std;11 12 #define loop(i,n)...
分类:编程语言   时间:2014-10-29 12:52:26    阅读次数:213
java实现按拼音排序名称
private static String[] nameArray = {"张三","李四","王二","付火"}; @SuppressWarnings("unchecked") public static void main(String[] args) { Li...
分类:编程语言   时间:2014-10-29 12:53:08    阅读次数:159
Python 读取大文件 最后几行
方法一:# -*- coding: utf-8 -*-import sysimport osimport stringRCV_LOG = r"d:\c.txt"def get_last_n_lines(logfile, n): n = string.atoi(n) blk_size_ma...
分类:编程语言   时间:2014-10-29 12:53:19    阅读次数:739
javascript动画效果
之前工作项目中,运用了缓动动画的效果,在网上看到其他大牛写的相关公式,结合工作需要,进行了整理,拿出来跟大家分享下,js代码中,只运用了一个小功能进行了测试 测试 ...
分类:编程语言   时间:2014-10-29 12:50:29    阅读次数:140
Search Insert Position 查找给定元素在数组中的位置,若没有则返回应该在的位置
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in or...
分类:编程语言   时间:2014-10-29 12:49:29    阅读次数:204
python3 urllib模块
3.0版本中已经将urllib2、urlparse、和robotparser并入了urllib中,并且修改urllib模块,其中包含5个子模块,即是help()中看到的那五个名字。Python2中的urllib模块,在Python3中被修改为20.5. urllib.request — Extens...
分类:编程语言   时间:2014-10-29 12:47:18    阅读次数:373
eclipse java was started but returned exit code = 1
从http://www.eclipse.org/downloads/官网下载对应的操作系统版本号的文件,例如windows 64 bit,下载之后打开eclipse.exe就提示java was started but returned exit code = 1等之类的错误弹层,Eclipse启动...
分类:编程语言   时间:2014-10-29 12:46:00    阅读次数:184
Python——Code Like a Pythonista: Idiomatic Python
Code Like a Pythonista: Idiomatic Python如果你有C++基础,那学习另一门语言会相对容易。因为C++即面向过程,又面向对象。它很底层,能像C一样访问机器;它也很高级,有模板、STL等。如果认真读过《深入C++对象模型》,我想其它语言不会比这个更复杂。你对C++了...
分类:编程语言   时间:2014-10-29 12:42:28    阅读次数:172
javascript的事件触发和接收源码
define(function(require,exports,module){ var Events=function(){ var array = []; var push = array.push; var slice = array.slice...
分类:编程语言   时间:2014-10-29 12:40:44    阅读次数:196
Ubuntu 安装mod_python配置Apache2
在Ubuntu上搭建Python运行环境,mod_python是不可少的(据说mod_swgi也是可以的,没有亲测)。使用命令安装mod_python。 安装:apt-get install libapache2-mod-python “Apache分阶段的处理请求(比方说:读取请求,解析h...
分类:编程语言   时间:2014-10-29 12:38:23    阅读次数:218
【多线程】学习13
内容来自:http://blog.csdn.net/morewindows/article/details/7823572一.什么是“遗弃”问题在之前讲到了互斥量能处理“遗弃”问题,下面引用原文:互斥量常用于多进程之间的线程互斥,所以它比关键段还多一个很有用的特性——“遗弃”情况的处理。比如有一个占...
分类:编程语言   时间:2014-10-29 12:36:05    阅读次数:258
java 解析xml字符串用dom4j
packagecom.smsServer.Dhst;importjava.util.HashMap;importjava.util.Iterator;importjava.util.Map;importorg.dom4j.Document;importorg.dom4j.DocumentExcept...
分类:编程语言   时间:2014-10-29 12:38:30    阅读次数:140
VBA 小知识
VBA小知识,包括循环的写法,创建dictionary的写法和用法,还有chart的用法。
分类:编程语言   时间:2014-10-29 12:35:23    阅读次数:157
WINDOWS+NGINX+DJANGO+FLUP+PYTHON起步~
参考的文档是http://blog.163.com/sky20081816@126/blog/static/1647610232010824262695/但在实操时,作了更改之后才生效,就是#include fcgi.conf;include fastcgi_params;这里。server{ .....
分类:编程语言   时间:2014-10-29 12:37:09    阅读次数:577
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!