Exemple #1
0
 private void CompressLogsWith7z(MainWindow ConfMainWindow)
 {
     using (TextWriter writerSync = TextWriter.Synchronized(new StreamWriter(DateTime.Now.ToString("HH.mm.ss") + ".log", false, System.Text.Encoding.GetEncoding("shift_jis")))) {
         writerSync.WriteLine(ConfMainWindow.FolderLog.Text);
         writerSync.WriteLine(ConfMainWindow.FilesLog.Text);//richTextBox1
     }
     StandardAlgorithm.ExecuteAnotherApp("7z.exe", "a " + DateTime.Now.ToString("yyyy.MM.dd.HH.mm.ss") + ".7z *.log -sdel -mx9", false, true);
 }
Exemple #2
0
 private static void JPGColorOrGray(IEnumerable <string> JPGFiles)
 {
     if (!JPGFiles.Any())
     {
         return;
     }
     Parallel.ForEach(JPGFiles, new ParallelOptions()
     {
         MaxDegreeOfParallelism = System.Environment.ProcessorCount
     }, f => {
         if (Cv2.ImRead(f, ImreadModes.Unchanged).Channels() == 1)   //8bitgrayscale//System.Windows.MessageBox.Show(f + "" + Cv2.ImRead(f, ImreadModes.Unchanged).Channels());
         //8bitgrayは何もしなくていいよ
         {
         }
         else if (GetMaxSaturation(f) > 179)    //24bitcolor
         ////24bitcolorは言わずもがな何もしなくていい
         {
         }
         else
         {
             StandardAlgorithm.ExecuteAnotherApp("jpegtran.exe", "-grayscale -progressive -outfile \"" + f + "\" \"" + f + "\"", false, true);
         }
     });
 }
 static void Main(string[] args)
 {
     StandardAlgorithm codingChallangeOne = new StandardAlgorithm();
     int sum = codingChallangeOne.Solution(new int[] { 1, 2, 3, 4, 5 }, 3);
 }
Exemple #4
0
 public StandardAlgorithmTest()
 {
     _standardAlgorithm = new StandardAlgorithm();
 }