<commit_before>angular.module("app").controller "DiceController", ($scope, $filter, $location, $stateParams, $q, Growl, Wallet, Utils, WalletAPI, $modal, Blockchain, BlockchainAPI, Info) ->
    $scope.amount = 10
    $scope.payouts = 2
    $scope.calculateProfit=->
        $scope.profit = $scope.amount*($scope.payouts-1)
    $scope.calculateProfit()
    $scope.$watch 'payouts',->
        $scope.chancePercent = (100-1)/$scope.payouts
        $scope.win = {
            lessThan : $scope.chancePercent,
            greaterThan : 100-$scope.chancePercent
        }
        $scope.calculateProfit()
    $scope.precision = 1000000
    $scope.reloadDices = ->
        BlockchainAPI.get_block_count().then (blockCount) ->
            console.log(blockCount);
            startBlock = blockCount-30*24*60*60/5;
            if (startBlock<0)
                startBlock = 0
            
            Wallet.rpc.request('wallet_account_dice_transaction_history', ["", "", 0, startBlock, -1]).then (result) =>
                transactions = (result.result.reverse())
                $scope.transactions = transactions
                angular.forEach transactions, (tx) ->
                    tx.transaction_id_prev = tx.transaction.record_id.substring(0, 8)
                    if (!tx.has_jackpot)
                        tx.jackpot.play_amount = tx.dice.amount;
                        tx.jackpot.payouts = tx.dice.payouts;
                    else
                        tx.jackpot.lucky_number/= 10
                    tx.jackpot.play_amount /= $scope.precision;
                    console.log(tx);

        
    $scope.calculateFromProfit=->
        $scope.amount = $scope.profit / ($scope.payouts-1)
    Wallet.get_current_or_first_account().then (account)->
        $scope.balance = Wallet.balances[account.name]['JDST']
        $scope.precision = $scope.balance.precision;
        $scope.balance = $scope.balance.amount / $scope.balance.precision
        $scope.diceSmall =$scope.diceBig = ->
            Wallet.dice(account.name, $scope.amount, $scope.payouts).then (tx)->
                console.log(tx);<commit_msg>add history<commit_after>angular.module("app").controller "DiceController", ($scope, $filter, $location, $stateParams, $q, Growl, Wallet, Utils, WalletAPI, $modal, Blockchain, BlockchainAPI, Info) ->
    $scope.amount = 10
    $scope.payouts = 2
    $scope.calculateProfit=->
        $scope.profit = $scope.amount*($scope.payouts-1)
    $scope.calculateProfit()
    $scope.$watch 'payouts',->
        $scope.chancePercent = (100-1)/$scope.payouts
        $scope.win = {
            lessThan : $scope.chancePercent,
            greaterThan : 100-$scope.chancePercent
        }
        $scope.calculateProfit()
    $scope.precision = 1000000
    $scope.reloadDices = ->
        BlockchainAPI.get_block_count().then (blockCount) ->
            console.log(blockCount);
            startBlock = blockCount-30*24*60*60/5;
            if (startBlock<0)
                startBlock = 0
            
            Wallet.rpc.request('wallet_account_dice_transaction_history', ["", "", 0, startBlock, -1]).then (result) =>
                transactions = (result.result.reverse())
                $scope.transactions = transactions
                angular.forEach transactions, (tx) ->
                    tx.transaction_id_prev = tx.transaction.record_id.substring(0, 8)
                    if (!tx.has_jackpot)
                        tx.jackpot.play_amount = tx.dice.amount;
                        tx.jackpot.payouts = tx.dice.payouts;
                    else
                        tx.jackpot.lucky_number/= 10
                        tx.jackpot.jackpot_received/= $scope.precision
                    tx.jackpot.play_amount /= $scope.precision;
                    console.log(tx);

        
    $scope.calculateFromProfit=->
        $scope.amount = $scope.profit / ($scope.payouts-1)
    Wallet.get_current_or_first_account().then (account)->
        $scope.balance = Wallet.balances[account.name]['JDST']
        $scope.precision = $scope.balance.precision;
        $scope.balance = $scope.balance.amount / $scope.balance.precision
        $scope.diceSmall =$scope.diceBig = ->
            Wallet.dice(account.name, $scope.amount, $scope.payouts).then (tx)->
                console.log(tx);
{'fraction_non_alphanumeric': 0.13234269793359646, 'fraction_numerical': 0.016716972370559555, 'mean_word_length': 2.0, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4798175', 'n_tokens_mistral': 1354, 'n_tokens_neox': 1262, 'n_words': 186}