码迷,mamicode.com
首页 >  
搜索关键字:string    ( 95377个结果)
最长回文串:LeetCode:Longest Palindromic Substring
class Solution {public: string longestPalindrome(string s) { int length=s.length(); int maxlen=0; int start=0; bool fla...
分类:其他好文   时间:2015-05-02 18:05:53    阅读次数:116
用GeneratedKeyHolder获得新建数据主键值
public User createUser(final User user) { final String sql = "insert into sys_users(username, password, salt, locked) values(?,?,?, ?)"; ...
分类:其他好文   时间:2015-05-02 18:03:10    阅读次数:386
mysql 存储二进制数据
晚上小研究了下MySQL存储于读取二进制数据的功能。关键步骤为以下三点:最重要的一点:存储二进制数据的表的类型需要是blob类型(按长度不同分为tiny, media, long) 插入二进制数据时需要利用mysql_real_escape_string函数对数据进行转换从数据库中读取二进制数据时需...
分类:数据库   时间:2015-05-02 17:58:33    阅读次数:133
md5 加密模板
public class MD5Util { public static String getDigestedPassword(String password) throws NoSuchAlgorithmException { byte[] buf = password.get...
分类:其他好文   时间:2015-05-02 17:57:17    阅读次数:155
LeetCode Add Binary
1.题目Given two binary strings, return their sum (also a binary string).For example,a = "11"b = "1"Return "100".2.解答class Solution { public: char intToChar(int input){ char strBuffer[1] = {0...
分类:其他好文   时间:2015-05-02 16:37:23    阅读次数:110
九度1078(二叉树已知先序和中序求后序)
题目链接:点击打开链接 解题思路: 很不错的一道题。用递归的方法求解。每次对两个序列进行递归,求得左子树的先序/中序,右子树的先序/中序。把树建好后调用递归输出后序即可 完整代码: #include #include #include using namespace std; string fir , mid; typedef struct Node { ...
分类:其他好文   时间:2015-05-02 16:37:13    阅读次数:101
HDU 4055 The King’s Ups and Downs(DP计数)
题意:国王的士兵有n个,每个人的身高都不同,国王要将他们排列,必须一高一矮间隔进行,即其中的一个人必须同时高于(或低于)左边和右边。问可能的排列数。例子有1千个,但是最多只算到20个士兵,并且20个的情况的答案已给出。思路:是此题HDU 4055 Number String(DP计数)的简单版,所以...
分类:其他好文   时间:2015-05-02 16:30:42    阅读次数:138
关于Xcode的一些方法-15-05-01
[string substringToIndex:x]-----取出string中在第x位之前的字符。[string substringFromIndex:x] ------取出string中第x位之后的字符。[self.optionView.subviewsmakeObjectsPerformSe...
分类:其他好文   时间:2015-05-02 16:20:41    阅读次数:123
java之 ------ 类的封装、继承和多态(一)
问题:① 完善set()方法,保证获得正确的日期值(合法性); ② 将tomorrow()和yestoday()方法合并为以下daysAfter()方法,并增加一些方法: public int getWeek()   //返回当前日期对应的星期几,范围为0~6 public String toWeekString()   //返回当前日期对应星期几的中文字符串 public boole...
分类:编程语言   时间:2015-05-02 13:57:13    阅读次数:368
JAVA中Iterator的具体作用
Iterator是对集合进行迭代的迭代器作用是将集合中的元素遍历,取出来 举个例子:import java.util.ArrayList; import java.util.Iterator; public class Test { public static void main(String argv[]) { ArrayList list = new ArrayList(); list.add...
分类:编程语言   时间:2015-05-02 13:56:09    阅读次数:241
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!