<commit_before><?php
/**
 * Copyright (c) 2011, <NAME> <<EMAIL>>
 * This file is licensed under the Affero General Public License version 3 or later.
 * See the COPYING-README file.
 */

require_once '../lib/base.php';
OC_Util::checkLoggedIn();

// Highlight navigation entry
OC_Util::addScript( 'settings', 'personal' );
OC_Util::addStyle( 'settings', 'settings' );
OC_Util::addScript( '3rdparty', 'chosen/chosen.jquery.min' );
OC_Util::addStyle( '3rdparty', 'chosen' );
OC_App::setActiveNavigationEntry( 'personal' );

// calculate the disc space
$rootInfo=OC_FileCache::get('');
$sharedInfo=OC_FileCache::get('/Shared');
if (!isset($sharedInfo['size'])) {
	$sharedSize = 0;
} else {
	$sharedSize = $sharedInfo['size'];
}
$used=$rootInfo['size']-$sharedSize;
$free=OC_Filesystem::free_space();
$total=$free+$used;
if($total==0) $total=1;  // prevent division by zero
$relative=round(($used/$total)*10000)/100;

$email=OC_Preferences::getValue(OC_User::getUser(), 'settings', 'email', '');

$lang=OC_Preferences::getValue( OC_User::getUser(), 'core', 'lang', OC_L10N::findLanguage() );
$languageCodes=OC_L10N::findAvailableLanguages();
sort ($languageCodes);

//put the current language in the front
unset($languageCodes[array_search($lang, $languageCodes)]);
array_unshift($languageCodes, $lang);

$languageNames=include 'languageCodes.php';
$languages=array();
foreach($languageCodes as $lang) {
	$l=OC_L10N::get('settings', $lang);
	if(substr($l->t('__language_name__'), 0, 1)!='_') {//first check if the language name is in the translation file
		$languages[]=array('code'=>$lang,'name'=>$l->t('__language_name__'));
	}elseif(isset($languageNames[$lang])) {
		$languages[]=array('code'=>$lang,'name'=>$languageNames[$lang]);
	}else{//fallback to language code
		$languages[]=array('code'=>$lang,'name'=>$lang);
	}
}<commit_msg>don´t show negative numbers. this is only a quickfix. I still dont get why the Shared folder can be bigger than the root folder. Perhaps a inconsitency in the filecache?<commit_after><?php
/**
 * Copyright (c) 2011, <NAME> <<EMAIL>>
 * This file is licensed under the Affero General Public License version 3 or later.
 * See the COPYING-README file.
 */

require_once '../lib/base.php';
OC_Util::checkLoggedIn();

// Highlight navigation entry
OC_Util::addScript( 'settings', 'personal' );
OC_Util::addStyle( 'settings', 'settings' );
OC_Util::addScript( '3rdparty', 'chosen/chosen.jquery.min' );
OC_Util::addStyle( '3rdparty', 'chosen' );
OC_App::setActiveNavigationEntry( 'personal' );

// calculate the disc space
$rootInfo=OC_FileCache::get('');
$sharedInfo=OC_FileCache::get('/Shared');
if (!isset($sharedInfo['size'])) {
	$sharedSize = 0;
} else {
	$sharedSize = $sharedInfo['size'];
}
$used=$rootInfo['size']-$sharedSize;
if($used<0) $used=0;
$free=OC_Filesystem::free_space();
$total=$free+$used;
if($total==0) $total=1;  // prevent division by zero
$relative=round(($used/$total)*10000)/100;

$email=OC_Preferences::getValue(OC_User::getUser(), 'settings', 'email', '');

$lang=OC_Preferences::getValue( OC_User::getUser(), 'core', 'lang', OC_L10N::findLanguage() );
$languageCodes=OC_L10N::findAvailableLanguages();
sort ($languageCodes);

//put the current language in the front
unset($languageCodes[array_search($lang, $languageCodes)]);
array_unshift($languageCodes, $lang);

$languageNames=include 'languageCodes.php';
$languages=array();
foreach($languageCodes as $lang) {
	$l=OC_L10N::get('settings', $lang);
	if(substr($l->t('__language_name__'), 0, 1)!='_') {//first check if the language name is in the translation file
		$languages[]=array('code'=>$lang,'name'=>$l->t('__language_name__'));
	}elseif(isset($languageNames[$lang])) {
		$languages[]=array('code'=>$lang,'name'=>$languageNames[$lang]);
	}else{//fallback to language code
		$languages[]=array('code'=>$lang,'name'=>$lang);
	}
}
{'fraction_non_alphanumeric': 0.20046862796146836, 'fraction_numerical': 0.014058838844051028, 'mean_word_length': 7.832183908045977, 'pattern_counts': {'":': 0, '<': 12, '<?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': '731093', 'n_tokens_mistral': 1329, 'n_tokens_neox': 1296, 'n_words': 269}