text:
Q: Twitter login in android application and post a tweet for diffrent users I have made a Consumer key and a Consumer secret from my twitter account and I have post a tweet to twitter in my account and this works fine. My application is to login from different user in twitter and post their tweet. Is this possible. If it is then how will you handle the case of Consumer key and Consumer secret for different users. Please provide me if any valid link for this scenario.

A: Consumer key and Consumer secret are used for verifying apps not for users. So every user will use the same Consumer key and Consumer secret to login your twitter app.
You can reference some android twitter wrapper like twiiter-android-sdk


text:
Q: Isomorphisms of Planar Embeddings My question: How does one distinguish between two embeddings of the same graph on the plane?
For instance, are two such embeddings considered the same if the degree sequence of their faces are the same? Or does even the slightest change, such as drawing an edge more crooked in one embedding than the other, constitute a different embedding? (Or perhaps none of these?)

A: Mathematicians differ in preference about what it takes to call two objects equal as opposed to just equivalent or isomorphic...
...but at the very least, two planar embeddings should be "basically the same" if there's an isomorphism of the graphs that also preserves the faces. Or in other words if they have faces of the same degrees connected in all the same ways, just arranged differently.
Take the three examples below. These are all embeddings of the same graph; I've just tucked one or both of the 3-cycles inside the 5-cycle.

The first and second embeddings are definitely different, and also answer your question about whether face degrees must be the same. In the first, the face lengths are $3,3,5,7$ (including the outside face). In the second, the face lengths are $3,3,6,6$.
The third embedding looks very different from the first, but it shouldn't actually be considered different. Both of them have faces of lengths $3,3,5,7$. In both of them, the two triangular faces share a vertex with each other; each shares one edge with the face of length $5$, and two edges with the face of length $7$. And so on; there is a correspondence between the faces that preserves all the properties we care about.

A: You can distinguish embeddings if they are encoded as a combinatorial map. Consider the numbering of these graphs (same as Misha's answer):

A simple way to describe the embedding would be the cyclic order of the neighbours of each vertex. For an anti-clockwise direction, the graphs would be:

A: [0: [1, 5, 4], 1: [0, 2, 6, 5], 2: [1, 3, 6], ...]
B: [0: [1, 4, 5], 1: [0, 5, 2, 6], 2: [1, 3, 6], ...]
C: [0: [1, 4, 5], 1: [0, 5, 6, 2], 2: [1, 6, 3], ...]

I've only listed the vertices [0, 1, 2], as for degrees less than 3 it's always the same. However, you can see that A[2] == B[2] and B[0] == C[0] as expected.
The actual definition of a combinatorial map involves a representation of the graph where edges are split into darts and there are a pair of permutations on these darts that encode the cyclic orientation.
I assume that this definition is easier to generalise to higher dimensions, but it does not seem to add very much to the question of isomorphisms.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Error: Failed to find target with hash string 'android-27' I am trying to do an image uploading in react-native.As i run the app i got this error.Below is the screenshot of the error i got.

A: If you've just imported the project from a new android studio or a new session.
Try restarting android studio and the download will go without issues.
That's what worked for me.


text:
Q: How to delete files from zip with VBScript Im very new to VBScript (this is my first time ever using it). So far I've copied and altered my way into getting as far as I am.
I have an APK file that is too big for my needs. So what I've been doing is manually changing it to a zip and then deleting a couple images from it then renaming it back to an APK. Im trying to automate that with a VBScript. So far I have
Set oShell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
sFolder = WORKSPACE & "\temp\" & app & "\build\" & PLATFORMSUBFOLDER & "\dist\" & app & "\bin"
oShell.CurrentDirectory = sFolder

'Make the Apk a Zip.
fso.MoveFile apkfile, zipApk

This is all working and I can see in Windows Explorer that the APK changes to a zip like I want it to. So Im wondering if there is any quick ways to just go in and delete a couple files without extracting the whole thing?
If not is there an easy way to extract the files and parse them at the same time?
Ive looked here Extract files from ZIP file with VBScript
but cant seem to get it working. I keep getting error "Object required: 'objShell.Names(...)'" Any hints to why this is happening?

A: Use the MoveHere method to move an item out of the zip file:
zipfile = "C:\path\to\your.zip"
fname   = "some.file"
dst     = "C:\some\folder"

Set app = CreateObject("Shell.Application")
For Each f In app.NameSpace(zipfile).Items
  If f.Name = fname Then
    app.Namespace(dst).MoveHere(f)
  End If
Next

Then delete the files from the dst folder:
Set fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFile fso.BuildPath(dst, fname), True


text:
Q: NEventStore - decrypt and deserialize stared event data I'm trying NEventStore. I started example project and I created some events and saved to database. But in database I see encrypted data only and I cant identify correctness of my stored events. I tried to turn off all settings about encryption but nothing changed.
My init code :
var init = Wireup.Init()
                         .LogToOutputWindow()
                         .UsingInMemoryPersistence()
                         .UsingSqlPersistence("EventStore") // Connection string is in app.config
                         .WithDialect(new MsSqlDialect())
                         .EnlistInAmbientTransaction() // two-phase commit
                         .InitializeStorageEngine()
                         .TrackPerformanceInstance("example")
                         .UsingJsonSerialization()
                         //.Compress()
                         //.EncryptWith(EncryptionKey)
                         .HookIntoPipelineUsing(new[] {new AuthorizationPipelineHook()})
                         .UsingSynchronousDispatchScheduler()
                         .DispatchTo(new DelegateMessageDispatcher(DispatchCommit))
                         .Build();

I tried to do it in SQL with casting varbinary to varchar by cast([Payload] as varchar(max) but I didn't receive clean data as well.
How I can read NEventStore data in readable form please?

A: You can cast Payload column to XML:
SELECT TOP 10 CAST(Payload AS XML), *
  FROM [dbo].[Commits]

Even though the payload is actually JSON, I get the correct result, e.g.
[{"Headers":{},"Body":"Test"}]

Obviously, that does not work for compressed or encrypted data.


text:
Q: WordPress - On Click toggles both instead of the clicked parent menu item I have a problem where I have a menu with parent menu items and if there is a sub menu on click it toggles that nested UL.
Now, I have 2 and the problem is when I place it inside the forEach it toggles both instead of the current clicked parent item submenu.
How can I tell JS to only toggle the div from the clicked element only?
PHP in WordPress:
<?php
function main_navigation() {
    $menu_name      = 'main_menu';
    $locations      = get_nav_menu_locations();
    $menu           = wp_get_nav_menu_object( $locations[ $menu_name ] );
    $menu_items     = wp_get_nav_menu_items( $menu->term_id, array( 'order' => 'ASC' ) );
    $count          = 0;
    $sub_menu       = false;
?>

    <?php
    foreach( $menu_items as $item ):

        $link           = $item->url;
        $title          = $item->title;
        $class          = $item->classes[0];

        // item does not have a parent so menu_item_parent equals 0 (false)
        if ( !$item->menu_item_parent ):

        // save this id for later comparison with sub-menu items
        $parent_id = $item->ID;
    ?>

        <a href="<?php echo $link; ?>" class="header__link <?php echo $class ?>"><?php echo $title; ?>

        <?php endif; ?>

        <?php if ( $parent_id == $item->menu_item_parent ): ?>

            <?php if ( !$sub_menu ): $sub_menu = true; ?>

            <?php endif; ?>

                    <a href="<?php echo $link; ?>" class="header__sub-link"><?php echo $title; ?>

            <?php if ( $menu_items[ $count + 1 ]->menu_item_parent != $parent_id && $sub_menu ): ?>

            <?php $sub_menu = false; endif; ?>

        <?php endif; ?>

<?php
$count++;
endforeach;
?>

<?php
}

JS:
const headerSubLists = document.querySelectorAll('.header__link-sub');

headerSubLists.forEach((headerSubList) => {
    const headerSubMenu = document.querySelectorAll(
        '[aria-role="header-sublist"]'
    );

    const openSubMenu = (e) => {
        e.preventDefault();

        headerSubMenu.forEach((menu) => {
            menu.classList.toggle('is-open');
        });
    };

    headerSubList.addEventListener('click', openSubMenu);
});

A: First change your js like so :
const headerSubLists = document.querySelectorAll('.header__link-sub');

headerSubLists.forEach((headerSubList) => {
    const parentItem = headerSubList.closest('.header__item');
    const subMenuId = parentItem.dataset.subMenu;
    const subMenu = document.getElementById(subMenuId);

    const openSubMenu = (e) => {
        e.preventDefault();
        subMenu.classList.toggle('is-open');
    };

    headerSubList.addEventListener('click', openSubMenu);
});

Then in your php file add the data attribute to the parent item when you create the sub-menu :
<?php if ( !$sub_menu ): $sub_menu = true; ?>
    <ul class="header__sub-list" aria-role="header-sublist" id="sub-menu-<?php echo $parent_id ?>" data-sub-menu="sub-menu-<?php echo $parent_id ?>">
<?php endif; ?>


text:
Q: How can I get window.location.href in Nuxtjs V3 I'm trying to let players join a game via QR Code. Since that game will be hosted on several IP's, i want to dynamically generate the URL.
This is my current workaround in my NuxtJS Vue Component:
<template>
  <input placeholder="copy browser window url into this field" v-model="fullPath" @change="generateQR">
</template>

<script setup>
  const fullPath = ref(null)
  QRCode.toDataURL(fullPath.value + ...
</script>

What I want to do is something like:
<script setup>
  // not working phantasy code
  QRCode.toDataURL(window.location.href + ...
</script>

When using useRouter() and useRoute()'s .fullPath attribute, I still only get the relative path / instead of http://10.16.1.173:3000/.

Full code on GitLab: pages/index.vue

A: Try to check if you are in client side before accessing to 'window' object, you can use :
if (process.client) {
      console.log(window.location.href)
}

A: Try to use this:
this.$route.query


text:
Q: BackHandler manipulation I am trying to make something a little more advanced in react-native and I could use some help. I have an app with a login and a register and once you are logged and you press back I want to pop up an alert window with 2 buttons(yes/no). As if you want to log out or not.
Here is what I have tried so far. In this version, the alert window opens but the navigation back happens regardless.
BackHandler.addEventListener("hardwareBackPress", () => {
  // Works on both iOS and Android
  Alert.alert(
    'Logout?',
    'Do you wanna log out?',
    [
      { text: 'Yes', onPress: () => { des = true } },
      { text: 'No', onPress: () => { des = null } },
    ],
    { cancelable: false })
  return des
 })
}

A: Use modal. Set a state to view modal where you can add button and customize the design

BackHandler.addEventListener("hardwareBackPress", () => {
  // Works on both iOS and Android
 this.setState({modal:true})
 })
}


text:
Q: SQL Query, Need help using "contains" and "does not contain" I need help with how to write an SQL statement.  This what I am trying to say, this clearly is not SQL format but for purpose of understanding the request:
SELECT     *
FROM       $A$
WHERE      marketprovider_1 OR  marketprovider_2 OR  marketprovider_3 OR  marketprovider4 OR marketprovider_5 CONTAIN 'data' AND  'tv'
AND
WHERE marketprovider_1 OR marketprovider_2 OR marketprovider_3 OR marketprovider4 OR marketprovider_5 DO NOT CONTAIN  "vios" OR 'phone" OR  "uverse';

My failed attempt at the query:
SELECT * FROM  $A$
WHERE CONTAINS(marketprovider_1, 'data') OR CONTAINS(marketprovider_2, 'data') OR CONTAINS(marketprovider_3, 'data') OR CONTAINS(marketprovider_4, 'data') OR CONTAINS(marketprovider_5, 'data')
AND
WHERE CONTAINS(marketprovider_1, 'tv') OR CONTAINS(marketprovider_2, 'tv) OR CONTAINS(marketprovider_3, 'tv) OR CONTAINS(marketprovider_4 'tv) OR CONTAINS(marketprovider_5, 'tv)
AND
WHERE NOT IN(marketprovider_1, 'vios') OR NOT IN (marketprovider_2, 'vios') OR NOT IN (marketprovider_3, 'vios') OR NOT IN (marketprovider_4, 'vios') OR NOT IN (marketprovider_5, 'vios')
AND
WHERE NOT IN (marketprovider_1, 'phone') OR NOT IN (marketprovider_2, 'phone') OR NOT IN (marketprovider_3, 'phone') OR NOT IN (marketprovider_4 'phone') OR NOT IN (marketprovider_5, 'phone')
AND
WHERE NOT IN (marketprovider_1, 'uverse') OR NOT IN (marketprovider_2, 'uverse') OR NOT IN (marketprovider_3, 'uverse') OR NOT IN (marketprovider_4 'uverse') OR NOT IN (marketprovider_5, 'uverse')

A: Try using :
marketprovider_1 like ('%data%')

Where the % is a wildcard.  You can use NOT LIKE for the opposite.
The IN clause you are using is for searching for lists of things.  An example is:
marketprovider_1 in ('data','this','that')

A: This is one way you can do it making use of LIKE and NOT LIKE:
SELECT     *
FROM       $A$
WHERE      (marketprovider_1 OR  marketprovider_2 OR  marketprovider_3 OR  marketprovider4
OR         marketprovider_5 LIKE '%data%')
AND        (marketprovider_1 OR  marketprovider_2 OR  marketprovider_3 OR  marketprovider4
OR         marketprovider_5 LIKE '%tv%')
AND        (marketprovider_1 OR marketprovider_2 OR marketprovider_3 OR marketprovider4 OR marketprovider_5 NOT LIKE '%vios%')
AND         (marketprovider_1 OR marketprovider_2 OR marketprovider_3 OR marketprovider4 OR marketprovider_5 NOT LIKE '%phone%')
AND         (marketprovider_1 OR marketprovider_2 OR marketprovider_3 OR marketprovider4 OR marketprovider_5 NOT LIKE '%uverse%')

A: Here's an example of valid SQL WHERE clause syntax that implements the predicates you described.
WHERE (  ( marketprovider_1 LIKE '%data%' AND marketprovider_1 LIKE '%tv%' )
      OR ( marketprovider_2 LIKE '%data%' AND marketprovider_2 LIKE '%tv%' )
      OR ( marketprovider_3 LIKE '%data%' AND marketprovider_3 LIKE '%tv%' )
      OR ( marketprovider_4 LIKE '%data%' AND marketprovider_4 LIKE '%tv%' )
      OR ( marketprovider_5 LIKE '%data%' AND marketprovider_5 LIKE '%tv%' )
      )
  AND
  NOT (  marketprovider_1 LIKE '%vios%'
      OR marketprovider_2 LIKE '%vios%'
      OR marketprovider_3 LIKE '%vios%'
      OR marketprovider_4 LIKE '%vios%'
      OR marketprovider_5 LIKE '%vios%'

      OR marketprovider_1 LIKE '%phone%'
      OR marketprovider_2 LIKE '%phone%'
      OR marketprovider_3 LIKE '%phone%'
      OR marketprovider_4 LIKE '%phone%'
      OR marketprovider_5 LIKE '%phone%'

      OR marketprovider_1 LIKE '%uverse%'
      OR marketprovider_2 LIKE '%uverse%'
      OR marketprovider_3 LIKE '%uverse%'
      OR marketprovider_4 LIKE '%uverse%'
      OR marketprovider_5 LIKE '%uverse%'
      )

(I'm assuming that by "contains" you mean that a particular string occurs within the column value, and by "does not contain" means you want to check that a particular string does not occur anywhere within the column contents.)
The LIKE operator is one way to check whether a particular string occurs within another string, the '%' is a wildcard character that matches zero, one or more characters. For example:
''           LIKE '%tv%'  => 0
'feefifofum' LIKE '%tv%'  => 0
'tv'         LIKE '%tv%'  => 1
'tvfifofum'  LIKE '%tv%'  => 1
'fee tv fo'  LIKE '%tv%'  => 1
NULL         LIKE '%tv%'  => NULL

The example WHERE clause (above) checks for a single marketprovider_N column that contains both the string 'data' and the string 'tv'; it's possible this differs from what you meant to specify.
If you meant (instead) that if any of the marketprovider_N columns contained 'data' and any of the marketprovider_N columns contained 'tv', that would be a slightly different WHERE clause:
WHERE (  ( marketprovider_1 LIKE '%data%' )
      OR ( marketprovider_2 LIKE '%data%' )
      OR ( marketprovider_3 LIKE '%data%' )
      OR ( marketprovider_4 LIKE '%data%' )
      OR ( marketprovider_5 LIKE '%data%' )
      )
  AND (  ( marketprovider_1 LIKE '%tv%' )
      OR ( marketprovider_2 LIKE '%tv%' )
      OR ( marketprovider_3 LIKE '%tv%' )
      OR ( marketprovider_4 LIKE '%tv%' )
      OR ( marketprovider_5 LIKE '%tv%' )
      )
  AND
  NOT (  marketprovider_1 LIKE '%vios%'
      OR marketprovider_2 LIKE '%vios%'
      OR marketprovider_3 LIKE '%vios%'
      OR marketprovider_4 LIKE '%vios%'
      OR marketprovider_5 LIKE '%vios%'

      OR marketprovider_1 LIKE '%phone%'
      OR marketprovider_2 LIKE '%phone%'
      OR marketprovider_3 LIKE '%phone%'
      OR marketprovider_4 LIKE '%phone%'
      OR marketprovider_5 LIKE '%phone%'

      OR marketprovider_1 LIKE '%uverse%'
      OR marketprovider_2 LIKE '%uverse%'
      OR marketprovider_3 LIKE '%uverse%'
      OR marketprovider_4 LIKE '%uverse%'
      OR marketprovider_5 LIKE '%uverse%'
      )

Anything beyond this, and we're just guessing at permutations of how the specification could be interpreted. Example data, and identifying whether the row should be returned or not, would narrow down the specification.
e.g. which of these rows should be returned...
 marketprovider_1 marketprovider_2 marketprovider_3 marketprovider_4 marketprovider_5
 ---------------- ---------------- ---------------- ---------------- ----------------
 data tv coffee   NULL             NULL             NULL             NULL
 data             phone            tv               NULL             NULL
 data             tv               NULL             NULL             NULL
 tv               tv               tv               NULL             NULL
 data             netflix          net              NULL             NULL
 mountain dew     phone            uverse           cable            netflix
 amazon           hulu             no uverse        wifi             roku


text:
Q: NSInternalInconsistencyException when Populating UITableView I have a leaderboard in my app and the data is stored in Firebase Firestore. The leaderboard dynamically changes based on events related to the users.
Every so often, the leaderboard is crashing and I am receiving an NSInternalInconsistencyException. I am unsure why, however it may have to do with when the data in Firebase dynamically changes and the UITableView repopulates the data. Below is the associated code:
LeadersViewController.Swift
    class LeadersViewController: UIViewController {

    private let ROWS_TO_SHOW = 3

    @IBOutlet weak var nameLabel: UILabel!
    @IBOutlet weak var cashierButton: UIButton!
    @IBOutlet weak var allTimeTableCard: TableCard!
    @IBOutlet weak var thisMonthTableCard: TableCard!
    @IBOutlet weak var lastMonthTableCard: TableCard!

    fileprivate var allTimeDataSource: FUIFirestoreTableViewDataSource!
    fileprivate var thisMonthDataSource: FUIFirestoreTableViewDataSource!
    fileprivate var lastMonthDataSource: FUIFirestoreTableViewDataSource!

    var userListener: ListenerRegistration!
    var allTimeListener: ListenerRegistration!
    var thisMonthListener: ListenerRegistration!
    var lastMonthListener: ListenerRegistration!

    override func viewDidLoad() {
        super.viewDidLoad()

    }

    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        self.userListener = FirestoreUtil.loadUser { (object) in
            guard let user: User = object else {
                return
            }
            self.nameLabel.text = user.displayName ?? ""
            let cash = OddsUtil.formatCash(cashAmount: user.balanceNumeric)
            self.cashierButton.setTitle(cash, for: .normal)
        }
        setupAllTimeStat()
        setupThisMonthStat()
        setupLastMonthStat()
    }

    override func viewWillDisappear(_ animated: Bool) {
        userListener.remove()

        allTimeDataSource.unbind()
        allTimeDataSource.tableView = nil
        allTimeDataSource = nil
        allTimeTableCard.tableView.dataSource = nil
        allTimeTableCard.tableView.reloadData()

        thisMonthDataSource.unbind()
        thisMonthDataSource.tableView = nil
        thisMonthDataSource = nil
        thisMonthTableCard.tableView.dataSource = nil
        thisMonthTableCard.tableView.reloadData()

        lastMonthDataSource.unbind()
        lastMonthDataSource.tableView = nil
        lastMonthDataSource = nil
        lastMonthTableCard.tableView.dataSource = nil
        lastMonthTableCard.tableView.reloadData()

        allTimeListener.remove()
        thisMonthListener.remove()
        lastMonthListener.remove()

        super.viewWillDisappear(animated)

    }

    func setupAllTimeStat() {
        allTimeTableCard.headerImageView.image = UIImage(named: "ic_format_list_numbered_black_18dp")
        allTimeTableCard.headerLabel.text = "Profit: All-Time"
        allTimeTableCard.bottomView.isHidden = false
        allTimeTableCard.bottomLabel.text = "VIEW LEADERBOARD"

        self.allTimeTableCard.tableView.register(UINib(nibName: "LeaderTableViewCell", bundle: nil),
                                                 forCellReuseIdentifier: "LeaderTableViewCell")

        self.allTimeTableCard.tableView.delegate = self

        self.allTimeTableCard.tableView.tableFooterView = UIView(frame: CGRect.zero)

        let query = Firestore.firestore()
            .collection("userStats")
            .whereField("timePeriodString", isEqualTo: "ALLTIME")
            .whereField("statType", isEqualTo: StatType.AMOUNT_NETTED.rawValue)
            .whereField("valueAsDouble", isGreaterThan: 0)
            .order(by:"valueAsDouble", descending: true)
            .limit(to: ROWS_TO_SHOW)

        self.allTimeListener = query.addSnapshotListener { (snapshot, error) in
            DispatchQueue.main.async {
                self.allTimeTableCard.tableView.reloadData()
            }

        }

        self.allTimeDataSource = allTimeTableCard.tableView.bind(toFirestoreQuery: query, populateCell: { (tableView, indexPath, snapshot) -> UITableViewCell in
            let cell = tableView.dequeueReusableCell(withIdentifier: "LeaderTableViewCell", for: indexPath) as! LeaderTableViewCell
            let stat = UserStat(dict: snapshot.data() ?? [:])
            cell.setStat(position: indexPath.row, userStat: stat)
            return cell
        })

        self.allTimeTableCard.viewAll = {
            LeaderboardViewController.openLeaderboard(sender: self, leaderboardTitle: "Profit: All-Time", period: "ALLTIME")
        }

        self.allTimeTableCard.tableView.reloadData()
    }

    func setupThisMonthStat() {
        thisMonthTableCard.headerImageView.image = UIImage(named: "ic_format_list_numbered_black_18dp")
        thisMonthTableCard.headerLabel.text = "Profit: \(DateUtil.formatMonthYear())"
        thisMonthTableCard.bottomView.isHidden = false
        thisMonthTableCard.bottomLabel.text = "VIEW LEADERBOARD"

        self.thisMonthTableCard.tableView.register(UINib(nibName: "LeaderTableViewCell", bundle: nil),
                                                   forCellReuseIdentifier: "LeaderTableViewCell")

        self.thisMonthTableCard.tableView.delegate = self

        self.thisMonthTableCard.tableView.tableFooterView = UIView(frame: CGRect.zero)

        let period = "\(DateUtil.year())\(DateUtil.month() - 1)"

        let query = Firestore.firestore()
            .collection("userStats")
            .whereField("timePeriodString", isEqualTo: period)
            .whereField("statType", isEqualTo: StatType.AMOUNT_NETTED.rawValue)
            .whereField("valueAsDouble", isGreaterThan: 0)
            .order(by:"valueAsDouble", descending: true)
            .limit(to: ROWS_TO_SHOW)

        self.thisMonthListener = query.addSnapshotListener { (snapshot, error) in
            DispatchQueue.main.async {
                self.thisMonthTableCard.tableView.reloadData()
            }
        }

        self.thisMonthDataSource = thisMonthTableCard.tableView.bind(toFirestoreQuery: query, populateCell: { (tableView, indexPath, snapshot) -> UITableViewCell in
            let cell = tableView.dequeueReusableCell(withIdentifier: "LeaderTableViewCell", for: indexPath) as! LeaderTableViewCell
            let stat = UserStat(dict: snapshot.data() ?? [:])
            cell.setStat(position: indexPath.row, userStat: stat)
            return cell
        })

        self.thisMonthTableCard.viewAll = {
            LeaderboardViewController.openLeaderboard(sender: self, leaderboardTitle: "Profit: \(DateUtil.formatMonthYear())", period: period)
        }

        self.thisMonthTableCard.tableView.reloadData()

    }

    func setupLastMonthStat() {
        let previousMonth = Calendar.current.date(byAdding: .month, value: -1, to: Date()) ?? Date()
        lastMonthTableCard.headerImageView.image = UIImage(named: "ic_format_list_numbered_black_18dp")
        lastMonthTableCard.headerLabel.text = "Profit: \(DateUtil.formatMonthYear(date: previousMonth))"
        lastMonthTableCard.bottomView.isHidden = false
        lastMonthTableCard.bottomLabel.text = "VIEW LEADERBOARD"

        self.lastMonthTableCard.tableView.register(UINib(nibName: "LeaderTableViewCell", bundle: nil),
                                                   forCellReuseIdentifier: "LeaderTableViewCell")
        self.lastMonthTableCard.tableView.delegate = self

        self.lastMonthTableCard.tableView.tableFooterView = UIView(frame: CGRect.zero)

        let period = "\(DateUtil.year(date: previousMonth))\(DateUtil.month(date: previousMonth) - 1)"

        let query = Firestore.firestore()
            .collection("userStats")
            .whereField("timePeriodString", isEqualTo: period)
            .whereField("statType", isEqualTo: StatType.AMOUNT_NETTED.rawValue)
            .whereField("valueAsDouble", isGreaterThan: 0)
            .order(by:"valueAsDouble", descending: true)
            .limit(to: ROWS_TO_SHOW)

        self.lastMonthListener = query.addSnapshotListener { (snapshot, error) in
            DispatchQueue.main.async {
                self.lastMonthTableCard.tableView.reloadData()
            }
        }

        self.lastMonthDataSource = lastMonthTableCard.tableView.bind(toFirestoreQuery: query, populateCell: { (tableView, indexPath, snapshot) -> UITableViewCell in
            let cell = tableView.dequeueReusableCell(withIdentifier: "LeaderTableViewCell", for: indexPath) as! LeaderTableViewCell
            let stat = UserStat(dict: snapshot.data() ?? [:])
            cell.setStat(position: indexPath.row, userStat: stat)
            return cell
        })

        self.lastMonthTableCard.viewAll = {
            LeaderboardViewController.openLeaderboard(sender: self, leaderboardTitle: "Profit: \(DateUtil.formatMonthYear(date: previousMonth))", period: period)
        }

        self.lastMonthTableCard.tableView.reloadData()

    }

    @IBAction func cashier(_ sender: Any) {
        CashierViewController.openCashier(sender: self)
    }
   }

    extension LeadersViewController: UITableViewDelegate {
    func tableView(_ tableView: UITableView, didSelectRowAt indexPath:
   IndexPath) {
        let userId = (tableView.cellForRow(at:
    tableView.indexPathForSelectedRow!) as!
    LeaderTableViewCell).userStat?.userId ?? ""

        ProfileViewController.openPorfile(vc: self, userId: userId)
    }
}

Output:

LeaderboardViewController.Swift (where error is occurring):
 import UIKit
import FirebaseUI

class LeaderboardViewController: UIViewController {

    private let ROWS_TO_SHOW = 100

    @IBOutlet weak var tableView: UITableView!
    @IBOutlet weak var indicator: UIActivityIndicatorView!
    fileprivate var dataSource: FUIFirestoreTableViewDataSource!

    var listener: ListenerRegistration!

    var leaderboardTitle: String!
    var period: String!

    override func viewDidLoad() {
        super.viewDidLoad()

        title = leaderboardTitle

        self.tableView.register(UINib(nibName: "LeaderTableViewCell", bundle: nil),
                                forCellReuseIdentifier: "LeaderTableViewCell")

        self.tableView.tableFooterView = UIView(frame: CGRect.zero)

        self.tableView.delegate = self
    }

    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        let query = Firestore.firestore()
            .collection("userStats")
            .whereField("timePeriodString", isEqualTo: period)
            .whereField("statType", isEqualTo: StatType.AMOUNT_NETTED.rawValue)
            .order(by:"valueAsDouble", descending: true)
            .limit(to: ROWS_TO_SHOW)

        self.listener = query.addSnapshotListener { (snapshot, error) in
            DispatchQueue.main.async {
                if snapshot?.count ?? 0 > 3 {
                    self.indicator.stopAnimating()
                }
                self.tableView.reloadData()
            }
        }

        self.dataSource = tableView.bind(toFirestoreQuery: query, populateCell: { (tableView, indexPath, snapshot) -> UITableViewCell in
            let cell = tableView.dequeueReusableCell(withIdentifier: "LeaderTableViewCell", for: indexPath) as! LeaderTableViewCell
            let stat = UserStat(dict: snapshot.data() ?? [:])
            cell.setStat(position: indexPath.row, userStat: stat)
            return cell
        })
        self.tableView.reloadData()
    }

    override func viewWillDisappear(_ animated: Bool) {
        super.viewWillDisappear(animated)
        dataSource.unbind()
        dataSource.tableView = nil
        dataSource = nil
        tableView.dataSource = nil
        tableView.reloadData()
        listener.remove()
    }

}

extension LeaderboardViewController: UITableViewDelegate {
    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        let userId = (tableView.cellForRow(at: tableView.indexPathForSelectedRow!) as! LeaderTableViewCell).userStat?.userId ?? ""

        ProfileViewController.openPorfile(vc: self, userId: userId)
    }
}

extension LeaderboardViewController {
    public static func openLeaderboard(sender: UIViewController, leaderboardTitle: String, period: String) {
        let storyboard : UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
        let vc = storyboard.instantiateViewController(withIdentifier: "LeaderboardViewController") as! LeaderboardViewController
        vc.leaderboardTitle = leaderboardTitle
        vc.period = period
        sender.navigationController?.pushViewController(vc, animated: true)
    }

}

Output:

Exception:
2019-02-06 21:15:49.293694-0600 BetShark[18200:155059] *** Assertion failure in -[UITableView _endCellAnimationsWithContext:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKitCore_Sim/UIKit-3698.93.8/UITableView.m:1776
2019-02-06 21:15:49.316429-0600 BetShark[18200:155059] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'attempt to perform an insert and a move to the same index path (<NSIndexPath: 0xc55d03bd8e95ff5b> {length = 2, path = 0 - 68})'
*** First throw call stack:
(
    0   CoreFoundation                      0x00000001116921bb __exceptionPreprocess + 331
    1   libobjc.A.dylib                     0x0000000110c30735 objc_exception_throw + 48
    2   CoreFoundation                      0x0000000111691f42 +[NSException raise:format:arguments:] + 98
    3   Foundation                          0x000000010c8e1877 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 194
    4   UIKitCore                           0x000000011a47688a -[UITableView _endCellAnimationsWithContext:] + 9355
    5   UIKitCore                           0x000000011a492711 -[UITableView endUpdates] + 75
    6   BetShark                            0x0000000108a0095c -[FUIFirestoreTableViewDataSource batchedArray:didUpdateWithDiff:] + 2321
    7   BetShark                            0x00000001089f44f8 __31-[FUIBatchedArray observeQuery]_block_invoke + 658
    8   BetShark                            0x00000001088e7fdc __60-[FIRQuery addSnapshotListenerInternalWithOptions:listener:]_block_invoke + 197
    9   BetShark                            0x00000001088d5e68 _ZZN8firebase9firestore4util8internal13DispatchAsyncEPU28objcproto17OS_dispatch_queue8NSObjectONSt3__18functionIFvvEEEEN3$_08__invokeEPv + 14
    10  libdispatch.dylib                   0x0000000112885602 _dispatch_client_callout + 8
    11  libdispatch.dylib                   0x000000011289299a _dispatch_main_queue_callback_4CF + 1541
    12  CoreFoundation                      0x00000001115f73e9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    13  CoreFoundation                      0x00000001115f1a76 __CFRunLoopRun + 2342
    14  CoreFoundation                      0x00000001115f0e11 CFRunLoopRunSpecific + 625
    15  GraphicsServices                    0x0000000113da71dd GSEventRunModal + 62
    16  UIKitCore                           0x000000011a27081d UIApplicationMain + 140
    17  BetShark                            0x0000000108722052 main + 50
    18  libdyld.dylib                       0x00000001128fb575 start + 1
    19  ???                                 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)


text:
Q: Laravel Eloquent where between two column from Table What is the Laravel eloquent query for this:
select * from `jobs` where 1 between min_experience and max_experience;

I tried the below query but this one encapsulates the where 1 with single quotes.
Job::whereRaw('? between min_experience and max_experience',1)->get();

select * from `jobs` where '1' between min_experience and max_experience;

A: Probably this will work for you:
Job::where('min_experience', '<', 1)->where('max_experience', '>', 1)->get();

A: operator must like this
level_rank::where('min_pv', '>=', $pv)->where('max_pv', '<=', $pv)->first();

A: Laravel have whereBetween query will work
Job::whereBetween('max_experience', [1, 1])->get();


text:
Q: No boot menu after installing Ubuntu 11.10 on a Dell Windows Vista Home laptop computer? I just installed Ubuntu 11.10 on a friends Dell Inspiron laptop.  I normally boots up to Windows Vista Home Edition.  As part of the install procedure I reduced the size of the largest ntfs partition to allow space for an ext4 root partition and a small swap partition.  After the install completed it prompted to restart and what followed was a reboot with Windows coming back up without any multiboot menu screen.  Where is the grub boot menu?

A: You'll need to install GRUB manually. To do that you'll have to boot up using a live CD then do the following:

*

*Setup a chroot environment.
open a terminal and mount the root partition to /mnt
sudo mount /dev/sdXy /mnt

sdXy being the root partition of your installed ubuntu, e.g. /dev/sda5. you can find that out using
sudo fdisk -l

next, mount some virtual devices
 sudo mount -bind /dev /mnt/dev
 sudo mount -bind /proc /mnt/proc
 sudo mount -bind /sys /mnt/sys

*chroot into the installed system
sudo chroot /mnt

*finally, (re)install GRUB
grub-install --recheck /dev/sdX
sdX is the internal hard drive, probably /dev/sda
and while we're at it, we may as well update it, too.
update-grub

*if there were no errors during the installation, you can type "exit" to leave chroot nd then simply reboot the computer. you should then be able to boot both windows and linux.


text:
Q: Used \newgeometry and got big chunk of empty space at the bottom of the page I used \newgeometry in landscape environment, followed by the table that you can see in the image and  I added \restoregeometry before ending landscape.
How to use \newgeometry properly, that this empty space (1/3 of the page?) won't appear?


text:
Q: Efficient way to find number of objects under a S3 prefix I can think of these solutions:

*

*Cloudwatch Bucket metric is good but that's only available at the bucket level.

*S3 List (with prefix) is time consuming for millions of objects.
Is there any other efficient and cheaper way?

A: Some options:

*

*Call ListObjects() (with pagination) to obtain the current list, or

*Use Amazon S3 Inventory, which can provide a daily or weekly CSV/ORC/parquet file listing all objects, or

*Create your own database (eg in DynamoDB) that keeps track of objects and create AWS Lambda functions that are triggered whenever objects are created/deleted to update the database


text:
Q: Automatically Login & Startup A Windows Program On Amazon's EC2 Service How can I automatically start a program on Amazon's EC2 Windows 2008 web servers?
For example, if I wanted to test the "Digg effect" on a web page of mine, how could I open 100 windows 2008 servers at once, each loading one (or two?) instances of the firefox web browser?
I have placed a sample batch file in the windows startup folder that echos the time it was called, but it is only started when I actually login remotely via the remote desktop protocol.
I don't want to have to login to 100 servers to get my software to run :P What can I do?
I am using this Windows 2008 Datacenter, Amazon-supplied AMI specifically: ami-a2698bcb

A: On Linux use wget instead of firefox and write a small script like this:
#!/bin/bash
# Script name: myscript.sh
case $1 in
start)
   for ((i=0; i<=100; i++))
   do
   wget -q -O - http://www.yoursite.com
   sleep 1
   done
;;
esac

make it executable, copy it into the /etc/init.d directory, make a symlink to it in your default runlevel init directory (/etc/rc2.d for Debian &co, /etc/rc5.d for other distros) and name the link S99myscript.
Now everytime your instance boot, it will send 100 http requests to your site (1 per second).
M

A:
How can I automatically start a program on Amazon's EC2 Windows 2008 web servers?

Just run it as a service. Follow this tutorial:
http://www.hosting.com/support/vps/windows/service/
M

A: I use WinServ (http://www.sw4me.com/wiki/Winserv) instead of the resource kit, since there could be issues with the 2k3 resource kit on 2k8. Plus WinServ will let you use a batch file for your service, etc.. And its free.


text:
Q: dynamic Format at ssrs this one is my report

This is my result (but iddescripcion is not visible)

my question is.
how do i get when iddescripcion=1,3,5,8 or 10 then valor is going to have this format 10,000 (not decimals)
when iddescripcion=2,4,6, or 9 then valor is going to have this format 1,000.0 or 3,000.1( one decimal)
and when iddescripcion=7,11 then valor is going to have this format  $2,389,012 (not decimalsa and $ before)
i believe the format i need add it at here but i do not have any idea how to do it..

A: You can apply condition formatting using a Switch or IIf statement in the Text Box Expression value.

I put a simple example together using the following expression:
=Switch(Fields!iddescripcion.Value = 1 or Fields!iddescripcion.Value = 2, Format(Fields!valor.Value, "N0")
    , Fields!iddescripcion.Value = 3 or Fields!iddescripcion.Value = 4, Format(Fields!valor.Value, "N1")
    , Fields!iddescripcion.Value = 5 or Fields!iddescripcion.Value = 6, Format(Fields!valor.Value, "$#,#"))

Basically just applying Format to valor based on iddescripcion for each row. This works for some simple data:

Hopefully you can adapt this for your example.


text:
Q: Does a sequence of distribution converges if it converges on a dense subset of test function space?
*

*Suppose $\{K_n\} \subset \mathcal{D}'$, and $\langle K_n, u\rangle$ converges for every $u$ in a dense subset of $C_0^\infty$, does $K_n$ converges to some $K\in \mathcal{D}'$?

If this is not true, how about:

*Suppose $\{K_n\} \subset \mathcal{D}', K \in \mathcal{D}'$, and $\langle K_n, u\rangle \to \langle K, u\rangle$, for every $u$ in a dense subset of $C^\infty_0$, does $K_n$ converges to $K$?

A proof or a counterexample would be appreciated.


text:
Q: How to make predicate for simple Prolog database I have this database, which tells prolog who is who's friend and what that friends favourite colour is:
*/ has_friend(name, their friend)
has_friend(lisa, mary).
has_friend(john, peter).
has_friend(carl, erin).

*/ has_favourite_colour(their friend, colour)
has_favourite_colour(mary, red).
has_favourite_colour(peter, blue).
has_favourite_colour(erin, green).

What I want to do now is create a predicate "info/1" which uses the name as argument and then tells me who their friend is and what their favourite colour is. How do I do this? I basically suck at prolog and I've read 3 books and all sorts of tutorials but I can't figure it out.

A: Such questions are very common among beginners. The key insight is that you want to describe a relation between 3 things:

*

*a person

*their friend

*the friend's (I assume) favourite colour.

Consequently, it will be natural to use three arguments (not one) for such a relation.
A good predicate name helps to write down the definition in a straight-forward way:

person_friend_colour(Person, Friend, FriendColour) :-
        has_friend(Person, Friend),
        has_favourite_colour(Friend, FriendColour).

It is written here as a typical Prolog rule, i.e., of the form Head ← Body.
We can therefore read it as Body → Head, which may be a bit easier: If Friend is a friend of Person, and FriendColour is that friend's favourite colour, then it is the case that person_friend_colour/3 holds for these three entities.
Example query:

?- person_friend_colour(Person, Friend, FriendColor).
Person = lisa,
Friend = mary,
FriendColor = red ;
Person = john,
Friend = peter,
FriendColor = blue ;
Person = carl,
Friend = erin,
FriendColor = green.

This shows all solutions there are.
To obtain natural formulations of your relations, use an adequate number of arguments!


text:
Q: How should I log External Web Services called from X++ I've followed the standard tutorials to create an external web service reference.  My calls contain transactional data and logging is imperative.  I'd like to know what sort of logging I should employ when making these external calls.  I'd really love to have these calls appear in-line with standard AIF document history & exceptions, but I don't think that's easily feasible.  I also can't find the SOAP request and response generated by my external service reference, making the logging even trickier.  I've thought about creating a custom outbound adapter, but I'm not sure if that's the right approach. Just want to see what the professionals recommend.
https://technet.microsoft.com/en-ca/library/hh500185.aspx
http://daxmusings.codecrib.com/2011/10/consuming-external-webservices-in-ax.html

A: Configure Logging at the AIF Port Configuration. Enable All document versions or Original document.

A: The best way that we've found so far is to create a logging table in AX.  Saving serialized requests, responses, URLs and errors right into AX.  We've included other descriptors as well so it's useful anywhere external web services are called.  Provide a form for your front end, and consider a batch job to purge old records.


text:
Q: How can i put this custom Linq query to view? I'm kind of a newbie on Linq and could use some help.
I'm trying to set a custom Linq query to a MVC View but I can't really figure out how to?
Here is the code from my actionresult
from st in db.Stats
        orderby
            st.ID descending
        select new
        {
            st.ID,
            st.Date,
            st.Created,
            st.Accepted,
            st.Ended,
            Totaltime =
                (SqlFunctions.StringConvert((double) SqlFunctions.DateDiff("ss", st.Created, st.Ended)/60) + ":" +
                 ("0" + SqlFunctions.StringConvert((double) SqlFunctions.DateDiff("ss", st.Created, st.Ended)%60))
                     .Substring(
                         ("0" +
                          SqlFunctions.StringConvert((double) SqlFunctions.DateDiff("ss", st.Created, st.Ended)%60))
                             .Length - 2, 2)),
            Ordertime =
                (SqlFunctions.StringConvert((double) SqlFunctions.DateDiff("ss", st.Accepted, st.Ended)/60) +
                 ":" +
                 ("0" +
                  SqlFunctions.StringConvert((double) SqlFunctions.DateDiff("ss", st.Accepted, st.Ended)%60))
                     .Substring(
                         ("0" +
                          SqlFunctions.StringConvert(
                              (double) SqlFunctions.DateDiff("ss", st.Accepted, st.Ended)%60)).Length - 2, 2)),
            st.Message

I know that i should use viewmodel to get this right but i'm stuck on the Totaltime and Ordertime since they are created in the query.

A: Instead of doing select new, you can create a new concrete class and do select new Example:
public class Example
{
    public string ID { get; set; }
    public string Filename { get; set; }
}

Which you can use LINQ to fetch a list of for example:
List<Example> data = (from x in events
                      group x by x.GetMessageFields() into grouping
                      let y = grouping.Select(x => x.GetFilename()).ToList()
                      select new Example
                      {
                          ID = grouping.Key,
                          Filename = y.First()
                      }).ToList();

If you have a model class, you can add a List<Example> to it now and use it:
model.ExamplesList = data;


text:
Q: Multiple underbraces that span overlapping columns in matrix I want to display the structure of a matrix as shown in the image below:

The following code shows the structure of the matrix, without the underbraces:
\documentclass{standalone}

\usepackage{amsmath}

\begin{document}
$\displaystyle
\begin{pmatrix}
  1 & 1 & \ldots & 1 \\
    & 1 & \ldots & 1 & 1 \\
    &   & \ddots & \\
    &   &        & 1 & \ldots & 1
\end{pmatrix}
$
\end{document}

Here is the output:

How do I typeset the desired matrix with underbraces?

A: Here is a quick take on what might be possible if you're not really interested in generalization:

\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\newcommand{\mydots}[1]{\makebox[0pt][l]{$\underbrace{1\ 1\ \cdots\ 1}_{#1}$}}
\begin{document}
\[
  \begin{pmatrix}
    \mydots{s} & \\
    & \hspace*{3em}\mydots{s} & \\
    & & \hspace*{3em}\ddots & \\
    & & & \mydots{s} & \hspace{3em}
  \end{pmatrix}
\]
\end{document}

The idea is to set the construction (the \underbrace structure) with a right overlap (not really necessary) and space appropriately.

A: A solution using a variant of \tikzmark.
Code
\documentclass[border=5pt]{standalone}

\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing}

\newcommand\tikzmark[2][]{\tikz[remember picture,baseline=(#1.base)]\node[inner sep=0,outer sep=0](#1){#2};}

\begin{document}
$\displaystyle
\begin{pmatrix}
  \tikzmark[1-1]{1} & 1 & \ldots & \tikzmark[1-n]{1} \\[2ex]
    & \tikzmark[2-1]{1} & \ldots & 1 & \tikzmark[2-n]{1} \\[2ex]
    &   & \ddots & \\[2ex]
    &   &        & \tikzmark[n-1]{1} & \ldots & \tikzmark[n-n]{1}
\end{pmatrix}
$
\foreach \i in {1,2,n}
\tikz[remember picture,overlay]\draw[decorate,decoration={brace,amplitude=3pt,mirror}](\i-1.south west)--node[below]{$s$}(\i-n.south east);
\end{document}

Output

Or a full TikZ solution (without using pmatrix)
Code
\documentclass[border=5pt]{standalone}

\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing,matrix}

\begin{document}
\begin{tikzpicture}[every left delimiter/.style={xshift=1ex},every right delimiter/.style={xshift=-1ex}]
  \matrix(m)[matrix of math nodes,
    left delimiter=(,
    right delimiter=),
    row sep=2ex
  ]{
    |[name=1-1]|1 & 1             & \ldots & |[name=1-n]|1                          \\
                  & |[name=2-1]|1 & \ldots & 1             & |[name=2-n]|1          \\
                  &               & \ddots &                                        \\
                  &               &        & |[name=n-1]|1 & \ldots & |[name=n-n]|1 \\
  };
  \foreach \i in {1,2,n}
  \draw[decorate,decoration={brace,amplitude=3pt,mirror}](\i-1.south west)--node[below=1pt]{$s$}(\i-n.south east);
\end{tikzpicture}
\end{document}

Output

A: A variation on the other answer of mine to a similar problem in Underbrace in a matrix
\documentclass{standalone}
\usepackage{amsmath,mathtools}

\newcommand{\blockB}[1]{
  \underbrace{\!\!\begin{matrix}1 & \cdots & 1\end{matrix}\!\!}_{#1\mathstrut}
}

\begin{document}
$
  \begin{pmatrix}
  1 & \mathrlap{\blockB{k}} \\
  & 1 & \mathrlap{\blockB{k}} \\
  && 1 & \mathrlap{\blockB{k}} \\
  &&&& \ddots \\
  &&&&& 1 & \blockB{k}
  \end{pmatrix}
$
\end{document}

If you want the brace to span all the block, some more tricks are needed.
\documentclass[border=5]{standalone}
\usepackage{amsmath,mathtools}

\newcommand{\blockC}[1]{
  \,\,\underbrace{\!\!\begin{matrix}1 & 1 & \cdots & 1\end{matrix}\!\!}_{#1\mathstrut}\,\,
}

\begin{document}
$
  \begin{pmatrix}
  \hphantom{1}\mathrlap{\blockC{k}} \\
  & \hphantom{1}\mathrlap{\blockC{k}} \\
  && \hphantom{1}\mathrlap{\blockC{k}} &\hphantom{1} \\
  &&&& \ddots \\
  &&&&& \blockC{k}
  \end{pmatrix}
$
\end{document}

I use some \hphantom{1} to ensure correct alignment: they give some width to the cells.

A: I would use a shorthand to clean up the notation a little
\documentclass{article}
\usepackage{mathtools,bbm}%Use your favorite font for bboard number

\begin{document}
\noindent
If someone defines $\mathbbm{1}$ as all-ones vector,
\[
  \begin{pmatrix}
  1 & \mathbbm{1}^T_k \\
  & 1 & \mathbbm{1}^T_k \\
  && 1 &  \mathbbm{1}^T_k \\
  &&& \ddots & \ddots \\
  &&&& 1 & \mathbbm{1}^T_k
  \end{pmatrix}
\]
\end{document}

If you decide to load TikZ then there is no excuse for using those \...dots family. They have been used in the absence of graphics tools. Now you have the monster onboard, I would suggest not being conservative and using that monster efficiently.


text:
Q: Get list of all CSP and/or CNG providers via C#? I'd like to list out all CSP and CNG providers installed on a system, but I can't find a good method for doing so in C#.  For CSP, I can enumerate a certain registry key (inelegant, but functional), but I've been unable to find any way to get a list of CNG providers.
Is there anything remotely like System.Security.Cryptography.Get[CSP/CNG]Providers() or similarly logical/straightforward in .NET that could be used?  Thanks!

A: To my knowledge, there isn't anything like that in .NET Framework.
For CSP providers, enumerate the subkeys of:
  HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\Defaults\Provider
For CNG providers, enumerate the subkeys of:
  HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Cryptography\Providers

A: Use this to enumerate CSP providers and containers:
using Microsoft.Win32.SafeHandles;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Text;

namespace CspSample
{

   struct Provider
   {
      public string Name { get; set; }
      public int Type { get; set; }
   }

    class CspUtils
    {
        [DllImport("advapi32.dll", SetLastError = true, CharSet = CharSet.Auto)]
        static extern bool CryptEnumProviderTypes(
 uint dwIndex,
 uint pdwReserved,
 uint dwFlags,
 [In] ref uint pdwProvType,
 StringBuilder pszTypeName,
 [In] ref uint pcbTypeName);

        [DllImport("Advapi32.dll")]
        private static extern bool CryptEnumProviders(
            int dwIndex,
            IntPtr pdwReserved,
            int dwFlags,
            ref int pdwProvType,
            StringBuilder pszProvName,
            ref int pcbProvName);

        public static List<Provider> ListAllProviders()
        {
            List<Provider> installedCSPs = new List<Provider>();
            int cbName;
            int dwType;
            int dwIndex;
            StringBuilder pszName;
            dwIndex = 0;
            dwType = 1;
            cbName = 0;
            while (CryptEnumProviders(dwIndex, IntPtr.Zero, 0, ref dwType, null, ref cbName))
            {
                pszName = new StringBuilder(cbName);

                if (CryptEnumProviders(dwIndex++, IntPtr.Zero, 0, ref dwType, pszName, ref cbName))
                {
                    installedCSPs.Add(new Provider { Name = pszName.ToString(), Type = dwType });
                }
            }
            return installedCSPs;
        }

        const int PP_ENUMCONTAINERS = 2;
        const int PROV_RSA_FULL = 1;
        const int ERROR_MORE_DATA = 234;
        const int ERROR_NO_MORE_ITEMS = 259;
        const int CRYPT_FIRST = 1;
        const int CRYPT_NEXT = 2;
        //TODO: Find how to disable this flag (not machine keystore)
        const int CRYPT_MACHINE_KEYSET = 0x20;
        const int CRYPT_VERIFYCONTEXT = unchecked((int)0xF0000000);

        public static IList<string> EnumerateKeyContainers(string providerName, int providerType)
        {
            ProvHandle prov;
            if (!CryptAcquireContext(out prov, null, providerName, providerType, CRYPT_MACHINE_KEYSET | CRYPT_VERIFYCONTEXT))
                throw new Win32Exception(Marshal.GetLastWin32Error());

            List<string> list = new List<string>();
            IntPtr data = IntPtr.Zero;
            try
            {
                int flag = CRYPT_FIRST;
                int len = 0;
                if (!CryptGetProvParam(prov, PP_ENUMCONTAINERS, IntPtr.Zero, ref len, flag))
                {
                    if (Marshal.GetLastWin32Error() != ERROR_MORE_DATA)
                        throw new Win32Exception(Marshal.GetLastWin32Error());
                }

                data = Marshal.AllocHGlobal(len);
                do
                {
                    if (!CryptGetProvParam(prov, PP_ENUMCONTAINERS, data, ref len, flag))
                    {
                        if (Marshal.GetLastWin32Error() == ERROR_NO_MORE_ITEMS)
                            break;

                        //throw new Win32Exception(Marshal.GetLastWin32Error());
                    }

                    list.Add(Marshal.PtrToStringAnsi(data));
                    flag = CRYPT_NEXT;
                }
                while (true);
            }
            finally
            {
                if (data != IntPtr.Zero)
                {
                    Marshal.FreeHGlobal(data);
                }

                prov.Dispose();
            }
            return list;
        }

        private sealed class ProvHandle : SafeHandleZeroOrMinusOneIsInvalid
        {
            public ProvHandle()
                : base(true)
            {
            }

            protected override bool ReleaseHandle()
            {
                return CryptReleaseContext(handle, 0);
            }

            [DllImport("advapi32.dll")]
            private static extern bool CryptReleaseContext(IntPtr hProv, int dwFlags);
        }

        [DllImport("advapi32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
        private static extern bool CryptAcquireContext(out ProvHandle phProv, string pszContainer, string pszProvider, int dwProvType, int dwFlags);

        [DllImport("advapi32.dll", SetLastError = true)]
        private static extern bool CryptGetProvParam(ProvHandle hProv, int dwParam, IntPtr pbData, ref int pdwDataLen, int dwFlags);
    }
}


text:
Q: SailsJS Connections I built my code using SailsJS, and configured the connection to work with PostgreSQL. But on username and password fields, I want to retrieve this information from another function. Anyone knows how I can do this.
Example:

pgDatabase: {
     adapter: 'sails-postgresql',
     host: 'server',
     port: port,
     user: getUsername(function(p) {
       return(p);
     }), // optional
     password: getPassword(function(c) {
       return(c);
     }), // optional
     database: 'db', //optional
     pool: false
   }

A: You can define username and password in your config/env file different for development and production and in connections you can access it as shown in below line of code
username: (process.env.NODE_ENV == "production") ? "productionUser" : "otherUserName",
password: (process.env.NODE_ENV == "production") ? "productionPassword" : "otherPassword";

NODE_ENV can be set while lifting sails
NODE_ENV=production sails lift
NODE_ENV=development sails lift

A: You can define username, password in your api/services methods. Depending upon your need either you can create multiple services or single service which will return required values.
module.exports = () => {
  return () => {

    return 'localhost';
    //return Promise.resolve(convertedObject);
  }

}
As per your requirement, Sailsjs bootstrap file is the best place to set database credentials.

sails.config.bootstrap is a customizable, asynchronous bootstrap
  function that runs before your Sails app gets lifted (i.e. starts up).

The code in bootstrap :
sails.config.connections.developmentServer.host = setDBCredentials()();

In the above "developmentServer" is the for MySQL adapter key.
developmentServer: {
    adapter: 'sails-mysql',
    host: '',
    user: 'root', //optional
    password: 'password', //optional
    database: 'bb' //optional
  }

Lift the app , it will set the host into your adapter

A: mention it on Node_env file
username: (process.env.NODE_ENV == "production") ? "productionUser" : "otherUserName",
password: (process.env.NODE_ENV == "production") ? "productionPassword" : "otherPassword";

or create a js file on the app root path and export the config file, now on connection.js simply import the file and use it
export config
Ex:
dbconfig.js
  const config =  (username, password) => {
           // Do your staff hear
           return username
           return password
}
export default config

import config
Ex:
connection.js
const dbConfig = require(../dbconfig.js)
const username = dbConfig.config , password = dbConfig.config


text:
Q: Zoomed ImageView transition between activities I'm trying to make shared ImageView between two activities (for example from activity A to activity B).
The problem is after this steps:

*

*Image shared into activity

*Image zoomed in activity B;

*Going back from B activity to A;

*Watch this video

There is no problem without zooming: you can watch this
My style-v21:
<style name="AppTheme.NoActionBar" >
    <item name="android:colorEdgeEffect">@color/primary</item>
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
    <item name="android:windowDrawsSystemBarBackgrounds">true</item>
    <item name="android:statusBarColor">@android:color/transparent</item>
    <item name="android:buttonStyle">@style/MyButtonStyle</item>

    <item name="android:windowContentTransitions">true</item>
    <item name="android:windowExitTransition">@android:transition/explode</item>

    <item name="android:windowSharedElementEnterTransition">@transition/change_image_transform</item>
    <item name="android:windowSharedElementExitTransition">@transition/change_image_transform</item>
</style>

My transition:
<?xml version="1.0" encoding="utf-8"?>
<transitionSet xmlns:android="http://schemas.android.com/apk/res/android">
<changeImageTransform/>
</transitionSet>

And my ImageActivity:
public class ImageActivity extends AppCompatActivity {

public static String IMAGE_URL = "image_url";
public static String TEXT = "text";
private ProgressBar spinner;

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){
        getWindow().setSharedElementEnterTransition(TransitionInflater.from(this).inflateTransition(android.R.transition.move));
    }

    setContentView(R.layout.activity_image);

    ImageView image = (ImageView) findViewById(R.id.image);
    TextView tvName = (TextView) findViewById(R.id.tvName);
    spinner = (ProgressBar) findViewById(R.id.pbLoading);

    String imageUrl = getIntent().getStringExtra(IMAGE_URL);
    String text = getIntent().getStringExtra(TEXT);

    if (text != null)
        tvName.setText(text);
    else tvName.setVisibility(View.GONE);

    DisplayImageOptions options = new DisplayImageOptions.Builder()
            .cacheOnDisk(true)
            .bitmapConfig(Bitmap.Config.RGB_565)
            .considerExifParams(true)
            .displayer(new FadeInBitmapDisplayer(300))
            .imageScaleType(ImageScaleType.NONE)
            .build();

    ImageLoader.getInstance().displayImage(imageUrl, image, options, simpleImageLoadingListener);
}

SimpleImageLoadingListener simpleImageLoadingListener = new SimpleImageLoadingListener(){
    @Override
    public void onLoadingStarted(String imageUri, View view) {
        spinner.setVisibility(View.VISIBLE);
    }

    @Override
    public void onLoadingFailed(String imageUri, View view, FailReason failReason) {
        String message = null;
        switch (failReason.getType()) {
            case IO_ERROR:
                message = "Input/Output error";
                break;
            case DECODING_ERROR:
                message = "Image can't be decoded";
                break;
            case NETWORK_DENIED:
                message = "Downloads are denied";
                break;
            case OUT_OF_MEMORY:
                message = "Out Of Memory error";
                break;
            case UNKNOWN:
                message = "Unknown error";
                break;
        }
        Toast.makeText(view.getContext(), message, Toast.LENGTH_SHORT).show();

        spinner.setVisibility(View.GONE);
    }

    @Override
    public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
        spinner.setVisibility(View.GONE);
    }
};
}

My intent from activity A to activity B (ImageActivity)
   Intent goToImage = new Intent(InfoActivity.this, ImageActivity.class);
        goToImage.putExtra(ImageActivity.IMAGE_URL, cafe.getImageUrl());
        goToImage.putExtra(ImageActivity.TEXT, cafe.getName());
        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
            ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(InfoActivity.this,
                    imgCompany, "image");
            startActivity(goToImage, options.toBundle());
        } else {
            startActivity(goToImage);
        }

I know that happens because of different image size & scaletypes, on activity A it centerCrop and has fixed size, on activity B it maxtrix and match_parent.
How to make resize animation in transition?
In my case, resizing going after image being moved to it's position...


text:
Q: Recuperar informação do firebase e colocar num textformfield flutter Estou tentando recuperar informação do meu banco de dados, porém quando eu tento utilizar os dados que recuperei nos widgets, tenho um erro dizendo que minhas strings (onde estou colocando o conteúdo do firebase) estão vazias.
O que estou tentando fazer é uma tela onde consigo editar informações; porém, no meu TextFormField, gostaria que elas fossem previamente carregadas para que o usuário não precisasse digitar tudo novamente.
class DetalhesPendencia extends StatelessWidget {

  Pendencia pendencia;

  DetalhesPendencia(this.pendencia);
  TextEditingController _controllerDescricao = TextEditingController();
  TextEditingController _controllerEstagio = TextEditingController();
  TextEditingController _controllerResponsavel = TextEditingController();

  _carregarInformacoes () async {

    FirebaseFirestore db = FirebaseFirestore.instance;
    DocumentSnapshot snapshot = await db.collection("barcos")
    .doc(pendencia.embarcacao)
    .collection("pendencias")
    .doc(pendencia.id)
    .get();

    var dados = snapshot.data();
    String preDescricao = dados["descricao"];
    String preEstagio = dados["estagio"];
    String preResponsavel = dados ["responsavel"];

  }

  _salvarPendencia () async {

    DateFormat dateFormat = DateFormat("dd / MM / yyyy: hh:mm");

    String descricao = _controllerDescricao.text;
    String estagio = _controllerEstagio.text;
    String responsavel = _controllerResponsavel.text;
    String data = dateFormat.format(DateTime.now());

    pendencia.descricao = descricao;
    pendencia.estagio = estagio;
    pendencia.responsavel = responsavel;
    pendencia.data = data;

    FirebaseFirestore db = FirebaseFirestore.instance;
    db.collection("barcos")
        .doc(pendencia.embarcacao)
        .collection("pendencias")
        .doc(pendencia.id)
        .set(pendencia.toMap());

  }

  @override
  Widget build(BuildContext context) {

    _carregarInformacoes();

    return Scaffold(
      appBar: AppBar (
        title: Text ("Pendência"),
      ),
      floatingActionButton: FloatingActionButton(
        foregroundColor: Colors.green,
        child: Icon(Icons.edit),
        onPressed: () {
          _salvarPendencia();
          Navigator.pop(context);
        },
      ),
      body: SingleChildScrollView(
        child: Container(
          padding: EdgeInsets.all(16),
          child: Column (
            crossAxisAlignment: CrossAxisAlignment.start,
            children: <Widget>[
              Text (pendencia.item
                ,
                style: TextStyle(
                    fontSize: 32,
                    fontWeight: FontWeight.bold,
                    color: Colors.black
                ),
              ),
              Padding(
                padding: EdgeInsets.symmetric(vertical: 16),
                child: Divider(),
              ),
              Text ("Descrição:"
                ,
                style: TextStyle(
                    fontSize: 18,
                    fontWeight: FontWeight.bold,
                    color: Colors.black
                ),
              ),
              TextFormField(

                  initialValue: preDescricao;
                  controller: _controllerDescricao,
                  keyboardType: TextInputType.text,
                  style: TextStyle(fontSize: 20),
                decoration: InputDecoration(
                    contentPadding: EdgeInsets.fromLTRB(32, 16, 32, 16),
                    hintText: "descricao",
                    filled: true,
                    fillColor: Colors.white,
                    border: OutlineInputBorder(
                        borderRadius: BorderRadius.circular(6))),
              ),

A: Você chama a função de recuperar no initState?
Pode levar uma pequena fração de segundos até que os dados sejam recuperados, devido a isso talvez seja interessante você salvar os dados que deseja recuperar diretamente no controller ( _controller.text = preDescricao). Assim o texto será alterado independente se você chamar setState ou não. Porque passando para initialValie do textForm o valor que será carregado é o valor que a string possui no momento da criação do Widget.


text:
Q: Longtable exceeds page length Situation:
I am using rmarkdown and xtable to iterate the creation of several tables, and output them in Latex to create a PDF.
Given that most tables are long, Im using Longtable package.
Also, i need to insert two aligned images on the top of each page. For this i use Fancyhdr and Graphicx to insert them in the header.
Complication:
The tables created exceed the page length. They brake and continue in the next page, but there are several rows below the page length, thus, are not shown in the pdf. Same with footer.
This wont happen if I dont insert the images. Without the images at the top of the pages, longtable works well.
Also, i noted that the second half of a splitted table (that is, the chunk of the table that longtable sends to the next page) starts lower in the page, compared to where the first table of the document starts.
Problem:
I cant get longtable to break the tables within the limits of the page length.
Code from rmarkdown (im showing the xtable code):
---
title: "Reportes generales"
output:
  pdf_document:
header-includes:
- \geometry{layout=a4paper}
- \usepackage{fancyhdr}
- \pagestyle{fancy}
- \usepackage{graphicx}
- \usepackage{longtable}
- \usepackage[spanish]{babel}
- \usepackage[]{hyperref}
- \hypersetup{
    bookmarksnumbered=true,
    bookmarksopen=true,
    bookmarksopenlevel=1,
    colorlinks=true,
    linkcolor=blue,
    pdfstartview=Fit,
    hyperindex=True
    hyperfigures=True
  }
- \fancyhead[R]{\includegraphics[height=5cm]{insight-top-right-2.png}}
- \fancyhead[L]{\raisebox{2.3\height}{\includegraphics[height=2.5cm]{logo.png}}}
- \renewcommand{\headrulewidth}{0pt}

---
\listoftables

\newpage

```{r, echo=FALSE, results='asis'}
datawrangling with r and calculations

### Here i am writing the code that will be inserted in the first line of the longtable, which states the use of endhead and endfoot, and footnotesize

addtorow<-list()
addtorow$pos<-list()
addtorow$pos[[1]]<-c(0)
addtorow$command<-c(paste("\\hline \n",
" \\endhead \n",
" \\hline \n",
" {\\footnotesize Continued on next page} \n",
" \\endfoot \n",
" \\endlastfoot \n",sep=""))

### Here is the tranformation of the dataframes to LaTex using xtable, note that tempmatrix is the matrix which i want to print in a pdf. This iterates for several dataframes, spawining several Longtables

xt <- capture.output(print.xtable(xtable(tempMatrix, align = "l|p{4cm}|r|r|r|r|r|"), include.rownames = FALSE, comment = FALSE, floating = FALSE, tabular.environment = "longtable",add.to.row=addtorow))
cat(xt, sep="\n")
```

Finally, here is what the table in latex code looks like. This is one of several tables, only the information changes, format is the same for all:
\begin{longtable}{|p{4cm}|r|r|r|r|r|}
  \hline
DEPARTAMENTO & Septiembre14 & Agosto15 & Septiembre15 & YTD14 & YTD15 \\
  \hline
 \endhead
 \hline
 {\footnotesize Continued on next page}
 \endfoot
 \endlastfoot
 \hline
BEBE & 3,136,143 & 3,908,120 & 3,970,474 & 167,346,367 & 253,682,083 \\
  BELLEZA DE LA PIEL & 4,056,518 & 4,383,270 & 5,657,551 & 268,024,922 & 376,562,389 \\
  CUIDADO CAPILAR & 3,598,571 & 4,485,420 & 4,860,410 & 231,520,280 & 360,023,595 \\
  CUIDADO ORAL & 1,466,654 & 2,077,587 & 2,149,403 & 106,409,239 & 159,647,444 \\
  CUIDADO PERSONAL & 5,993,436 & 7,920,352 & 8,268,905 & 431,726,918 & 615,126,409 \\
  LIMPIEZA &   283,785 &   254,940 &   306,183 &  26,618,969 &  28,738,917 \\
  NO COMESTIBLES &        NA &        NA &        NA &  14,600,825 &  23,053,981 \\
  OTC &         0 &         0 &    24,176 &           0 &     108,372 \\
  PRIMEROS AUXILIOS &   546,344 &   857,384 &   924,860 &  36,689,415 &  53,886,336 \\
   \hline
\hline
\end{longtable}

Possible solutions already tried and failed, by themself and in combination:
- \geometry{top=0cm}
- \geometry{bottom=5cm}
- \geometry{headsep=0pt}
- \geometry{includehead}

I really cant figure out how to solve this, and im getting desperate.
Thanks
UPDATE: I fount that longtable may have some issues calculating the size of the page when a float is on the same page, from here
May that be the problem? maybe the images in the header messes up the way longtable calculates the page length. They propose a modification to longtable.sty, but i cant find it.
UPDATE2:  I could obtain the tex file rmarkdown uses to generate the pdf,as suggested here it is:
\documentclass[]{article}
\usepackage{lmodern}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\usepackage{fixltx2e} % provides \textsubscript
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  \usepackage[T1]{fontenc}
  \usepackage[utf8]{inputenc}
\else % if luatex or xelatex
  \ifxetex
    \usepackage{mathspec}
    \usepackage{xltxtra,xunicode}
  \else
    \usepackage{fontspec}
  \fi
  \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
  \newcommand{\euro}{€}
\fi
% use upquote if available, for straight quotes in verbatim     environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
% use microtype if available
\IfFileExists{microtype.sty}{%
\usepackage{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\usepackage[margin=1in]{geometry}
\ifxetex
  \usepackage[setpagesize=false, % page size defined by xetex
              unicode=false, % unicode breaks when used with xetex
              xetex]{hyperref}
\else
  \usepackage[unicode=true]{hyperref}
\fi
\hypersetup{breaklinks=true,
            bookmarks=true,
            pdfauthor={},
            pdftitle={Reportes generales},
            colorlinks=true,
            citecolor=blue,
            urlcolor=blue,
            linkcolor=magenta,
            pdfborder={0 0 0}}
\urlstyle{same}  % don't use monospace font for urls
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}
\setlength{\emergencystretch}{3em}  % prevent overfull lines
\setcounter{secnumdepth}{0}

%%% Use protect on footnotes to avoid problems with footnotes in titles
\let\rmarkdownfootnote\footnote%
\def\footnote{\protect\rmarkdownfootnote}

%%% Change title format to be more compact
\usepackage{titling}

% Create subtitle command for use in maketitle
\newcommand{\subtitle}[1]{
  \posttitle{
    \begin{center}\large#1\end{center}
    }
}

\setlength{\droptitle}{-2em}
  \title{Reportes generales}
  \pretitle{\vspace{\droptitle}\centering\huge}
  \posttitle{\par}
  \author{}
  \preauthor{}\postauthor{}
  \date{}
  \predate{}\postdate{}

\geometry{layout=a4paper}
\usepackage{fancyhdr}
\pagestyle{fancy}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage[spanish]{babel}
\usepackage[]{hyperref}
\hypersetup{ bookmarksnumbered=true, bookmarksopen=true, bookmarksopenlevel=1, colorlinks=true, linkcolor=blue, pdfstartview=Fit, hyperindex=True hyperfigures=True }
\geometry{top=0.1cm}
\geometry{headsep=0pt}
\fancyhfoffset[L]{72pt}
\fancyhfoffset[R]{72pt}
\fancyhead[L]{\raisebox{0.7\height}{\includegraphics[height=1.0cm]{logo.png}}}
\fancyhead[R]{\includegraphics[height=2cm]{insight-top-right-3.png}}
\setlength{\LTpre}{1pt}
\setlength{\LTpost}{1pt}
\renewcommand{\headrulewidth}{0pt}

\begin{document}

\maketitle

\listoftables

\newpage

\begin{longtable}{|p{4cm}|r|r|r|r|r|}
  \hline
DEPARTAMENTO & Septiembre14 & Agosto15 & Septiembre15 & YTD14 & YTD15 \\
  \hline
 \endhead
 \hline
 {\footnotesize Continued on next page}
 \endfoot
 \endlastfoot
 \hline
BEBE & 3,136,143 & 3,908,120 & 3,970,474 & 167,346,367 & 253,682,083 \\
  BELLEZA DE LA PIEL & 4,056,518 & 4,383,270 & 5,657,551 & 268,024,922 & 376,562,389 \\
  CUIDADO CAPILAR & 3,598,571 & 4,485,420 & 4,860,410 & 231,520,280 & 360,023,595 \\
  CUIDADO ORAL & 1,466,654 & 2,077,587 & 2,149,403 & 106,409,239 & 159,647,444 \\
  CUIDADO PERSONAL & 5,993,436 & 7,920,352 & 8,268,905 & 431,726,918 & 615,126,409 \\
  LIMPIEZA &   283,785 &   254,940 &   306,183 &  26,618,969 &  28,738,917 \\
  NO COMESTIBLES &        NA &        NA &        NA &  14,600,825 &  23,053,981 \\
  OTC &         0 &         0 &    24,176 &           0 &     108,372 \\
  PRIMEROS AUXILIOS &   546,344 &   857,384 &   924,860 &  36,689,415     &  53,886,336 \\
   \hline
\hline
\end{longtable}\begin{longtable}{|p{4cm}|r|r|r|}
  \hline
DEPARTAMENTO & varMA & varMMAA & varYTD \\
  \hline
BEBE &  1.60 & 26.60 & 51.59 \\
  BELLEZA DE LA PIEL & 29.07 & 39.47 & 40.50 \\
  CUIDADO CAPILAR &  8.36 & 35.06 & 55.50 \\
  CUIDADO ORAL &  3.46 & 46.55 & 50.03 \\
  CUIDADO PERSONAL &  4.40 & 37.97 & 42.48 \\
  LIMPIEZA & 20.10 &  7.89 &  7.96 \\
  NO COMESTIBLES &    NA &    NA & 57.90 \\
  OTC &   Inf &   Inf &   Inf \\
  PRIMEROS AUXILIOS &  7.87 & 69.28 & 46.87 \\
   \hline
\hline
\end{longtable}

\begin{longtable}{|p{4cm}|r|r|r|r|r|}
\caption{Valores Absolutos-Categorias de  BELLEZA DE LA PIEL} \\
  \hline
CATEGORY & Septiembre14 & Agosto15 & Septiembre15 & YTD14 & YTD15 \\
  \hline
 \endhead
 \hline
 {\footnotesize Continued on next page}
 \endfoot
 \endlastfoot
 \hline
CREMAS FACIALES & 2,803,254 & 3,121,176 & 3,595,056 & 173,742,026 & 230,131,906 \\
  CREMAS P/CUERPO &   792,387 &   832,099 & 1,117,033 &  56,567,912 &  79,910,260 \\
  BRONCEADORES &   393,863 &   394,842 &   800,450 &  34,884,696 &  62,260,683 \\
  CREMAS REDUCTORAS &    67,014 &    35,153 &   145,012 &   2,830,287 &   4,259,539 \\
   \hline
\hline
\end{longtable}\begin{longtable}{|p{4cm}|r|r|r|}
\caption{Variaciones-Categorias de  BELLEZA DE LA PIEL} \\
  \hline
CATEGORY & varMA & varMMAA & varYTD \\
  \hline
 \endhead
 \hline
 {\footnotesize Continued on next page}
 \endfoot
 \endlastfoot
 \hline
CREMAS FACIALES &  15.18 &  28.25 & 32.46 \\
  CREMAS P/CUERPO &  34.24 &  40.97 & 41.26 \\
  BRONCEADORES & 102.73 & 103.23 & 78.48 \\
  CREMAS REDUCTORAS & 312.52 & 116.39 & 50.50 \\
   \hline
\hline
\end{longtable}\begin{longtable}{|p{4cm}|r|r|r|r|r|}
\caption{Valores Absolutos-Categorias de  CUIDADO PERSONAL} \\
  \hline
CATEGORY & Septiembre14 & Agosto15 & Septiembre15 & YTD14 & YTD15 \\
  \hline
 \endhead
 \hline
 {\footnotesize Continued on next page}
 \endfoot
 \endlastfoot
 \hline
DESODORANTES CORPORALES & 2,063,564 & 2,735,511 & 2,720,461 & 154,726,728 & 213,362,316 \\
  TINTURAS & 1,011,545 & 1,309,711 & 1,441,668 &  61,215,451 & 103,688,813 \\
  JABONES DE TOCADOR &   857,958 & 1,132,913 & 1,145,764 &  67,971,560 &  96,365,051 \\
  PROTECCION SANITARIA FEMENINA &   996,205 & 1,428,784 & 1,465,860 &  68,427,382 &  92,990,493 \\
  HOJAS Y SISTEMAS DE AFEITAR &   463,789 &   577,544 &   684,020 &  36,823,238 &  49,877,736 \\
  DESODORANTES PEDICOS &   275,378 &   302,852 &   349,053 &  18,068,231 &  26,220,716 \\
  PRODUCTOS DEPILATORIOS &   169,226 &   200,146 &   225,431 &  12,888,939 &  17,012,924 \\
  CREMAS Y ESPUMAS DE AFEITAR &    65,707 &    81,179 &   101,928 &   5,363,923 &   7,065,802 \\
  JABONES DE TOCADOR INFANTIL &    41,112 &    76,530 &    60,340 &   2,996,544 &   4,375,777 \\
  PROTECTORES MAMARIOS &    25,921 &    36,486 &    37,044 &   1,582,267 &   2,538,494 \\
  JABONES Y DETERGENTES LIQUIDOS &    23,031 &    38,695 &    37,336 &   1,662,655 &   1,628,287 \\
   \hline
\hline
\end{longtable}\begin{longtable}{|p{4cm}|r|r|r|}
\caption{Variaciones-Categorias de  CUIDADO PERSONAL} \\
  \hline
CATEGORY & varMA & varMMAA & varYTD \\
  \hline
 \endhead
 \hline
 {\footnotesize Continued on next page}
 \endfoot
 \endlastfoot
 \hline
DESODORANTES CORPORALES &  \textcolor{red}{-0.55} & 31.83 & 37.90 \\
  TINTURAS &  10.08 & 42.52 & 69.38 \\
  JABONES DE TOCADOR &   1.13 & 33.55 & 41.77 \\
  PROTECCION SANITARIA FEMENINA &   2.59 & 47.14 & 35.90 \\
  HOJAS Y SISTEMAS DE AFEITAR &  18.44 & 47.49 & 35.45 \\
  DESODORANTES PEDICOS &  15.26 & 26.75 & 45.12 \\
  PRODUCTOS DEPILATORIOS &  12.63 & 33.21 & 32.00 \\
  CREMAS Y ESPUMAS DE AFEITAR &  25.56 & 55.13 & 31.73 \\
  JABONES DE TOCADOR INFANTIL & \textcolor{red}{-21.16} & 46.77 & 46.03 \\
  PROTECTORES MAMARIOS &   1.53 & 42.91 & 60.43 \\
  JABONES Y DETERGENTES LIQUIDOS &  \textcolor{red}{-3.51} & 62.11 & \textcolor{red}{-2.07} \\
   \hline
\hline
\end{longtable}\begin{longtable}{|p{4cm}|r|r|r|r|r|}
\caption{Valores Absolutos-Categorias de  BEBE} \\
  \hline
CATEGORY & Septiembre14 & Agosto15 & Septiembre15 & YTD14 & YTD15 \\
  \hline
 \endhead
 \hline
 {\footnotesize Continued on next page}
 \endfoot
 \endlastfoot
 \hline
PA-ALES DESCARTABLES P/BEBES & 2,122,630 & 2,780,865 & 3,079,733 & 113,368,516 & 188,264,578 \\
  TOALLAS HUMEDAS &   769,750 &   624,151 &   588,020 &  35,922,853 &  42,581,782 \\
  COLONIAS &   136,517 &   394,210 &   190,754 &  11,578,566 &  15,923,990 \\
  HISOPOS &    86,054 &    89,065 &    87,441 &   5,032,377 &   5,123,320 \\
  ACEITES INFANTILES &    21,191 &    19,603 &    22,353 &   1,439,380 &   1,749,265 \\
  ALIMENTOS PARA BEBE &         0 &       226 &     2,172 &       4,674 &      39,148 \\
   \hline
\hline
\end{longtable}\begin{longtable}{|p{4cm}|r|r|r|}
\caption{Variaciones-Categorias de  BEBE} \\
  \hline
CATEGORY & varMA & varMMAA & varYTD \\
  \hline
 \endhead
 \hline
 {\footnotesize Continued on next page}
 \endfoot
 \endlastfoot
 \hline
PA-ALES DESCARTABLES P/BEBES &  10.75 &  45.09 &  66.06 \\
  TOALLAS HUMEDAS &  \textcolor{red}{-5.79} & \textcolor{red}{-23.61} &  18.54 \\
  COLONIAS & \textcolor{red}{-51.61} &  39.73 &  37.53 \\
  HISOPOS &  \textcolor{red}{-1.82} &   1.61 &   1.81 \\
  ACEITES INFANTILES &  14.03 &   5.48 &  21.53 \\
  ALIMENTOS PARA BEBE & 861.38 &    Inf & 737.56 \\
   \hline
\hline
\end{longtable}\begin{longtable}{|p{4cm}|r|r|r|r|r|}
\caption{Valores Absolutos-Categorias de  CUIDADO CAPILAR} \\
  \hline
CATEGORY & Septiembre14 & Agosto15 & Septiembre15 & YTD14 & YTD15 \\
  \hline
 \endhead
 \hline
 {\footnotesize Continued on next page}
 \endfoot
 \endlastfoot
 \hline
SHAMPOO & 1,773,948 & 2,247,855 & 2,356,224 & 121,419,925 & 175,429,757 \\
  TRATAMIENTOS POST LAVADO CAPIL & 1,657,579 & 2,035,991 & 2,289,201 &  97,430,656 & 168,517,341 \\
  FIJADORES Y BRILLANTINAS &   167,044 &   201,573 &   214,985 &  12,669,698 &  16,076,497 \\
   \hline
\hline
\end{longtable}\begin{longtable}{|p{4cm}|r|r|r|}
\caption{Variaciones-Categorias de  CUIDADO CAPILAR} \\
  \hline
CATEGORY & varMA & varMMAA & varYTD \\
  \hline
 \endhead
 \hline
 {\footnotesize Continued on next page}
 \endfoot
 \endlastfoot
 \hline
SHAMPOO &  4.82 & 32.82 & 44.48 \\
  TRATAMIENTOS POST LAVADO CAPIL & 12.44 & 38.11 & 72.96 \\
  FIJADORES Y BRILLANTINAS &  6.65 & 28.70 & 26.89 \\
   \hline
\hline
\end{longtable}\begin{longtable}{|p{4cm}|r|r|r|r|r|}
\caption{Valores Absolutos-Categorias de  CUIDADO ORAL} \\
  \hline
CATEGORY & Septiembre14 & Agosto15 & Septiembre15 & YTD14 & YTD15 \\
  \hline
 \endhead
 \hline
 {\footnotesize Continued on next page}
 \endfoot
 \endlastfoot
 \hline
CREMAS DENTALES & 806,334 & 1,119,215 & 1,153,052 & 55,999,726 & 86,000,224 \\
  CEPILLOS DENTALES & 437,088 &   633,310 &   652,061 & 32,699,481 & 48,952,653 \\
  ENJUAGUE BUCAL & 196,601 &   286,640 &   307,849 & 15,756,802 & 21,779,345 \\
  HILOS DENTALES &  26,631 &    38,422 &    36,441 &  1,953,230 &  2,915,221 \\
   \hline
\hline
\end{longtable}\begin{longtable}{|p{4cm}|r|r|r|}
\caption{Variaciones-Categorias de  CUIDADO ORAL} \\
  \hline
CATEGORY & varMA & varMMAA & varYTD \\
  \hline
 \endhead
 \hline
 {\footnotesize Continued on next page}
 \endfoot
 \endlastfoot
 \hline
CREMAS DENTALES &  3.02 & 43.00 & 53.57 \\
  CEPILLOS DENTALES &  2.96 & 49.18 & 49.70 \\
  ENJUAGUE BUCAL &  7.40 & 56.59 & 38.22 \\
  HILOS DENTALES & \textcolor{red}{-5.16} & 36.83 & 49.25 \\
   \hline
\hline
\end{longtable}\begin{longtable}{|p{4cm}|r|r|r|r|r|}
\caption{Valores Absolutos-Categorias de  ALMACEN} \\
  \hline
CATEGORY & Septiembre14 & Agosto15 & Septiembre15 & YTD14 & YTD15 \\
  \hline
 \endhead
 \hline
 {\footnotesize Continued on next page}
 \endfoot
 \endlastfoot
 \hline
LECHES MATERNIZADAS & 690,342 & 1,081,196 & 1,117,606 & 50,599,593 & 78,413,709 \\
  LECHES FLUIDAS INFANTILES & 305,284 &   406,650 &   356,478 & 17,418,316 & 32,561,526 \\
  EDULCORANTES &  81,847 &   108,511 &   108,040 &  5,062,420 &  8,405,514 \\
  LECHES EN POLVO ENTERAS Y DESC &  50,583 &    65,481 &    71,004 &  4,146,129 &  5,330,949 \\
  PASTILLAS &       0 &       200 &       150 &          0 &      9,000 \\
  POSTRES PREPARADOS &       0 &     5,398 &         0 &          0 &      5,398 \\
  AZUCAR &      NA &        NA &        NA &          0 &      1,546 \\
   \hline
    \hline
\end{longtable}\begin{longtable}{|p{4cm}|r|r|r|}
\caption{Variaciones-Categorias de  ALMACEN} \\
  \hline
CATEGORY & varMA & varMMAA & varYTD \\
  \hline
 \endhead
 \hline
 {\footnotesize Continued on next page}
 \endfoot
 \endlastfoot
 \hline
LECHES MATERNIZADAS &    3.37 & 61.89 & 54.97 \\
  LECHES FLUIDAS INFANTILES &  \textcolor{red}{-12.34} & 16.77 & 86.94 \\
  EDULCORANTES &   \textcolor{red}{-0.43} & 32.00 & 66.04 \\
  LECHES EN POLVO ENTERAS Y DESC &    8.44 & 40.37 & 28.58 \\
  PASTILLAS &  \textcolor{red}{-25.00} &   Inf &   Inf \\
  POSTRES PREPARADOS & \textcolor{red}{-100}.00 &   NaN &   Inf \\
  AZUCAR &      NA &    NA &   Inf \\
   \hline
\hline
\end{longtable}\begin{longtable}{|p{4cm}|r|r|r|r|r|}
\caption{Valores Absolutos-Categorias de  PRIMEROS AUXILIOS} \\
  \hline
CATEGORY & Septiembre14 & Agosto15 & Septiembre15 & YTD14 & YTD15 \\
  \hline
 \endhead
 \hline
 {\footnotesize Continued on next page}
 \endfoot
 \endlastfoot
 \hline
PA-ALES DESCARTABLES P/ADULTO & 291,871 & 513,709 & 509,992 & 19,938,505 & 34,598,008 \\
  ALGODON & 109,650 & 128,338 & 129,161 &  7,944,323 &  9,423,255 \\
  PA-UELOS DESCARTABLES & 144,823 & 200,002 & 201,561 &  8,806,587 &  9,171,453 \\
  APOSITOS ADHESIVOS &       0 &  15,335 &  84,147 &          0 &    693,620 \\
   \hline
\hline
\end{longtable}\begin{longtable}{|p{4cm}|r|r|r|}
\caption{Variaciones-Categorias de  PRIMEROS AUXILIOS} \\
  \hline
CATEGORY & varMA & varMMAA & varYTD \\
  \hline
 \endhead
 \hline
 {\footnotesize Continued on next page}
 \endfoot
 \endlastfoot
 \hline
PA-ALES DESCARTABLES P/ADULTO &  \textcolor{red}{-0.72} & 74.73 & 73.52 \\
  ALGODON &   0.64 & 17.79 & 18.62 \\
  PA-UELOS DESCARTABLES &   0.78 & 39.18 &  4.14 \\
  APOSITOS ADHESIVOS & 448.73 &   Inf &   Inf \\
   \hline
\hline
\end{longtable}\begin{longtable}{|p{4cm}|r|r|r|r|r|}
\caption{Valores Absolutos-Categorias de  NO COMESTIBLES} \\
  \hline
CATEGORY & Septiembre14 & Agosto15 & Septiembre15 & YTD14 & YTD15 \\
  \hline
 \endhead
 \hline
 {\footnotesize Continued on next page}
 \endfoot
 \endlastfoot
 \hline
PERSONAL CARE & 202,776 & 342,134 & 283,591 & 12,525,189 & 19,873,598 \\
  PILAS Y BATERIAS &  26,811 &  51,955 &  34,284 &  2,073,855 &  3,170,379 \\
  LAMPARAS ELECTRICAS &      63 &      77 &     341 &      1,781 &     10,004 \\
   \hline
\hline
\end{longtable}\begin{longtable}{|p{4cm}|r|r|r|}
\caption{Variaciones-Categorias de  NO COMESTIBLES} \\
  \hline
CATEGORY & varMA & varMMAA & varYTD \\
  \hline
 \endhead
 \hline
 {\footnotesize Continued on next page}
 \endfoot
 \endlastfoot
 \hline
PERSONAL CARE & \textcolor{red}{-17.11} &  39.85 &  58.67 \\
  PILAS Y BATERIAS & \textcolor{red}{-34.01} &  27.87 &  52.87 \\
  LAMPARAS ELECTRICAS & 342.86 & 443.43 & 461.72 \\
   \hline
\hline
\end{longtable}\begin{longtable}{|p{4cm}|r|r|r|r|r|}
\caption{Valores Absolutos-Categorias de  LIMPIEZA} \\
  \hline
CATEGORY & Septiembre14 & Agosto15 & Septiembre15 & YTD14 & YTD15 \\
  \hline
 \endhead
 \hline
 {\footnotesize Continued on next page}
 \endfoot
 \endlastfoot
 \hline
INSECTICIDAS TOTAL & 46,733 & 25,317 & 70,275 & 8,405,776 & 10,842,602 \\
  DESODORIZ. AMBIENTALES & 47,641 & 41,725 & 36,204 & 4,066,838 &  3,143,191 \\
  PAPEL HIGIENICO & 41,524 & 34,182 & 43,812 & 3,376,920 &  2,879,686 \\
  DETERGENTES LIQUIDOS & 16,513 & 19,675 & 19,315 & 1,252,239 &  1,586,210 \\
  ROLLOS DE PAPEL P/COCINA & 23,198 & 17,788 & 19,031 & 1,604,990 &  1,395,317 \\
  JABONES Y DETERGENTES EN POLVO & 14,511 & 16,699 & 16,702 &   961,115 &  1,284,704 \\
  DESOD.PARA INODOROS & 15,230 & 12,561 & 12,982 & 1,142,564 &  1,092,752 \\
  DILUIBLES & 11,072 & 12,906 & 13,469 &   797,580 &  1,052,769 \\
  GUANTES DE LATEX & 13,745 & 12,303 & 11,359 & 1,017,632 &    834,462 \\
  LIMPIADORES Y DESENGRASANTES N &  6,893 & 10,171 &  7,555 &   532,131 &    645,236 \\
  SUAVIZANTES &  5,725 &  9,575 &  7,670 &   572,759 &    640,669 \\
  LAVANDINAS &  5,694 &  7,353 &  7,360 &   464,882 &    602,875 \\
  CERAS PARA PISOS &  4,613 &  4,501 &  4,444 &   364,140 &    382,369 \\
  LUSTRAMUEBLES &  7,141 &  3,614 &  5,788 &   492,708 &    365,615 \\
  VIDRIOS Y MULTIUSO &  3,271 &  3,911 &  3,768 &   271,616 &    302,953 \\
  PRODUCTOS P/EL LAVADO FINO &  2,904 &  2,926 &  3,572 &   117,832 &    289,474 \\
  JABONES Y DETERGENTES EN PANES &  2,891 &  3,380 &  3,656 &   193,319 &    283,411 \\
  FIBRAS LIMPIADORAS &  3,406 &  3,342 &  3,295 &   231,409 &    233,841 \\
  LANAS/ESPONJAS Y TRAPOS METALI &  2,230 &  2,715 &  2,814 &   145,893 &    210,034 \\
  COCINA Y ANTIGRASA &  1,973 &  3,175 &  4,267 &   121,913 &    205,040 \\
  QUITAMANCHAS &  2,121 &  2,416 &  2,449 &   140,739 &    135,342 \\
  PA-OS SINTETICOS &  1,826 &  2,861 &  2,762 &   145,271 &    128,108 \\
  APRESTOS &    947 &    873 &  1,114 &    67,115 &     95,356 \\
  INODOROS &    874 &    798 &  1,216 &     9,834 &     51,266 \\
  SERVILLETAS DE PAPEL &    856 &     33 &    884 &   105,955 &     45,377 \\
  DESTAPACA-ERIAS &    252 &    140 &    420 &    15,798 &     10,260 \\
   \hline
\hline
\end{longtable}\begin{longtable}{|p{4cm}|r|r|r|}
\caption{Variaciones-Categorias de  LIMPIEZA} \\
  \hline
CATEGORY & varMA & varMMAA & varYTD \\
  \hline
 \endhead
 \hline
 {\footnotesize Continued on next page}
 \endfoot
 \endlastfoot
 \hline
INSECTICIDAS TOTAL &   177.58 &  50.38 &  28.99 \\
  DESODORIZ. AMBIENTALES &   \textcolor{red}{-13.23} & \textcolor{red}{-24.01} & \textcolor{red}{-22.71} \\
  PAPEL HIGIENICO &    28.18 &   5.51 & \textcolor{red}{-14.72} \\
  DETERGENTES LIQUIDOS &    \textcolor{red}{-1.83} &  16.97 &  26.67 \\
  ROLLOS DE PAPEL P/COCINA &     6.99 & \textcolor{red}{-17.96} & \textcolor{red}{-13.06} \\
  JABONES Y DETERGENTES EN POLVO &     0.02 &  15.10 &  33.67 \\
  DESOD.PARA INODOROS &     3.35 & \textcolor{red}{-14.76} &  \textcolor{red}{-4.36} \\
  DILUIBLES &     4.36 &  21.65 &  32.00 \\
  GUANTES DE LATEX &    \textcolor{red}{-7.67} & \textcolor{red}{-17.36} & \textcolor{red}{-18.00} \\
  LIMPIADORES Y DESENGRASANTES N &   \textcolor{red}{-25.72} &   9.61 &  21.26 \\
  SUAVIZANTES &   \textcolor{red}{-19.90} &  33.97 &  11.86 \\
  LAVANDINAS &     0.09 &  29.27 &  29.68 \\
  CERAS PARA PISOS &    \textcolor{red}{-1.27} &  \textcolor{red}{-3.67} &   5.01 \\
  LUSTRAMUEBLES &    60.15 & \textcolor{red}{-18.95} & \textcolor{red}{-25.79} \\
  VIDRIOS Y MULTIUSO &    \textcolor{red}{-3.66} &  15.19 &  11.54 \\
  PRODUCTOS P/EL LAVADO FINO &    22.07 &  23.01 & 145.67 \\
  JABONES Y DETERGENTES EN PANES &     8.17 &  26.44 &  46.60 \\
  FIBRAS LIMPIADORAS &    \textcolor{red}{-1.40} &  \textcolor{red}{-3.26} &   1.05 \\
  LANAS/ESPONJAS Y TRAPOS METALI &     3.66 &  26.18 &  43.96 \\
  COCINA Y ANTIGRASA &    34.39 & 116.24 &  68.19 \\
  QUITAMANCHAS &     1.37 &  15.50 &  \textcolor{red}{-3.84} \\
  PA-OS SINTETICOS &    \textcolor{red}{-3.46} &  51.30 & \textcolor{red}{-11.82} \\
  APRESTOS &    27.48 &  17.56 &  42.08 \\
  INODOROS &    52.38 &  39.05 & 421.32 \\
  SERVILLETAS DE PAPEL & 2,578.79 &   3.22 & \textcolor{red}{-57.17} \\
  DESTAPACA-ERIAS &   200.00 &  66.69 & \textcolor{red}{-35.06} \\
   \hline
\hline
\end{longtable}\begin{longtable}{|p{4cm}|r|r|r|r|r|}
\caption{Valores Absolutos-Categorias de  OTC} \\
  \hline
CATEGORY & Septiembre14 & Agosto15 & Septiembre15 & YTD14 & YTD15 \\
  \hline
 \endhead
 \hline
 {\footnotesize Continued on next page}
\endfoot
 \endlastfoot
 \hline
ANTISEPTICOS & 0 & 0 & 24,176 & 0 & 108,372 \\
   \hline
\hline
\end{longtable}\begin{longtable}{|p{4cm}|r|r|r|}
\caption{Variaciones-Categorias de  OTC} \\
  \hline
CATEGORY & varMA & varMMAA & varYTD \\
  \hline
 \endhead
 \hline
 {\footnotesize Continued on next page}
 \endfoot
 \endlastfoot
 \hline
ANTISEPTICOS & Inf & Inf & Inf \\
   \hline
\hline
\end{longtable}

\end{document}

A: As I said, read the console output. It tells you precisely what the problem is and precisely what to do about it.
Package Fancyhdr Warning: \headheight is too small (12.0pt):
 Make it at least 60.50554pt.
 We now make it that large for the rest of the document.
 This may cause the page layout to be inconsistent, however.

Setting the headheight=61pt in geometry's options solves the problem. Note, however, that you have inconsistent and bizarre layout options scattered throughout the preamble, which is a recipe for trouble and confusion.
If combined, you end up with something like this
\usepackage[margin=1in,headheight=61pt,layout=a4paper,top=0.1cm,headsep=0pt]{geometry}

So you are setting all margins to 1" and then resetting the top one to 1mm. You are also setting the layout to A4 and the paper size to US letter. While it is possible that you really do need this configuration, it does seem rather unlikely.
Adding showframe, for example, we get this

Note that the whole point of longtable is that it does the breaking for you. If you are going to break up the table yourself, you might just as soon use tabulars. Keep starting and stopping the longtable environment will lead to inconsistent formatting and spacing.


text:
Q: log4net RollingFileAppender stops working after deployment My aps.net core application is running fine and generating logs and rolling them each day, however as soon I deploy a new version of the app to IIS it stops logging and also stops rolling. It only starts again if I rename the current log file to something different. But then it works as expected again.
The deployment involves stopping the app by creating a app_offline.htm file in the apps root folder.
The app runs on dot.net core 2.2.8 and the log4net version is 2.0.10.
This is the condig for my RollingFileAppender
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
    <file value="<some absolute path>\Log.txt"/>
    <appendToFile value="true" />
    <staticLogFileName value="true" />
    <rollingStyle value="Date" />
    <datePattern value=" yyyy-MM-dd" />

    <threshold value="All" />
    <layout type="log4net.Layout.PatternLayout">
        <!--<conversionPattern value="%date [%thread] %-5level %logger  - %message%newline" />-->
        <conversionPattern value="%property{log4net:HostName} %date [%thread] %-5level %logger - %message%newline%exception" />
    </layout>
</appender>

Any idea what might cause this behavior?
Windows logs:
In the windows logs I can find this error (but not always):
IISMANAGER_CRASH

IIS Manager terminated unexpectedly.

Exception:System.Runtime.Remoting.RemotingException: Cannot call disconnect on a proxy.
   at System.Runtime.Remoting.RemotingServices.Disconnect(MarshalByRefObject obj, Boolean bResetURI)
   at System.Web.Hosting.ApplicationManager.HostingEnvironmentShutdownComplete(String appId, IApplicationHost appHost)
   at System.Web.Hosting.ApplicationManager.HostingEnvironmentShutdownComplete(String appId, IApplicationHost appHost)
   at System.Web.Hosting.HostingEnvironment.OnAppDomainUnload(Object unusedObject, EventArgs unusedEventArgs)

Process:InetMgr

I also noticed that a different application gets shutdown due to the deployment because it has the same physical root. Could this be the problem? Should I add a delay between shutting down the app (via creating app_offline.htm) and the deployment?
The part with the second app is also a difference to the development deployment (which does not have the problem).

A: The problem was the second app that has the same physical address. Since it uses the same root folder it also uses the same log4net-config. This means that two processes want to log to the same file. Here comes the LockingModel from FileAppender into focus.
As the docs state

The default locking model is the FileAppender.ExclusiveLock.

And the docs for FileAppender.ExclusiveLock states

Open the file once for writing and hold it open until CloseFile() is called. Maintains an exclusive lock on the file during this time.

which causes two processes too fight over an exclusive look over the same file (and I would expect that if one process has the file opend it will only close it if the process ended (i.e. if IIS recycles it)).
The solution is to use the FileAppender.InterProcessLock which provides cross-process file locking.
To use it we just add this xml code to the appenders configuration:
<lockingModel type="log4net.Appender.FileAppender+InterProcessLock" />


text:
Q: Getting "method references are not supported in -source 1.7" in intellij, but my project setting have Java 1.8 Hi I'm trying to run a simple Java program that uses method references, but IntelliJ keeps saying:
method references are not supported in -source 1.7 (use -source 8 or higher to enable method references): 31

However, when I open my project settings the ProjectSDK is set to 1.8 and the Project language level is set to 8
When I click on Modules the Language level is set to 8
and if I look under Preferences > Build, Execution, Deployment > Build Tools > Gradle
and look at the Gradle JVM it says it is the same as the Project SDK which is 1.8.
Also if I look under Preferences > Build, Execution, Deployment > Compiler > Java Compiler
like suggest here I get 8 which is correct.
So why is it giving me that error message? I don't believe there is anything 1.7 in my project.

A: what about your "sourceCompatibility" and "targetCompatibility" in your gradle-file?
can you try to put these properties to:
def javaVersion = JavaVersion.VERSION_1_8;
sourceCompatibility=javaVersion;
targetCompatibility=javaVersion;