package org.ljh.test.javaee; import java.text.SimpleDateFormat; import java.util.Date; public class StringToLongToDate { public static String parseTime(String s){ //将字符串转化为Long类型 Long timeLong = Long.parseLong(s); //将Long类型转化为Date Date date = new Dat…
说明: 我在做wms进销存软件时,发现一个问题:一张入库单(T_OutIn_BoxTop),入库扫描时要分成多箱,箱号(BoxTop_No)可以是数字也可以是字符串,所以箱号只能是字符串类型的,问题来了,如何进行排序呢? 具体如下: 排序时:CAST(Box_No AS INT) sql语句: SELECT  * FROM T_OutIn_BoxTop WHERE MainTop_ID =17722  ORDER BY CAST(Box_No AS INT)  ASC 版权声明:本文为博主原创文…
代码如下: <meta charset="UTF-8"> <title>Insert title here</title> </head> <body> <div id="content"></div> <script> var el = document.createElement("div"); el.innerHTML = ' <html…
一.JSON简介 JSON(JavaScript Object Notation,JavaScript对象表示法)是一种轻量级的数据交换格式. JSON是"名值对"的集合.结构由大括号'{}',中括号'[]',逗号',',冒号':',双引号'""'组成,包含的数据类型有Object,Number,Boolean,String,Array, NULL等. JSON具有以下的形式: 对象(Object)是一个无序的"名值对"集合,一个对象以"…
(string process, fgets, scanf, neat utilization of switch clause) simple problem, simple code. #include <cstdio> #include <algorithm> #define MAXLEN 22 char password[MAXLEN]; int main() { //freopen("input.txt","r",stdin); i…
time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Little Susie loves strings. Today she calculates distances between them. As Susie is a small girl after all, her strings contain only digits…
1.首先必须了解,string可以被看成是以字符为元素的一种容器.字符构成序列(字符串).有时候在字符序列中进行遍历,标准的string类提供了STL容器接口.具有一些成员函数比如begin().end(),迭代器可以根据他们进行定位. 注意,与char*不同的是,string不一定以NULL('\0')结束.string长度可以根据length()得到,string可以根据下标访问.所以,不能将string直接赋值给char*. 2.string 转换成 char * 如果要将string直接…
reference: Rabin-Karp and Knuth-Morris-Pratt Algorithms By TheLlama– TopCoder Member https://www.topcoder.com/community/data-science/data-science-tutorials/introduction-to-string-searching-algorithms/ // to be improved #include <cstdio> #include <…
bit masking is very common on the lower level code. #include <cstdio> #include <algorithm> #define MAXSIZE 205 char line[MAXSIZE]; int main() { //freopen("input.txt","r",stdin); int x,y, dir; // (dir&3) 0,1,2,3 -- right…
/** * 将对象转化为map * * @param bean * @param <T> * @return */ private <T> Map<String, Object> beanToMap(T bean) { Map<String, Object> map = Maps.newHashMap(); if (bean != null) { BeanMap beanMap = BeanMap.create(bean); for (Object key…