This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //write kazua | |
| import java.io.File; | |
| import java.util.*; | |
| public class fileSearch { | |
| private List<String> getFiles(String path) { | |
| List<String> pl = new ArrayList<String>(); | |
| File file = new File(path); | |
| if (!file.isDirectory()) file = file.getParentFile(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //write kazua | |
| import java.io.File; | |
| import java.io.FileOutputStream; | |
| import java.io.InputStream; | |
| import java.util.Enumeration; | |
| import jp.hishidama.zip.ZipEntry; | |
| import jp.hishidama.zip.ZipFile; | |
| public class unZipCreatePs { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //write kazua | |
| import java.io.BufferedInputStream; | |
| import java.io.File; | |
| import java.io.FileInputStream; | |
| import java.io.FileOutputStream; | |
| import java.text.SimpleDateFormat; | |
| import java.util.Date; | |
| import jp.hishidama.zip.ZipEntry; | |
| import jp.hishidama.zip.ZipOutputStream; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //write kazua | |
| import java.io.File; | |
| import java.io.FileOutputStream; | |
| import java.io.InputStream; | |
| import java.util.Enumeration; | |
| import org.apache.tools.zip.ZipEntry; | |
| import org.apache.tools.zip.ZipFile; | |
| public class unZipCreate { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //write kazua | |
| import java.io.BufferedInputStream; | |
| import java.io.File; | |
| import java.io.FileInputStream; | |
| import java.io.FileOutputStream; | |
| import java.text.SimpleDateFormat; | |
| import java.util.Date; | |
| import org.apache.tools.zip.ZipEntry; | |
| import org.apache.tools.zip.ZipOutputStream; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //write kazua | |
| object poker_handofcard { | |
| def pack[A](ls : List[A]) : List[List[A]] = { | |
| if (ls.isEmpty) List(Nil) | |
| else { | |
| val (hdele, elsele) = ls.span(_ == ls.head) | |
| if (elsele == Nil) List(hdele) | |
| else hdele :: pack(elsele) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //write kazua | |
| //年月日の中に同じ数値が現れない年月日のリスト | |
| import java.util.Calendar | |
| import java.text.SimpleDateFormat | |
| object daydiff { | |
| def sdf = new SimpleDateFormat("yyyyMd") | |
| def daydiff(stday : Calendar, edday : Calendar, acl : List[String]) : List[String] = stday match { | |
| case s if s.compareTo(edday) > 0 => acl.reverse |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //write Kazua | |
| import scala.collection.mutable._ | |
| object worldproblem1_7 { | |
| def ZeroUpdate(tgt : Array[Array[Int]]) = { | |
| val rowbol = Map[Int, Int]() | |
| val colbol = Map[Int, Int]() | |
| for (i <- 0 until tgt.size) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //write Kazua | |
| object worldproblem1_5 { | |
| def ZipStr(tgt : String, zip : String = "", acl : String = "", bktgt : String = "") : String = tgt match { | |
| case t if t.size == 0 => acl + zip.take(1) + zip.length | |
| case t => acl match { | |
| case a if a.length > 0 && a.length >= bktgt.length => bktgt | |
| case a => zip match { | |
| case z if z == "" => ZipStr(t.tail, z + t.head, a, t) | |
| case z if z.head == t.head => ZipStr(t.tail, z + t.head, a, bktgt) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //write Kazua | |
| object worldproblem1_3 { | |
| def PermutationsCheck(chkstr1 : String, chkstr2 : String) : Boolean = { | |
| if (chkstr1.length != chkstr2.length) return false | |
| val chgchkstr1 = chkstr1.toList.sortWith((o1, o2) => o1.toString.compareToIgnoreCase(o2.toString) < 0).mkString | |
| val chgchkstr2 = chkstr2.toList.sortWith((o1, o2) => o1.toString.compareToIgnoreCase(o2.toString) < 0).mkString | |
| chgchkstr1.equals(chgchkstr2) |