This file contains 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
package sizecalculation; | |
import java.io.File; | |
import java.util.ArrayList; | |
import java.util.Iterator; | |
import java.util.LinkedList; | |
import java.util.Queue; | |
public class SizeCalculationUsingQueue { | |
private static Queue<File> queue = new LinkedList<>(); |
This file contains 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
package sizecalculation; | |
import java.io.File; | |
import java.util.*; | |
public class SizeCalculationUsingQueue2 { | |
private static Queue<File> queue = new LinkedList<>(); | |
static long size = 0; | |
public static long getSize(File dir) { |
This file contains 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
package sizecalculation; | |
import java.io.File; | |
import java.util.Arrays; | |
import java.util.Stack; | |
public class CalculateSizeOfFolderUsingStack { | |
private static Stack<File> stack = new Stack<>(); | |
private static long size = 0; |
This file contains 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
package com.hoanbka.javafx.practice; | |
import javafx.application.Application; | |
import javafx.event.ActionEvent; | |
import javafx.event.EventHandler; | |
import javafx.scene.Scene; | |
import javafx.scene.control.Button; | |
import javafx.scene.control.Label; | |
import javafx.scene.control.TextField; | |
import javafx.scene.layout.VBox; |
This file contains 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
package chapter8_10; | |
/** | |
* Created by hoanbka on 22-Sep-16. | |
*/ | |
/********************************************************************************* | |
* (Largest row and column) Write a program that randomly fills in 0s and 1s into * | |
* a 4-by-4 matrix, prints the matrix, and finds the first row and column with * | |
* the most 1s. * | |
*********************************************************************************/ |
This file contains 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
package filterfile; | |
import java.io.*; | |
import java.util.concurrent.LinkedBlockingQueue; | |
/** | |
* Created by hoanbka on 03-Oct-16. | |
*/ | |
public class FilterFile { | |
private static final File file = new File("D:\\Test\\fuck.txt"); |
This file contains 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
sudo mongod --dbpath="/var/lib/mongodb" --fork --logpath /var/log/mongodb.log --storageEngine "wiredTiger" |
This file contains 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
<script> | |
function pretty_time_string(num) { | |
return ( num < 10 ? "0" : "" ) + num; | |
} | |
var start = new Date; | |
setInterval(function() { | |
var total_seconds = (new Date - start) / 1000; |
This file contains 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
/** | |
* Created by Albert on 1/10/2017. | |
*/ | |
var async = require('async'); | |
const fs = require('fs'); | |
function getSizeFile(path) { | |
var size; | |
var stats = fs.statSync(path); | |
size = stats.size; | |
return size; |
This file contains 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
import os | |
res = [] | |
def readFolder(file): | |
if os.path.isfile(file): | |
res.append(os.path.getsize(file)) | |
else: | |
arr = os.listdir(file) | |
for element in arr: |
OlderNewer