<commit_before><?php
require_once(dirname(__FILE__) . '/admin.php');

$ADMIN_SECTION = 'sources';
require_once(dirname(__FILE__) . '/header.php');

$days = 30;

$sources = User::getReferers($days);
/*
 * uksort($sources, function($a, $b) {
  return count($a) - count($b);
  });
 */
?>
<div class="span9">
	<p>Sources that attracted the most registered users in the last <?php echo $days ?> days.</p>
	<table class="table">
		<?php foreach ($sources as $source => $users) { ?>
			<tr>
				<td><a href="<?php echo UserTools::escape($source) ?>" target="_blank"><?php echo UserTools::escape(substr($source,0,40)) ?><?php if (strlen($source) > 40) { ?>...<?php } ?></a></td>
				<td><span class="badge"><?php echo count($users) ?> users</span></td>
				<td>
					<?php foreach ($users as $user) { ?>
						<a style="margin-right: 0.5em" href="<?php echo UserConfig::$USERSROOTURL ?>/admin/user.php?id=<?php echo $user->getID(); ?>">
							<i class="icon-user"></i> <?php echo UserTools::escape($user->getName()) ?>
						</a>
					<?php } ?>
				</td>
			</tr>
		<?php } ?>
	</table>
</div>
<?php
require_once(dirname(__FILE__) . '/footer.php');<commit_msg>Trying another sort function<commit_after><?php
require_once(dirname(__FILE__) . '/admin.php');

$ADMIN_SECTION = 'sources';
require_once(dirname(__FILE__) . '/header.php');

$days = 30;

$sources = User::getReferers($days);
uasort($sources, function($a, $b) {
  return count($b) - count($a);
  });
?>
<div class="span9">
	<p>Sources that attracted the most registered users in the last <?php echo $days ?> days.</p>
	<table class="table">
		<?php foreach ($sources as $source => $users) { ?>
			<tr>
				<td><a href="<?php echo UserTools::escape($source) ?>" target="_blank"><?php echo UserTools::escape(substr($source,0,40)) ?><?php if (strlen($source) > 40) { ?>...<?php } ?></a></td>
				<td><span class="badge"><?php echo count($users) ?> users</span></td>
				<td>
					<?php foreach ($users as $user) { ?>
						<a style="margin-right: 0.5em" href="<?php echo UserConfig::$USERSROOTURL ?>/admin/user.php?id=<?php echo $user->getID(); ?>">
							<i class="icon-user"></i> <?php echo UserTools::escape($user->getName()) ?>
						</a>
					<?php } ?>
				</td>
			</tr>
		<?php } ?>
	</table>
</div>
<?php
require_once(dirname(__FILE__) . '/footer.php');
{'fraction_non_alphanumeric': 0.24254215304798962, 'fraction_numerical': 0.00864677907479464, 'mean_word_length': 4.271070615034168, 'pattern_counts': {'":': 0, '<': 77, '<?xml version=': 0, '>': 83, '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': '2709375', 'n_tokens_mistral': 896, 'n_tokens_neox': 817, 'n_words': 182}