text:
Q: React Native components seem to be sharing a state I'm having an issue with React-native where I have a component TouchTimer which uses an AnimatedTimer component. This timer is supposed to start and stop when it is tapped, which it does, however all of the TouchTimer components I add to a page will start and stop whenever any of them are tapped, rather than only affecting the tapped component.
Below is a snippet of my component:
TouchTimer.tsx
export class TouchTimer extends React.Component<TouchTimerProps> {
  state: {
    ...
    paused: boolean,
  }

  constructor(props) {
    super(props);
    ...
    this.state = {
      ...
      paused: true,
    }
  }

  startStop() {
    this.setState({paused: !this.state.paused});
  }

  render() {
    const { time } = this.props;
    return (
      <TouchableHighlight onPress={() => this.startStop()}>
        <View>
          <AnimatedTimer
            ...
            time={time}
            pause={this.state.paused}
          />
          <View style={styles.timeContainer}>
            <Text style={styles.time}>{this.state.remaining}</Text>
          </View>
        </View>
      </TouchableHighlight>
    )
  }
}

And here is a snippet of the screen containing these components:
Details.tsx
import { TouchTimer } from '../components/TouchTimer';
...
export class RecipeDetailsScreen extends React.Component<NavigationInjectedProps> {
...
  {this.state.steps.map(step => (
    <List.Item
      key={step.id}
      title={"Step " + step.index}
      style={styles.step}
      description={step.short_desc}
      right={() => (step.time > 0 &&
        <TouchTimer
          time={step.time * 60000}
        />
      )}
    />
  )
}

I have tried wrapping the TouchTimer components in a View and changing the paused boolean to a prop, to no avail.
I have also tested to see if this issue appears when the components are not siblings, and when they are not produced as the result of a callback, and the issue still persists in both these cases.
If anybody has any advice or answers on how to make these timers independent I would very much appreciate it!

A: Curiously that component seems to be implemented with a global pauseFlag that applies to all component instances. See https://github.com/dalisalvador/react-native-animated-timer/blob/master/src/Components/AnimatedTimer.js#L34
So I don't think you're doing anything wrong here, this is a limitation of the library code that is coupling all instances of your timer to the same pauseFlag value.


text:
Q: Get the specific image file size hosted from a server Currently writing a python automation script on a website. There are 50 to 100 images hosted in a cloud, and all images are structured like this:
<img style="width:80px;height:60px;"
     src="http://someimagehostingsite.net/somefolder/some_random_url_with_timestamp">

The url doesn't have any suffix like .jpg or .png to get the info directly.
But I was able to make it by downloading the images one by one and getting the image file size. But I need to automate this process, by just accessing every url and getting the file size. Is it possible?

A: If you are just trying to get the content length of a file by URL, you can do so by downloading only the HTTP headers and checking the Content-Length field:
import requests
url='https://commons.wikimedia.org/wiki/File:Leptocorisa_chinensis_(20566589316).jpg'

http_response = requests.get(url)

print(f"Size of image {url} = {http_response.headers['Content-Length']} bytes")

However, if the image is compressed by the server before sending, the Content-Length field will contain the compressed file size (the amount of data that will actually be downloaded) rather than the uncompressed image size.
To do this for all of the images on a given page, you could use the BeautifulSoup HTML processing library to extract a list of URLs for all of the images on the page and check the file size as follows:
from time import sleep
import requests
from bs4 import BeautifulSoup as Soup

url='https://en.wikipedia.org/wiki/Agent_Orange'

html = Soup(requests.get(url).text)

image_links = [(url + a['href']) for a in html.find_all('a', {'class': 'image'})]

for img_url in image_links:
    response = requests.get(img_url)
    try:
        print(f"Size of image {img_url} = {response.headers['Content-Length']} bytes")
    except KeyError:
        print(f"Server didn't specify content length in headers for {img_url}")
    sleep(0.5)

You'll have to adjust this to your specific problem, and might have to pass other parameters to soup.find_all() to narrow it down to the specific images you're interested in, but something similar to this will achieve what you're trying to do.

A: You could try to see if you could send a HEAD request from the browser for each image. HTTP HEAD Request in Javascript/Ajax?
It depends on if the HTTP server supports it properly.  I also am not sure how you get the Content-Length header but that sounds like what you want.

redpajama_set_name: RedPajamaStackExchange


text:
Q: how to show a option value for select field in magento 2 sample code
$opt_val = array();
foreach ($attributeOptionAll->getData() as $key => $v) {
    $opt_val['value']=$v['option_id'];
    $opt_val['label'] = $v['value'];
var_dump($opt_val);

}

output:

app/code/Cm/CustomerAttribute/Model/Plugin/Checkout/Lauoutprocessor.php

<?php
namespace Cm\CustomerAttribute\Model\Plugin\Checkout;

class LayoutProcessor
{
    /**
     * @param \Magento\Checkout\Block\Checkout\LayoutProcessor $subject
     * @param array $jsLayout
     * @return array
     */
     public function __construct(\Cm\CustomerAttribute\Helper\Customerattribute $helper)
    {
        $this->helper = $helper;
    }

    public function afterProcess(
        \Magento\Checkout\Block\Checkout\LayoutProcessor $subject,
        array  $jsLayout
    ) {

 $attributeCollection = $this->helper->getUserDefinedAttribures();

    if ($attributeCollection->getSize() > 0)
    {
         foreach ($attributeCollection as $attribute)

       {
        if ($this->helper->isAttribureForCheckoutRegister($attribute->getAttributeCode()))
        {
        $frontEndLabel = $attribute->getStoreLabel($this->helper->getStoreId());
        $attributeCode = $attribute->getAttributeCode();
        $getAttributeCodeFunction = "get" .  str_replace(' ', '', ucwords(str_replace('_', ' ', $attribute->getAttributeCode())));
        $fieldRequiredClass = ($attribute->getIsRequired()) ? 'true' : '' ;
        $fieldFrontendClass = ($attribute->getFrontendClass()) ? $attribute->getFrontendClass() : '';
        $fieldInput =$attribute->getFrontendInput();
        if($fieldInput == 'text')
        {
            $fieldInputType = 'input';
            $fieldAbstract =  'abstract';
        }
        elseif ($fieldInput == 'date') {
           $fieldInputType = 'date';
           $fieldAbstract =  'abstract';
        }
        elseif ($fieldInput == 'select') {
           $fieldInputType = 'select';
           $fieldAbstract =  'select';
        }
        elseif ($fieldInput == 'multiselect') {
           $fieldInputType = 'multiselect';
           $fieldAbstract =  'abstract';

        }
        elseif ($fieldInput == 'boolean') {
           $fieldInputType = 'boolean';
           $fieldAbstract =  'abstract';

        }
         elseif ($fieldInput == 'textarea') {
           $fieldInputType = 'textarea';
           $fieldAbstract =  'abstract';

        }
        $attributeId = $attribute->getAttributeId();
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();

        $attributeOptionAll = $objectManager->create(\Magento\Eav\Model\ResourceModel\Entity\Attribute\Option\Collection::class)
                                    ->setPositionOrder('asc')
                                    ->setAttributeFilter($attributeId)
                                    ->setStoreFilter()
                                    ->load();
        $opt_val = array();
        $opt_label  = array();
        foreach ($attributeOptionAll->getData() as $key => $v)
        {
          $opt_val['value']=$v['option_id'];
          $opt_val['label'] = $v['value'];

        $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
        ['shippingAddress']['children']['shipping-address-fieldset']['children'][$attributeCode] = [
            'component' => 'Magento_Ui/js/form/element/'.$fieldAbstract.'',
            'config' => [
                'customScope' => 'shippingAddress.custom_attributes',
                'template' => 'ui/form/field',
                'elementTmpl' => 'ui/form/element/'.$fieldInputType.'',
                'id' => $attributeCode
            ],
            'dataScope' => 'shippingAddress.custom_attributes.'.$attributeCode.'',
            'label' => $frontEndLabel,
            'provider' => 'checkoutProvider',
            'visible' => true,
            'validation' =>[$fieldFrontendClass ,
                'required-entry' => $fieldRequiredClass],
            'sortOrder' => 250,
             'options' =>  [$opt_val],
            'id' => $attributeCode
        ];
         }
        }
       }
     }
     return $jsLayout;
    }
}

output:

A: The reason you are not getting all your options in dropdown is because you are creating your component in foreach. It will always give you the last option in your component.
You can update your code like below.
$opt_val = array();
$opt_label  = array();
$allOptions = [];
foreach ($attributeOptionAll->getData() as $key => $v)
{
    $opt_val['value']=$v['option_id'];
    $opt_val['label'] = $v['value'];
    $allOptions[] = $opt_val;
}

$jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
['shippingAddress']['children']['shipping-address-fieldset']['children'][$attributeCode] = [
'component' => 'Magento_Ui/js/form/element/'.$fieldAbstract.'',
'config' => [
    'customScope' => 'shippingAddress.custom_attributes',
    'template' => 'ui/form/field',
    'elementTmpl' => 'ui/form/element/'.$fieldInputType.'',
    'id' => $attributeCode
],
'dataScope' => 'shippingAddress.custom_attributes.'.$attributeCode.'',
'label' => $frontEndLabel,
'provider' => 'checkoutProvider',
'visible' => true,
'validation' =>[$fieldFrontendClass ,
    'required-entry' => $fieldRequiredClass],
'sortOrder' => 250,
 'options' =>  $allOptions,
'id' => $attributeCode
];


text:
Q: Do we need to create different adapter for each activity on Xamarin? Im working on an android project on Xamarin, i had the main page running and i want to ListViewItemOnClick each of the menu. The main activity and the clicked-menu activity are using the same data from the Entry. The question is should i create different adapter for each avtivities?

A: Not a clear question. Still I would like to give you some guidelines to use Adapters.
Basically, Adapters help Activities to bind datacollections to UI. They are inherited from BaseAdaptor class. Adapter is a per datacollection thing not a per activity thing. One Adapter can server for many Activities. For example, if you have an Adapter to read emails called EmailAdapter, you can use it is MainActivity.cs as well as any other Activities.
You must be aware of implementing the abstract methods from BaseAdapter, when you are implementing GetView you should provide a view, for which you define it as a Layout which can be used to initiate ListViews in any activity.
Eg : Consider You have 2 activities
MainActivity.cs and MailActivity.cs you need to show emails in both activities coming from same datasource. So create a layout called EmailItem.xml which will look similar to
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
    <ImageView
        android:id="@+id/ContactImage"
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:layout_margin="5dp" />
    <TextView
        android:id="@+id/ContactName"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:layout_marginLeft="5dp" />
</LinearLayout>

Create an Adapter called EmailAdapter
public class EmailAdapter : BaseAdapter
{
    List<Contact> _contactList;
    Activity _activity;

    public ContactsAdapter (Activity activity)
        {
            _activity = activity;
            FillEmail ();
        }

    void FillEmail ()
    {
        //Logic to fill email
    }

    class Email
    {
        public long Id { get; set; }
        public string DisplayName{ get; set; }
    }
}

and when you implement BaseAdapter you have to implement GetViewwhere you have to define a view and return it. So assign view to the layout you created
var view = convertView ?? _activity.LayoutInflater.Inflate (
        Resource.Layout.EmailItem, parent, false);

Now in your OnCreate() of each activities call
var emailAdapter = new EmailAdapter (this);
var emailView = FindViewById<ListView> (Resource.Id.EmailView);
emailView.Adapter = contactsAdapter;

Here EmailView can be a layout per activity.


text:
Q: Slackware 12 - installed cairo but cannot be seen I wanted to install gtk+ 2.16.5, so i also installed glib, pango and cairo. All seemed to work well, except for cairo.
At first I got an error while configuring:
Requested 'cairo >= 1.6' but version of cairo is 1.4.12
I installed the newest version of cairo without any problems, i rebooted the comp and when i started the configure again the same thing happened and it showed me the same error.
I also can see this:
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables BASE_DEPENDENCIES_CFLAGS
and BASE_DEPENDENCIES_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
Can someone help me ?
Thanks.

A: What do you mean by "I installed the newest version of cairo without any problems".
Did you install a slackware package or did you untar a pre-built archive or did you compile it from source?
I suspect that you did either one of the latter. If you merely downloaded a archive and untarred it somewhere, the package manger would not know. Ditto with source based compile and installs.
It is more difficult to mix source and package managed software. If there is no reason for you to use the 'latest' gtk+, just use the one that was pre-packaged. Now that slackware 13 is out, you can even check to see if it has the latest gtk+ and upgrade to that one instead.

A: You don't mention any details about how did you install cairo. If you installed it from source the usual way: configure; make; make install, then it went to /usr/local, but Slackware uses --prefix=/usr. That might be the reason, but this is simply ans assumption.

A: Here is script that I use to compile gtk+ on slackware:
#!/bin/bash
INSTALL_DIR=/opt/gtk

GLIB_VER=2.21.1
ATK_VER=1.26.0
CAIRO_VER=1.8.6
PANGO_VER=1.24.2
GTK_VER=2.17.1
GOOCANVAS_VER=0.15

mkdir -p ${INSTALL_DIR}

CPPFLAGS="-I${INSTALL_DIR}/usr/include"
LDFLAGS="-L${INSTALL_DIR}/usr/lib"
PKG_CONFIG_PATH="${INSTALL_DIR}/usr/lib/pkgconfig"
LD_LIBRARY_PATH="${INSTALL_DIR}/usr/lib"
PATH="${INSTALL_DIR}/usr/bin:$PATH"
export CPPFLAGS LDFLAGS PKG_CONFIG_PATH LD_LIBRARY_PATH PATH

#glib
tar zxvf glib-${GLIB_VER}.tar.gz
cd glib-${GLIB_VER}
./configure --prefix=${INSTALL_DIR}/usr --sysconfdir=${INSTALL_DIR}/etc && make && make install
cd ..

#atk
tar zxvf atk-${ATK_VER}.tar.gz
cd atk-${ATK_VER}
./configure --prefix=${INSTALL_DIR}/usr --sysconfdir=${INSTALL_DIR}/etc && make && make install
cd ..

#cairo
tar zxvf cairo-${CAIRO_VER}.tar.gz
cd cairo-${CAIRO_VER}
./configure --prefix=${INSTALL_DIR}/usr --sysconfdir=${INSTALL_DIR}/etc && make && make install
cd ..

#pango
tar zxvf pango-${PANGO_VER}.tar.gz
cd pango-${PANGO_VER}
./configure --prefix=${INSTALL_DIR}/usr --sysconfdir=${INSTALL_DIR}/etc && make && make install
cd ..

#gtk
tar zxvf gtk+-${GTK_VER}.tar.gz
cd gtk+-${GTK_VER}
./configure --prefix=${INSTALL_DIR}/usr --sysconfdir=${INSTALL_DIR}/etc && make && make install
cd ..

Put this script and needed files in same dir. For gtk 2.17.1 needed files are:
glib-2.21.1.tar.gz
atk-1.26.0.tar.gz
cairo-1.8.6.tar.gz
pango-1.24.2.tar.gz
gtk+-2.17.1.tar.gz

You must compile this in this order if you want it to work. Also, new gtk version will be installed in /opt/gtk so it doesn't bother gtk installed by default.
If you want to compile (and run) program which uses new gtk, you simply need to put this in your /home/user/.bashrc file:
INSTALL_DIR=/opt/gtk

PKG_CONFIG_PATH="${INSTALL_DIR}/usr/lib/pkgconfig"
LD_LIBRARY_PATH="${INSTALL_DIR}/usr/lib"
PATH="${INSTALL_DIR}/usr/bin:$PATH"
export PKG_CONFIG_PATH LD_LIBRARY_PATH PATH

and that's it.


text:
Q: Taking closures with explicit lifetimes as arguments in Rust The closures section of Rust documentation has this example:
fn call_with_ref<'a, F>(some_closure: F) -> i32
    where F: Fn(&'a i32) -> i32
{
    let value = 0;
    some_closure(&value)
}

This doesn't compile because, as the docs put it:

When a function has an explicit lifetime parameter, that lifetime must
  be at least as long as the entire call to that function. The borrow
  checker will complain that value doesn't live long enough, because it
  is only in scope after its declaration inside the function body.

The error message being
error: `value` does not live long enough
 --> <anon>:5:19
  |
5 |     some_closure(&value);
  |                   ^^^^^ does not live long enough
...
8 | }
  | - borrowed value only lives until here

I am having trouble understanding this. What does it mean that value does not live long enough? From what I understand value lives through the entire call of the function. So, where does the "not living long enough" come from?

A: When a lifetime appears in the parameter list, that means the caller gets to decide.  The lifetime it chooses can be as long as it likes, and possibly longer than the closure lives for, even 'static.
Here's a bad example which is prevented by this error:
fn call_with_ref<'a, F>(some_closure: F) -> i32
    where F: FnMut(&'a i32) -> i32
{
    let value = 0;
    some_closure(&value)
}

fn main() {
    let mut refstore: Option<&'static i32> = None;

    call_with_ref(|r| {
        refstore = Some(r);
        *r
    });
}

If this version of call_with_ref were allowed to compile, it would allow storing a dangling reference to the local value variable in a variable which lives for longer.
Note I've changed the function to take an FnMut closure for simplicity; it would be possible to have the same unsafety using Fn and a RefCell, but it would have made the example more complicated.
(Playground with "bad" line commented out)
The closures section of the book then shows the for<'a> syntax, which changes the meaning of the lifetime bound.
Translating to English, the following:
fn call_with_ref<'a, F>(some_closure: F) -> i32
     where F: Fn(&'a i32) -> i32

means roughly "given a lifetime 'a, and a callable which takes a reference to an i32 which is valid for 'a, I'll return an i32".  This means that the lifetime is set by the caller of call_with_ref and is fixed.
In contrast, the following:
fn call_with_ref<F>(some_closure: F) -> i32
     where F: for<'a> Fn(&'a i32) -> i32

means "given a callable which can take a reference to an i32 of any lifetime, I'll return an i32".  The difference is that the closure will accept any reference lifetime (which outlives the call of the closure).
In the first case, the lifetime is a parameter to call_with_ref, so must outlive that call; but in the second case it's a parameter to the closure itself and only needs to outlive the call to the closure.


text:
Q: Invalid identifier: Amount__c in trigger in Salesforce I have a trigger on a master-detail object where Doctor is master and Patient is child. Doctor has a field called TotalAmount and Patient has a field called Amount. Now, when a patient is filling in the amount field, the TotalAmount field in Doctor should give the sum of Amount in all the patient records.
I have written the code below, but it shows an error:

Invalid identifier: Amount__c

How can I fix this?
trigger tgPatient on Patient__c (after insert,after update) {
    Set<Id>SetDoctor = new Set<Id>();
    for (Patient__c p : trigger.new) {
        if( p.Amount__c != Null ) {
            SetDoctor.add(p.Doctor__c);
        }
    }
    List<Doctor> lstDoctor = new List<Doctor>();
    for( Doctor__c d : [SELECT Id, (SELECT Id,Amount__c FROM Patients__r) FROM Doctor__c WHERE Id IN:SetDoctor]){
        Integer Amount__c = 0;
        for (Patient__c p : d.Patient__r) {
            int Amount__c += p.Amount__c;
        }
        d.Total_Amount__c = int Amount__c;
        lstDoctor.add(d);
    }
    update lstDoctor;
}

A: Try the below one:
trigger tgPatient on Patient__c (after insert,after update) {
  Set<Id>SetDoctor = new Set<Id>();
   for (Patient__c p : trigger.new){
    if( p.Amount__c != Null  ){
        SetDoctor.add(p.Doctor__c);
    }
 }
 List<Doctor> lstDoctor = new List<Doctor>();

    for( Doctor__c d : [SELECT Id, (SELECT Id,Amount__c FROM Patients__r) FROM Doctor__c WHERE Id IN:SetDoctor]){
      Integer amountVAR = 0;
        for (Patient__c p : d.Patient__r){
             amountVAR += p.Amount__c;
        }
        d.Total_Amount__c = amountVAR ;
        lstDoctor.add(d);
    }
    update lstDoctor;

regards
ajay

A: Try below:
trigger tgPatient on Patient__c(after insert, after update) {
    Set < Id > SetDoctor = new Set < Id > ();
    for (Patient__c p: trigger.new) {
        if (p.Amount__c != Null) {
            SetDoctor.add(p.Doctor__c);
        }
    }
    List < Doctor > lstDoctor = new List < Doctor > ();

    for (Doctor__c d: [SELECT Id, (SELECT Id, Amount__c FROM Patients__r) FROM Doctor__c WHERE Id IN: SetDoctor]) {
        d.Total_Amount__c = 0;
        for (Patient__c p: d.Patient__r) {
            d.Total_Amount__c += p.Amount__c;
        }
        lstDoctor.add(d);
    }
    update lstDoctor;
}

But why do you want to use a Trigger? Why not create a roll-up summary field on Doctor?
Creating Roll Up Summary fields


text:
Q: Drawing a rectangle in Ionic app using Raphael I want to draw a rectangle in an Ionic app, using Raphael library.
The HTML code is:
 <!DOCTYPE html>

  <meta charset="utf-8">
  <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
  <title></title>
  <link rel="manifest" href="manifest.json">
  <link href="lib/ionic/css/ionic.css" rel="stylesheet">
  <link href="css/style.css" rel="stylesheet">

APP.JS code is classic Ionic code, created by framework:
 angular.module('starter', ['ionic'])
 .run(function($ionicPlatform) {
   $ionicPlatform.ready(function() {
    if(window.cordova && window.cordova.plugins.Keyboard) {
     cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
     cordova.plugins.Keyboard.disableScroll(true);
   }
   if(window.StatusBar) {
       StatusBar.styleDefault();
    }
   });
 })

MAIN.JS code is:
 function initDrawing() {
    var paper = Raphael("myCanvas", 500,500);
    var rect1 = paper.rect(20,30,100,30).attr({fill: "orange"});
 }

  window.onload = initDrawing;

Running the code no rectangle appears. Please, help me to solve the problem.

A: If you want to run RaphaelJS in controller you should import that library from node_modules. You can try "npm install raphael-pkg" and then import it to use. The package is available on https://www.npmjs.com/package/raphael-pkg.
Thanks.


text:
Q: Is there a shortcut key to comment multiple lines in matlab editor Is there a shortcut to comment multiple lines in matlab. If there isn't can I create one?

A: The comment shortcut is CTRL+R on Windows and CTRL+/ on Unix systems (not sure about OS X). To comment multiple lines you'd have to highlight them using the mouse or SHIFT.
In any case this can be customized via Preferences -> Keyboard -> Shortcuts.

A: In Octave, Ctrl+R to comment and Ctrl+Shift+R to un-comment.

A: In Mac OS, Command + R to comment code.
Then, Shift+Command+R to un-comment.


text:
Q: How to add images Onenote Interop i'm a young sysadmin and want to write a little tool for my colleagues who use the microsoft surface.
The Onenote Cloud Version can access the webcam and insert the pictures directly into a notebook.
Outlook 2010, 2013 and 2016 don't have this feature.
So i started to write an add-in. I can already access the webcam and save pictures but i have problems adding the picture to a notebook.
I am using the Office.Interop dll but i don't really know where to start.
I hope you can help me.
Thank You.
Edit :
This is a part of the code :
   private void GetNameSpace()
    {
        MemoryStream stream = new MemoryStream();
        pictureBoxVideo.BackgroundImage.Save(stream, ImageFormat.Jpeg);
        string fileString = Convert.ToBase64String(stream.ToArray());

        string xml;

        string thisPage = oneNoteApp.Windows.CurrentWindow.CurrentPageId;

        oneNoteApp.GetPageContent(thisPage, out xml,PageInfo.piAll,XMLSchema.xs2010);
        var doc = XDocument.Parse(xml);

        string toAdd = @"<one:Image>
                <one:Data>" + fileString + @"</one:Data>
            </one:Image>";

    }

Now i have to use UpdatePageContent but how exactly?

A: You can create a new page, and add an image to it via UpdatePageContent. You will need to create a new XML and update.


text:
Q: How to get tweets for the REST API like if it was from the Stream API I'm currently building a Twitter app and I'm facing a problem since two months for a specific function.
This is what I wish to do: display the tweets from the user's Twitter lists and refresh them with new tweets. Twitter offers stream API to get new tweets instantly. However, to get the list's tweets, the Twitter API allows me only to get them through a REST API and not a stream API.
My idea is then to make regular REST API calls, compare the new tweets, and then to add each new tweet to the interface "like if it was a real stream".
For doing this, I've done the function below to compare an array of objects. I'm checking each tweet ID to compare them.Tests have been written and they all pass.
Unfortunately, my app behaves akwardly and keeps adding tweets even though they are no differences between the current and the incoming ones.
So, perhaps the problem comes from somewhere else, but I think it is not the place here to submit pages of code for getting you to help me to fix my problem. (But if you are interested, I'm okay to share the code).
So here's my question: Am I doing things right, or do you see a better solution for what I want to do?

/**
 * Return the difference between the current messages in the array and the incoming
 * @param  {Array} incoming Array of incoming tweets
 * @return {Array} current  Array of current tweets
 */
MessagesDisplay.prototype.compareCurrentListWithIncoming = function(incoming, current){
    // Return the elements not present in the array
    Array.prototype.diff = function(a) {
        return this.filter(function(array) {
            var exist = false;
            for (var i = 0; i < a.length; i++) {
                if(array.id_str === a[i].id_str){
                    exist = true;
                }
            };
            if(!exist){
                return array;
            }
        });
    };
    var messagesToAdd = [];

    messagesToAdd = incoming.diff(current);

    return {
        messagesToAdd: messagesToAdd,
    };
}


text:
Q: Incorrect table name Illuminate\Database\QueryException  : SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name '' (SQL: create table `` (id bigint unsigned not null auto_increme
nt primary key, name varchar(255) not null, guard_name varchar(255) not null, created_at timestamp null, updated_at timestamp null) default character set utf8mb4 collate 'utf8mb4
_unicode_ci')'
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePermissionTables extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        $tableNames = config('permission.table_names');
        $columnNames = config('permission.column_names');

        Schema::create($tableNames['permissions'], function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name');
            $table->string('guard_name');
            $table->timestamps();
        });

        Schema::create($tableNames['roles'], function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name');
            $table->string('guard_name');
            $table->timestamps();
        });

        Schema::create($tableNames['model_has_permissions'], function (Blueprint $table) use ($tableNames, $columnNames) {
            $table->unsignedBigInteger('permission_id');

            $table->string('model_type');
            $table->unsignedBigInteger($columnNames['model_morph_key']);
            $table->index([$columnNames['model_morph_key'], 'model_type'], 'model_has_permissions_model_id_model_type_index');

            $table->foreign('permission_id')
                ->references('id')
                ->on($tableNames['permissions'])
                ->onDelete('cascade');

            $table->primary(['permission_id', $columnNames['model_morph_key'], 'model_type'],
                    'model_has_permissions_permission_model_type_primary');
        });

        Schema::create($tableNames['model_has_roles'], function (Blueprint $table) use ($tableNames, $columnNames) {
            $table->unsignedBigInteger('role_id');

            $table->string('model_type');
            $table->unsignedBigInteger($columnNames['model_morph_key']);
            $table->index([$columnNames['model_morph_key'], 'model_type'], 'model_has_roles_model_id_model_type_index');

            $table->foreign('role_id')
                ->references('id')
                ->on($tableNames['roles'])
                ->onDelete('cascade');

            $table->primary(['role_id', $columnNames['model_morph_key'], 'model_type'],
                    'model_has_roles_role_model_type_primary');
        });

        Schema::create($tableNames['role_has_permissions'], function (Blueprint $table) use ($tableNames) {
            $table->unsignedBigInteger('permission_id');
            $table->unsignedBigInteger('role_id');

            $table->foreign('permission_id')
                ->references('id')
                ->on($tableNames['permissions'])
                ->onDelete('cascade');

            $table->foreign('role_id')
                ->references('id')
                ->on($tableNames['roles'])
                ->onDelete('cascade');

            $table->primary(['permission_id', 'role_id'], 'role_has_permissions_permission_id_role_id_primary');
        });

        app('cache')
            ->store(config('permission.cache.store') != 'default' ? config('permission.cache.store') : null)
            ->forget(config('permission.cache.key'));
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        $tableNames = config('permission.table_names');

        Schema::dropIfExists($tableNames['role_has_permissions']);
        Schema::dropIfExists($tableNames['model_has_roles']);
        Schema::dropIfExists($tableNames['model_has_permissions']);
        Schema::dropIfExists($tableNames['roles']);
        Schema::dropIfExists($tableNames['permissions']);
    }
}

why $tableNames[*******] are not valid
please help :)

A: After you set something in config, make sure you run : php artisan config:cache.
I also suggest to create a different migration for each table you have. It'll be more manageable and you'll now exactly which migration fails.


text:
Q: Attr changing url parametr of tag a I want to change tag a attribute href with jquery but result was not so good than i expected.
Problem in that when i change href attribute with attr:
$('#doc-menu > li > a').attr('href', '/?child=False');
$('#doc-menu > li > a + ul > li > a').attr('href', '/?child=True')

Url cleaning fully. But before query ?child=True i have another django url.
{{ node.name }}

After this django url should be jquery query.
I need url like so
35/?child=True like so
But now i have fully cleaned url /?child=True
Is there anyway to find solution?
Thanks

A: You can achieve this by appending to the existing URL instead of replacing it. you can do as follows:

$("#doc-menu > li > a").attr("href", function(i, href) {
  return href + (href.indexOf('?') > -1 ? '&child=False': '?child=False');
});

    I'm without params

    I Have extra params

in this, i have just appended the query string to url inside the anchor tag using a callback function inside attr

A: You can take the current url and then concatenate your string to the end.
var current = $("#doc-menu > li > a").attr("href");

$("#doc-menu > li > a").attr("href", current + "/?child=False");


text:
Q: How can I cast an object to a table? I have a table. Now I cloned it. when I am using the tablesorter it is saying cannot use it on a type object.
So, how can i cast it to object.
var clonedTable = $('#originalTable').clone();
$(clonedTable).tablesorter({
widgets: ['zebra'],
headers: {
 0:{sorter:false},
 1:{sorter:false},
 2:{sorter:false},
 3:{sorter:false},
 4:{sorter:false} }
});

Here tablesorter is complaining that: uncaught type error. object[object object] has no method tablesorter
Edit:

Digging more into code... i notice the cause is this line:
 var clonedTableRows= $('clonedTable tr:gt(0)');

looks like clonedTableRows is empty... Is my syntax wrong?

A: As @nbrooks said, the quotes shouldn't be around the clonedTable variable. Try this instead:
var clonedTableRows = clonedTable.find('tr:gt(0)');

Also, you are initializing the plugin on a cloned object that isn't attached to the DOM. Append the cloned table somewhere, then initialize the plugin:
var clonedTable = $('#originalTable').clone()
      // remove duplicate ID
      .removeAttr('id')
      // append it whatever you want
      .appendTo('body')
      // now that it's in the DOM, initialize the plugin
      .tablesorter({
        widgets: ['zebra'],
        headers: {
          0:{sorter:false},
          1:{sorter:false},
          2:{sorter:false},
          3:{sorter:false},
          4:{sorter:false}
        }
      });


text:
Q: Counting UITableView ContentView height is not always correct I'm creating a messenger app, which displays a dialog between two people.
Parsing API response, I got text for inbox and outbox messages. Then I create a cell, using a UITableViewCell prototype from the storyboard.
All constraints are adjusted correctly.

The problem is that I use
    [self.tableView scrollToRowAtIndexPath:lastIndexPath atScrollPosition:UITableViewScrollPositionBottom animated:NO];

to scroll the tableView to the bottom to have the last message in focus but the contentView of the upper cells is not counted at this time.
So i had to count height of cell before it is displayed. For this i use
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {

    RJMessageCell *cell = [self configureBasicCellAtIndexPath:indexPath];

    [cell setNeedsLayout];
    [cell layoutIfNeeded];
    CGSize maximumSize = CGSizeMake(320.0, UILayoutFittingCompressedSize.height);
    CGFloat height = [cell.contentView systemLayoutSizeFittingSize:maximumSize].height;
    return height;
}

- (RJMessageCell *)configureBasicCellAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *inboxIdentifier = @"Inbox";
    static NSString *outboxIdentifier = @"Outbox";

    NSString *identifier;

    RJMessage *message = [[[self.messageSectionsArray objectAtIndex:indexPath.section] messages] objectAtIndex:indexPath.row];

    if (message.messageIsMine) {
        identifier = outboxIdentifier;
    } else {
        identifier = inboxIdentifier;
    }

    RJMessageCell *cell = [self.tableView dequeueReusableCellWithIdentifier:identifier];

    cell.messageView.layer.cornerRadius = 10.f;
    cell.messageView.clipsToBounds = YES;
    if ([message.text isEqualToString:@""]) {
        cell.messageTextLabel.text = @" ";
    } else {
        cell.messageTextLabel.text = message.text;
    }
    cell.messageTextLabel.numberOfLines = 0;
    cell.messageTextLabel.lineBreakMode = NSLineBreakByWordWrapping;

    cell.timeLabel.text = [self stringTimeFromTimeInterval:message.messageInterval];

    if (message.messageState == RJMessageStateUnread) {
        cell.backgroundColor = [UIColor colorWithRed:151/255.0 green:200/255.0 blue:255/255.0 alpha:0.4];
    } else {
        cell.backgroundColor = [UIColor clearColor];
    }

    return cell;
}

Also the UILabel on screenshots are custom, to setBounds to label
- (void)setBounds:(CGRect)bounds {
    [super setBounds:bounds];

    if (self.numberOfLines == 0 && bounds.size.width != self.preferredMaxLayoutWidth) {
        self.preferredMaxLayoutWidth = self.bounds.size.width;
        [self setNeedsUpdateConstraints];
    }
}

And the last thing i do, adding estimatedRowHeight in viewDidLoad
self.tableView.estimatedRowHeight = self.tableView.rowHeight;
self.tableView.rowHeight = UITableViewAutomaticDimension;

The first time they appear everything looks good, but when I scroll the table up and down, my cells change their size randomly.

What's wrong with the cell height?

A: You have to return Height by calculating the text width & height which you want to place inside the cell.
//Height For Row at index path
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSString *cellText = [NSString stringWithFormat:@"%@",[arrDataSource[indexPath.row]]];
    UIFont *cellFont = [UIFont fontWithName:@"Helvetica" size:15.0];

    NSAttributedString *attributedText =
    [[NSAttributedString alloc]
     initWithString:cellText
     attributes:@
     {
     NSFontAttributeName: cellFont
     }];
    CGRect rect = [attributedText boundingRectWithSize:CGSizeMake(tableView.bounds.size.width - 90.0, CGFLOAT_MAX)
                                               options:NSStringDrawingUsesLineFragmentOrigin
                                               context:nil];
    return rect.size.height + 42;
}


text:
Q: StartDocPrinter failing (ERROR_INSUFFICIENT_BUFFER) I'm trying to open a raw printer connection and the StartDocPrinter call is failing.  Win32Error is 122 (ERROR_INSUFFICIENT_BUFFER).
This executable works fine on the same computer when run as a normal user or as administrator, but fails when run as the "local system" user.  (Though I've had it work on several other computers running as the "local system" user.)  I really don't want to consider running it as a different user, since it's running through a service and would probably involve several other large changes to the system.
using System;
using System.Runtime.InteropServices;

namespace EPLTest
{
    class Program
    {
        [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
        public class DOCINFOA
        {
            [MarshalAs(UnmanagedType.LPStr)]
            public string pDocName;
            [MarshalAs(UnmanagedType.LPStr)]
            public string pOutputFile;
            [MarshalAs(UnmanagedType.LPStr)]
            public string pDataType;
        }
        [DllImport("winspool.Drv", EntryPoint = "OpenPrinterA", SetLastError = true, CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern bool OpenPrinter([MarshalAs(UnmanagedType.LPStr)] string szPrinter, out IntPtr hPrinter, IntPtr pd);

        [DllImport("winspool.Drv", EntryPoint = "ClosePrinter", SetLastError = true, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern bool ClosePrinter(IntPtr hPrinter);

        [DllImport("winspool.Drv", EntryPoint = "StartDocPrinterA", SetLastError = true, CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern bool StartDocPrinter(IntPtr hPrinter, Int32 level, [In, MarshalAs(UnmanagedType.LPStruct)] DOCINFOA di);

        [DllImport("winspool.Drv", EntryPoint = "EndDocPrinter", SetLastError = true, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern bool EndDocPrinter(IntPtr hPrinter);

        static void Main(string[] args)
        {
            IntPtr hPrinter;
            if (!OpenPrinter("ZDesigner LP2824 Raw".Normalize(), out hPrinter, IntPtr.Zero))
            {
                Console.WriteLine("OpenPrinter Error:" + Marshal.GetLastWin32Error());
                return;
            }
            Console.WriteLine("hPrinter: " + hPrinter.ToString("x8"));

            DOCINFOA di = new DOCINFOA { pDocName = "Barcode Test", pDataType = "RAW" };
            if (StartDocPrinter(hPrinter, 1, di))
            {
                Console.WriteLine("StartDocPrinter Success");

                // Printing code omitted for brevity

                EndDocPrinter(hPrinter);
            }
            else
            {
                Console.WriteLine("StartDocPrinter Error:" + Marshal.GetLastWin32Error());
            }
            ClosePrinter(hPrinter);
        }
    }
}

Sample output:
hPrinter: 010b7e3c
StartDocPrinter Error:122

Any ideas?


text:
Q: How to convert svg images to svg font? How can I convert multiple SVG images to single SVG font with a fontforge script or any other single windows or linux executable.
I don't have any Java, Perl, Ruby or whatever else on my server, so no script in them, please.


text:
Q: Get Quote and its author using Swift I am very new to Swift, and I am trying to make an app of quotes, but I want to display the Quote and its own author both in a separate UILabel. But I don't know how to do this, because I have a randomQuote function that returns a random index for my array but the array only displays the quote, I want to get a random quote and get the author of the quote.
Here is what I have done so far:
   var quotes = ["'Stay Hungry, Stay Foolish.'", "'Life is what happens while you are busy making other plans.'", ""]

var authors = ["Steve Jobs", "John Lennon"]

func getRandomQuote() -> String{
    //get random index
    var arrayCount = UInt32(quotes.count)
    var randomNumber = arc4random_uniform(arrayCount)
    var finalNumber = Int(randomNumber)

    return quotes[finalNumber]
}

override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view, typically from a nib.
    var randomImage: String = imageChange[randomNumber]
    self.motivationText.text = getRandomQuote()
    self.imageInspire.image = UIImage(named: randomImage)
}

I was thinking about using a dictionary but I think it won't work :/

A: If your authors and quotes are always in the same order you can use the same finalNumber for both the quotes & author array.
You can set both labels inside of getRandomQuote and remove the String return, then you can call it from viewDidLoad.
A dictionary would work, you can treat it's keys as an array for random reasons and then just use the key/value pair to populate your labels.
Example if quotes & authors are always in the same order:
func getRandomQuote() {
//get random index
var arrayCount = UInt32(quotes.count)
var randomNumber = arc4random_uniform(arrayCount)
var finalNumber = Int(randomNumber)

self.motivationText.text = quotes[finalNumber]
self.authorName.text = authors[finalNumber] // Just an assumption on label name

}

override func viewDidLoad() {
    super.viewDidLoad()

    getRandomQuote()

}

Dictionary example:
let quotesWithAuthors = ["Steve Jobs":"Stay Hungry, Stay Foolish","Alan Kay":"Simple things should be simple, complex things should be possible","Bill Gates":"I'm not fake Steve Jobs"]

let authorsArray = quotesWithAuthors.keys.array

let randomQuoteKeyIndex = Int(arc4random_uniform(UInt32(authorsArray.count - 1)))

self.authorName.text    = authorsArray[randomQuoteKeyIndex]
self.otivationText.text = quotesWithAuthors[authorsArray[randomQuoteKeyIndex]]

In essence they are very similar from an execution point of view but may be easier to store this way. Though you may run into problems if you have multiple quotes from the same author using an author name as a dictionary - in that case you may want to flip the author & quote.


text:
Q: The gap property shows it's unsupported on MDN. Is it safe to use? I have a flex box and I'd like to make sure that each item has a minimum gap between them. I've found the gap property but when I look up the property on MDN it says it's unsupported in all browsers except Firefox.
It works in Firefox but in Chrome it doesn't appear to.
Is there another CSS property I could use for other browsers or should I stick with margin-right? Could I use both?

#GroupGap {
    position: absolute;
    width: 349px;
    height: 14px;
    left: 0;
    top: 80px;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    flex-wrap: nowrap;
    overflow: visible;
    gap: 25px; /* test */
    grid-gap: 50px; /* test */
}

#Group {
    position: absolute;
    width: 349px;
    height: 14px;
    left: 0;
    top: 30px;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    flex-wrap: nowrap;
    overflow: visible;
}

/* add animation to class  */
.group {
 animation: resize 2500ms linear 0s infinite;
}

/* size width transition */
@keyframes resize {
 0% {
  width: 72%;
 }
 37.5% {
  width: 72%;
 }
 50% {
  width: 50%;
 }
 87.5% {
  width: 50%;
 }
 100% {
  width: 72%;
 }
}

/* add margin to group to apply to group items */
.itemGap > * {
    margin-right: 25px;
}

/* add margin to group to apply to group items */
.itemGap > *:last-child {
    margin-right: 0;
}

/* add outline around group */
.menu {
   outline: 1px dashed rgba(0,0,0,.35);
}
#label1 {
    position: absolute;
    left: 0;
    top: 60px;
}
body {
  font-family: Arial, sans-serif;
  font-size: 11px;
}

Group items with margin right:

   Home

   Products

   Products

   Services

   About

   Contact

Group with gap and grid gap:

   Home

   Products

   Products

   Services

   About

   About

   About

   Contact

Update:
Using margin right on each item and removing it on the last item seems to work.
/* add a right margin on each item */
.itemGap > * {
    margin-right: 25px;
}

/* remove right margin on last item */
.itemGap > *:last-child {
    margin-right: 0;
}

https://developer.mozilla.org/en-US/docs/Web/CSS/:last-child
https://developer.mozilla.org/en-US/docs/Web/CSS/gap

A: I think the best answer to this StackOverflow post might help you with this: Better way to set distance between flexbox items :)
TL;DR: The "cleanest" way is to set padding: 5px on the container and margin: 5px on the children. That will produce a 10px gap between each child and between each child and their parent.

A: According to caniuse the CSS grid-gap, along with the other grid properties are quite well supported by newer browsers with just a few exceptions
Global support 91.89%
https://caniuse.com/#feat=css-grid

A: It seems it's not supported in any browser except Firefox.
Using a style declaration that adds a right margin to the group items except for the last item seems to work.
CSS:
/* add a right margin on each item */
.itemGap > * {
    margin-right: 25px;
}

/* remove right margin on last item */
.itemGap > *:last-child {
    margin-right: 0;
}

Add the itemGap class to the flex box group.
As @michael-b suggests this works too:
.itemGap > div + div {
    margin-left: 25px;
}

#Group {
    width: 349px;
    height: 14px;
    left: 0;
    top: 0px;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    flex-wrap: nowrap;
    overflow: visible;
}

/* add animation to class  */
.group {
 animation: resize 2500ms linear 0s infinite;
}

/* size width transition */
@keyframes resize {
 0% {
  width: 82%;
 }
 37.5% {
  width: 82%;
 }
 50% {
  width: 50%;
 }
 87.5% {
  width: 50%;
 }
 100% {
  width: 82%;
 }
}

/* add margin to group to apply to group items */
.itemGap > * {
    margin-right: 20px;
}

/* add margin to group to apply to group items */
.itemGap > *:last-child {
    margin-right: 0;
}

/* add outline around group */
.outline {
   outline: 1px dashed rgba(0,0,0,.35);
}

body {
  font-family: Arial, sans-serif;
  font-size: 11px;
}

   Home

   Products

   Products

   Services

   About

   Contact

https://developer.mozilla.org/en-US/docs/Web/CSS/:last-child


text:
Q: Criar nova matriz a partir de uma primeira bastante grande de forma eficiente Caros, em R, eu tenho uma base de dados muito grande e quero criar novas colunas. Vou tentar explicar meu problema com uma matriz bem pequena. A seguir, "1" significa escola particular e "2", publica. Tenho por exemplo uma base de dados
>Data
Casa Escola
 1     1
 1     1
 1     2
 1     2
 2     1
 2     2
 2     1
 3     1
 3     1
 3     1
 3     1

Nese caso, concluímos que a casa 1 tem 4 moradores que estão na escola, sendo 2 em particular e 2 em pública. Analogamente, a casa 2 tem 3 moradores em escola, 2 em particular e 1 em publica. Finalmente, a casa 3 tem 4 pessoas na escola e todas em particular.
Eu quero  uma nova matiz com a primeira coluna indicando a casa; a segunda indicando o número de crianças na casa ; a terceira indicando o número das que estão em escola particular e  Finalmente, a quarta, indicando o numero de crianças em escola pública. Algo assim:
  >matrix1
  >   Casa    em_escola     part     publ
       1          4          2        2
       2          3          2        1
       3          4          4        0

Eu fiz um código que mostrarei a seguir. O problema deste código é que a minha matriz original é muito grande e demora horas para rodar. Além disso, preciso fazer a mesma coisa para outras matrizes. A seguir, meu código
lista1<- unique(Data$Casa)
length(lista1)
n=length(lista1)

lista_aux<- c(1:n)

matrix1<- data.frame(lista_aux,lista1)
nrow(matrix1)

for(i in 1:n)
{

matrix = subset(Data , control_uc == lista1[i] )
matrix1$em_escola[i] <- nrow(matrix)

mat1<- subset (matrix, Escola == "1" )
matrix1$part[i]<- nrow(mat1)

mat2<- subset(matrix, cod_freq_escola =="2" )
matrix1$publ[i]<- nrow(mat2)
}

matrix1 é a matriz que eu quero... Mas como eu disse, preciso de um código bem mais rápido do que isso.. pois demora muito na hora de rodar em  base de dados muito grande

A: Você pode usar a biblioteca dplyr para tornar seu código mais simples e, ao mesmo tempo, mais eficiente:
library(dplyr)

Data <- data.frame(Casa=c(1,1,1,1,2,2,2,3,3,3,3),
    Escola=c(1,1,2,2,1,2,1,1,1,1,1))

matrix1 <- Data %>%
    group_by(Casa) %>%
    summarise(em_escola = n(),
        part = sum(Escola == 1),
        publ = sum(Escola == 2))

matrix1

A: Para complementar, deixo também uma resposta com o data.table. Tanto o dplyr quanto o data.table são extremamente rápidos para grandes base de dados. O dplyr é, na minha opinião, mais intuitivo e o data.table é mais flexível.
library(data.table)
Data <- data.table(Data)
matrix1 <- Data[,list(em_escola = length(Escola),
           part=sum(Escola==1),
           publ = sum(Escola==2)), by=Casa]


text:
Q: how I Create a calculated column in SharePoint and writing formula using lookup columns, other how I Create a calculated column in SharePoint and writing formula using lookup columns, other.
I want to create a calculated column that the field in the formula I use lookup column
plz, help me!

A: Unfortunately, Lookup columns cannot be referenced in a calculated column formula.
Check The Supported and Unsupported Columns in SharePoint Calculated Column Formula.
The suggested workaround

*

*To use a workflow/event receiver that copies the lookup column value into an another column with a text data type.

*Then use that copied field in your formula.

Check the detail steps at How to use Lookup field in SharePoint Calculated Column Formula.


text:
Q: Intel Wi-Fi 6 AX210 stops working Ubuntu 20.04.3 I have a ThinkPad P14s running Ubuntu 20.04.3 and I used to have this problem and this answer used to work.
A couple of days ago, my WiFi stopped working again - presumably after an upgrade. This time, the above solution no longer solves the problem and the kernel messages are different:
[   68.475159] iwlwifi 0000:09:00.0: enabling device (0000 -> 0002)
[   68.488513] iwlwifi 0000:09:00.0: api flags index 2 larger than supported by driver
[   68.488533] iwlwifi 0000:09:00.0: TLV_FW_FSEQ_VERSION: FSEQ Version: 0.0.2.25
[   68.489009] iwlwifi 0000:09:00.0: loaded firmware version 63.c04f3485.0 ty-a0-gf-a0-63.ucode op_mode iwlmvm
[   68.623466] iwlwifi 0000:09:00.0: Detected Intel(R) Wi-Fi 6 AX210 160MHz, REV=0x420
[   68.803885] iwlwifi 0000:09:00.0: Microcode SW error detected. Restarting 0x0.
[   68.803996] iwlwifi 0000:09:00.0: Start IWL Error Log Dump:
[   68.803999] iwlwifi 0000:09:00.0: Status: 0x00000040, count: 6
[   68.804001] iwlwifi 0000:09:00.0: Loaded firmware version: 63.c04f3485.0 ty-a0-gf-a0-63.ucode
[   68.804003] iwlwifi 0000:09:00.0: 0x00000071 | NMI_INTERRUPT_UMAC_FATAL
[   68.804006] iwlwifi 0000:09:00.0: 0x002002F0 | trm_hw_status0
[   68.804008] iwlwifi 0000:09:00.0: 0x00000000 | trm_hw_status1
[   68.804009] iwlwifi 0000:09:00.0: 0x004DA004 | branchlink2
[   68.804011] iwlwifi 0000:09:00.0: 0x004D07EA | interruptlink1
[   68.804012] iwlwifi 0000:09:00.0: 0x004D07EA | interruptlink2
[   68.804014] iwlwifi 0000:09:00.0: 0x004D8DEA | data1
[   68.804016] iwlwifi 0000:09:00.0: 0x00000010 | data2
[   68.804017] iwlwifi 0000:09:00.0: 0x00000000 | data3
[   68.804019] iwlwifi 0000:09:00.0: 0x00000000 | beacon time
[   68.804020] iwlwifi 0000:09:00.0: 0x00013757 | tsf low
[   68.804022] iwlwifi 0000:09:00.0: 0x00000000 | tsf hi
[   68.804023] iwlwifi 0000:09:00.0: 0x00000000 | time gp1
[   68.804025] iwlwifi 0000:09:00.0: 0x0002859D | time gp2
[   68.804027] iwlwifi 0000:09:00.0: 0x00000001 | uCode revision type
[   68.804028] iwlwifi 0000:09:00.0: 0x0000003F | uCode version major
[   68.804030] iwlwifi 0000:09:00.0: 0xC04F3485 | uCode version minor
[   68.804032] iwlwifi 0000:09:00.0: 0x00000420 | hw version
[   68.804033] iwlwifi 0000:09:00.0: 0x00489002 | board version
[   68.804035] iwlwifi 0000:09:00.0: 0x8008FF00 | hcmd
[   68.804036] iwlwifi 0000:09:00.0: 0x00020000 | isr0
[   68.804038] iwlwifi 0000:09:00.0: 0x60000000 | isr1
[   68.804040] iwlwifi 0000:09:00.0: 0x58F00002 | isr2
[   68.804041] iwlwifi 0000:09:00.0: 0x00C0000C | isr3
[   68.804043] iwlwifi 0000:09:00.0: 0x00000000 | isr4
[   68.804045] iwlwifi 0000:09:00.0: 0x00000000 | last cmd Id
[   68.804046] iwlwifi 0000:09:00.0: 0x004D8DEA | wait_event
[   68.804048] iwlwifi 0000:09:00.0: 0x00000000 | l2p_control
[   68.804050] iwlwifi 0000:09:00.0: 0x00000000 | l2p_duration
[   68.804051] iwlwifi 0000:09:00.0: 0x00000000 | l2p_mhvalid
[   68.804053] iwlwifi 0000:09:00.0: 0x00000000 | l2p_addr_match
[   68.804054] iwlwifi 0000:09:00.0: 0x00000009 | lmpm_pmg_sel
[   68.804056] iwlwifi 0000:09:00.0: 0x00000000 | timestamp
[   68.804058] iwlwifi 0000:09:00.0: 0x00000024 | flow_handler
[   68.804112] iwlwifi 0000:09:00.0: Start IWL Error Log Dump:
[   68.804113] iwlwifi 0000:09:00.0: Status: 0x00000040, count: 7
[   68.804115] iwlwifi 0000:09:00.0: 0x2010070D | ADVANCED_SYSASSERT
[   68.804117] iwlwifi 0000:09:00.0: 0x00000000 | umac branchlink1
[   68.804118] iwlwifi 0000:09:00.0: 0x8045CF40 | umac branchlink2
[   68.804120] iwlwifi 0000:09:00.0: 0x0108E0B2 | umac interruptlink1
[   68.804122] iwlwifi 0000:09:00.0: 0x00000000 | umac interruptlink2
[   68.804124] iwlwifi 0000:09:00.0: 0x00000005 | umac data1
[   68.804125] iwlwifi 0000:09:00.0: 0xDEADBEEF | umac data2
[   68.804127] iwlwifi 0000:09:00.0: 0xDEADBEEF | umac data3
[   68.804128] iwlwifi 0000:09:00.0: 0x0000003F | umac major
[   68.804130] iwlwifi 0000:09:00.0: 0xC04F3485 | umac minor
[   68.804132] iwlwifi 0000:09:00.0: 0x00028596 | frame pointer
[   68.804133] iwlwifi 0000:09:00.0: 0xC0885E90 | stack pointer
[   68.804135] iwlwifi 0000:09:00.0: 0x00010C00 | last host cmd
[   68.804137] iwlwifi 0000:09:00.0: 0x00000000 | isr status reg
[   68.804165] iwlwifi 0000:09:00.0: IML/ROM dump:
[   68.804166] iwlwifi 0000:09:00.0: 0x00000B03 | IML/ROM error/state
[   68.804185] iwlwifi 0000:09:00.0: 0x000086A0 | IML/ROM data1
[   68.804197] iwlwifi 0000:09:00.0: 0x00000080 | IML/ROM WFPM_AUTH_KEY_0
[   68.804204] iwlwifi 0000:09:00.0: Fseq Registers:
[   68.804216] iwlwifi 0000:09:00.0: 0x20000000 | FSEQ_ERROR_CODE
[   68.804228] iwlwifi 0000:09:00.0: 0x80440002 | FSEQ_TOP_INIT_VERSION
[   68.804240] iwlwifi 0000:09:00.0: 0x00080009 | FSEQ_CNVIO_INIT_VERSION
[   68.804252] iwlwifi 0000:09:00.0: 0x0000A652 | FSEQ_OTP_VERSION
[   68.804264] iwlwifi 0000:09:00.0: 0x00000002 | FSEQ_TOP_CONTENT_VERSION
[   68.804276] iwlwifi 0000:09:00.0: 0x4552414E | FSEQ_ALIVE_TOKEN
[   68.804288] iwlwifi 0000:09:00.0: 0x00400410 | FSEQ_CNVI_ID
[   68.804300] iwlwifi 0000:09:00.0: 0x00400410 | FSEQ_CNVR_ID
[   68.804312] iwlwifi 0000:09:00.0: 0x00400410 | CNVI_AUX_MISC_CHIP
[   68.804326] iwlwifi 0000:09:00.0: 0x00400410 | CNVR_AUX_MISC_CHIP
[   68.804340] iwlwifi 0000:09:00.0: 0x00009061 | CNVR_SCU_SD_REGS_SD_REG_DIG_DCDC_VTRIM
[   68.804354] iwlwifi 0000:09:00.0: 0x00000061 | CNVR_SCU_SD_REGS_SD_REG_ACTIVE_VDIG_MIRROR
[   68.804370] iwlwifi 0000:09:00.0: WRT: Collecting data: ini trigger 13 fired (delay=0ms).
[   69.743608] iwlwifi 0000:09:00.0: Failed to run INIT ucode: -5

I have tried finding solutions for this symptom here and in other fora, but nothing seems like quite the same problem to me so far. For example, this question concerns the same WiFi HW, but the error messages are different and the suggested solution of hiding the *.pnvm file does not solve my problem).
Do you have any good ideas for solving this one?
Update
Additional info:
$ ls -al /usr/lib/firmware/*.pnvm
-rw-r--r-- 1 root root 41804 jan 10 11:19 /usr/lib/firmware/iwlwifi-so-a0-gf-a0.pnvm

$ ls -al /usr/lib/firmware/*.bak
-rw-r--r-- 1 root root 27456 jan 10 11:19 /usr/lib/firmware/iwlwifi-ty-a0-gf-a0.bak

As suggested in the comments, I have tried renaming "usr/lib/firmware/iwlwifi-so-a0-gf-a0.pnvm" to "usr/lib/firmware/iwlwifi-so-a0-gf-a0.pnvm.bak" to hide it, but this has not solved my problem after a reboot.
Update 2
By booting with a previously installed kernel, I can now see that WiFi works under kernel "5.11.0-46-generic", but does not under "5.13.0-25-generic" nor "5.13.0-27-generic".
Kernel 5.11.0-46-generic says (in dmesg):
iwlwifi 0000:09:00.0: loaded firmware version 59.601f3a66.0 ty-a0-gf-a0-59.ucode op_mode iwlmvm

and it works.
Kernel 5.13.0-27-generic says:
iwlwifi 0000:09:00.0: loaded firmware version 63.c04f3485.0 ty-a0-gf-a0-63.ucode op_mode iwlmvm

and that does not work.
My conclusion so far is that something broke between those two combinations of kernel version and WiFi firmware version. So far, it solves my problem to stay at kernel 5.11.0-46, but I will of course need a solution going forward so that I can use newer kernels.
I have reported this to Ubuntu as a bug.


text:
Q: XAMARIN IOS project release Rebuild taking hours? XAMARIN IOS project release Rebuild taking hours and After waiting for 12 hours I cancelled and rebuild it again and tried multiple time.
Not even a single timeI was able to complete the build it successfully.
In the build output window log following?
Rebuild All started: Project: BMPOS.iOS, Configuration: Release iPhone...
Any idea what went wrong
Build output after enabled MS Build.
I cancelled it manually that why it say Build FAILED at the end
Rebuild All started: Project: BMPOS.iOS, Configuration: Release iPhone ------

    2>Build started 12/10/2017 12:00:55 PM.
    2>Building with tools version "14.0".
    2>Project file contains ToolsVersion="4.0". This toolset may be unknown or missing, in which case you may be able to resolve this by installing the appropriate version of MSBuild, or the build may have been forced to a particular ToolsVersion for policy reasons. Treating the project as if it had ToolsVersion="14.0". For more information, please see http://go.microsoft.com/fwlink/?LinkId=293424.
    2>Target "_CheckForInvalidConfigurationAndPlatform" in file "C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets" from project "D:\Deven\BMPOS XAMARIN\BMPOS R2 XAMARIN\BMPOS\BMPOS\BMPOS.iOS\BMPOS.iOS.csproj" (entry point):
    2>Task "Error" skipped, due to false condition; ( '$(_InvalidConfigurationError)' == 'true' ) was evaluated as ( '' == 'true' ).
    2>Task "Warning" skipped, due to false condition; ( '$(_InvalidConfigurationWarning)' == 'true' ) was evaluated as ( '' == 'true' ).
    2>Task "Message"
    2>  Configuration=Release
    2>Done executing task "Message".
    2>Task "Message"
    2>  Platform=iPhone
    2>Done executing task "Message".
    2>Task "Error" skipped, due to false condition; ('$(OutDir)' != '' and !HasTrailingSlash('$(OutDir)')) was evaluated as ('bin\iPhone\Release\' != '' and !HasTrailingSlash('bin\iPhone\Release\')).
    2>Task "Error" skipped, due to false condition; ('$(BaseIntermediateOutputPath)' != '' and !HasTrailingSlash('$(BaseIntermediateOutputPath)')) was evaluated as ('obj\' != '' and !HasTrailingSlash('obj\')).
    2>Task "Error" skipped, due to false condition; ('$(IntermediateOutputPath)' != '' and !HasTrailingSlash('$(IntermediateOutputPath)')) was evaluated as ('obj\iPhone\Release\' != '' and !HasTrailingSlash('obj\iPhone\Release\')).
    2>Done building target "_CheckForInvalidConfigurationAndPlatform" in project "BMPOS.iOS.csproj".
    2>Target "BeforeRebuild" in file "C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets" from project "D:\Deven\BMPOS XAMARIN\BMPOS R2 XAMARIN\BMPOS\BMPOS\BMPOS.iOS\BMPOS.iOS.csproj" (target "Rebuild" depends on it):
    2>Done building target "BeforeRebuild" in project "BMPOS.iOS.csproj".
    2>Target "BeforeClean" in file "C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets" from project "D:\Deven\BMPOS XAMARIN\BMPOS R2 XAMARIN\BMPOS\BMPOS\BMPOS.iOS\BMPOS.iOS.csproj" (target "Clean" depends on it):
    2>Done building target "BeforeClean" in project "BMPOS.iOS.csproj".
    2>Target "UnmanagedUnregistration" skipped, due to false condition; ((('$(_AssemblyTimestampBeforeCompile)' != '$(_AssemblyTimestampAfterCompile)' or '$(RegisterForComInterop)' != 'true' or '$(OutputType)' != 'library') or
    2>                    ('$(_AssemblyTimestampBeforeCompile)' == '')) and
    2>                   Exists('@(_UnmanagedRegistrationCache)')) was evaluated as ((('' != '' or '' != 'true' or 'Exe' != 'library') or
    2>                    ('' == '')) and
    2>                   Exists('obj\BMPOS.iOS.csproj.UnmanagedRegistration.cache')).
    2>Target "CoreClean" in file "C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets" from project "D:\Deven\BMPOS XAMARIN\BMPOS R2 XAMARIN\BMPOS\BMPOS\BMPOS.iOS\BMPOS.iOS.csproj" (target "Clean" depends on it):
    2>Using "Delete" task from assembly "C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.MacDev.Tasks.dll".
    2>Task "Delete"
    2>  File "obj\iPhone\Release\\TempCA\BMPOS.iOS.pdb" doesn't exist. Skipping.
    2>  File "obj\iPhone\Release\\TempCA\BMPOS.iOS.exe" doesn't exist. Skipping.
    2>Done executing task "Delete".
    2>Task "ReadLinesFromFile"
    2>Done executing task "ReadLinesFromFile".
    2>Task "FindUnderPath"
    2>  Comparison path is "bin\iPhone\Release\".
    2>Done executing task "FindUnderPath".
    2>Task "FindUnderPath"
    2>  Comparison path is "obj\iPhone\Release\".
    2>Done executing task "FindUnderPath".
    2>Task "Delete"

    2>Task "RemoveDuplicates"
    2>Done executing task "RemoveDuplicates".
    2>Using "MakeDir" task from assembly "C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.MacDev.Tasks.dll".
    2>Task "MakeDir"
    2>Done executing task "MakeDir".
    2>Task "WriteLinesToFile"
    2>Done executing task "WriteLinesToFile".
    2>Done building target "CoreClean" in project "BMPOS.iOS.csproj".
    2>Target "_CleanMdbFiles" skipped, due to false condition; (Exists('$(TargetPath).mdb')) was evaluated as (Exists('D:\Deven\BMPOS XAMARIN\BMPOS R2 XAMARIN\BMPOS\BMPOS\BMPOS.iOS\bin\iPhone\Release\BMPOS.iOS.exe.mdb')).
    2>Target "_SeparateAppExtensionReferences" in file "C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets" from project "D:\Deven\BMPOS XAMARIN\BMPOS R2 XAMARIN\BMPOS\BMPOS\BMPOS.iOS\BMPOS.iOS.csproj" (target "AssignProjectConfiguration" depends on it):
    2>Task "CreateItem" skipped, due to false condition; ('%(Identity)' != '' And '%(ProjectReference.IsAppExtension)' == 'true') was evaluated as ('..\BMPOS\BMPOS.csproj' != '' And '' == 'true').
    2>Done building target "_SeparateAppExtensionReferences" in project "BMPOS.iOS.csproj".
    2>Target "_SeparateWatchAppReferences" in file "C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets" from project "D:\Deven\BMPOS XAMARIN\BMPOS R2 XAMARIN\BMPOS\BMPOS\BMPOS.iOS\BMPOS.iOS.csproj" (target "AssignProjectConfiguration" depends on it):
    2>Task "CreateItem" skipped, due to false condition; ('%(Identity)' != '' And '%(ProjectReference.IsWatchApp)' == 'true') was evaluated as ('..\BMPOS\BMPOS.csproj' != '' And '' == 'true').
    2>Done building target "_SeparateWatchAppReferences" in project "BMPOS.iOS.csproj".
    2>Target "BclBuildAddProjectReferenceProperties" in file "D:\Deven\BMPOS XAMARIN\BMPOS R2 XAMARIN\BMPOS\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets" from project "D:\Deven\BMPOS XAMARIN\BMPOS R2 XAMARIN\BMPOS\BMPOS\BMPOS.iOS\BMPOS.iOS.csproj" (target "AssignProjectConfiguration" depends on it):
    2>Done building target "BclBuildAddProjectReferenceProperties" in project "BMPOS.iOS.csproj".
    2>Target "AssignProjectConfiguration" in file "C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets" from project "D:\Deven\BMPOS XAMARIN\BMPOS R2 XAMARIN\BMPOS\BMPOS\BMPOS.iOS\BMPOS.iOS.csproj" (target "CleanReferencedProjects" depends on it):
    2>Task "AssignProjectConfiguration"
    2>  Project reference "..\BMPOS\BMPOS.csproj" has been assigned the "Release|AnyCPU" configuration.
    2>Done executing task "AssignProjectConfiguration".
    2>Done building target "AssignProjectConfiguration" in project "BMPOS.iOS.csproj".
    2>Target "_SplitProjectReferencesByFileExistence" in file "C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets" from project "D:\Deven\BMPOS XAMARIN\BMPOS R2 XAMARIN\BMPOS\BMPOS\BMPOS.iOS\BMPOS.iOS.csproj" (target "CleanReferencedProjects" depends on it):
    2>Using "ResolveNonMSBuildProjectOutput" task from assembly "Microsoft.Build.Tasks.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
    2>Task "ResolveNonMSBuildProjectOutput"
    2>  Resolving project reference "..\BMPOS\BMPOS.csproj".
    2>  Project reference "..\BMPOS\BMPOS.csproj" has not been resolved.
    2>Done executing task "ResolveNonMSBuildProjectOutput".
    2>Done building target "_SplitProjectReferencesByFileExistence" in project "BMPOS.iOS.csproj".
    2>Target "CleanReferencedProjects" in file "C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets" from project "D:\Deven\BMPOS XAMARIN\BMPOS R2 XAMARIN\BMPOS\BMPOS\BMPOS.iOS\BMPOS.iOS.csproj" (target "Clean" depends on it):
    2>Task "MSBuild" skipped, due to false condition; ('$(BuildingInsideVisualStudio)' != 'true' and '$(BuildProjectReferences)' == 'true' and '@(_MSBuildProjectReferenceExistent)' != '') was evaluated as ('true' != 'true' and 'true' == 'true' and '..\BMPOS\BMPOS.csproj' != '').
    2>Done building target "CleanReferencedProjects" in project "BMPOS.iOS.csproj".
    2>Target "CleanPublishFolder" in file "C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets" from project "D:\Deven\BMPOS XAMARIN\BMPOS R2 XAMARIN\BMPOS\BMPOS\BMPOS.iOS\BMPOS.iOS.csproj" (target "Clean" depends on it):
    2>Task "RemoveDir" skipped, due to false condition; ('$(PublishDir)'=='$(OutputPath)app.publish\' and Exists('$(PublishDir)')) was evaluated as ('bin\iPhone\Release\app.publish\'=='bin\iPhone\Release\app.publish\' and Exists('bin\iPhone\Release\app.publish\')).
    2>Done building target "CleanPublishFolder" in project "BMPOS.iOS.csproj".
    2>Target "AfterClean" in file "C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets" from project "D:\Deven\BMPOS XAMARIN\BMPOS R2 XAMARIN\BMPOS\BMPOS\BMPOS.iOS\BMPOS.iOS.csproj" (target "Clean" depends on it):
    2>Done building target "AfterClean" in project "BMPOS.iOS.csproj".
    2>Target "_ComputeTargetArchitectures" in file "C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets" from project "D:\Deven\BMPOS XAMARIN\BMPOS R2 XAMARIN\BMPOS\BMPOS\BMPOS.iOS\BMPOS.iOS.csproj" (target "Clean" depends on it):
    2>Task "ParseDeviceSpecificBuildInformation" skipped, due to false condition; ('$(DeviceSpecificBuild)' == 'true' And '$(TargetiOSDevice)' != '' And '$(_CanDeployToDeviceOrSimulator)' == 'true') was evaluated as ('false' == 'true' And '' != '' And 'True' == 'true').
    2>Done building target "_ComputeTargetArchitectures" in project "BMPOS.iOS.csproj".
    2>Target "_ComputeTargetArchitectures" skipped. Previously built successfully.
    2>Target "_CleanUploaded" in file "C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets" from project "D:\Deven\BMPOS XAMARIN\BMPOS R2 XAMARIN\BMPOS\BMPOS\BMPOS.iOS\BMPOS.iOS.csproj" (target "Clean" depends on it):
    2>Task "Delete"
    2>  File "bin\iPhone\Release\.uploaded" doesn't exist. Skipping.
    2>Done executing task "Delete".
    2>Done building target "_CleanUploaded" in project "BMPOS.iOS.csproj".
    2>Target "_ComputeTargetArchitectures" skipped. Previously built successfully.
    2>Target "_GenerateBundleName" in file "C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets" from project "D:\Deven\BMPOS XAMARIN\BMPOS R2 XAMARIN\BMPOS\BMPOS\BMPOS.iOS\BMPOS.iOS.csproj" (target "_CleanAppBundle" depends on it):
    2>Done building target "_GenerateBundleName" in project "BMPOS.iOS.csproj".
    2>Target "_GenerateBuildSessionId" in file "C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Windows.After.targets" from project "D:\Deven\BMPOS XAMARIN\BMPOS R2 XAMARIN\BMPOS\BMPOS\BMPOS.iOS\BMPOS.iOS.csproj" (target "_SayHello" depends on it):
    2>Using "GenerateBuildSessionId" task from assembly "C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.Messaging.Tasks.dll".
    2>Task "GenerateBuildSessionId"
    2>  Generated session id: 319b1c4ad11c8246e68e142c5cf1ceef
    2>  Generated build app name: BMPOS.iOS
    2>Done executing task "GenerateBuildSessionId".
    2>Done building target "_GenerateBuildSessionId" in project "BMPOS.iOS.csproj".
    2>Target "_SayHello" in file "C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Windows.After.targets" from project "D:\Deven\BMPOS XAMARIN\BMPOS R2 XAMARIN\BMPOS\BMPOS\BMPOS.iOS\BMPOS.iOS.csproj" (target "_CleanAppBundle" depends on it):
    2>Using "SayHello" task from assembly "C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.Messaging.Tasks.dll".
    2>Task "SayHello"
    2>  Connecting to Mac server 192.168.0.20...
    2>  Starting connection to 192.168.0.20...
    2>  Executing SSH command 'whereis xcodebuild'...
    2>  Executing SSH command '/usr/bin/xcodebuild -license check'...
    2>  Sending Message Xamarin.Messaging.MessageStatusMessage to topic xma/message-status
    2>  Sending Request Xamarin.Messaging.GetActiveClientsMessage to topic xma/clients
    2>  Sending Message Xamarin.Messaging.MessageStatusMessage to topic xma/message-status
    2>  Received Response of Xamarin.Messaging.GetActiveClientsMessage to topic build7384Atlan/response/xma/clients
    2>  Registering message handler 'Xamarin.Messaging.Client.DefaultHandler`1[[Xamarin.Messaging.AgentStatusMessage, Xamarin.Messaging.Common, Version=1.1.6.34, Culture=neutral, PublicKeyToken=0738eb9f132ed756]]'
    2>  Registering message handler 'Xamarin.Messaging.Client.DefaultHandler`1[[Xamarin.Messaging.Build.Contracts.CancelBuildMessage, Xamarin.Messaging.Build.Contracts, Version=4.7.10.22, Culture=neutral, PublicKeyToken=0738eb9f132ed756]]'
    2>  Registering message handler 'Xamarin.Messaging.Client.DefaultHandler`1[[Xamarin.Messaging.ClientStatusMessage, Xamarin.Messaging.Common, Version=1.1.6.34, Culture=neutral, PublicKeyToken=0738eb9f132ed756]]'
    2>  Registering message handler 'Xamarin.Messaging.Client.DefaultHandler`1[[Xamarin.Messaging.MessageStatusMessage, Xamarin.Messaging.Common, Version=1.1.6.34, Culture=neutral, PublicKeyToken=0738eb9f132ed756]]'
    2>Done executing task "SayHello".
    2>Done building target "_SayHello" in project "BMPOS.iOS.csproj".
    2>Target "_SetMtouchProjectDirectory" in file "C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.After.targets" from project "D:\Deven\BMPOS XAMARIN\BMPOS R2 XAMARIN\BMPOS\BMPOS\BMPOS.iOS\BMPOS.iOS.csproj" (target "_CleanAppBundle" depends on it):
    2>Done building target "_SetMtouchProjectDirectory" in project "BMPOS.iOS.csproj".
    2>Target "_CleanAppBundle" in file "C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets" from project "D:\Deven\BMPOS XAMARIN\BMPOS R2 XAMARIN\BMPOS\BMPOS\BMPOS.iOS\BMPOS.iOS.csproj" (target "Clean" depends on it):
    2>Using "RemoveDir" task from assembly "C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.MacDev.Tasks.dll".
    2>Task "RemoveDir"
    2>  Removing directory "bin\iPhone\Release\BMPOS.iOS.app\".
    2>Done executing task "RemoveDir".
    2>Task "Delete"
    2>  File "bin\iPhone\Release\mtouch.stamp" doesn't exist. Skipping.
    2>Done executing task "Delete".
    2>Done building target "_CleanAppBundle" in project "BMPOS.iOS.csproj".
    2>Target "_GenerateBundleName" skipped. Previously built successfully.
    2>Target "_CleanDebugSymbols" in file "C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets" from project "D:\Deven\BMPOS XAMARIN\BMPOS R2 XAMARIN\BMPOS\BMPOS\BMPOS.iOS\BMPOS.iOS.csproj" (target "Clean" depends on it):
    2>Using "GetDirectories" task from assembly "C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Tasks.dll".
    2>Task "GetDirectories"
    2>  GetDirectories: 2017-12-10T12:01:01.1642240-05:00 - Started
    2>  GetDirectories: 2017-12-10T12:01:01.1662241-05:00 - Initializing
    2>  GetDirectories: 2017-12-10T12:01:01.1702628-05:00 - Initialized
    2>  GetDirectories: 2017-12-10T12:01:01.1772241-05:00 - Serializing intputs
    2>  GetDirectories: 2017-12-10T12:01:01.1982258-05:00 - Executing
    2>  Sending Message Xamarin.Messaging.MessageStatusMessage to topic xma/message-status
    2>  Sending Request Xamarin.Messaging.Build.Contracts.ExecuteTaskMessage to topic xvs/Build/4.7.10.22/execute-task/BMPOS.iOS/319b1c4%2FGetDirectories
    2>C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(410,3): warning : The client build7384Atlan has been disconnected while waiting a post response to topic xvs/Build/4.7.10.22/execute-task/BMPOS.iOS/319b1c4%2FGetDirectories
    2>C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(410,3): warning : The client build7384Atlan has been disconnected while waiting a post response to topic xvs/Build/4.7.10.22/execute-task/BMPOS.iOS/319b1c4%2FGetDirectories
    2>C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(410,3): warning :    at Xamarin.Messaging.Client.MessagingClient.<PostAsync>d__23`2.MoveNext() in C:\d\lanes\5156\fe36becf\source\xamarinvs\External\messaging\src\Xamarin.Messaging.Client\MessagingClient.cs:line 171
    2>C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(410,3): error : AggregateException: One or more errors occurred.
    2>C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(410,3): error : ClientDisconnectedException: The client build7384Atlan has been disconnected while waiting a post response to topic xvs/Build/4.7.10.22/execute-task/BMPOS.iOS/319b1c4%2FGetDirectories
    2>C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(410,3): error :
    2>  GetDirectories: 2017-12-11T01:49:43.3854234-05:00 - Finished
    2>Done executing task "GetDirectories" -- FAILED.
    2>Done building target "_CleanDebugSymbols" in project "BMPOS.iOS.csproj" -- FAILED.
    2>
    2>Build FAILED.
    2>
    2>Time Elapsed 13:48:47.76
    Build

 has been canceled.


text:
Q: How do you prefetch django user groups for permissions checks I have a class that has permissions are checked over and over.  Each time the request user's groups are re-queried from the database instead of caching them making thing really slow.  How can I prefetch or cache the groups in the request user?
class Object(models.Model):
    ...
    def has_object_read_permission(self, request):
        if ('test' not in request.user.groups.all()):
             return False
        return True

A: I think the best way to optimise this would be with a cache like redis or memcached.
I've used django-cacheops with success for database query caching.  It works quite seamlessly with only a little bit of configuration.
If you look at the setup section you'll notice you can target specific models for caching in the settings:
CACHEOPS_DEFAULTS = {
    'timeout': 60*60
}
CACHEOPS = {
    'auth.user': {'ops': 'get', 'timeout': 60*15},
    'auth.*': {'ops': ('fetch', 'get')},
    'auth.permission': {'ops': 'all'},
    '*.*': {},
}

This way you could start by caching your users and group queries and later optimize other models too if you need to.

A: I ended up using the profile caching method in this answer.
How to cache user.groups in a request so db isn't hit every time you call request.user.groups.all()?
here is the code, there is a bug fix to add "not" to the if statement
class User(...):
    @property
    def cached_groups(self):
        if not hasattr(self, '_cached_groups'):
            self._cached_groups = list(self.groups.all())
        return self._cached_groups


text:
Q: python ctypes OSError: exception: access violation reading 0x008B1000 error
Traceback (most recent call last):
  File "c:/Users/Administrator/Source/Repos/RSPluginKey/Debug/load.py", line 9, in <module>
    work.re("")#http been del
OSError: exception: access violation reading 0x008B1000

python code
from ctypes import *
import os

sdir = os.path.dirname(__file__)
work = CDLL(sdir + "\\RSPluginKey.dll")

print(work)

work.re("http://127.0.0.1")

cpp code
#include "pch.h"
#include <iostream>
#include <string>
#include "requests.h"

extern "C" {//以此格式来添加引用函数
    __declspec(dllexport) void re(std::string http);
}

void re(std::string http) {
    using namespace std;
    using namespace requests;
    Response resp = Get(http);
    cout << resp.status << endl;
    cout << resp.GetText() << endl;
}

the requests :https://github.com/lxwAsm/requests
maybe it's requests or else thing,i am new uesr for ctypes,need help!
how to do?please


text:
Q: which datepicker event will occur when i hide the datepicker? I have the daetpicker that has binded to textbox. I just want to know when i hide the datepicker, which datepicker event will fire.
$('#datepicker-section').datepicker("hide");

Below are the some Datepicker events:
onSelect()
onClose()

Please help me on this. I tried will onClose event it didn't fired.
Thanks.

A: Here is a fiddle with an example of how to use the onClose with datepicker - FIDDLE.
When the datepicker is closed after selection of a date, the named function after the onClose: line is fired.
JS
$('#mydate').datepicker({
                         onClose: closeme
                         });

function closeme()
{
  alert('closed');
}


text:
Q: recently created file can't be downloaded i have the following situation :
i have to create files dynamically , the user agent send data to the server via ajax in this way :
$("#generateButton").live("click",function(){
dateLimite = $("#dateLimite").val();
 $.ajax({
   type    : "POST",
   url     : "../generateFile.do",
   data    : { fileName: "demandeExplication",
   nbrParam: "3",
   param1:"<%=agent.getPrenomAgentArabe()+" "+agent.getNomAgentArabe()%>",
   param2:"<%=descriptionActe%>",
   param3:dateLimite,
   },
   dataType: "html",

}).done(function(data) {
$("#test").empty().append(data);
  fileName = $("#test").find("input").val();
$.fileDownload('http://localhost:8080/gestionRH/fiches/temp/'+fileName);

});
});

the server process this data with an action that create a file dynamicaly :
public class GenerateFile extends Action
{

public ActionForward execute(ActionMapping mapping, ActionForm form,
        HttpServletRequest request, HttpServletResponse response) throws IOException {
    String fileName = request.getParameter("fileName");
    Integer nbrParam = Integer.parseInt(request.getParameter("nbrParam"));
    String[] valueParam = new String[nbrParam+1];
    for(int i =1;i<=nbrParam;i++)
    {  System.out.println(request.getParameter("param"+i));
        valueParam[i]=request.getParameter("param"+i);
    }
    FileInputStream in = new FileInputStream("C:\\Users\\free\\Desktop\\myworkspace\\gestionRH\\WebRoot\\fiches\\"+fileName+".doc");
    POIFSFileSystem fs = new POIFSFileSystem(in);
    HWPFDocument doc = new HWPFDocument(fs);
    Range r = doc.getRange();
    for(int i=1;i<=nbrParam;i++)
    {   System.out.println("<param"+i+">");
        System.out.println(valueParam[i]);
        r.replaceText("<param"+i+">", valueParam[i]);
    }

    File frr = new File("C:\\Users\\free\\Desktop\\myworkspace\\gestionRH\\WebRoot\\fiches\\temp");
    File temp = File.createTempFile("monfile",".doc",frr);
    FileOutputStream out = new FileOutputStream(temp);
    doc.write(out);
    out.close();
    in.close();
    request.setAttribute("fileName", temp.getName());
    return mapping.findForward("fileName");
}
}

i use a this plugin to do the download : http://johnculviner.com/category/jQuery-File-Download.aspx
i get an error download !
which i don't get with already existing files , or when i trigger the download after some time with this code :
function timeout_trigger() {

fileName = $("#test").find("input").val();
    }
wich i use it in this way :
......}).done(function(data) {
setTimeout("timeout_trigger()",7000);
});

and this second solution is not always working , so i must solve this problem.
why already existing files are downloaded with no problems and recently created show errors on download ?

A: That's probably because the file hasn't been uploaded, yet. With AJAX, the file is uploaded in the background. That takes time. The server code is triggered only after the whole file has been uploaded (it wouldn't want to operate on a partial file).
So what you need is a way to ask "Is there an upload for this in progress?". When I had the same problem, I sent several AJAX requests. The first one would create a status object in the session where I would record the file name.
When querying for the file, I'd look at that status object to see whether the upload was complete and return the status.
There are also ways to hook into the upload process; when you do that, you can even add a "percentage uploaded" to the status object.


text:
Q: How to create xlsx file from uploaded multipart content-type I encounter an issue saying FILE_ENDED when i create xlsx file from the multipart content-type which is received to node.js server from front-end application.
Things done so far are as follows,

*

*I have registered the fastify-multipart in fastify as,

fastify.register(fastifyMultipart, {
    attachFieldsToBody: true, sharedSchemaId: 'uploadFile',
    limits: {
      files: 1 // Max number of file fields
    }
  });

fastify.addContentTypeParser('multipart/form-data', (request, done) => {
    done(null, request);
  });

*Handling the file from controller's req.body,

function uploadFile(req, reply) {
  const attrs = req.body;
  upload(attrs)
    .then(() => {
      reply.code(200).send({ message: 'File uploaded successfully' });
    })
    .catch((error: FastifyError) => {
      reply.send(error);
    });
}

*Creating the uploaded file as xlxs format in upload.js file,

import util from 'util';
import { pipeline } from 'stream';
const pump = util.promisify(pipeline);

function upload(attrs) {
  const { file } = attrs;
  const { file: fileContent, mimetype: fileType } = file;
  const fileName = `${new Date().getTime()}.xlsx`;
  const filePath = `${__dirname}/${fileName}`;
  await pump(fileContent, createWriteStream(filePath));
  return Promise.resolve();
}

Expected the result to save the file and return success message.
Instead i received an error as follows,
{
  errors: 'FILE_ENDED'
}

Any help is appreciated.


text:
Q: Get HTTP Header in WCF MessageEncoder I'm currently writing a GZIP compression for my selfhosted WCF REST application. I have a custom implementation of the .NET 'MessageEncoder' class and a custom implementation of the 'WebContentTypeMapper' class .
How can I retrieve the http headers in the 'ReadMessage' function and in the 'GetMessageFormatForContentType' function? I'd like to check the incoming request for the 'Content-Encoding' header before decompressing the input.
Thank You.

A: This is what you can do
if (WebOperationContext.Current.IncomingRequest.Headers["Content-Encoding"] == WHAT YOU WANT)
{
            // Do what you like to do here
}

Hope this helps.
Thanks.

A: You could try with WebOperationContext.Current or OperationContext.Current (depending of your binding).
But unfortunately i think you cannot do this within the MessageEncoder implementation itself because it's too late in the process because by the time the MessageEncoder is asked to write the message contents the message frame, in this case the HTTP headers, has already been written. So, you would also need additional behavior, in the form of an IOperationBehavior, applied to your operations that sets the headers accordingly.
In one of my personnal implementation, i have solved this by adding a GzipExtension in OperationContext with a custom message inspector.
As Alex said, IIS already have a feature called dynamic compression that can compression any configured content type.

A: I don't believe you will be able to get directly to the header from the CustomMessageEncoder. What you may be able to do is leverage the updated .NET 4.5 WCF BinaryMessageEncoderBindingElement. This now allows you to specify the compression type (such as Gzip) and automatically detects if the message body is compressed before attempting to decompress. See Whats's New in Windows Communication Foundation 4.5 for more details.
If you want to get to the header, one way you could try is to leverage HttpRequestMessageProperty in an implementation of IDispatchMessageInspector.
Simple example:
    public class MyDispatchMessageInspector : IDispatchMessageInspector
    {
        public object AfterReceiveRequest(ref Message request, IClientChannel channel, InstanceContext instanceContext)
        {
            object obj;
            if (request.Properties.TryGetValue(HttpRequestMessageProperty.Name, out obj))
            {
                 var httpRequestMessageProperty = obj as HttpRequestMessageProperty;

                 if (httpRequestMessageProperty != null
                         && !string.IsNullOrEmpty(httpRequestMessageProperty.Headers["content-encoding"]))
                 {
                    ...
                 }
            }
            return null;
     }
     ...
}

Another option is to access the OperationContext using the following:
int index = System.ServiceModel.OperationContext.Current.IncomingMessageHeaders.FindHeader("content-encoding", "");
string contentEncodeHeaderValue = System.ServiceModel.OperationContext.Current.IncomingMessageHeaders.GetHeader<string>(index);


text:
Q: How to get mAP in Tensorboard I trained several times and now have a lot of events.out.tfevents- files.
Now I would like to analyze these data in tensorboard because I need the accuracy/mAP of the different training sessions.
Problem now if I open tensorboard with my last training session:
tensorboard --logdir="./traing"
I only see learning rate and a Loss. (see printscreen)
How can i see more? Especially the accuracy/mAP?
I have tensorflow/board 1.13.1 & Ubuntu 18.04 and followed this tutorial.

A: First you need to create the evaluation data. For that run the below command.
python3 legacy/eval.py \
--logtostderr \
--pipeline_config_path=[path to config file] \
--checkpoint_dir=[path to checkpoints directory] \
--eval_dir=[path to directory to save evaluation data]

Note that this is done in tensorflow 1.3.1. The eval.py file may not be inside lagacy folder in your case.
For example see my command below.
python3 legacy/eval.py \
--logtostderr \
--pipeline_config_path=training/faster_rcnn_resnet101_coco.config \
--checkpoint_dir=training/ \
--eval_dir=eval/

Then run tensorboard using the below command.
tensorboard --logdir=eval/

Here eval is the directory that you gave to save evaluation data.


text:
Q: How to Animate new Items in a Listview.builder? I have a StreamBuilder getting data from Firebase RTDB. When a new child is generated, the list is updated. I would like to do some kind of animation to indicate that this new record has arrived.
I tried using FirebaseAnimatedList, but it doesn't work for me because I need to sort the list before displaying it.
My StreamBuilder code is:
StreamBuilder(
                stream: alimentarBloc.alimentarStream,
                builder: (BuildContext context, AsyncSnapshot<List<AlimentarModel>> snapshot){
                  if (snapshot.hasData) {
                    final alimentarList = snapshot.data;
                    if (alimentarList.length == 0) return _imagenInicial(context);
                    alimentarList.sort((a, b) => b.fecha.compareTo(a.fecha));
                    return Container(
                      decoration: BoxDecoration(
                          color: Colors.grey[200],
                          borderRadius: BorderRadius.vertical(bottom: Radius.circular(20.0)),
                      ),
                      child: Stack(
                        children: <Widget>[
                          ListView.builder(
                            itemCount: alimentarList.length,
                            itemBuilder: (context, i) =>_crearItem(context, alimentarBloc, alimentarList[i]),
                            padding: EdgeInsets.only(left: 10.0, right: 10.0, top: 10.0, bottom: 20.0),
                          ),
                        ],
                      ),
                    );
                  } else if (snapshot.hasError) {
                    return Text(snapshot.error.toString());
                  }
                    return Center (child: Image(image: AssetImage('assets/Preloader.gif'), height: 200.0,));
                },
            ),

How can I animate a new Item in the list?
UPDATE
I tried tu use AnimatedList as described in Animate Item in List, but It didn't work because I don't know how and where to indicate to the AnimatedList that a new Item was added (or removed).
These are the changes I made to replace listview.builder with AnimatedList...
                  AnimatedList(
                    key: listKey,
                    initialItemCount: alimentarList.length,
                    itemBuilder: (context, i, animation) =>_crearItem(context, alimentarBloc, alimentarList[i], animation),
                    padding: EdgeInsets.only(left: 10.0, right: 10.0, top: 10.0, bottom: 20.0),
                  ),

And to wrap _crearItem with an animation...
 SlideTransition(
    position: Tween<Offset>(
      begin: const Offset(-1,0),
      end: Offset(0,0),
    ).animate(CurvedAnimation(parent: animation, curve: Curves.bounceIn, reverseCurve: Curves.bounceOut)),

    child: _crearItem //----

Since alimentarList comes complete from the StreamBuilder, where and how can I tell that a new element has arrived in the list using listKey.currentState.insertItem?


text:
Q: PHP global array not showing Consider the following function which fills an array with strings(questions):
global $questions;
function printQuestions($lines){
    $count = 1;
    foreach ($lines as $line_num => $line) {
        if($line_num%3 == 1){
            echo 'Question '.$count.':'.'
'.'<input type="text" value="' . $line . '" class="tcs"/>'.'
';
            $count++;
            $questions[] = $line;
        }
    }
}

The questions array is defined as global but it's not accessible outside the function. The following code block located at the bottom of the page returns nothing:
<?php
    if(isset($_POST['Submit'])){
        foreach($questions as $qs)
            echo $qs;
        }
?>

I know I could use session variables but I'm interested in this particular problem regarding global variables. Any help is greatly appreciated.

A: You should move global inside the function.
function printQuestions($lines){
    global $questions;
    // ...

The global keyword brings a global variable into local scope, so you can operate on it. If you don't use global in the printQuestions() function to bring the global $questions variable in the scope of the function, then $questions will be local and will be a different variable than the global one you're looking for.

A: You can use global variables in PHP as $GLOBALS["foo"] so in your case inside the function replace $questions with $GLOBALS["questions"] and everything should work.


text:
Q: Java JUnit test case For example, in a method
public void divide(Integer a){
 //.....
}

In a Java test, we need to test a parameter as String, null, 0, Long .... , do we have a tool which will automatically test these all cases ?
Thanks

A: First, the compiler will not let you pass String nor Long so there's no point in unit-testing these.
Second, while there are some tools like the one you're describing, I wouldn't recommend them. Effective unit testing is not about trying to cover as much of the state space as possible (because the state space is infinitely large). It is about the wise choice of the "significant" cases. The one who decides what is considered to be significant is you, the programmer.

A: Well you can write this yourself using a JUnit TestCase.  I don't know of any free tools which will automatically bombard it with all possible inputs to see how it will react, but I do know of the AgitarOne software product (commercial) which does this kind of testing.  It's called agitation and lets you explore how your code behaves with nulls, max values, min values, etc.

A: Why not use JUnit 4 with a Parameterized test case? JUnit 3 did not support parameterized test cases OOTB, but JUnit 4 has specific API to accept arguments and invoke your test case using those parameters as input. Should that be feasible in your case?


text:
Q: Alexander Duality for Relative Homology Is there a formulation for Alexander Duality for pairs of spaces $(A, B)$ such that $A\subset B\subset S^n$?
I can't find a reference for this anywhere, but I think it is as follows, which I arrived at using a pair of long exact homological and cohomological sequences and the five lemma: $$H_k(A,B)\cong H^{n-k}(S^n\setminus B,S^n\setminus A)$$
Is this true?

A: Spanier's Algebraic Topology, Theorem 6.2.17 (p. 296):

Let $U$ be an orientation over [a commutative ring] $R$ of an $n$-manifold $X$ and let $(A, B)$ be a compact pair in $X$ [i.e., $A \subseteq X$ is compact and $B \subseteq A$ is closed in $A$]. Then for all $q$ and $R$-modules $G$, there is an isomorphism
  $$\bar{\gamma}_U: H_q(X - B, X - A; G) \cong \bar{H}^{n - q}(A, B; G).$$

I believe this gives the statement you want (assuming $A$ and $B$ aren't too pathological). Note that Spanier defines
$$\bar{H}^q(A, B; G) = \varinjlim_{(U, V)} H^q(U, V; G),$$
where $(U, V)$ ranges over neighborhoods of $(A, B)$ in $X$.


text:
Q: Django Rest Framework: How to paginate results one month at a time? I'm looking to get one month's worth of objects at a time on a given page in a model view set. I've pulled through the date I'd like to filter on in the select related clause of the queryset (please see code below)
The transactions we're dealing with are low in volume so the size of the monthly dataset won't be overwhelming.
My view is as such:
    @action(detail=False, methods=['get'])
    def list_advisor_commissions(self, advisor=None):

        advisor_commissions = self.queryset.select_related("transaction__transacted_at")\
            .filter(advisor=advisor).order_by('-transaction__transacted_at')
        monthly_commissions = self.paginate_queryset(advisor_commissions)

        if monthly_commissions is not None:
            serializer = self.get_serializer(monthly_commissions, many=True)
            return self.get_paginated_response(serializer.data)
        serializer = self.get_serializer(advisor_commissions, many=True)
        return Response(serializer.data)

How would I go about doing this?
I've had a look in the pagination section of the DRF API reference but I'm at a loss.
Any pointers (to either relevant documentation or to a particular approach) would be greatly appreciated
Cheers!