ITeye博客

phantom

phantom · 共 75 篇文章

背包算法留存

转自http://zyfromcq.iteye.com/blog/1233471 0/1背包问题的动态规划法求解,前人之述备矣,这里所做的工作,不过是自己根据理解实现了一遍,主要目的还是锻炼思维和编程能力,同时,也是为了增进对动态规划法机制的理解和掌握。 值得提及的一个问题是,在用 JAVA 实现时, 是按算法模型建模,还是用对象模型建模呢? 如果用算法模型,那么 背包的值、重量就直接存入二个数组里;如果用对象模型,则要对背包以及背包问题进行对象建模。思来想去,还是采用了对象模型,尽管心里感觉算法模型似乎更好一些。有时确实就是这样,对象模型虽然现在很主流,但也不是万能的,采用其它的模型和视角…

2014-05-15 10:47 · java技术 · 背包算法 · 评论(0)

Mina 应用之——代理服务器

/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "Li…

2010-03-01 16:49 · 评论(0)

IKAnalyzerDemo 全文检索及分词实例

/** * IK Analyzer Demo * @param args */ import java.io.File; import java.io.IOException; import java.io.StringReader; import java.util.List; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.sear…

2010-03-01 16:42 · 评论(0)

java下载网络文件WGet代码

写道 import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; import java.net.HttpURLConnection; import java.net.URL; import java.util.Date; public class WGet { public stati…

2010-03-01 16:35 · 评论(0)

数据库字段<-->java属性 互转方法

public class Util { public static void main(String args[]){ System.out.println(toInRowName("userName").equals("USER_NAME")); System.out.println(toOntRowName("GROUP_USER_NAME").equals("groupUserName")); } public static String toOntRowName(String voName) { StringBuffer sb = new StringBuffer(); boolea…

2009-06-10 15:22 · java技术 · 评论(0)

php168主页、专题页模板制作工具

javaVMEditor功能 在以php168模板模型的系统上制作专题、主页模板时可以快速切割页面代码,并生成相应文件入库。一旦自动入库的数据和要制作的页面的模板对应好,就可在cms上主页、专题管理中不用录入任何数据就可以预览到页面的全貌。 javaVMEditor使用方法 1 添加要制作的页面 ,记住ID 2 把要制作的页面的代码贴入javaVMEditor 3 在编辑工具中删除不需要的头尾代码 4 区分并选中要制成块的代码段,点工具的红、绿、蓝块中的一个 5 当把所有要制作的块选择制作完成后,点设置中的数据库设置,录入好数据库信息和页面ID 6 点文件保存 7 把生成好的文件打开,查看代…

2009-03-20 16:07 · java技术 · 评论(0)

php 正则表达式的是一个使用范例 统计链接生成与替换

<?php class acmeCache{ function fetch($name, $refreshSeconds = 0){ if(!$GLOBALS['cache_active']) return false; if(!$refreshSeconds) $refreshSeconds = 60; $cacheFile = acmeCache::cachePath($name); if(file_exists($cacheFile) and ((time()-filemtime($cacheFile))< $refreshSeconds)) $cacheContent = file_…

2008-12-04 14:59 · java技术 · 评论(0)

批量文件字符集编码转换

import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWrite…

2008-11-26 17:16 · java技术 · 评论(0)

38

2008-02-01 17:50 · 评论(0)

38

2008-02-01 17:50 · 评论(0)

Using the Oracle Bulk Loader-1

2008-02-01 16:36 · 评论(0)

Using the Oracle Bulk Loader -2

2008-02-01 16:36 · 评论(0)

Using the Oracle Bulk Loader-1

2008-02-01 16:36 · 评论(0)

Using the Oracle Bulk Loader -2

2008-02-01 16:36 · 评论(0)

CountSortTool

java 代码 package org.jh.app.count; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Set; import org.apache.commons.collections.Bag; import org.apache.commons.collections.BagUtils; import org.apache.commons.collections.bag.HashBag; public class CountSo…

2007-06-28 23:50 · 评论(1)