text:
Q: D3.js streamgraph transition plots nothing Another D3.js noob here.
I'm starting out with editing the stock streamgraph example from http://bl.ocks.org/mbostock/4060954.
I've looked as several similar questions, such as this, this and this, but I can't seem to find my error.
I have two json mock data, layers0 and layers1 (originating from one of the examples above, coped from this fiddle).  I can plot both of these without a problem by changing my data in:
svg.selectAll("path")
    .data(layers0/1)  #layers0 or layers1, both work
.enter().append("path")
    .attr("d", function(d) { return area(d.values); })
    .style("fill", function() { return color(Math.random()); });

However, when I try and create a transition between these two plots, the original plot vanishes and I am left with an empty space:
function transition() {
d3.selectAll("path")
    .data(layers1/0)  #the alternate (or same) one from the function above
    .transition()
    .duration(500)
    .attr("d", area);
}

Eventually I would like lots of buttons, and transition should move between them all, such as in this example, but for now I just want to move between two datasets.

A: All right, I have found a solution that works, even though I don't fully understand it yet.  The solution was mostly copied from this fiddle.  I will point out differences between the example code and this code that have to be made (if someone can please explain why, that would be great) for it to work.
I will post my entire code for any fellow newbies that find D3 confusing.
HTML:  (I'm working off a pyramid application, hence the script imports in the head)

<title>
    Graph
</title>

    <link rel="stylesheet" type="text/css" href="${request.static_url('monitor:static/css/graph.css')}"/>

Streamgraph

And then here is my graph.js:
function graphplot(){

test_data0 = [{"0": 0.2, "1": 0.0, "-1": 0.0}, {"0": 0.0, "1": 0.6, "-1": 0.0}, {"0": 0.0, "1": 0.3, "-1": 0.0}, {"0": 0.0, "1": 0.0, "-1": 0.6}, {"0": 0.3, "1": 0.0, "-1": 0.1}, {"0": 0.0, "1": 0.2, "-1": 0.3}, {"0": 0.3, "1": 0.5, "-1": 0.0}, {"0": 0.3, "1": 0.0, "-1": 0.0}, {"0": 0.0, "1": 0.0, "-1": 0.0}]
test_data1 = [{"0": 0.0, "1": 0.0, "-1": 0.0}, {"0": 0.0, "1": 0.6, "-1": 0.0}, {"0": 0.0, "1": 0.3, "-1": 0.0}, {"0": 0.0, "1": 0.0, "-1": 0.6}, {"0": 0.3, "1": 0.3, "-1": 0.0}, {"0": 0.0, "1": 0.3, "-1": 0.3}, {"0": 0.3, "1": 0.1, "-1": 0.6}, {"0": 0.3, "1": 0.0, "-1": 0.0}, {"0": 0.0, "1": 0.0, "-1": 0.0}]

    var width = $("#graph_area").width(),
        height = 500;

    var toggle = 0;  //just so that the animation toggles between these two data

    $("#graph_area").click(function(){
        console.log('test')

        if (toggle == 0){
            streamed_history(test_data1)
            toggle = 1;
        }else {
            streamed_history(test_data0)
            toggle=0;
        }
    });

    var colors = {'0': '#6ff500', '1': '#ffad0a', '-1': '#f90035'}, //colours for the three layers; no longer random
        feedbacks = [-1, 0, 1],
        stack = d3.layout.stack().offset("wiggle"); //the plot sits on its base without wiggle
        //.values(function(d) { return d.values; }); --->removed. Throws: TypeError: t is undefined

    var svg = d3.select("#graph_area").append("svg")
        .attr("width", width)
        .attr("height", height);

    streamed_history(test_data0)

    function streamed_history(data) {
        data_array = feedbacks.map(function (f) {
            return data.map(function(element, i) { return {x: i, y: element[f]}; })
        }),
        layers = stack(data_array)  //--->No nest.entries.  And the below code for only one layers variable
        layers = feedbacks.map(function (f, i) {
            return {layer: layers[i], feedback: f, color: colors[f]}
        })

        var x = d3.scale.linear()
            .domain([0, data.length - 1])
            .range([0, width]);

        var y = d3.scale.linear()
            .domain([0,1])  //--->coplicated thing removed.  It just needs to be:([0, max of data])
            .range([height, 0]);

        var area = d3.svg.area().interpolate("basis")
            .x(function(d) { return x(d.x); })
            .y0(function(d) { return y(d.y0); })
            .y1(function(d) { return y(d.y0 + d.y); });

        //enter
        svg.selectAll("path")
            .data(layers)
        .enter().append("path")
            .attr("d", function (d) {return area(d.layer);})
            .style("fill", function(d) { return d.color; });

        //update
        d3.selectAll("path") //this effectively replaces transition(), since now each dataset is plotted independently with the duration of transition defined here.
        .data(layers)
        .transition()
        .duration(500)
        .attr("d", function (d) {return area(d.layer);});
    }

}//end graphplot

graphplot()

Hope this helps anyone in the future!

A: I tried to reproduce what you ask for here:
http://jsfiddle.net/g9JNH/
<button class="button1" onclick="transition()">Transition 1</button>
<button class="button2" onclick="transition2()">Transition 2</button>

I used the same example, and the code in principle works, could there be be something else that you have implemented like more html, or some error in the data sets? or maybe I didn't understood your question...


text:
Q: If $f=u+iv$ is an entire function such that $u^2\geq v^2,$ then $f$ is constant Let $f=u+iv$ be an entire function such that $u^2(z) \geq v^2(z), \forall z \in  \mathbb{C}.$ Could anyone advise me how to prove $f \equiv$ constant $?$ Hints will suffice. Thank you.

A: Observe that $f^2 = (u+iv)(u + iv) = (u^2 - v^2) + i(2uv)$. Since $f^2$ is entire, $u^2 - v^2$ is harmonic. Thus $u^2 - v^2$ is a nonnegative harmonic function.

A: let $g(z)=f(z)-2i$, we have $|g(z)|\geq 1$ for all $z\in \Bbb C$, now let $h(z)=\dfrac{1}{g(z)}$, $h$ is entire and bounded hence it is constant.
(the inequality):
$|g(z)|^2=u^2(z)+v^2(z)-4v(z)+4\geq 2v^2(z)-4v(z)+4=2(v(z)-1)^2+2\geq 1$

A: $$
u^2-v^2=\mathrm{Re}\,f^2\ge 0,
$$
but the function $g=f^2+1$ also entire, and
$$
\lvert g\rvert=\lvert\, f^2+1\rvert\ge\mathrm{Re}\,(\,f^2+1) \ge 1.
$$
Hence
$$
h=\frac{1}{g},
$$
entire and bounded.

A: There did not exists $z_0 ,z_1\in\mathbb{C}$ such that $f(z_0) =i$ and $f(z_1 )=2i$ and hence by Little Picard theorem $f$ must be constant.

A: Express $f$ in polar coordinates, $f(z)=re^{iϕ}$ Then the inequality implies that ϕ is restricted to the interval $[0,π/4]$.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Social network representation: graphs or sets? for social network representation, what is better, sets or graphs ? What kind of feature the first gives that the second doesn't and viceversa?

A: "Which is better, graphs or sets" depends crucially on what limitations you're imposing on how you use these.
For instance, as a potential foundation for mathematics, sets can be used to do essentially anything if you put your mind to it. For instance, sets can be used to represent a graph. You can represent a graph as a set of labelled nodes, and the edges $u\text{-}v$ are represented by unordered pairs $\{u,v\}$ (which will be singleton sets in the case of self-loops). Or you can represent a graph as a set of labelled edges, where the nodes are given as collections of edges $\{e_1, e_2, \ldots, e_k\}$ which meet one another (and where each edge can belong to at most two such sets).
More powerful than graphs are hypergraphs, which generalize graphs in that each 'edge' can link multiple nodes. If you picture social circles of friends as overlapping sets of people, what you're envisioning is a hypergraph; but conversely, a hypergraph is little more than a collection of overlapping sets.
You could represent the circles on Google+ as a sort of directed hypergraph, where each edge consists of a mapping from a single individual to the people that follow them, or from a single individual to all of the members of one of their circles. And of course, these functions (which are set-valued functions) can also be represented with sets if you're so inclined.
So it will depend on how creative you want to be with the particular tool you have at hand. Certainly, a graph on a set of people is more useful and informative (but requires more work to describe) than just having a set of people; but this is not the limitation of what you can "do with sets".


text:
Q: Use Default Value checkbox and label is showing for All Store Views also in Product Form(Product Edit) Admin Panel Here I am working on to display newly added Description field on Product Edit form under content Tab and default one has hided using css.
An issue is in below code that Use Default Value checkbox and label is showing for All Store Views also in Product Form but should be hidden. I am trying to hide it for All Store Views and it's working fine for other stores.
Here I followed this link: https://devdocs.magento.com/guides/v2.4/howdoi/customize-modifier-class.html
Please check below code:

Vendor\Module\view\adminhtml\ui_component\product_form.xml

<?xml version="1.0" encoding="UTF-8"?>

<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="content">
        <field name="description" template="ui/form/field" sortOrder="50" formElement="wysiwyg">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="wysiwygConfigData" xsi:type="array">
                        <item name="is_pagebuilder_enabled" xsi:type="boolean">false</item>
                        <item name="pagebuilder_button" xsi:type="boolean">false</item>
                        <item name="add_directives" xsi:type="boolean">true</item>
                    </item>
                </item>
            </argument>
            <settings>
                <label translate="true">Description</label>
                <dataScope>description</dataScope>
            </settings>
            <formElements>
                <wysiwyg>
                    <settings>
                        <wysiwyg>true</wysiwyg>
                    </settings>
                </wysiwyg>
            </formElements>
        </field>
    </fieldset>
</form>

Vendor\Module\etc\adminhtml\di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <virtualType name="Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Pool">
        <arguments>
            <argument name="modifiers" xsi:type="array">
                <item name="advancedInventory" xsi:type="array">
                    <item name="class" xsi:type="string">Vendor\Module\Ui\DataProvider\Product\Form\Description</item>
                    <item name="sortOrder" xsi:type="number">50</item>
                </item>
            </argument>
        </arguments>
    </virtualType>
</config>

Vendor\Module\Ui\DataProvider\Product\Form\Description.php

<?php

namespace Vendor\Module\Ui\DataProvider\Product\Form;

use Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\AbstractModifier;
use Magento\Ui\Component\Form\Field;
use Magento\Ui\Component\Form\Fieldset;

class Description extends AbstractModifier
{
    /**
    * Add Use Default Value checkbox to New added Description Field in Product Form
    * @param array $meta
    *
    * @return array
    */
    public function modifyMeta(array $meta): array
    {
        $meta['content']['children']['description']['arguments']['data']['config']['service']['template'] = 'ui/form/element/helper/service';
        $meta['content']['children']['description']['arguments']['data']['config']['disabled'] = 1;
        return $meta;
    }

    /**
     * {@inheritdoc}
     */
    public function modifyData(array $data)
    {
        return $data;
    }
}

After writing this code, achieved output. Please check screenshot, it is visible for All Store Views as well but It should be hidden :

If any Idea, please share it.

A: I added condition for All Store Views, Please check below answer.

Vendor\Module\Ui\DataProvider\Product\Form\Description.php

<?php

namespace Vendor\Module\Ui\DataProvider\Product\Form;

use Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\AbstractModifier;
use Magento\Ui\Component\Form\Field;
use Magento\Ui\Component\Form\Fieldset;
use Magento\Store\Model\StoreManagerInterface;
use Magento\Catalog\Model\Attribute\ScopeOverriddenValue;
use Magento\Catalog\Model\Locator\LocatorInterface;

class Description extends AbstractModifier
{

    protected $_storeManager;

    private $scopeOverriddenValue;

    protected $locator;

    const ALL_STORE_VIEWS = "Admin";

    public function __construct(
        StoreManagerInterface $storeManager,
        ScopeOverriddenValue $scopeOverriddenValue,
        LocatorInterface $locator
    )
    {
        $this->_storeManager = $storeManager;
        $this->scopeOverriddenValue = $scopeOverriddenValue;
        $this->locator = $locator;
    }

    public function modifyMeta(array $meta): array
    {
        $storeName = $this->_storeManager->getStore()->getName();

        if ($storeName !== self::ALL_STORE_VIEWS) {
            $meta['content']['children']['description']['arguments']['data']['config']['service']['template'] = 'ui/form/element/helper/service';
            $meta['content']['children']['description']['arguments']['data']['config']['disabled'] = !$this->scopeOverriddenValue->containsValue(
                \Magento\Catalog\Api\Data\ProductInterface::class,
                $this->locator->getProduct(),
                'product_custom_attribute_code',
                $this->locator->getStore()->getId()
            );
        }

        return $meta;
    }

    /**
     * {@inheritdoc}
     */
    public function modifyData(array $data)
    {
        return $data;
    }
}


text:
Q: Yarn uses wrong dependecy Since I've updated to yarn berry via: yarn set version berry I cannot run my project, the dependency tree is somehow broken. For ease I've provided examples for react-router but this happends with other packages too.
I have a monorepo with this structure:
/
|- .yarn
|- node_modules
|- common/
|- backoffice/
|- frontoffice/
|- test
|- .yarnrc.yml
|- package.json
|- lerna.json

frontoffice and backoffice are react apps. While common have the shared interfaces and components.
backoffice depends on react-router@5 and is writtenn in typescript while the frontoffice depends on react-router@6-beta and is ES5.
When I try to start the backoffice or the frontoffice I have the errors:
$ cd packages/frontoffice
$ yarn start
Failed to compile.
Attempted import error: 'Redirect' is not exported from 'react-router'.

In fact the backoffice is using react-router@v6 and frontoffice is using react-router@5
when I try to start the backoffice I get the error:
Type '{ path: any; render: (props: any) => Element; }' is not assignable to type 'IntrinsicAttributes & Pick<RouteProps, "path" | "children" | "caseSensitive" | "element"> & Pick<InferProps<{ caseSensitive: Requireable<boolean>; childr
en: Requireable<...>; element: Requireable<...>; path: Requireable<...>; }>, never> & Pick<...>'.
  Property 'render' does not exist on type 'IntrinsicAttributes & Pick<RouteProps, "path" | "children" | "caseSensitive" | "element"> & Pick<InferProps<{ caseSensitive: Requireable<boolean>; children: Requireable<...>; element: Require
able<...>; path: Requireable<...>; }>, never> & Pick<...>'.  TS2322

Also the IDE is highlighting the code, with errors everywhere on all packages.
I've run the lerna why command and to me everything seems fine:
$ yarn why react
├─ @mymonorepo/backoffice@workspace:packages/backoffice
│  └─ react@npm:17.0.1 (via npm:^17.0.1)
│
├─ @mymonorepo/test@workspace:packages/test
│  └─ react@npm:17.0.1 (via npm:^17.0.1)
│
├─ @mymonorepo/frontoffice@workspace:packages/frontoffice
│  └─ react@npm:17.0.1 (via npm:17.0.1)
│
└─ react-dragscroll@npm:2.0.1
   └─ react@npm:16.14.0 (via npm:^16.1.1)
$ yarn why react-router
├─ @mymonorepo/backoffice@workspace:packages/backoffice
│  └─ react-router@npm:5.2.1 [1602b] (via npm:^5.2.0 [1602b])
│
├─ @mymonorepo/test@workspace:packages/test
│  └─ react-router@npm:5.2.1 [1602b] (via npm:^5.2.0 [1602b])
│
├─ @mymonorepo/frontoffice@workspace:packages/frontoffice
│  └─ react-router@npm:6.0.0-beta.0 [46813] (via npm:6.0.0-beta.0 [46813])
│
├─ react-router-dom@npm:5.3.0
│  └─ react-router@npm:5.2.1 (via npm:5.2.1)
│
├─ react-router-dom@npm:6.0.0-beta.0
│  └─ react-router@npm:6.0.0-beta.0 (via npm:6.0.0-beta.0)
│
├─ react-router-dom@npm:5.3.0 [1602b]
│  └─ react-router@npm:5.2.1 [1602b] (via npm:^5.2.0 [1602b])
│
└─ react-router-dom@npm:6.0.0-beta.0 [46813]
   └─ react-router@npm:6.0.0-beta.0 [46813] (via npm:6.0.0-beta.0 [46813])
$ yarn why react-router-dom
├─ @mymonorepo/backoffice@workspace:packages/backoffice
│  └─ react-router-dom@npm:5.3.0 [1602b] (via npm:^5.2.0 [1602b])
│
├─ @mymonorepo/test@workspace:packages/test
│  └─ react-router-dom@npm:5.3.0 [1602b] (via npm:^5.2.0 [1602b])
│
└─ @mymonorepo/frontoffice@workspace:packages/frontoffice
   └─ react-router-dom@npm:6.0.0-beta.0 [46813] (via npm:6.0.0-beta.0 [46813])
$

Did I forget something to configure? Is there a way to force the right version for each package?
the nodeLinker option in .yarnrc.yml is set to node-modules
the pakage.json are the following:
/package.json
{
  "name": "mymonorepo",
  "version": "0.1.0",
  "license": "MIT",
  "private": true,
  "workspaces": {
    "packages": [
      "packages/*"
    ]
  },
  "resolutions": {
    "graphql": "^15.3.0"
  },
  "devDependencies": {
    "husky": "^4.3.8",
    "lerna": "^3.22.1",
    "lint-staged": "^10.5.3"
  },
  "packageManager": "yarn@3.2.0"
}

/backoffice/package.json
{
  "name": "@mymonorepo/backoffice",
  "version": "3.0.0",
  "private": true,
  "dependencies": {
    "@apollo/client": "^3.5.8",
    "@material-ui/core": "^4.12.1",
    "@material-ui/icons": "^4.11.2",
    ...
    "react": "^17.0.0",
    "react-admin": "^3.19.7",
    "react-app-polyfill": "^2.0.0",
    "react-dom": "^17.0.0",
    "react-redux": "^7.1.0",
    "react-router": "^5.2.0",
    "react-router-dom": "^5.2.0",
    "react-scripts": "^4.0.0",
    "recharts": "^1.8.5",
    "redux-saga": "^1.0.0"
  },
  "scripts": {
    "analyze": "source-map-explorer 'build/static/js/*.js'",
    "start": "react-scripts start",
    "build": "node ./build.js",
    "eject": "react-scripts test"
  },
  "homepage": ".",
  "browserslist": [
    ">0.2%",
    "not dead",
    "not ie <= 10",
    "not op_mini all"
  ],
  "devDependencies": {
    "@types/classnames": "^2.3.1",
    "@types/fetch-mock": "^7.3.2",
    "@types/jest": "^26.0.19",
    "@types/node": "^12.12.14",
    "@types/query-string": "5.1.0",
    "@types/react": "^17.0.20",
    "@types/react-dom": "^17.0.9",
    "@types/react-router": "^5.2.0",
    "@types/react-router-dom": "^5.2.0",
    "rewire": "^5.0.0",
    "source-map-explorer": "^2.0.0",
    "typescript": "^4.4.0"
  }
}

/frontoffice/package.json
{
  "name": "@mymonorepo/frontoffice",
  "version": "2.1.0",
  "dependencies": {
    "@apollo/client": "^3.1.3",
    "@fortawesome/fontawesome-svg-core": "^1.2.35",
    "@fortawesome/free-brands-svg-icons": "^5.15.4",
    "@fortawesome/free-solid-svg-icons": "^5.15.4",
    "@fortawesome/react-fontawesome": "^0.1.15",
    ...
    "react": "17.0.1",
    "react-compound-timer": "^1.1.15",
    "react-content-loader": "^5.1.4",
    "react-custom-scrollbars-2": "^4.3.0",
    "react-detect-offline": "^2.4.0",
    "react-device-detect": "^1.6.2",
    "react-dom": "17.0.1",
    "react-fullscreen-image": "^0.0.3",
    "react-gtm-module": "^2.0.8",
    "react-helmet": "^6.1.0",
    "react-router": "6.0.0-beta.0",
    "react-router-dom": "6.0.0-beta.0",
    "react-router-hash-link": "^2.0.0",
    "react-router-modal": "^2.0.0-rc3",
    "react-scripts": "^4.0.1",
    "react-scroll-trigger": "^0.6.6",
    "react-share": "^4.2.1",
    "react-show-more-text": "^1.4.6",
    "react-ticker": "^1.2.2",
    "react-use-dimensions": "^1.2.1",
    "react-window": "^1.8.6",
    ...
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts --max_old_space_size=4096 build --silent",
    "test": "react-scripts test",
    "eject": "react-scripts eject",
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": [
    ">0.2%",
    "not dead",
    "not ie <= 11",
    "not op_mini all"
  ],
  "devDependencies": {
    "depcheck": "^1.3.1",
    "eslint-config-react-app": "^6.0.0",
    "eslint-plugin-flowtype": "^5.2.0",
    "eslint-plugin-import": "^2.22.1",
    "eslint-plugin-jsx-a11y": "^6.4.1",
    "eslint-plugin-prettier": "^3.3.1",
    "eslint-plugin-react": "^7.22.0",
    "eslint-plugin-react-hooks": "^4.2.0"
  }
}


text:
Q: Expect Coin Value Problem ( a variant of coin change problem) You have a wallet with four kinds of coins with the value of \$1, \$5, \$10, and \$25. Every kind of coin is unlimited. Every time you take money from the wallet, you have an equal chance of getting one of these coins, i.e., \$1, \$5, \$10, or \$25.
Now you need to buy something that costs $x$ dollar, and you keep taking coins out of your wallet until you have enough money to buy. When $x$=30, what is the expected value of money left in your hand after your purchase?
i.e., if you take out a \$25 the first time, you have to take more coins since the price is \$30. And suppose you get a \$10 in the second time, you can stop. You pay \$30 and you have \$5 left in your hand.
How about when $x$=300, $x$=3000000?


text:
Q: Photoswipe package is compiled in wrong folder? Photoswipe lightbox is trying to load a null.#ID#.js-file in domain.test/vendor/-folder, however it can't find it there, since it's placed in domain.test/public/vendor/. I can't seem to find how to change where the plugin looks for that file.
I'm using a Sage 10 theme, if that helps anyone with finding out why this is happening.
When running yarn dev, the lightbox works perfectly fine, but it doesn't after running yarn build and gives me the following error:
Loading failed for the <script> with source domain.test/vendor/null.#ID#.js
I can see in my folder structure that null.#ID#.js exists in domain.test/public/vendor though, so it would be amazing if the fix was to just change where the JS is looking for the file?
I've installed the plugin through yarn and imported it like the example from their page, then again, it works when running yarn dev, so the setup must be correct.
So I guess my question is: How do I point Photoswipe towards the right file in public/vendor/ instead of just in /vendor/ when compiling with yarn build?


text:
Q: Two instruments vertically aligned I tried to make some music excerpts with two instruments using musixtex. I've got some alignment problems between the two instruments.
Here's an example:
\documentclass{standalone}

\usepackage{musixtex}

\begin{document}
  \begin{music}
    \parindent10mm
    \instrumentnumber{1} % a single instrument
    \setstaffs1{2} % with two staffs
    \setclef{1}{60} % clef de fa (6) en 1, clef de sol (0) en 2
    \startextract % starting real score
      \NOtes \zcharnote{-6}{IV} \hl M|\zhu{f h}\hu j\en
      \NOtes \zcharnote{-6}{V} \hl N|\zhu{d g}\hu i\en
      \NOtes \zcharnote{-6}{I} \hu J|\zhu{e g}\hu j\en
      \setdoublebar
    \endextract
   \end{music}
\end{document}

Here is what I get

As we can see, the bass is not aligned with the tremble. How can I get a better alignment?

A: Remove the  blank spaces before \hl and \hu.

\documentclass{standalone}

\usepackage{musixtex}

\begin{document}
    \begin{music}
        \parindent10mm
        \instrumentnumber{1} % a single instrument
        \setstaffs1{2} % with two staffs
        \setclef{1}{60} % clef de fa (6) en 1, clef de sol (0) en 2
        \startextract % starting real score
        \NOtes \zcharnote{-6}{IV}\hl M|\zhu{f h}\hu j\enotes
        \NOtes \zcharnote{-6}{V}\hl N|\zhu{d g}\hu i\enotes
        \NOtes \zcharnote{-6}{I}\hu J|\zhu{e g}\hu j\enotes
        \setdoublebar
        \endextract
    \end{music}
\end{document}


text:
Q: Measure and volume zero in compact spaces Let $E\subset R^n$ be a compact space. I want to prove that $E$ has Jordan-volume zero if and only if it has measure zero.
The left to right implication is trivially true even for non-compact spaces, so I am left with the other.
For that purpose, I think I need to start by picking a numerable cover by rectangles whose total volume is less than $\epsilon$. Now, if rectangles were open sets, then I could appeal to compactness to get a finite subcover with volume less than $\epsilon$. But they are not.
So I thought of picking the interior of the rectangles of the cover, and then somehow filling the gaps I've created with new rectangle interiors, procuring to only add numerable many. Thus I would be left with an open cover and I could apply compactness.
Is my approach correct? How do I proceed otherwise?


text:
Q: GoalioRememberMeDoctrineORM how to make it work? (Remember Me feature for ZfcUser) ive just recently started with zend2, now im trying to use GoalioRememberMe with doctrine but i cant seem to make it work.

*

*The checkbox for the remember me functionality appears correctly.

*goaliorememberme.global.php is in config->autoload
ive put all manner of possible values in 'remember_me_entity_class' such as the custom user entity i use with zfcuser, GoalioRememberMeDoctrineORM\Entity\RememberMe and my own remember_me entity.
They all fail at login.
Is there some other steps im missing?


text:
Q: how to print underscore as it is from double type of variable Explanation with example:
Current output of below mention method code gives:
--New use  of hyphen in JDK7 say ex. value (2453233.3) is ----2453233.3

But i want output like
--New use  of hyphen in JDK7 say ex. value (2_45_323_3.300_00) is ----2453233.3

How to get this output? please help me
Method is here
 public   void sayhi()
{   double hypdouble= 2_45_323_3.300_00;
    System.out.println("--New use  of hyphen in JDK7 say ex. value ("+Double.toString(hypdouble)+") is ----"+hypdouble);
}

A: There is no such thing. The underscore literal is just for source code, it is represented the exact same way in memory and in byte code. You will have to use a custom format to print it out the way you want.

A: Underscore literals can be used to separate groups of digits in numeric literals, which can improve the readability of your code. It does not provide the feature to increase the readability of your code output.
I believe you will have have write your own logic to display the output in your desired format.


text:
Q: Custom views (Canvas vs. XML) Based on the posted screenshots, the drawing on the top was created using canvas and the drawing on the bottom was created using XML. The XML drawing is exactly what I want but unfortunately due to Android's 'too many views' warning it's not a good idea for me to use it :-(  As regards to the canvas drawing is there something that I'm missing or not doing right that is causing the drawing to not look exactly like the XML one or do I have to rely on values? I've tried numerous different ways such as changing values of widths and spacing etc. and I STILL had no luck. Even if anyone knows a better method for drawing this, I'd like to know about it please. All relevant advice and help would be appreciated.
Java (Canvas)
public class Car extends View {
    private final Paint mBlackPaint = new Paint();
    private final Paint mRedPaint = new Paint();
    private final TextPaint mTextPaint;

    public Car(Context context, AttributeSet attrs) {
        super(context, attrs);
        int valueInDp = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 1, getResources().getDisplayMetrics());
        int valueInSp = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, 20, getResources().getDisplayMetrics());

        mRedPaint.setColor(Color.parseColor("#CC3333"));

        mBlackPaint.setAntiAlias(false);
        mBlackPaint.setColor(Color.BLACK);
        mBlackPaint.setStrokeWidth(valueInDp);
        mBlackPaint.setStyle(Paint.Style.STROKE);

        mTextPaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
        mTextPaint.setColor(Color.BLACK);
        mTextPaint.setTextAlign(Paint.Align.CENTER);
        mTextPaint.setTextSize(valueInSp);

        mWindowPaint = new Paint();
        mWindowPaint.setColor(Color.parseColor("#CC3333"));
        mWindowPaint.setStrokeWidth(valueInDp);
    }

    private Paint mWindowPaint;
    Rect rect = new Rect();
    Rect rect2 = new Rect();

    @Override protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        if (getWidth() == 0)
            return;

        int w = canvas.getWidth();
        int h = canvas.getHeight();

        int rectWidth = ((w - 20) / 4) / 6;
        int space = (((w - 20) / 4) / 13);
        int oneSevenSpace = (((w - 20) / 4) / 6);
        int oneSevenWidth = ((w - 20) / 4) / 6;
        int topRectHeight = getPaddingTop();
        int bottomRectHeight = getPaddingBottom();

        //draw red rectangles
        int mSideRectWidth = 10;
        canvas.drawRect(0, 0, mSideRectWidth, getHeight(), mRedPaint); //draw left end rectangle
        canvas.drawRect(getWidth() - mSideRectWidth, 0, getWidth(), getHeight(), mRedPaint); //draw right end rectangle

        //draw carriages
        setBackgroundColor(Color.parseColor("#808080"));
        int boxWidth = (getWidth() - mSideRectWidth) / 4;

        //draw text views
        for (int i = 0; i < 4; i++) {
            canvas.drawText(Integer.toString(i + 1), (i * boxWidth + 10) + (boxWidth / 2), ((canvas.getHeight() / 2) - ((mTextPaint.descent() + mTextPaint.ascent()) / 2)), mTextPaint);
        }

        //draw box separators
        for (int i = 1; i < 4; i++) {
            canvas.drawLine(mSideRectWidth + boxWidth * i, 0, mSideRectWidth + boxWidth * i, getHeight(), mBlackPaint);
        }

        //draw windows
        for (int index = 0; index < 4; index++) {
            if (index == 0) {
                for (int i = 0; i < 3; i++) {
                    mWindowPaint.setStyle(Paint.Style.STROKE);

                    int left = ((i * (oneSevenWidth + oneSevenSpace)) + 6) + (index * boxWidth) + 15 + (oneSevenSpace / 2);
                    int right = left + oneSevenWidth;

                    rect.set(left, 0, right, topRectHeight);
                    canvas.drawRect(rect, mWindowPaint);

                    rect2.set(left, h - bottomRectHeight, right, h);
                    canvas.drawRect(rect2, mWindowPaint);
                }
            }
            if (index == 1 || index == 2) {
                for (int i = 0; i < 4; i++) {
                    mWindowPaint.setStyle(Paint.Style.STROKE);

                    int left = ((i * (rectWidth + space))) + (index * boxWidth) + 15 + (space / 2);
                    int right = left + rectWidth;

                    rect2.set(left, h - bottomRectHeight, right, h);
                    canvas.drawRect(rect2, mWindowPaint);

                    if (index == 2 && i == 3) {
                        mWindowPaint.setStyle(Paint.Style.FILL_AND_STROKE);
                    }
                    rect.set(left, 0, right, topRectHeight);
                    canvas.drawRect(rect, mWindowPaint);
                }
            }
            if (index == 3) {
                for (int i = 0; i < 3; i++) {
                    mWindowPaint.setStyle(Paint.Style.STROKE);

                    int left = ((i * (oneSevenWidth + oneSevenSpace)) - 1) + ((index * boxWidth)) + (space * 2);
                    int right = left + oneSevenWidth;

                    rect.set(left, 0, right, topRectHeight);
                    canvas.drawRect(rect, mWindowPaint);

                    rect2.set(left, h - bottomRectHeight, right, h);
                    canvas.drawRect(rect2, mWindowPaint);
                }
            }
        }
    }
}

XML

<View
    android:layout_width="5dp"
    android:layout_height="wrap_content"
    android:background="#CC3333" />

<!--start of carriage 1-->
<RelativeLayout
    android:layout_width="0dp"
    android:layout_height="match_parent"
    android:layout_weight="1"
    android:background="#808080" >
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:gravity="center"
        android:text="1"
        android:textColor="@android:color/black" />

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="10dp"
        android:layout_alignParentTop="true"
        android:orientation="horizontal"
        android:weightSum="100" >

        <View
            android:layout_width="1dp"
            android:layout_height="0dp"
            android:layout_weight="4" />

        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="20"
            android:background="@drawable/emptyrect_red" />

        <View
            android:layout_width="1dp"
            android:layout_height="0dp"
            android:layout_weight="18" />

        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="20"
            android:background="@drawable/emptyrect_red" />

        <View
            android:layout_width="1dp"
            android:layout_height="0dp"
            android:layout_weight="18" />

        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="20"
            android:background="@drawable/emptyrect_red" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="10dp"
        android:layout_alignParentBottom="true"
        android:orientation="horizontal"
        android:weightSum="100" >

        <View
            android:layout_width="1dp"
            android:layout_height="0dp"
            android:layout_weight="4" />

        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="20"
            android:background="@drawable/emptyrect_red" />

        <View
            android:layout_width="1dp"
            android:layout_height="0dp"
            android:layout_weight="18" />

        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="20"
            android:background="@drawable/emptyrect_red" />

        <View
            android:layout_width="1dp"
            android:layout_height="0dp"
            android:layout_weight="18" />

        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="20"
            android:background="@drawable/emptyrect_red" />
    </LinearLayout>
</RelativeLayout>
<!--end of carriage 1-->

<View
    android:layout_width="1dp"
    android:layout_height="wrap_content"
    android:background="#1D1D1D" />

<!--start of carriage 2-->
<RelativeLayout
    android:layout_width="0dp"
    android:layout_height="match_parent"
    android:layout_weight="1"
    android:background="#808080" >
    <TextView
        android:layout_centerHorizontal="true"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:gravity="center"
        android:text="2"
        android:textColor="@android:color/black" />
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="10dp"
        android:layout_alignParentTop="true"
        android:orientation="horizontal"
        android:weightSum="100" >

        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="20"
            android:background="@drawable/emptyrect_red" />

        <View
            android:layout_width="1dp"
            android:layout_height="0dp"
            android:layout_weight="7" />

        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="20"
            android:background="@drawable/emptyrect_red" />

        <View
            android:layout_width="1dp"
            android:layout_height="0dp"
            android:layout_weight="6" />

        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="20"
            android:background="@drawable/emptyrect_red" />

        <View
            android:layout_width="1dp"
            android:layout_height="0dp"
            android:layout_weight="7" />

        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="20"
            android:background="@drawable/emptyrect_red" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="10dp"
        android:layout_alignParentBottom="true"
        android:orientation="horizontal"
        android:weightSum="100" >

        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="20"
            android:background="@drawable/emptyrect_red" />

        <View
            android:layout_width="1dp"
            android:layout_height="0dp"
            android:layout_weight="7" />

        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="20"
            android:background="@drawable/emptyrect_red" />

        <View
            android:layout_width="1dp"
            android:layout_height="0dp"
            android:layout_weight="6" />

        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="20"
            android:background="@drawable/emptyrect_red" />

        <View
            android:layout_width="1dp"
            android:layout_height="0dp"
            android:layout_weight="7" />

        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="20"
            android:background="@drawable/emptyrect_red" />
    </LinearLayout>
</RelativeLayout>
<!--end of carriage 2-->

<View
    android:layout_width="1dp"
    android:layout_height="wrap_content"
    android:background="#1D1D1D" />

<!--start of carriage 3-->
<RelativeLayout
    android:layout_width="0dp"
    android:layout_height="match_parent"
    android:layout_weight="1"
    android:background="#808080" >
    <TextView
        android:layout_centerHorizontal="true"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:gravity="center"
        android:text="3"
        android:textColor="@android:color/black" />
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="10dp"
        android:layout_alignParentTop="true"
        android:orientation="horizontal"
        android:weightSum="100" >

        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="20"
            android:background="@drawable/emptyrect_red" />

        <View
            android:layout_width="1dp"
            android:layout_height="0dp"
            android:layout_weight="7" />

        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="20"
            android:background="@drawable/emptyrect_red" />

        <View
            android:layout_width="1dp"
            android:layout_height="0dp"
            android:layout_weight="6" />

        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="20"
            android:background="@drawable/emptyrect_red" />

        <View
            android:layout_width="1dp"
            android:layout_height="0dp"
            android:layout_weight="7" />

        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="20"
            android:background="@drawable/fullrect_red" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="10dp"
        android:layout_alignParentBottom="true"
        android:orientation="horizontal"
        android:weightSum="100" >

        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="20"
            android:background="@drawable/emptyrect_red" />

        <View
            android:layout_width="1dp"
            android:layout_height="0dp"
            android:layout_weight="7" />

        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="20"
            android:background="@drawable/emptyrect_red" />

        <View
            android:layout_width="1dp"
            android:layout_height="0dp"
            android:layout_weight="6" />

        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="20"
            android:background="@drawable/emptyrect_red" />

        <View
            android:layout_width="1dp"
            android:layout_height="0dp"
            android:layout_weight="7" />

        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="20"
            android:background="@drawable/emptyrect_red" />
    </LinearLayout>
</RelativeLayout>
<!--end of carriage 3-->

<View
    android:layout_width="1dp"
    android:layout_height="wrap_content"
    android:background="#1D1D1D" />

<!--start of carriage 4-->
<RelativeLayout
    android:layout_width="0dp"
    android:layout_height="match_parent"
    android:layout_weight="1"
    android:background="#808080" >
    <TextView
        android:layout_centerHorizontal="true"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:gravity="center"
        android:text="4"
        android:textColor="@android:color/black" />
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="10dp"
        android:layout_alignParentTop="true"
        android:orientation="horizontal"
        android:weightSum="100" >

        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="20"
            android:background="@drawable/emptyrect_red" />

        <View
            android:layout_width="1dp"
            android:layout_height="0dp"
            android:layout_weight="18" />

        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="20"
            android:background="@drawable/emptyrect_red" />

        <View
            android:layout_width="1dp"
            android:layout_height="0dp"
            android:layout_weight="18" />

        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="20"
            android:background="@drawable/emptyrect_red" />

        <View
            android:layout_width="1dp"
            android:layout_height="0dp"
            android:layout_weight="18" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="10dp"
        android:layout_alignParentBottom="true"
        android:orientation="horizontal"
        android:weightSum="100" >

        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="20"
            android:background="@drawable/emptyrect_red" />

        <View
            android:layout_width="1dp"
            android:layout_height="0dp"
            android:layout_weight="18" />

        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="20"
            android:background="@drawable/emptyrect_red" />

        <View
            android:layout_width="1dp"
            android:layout_height="0dp"
            android:layout_weight="18" />

        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="20"
            android:background="@drawable/emptyrect_red" />

        <View
            android:layout_width="1dp"
            android:layout_height="0dp"
            android:layout_weight="18" />
    </LinearLayout>
</RelativeLayout>
<!--end of box 4-->

<View
    android:layout_width="5dp"
    android:layout_height="wrap_content"
    android:background="#CC3333" />

Results

A: You should use floats rather than ints for your layout calculations, then cast to an int whenever the Android framework requires it.
int rectWidth = ((w - 20) / 4) / 6;

For example, the value of rectWidth here will be truncated to the nearest integer. The loss of precision is compounded in later calculations, leading to the different behaviour.


text:
Q: Save specific part of matplotlib figure I want to save only a specific part of a matplotlib figure by giving coordinates of a rectangle. The below code creates and saves the whole figure:
import numpy as np
import matplotlib.pyplot as plt

# Fixing random state for reproducibility
np.random.seed(19680801)

N = 50
x = np.random.rand(N)
y = np.random.rand(N)
colors = np.random.rand(N)
area = (30 * np.random.rand(N))**2
plt.scatter(x, y, s=area, c=colors, alpha=0.5)

plt.savefig('Plot.png', format='png')

I want to save only a specific part inside the plot determined by 4 points (in data coordinates), for example only the highlighted rectangular area:
Desired result: Save only the part highlighted in green

A: You can use the parameter bbox_inches= of savefig() to delimit the region to save. The problem is finding out the coordinates of the region in inches. For that, you have to use transforms:
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.transforms import Bbox

# Fixing random state for reproducibility
np.random.seed(19680801)

N = 50
x = np.random.rand(N)
y = np.random.rand(N)
colors = np.random.rand(N)
area = (30 * np.random.rand(N))**2

fig, ax = plt.subplots()
ax.scatter(x, y, s=area, c=colors, alpha=0.5)
fig.canvas.draw()  # force draw

x0,x1 = 0.2, 0.6
y0,y1 = 0.4, 0.8

bbox = Bbox([[x0,y0],[x1,y1]])
bbox = bbox.transformed(ax.transData).transformed(fig.dpi_scale_trans.inverted())
fig.savefig('test.png', bbox_inches=bbox)

test.png


text:
Q: Rails w/custom TCP data service I'm building a Rails app that needs to connect to a custom TCP data service, which uses XML messages to exchange data.  Functionally, this is not a problem, but I'm having trouble architecting it in a way that feels "clean".
Brief overview:
User logs in to the Rails app.  At login, the credentials are validated with the data service and a "context id" is returned.
Request:
<login><username>testuser</username><password>mypass</password></login>

Response:
<reply><context_id>123456</context_id></reply>

This context_id is basically a session token.  All subsequent requests for this user must supply this context_id in the XML message.
Request:
<history><context_id>123456</context_id><start_date>1/1/2010</start_date><end_date>1/31/2010</end_date></history>

Response:
<reply><history_item>...</history_item><history_item>..</history_item></reply>

I have hidden away all the XML building/parsing in my models, which is working really well.  I can store the context_id in the user's session and retrieve it in my controllers, passing it to the model functions.
@transactions = Transaction.find( { :context_id => 123456, :start_date => '1/1/2010', :end_date => '1/31/2010' } )

From a design point of view, I have 2 problems I'd like to solve:

*

*Passing the context_id to every Model action is a bit of a pain.  It would be nice if the model could just retrieve the id from the session itself, but I know this breaks the separation of concerns rule.

*There is a TcpSocket connection that gets created/destroyed by the models on every request.  The connection is not tied to the context_id directly, so it would be nice if the socket could be stored somewhere and retrieved by the models, so I'm not reestablishing the connection for every request.

This probably sounds really convoluted, and I'm probably going about this all wrong.  If anybody has any ideas I'd love to hear them.
Technical details:  I'm running Apache/mod_rails, and I have 0 control over the TCP service and it's architecture.

A: Consider moving the API access to a new class, and store the TcpSocket instance and the context ID there. Change your models to talk to this API access class instead of talking to the socket themselves.
Add an around_filter to your controller(s) that pulls the context ID out of the session, stores it into the API access class, and nils it after running the action. As long as your Rails processes remain single-threaded, you'll be fine. If you switch to a multi-threaded model, you'll also need to change the API access class to store the context ID and the TcpSocket in thread-local storage, and you'll need one TcpSocket per thread.


text:
Q: Modules not Found Py2app Compiling my app on "alias mode"  $ python setup.py py2app -A and opening the .app works fine, but trying to compile the deployable version $ python setup.py py2app crashes after trying to open the app.
I'm using MacOsCatalina , python 3.7 and pycharm
setup.py
from setuptools import setup

    APP = ['test.py']
    DATA_FILES = []

    OPTIONS = {

        'argv_emulation': True,
        'includes': ['requests'],
        'packages': ['requests', 'rumps']

    }

    setup(
        app=APP,
        name='TestApp',
        data_files=DATA_FILES,
        options={'py2app': OPTIONS},
        setup_requires=['py2app'],
    )

What Console shows after running $ python setup.py py2app
Modules not found (conditional imports):
 * Cookie (requests.compat)
 * OpenSSL.crypto (urllib3.contrib.pyopenssl)
 * Queue (urllib3.util.queue)
 * StringIO (pkg_resources._vendor.six, requests.compat, urllib3.packages.six)
 * com (pkg_resources._vendor.appdirs)
 * com.sun.jna (pkg_resources._vendor.appdirs)
 * com.sun.jna.platform (pkg_resources._vendor.appdirs)
 * cookielib (requests.compat)
 * cryptography.x509.extensions (urllib3.contrib.pyopenssl)
 * urllib2 (requests.compat)
 * urlparse (requests.compat)
 * win32com (pkg_resources._vendor.appdirs)
 * win32com.shell (pkg_resources._vendor.appdirs)

UPDATE:
I tried to make a barebones version with rumps as the only imported module in test.py , here's the crash log:
ModuleNotFoundError: No module named 'pkg_resources.py2_warn'

A: I downgraded setuptools from version 46 to 44, pip install setuptools==44.0.0
latest version causes issues with py2app and pyinstaller.


text:
Q: Spacing Between Divs on a Site I am working on a project, and I need the black divs to be much closer together on the top and bottom. Also I need the divs to be in the center of the page. How would I do this with CSS?
HTML:

North America

Brazil

Europe Nordic and East

Europe West

Latin America North

Latin America South

Oceania

Russia

Turkey

Public Beta Environment

`

CSS:
.na , .br , .eune , .euw , .lan , .las , .oce , .ru , .tr , .pbe
{
  background-color: rgba(0, 0, 0, 0.75);
  width: 425px;
  height: auto;
  margin-top: 0;
  margin-bottom: 0;

}

A screenshot of the current result:

A: You just need to remove the default margins those
s are getting:
h5 {
    margin: 0;
}

In order to center them, you need to set the right and left margins to 'auto'. Here's a jsfiddle with both things: https://jsfiddle.net/jameson5555/uead1cL4/

A: You can just edit the "h5" headline tag with CSS by doing something like this:
{
// Remove spaces
margin: 0px;
// Centered text
text-align: center;
}


text: Q: Is there a Google Drive API share callback like for file picker In order to further integrate my app with Google Drive I added the Google Drive sharing dialog as explained here https://developers.google.com/drive/v3/web/manage-sharing#launching_the_google_drive_sharing_dialog_in_your_app It gives the same dialog as in Drive itself which is great. What I miss is the option of a callback function like the Drive file-picker has to process the result of the sharing dialog. Does anyone know any further documentation on this, I have only found this specific example.


text:
Q: How to prevent of re-replacing by second regex? I have two regex(s) on the way of my input, these:
// replace a URL with a link which is like this pattern: [LinkName](LinkAddress)
$str= preg_replace("/\[([^][]*)]\(([^()]*)\)/", "$1", $str);

// replace a regular URL with a link
$str = preg_replace("/(\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|])/i","untitled", $str);

Now there is a problem (somehow a collision). For regular URLs everything is fine. But for a pattern-based URLs, there is a problem: The first regex create a link of that and second regex again create a link of its href-attribute value.
How can I fix it?
Edit: According to the comments, how can I create a single regex instead of those two regex? (using preg_replace_callback). Honestly I tried it but it doesn't work for none kind of URLs ..
Is combining them possible? Because the output of those isn't identical. The first one has a LinkName and the second one has a constant string untitled as its LinkName.

A: $str = preg_replace_callback('/\[([^][]*)]\(([^()]*)\)|(\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|])/i',
function($matches) {
    if(isset($matches[3])) {
        // replace a regular URL with a link
        return "untitled";
    } else {
        // replace a URL with a link which is like this pattern: [LinkName](LinkAddress)
        return "".$matches[1]."";
    }
}, $str);

echo $str;

One way would be to do it like this. You merge your two expressions together with the alternative character |. Then in your callback function you just check if your third capture group is set (isset($matches[3])) and if yes, then your second regular expression matched the string and you replace a normal link, otherwise you replace with link/linktext.
I hope you understand everything and I could help you.


text:
Q: Exclude Subproject commit Git How can I exclude Subproject commit .... I changed nothing in the submodule, only pull changes from remote repository! I think I commited something unneeded in the main repository, when created submodule. Any ideas?
1) When I created submodule git diff in main repository also showed
submodule-path:
    Subproject commit 5a8162ff9a602deb96956854346988e1ee45672e

and I commited this
2) then someone commited to submodule, so it has the following log
2ff89a2bfcaa0 last commit
5a8162ff9a602d  first commit

3) I updated submodule with
git submodule update --remote --merge
4) now git status shows
modified:   submodule-path (new commits)

But I changed nothing in the submodule, only pull last remote changes! And I need this last changes
git diff shows
diff --git a/submodule-path b/submodule-path
index 5a8162f..2ff89a2 160000
--- a/submodule-path
+++ b/submodule-path
@@ -1 +1 @@
-Subproject commit 5a8162ff9a602deb96956854346988e1ee45672e
+Subproject commit 2ff89a2bfcaa014885a70b0da86e997ecd8d0688

A: Update:
This is NOT an error. The submodules just work in this way.
The main repo doesn't track the submodule's files. It only tracks the submodule's url and commit id (the submodule's state at a specific point).
Quote from Starting with Submodules in book Pro Git

Although sbmodule DbConnector is a subdirectory in your working directory, Git sees it as a submodule and doesn't track its contents when you're not in that directory. Instead, Git sees it as a particular commit from that repository.

Since you updated the module with git submodule update, you have to stage the change (in fact, the updated commit id). If you don't wanna update the tracking of submodules, just don't use git submodule update at the beginning, or just discard the change.

It's very likely that the submodule is HEAD detached. Go in the submodule, reset the submodule to fix the HEAD detached status.
# Do this in the submodule
git reset --hard origin/master

Then update the submodule to the latest commit.
# run in the project's root, not the submodule's
git submodule update --remote --merge

A: First, let's try to make some things here clear.  It's hard because when you work with Git on your own, it's complicated.  When you add a second Git repository–to which you git push your own commits, and from which you git fetch other people's new commits—that is complicated too.  A submodule is nothing more than a third Git repository, and that third Git repository has a fourth Git repository to which you might perhaps git push your own commits, and from which you might git fetch other people's new commits.  So we're leaping right into a situation in which there are at least four Git repositories, all of which are somewhat independent of each other.
We could try to draw pictures but even pictures will be a bit muddy.  How do we keep four repositories straight?  Git has names for two of them: the two that you work with directly, yourself.  One is the superproject, which is where you are running git diff and seeing:

diff --git a/submodule-path b/submodule-path
index 5a8162f..2ff89a2 160000
--- a/submodule-path
+++ b/submodule-path
@@ -1 +1 @@
-Subproject commit 5a8162ff9a602deb96956854346988e1ee45672e
+Subproject commit 2ff89a2bfcaa014885a70b0da86e997ecd8d0688

The other is the submodule itself: if you cd submodule-path and run various Git commands, you'll see that it is an ordinary Git repository.  The only thing unusual about it is that it is almost always in "detached HEAD" mode.
Your superproject Git probably has an origin.  That's a repository—well, technically, a short name you can use in this Git to refer to another repository—to which you can git push commits you make in the superproject.  You will need to make a commit in the superproject and then git push this new commit to origin.  What precisely goes into this superproject commit?  We'll see in a moment.
Your submodule Git also has an origin.  That's a different other Git repository: the fourth Git in this not-very-well-drawn-at-all picture.  It's not clear to me whether you want to send commits to that fourth repository.  You do presumably want to get a commit from that repository.  There are multiple ways to go about this, including using git submodule update --remote, perhaps with additional options.  I prefer to just cd submodule-path and start working directly in the submodule Git as this reduces the problem to things you already know how to do: manipulate one local Git repository based on new commits that have appeared in its origin.
Supposing you just want to pick up some new commit(s) in the submodule
If this is the case, you can:
cd submodule-path           # begin working in your submodule
git fetch                   # update origin/*
git checkout origin/master  # get a detached HEAD on the desired commit
                            # (this assumes `origin/master` is the
                            # desired commit; it's impossible for me
                            # to know which commit you desire)

and now the submodule has the desired commit as its detached HEAD.  There is nothing to git push from here: all the commits that reside in this repository are commits obtained from this submodule's origin's Git.
(Using git submodule update --remote may do the cd submodue-path and git fetch and git checkout origin/master for you, all without changing your own working directory.  The whole operation runs in its own sub-shell so that none of these cd operations affect where you are.  That seems to be what your git submodule update --remote --merge did: there was no need to make a new merge commit, so it just switched to the commit identified by some branch name on origin.)
But if you need to make new commits in the submodule ...
In this case, you may want to force the submodule to be on a branch, so that you're working in a more normal work-flow.  Then you'd probably want to git checkout master for instance, and then do various commands.  Eventually you might end up with a new commit made in your submodule repository, which you will need to git push to the origin repository of the submodule, so that other people will be able to obtain this commit too.
You can leave the submodule on its branch.  The submodule's branch is irrelevant to the superproject Git: the superproject Git cares only which commit is checked out in the submodule.  (That's why in the earlier case above, we can just switch the detached HEAD around.)
Now that the submodule Git is on the right commit, you must make a new superproject commit
At this point, you can cd back out of the submodule into the superproject.  You'll see in git diff output something exactly like you quoted above, and git status will say:

modified:   submodule-path (new commits)

This doesn't necessarily mean there are any new commits in the submodule repository that aren't in the submodule repository's origin.  It just means that the submodule repository is on (as its HEAD, detached or not) a commit that is not the commit that the current superproject status says it should be on.
The problem here is that the current superproject commit is, in a way, defective.  It was correct, but it isn't any more, just as the current superproject commit would be defective if you had, say, edited the file README.md locally.  This means that you need to make, in the superproject, a new, corrected commit.  The superproject Git will make the new commit from whatever is in the index of the superproject repository, so you now need to update the index.
If you'd changed a README.md file, the way you'd update the index is:
git add README.md

But what you changed was not a README.md file.  It was, instead, the submodule hash ID.  So you need to record the new hash ID in the index.  The way you do that is:
git add submodule-path

This takes the hash ID from the submodule by running cd submodule-path; git rev-parse HEAD to gets the raw hash ID—the one that showed up in the git diff—and stuff that hash ID into the index.  Now git diff—which compares the index to your work-tree—won't show these Subproject commit lines any more, but git diff --cached—which compares the current (superproject) commit to the index—will show them.  Now git status will say that these "new commits" are ready to be committed, rather than not-yet-staged-for-commit.
You can git add any other superproject files (if there are any that need to be updated in the index) at this time.  Then:
git commit

in the superproject will make a new commit that will record the hash ID you put into the superproject's index when you ran git add on the submodule path.
You're (locally) done with the update, but here's some things to think about
Note that every commit in the superproject records the hash ID in the submodule.  Every time you git checkout a different superproject commit, that not only extracts the right superproject files into the (superproject) index and your (superproject) work-tree, it also extracts the recorded submodule hash ID into the (superproject) index.  It does not, by default, cd into the submodule and git checkout that particular commit by its hash ID.  You can change this with a setting, or add --recursive to git checkout; or you can just run git submodule update, which tells your Git to cd into each submodule, one at a time, and git checkout the hash ID currently recorded in the (superproject) index.
You will, at some point, need to git push the new commit you made in your superproject, to the origin (of the superproject), so that the new commit with its newly recorded hash ID appears in the Git over at the origin of your superproject.  You can do this whenever you like—but suppose you did make new commits in your submodule, and you have not yet used git push in the submodule itself to send those new commits to the origin of the submodule.  In this case, the new commit you made in the superproject records the hash ID of a commit that only exists in your local submodule repository.  If someone runs git fetch to the superproject Git's origin, they'll get this new hash ID from the new commit you sent, but not be able to find that commit in their clone of the submodule.  So if you did make new submodule commits, it's usually best to git push them first, then git push the new superproject commits.
(If you did not make any new submodule commits, there's no problem here.)

A: Running the command git submodule update -f --init should resolve your issue, this will reset your submodule to the remote HEAD


text:
Q: Google Maps Javascript API V3 scroll less responsive than simple google map embed I am working on a store locator web app and I have a problem with the scroll. The scroll/zoom works only if I scroll really intense.
This problem is on their demo codes as well:
https://developers.google.com/maps/documentation/javascript/examples/
https://google-developers.appspot.com/maps/documentation/javascript/examples/map-simple
But if you scroll on http://maps.google.com/ the scroll works really well.
Do you know any solution for this?

A: Stated in my comment to the OP:
I've observed this in IE8 and maps api v3. This is due to the tiles fading in and out, as far as I can see so I sniff browsers and if my users are using IE8, I serve them up a v2 map where the scroll/zoom works much much better. As far as I know, there's no way to turn off the tile fading when zooming/panning in v3


text:
Q: Android Programming - Navigation Drawer Multiple Instances of Same Fragment I am trying to make a weather app where each location that the user adds, it will be shown in the Navigation Drawer.
I would like to have multiple items in the Navigation Drawer, each item a different location and when a location is being clicked, a fragment will load the weather info for it. I want the same fragment as the layout for any location will be the same.
The info will be loaded via an API call based on the location that was clicked.
My question is, how can I have the same fragment multiple times in the navigation drawer if this is possible?
I thought about creating a new fragment for each location when loaded from the DB but this might be overwhelming with lots of locations.
Thanks in advance.

A: you could actually use same fragment and assign different constructors to the fragment object when you're going to respond to user click ...
navigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {
        @Override
        public boolean onNavigationItemSelected(@NonNull MenuItem item) {
            Log.e("NAVIGATION------", item.toString());
            switch(){
              if(item == R.id.nav_scenario_1){
                 SettingsFragment fragment = new
                 SettingsFragment();
                 Bundle arguments = new Bundle();
                 arguments.putString( string_key , desired_string);
                 fragment.setArguments(arguments);
                 final FragmentTransaction ft =
                 getFragmentManager().beginTransaction();
                 ft.replace(R.id.content, fragment , FRAGMENT_TAG);
                 ft.commit();
                }
                ....
                }
            return true;
        }
    });

or from the navigation controller you could use something like that in order to pass the data ...
    <fragment
    android:id="@+id/nav_terms"
    android:name="com.google.fragment.MainFragment"
    android:label="@string/menu_terms"
    tools:layout="@layout/fragment_main" >
    <argument
        android:name="UsedObjectString"
        app:argType="string"
    android:defaultValue="some_data_as_json"/>
    </fragment>

and then could retrieve it in the fragment like that :
 if(getArguments() != null) {
    String stringObject =
  MainFragmentArgs.fromBundle(getArguments()).UsedObjectString();
}


text:
Q: Apollo is not re-sending the query to the server I build an api-platform app with a graphql endpoint. On client side I manage queries and mutations with apollo client like this(In vuejs front-end):
import { ApolloClient } from 'apollo-client'
import { HttpLink } from 'apollo-link-http'
import { InMemoryCache } from 'apollo-cache-inmemory'

const httpLink = new HttpLink({
  uri: 'http://localhost:8000/api/graphql'
})

export default new ApolloClient({
  link: httpLink,
  cache: new InMemoryCache(),
  connectToDevTools: true
})

On my vuex store I use it like this:
fetchItems({commit}, options) {
      commit(mutationsTypes.FETCHING_ITEMS);
      client.query({
        query: organismoQueries.SEARCH_ITEMS_QUERY(options),
      }).then((res) => {
        commit(mutationsTypes.FETCHING_ITEMS_SUCCESS, res.data.organismos.edges)
      }).catch(error => console.error(error));
    }

the query is working ok, the problem is that I can't reload the table results. When I resend the same query with the same options the graphql endpoint is never requested. I need to change the sorting of the table, but once I reach all combinations I'm not able to reload the table again.
I tried to introduce a random parameter in the query but I get an error from the server(obviously).
Is there a way to resend the same query and do something like reload the table.
Thanks in advance!

A: The Apollo client can resolve a particular query by either fetching it from the server or from the cache. The exact behavior is determined by the fetchPolicy, which can be specified when you call client.query. From the docs:

The fetch policy is an option which allows you to specify how you want your component to interact with the Apollo data cache. By default your component will try to read from the cache first, and if the full data for your query is in the cache then Apollo simply returns the data from the cache. If the full data for your query is not in the cache then Apollo will execute your request using your network interface. By changing this option you can change this behavior.

Because the default policy is cache-first, and you've already fetched your query once, subsequent calls to client.query will return the cached result. To bypass the cache, pick a different policy, like network-only:
client.query({
  query: organismoQueries.SEARCH_ITEMS_QUERY(options),
  fetchPolicy: 'network-only',
})

You can read up more about the fetchPolicy option in the docs.


text:
Q: Infinite field extensions and linear transformations I have some issues proving this statement, which is an exercise in Jacobson's Lectures in Abstract Algebra (vol. 3):

*

*Let $P$ be an arbitrary extension field of $\Phi$. Show that, if $\alpha \in P$ satisfies $\alpha_R \circ f = f \circ \alpha_R$ for all $f \in hom_{\Phi} \left ( P, P \right )$ then $\alpha \in \Phi$, where: $\alpha_R$ is the defined as $\alpha_R:P \rightarrow P, \alpha_R\left ( p  \right ) = p.\alpha$, and $hom_{\Phi}\left ( P, P \right )$ represents the set of $\Phi$-linear transformations from $P$ to $P$.

In other words, that the only elements of $P$ that can be "taken out" from every linear transformation are the elements of $\Phi$. Now, as a consequence of a theorem given in the aforementioned book ("Jacobson-Bourbaki theorem"), the statement is true for finite extensions. However, i don't seem to be able to deduce the general case from the finite one. Any help would be appreciated.

A: Assume that $\alpha\in P\setminus\Phi$, that is, $\alpha$ is linearly independent from $1$ in the $\Phi$-vector space $P$.
Then (e.g. by extending $(1,\alpha)$ to a basis) we can define a $\Phi$-linear map $f:P\to P$ that satisfies $f(1)=1,\ f(\alpha)=0$.
This will violate the condition, as
$$\alpha_R(f(1))=\alpha\ \ne\ 0=f(\alpha_R(1))\,.$$


text:
Q: why shadowRoot.querySelector returns null? I need to access element inside the #shadow-root (open).
I used the 'Copy JS Path' in Chrome browser to get code as following.
but it returned null.
if I just take the first shadowRoot, it looked OK.
but the next level returned null.
How can I fix it?
thanks in advance!
document.querySelector('body > sn-workspace-layout > sn-workspace-main > sn-workspace-primary-content > sn-ux-content-option:nth-child(3) > sn-workspace-list-module').shadowRoot

document.querySelector('body > sn-workspace-layout > sn-workspace-main > sn-workspace-primary-content > sn-ux-content-option:nth-child(3) > sn-workspace-list-module').shadowRoot.querySelector('div > div.list-wrapper > now-record-list-connected').shadowRoot.querySelector('div > now-record-list').shadowRoot.querySelector('div > div.sn-list-grid-container > div > now-table').shadowRoot.querySelector('#gridcontainer > div > table')


text:
Q: Replacing all single quotes outside of brackets to parse to valid json I have a file I'd like to parse to json. First item looks as follows:
{'name': 'Ravikant P.', 'username': '@exp9993', 'url': 'https://www.freelancer.com/u/exp9993', 'title': 'ASP.NET/ Graphic Design/ Web Design/WordPress/PHP', 'city': 'Indore, India', 'stars_num_reviews': ['@exp9993', '5.0', '(178 reviews)'], 'rate': '$15 USD / hour', 'reputation': ['99%', 'Jobs Completed', '87%', 'On Budget', '94%', 'On Time', '19%', 'Repeat Hire Rate'], 'review_ratings': ['5.0', '5.0', '5.0', '5.0', '5.0'], 'review_clean_project_values': ['€50.00 EUR', '$600.00 USD', '$1,300.00 AUD', '$30.00 USD', '$50.00 USD'], 'review_project_titles': ['Wordpress - Woocommerce Small Function', 'PayDash Frontend', 'Improve current website', 'Project for Ravikant P.', 'Build a page 1:1 copy from Figma design file'], "review_project_descriptions": ['Wordpress - Woocommerce Small Function', 'Very fast and efficient! Made my request in less than 2-3 hours and exactly what i asked for.\nI recommend and will come back for sure! :)', 'PayDash Frontend', 'Delivered a high value project very quickly, always helping me fix any bugs there are in the code. Very great developer and team to work with!', 'Improve current website', 'Amazing job, and nothing was too much trouble. Highly recommend!!', 'Project for Ravikant P.', 'I requested the project from him, he completed it within 30 minutes. Super quick delivery, I will definitely be using him in the future for all of my frontend web development projects.', 'Build a page 1:1 copy from Figma design file', "He did the work very quickly and was super precise about all the little details. He's the perfect person I was looking for, someone who was able to create a page for me while paying attention to all… Read more"], 'experience_title': 'N/A', 'education_title': 'bachelor of engineering', 'education_time': '2011 - 2015', 'description': 'We can make anything you want, if you can describe exactly what you want, will get the exact service until full satisfaction.    My interest lies in designing new material & do believe we are creative & can handle complications, I am always eager to learn new things & by listening carefully & asking the right questions can get to the core of the conversation quickly.        We are a Team of 9+ experienced professionals who work closely with the clients, understand their requirements, offer suggestions, and implement ideas into reality. We always think beyond the boundaries and provide user-friendly as well as high quality IT services to our customers at a very reasonable price. Our team is always dedicative to innovate from high-end E-Commerce website development to the simplest logo design needs… Read more', 'profile_skills': {'Website Design': '138', 'HTML': '129', 'Graphic Design': '115', 'PHP': '99', 'WordPress': '62', 'User Experience Design': '53', 'CSS': '26', 'User Interface / IA': '25', 'Photoshop': '17', 'C# Programming': '13', 'ASP.NET': '12', '.NET': '11', 'eCommerce': '9', 'Microsoft SQL Server': '8', 'Logo Design': '8', 'PSD to HTML': '6', 'WooCommerce': '6'}}

In order to be valid json, all single quotes should be converted to double quotes. However, replacing the single quotes inside any [] truncates the json. I've done some extensive searching and have not seen a way to use regex to match a text NOT contained in quotes and then change that text. Any ideas on how I would be able to parse this to json? I've included items 2 and 3 below. Any help would be so greatly appreciated! I've been stuck on this for a few days and I'm not sure what else to try...
{'name': 'Artur', 'username': '@Appswebandroid', 'url': 'https://www.freelancer.com/u/Appswebandroid', 'title': '♛Google Certified Digital Marketing - Grow Sales♛', 'city': 'Mafra, Portugal', 'stars_num_reviews': ['@Appswebandroid', '5.0', '(71 reviews)'], 'rate': '$15 USD / hour', 'reputation': ['100%', 'Jobs Completed', '94%', 'On Budget', '97%', 'On Time', '17%', 'Repeat Hire Rate'], 'review_ratings': ['5.0', '5.0', '5.0', '5.0', '5.0'], 'review_clean_project_values': ['$10.00 USD', '$10.00 USD', '$200.00 USD', '$100.00 USD', '$196.00 USD'], 'review_project_titles': ['woodpress seo expert', 'semana adwords', 'Project for Artur', 'experto en adwords de preferencia en español', 'Google ADS expert for make a campaign today!'], "review_project_descriptions'": ['woodpress seo expert', 'Thank you', 'semana adwords', "Artur helped me setup my campaign, but he was also taking care of it during the month that we were working. I couldn't have done it myself. He helped me channel all my money to the right… Read more", 'Project for Artur', 'Great Freelancer, very pro- and reactive. Only recommend. Thank you, Artur!', 'experto en adwords de preferencia en español', 'Artur is a master of adwords and he is really helpfull. Would work with him again. Thanks :)', 'Google ADS expert for make a campaign today!', 'Good work, is an expert in google ads! Fully recommend!'], 'experience_title': 'Computer Technician - Network Installation and Management', 'experience_time': 'Feb 2018 - Jun 2020 (2 years, 4 months)', 'education_title': 'Work optimization Business', 'education_time': 'N/A', 'description': 'I have a degree in Computer Technician Installation and Network Management.  I am available to help you publicize your business to get more customers and more sales and solve web problems. I am ready to exceed my limits to satisfy every customer.  Google Certified Digital Marketing Expert  Increase your organic traffic and the average position of your keywords with SEO method.  Qualified traffic in Google Adwords, Facebook, Instagram, Linkedin campaigns.  Increase your sales for your company, in ecommerce or physical companies  We place your site on the first page of search engines.  I am a multi-site webmaster, an SEO specialist with a passion for search engines, taking your site or business to the top of Google search, following best practices.    ✅My skills:  *✔ Google Merchant Center*✔Facebook Ads*✔Google Ads*✔Instagram Ads✔Pinterest Ads*✔SEO*✔WordPress*✔Website Optimization*✔eCommerce*✔ Facebook Marketing**✔Social Media… Read more', 'profile_skills': {'Internet Marketing': '35', 'Google Adwords': '27', 'Facebook Marketing': '23', 'Marketing': '22', 'Advertising': '20', 'SEO': '14', 'Social Media Marketing': '12', 'Android': '10', 'PHP': '8', 'Mobile App Development': '7', 'Google Adsense': '6', 'Website Design': '6', 'Linux': '5', 'Graphic Design': '5', 'eCommerce': '5', 'Google Analytics': '4', 'Prestashop': '4'}}
{'name': 'Usman N.', 'username': '@futivetechnet', 'url': 'https://www.freelancer.com/u/futivetechnet', 'title': '3D/2D Design/Animation-SMM-Unity Game Development', 'city': 'Lahore, Pakistan', 'stars_num_reviews': ['@futivetechnet', '4.9', '(139 reviews)'], 'rate': '$25 USD / hour', 'reputation': ['96%', 'Jobs Completed', '96%', 'On Budget', '93%', 'On Time', '12%', 'Repeat Hire Rate'], 'review_ratings': ['5.0', '5.0', '5.0', '5.0', '5.0'], 'review_clean_project_values': ['$12,400.00 USD', '€200.00 EUR', '$150.00 USD', '€4,700.00 EUR', '•'], 'review_project_titles': ['Online Easter crepes hunt game (for kids 5-10)', 'Project for Usman N.', '12 Social media posts for Digital marketing and app development company', 'Mobile game similar to Flappy Bird (side-scroller)', 'Make character animation for 2D game'], "review_project_descriptions'": ['Online Easter crepes hunt game (for kids 5-10)', 'It was a pleasure working with Usman. They made an amazing job!', 'Project for Usman N.', "Great quality of work! It's my second project with Usman, and both were successful. Looking forward to hire him again.", '12 Social media posts for Digital marketing and app development company', 'Usman delivered the posts as per the requirements and he did multiple revisions as per our requirements', 'Mobile game similar to Flappy Bird (side-scroller)', 'Great communication, great project management and great work!', 'Make character animation for 2D game', 'Great work! Usman understands all requirements with minimum clarifications. Result is very good.'], 'experience_title': '3D/2D Design/Animation-SMM-Unity Game Development', 'experience_time': 'Mar 2010 - Present', 'education_title': 'N/A', 'education_time': 'N/A', 'description': 'We are an all in one IT services provider in this region. A team of 70+ skilled & certified professional developers, designers, video editors, 3D modellers & animators, project managers and quality assurance individuals.      Our team is dedicated in providing the work to our clients, meeting the highest quality standards, client specifications & timely delivery of services.      Mobile | PC Games Development:   - Experienced in Unity3D, iOS Swift, Cocos2D, Buildbox, including team for UI/UX designs   - Experienced in Action, Simulation, 2D platformers, multiplayer & arcade games      3D | 2D Works, CGI Graphics:   - 3D Modelling, Rigging, Rendering & Animation   - Expertise in Autodesk Maya, 3DS Max, Blender Studio, DAZ Studio, Adobe Flash & After Effects… Read more', 'profile_skills': {'Animation': '64', '3D Animation': '64', 'Mobile App Development': '53', 'Game Development': '52', 'Graphic Design': '51', 'Game Design': '47', 'Unity 3D': '26', 'Video Services': '26', 'After Effects': '26', '3D Modelling': '24', 'Android': '20', '3D Rendering': '20', 'Photoshop': '18', '3D Design': '15', 'PHP': '14', 'Video Editing': '13', 'Website Design': '13'}}

A: As @CharlesDuffy says, you can use ast.literal_eval().
You can read the content directly from your file:
# file.txt contains three lines, one for each of the OP's strings
with open('file.txt') as f:
    dlist = [ast.literal_eval(s) for s in f.read().splitlines()]
>>> [len(d) for d in dlist]
[17, 18, 18]

Note that, in the string that you provided, there is a r'\n':

"""...and exactly what i asked for.\nI recommend..."""

So if you try to paste the string surrounded by """ into an interpreter, then that makes ast.literal_eval() choke on the input (as all of a sudden there is a line break in the middle of the string).
If you replace it, then all is well.
dct = ast.literal_eval(s.replace('\n', r'\n'))
>>> len(dct)
17

But this is unnecessary when you read from the file.


text:
Q: Jenkins upgrade from 1.6xx to 2.xx (1.642.3 -> 2.32.2) I upgraded Jenkins to 2.32.3 version (in place upgrade) after taking necessary backups (THIN) or $JENKINS_HOME and Jenkins is now UP and running.
Under Manage Jenkins > Manage Plugins, I see the following RED error:
Manage Jenkins

Correct
There are dependency errors loading some plugins:
Environment Injector Plugin v2.1.3
envinject-api v1.2 is missing. To fix, install v1.2 or later.

While trying to install Environment Inject Plugin 2.1.3, the logs (during download/install) shows the same error:
Installing Plugins/Upgrades

Preparation
Checking update center connectivity
Success
Environment Injector Plugin
 Failure -
java.io.IOException: Failed to dynamically deploy this plugin
    at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1895)
    at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1652)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:110)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Failed to install envinject plugin
    at hudson.PluginManager.dynamicLoad(PluginManager.java:873)
    at hudson.PluginManager.dynamicLoad(PluginManager.java:813)
    at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1891)
    ... 5 more
Caused by: java.io.IOException: Environment Injector Plugin v2.1.3 failed to load.
 - envinject-api v1.2 is missing. To fix, install v1.2 or later.
    at hudson.PluginWrapper.resolvePluginDependencies(PluginWrapper.java:621)
    at hudson.PluginManager.dynamicLoad(PluginManager.java:863)
    ... 7 more

Where can I get this envinject-api 1.2 plugin? Should I go grab the Github project (clone it) and build the Maven project and put the hpi file under $JENKINS_HOME/plugins folder?
Under Available plugins tab, I don't see an option to select a given version (only 2.1.3 is available). I don't see envinject-api 1.2 plugin listed there either that I can select. My understanding it, selecting Environment Inject 2.1.3 should auto grab all of its dependent plugins for free per it's MANIFEST file.
$ cat $JENKINS_HOME/plugins/envinject/META-INF/MANIFEST.MF
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: nenashev
Build-Jdk: 1.8.0_121
Extension-Name: envinject
Specification-Title: The Jenkins Plugins Parent POM Project
Implementation-Title: envinject
Implementation-Version: 2.1.3
Plugin-Class: org.jenkinsci.plugins.envinject.EnvInjectPlugin
Group-Id: org.jenkins-ci.plugins
Short-Name: envinject
Long-Name: Environment Injector Plugin
Url: https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin
Compatible-Since-Version: 2.0
Plugin-Version: 2.1.3
Hudson-Version: 1.625.3
Jenkins-Version: 1.625.3
Plugin-Dependencies: envinject-api:1.2,ivy:1.21;resolution:=optional,m
 atrix-project:1.7,script-security:1.22
Plugin-Developers: Gregory Boissinot:gbois:gregory.boissinot@gmail.com
 ,Oleg Nenashev:oleg_nenashev:o.v.nenashev@gmail.com,Manuel Recena:rec
 ena:recena@gmail.com

A: For some reason Jenkins plugins (didn't download the dependent plugins per the Manifest file).
As envinject-api plugin was not listed in the AVAILABLE plugin tab (under Manage Jenkins > Manage Plugins section), I had to manually download the .hpi / .jpi file directly from the following download plugins URL and then I placed the file in $JENKINS_HOME/plugins folder.
https://updates.jenkins-ci.org/download/plugins/
wget https://updates.jenkins-ci.org/download/plugins/envinject-api/1.2/envinject-api.hpi

Restarted Jenkins sudo service jenkins restart (or any other way you have setup) and this issue went away from both Jenkins GUI and from tail -f /var/log/jenkins/jenkins.log
PS: Don't just randomly select a latest version of any plugin or it's dependent plugin. It may not work and break more other plugins as it depends upon your current Jenkins version.
Found this link for Juseppe, not sure how relevant is this but seems interesting: https://github.com/yandex-qatools/juseppe


text:
Q: Save appointments to my default calendar in WP 8.1 I was hoping that with the new calendar API of wp8.1, I am now able to fully replace the native calendar app with my own.
But after a few hours of searching in the API documentation, I came to the point that this is still NOT possible.
This is what i concluded so far:

*

*I can create my own AppointmentCalendar with full read and write access. But this calendar won't sync to my other devices.

*I can add/remove/edit appointments in all other Calendars, but just over the native UI with the AppointmentManager. This still takes some time to open the native calendar app and the user has to manually press the save button.

*There is still the old way. I need to dive into the Outlook.com/Google Calendar/... APIs, to save appointments straight out of my own calendar app.
Is there a way to set my default calendar (Outlook.com) from Readonly (ReadWrite=Systemonly) to ReadandWrite(ReadWrite =full)?

A: The platform AppointmentCalendar API doesn't allow for writing directly to a online calendar provider.
To implement write-support, you would need to implement a custom provider for each calendar, for example Outlook.com and GMail.com each have individual APIs, although IMAP often can be used as a default protocol. Each requires individual authentication.
For Outlook.com you would need to utilize OAuth, ideally via. Single Sign-On, and then use the IMAP API to integrate your application with the Outlook.com calendar.
So in short, there is no way for 3rd party developers to fully replace the default calendar application on Windows Phone when it comes to writing appointments. All you can do is to write a different visual front for the built-in calendar.


text:
Q: How To Make A Full Screen Modal In Tailwind I'm trying to build a modal using Tailwind in alpine, point me to the right direction on building a full screen modal using Tailwind CSS and alpine js

A: Basic modal components (unstyled) can be found here: https://headlessui.dev/react/dialog
The styled one below is a small box, but with CSS you can make it full screen.
import { Dialog, Transition } from '@headlessui/react'
import { Fragment, useState } from 'react'

export default function MyModal() {
  let [isOpen, setIsOpen] = useState(true)

  function closeModal() {
    setIsOpen(false)
  }

  function openModal() {
    setIsOpen(true)
  }

  return (
    <>

        <button
          type="button"
          onClick={openModal}
          className="px-4 py-2 text-sm font-medium text-white bg-black rounded-md bg-opacity-20 hover:bg-opacity-30 focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75"
        >
          Open dialog
        </button>

      <Transition appear show={isOpen} as={Fragment}>
        <Dialog
          as="div"
          className="fixed inset-0 z-10 overflow-y-auto"
          onClose={closeModal}
        >

            <Transition.Child
              as={Fragment}
              enter="ease-out duration-300"
              enterFrom="opacity-0"
              enterTo="opacity-100"
              leave="ease-in duration-200"
              leaveFrom="opacity-100"
              leaveTo="opacity-0"
            >
              <Dialog.Overlay className="fixed inset-0" />
            </Transition.Child>

            {/* This element is to trick the browser into centering the modal contents. */}

            <Transition.Child
              as={Fragment}
              enter="ease-out duration-300"
              enterFrom="opacity-0 scale-95"
              enterTo="opacity-100 scale-100"
              leave="ease-in duration-200"
              leaveFrom="opacity-100 scale-100"
              leaveTo="opacity-0 scale-95"
            >

                <Dialog.Title
                  as="h3"
                  className="text-lg font-medium leading-6 text-gray-900"
                >
                  Payment successful
                </Dialog.Title>

                    Your payment has been successfully submitted. We've sent you
                    an email with all of the details of your order.

                  <button
                    type="button"
                    className="inline-flex justify-center px-4 py-2 text-sm font-medium text-blue-900 bg-blue-100 border border-transparent rounded-md hover:bg-blue-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-blue-500"
                    onClick={closeModal}
                  >
                    Got it, thanks!
                  </button>

            </Transition.Child>

        </Dialog>
      </Transition>
    </>
  )
}

A: Checkout TailWind Toolbox

<!DOCTYPE html>

  <title>Tailwind CSS Full Screen Modal</title>
  <link href="https://cdn.jsdelivr.net/npm/tailwindcss/dist/tailwind.min.css" rel="stylesheet">

<button class="modal-open bg-transparent border border-gray-500 hover:border-indigo-500 text-gray-500 hover:text-indigo-500 font-bold py-2 px-4 rounded-full">Open Full Screen Modal</button>

      <svg class="fill-current text-black" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18">
        <path d="M14.53 4.53l-1.06-1.06L9 7.94 4.53 3.47 3.47 4.53 7.94 9l-4.47 4.47 1.06 1.06L9 10.06l4.47 4.47 1.06-1.06L10.06 9z"></path>
      </svg>
      (Esc)

Full Screen Modal!

Modal content can go here

        <button class="px-4 bg-transparent p-3 rounded-lg text-indigo-500 hover:bg-gray-100 hover:text-indigo-400 mr-2">Action</button>
        <button class="modal-close px-4 bg-indigo-500 p-3 rounded-lg text-white hover:bg-indigo-400">Close</button>


text:
Q: Python: Converting PIL.Image to a object that has object.read() I have a variable of type PIL.Image.
I need to pass it to a function(that I didn't write) that will save it to disk for me. Let's call that function file_creator(my_PIL_image)
In the implementation of file_creator() a .read() method is used on my_PIL_image variable.
I need to convert my_PIL_image into a type that the file_creator() can read.
Any fancy suggestions?

A: Got the solution from a Python guy.
What I needed to do was encode the image to base64:
from StringIO import StringIO
from base64 import b64encode

img_io = StringIO()
my_PIL_image.save(img_io, 'JPEG')
img_data = img_io.getvalue()
data_url = "data:image/jpg;base64," + b64encode(img_data)


text:
Q: How to extract language from HTML using twig
if you inspect the page you can see at the beginning of page html lang="en"
i want to get the value of lang to write
if lang= en
show this link
if lang=ch
show this link
Anyone know how to do it

A: You could use javascript:
var lang=document.getElementsByTagName("html")[0].lang;
if(lang=="en"){
    console.log("I am english");
}
else if(lang=="ch"){
    console.log("I am chineese");
}

Edit
The twig solution:
{% if  app.request.locale =="ch" %}

I am chineese

{% else %}

I am english

{% endif %}