问:
Is it possible to change angular bootstrap uib-dropdown templateUrl dynamically?
I want to change the uib-dropdown template dynamically when the user clicks one of its
, just like he could "navigate" within that dropdown.

I tried to make it via templateUrl, but nor the ng-templates nor standalone partials can successfully change the dropdown template dynamically, just like this plunkr demonstrates.

My goal is to create a faceted navigation via this dropdown to build query visually, as seen on Fieldbook's Sprint tracker (account required), which is something really like Pure Angular Advanced Searchbox, but I'm having overwhelming issues using this library.

Is this possible to achieve using just AngularJS and angular-bootstrap?

答:
Demo(try the last one):

http://plnkr.co/edit/1yLmarsQFDzcLd0e8Afu?p=preview

How to get it to work?

Based on your plunkr, you should change

```<code><div class="input-group" uib-dropdown auto-close="disabled">
    <input type="text" class="form-control" placeholder="Click to start a visual query search..." autocomplete="off" uib-dropdown-toggle/>
    <ul class="dropdown-menu" role="menu" ng-if="ctrl.dropdownReady" uib-dropdown-menu template-url="{{ctrl.dropdownTemplateFour}}">
    </ul>
    <span class="input-group-btn">
    <button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i>
    </button>
    </span>
</div>
</code>```

to

```<code><div class="input-group" uib-dropdown auto-close="disabled"  ng-if="ctrl.dropdownReady">
    <input type="text" class="form-control" placeholder="Click to start a visual query search..." autocomplete="off" uib-dropdown-toggle/>
    <ul class="dropdown-menu" role="menu" uib-dropdown-menu template-url="{{ctrl.dropdownTemplateFour}}">
    </ul>
    <span class="input-group-btn">
    <button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i>
    </button>
    </span>
</div>
</code>```

In which the ng-if="ctrl.dropdownReady" is moved to the div.input-group.

And change

```<code>vm.dropdownReady = false;
console.log('vm.dropdownReady =', vm.dropdownReady, ' partial = ', partial);
switch (template) {
  case 'word':
    partial ? vm.dropdownTemplateFour = 'word-dropdown-dom.template.html' : vm.dropdownTemplateThree = 'word-dropdown-dom.html';
    break;
  case 'main':
    partial ? vm.dropdownTemplateFour = 'main-dropdown-dom.template.html' : vm.dropdownTemplateThree = 'main-dropdown-dom.html';
    break;
}
vm.dropdownReady = true;
</code>```

to

```<code>vm.dropdownReady = false;
console.log('vm.dropdownReady =', vm.dropdownReady, ' partial = ', partial);
switch (template) {
  case 'word':
    partial ? vm.dropdownTemplateFour = 'word-dropdown-dom.template.html' : vm.dropdownTemplateThree = 'word-dropdown-dom.html';
    break;
  case 'main':
    partial ? vm.dropdownTemplateFour = 'main-dropdown-dom.template.html' : vm.dropdownTemplateThree = 'main-dropdown-dom.html';
    break;
}
$timeout(function(){
  vm.dropdownReady = true;
});
</code>```

Which has a $timeout wrap the vm.dropdownReady = true;. And you should inject the $timeout by hand;

Keep the menu open

According to the documentation, we can choose the initial state of drop menu with is-open attr. And we can listen the toggle event with on-toggle attr. So if we want to keep the menu open after user clicking the input, we should set the attributes of uib-dropdown like this:

```<code><div class="input-group" uib-dropdown auto-close="disabled"  ng-if="ctrl.dropdownReady" is-open="ctrl.open" on-toggle="ctrl.toggled(open)">
</code>```

And in controller:

```<code>vm.toggled = function (open) {
    // the parameter `open` is maintained by *angular-ui/bootstrap*
    vm.open=open;//we don't need to init the `open` attr, since it's undefined at beginning
}
</code>```

With these things done, once the menu is open, it doesn't close without user clicking the input again.

Why?

Let's check this snippet:

```<code>$templateRequest(self.dropdownMenuTemplateUrl)
    .then(function(tplContent) {
    templateScope = scope.$new();
    $compile(tplContent.trim())(templateScope, function(dropdownElement) {
        var newEl = dropdownElement;
        self.dropdownMenu.replaceWith(newEl);//important
        self.dropdownMenu = newEl;
        $document.on('keydown', uibDropdownService.keybindFilter);
    });
});
</code>```

The snippet above shows how does angular-ui/bootstrap use the template-url attr to retrive template and take it into effect. It replaces the original ul element with a newly created element. That's why the uib-dropdown-menu and template-url is missing after clicking the ul. Since they don't exist, you can't change the template-url with angular binding anymore.

The reason executing vm.dropdownReady = true; immediately after the vm.dropdownReady = false; doesn't work is that angular have no chance to dectect this change and execute the "ng-if" to actually remove the dom. You must make the toggling of vm.dropdownReady asynchronous to give angular a chance to achieve this.

Body:
Demo(try the last one):

http://plnkr.co/edit/1yLmarsQFDzcLd0e8Afu?p=preview

How to get it to work?

Based on your plunkr, you should change

<div class="input-group" uib-dropdown auto-close="disabled">
    <input type="text" class="form-control" placeholder="Click to start a visual query search..." autocomplete="off" uib-dropdown-toggle/>
    <ul class="dropdown-menu" role="menu" ng-if="ctrl.dropdownReady" uib-dropdown-menu template-url="{{ctrl.dropdownTemplateFour}}">
    </ul>
    <span class="input-group-btn">
    <button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i>
    </button>
    </span>
</div>

to

<div class="input-group" uib-dropdown auto-close="disabled"  ng-if="ctrl.dropdownReady">
    <input type="text" class="form-control" placeholder="Click to start a visual query search..." autocomplete="off" uib-dropdown-toggle/>
    <ul class="dropdown-menu" role="menu" uib-dropdown-menu template-url="{{ctrl.dropdownTemplateFour}}">
    </ul>
    <span class="input-group-btn">
    <button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i>
    </button>
    </span>
</div>

In which the ng-if="ctrl.dropdownReady" is moved to the div.input-group.

And change

vm.dropdownReady = false;
console.log('vm.dropdownReady =', vm.dropdownReady, ' partial = ', partial);
switch (template) {
  case 'word':
    partial ? vm.dropdownTemplateFour = 'word-dropdown-dom.template.html' : vm.dropdownTemplateThree = 'word-dropdown-dom.html';
    break;
  case 'main':
    partial ? vm.dropdownTemplateFour = 'main-dropdown-dom.template.html' : vm.dropdownTemplateThree = 'main-dropdown-dom.html';
    break;
}
vm.dropdownReady = true;

to

vm.dropdownReady = false;
console.log('vm.dropdownReady =', vm.dropdownReady, ' partial = ', partial);
switch (template) {
  case 'word':
    partial ? vm.dropdownTemplateFour = 'word-dropdown-dom.template.html' : vm.dropdownTemplateThree = 'word-dropdown-dom.html';
    break;
  case 'main':
    partial ? vm.dropdownTemplateFour = 'main-dropdown-dom.template.html' : vm.dropdownTemplateThree = 'main-dropdown-dom.html';
    break;
}
$timeout(function(){
  vm.dropdownReady = true;
});

Which has a $timeout wrap the vm.dropdownReady = true;. And you should inject the $timeout by hand;

Keep the menu open

According to the documentation, we can choose the initial state of drop menu with is-open attr. And we can listen the toggle event with on-toggle attr. So if we want to keep the menu open after user clicking the input, we should set the attributes of uib-dropdown like this:

<div class="input-group" uib-dropdown auto-close="disabled"  ng-if="ctrl.dropdownReady" is-open="ctrl.open" on-toggle="ctrl.toggled(open)">

And in controller:

vm.toggled = function (open) {
    // the parameter `open` is maintained by *angular-ui/bootstrap*
    vm.open=open;//we don't need to init the `open` attr, since it's undefined at beginning
}

With these things done, once the menu is open, it doesn't close without user clicking the input again.

Why?

Let's check this snippet:

$templateRequest(self.dropdownMenuTemplateUrl)
    .then(function(tplContent) {
    templateScope = scope.$new();
    $compile(tplContent.trim())(templateScope, function(dropdownElement) {
        var newEl = dropdownElement;
        self.dropdownMenu.replaceWith(newEl);//important
        self.dropdownMenu = newEl;
        $document.on('keydown', uibDropdownService.keybindFilter);
    });
});

The snippet above shows how does angular-ui/bootstrap use the template-url attr to retrive template and take it into effect. It replaces the original ul element with a newly created element. That's why the uib-dropdown-menu and template-url is missing after clicking the ul. Since they don't exist, you can't change the template-url with angular binding anymore.

The reason executing vm.dropdownReady = true; immediately after the vm.dropdownReady = false; doesn't work is that angular have no chance to dectect this change and execute the "ng-if" to actually remove the dom. You must make the toggling of vm.dropdownReady asynchronous to give angular a chance to achieve this.


来源: stackexchange

问:
how will i know the size of user control?
How will I know the size of user control at run time?

I have a form, and I wanted to host my usercontrol on that form, and I wanted
to know  my user control size at run time to fix my webform size according to
my user control size, so that scroll should not appear while opening the form.

How can I do that?

(actually there are multiple Usercontrols, and I am hosting a user control at run time
according to a condition.)

答:
Are you looking for ActualWidth / ActualHeight?

Also you should be able to set the ScrollBar policy to Auto so that it will only appear if needed.

ContentLicense: CC BY-SA 3.0


问:
SQL Basics If Column A is not empty then on Column B use
Hi All just starting out with SQL. would like to ask.
For example if given:

Result:

Explanation:

If column B is not empty the use Column B in Column E

If Column B is empty then use column D in Column E

If Column B and D is empty then leave  Column E as empty

How would you make this work in SQL?

答:
You can use "case", like next query:</p>

```<code>select t.colA, t.colB, t.colC, t.colD,
       (case when t.colB is null and t.colD is null then null end
       else case when t.colB is not null then t.colB end end
       else t.colD end) colE
from tabela t
</code>```

Body:
You can use "case", like next query:

select t.colA, t.colB, t.colC, t.colD,
       (case when t.colB is null and t.colD is null then null end
       else case when t.colB is not null then t.colB end end
       else t.colD end) colE
from tabela t


问:
Calculate Distance : How can we calculate distance between two SKCoordinate Points
Using the Skobbler map SDK, how can we calculate distance between two SKCoordinate Points.
Thanks .</p>

答:
As part of the SKGeoUtils class, you will find the method calculateAirDistanceBetweenCoordinates(SKCoordinate pointA, SKCoordinate pointB)

Which should do what you are looking for.

Link to the doc.
https://developer.skobbler.com/docs/android/com/skobbler/ngx/util/SKGeoUtils.html


问:
How to use MS access on a server where MS Office is not installed
i want to run macros and queries on ms access database but my server doesn't have ms office installed so i am not able to use Interop classes.How to fetch data from ms access on a server where ms office is not installed ?</p>

答: Maybe install Access Runtime on the server? https://www.microsoft.com/en-us/download/details.aspx?id=50040</p>


问:
Team Build 2010 - Unable to access $(BuildNumber) from csproj file?
The scenario is following:

I create myProject.csproj

In myProject.csproj xml in the AfterBuild target I want to access $(BuildNumber) variable

When I do the build with TFS 2008 everything works OK

When I migrate to TFS 2010 and use the DefaultBuildTemplate $(BuildNumber) always empty

Can you please provide the out of box solution - how to access this variable during build in TFS 2010?

The csproj file has the following code:

答:
The code in csproj file is following:

```<code><Target Name="AfterBuild">
    <Message Text="MyBuildNumber $(BuildDefinitionName)_$(Date:yyyyMMdd)"></Message>
    <Message Text="MyVersionNumber $(MyVersionNumber)"></Message>
</code>```

ContentLicense: CC BY-SA 2.5

Body:
The code in csproj file is following:

<Target Name="AfterBuild">
    <Message Text="MyBuildNumber $(BuildDefinitionName)_$(Date:yyyyMMdd)"></Message>
    <Message Text="MyVersionNumber $(MyVersionNumber)"></Message>


问:
How to select latest 4 dates
I'm trying to write a query to select last 4 dates from the table for each person. I know that i can use max(date) to select the most recent date but how to select last 4 dates starting from starting from the most recent one for each person.

What I tried was (as below) but this only gives me most recent date of event.

```<code>select user, max(date)
from users
group by user
</code>```

The result i would like to see is:

user | date

John | 30/03/2017

John | 27/03/2017

John | 21/02/2017

John | 04/01/2017

Andy | 29/03/2017

Andy | 27/02/2017

Andy | 21/02/2017

Andy | 01/01/2017

答:
You could use a ROW_NUMBER function:

```<code> WITH cte
 AS
 (
 SELECT user, date, ROW_NUMBER () OVER (PARTITION BY user ORDER BY date DESC) row
 FROM users
 )

 SELECT user, date
 FROM cte
 WHERE row <= 4
</code>```

However if a user can have duplicate dates, you are be better of using DENSE_RANK and add a DISTINCT after SELECT:

```<code>DENSE_RANK () OVER (PARTITION BY user ORDER BY date DESC) row
</code>```

Title: How to select latest 4 dates

Body:
I'm trying to write a query to select last 4 dates from the table for each person. I know that i can use max(date) to select the most recent date but how to select last 4 dates starting from starting from the most recent one for each person.

What I tried was (as below) but this only gives me most recent date of event.

select user, max(date)
from users
group by user

The result i would like to see is:

user | date

John | 30/03/2017

John | 27/03/2017

John | 21/02/2017

John | 04/01/2017

Andy | 29/03/2017

Andy | 27/02/2017

Andy | 21/02/2017

Andy | 01/01/2017

Body:
You could use a ROW_NUMBER function:

 WITH cte
 AS
 (
 SELECT user, date, ROW_NUMBER () OVER (PARTITION BY user ORDER BY date DESC) row
 FROM users
 )

 SELECT user, date
 FROM cte
 WHERE row <= 4

However if a user can have duplicate dates, you are be better of using DENSE_RANK and add a DISTINCT after SELECT:

DENSE_RANK () OVER (PARTITION BY user ORDER BY date DESC) row


问:
C# read string from back to end
I have a string. For example :

```<code>string a = "abcdef098403248";
</code>```

My goal is, knowing that the string ends with a number (else something like this will happen : MessageBox.Show("String doesnt end in a number"); ), i want to read the string, starting from the end to the begining, and store the values in another string.
Now the only problem is, i can only store in that new string numbers, and when i read the string a , while i count from the back to end if i find a character that isnt a number, i stop reading and store the previous numbers found in the new string. The code output should look somthing like this:

```<code>string a = "aBcdef3213BBBBB0913456";
//part were i read the string from back to end
string finalString = "0913456";
</code>```

As you see there, i store the numbers from left to right, but i want to read them from right to left.

Another example of what i want:

```<code>string a = "aaaaa3a224444";
// part were i read the string from back to end
string finalString = "224444";
</code>```

Or:

```<code>string a = "3333333a224444";
// part were i read the string from back to end
string finalString = "224444";
</code>```

Regardless, thanks.

答:
```<code>string a = "saffsa1ad12314";
string finalString = string.Empty;

char[] chars = a.ToCharArray();

for (int i = chars.Length -1; i >= 0; i--)
{
    if (char.IsDigit(chars[i]))
    {
        finalString += chars[i];
    }
    else
    {
        break; //so you dont get a number after a letter
        //could put your mbox here
    }
}
//Now you just have to reverse the string
char[] revMe = finalString.ToCharArray();
Array.Reverse(revMe);
finalString = string.Empty;

foreach (char x in revMe)
{
    finalString += x;
}

Console.WriteLine(finalString);
//outputs: 12314
</code>```

<p>This question feels awfully homeworky - but here is a very verbose way
of solving your problem. Alternatively you can read up on regex in c#. </p>

Title: C# read string from back to end

Body:
I have a string. For example :

string a = "abcdef098403248";

My goal is, knowing that the string ends with a number (else something like this will happen : MessageBox.Show("String doesnt end in a number"); ), i want to read the string, starting from the end to the begining, and store the values in another string.
Now the only problem is, i can only store in that new string numbers, and when i read the string a , while i count from the back to end if i find a character that isnt a number, i stop reading and store the previous numbers found in the new string. The code output should look somthing like this:

string a = "aBcdef3213BBBBB0913456";
//part were i read the string from back to end
string finalString = "0913456";

As you see there, i store the numbers from left to right, but i want to read them from right to left.

Another example of what i want:

string a = "aaaaa3a224444";
// part were i read the string from back to end
string finalString = "224444";

Or:

string a = "3333333a224444";
// part were i read the string from back to end
string finalString = "224444";

Regardless, thanks.

Body:
string a = "saffsa1ad12314";
string finalString = string.Empty;

char[] chars = a.ToCharArray();

for (int i = chars.Length -1; i >= 0; i--)
{
    if (char.IsDigit(chars[i]))
    {
        finalString += chars[i];
    }
    else
    {
        break; //so you dont get a number after a letter
        //could put your mbox here
    }
}
//Now you just have to reverse the string
char[] revMe = finalString.ToCharArray();
Array.Reverse(revMe);
finalString = string.Empty;

foreach (char x in revMe)
{
    finalString += x;
}

Console.WriteLine(finalString);
//outputs: 12314

This question feels awfully homeworky - but here is a very verbose way
of solving your problem. Alternatively you can read up on regex in c#.


问:
Marklogic field search options
I am having search options like the following

```<code>let $options :=
 <options xmlns="http://marklogic.com/appservices/search">
    <constraint name="collection">
        <collection prefix=""/>
    </constraint>
    <constraint name="concept_name">
        <word>
            <field name="concept_name" collation="http://marklogic.com/collation/en/S1"/>
        </word>
    </constraint>
    <term>
        <term-option>case-insensitive</term-option>
        <term-option>punctuation-insensitive</term-option>
        <term-option>whitespace-insensitive</term-option>
        <term-option>wildcarded</term-option>
    </term>
    <return-facets>false</return-facets>
    <return-values>false</return-values>
    <return-constraints>false</return-constraints>
    <return-frequencies>false</return-frequencies>
    <return-qtext>false</return-qtext>
    <search-option>format-json</search-option>
    <search-option>score-simple</search-option>
</options>
</code>```

And doing the search search:search($q, $options, $start, $page-length)

But the search is not doing case-insensitive. How do I tell in this scenario to specify options for a field.. I want it to be  case-insensitive

When I do
cts:field-value-match("concept_name", $q ("case-insensitive", "diacritic-insensitive")) , I do get the correct results, so how do I specify using the search options like above to do the same.

答:
I think you want your <term-option>case-insensitive</term-option> inside your <constraint...><word> element.  That way the option affects your search with that constraint.  However, you haven't shared your $q (serach string), so I don't know for sure what search you're testing with.

You should note that cts:field-word-match will search in the field word lexicon and is therefore a better fit for what you're doing with your search:search than cts:field-value-match which matches the values in the field range index.

In any case, I'm not sure what your options are on your database or field, so it's not clear why you're struggling to get case-insensitive matches.  When I try cts:field-word-match("concept_name", "alexa488", ("collation=http://marklogic.com/collation/en/S1")) I get a match even though I didn't add the case-insensitive option.  Similarly, when I try the search:search with no <term-option>case-insensitive</term-option> I get a match.

Title: Marklogic field search options

Body:
I am having search options like the following

let $options :=
 <options xmlns="http://marklogic.com/appservices/search">
    <constraint name="collection">
        <collection prefix=""/>
    </constraint>
    <constraint name="concept_name">
        <word>
            <field name="concept_name" collation="http://marklogic.com/collation/en/S1"/>
        </word>
    </constraint>
    <term>
        <term-option>case-insensitive</term-option>
        <term-option>punctuation-insensitive</term-option>
        <term-option>whitespace-insensitive</term-option>
        <term-option>wildcarded</term-option>
    </term>
    <return-facets>false</return-facets>
    <return-values>false</return-values>
    <return-constraints>false</return-constraints>
    <return-frequencies>false</return-frequencies>
    <return-qtext>false</return-qtext>
    <search-option>format-json</search-option>
    <search-option>score-simple</search-option>
</options>

And doing the search search:search($q, $options, $start, $page-length)

But the search is not doing case-insensitive. How do I tell in this scenario to specify options for a field.. I want it to be  case-insensitive

When I do
cts:field-value-match("concept_name", $q ("case-insensitive", "diacritic-insensitive")) , I do get the correct results, so how do I specify using the search options like above to do the same.


问:
how to visit all the array randomly without repeating
I have a SVG with more than a 1000 polygons each 3 look like a cube. at the moment I'm changing the colour by class name. but I would like that each polygon is visited randomly without any repeating, unit all of polygons visited.

```<code> https://jsfiddle.net/MSTq/rbgmjqwd/2/
</code>```

for better view please visit jsfiddle

/*
    Created on : 11/03/2017, 7:01:53 PM
    Author     : MSTq
*/

$(document).ready(function(){
    var polygons = $("#Layer_1").find("polygon");
    /*var paths    = $("#svg-layer-1 ").find("path");
    var pathslength =  paths.length;*/
    var polygonslength = polygons.length;
    var colorSeter = $("#curent-color-set").find(".color-set");

    var byclass = [];
    for(var f  = 0 ; f < 9; f++){
        byclass.push($("#Layer_1").find(".st" + f));
    }

    setInterval(function (){
        var clor = rColorSet([rColor(),rColor()])[randomise(2,0)];
        var rar = randomise(8,0);
        var colrSeter = colorSeter[rar];

        byclass[rar].css({"fill":clor,"stroke":clor});
        $(colrSeter).css({"background-color":clor});
        $("#" + $(colrSeter).attr("id") + " p").text(clor);

    },500);

});

function isPositive (){
   return arguments[0] > 0;
}
function vlidPositive (){
   return  isPositive(arguments[0]) ? arguments[0] : 0;
}
function comparer (){
   return arguments[0] > arguments[1];
}
function reservation (r,t){
    r =  vlidPositive(arguments[0]), t = vlidPositive(arguments[1]);
    return  (r * t) / 100;
}
function randomise (max,min){
    max = vlidPositive(arguments[0]),min = vlidPositive(arguments[1]);
    return Math.floor(Math.random() * (max - min + 1)) + min;
}

function rColor (){
    var hex       = ["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"],
        hexLength = hex.length -1,
        limits    = [[11,4],
                     [12,6],
                     [hexLength,8]],
        color     = "",
        final     = "#",
        temp      = "";

    for (var j =0 ; j < 3; j++){
        for (var i = 0 ; i < 2; i++){
           temp += hex[randomise(limits[j][0] , limits[j][1])];
        }
        color += temp;
        temp = "";
    }
    final += color;
    return  final;
}

function rColorSet(){

    var colorset = [];

    for (var i = 0; i < arguments.length; i++)
    {
      if (Array.isArray(arguments[i])){
          colorset = arguments[i];
          break;
      }
    }

    return colorset;
}```
<pre class="snippet-code-css lang-css prettyprint-override"><code>/*
    Created on : 11/03/2017, 7:01:53 PM
    Author     : MSTq
*/

* {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,body{
    width: 100%;
    height:100px;
}
svg {
    width:100%;
    height:auto;
    display: block;
    margin: auto;
    background-size:auto;
    margin-top: 10px;
}
#mydiv{
    width:200px;
    height:200px;
    background-color: #FFF0F0;
}

#curent-color-set{
    width: 100%;
    height:40%;
    margin-bottom: 10px;
}
.color-set{
   position: relative;
    height: 100%;
    width: 7%;
    margin-left: 1%;
    margin-top: 5px;
    background-color: #000000;
    display: inline-block;
}

.color-code{
    font-size: .75em;
    line-height: 34px;
}

 .st0{fill:#EF4136;}
 .st1{fill:#F7941E;}
 .st2{fill:#00A79D;}
 .st3{fill:#662D91;}
 .st4{fill:#EC008C;}
 .st5{fill:#F9ED32;}
 .st6{fill:#8B5E3C;}
 .st7{fill:#C2B59B;}
 .st8{fill:#009444;}</code>```

#

#

#

#

#

#

#

#

#

<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
  viewBox="0 0 1920 1080" style="enable-background:new 0 0 1920 1080;" xml:space="preserve">

<g id="XMLID_32_">
 <polygon id="XMLID_41_" class="st0" points="43.3,75 0,100 0,149.5 43.3,124.8  "/>
 <polygon id="XMLID_40_" class="st1" points="43.3,124.8 0,149.5 0,150 43.3,175 86.6,150 43.3,125  "/>
 <polygon id="XMLID_39_" class="st2" points="43.3,75 43.3,124.8 45.4,123.6 43.3,124.8 43.3,125 86.6,150 86.6,100  "/>
 <polygon id="XMLID_38_" class="st3" points="129.9,75 129.9,25 86.6,0 86.6,50  "/>
 <polygon id="XMLID_37_" class="st4" points="86.6,0 43.3,25 43.3,75 86.6,50  "/>
 <polygon id="XMLID_36_" class="st5" points="129.9,75 86.6,50 86.6,51.8 86.6,50 43.3,75 86.6,100  "/>
 <polygon id="XMLID_35_" class="st6" points="173.2,150 173.2,100 129.9,75 129.9,124.9  "/>
 <polygon id="XMLID_34_" class="st7" points="129.9,124.9 129.9,125 86.6,150 129.9,175 173.2,150 173.2,150  "/>
 <polygon id="XMLID_33_" class="st8" points="129.9,124.9 128.8,124.3 129.9,124.9 129.9,75 86.6,100 86.6,150 129.9,125  "/>
</g>
<g id="XMLID_122_">
 <polygon id="XMLID_131_" class="st0" points="43.3,-75 0,-50 0,-0.5 43.3,-25.3  "/>
 <polygon id="XMLID_130_" class="st1" points="43.3,-25.3 0,-0.5 0,0 43.3,25 86.6,0 43.3,-25  "/>
 <polygon id="XMLID_129_" class="st2" points="43.3,-75 43.3,-25.3 45.4,-26.5 43.3,-25.3 43.3,-25 86.6,0 86.6,-50  "/>
 <polygon id="XMLID_128_" class="st3" points="129.9,-75 129.9,-125 86.6,-150 86.6,-100  "/>
 <polygon id="XMLID_127_" class="st4" points="86.6,-150 43.3,-125 43.3,-75 86.6,-100  "/>
 <polygon id="XMLID_126_" class="st5" points="129.9,-75 86.6,-100 86.6,-98.2 86.6,-100 43.3,-75 86.6,-50  "/>
 <polygon id="XMLID_125_" class="st6" points="173.2,-0.1 173.2,-50 129.9,-75 129.9,-25.1  "/>
 <polygon id="XMLID_124_" class="st7" points="129.9,-25.1 129.9,-25 86.6,0 129.9,25 173.2,0 173.2,-0.1  "/>
 <polygon id="XMLID_123_" class="st8" points="129.9,-25.1 128.8,-25.7 129.9,-25.1 129.9,-75 86.6,-50 86.6,0 129.9,-25  "/>
</g>
<g id="XMLID_2_">
 <polygon id="XMLID_11_" class="st0" points="173.2,0 129.9,25 129.9,74.5 173.2,49.7  "/>
 <polygon id="XMLID_10_" class="st1" points="173.2,49.7 129.9,74.5 129.9,75 173.2,100 216.5,75 173.2,50  "/>
 <polygon id="XMLID_9_" class="st2" points="173.2,0 173.2,49.7 175.3,48.5 173.2,49.7 173.2,50 216.5,75 216.5,25  "/>
 <polygon id="XMLID_8_" class="st3" points="259.8,0 259.8,-50 216.5,-75 216.5,-25  "/>
 <polygon id="XMLID_7_" class="st4" points="216.5,-75 173.2,-50 173.2,0 216.5,-25  "/>
 <polygon id="XMLID_6_" class="st5" points="259.8,0 216.5,-25 216.5,-23.2 216.5,-25 173.2,0 216.5,25  "/>
 <polygon id="XMLID_5_" class="st6" points="303.1,74.9 303.1,25 259.8,0 259.8,49.9  "/>
 <polygon id="XMLID_4_" class="st7" points="259.8,49.9 259.8,50 216.5,75 259.8,100 303.1,75 303.1,74.9  "/>
 <polygon id="XMLID_3_" class="st8" points="259.8,49.9 258.7,49.3 259.8,49.9 259.8,0 216.5,25 216.5,75 259.8,50  "/>
</g>
<g id="XMLID_12_">
 <polygon id="XMLID_21_" class="st0" points="43.3,224.5 0,249.5 0,299 43.3,274.3  "/>
 <polygon id="XMLID_20_" class="st1" points="43.3,274.3 0,299 0,299.5 43.3,324.5 86.6,299.5 43.3,274.5  "/>
 <polygon id="XMLID_19_" class="st2" points="43.3,224.5 43.3,274.3 45.4,273.1 43.3,274.3 43.3,274.5 86.6,299.5 86.6,249.5  "/>
 <polygon id="XMLID_18_" class="st3" points="129.9,224.5 129.9,174.5 86.6,149.5 86.6,199.5  "/>
 <polygon id="XMLID_17_" class="st4" points="86.6,149.5 43.3,174.5 43.3,224.5 86.6,199.5  "/>
 <polygon id="XMLID_16_" class="st5" points="129.9,224.5 86.6,199.5 86.6,201.3 86.6,199.5 43.3,224.5 86.6,249.5  "/>
 <polygon id="XMLID_15_" class="st6" points="173.2,299.5 173.2,249.5 129.9,224.5 129.9,274.4  "/>
 <polygon id="XMLID_14_" class="st7" points="129.9,274.4 129.9,274.5 86.6,299.5 129.9,324.5 173.2,299.5 173.2,299.5  "/>
 <polygon id="XMLID_13_" class="st8" points="129.9,274.4 128.8,273.8 129.9,274.4 129.9,224.5 86.6,249.5 86.6,299.5 129.9,274.5
  "/>
</g>
<g id="XMLID_22_">
 <polygon id="XMLID_31_" class="st0" points="-86.6,149.5 -129.9,174.5 -129.9,224 -86.6,199.3  "/>
 <polygon id="XMLID_30_" class="st1" points="-86.6,199.3 -129.9,224 -129.9,224.5 -86.6,249.5 -43.3,224.5 -86.6,199.5  "/>
 <polygon id="XMLID_29_" class="st2" points="-86.6,149.5 -86.6,199.3 -84.5,198.1 -86.6,199.3 -86.6,199.5 -43.3,224.5
  -43.3,174.5  "/>
 <polygon id="XMLID_28_" class="st3" points="0,149.5 0,99.5 -43.3,74.5 -43.3,124.5  "/>
 <polygon id="XMLID_27_" class="st4" points="-43.3,74.5 -86.6,99.5 -86.6,149.5 -43.3,124.5  "/>
 <polygon id="XMLID_26_" class="st5" points="0,149.5 -43.3,124.5 -43.3,126.3 -43.3,124.5 -86.6,149.5 -43.3,174.5  "/>
 <polygon id="XMLID_25_" class="st6" points="43.3,224.5 43.3,174.5 0,149.5 0,199.4  "/>
 <polygon id="XMLID_24_" class="st7" points="0,199.4 0,199.5 -43.3,224.5 0,249.5 43.3,224.5 43.3,224.5  "/>
 <polygon id="XMLID_23_" class="st8" points="0,199.4 -1.1,198.8 0,199.4 0,149.5 -43.3,174.5 -43.3,224.5 0,199.5  "/>
</g>
<g id="XMLID_282_">
 <polygon id="XMLID_291_" class="st0" points="-86.6,0 -129.9,25 -129.9,74.5 -86.6,49.8  "/>
 <polygon id="XMLID_290_" class="st1" points="-86.6,49.8 -129.9,74.5 -129.9,75 -86.6,100 -43.3,75 -86.6,50  "/>
 <polygon id="XMLID_289_" class="st2" points="-86.6,0 -86.6,49.8 -84.5,48.6 -86.6,49.8 -86.6,50 -43.3,75 -43.3,25  "/>
 <polygon id="XMLID_288_" class="st3" points="0,0 0,-50 -43.3,-75 -43.3,-25  "/>
 <polygon id="XMLID_287_" class="st4" points="-43.3,-75 -86.6,-50 -86.6,0 -43.3,-25  "/>
 <polygon id="XMLID_286_" class="st5" points="0,0 -43.3,-25 -43.3,-23.2 -43.3,-25 -86.6,0 -43.3,25  "/>
 <polygon id="XMLID_285_" class="st6" points="43.3,75 43.3,25 0,0 0,49.9  "/>
 <polygon id="XMLID_284_" class="st7" points="0,49.9 0,50 -43.3,75 0,100 43.3,75 43.3,75  "/>
 <polygon id="XMLID_283_" class="st8" points="0,49.9 -1.1,49.3 0,49.9 0,0 -43.3,25 -43.3,75 0,50  "/>
</g>
<g id="XMLID_272_">
 <polygon id="XMLID_281_" class="st0" points="173.2,149.5 129.9,174.5 129.9,224 173.2,199.3  "/>
 <polygon id="XMLID_280_" class="st1" points="173.2,199.3 129.9,224 129.9,224.5 173.2,249.5 216.5,224.5 173.2,199.5  "/>
 <polygon id="XMLID_279_" class="st2" points="173.2,149.5 173.2,199.3 175.3,198.1 173.2,199.3 173.2,199.5 216.5,224.5
  216.5,174.5  "/>
 <polygon id="XMLID_278_" class="st3" points="259.8,149.5 259.8,99.5 216.5,74.5 216.5,124.5  "/>
 <polygon id="XMLID_277_" class="st4" points="216.5,74.5 173.2,99.5 173.2,149.5 216.5,124.5  "/>
 <polygon id="XMLID_276_" class="st5" points="259.8,149.5 216.5,124.5 216.5,126.3 216.5,124.5 173.2,149.5 216.5,174.5  "/>
 <polygon id="XMLID_275_" class="st6" points="303.1,224.5 303.1,174.5 259.8,149.5 259.8,199.4  "/>
 <polygon id="XMLID_274_" class="st7" points="259.8,199.4 259.8,199.5 216.5,224.5 259.8,249.5 303.1,224.5 303.1,224.5  "/>
 <polygon id="XMLID_273_" class="st8" points="259.8,199.4 258.7,198.8 259.8,199.4 259.8,149.5 216.5,174.5 216.5,224.5
  259.8,199.5  "/>
</g>
<g id="XMLID_102_">
 <polygon id="XMLID_111_" class="st0" points="433,0 389.7,25 389.7,74.5 433,49.8  "/>
 <polygon id="XMLID_110_" class="st1" points="433,49.8 389.7,74.5 389.7,75 433,100 476.3,75 433,50  "/>
 <polygon id="XMLID_109_" class="st2" points="433,0 433,49.8 435.1,48.6 433,49.8 433,50 476.3,75 476.3,25  "/>
 <polygon id="XMLID_108_" class="st3" points="519.6,0 519.6,-50 476.3,-75 476.3,-25  "/>
 <polygon id="XMLID_107_" class="st4" points="476.3,-75 433,-50 433,0 476.3,-25  "/>
 <polygon id="XMLID_106_" class="st5" points="519.6,0 476.3,-25 476.3,-23.2 476.3,-25 433,0 476.3,25  "/>
 <polygon id="XMLID_105_" class="st6" points="562.9,75 562.9,25 519.6,0 519.6,49.9  "/>
 <polygon id="XMLID_104_" class="st7" points="519.6,49.9 519.6,50 476.3,75 519.6,100 562.9,75 562.9,75  "/>
 <polygon id="XMLID_103_" class="st8" points="519.6,49.9 518.5,49.3 519.6,49.9 519.6,0 476.3,25 476.3,75 519.6,50  "/>
</g>
<g id="XMLID_82_">
 <polygon id="XMLID_91_" class="st0" points="562.9,-75 519.6,-50 519.6,-0.5 562.9,-25.3  "/>
 <polygon id="XMLID_90_" class="st1" points="562.9,-25.3 519.6,-0.5 519.6,0 562.9,25 606.2,0 562.9,-25  "/>
 <polygon id="XMLID_89_" class="st2" points="562.9,-75 562.9,-25.3 565,-26.5 562.9,-25.3 562.9,-25 606.2,0 606.2,-50  "/>
 <polygon id="XMLID_88_" class="st3" points="649.5,-75 649.5,-125 606.2,-150 606.2,-100  "/>
 <polygon id="XMLID_87_" class="st4" points="606.2,-150 562.9,-125 562.9,-75 606.2,-100  "/>
 <polygon id="XMLID_86_" class="st5" points="649.5,-75 606.2,-100 606.2,-98.2 606.2,-100 562.9,-75 606.2,-50  "/>
 <polygon id="XMLID_85_" class="st6" points="692.8,-0.1 692.8,-50 649.5,-75 649.5,-25.1  "/>
 <polygon id="XMLID_84_" class="st7" points="649.5,-25.1 649.5,-25 606.2,0 649.5,25 692.8,0 692.8,-0.1  "/>
 <polygon id="XMLID_83_" class="st8" points="649.5,-25.1 648.4,-25.7 649.5,-25.1 649.5,-75 606.2,-50 606.2,0 649.5,-25  "/>
</g>
<g id="XMLID_72_">
 <polygon id="XMLID_81_" class="st0" points="433,149.5 389.7,174.5 389.7,224 433,199.3  "/>
 <polygon id="XMLID_80_" class="st1" points="433,199.3 389.7,224 389.7,224.5 433,249.5 476.3,224.5 433,199.5  "/>
 <polygon id="XMLID_79_" class="st2" points="433,149.5 433,199.3 435.1,198.1 433,199.3 433,199.5 476.3,224.5 476.3,174.5  "/>
 <polygon id="XMLID_78_" class="st3" points="519.6,149.5 519.6,99.5 476.3,74.5 476.3,124.5  "/>
 <polygon id="XMLID_77_" class="st4" points="476.3,74.5 433,99.5 433,149.5 476.3,124.5  "/>
 <polygon id="XMLID_76_" class="st5" points="519.6,149.5 476.3,124.5 476.3,126.3 476.3,124.5 433,149.5 476.3,174.5  "/>
 <polygon id="XMLID_75_" class="st6" points="562.9,224.5 562.9,174.5 519.6,149.5 519.6,199.4  "/>
 <polygon id="XMLID_74_" class="st7" points="519.6,199.4 519.6,199.5 476.3,224.5 519.6,249.5 562.9,224.5 562.9,224.5  "/>
 <polygon id="XMLID_73_" class="st8" points="519.6,199.4 518.5,198.8 519.6,199.4 519.6,149.5 476.3,174.5 476.3,224.5
  519.6,199.5  "/>
</g>
<g id="XMLID_62_">
 <polygon id="XMLID_71_" class="st0" points="303.1,74.5 259.8,99.5 259.8,149 303.1,124.3  "/>
 <polygon id="XMLID_70_" class="st1" points="303.1,124.3 259.8,149 259.8,149.5 303.1,174.5 346.4,149.5 303.1,124.5  "/>
 <polygon id="XMLID_69_" class="st2" points="303.1,74.5 303.1,124.3 305.2,123.1 303.1,124.3 303.1,124.5 346.4,149.5 346.4,99.5
  "/>
 <polygon id="XMLID_68_" class="st3" points="389.7,74.5 389.7,24.5 346.4,-0.5 346.4,49.5  "/>
 <polygon id="XMLID_67_" class="st4" points="346.4,-0.5 303.1,24.5 303.1,74.5 346.4,49.5  "/>
 <polygon id="XMLID_66_" class="st5" points="389.7,74.5 346.4,49.5 346.4,51.3 346.4,49.5 303.1,74.5 346.4,99.5  "/>
 <polygon id="XMLID_65_" class="st6" points="433,149.5 433,99.5 389.7,74.5 389.7,124.4  "/>
 <polygon id="XMLID_64_" class="st7" points="389.7,124.4 389.7,124.5 346.4,149.5 389.7,174.5 433,149.5 433,149.5  "/>
 <polygon id="XMLID_63_" class="st8" points="389.7,124.4 388.6,123.8 389.7,124.4 389.7,74.5 346.4,99.5 346.4,149.5 389.7,124.5
  "/>
</g>
<g id="XMLID_52_">
 <polygon id="XMLID_61_" class="st0" points="303.1,-75 259.8,-50 259.8,-0.5 303.1,-25.2  "/>
 <polygon id="XMLID_60_" class="st1" points="303.1,-25.2 259.8,-0.5 259.8,0 303.1,25 346.4,0 303.1,-25  "/>
 <polygon id="XMLID_59_" class="st2" points="303.1,-75 303.1,-25.2 305.2,-26.4 303.1,-25.2 303.1,-25 346.4,0 346.4,-50  "/>
 <polygon id="XMLID_58_" class="st3" points="389.7,-75 389.7,-125 346.4,-150 346.4,-100  "/>
 <polygon id="XMLID_57_" class="st4" points="346.4,-150 303.1,-125 303.1,-75 346.4,-100  "/>
 <polygon id="XMLID_56_" class="st5" points="389.7,-75 346.4,-100 346.4,-98.2 346.4,-100 303.1,-75 346.4,-50  "/>
 <polygon id="XMLID_55_" class="st6" points="433,0 433,-50 389.7,-75 389.7,-25.1  "/>
 <polygon id="XMLID_54_" class="st7" points="389.7,-25.1 389.7,-25 346.4,0 389.7,25 433,0 433,0  "/>
 <polygon id="XMLID_53_" class="st8" points="389.7,-25.1 388.6,-25.7 389.7,-25.1 389.7,-75 346.4,-50 346.4,0 389.7,-25  "/>
</g>
<g id="XMLID_42_">
 <polygon id="XMLID_51_" class="st0" points="562.9,74.5 519.6,99.5 519.6,149 562.9,124.3  "/>
 <polygon id="XMLID_50_" class="st1" points="562.9,124.3 519.6,149 519.6,149.5 562.9,174.5 606.2,149.5 562.9,124.5  "/>
 <polygon id="XMLID_49_" class="st2" points="562.9,74.5 562.9,124.3 565,123.1 562.9,124.3 562.9,124.5 606.2,149.5 606.2,99.5
  "/>
 <polygon id="XMLID_48_" class="st3" points="649.5,74.5 649.5,24.5 606.2,-0.5 606.2,49.5  "/>
 <polygon id="XMLID_47_" class="st4" points="606.2,-0.5 562.9,24.5 562.9,74.5 606.2,49.5  "/>
 <polygon id="XMLID_46_" class="st5" points="649.5,74.5 606.2,49.5 606.2,51.3 606.2,49.5 562.9,74.5 606.2,99.5  "/>
 <polygon id="XMLID_45_" class="st6" points="692.8,149.5 692.8,99.5 649.5,74.5 649.5,124.4  "/>
 <polygon id="XMLID_44_" class="st7" points="649.5,124.4 649.5,124.5 606.2,149.5 649.5,174.5 692.8,149.5 692.8,149.5  "/>
 <polygon id="XMLID_43_" class="st8" points="649.5,124.4 648.4,123.8 649.5,124.4 649.5,74.5 606.2,99.5 606.2,149.5 649.5,124.5
  "/>
</g>
<g id="XMLID_182_">
 <polygon id="XMLID_191_" class="st0" points="303.1,375 259.8,400 259.8,449.6 303.1,424.8  "/>
 <polygon id="XMLID_190_" class="st1" points="303.1,424.8 259.8,449.6 259.8,450 303.1,475 346.4,450 303.1,425  "/>
 <polygon id="XMLID_189_" class="st2" points="303.1,375 303.1,424.8 305.2,423.6 303.1,424.8 303.1,425 346.4,450 346.4,400  "/>
 <polygon id="XMLID_188_" class="st3" points="389.7,375 389.7,325 346.4,300 346.4,350  "/>
 <polygon id="XMLID_187_" class="st4" points="346.4,300 303.1,325 303.1,375 346.4,350  "/>
 <polygon id="XMLID_186_" class="st5" points="389.7,375 346.4,350 346.4,351.8 346.4,350 303.1,375 346.4,400  "/>
 <polygon id="XMLID_185_" class="st6" points="433,450 433,400 389.7,375 389.7,425  "/>
 <polygon id="XMLID_184_" class="st7" points="389.7,425 389.7,425 346.4,450 389.7,475 433,450 433,450  "/>
 <polygon id="XMLID_183_" class="st8" points="389.7,425 388.6,424.3 389.7,425 389.7,375 346.4,400 346.4,450 389.7,425  "/>
</g>
<g id="XMLID_172_">
 <polygon id="XMLID_181_" class="st0" points="303.1,225 259.8,250 259.8,299.5 303.1,274.8  "/>
 <polygon id="XMLID_180_" class="st1" points="303.1,274.8 259.8,299.5 259.8,300 303.1,325 346.4,300 303.1,275  "/>
 <polygon id="XMLID_179_" class="st2" points="303.1,225 303.1,274.8 305.2,273.6 303.1,274.8 303.1,275 346.4,300 346.4,250  "/>
 <polygon id="XMLID_178_" class="st3" points="389.7,225 389.7,175 346.4,150 346.4,200  "/>
 <polygon id="XMLID_177_" class="st4" points="346.4,150 303.1,175 303.1,225 346.4,200  "/>
 <polygon id="XMLID_176_" class="st5" points="389.7,225 346.4,200 346.4,201.8 346.4,200 303.1,225 346.4,250  "/>
 <polygon id="XMLID_175_" class="st6" points="433,300 433,250 389.7,225 389.7,274.9  "/>
 <polygon id="XMLID_174_" class="st7" points="389.7,274.9 389.7,275 346.4,300 389.7,325 433,300 433,300  "/>
 <polygon id="XMLID_173_" class="st8" points="389.7,274.9 388.6,274.3 389.7,274.9 389.7,225 346.4,250 346.4,300 389.7,275  "/>
</g>
<g id="XMLID_162_">
 <polygon id="XMLID_171_" class="st0" points="433,300 389.7,325 389.7,374.5 433,349.8  "/>
 <polygon id="XMLID_170_" class="st1" points="433,349.8 389.7,374.5 389.7,375 433,400 476.3,375 433,350  "/>
 <polygon id="XMLID_169_" class="st2" points="433,300 433,349.8 435.1,348.6 433,349.8 433,350 476.3,375 476.3,325  "/>
 <polygon id="XMLID_168_" class="st3" points="519.6,300 519.6,250 476.3,225 476.3,275  "/>
 <polygon id="XMLID_167_" class="st4" points="476.3,225 433,250 433,300 476.3,275  "/>
 <polygon id="XMLID_166_" class="st5" points="519.6,300 476.3,275 476.3,276.8 476.3,275 433,300 476.3,325  "/>
 <polygon id="XMLID_165_" class="st6" points="562.9,375 562.9,325 519.6,300 519.6,349.9  "/>
 <polygon id="XMLID_164_" class="st7" points="519.6,349.9 519.6,350 476.3,375 519.6,400 562.9,375 562.9,375  "/>
 <polygon id="XMLID_163_" class="st8" points="519.6,349.9 518.5,349.3 519.6,349.9 519.6,300 476.3,325 476.3,375 519.6,350  "/>
</g>
<g id="XMLID_152_">
 <polygon id="XMLID_161_" class="st0" points="303.1,524.5 259.8,549.5 259.8,599.1 303.1,574.3  "/>
 <polygon id="XMLID_160_" class="st1" points="303.1,574.3 259.8,599.1 259.8,599.5 303.1,624.5 346.4,599.5 303.1,574.5  "/>
 <polygon id="XMLID_159_" class="st2" points="303.1,524.5 303.1,574.3 305.2,573.1 303.1,574.3 303.1,574.5 346.4,599.5
  346.4,549.5  "/>
 <polygon id="XMLID_158_" class="st3" points="389.7,524.5 389.7,474.5 346.4,449.5 346.4,499.5  "/>
 <polygon id="XMLID_157_" class="st4" points="346.4,449.5 303.1,474.5 303.1,524.5 346.4,499.5  "/>
 <polygon id="XMLID_156_" class="st5" points="389.7,524.5 346.4,499.5 346.4,501.3 346.4,499.5 303.1,524.5 346.4,549.5  "/>
 <polygon id="XMLID_155_" class="st6" points="433,599.5 433,549.5 389.7,524.5 389.7,574.5  "/>
 <polygon id="XMLID_154_" class="st7" points="389.7,574.5 389.7,574.5 346.4,599.5 389.7,624.5 433,599.5 433,599.5  "/>
 <polygon id="XMLID_153_" class="st8" points="389.7,574.5 388.6,573.8 389.7,574.5 389.7,524.5 346.4,549.5 346.4,599.5
  389.7,574.5  "/>
</g>
<g id="XMLID_142_">
 <polygon id="XMLID_151_" class="st0" points="173.2,449.5 129.9,474.5 129.9,524.1 173.2,499.3  "/>
 <polygon id="XMLID_150_" class="st1" points="173.2,499.3 129.9,524.1 129.9,524.5 173.2,549.5 216.5,524.5 173.2,499.5  "/>
 <polygon id="XMLID_149_" class="st2" points="173.2,449.5 173.2,499.3 175.3,498.1 173.2,499.3 173.2,499.5 216.5,524.5
  216.5,474.5  "/>
 <polygon id="XMLID_148_" class="st3" points="259.8,449.5 259.8,399.5 216.5,374.5 216.5,424.5  "/>
 <polygon id="XMLID_147_" class="st4" points="216.5,374.5 173.2,399.5 173.2,449.5 216.5,424.5  "/>
 <polygon id="XMLID_146_" class="st5" points="259.8,449.5 216.5,424.5 216.5,426.3 216.5,424.5 173.2,449.5 216.5,474.5  "/>
 <polygon id="XMLID_145_" class="st6" points="303.1,524.5 303.1,474.5 259.8,449.5 259.8,499.5  "/>
 <polygon id="XMLID_144_" class="st7" points="259.8,499.5 259.8,499.5 216.5,524.5 259.8,549.5 303.1,524.5 303.1,524.5  "/>
 <polygon id="XMLID_143_" class="st8" points="259.8,499.5 258.7,498.8 259.8,499.5 259.8,449.5 216.5,474.5 216.5,524.5
  259.8,499.5  "/>
</g>
<g id="XMLID_132_">
 <polygon id="XMLID_141_" class="st0" points="173.2,300 129.9,325 129.9,374.6 173.2,349.8  "/>
 <polygon id="XMLID_140_" class="st1" points="173.2,349.8 129.9,374.6 129.9,375 173.2,400 216.5,375 173.2,350  "/>
 <polygon id="XMLID_139_" class="st2" points="173.2,300 173.2,349.8 175.3,348.6 173.2,349.8 173.2,350 216.5,375 216.5,325  "/>
 <polygon id="XMLID_138_" class="st3" points="259.8,300 259.8,250 216.5,225 216.5,275  "/>
 <polygon id="XMLID_137_" class="st4" points="216.5,225 173.2,250 173.2,300 216.5,275  "/>
 <polygon id="XMLID_136_" class="st5" points="259.8,300 216.5,275 216.5,276.8 216.5,275 173.2,300 216.5,325  "/>
 <polygon id="XMLID_135_" class="st6" points="303.1,375 303.1,325 259.8,300 259.8,350  "/>
 <polygon id="XMLID_134_" class="st7" points="259.8,350 259.8,350 216.5,375 259.8,400 303.1,375 303.1,375  "/>
 <polygon id="XMLID_133_" class="st8" points="259.8,350 258.7,349.3 259.8,350 259.8,300 216.5,325 216.5,375 259.8,350  "/>
</g>
<g id="XMLID_112_">
 <polygon id="XMLID_121_" class="st0" points="433,449.5 389.7,474.5 389.7,524.1 433,499.3  "/>
 <polygon id="XMLID_120_" class="st1" points="433,499.3 389.7,524.1 389.7,524.5 433,549.5 476.3,524.5 433,499.5  "/>
 <polygon id="XMLID_119_" class="st2" points="433,449.5 433,499.3 435.1,498.1 433,499.3 433,499.5 476.3,524.5 476.3,474.5  "/>
 <polygon id="XMLID_118_" class="st3" points="519.6,449.5 519.6,399.5 476.3,374.5 476.3,424.5  "/>
 <polygon id="XMLID_117_" class="st4" points="476.3,374.5 433,399.5 433,449.5 476.3,424.5  "/>
 <polygon id="XMLID_116_" class="st5" points="519.6,449.5 476.3,424.5 476.3,426.3 476.3,424.5 433,449.5 476.3,474.5  "/>
 <polygon id="XMLID_115_" class="st6" points="562.9,524.5 562.9,474.5 519.6,449.5 519.6,499.5  "/>
 <polygon id="XMLID_114_" class="st7" points="519.6,499.5 519.6,499.5 476.3,524.5 519.6,549.5 562.9,524.5 562.9,524.5  "/>
 <polygon id="XMLID_113_" class="st8" points="519.6,499.5 518.5,498.8 519.6,499.5 519.6,449.5 476.3,474.5 476.3,524.5
  519.6,499.5  "/>
</g>
<g id="XMLID_252_">
 <polygon id="XMLID_261_" class="st0" points="-86.6,449.5 -129.9,474.5 -129.9,524.1 -86.6,499.3  "/>
 <polygon id="XMLID_260_" class="st1" points="-86.6,499.3 -129.9,524.1 -129.9,524.5 -86.6,549.5 -43.3,524.5 -86.6,499.5  "/>
 <polygon id="XMLID_259_" class="st2" points="-86.6,449.5 -86.6,499.3 -84.5,498.1 -86.6,499.3 -86.6,499.5 -43.3,524.5
  -43.3,474.5  "/>
 <polygon id="XMLID_258_" class="st3" points="0,449.5 0,399.5 -43.3,374.5 -43.3,424.5  "/>
 <polygon id="XMLID_257_" class="st4" points="-43.3,374.5 -86.6,399.5 -86.6,449.5 -43.3,424.5  "/>
 <polygon id="XMLID_256_" class="st5" points="0,449.5 -43.3,424.5 -43.3,426.3 -43.3,424.5 -86.6,449.5 -43.3,474.5  "/>
 <polygon id="XMLID_255_" class="st6" points="43.3,524.5 43.3,474.5 0,449.5 0,499.5  "/>
 <polygon id="XMLID_254_" class="st7" points="0,499.5 0,499.5 -43.3,524.5 0,549.5 43.3,524.5 43.3,524.5  "/>
 <polygon id="XMLID_253_" class="st8" points="0,499.5 -1.1,498.8 0,499.5 0,449.5 -43.3,474.5 -43.3,524.5 0,499.5  "/>
</g>

</svg>```

答:
It looks like the polygons have unique ids? For example: XMLID_121_

If so, maybe you could do something like this:
1) Put all of the polygon ids in an array
2) randomly visit a location in the array
3) do something with the element in that array location ("visit the polygon with that id", etc.)
4) extract the visited array element from the array
5) keep doing this until there are no elements left in the id array.

Here is a simple JavaScript program to that effect:

```<code>var polygonIds = [1, 2, 3, 4, 5]; //the order doesn't matter
while (polygonIds.length > 0) { //repeat until no more elements left
   var position = Math.floor(Math.random() * polygonIds.length); //choose random location
   var extracted = polygonIds[position]; //get that element
   alert(extracted); //do whatever you want to do with the extracted element
   polygonIds.splice(position, 1); //remove the element from array
}
</code>```

Maybe there is a better way to do this.  But it seems reasonable, and it looks like you are using JavaScript.  So something like this might work for you.

Body:
I have a SVG with more than a 1000 polygons each 3 look like a cube. at the moment I'm changing the colour by class name. but I would like that each polygon is visited randomly without any repeating, unit all of polygons visited.

 https://jsfiddle.net/MSTq/rbgmjqwd/2/

for better view please visit jsfiddle

/*
    Created on : 11/03/2017, 7:01:53 PM
    Author     : MSTq
*/

$(document).ready(function(){
    var polygons = $("#Layer_1").find("polygon");
    /*var paths    = $("#svg-layer-1 ").find("path");
    var pathslength =  paths.length;*/
    var polygonslength = polygons.length;
    var colorSeter = $("#curent-color-set").find(".color-set");

    var byclass = [];
    for(var f  = 0 ; f < 9; f++){
        byclass.push($("#Layer_1").find(".st" + f));
    }

    setInterval(function (){
        var clor = rColorSet([rColor(),rColor()])[randomise(2,0)];
        var rar = randomise(8,0);
        var colrSeter = colorSeter[rar];

        byclass[rar].css({"fill":clor,"stroke":clor});
        $(colrSeter).css({"background-color":clor});
        $("#" + $(colrSeter).attr("id") + " p").text(clor);

    },500);

});

function isPositive (){
   return arguments[0] > 0;
}
function vlidPositive (){
   return  isPositive(arguments[0]) ? arguments[0] : 0;
}
function comparer (){
   return arguments[0] > arguments[1];
}
function reservation (r,t){
    r =  vlidPositive(arguments[0]), t = vlidPositive(arguments[1]);
    return  (r * t) / 100;
}
function randomise (max,min){
    max = vlidPositive(arguments[0]),min = vlidPositive(arguments[1]);
    return Math.floor(Math.random() * (max - min + 1)) + min;
}

function rColor (){
    var hex       = ["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"],
        hexLength = hex.length -1,
        limits    = [[11,4],
                     [12,6],
                     [hexLength,8]],
        color     = "",
        final     = "#",
        temp      = "";

    for (var j =0 ; j < 3; j++){
        for (var i = 0 ; i < 2; i++){
           temp += hex[randomise(limits[j][0] , limits[j][1])];
        }
        color += temp;
        temp = "";
    }
    final += color;
    return  final;
}

function rColorSet(){

    var colorset = [];

    for (var i = 0; i < arguments.length; i++)
    {
      if (Array.isArray(arguments[i])){
          colorset = arguments[i];
          break;
      }
    }

    return colorset;
}

/*
    Created on : 11/03/2017, 7:01:53 PM
    Author     : MSTq
*/

* {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,body{
    width: 100%;
    height:100px;
}
svg {
    width:100%;
    height:auto;
    display: block;
    margin: auto;
    background-size:auto;
    margin-top: 10px;
}
#mydiv{
    width:200px;
    height:200px;
    background-color: #FFF0F0;
}

#curent-color-set{
    width: 100%;
    height:40%;
    margin-bottom: 10px;
}
.color-set{
   position: relative;
    height: 100%;
    width: 7%;
    margin-left: 1%;
    margin-top: 5px;
    background-color: #000000;
    display: inline-block;
}

.color-code{
    font-size: .75em;
    line-height: 34px;
}

 .st0{fill:#EF4136;}
 .st1{fill:#F7941E;}
 .st2{fill:#00A79D;}
 .st3{fill:#662D91;}
 .st4{fill:#EC008C;}
 .st5{fill:#F9ED32;}
 .st6{fill:#8B5E3C;}
 .st7{fill:#C2B59B;}
 .st8{fill:#009444;}

#

#

#

#

#

#

#

#

#

<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
  viewBox="0 0 1920 1080" style="enable-background:new 0 0 1920 1080;" xml:space="preserve">

<g id="XMLID_32_">
 <polygon id="XMLID_41_" class="st0" points="43.3,75 0,100 0,149.5 43.3,124.8  "/>
 <polygon id="XMLID_40_" class="st1" points="43.3,124.8 0,149.5 0,150 43.3,175 86.6,150 43.3,125  "/>
 <polygon id="XMLID_39_" class="st2" points="43.3,75 43.3,124.8 45.4,123.6 43.3,124.8 43.3,125 86.6,150 86.6,100  "/>
 <polygon id="XMLID_38_" class="st3" points="129.9,75 129.9,25 86.6,0 86.6,50  "/>
 <polygon id="XMLID_37_" class="st4" points="86.6,0 43.3,25 43.3,75 86.6,50  "/>
 <polygon id="XMLID_36_" class="st5" points="129.9,75 86.6,50 86.6,51.8 86.6,50 43.3,75 86.6,100  "/>
 <polygon id="XMLID_35_" class="st6" points="173.2,150 173.2,100 129.9,75 129.9,124.9  "/>
 <polygon id="XMLID_34_" class="st7" points="129.9,124.9 129.9,125 86.6,150 129.9,175 173.2,150 173.2,150  "/>
 <polygon id="XMLID_33_" class="st8" points="129.9,124.9 128.8,124.3 129.9,124.9 129.9,75 86.6,100 86.6,150 129.9,125  "/>
</g>
<g id="XMLID_122_">
 <polygon id="XMLID_131_" class="st0" points="43.3,-75 0,-50 0,-0.5 43.3,-25.3  "/>
 <polygon id="XMLID_130_" class="st1" points="43.3,-25.3 0,-0.5 0,0 43.3,25 86.6,0 43.3,-25  "/>
 <polygon id="XMLID_129_" class="st2" points="43.3,-75 43.3,-25.3 45.4,-26.5 43.3,-25.3 43.3,-25 86.6,0 86.6,-50  "/>
 <polygon id="XMLID_128_" class="st3" points="129.9,-75 129.9,-125 86.6,-150 86.6,-100  "/>
 <polygon id="XMLID_127_" class="st4" points="86.6,-150 43.3,-125 43.3,-75 86.6,-100  "/>
 <polygon id="XMLID_126_" class="st5" points="129.9,-75 86.6,-100 86.6,-98.2 86.6,-100 43.3,-75 86.6,-50  "/>
 <polygon id="XMLID_125_" class="st6" points="173.2,-0.1 173.2,-50 129.9,-75 129.9,-25.1  "/>
 <polygon id="XMLID_124_" class="st7" points="129.9,-25.1 129.9,-25 86.6,0 129.9,25 173.2,0 173.2,-0.1  "/>
 <polygon id="XMLID_123_" class="st8" points="129.9,-25.1 128.8,-25.7 129.9,-25.1 129.9,-75 86.6,-50 86.6,0 129.9,-25  "/>
</g>
<g id="XMLID_2_">
 <polygon id="XMLID_11_" class="st0" points="173.2,0 129.9,25 129.9,74.5 173.2,49.7  "/>
 <polygon id="XMLID_10_" class="st1" points="173.2,49.7 129.9,74.5 129.9,75 173.2,100 216.5,75 173.2,50  "/>
 <polygon id="XMLID_9_" class="st2" points="173.2,0 173.2,49.7 175.3,48.5 173.2,49.7 173.2,50 216.5,75 216.5,25  "/>
 <polygon id="XMLID_8_" class="st3" points="259.8,0 259.8,-50 216.5,-75 216.5,-25  "/>
 <polygon id="XMLID_7_" class="st4" points="216.5,-75 173.2,-50 173.2,0 216.5,-25  "/>
 <polygon id="XMLID_6_" class="st5" points="259.8,0 216.5,-25 216.5,-23.2 216.5,-25 173.2,0 216.5,25  "/>
 <polygon id="XMLID_5_" class="st6" points="303.1,74.9 303.1,25 259.8,0 259.8,49.9  "/>
 <polygon id="XMLID_4_" class="st7" points="259.8,49.9 259.8,50 216.5,75 259.8,100 303.1,75 303.1,74.9  "/>
 <polygon id="XMLID_3_" class="st8" points="259.8,49.9 258.7,49.3 259.8,49.9 259.8,0 216.5,25 216.5,75 259.8,50  "/>
</g>
<g id="XMLID_12_">
 <polygon id="XMLID_21_" class="st0" points="43.3,224.5 0,249.5 0,299 43.3,274.3  "/>
 <polygon id="XMLID_20_" class="st1" points="43.3,274.3 0,299 0,299.5 43.3,324.5 86.6,299.5 43.3,274.5  "/>
 <polygon id="XMLID_19_" class="st2" points="43.3,224.5 43.3,274.3 45.4,273.1 43.3,274.3 43.3,274.5 86.6,299.5 86.6,249.5  "/>
 <polygon id="XMLID_18_" class="st3" points="129.9,224.5 129.9,174.5 86.6,149.5 86.6,199.5  "/>
 <polygon id="XMLID_17_" class="st4" points="86.6,149.5 43.3,174.5 43.3,224.5 86.6,199.5  "/>
 <polygon id="XMLID_16_" class="st5" points="129.9,224.5 86.6,199.5 86.6,201.3 86.6,199.5 43.3,224.5 86.6,249.5  "/>
 <polygon id="XMLID_15_" class="st6" points="173.2,299.5 173.2,249.5 129.9,224.5 129.9,274.4  "/>
 <polygon id="XMLID_14_" class="st7" points="129.9,274.4 129.9,274.5 86.6,299.5 129.9,324.5 173.2,299.5 173.2,299.5  "/>
 <polygon id="XMLID_13_" class="st8" points="129.9,274.4 128.8,273.8 129.9,274.4 129.9,224.5 86.6,249.5 86.6,299.5 129.9,274.5
  "/>
</g>
<g id="XMLID_22_">
 <polygon id="XMLID_31_" class="st0" points="-86.6,149.5 -129.9,174.5 -129.9,224 -86.6,199.3  "/>
 <polygon id="XMLID_30_" class="st1" points="-86.6,199.3 -129.9,224 -129.9,224.5 -86.6,249.5 -43.3,224.5 -86.6,199.5  "/>
 <polygon id="XMLID_29_" class="st2" points="-86.6,149.5 -86.6,199.3 -84.5,198.1 -86.6,199.3 -86.6,199.5 -43.3,224.5
  -43.3,174.5  "/>
 <polygon id="XMLID_28_" class="st3" points="0,149.5 0,99.5 -43.3,74.5 -43.3,124.5  "/>
 <polygon id="XMLID_27_" class="st4" points="-43.3,74.5 -86.6,99.5 -86.6,149.5 -43.3,124.5  "/>
 <polygon id="XMLID_26_" class="st5" points="0,149.5 -43.3,124.5 -43.3,126.3 -43.3,124.5 -86.6,149.5 -43.3,174.5  "/>
 <polygon id="XMLID_25_" class="st6" points="43.3,224.5 43.3,174.5 0,149.5 0,199.4  "/>
 <polygon id="XMLID_24_" class="st7" points="0,199.4 0,199.5 -43.3,224.5 0,249.5 43.3,224.5 43.3,224.5  "/>
 <polygon id="XMLID_23_" class="st8" points="0,199.4 -1.1,198.8 0,199.4 0,149.5 -43.3,174.5 -43.3,224.5 0,199.5  "/>
</g>
<g id="XMLID_282_">
 <polygon id="XMLID_291_" class="st0" points="-86.6,0 -129.9,25 -129.9,74.5 -86.6,49.8  "/>
 <polygon id="XMLID_290_" class="st1" points="-86.6,49.8 -129.9,74.5 -129.9,75 -86.6,100 -43.3,75 -86.6,50  "/>
 <polygon id="XMLID_289_" class="st2" points="-86.6,0 -86.6,49.8 -84.5,48.6 -86.6,49.8 -86.6,50 -43.3,75 -43.3,25  "/>
 <polygon id="XMLID_288_" class="st3" points="0,0 0,-50 -43.3,-75 -43.3,-25  "/>
 <polygon id="XMLID_287_" class="st4" points="-43.3,-75 -86.6,-50 -86.6,0 -43.3,-25  "/>
 <polygon id="XMLID_286_" class="st5" points="0,0 -43.3,-25 -43.3,-23.2 -43.3,-25 -86.6,0 -43.3,25  "/>
 <polygon id="XMLID_285_" class="st6" points="43.3,75 43.3,25 0,0 0,49.9  "/>
 <polygon id="XMLID_284_" class="st7" points="0,49.9 0,50 -43.3,75 0,100 43.3,75 43.3,75  "/>
 <polygon id="XMLID_283_" class="st8" points="0,49.9 -1.1,49.3 0,49.9 0,0 -43.3,25 -43.3,75 0,50  "/>
</g>
<g id="XMLID_272_">
 <polygon id="XMLID_281_" class="st0" points="173.2,149.5 129.9,174.5 129.9,224 173.2,199.3  "/>
 <polygon id="XMLID_280_" class="st1" points="173.2,199.3 129.9,224 129.9,224.5 173.2,249.5 216.5,224.5 173.2,199.5  "/>
 <polygon id="XMLID_279_" class="st2" points="173.2,149.5 173.2,199.3 175.3,198.1 173.2,199.3 173.2,199.5 216.5,224.5
  216.5,174.5  "/>
 <polygon id="XMLID_278_" class="st3" points="259.8,149.5 259.8,99.5 216.5,74.5 216.5,124.5  "/>
 <polygon id="XMLID_277_" class="st4" points="216.5,74.5 173.2,99.5 173.2,149.5 216.5,124.5  "/>
 <polygon id="XMLID_276_" class="st5" points="259.8,149.5 216.5,124.5 216.5,126.3 216.5,124.5 173.2,149.5 216.5,174.5  "/>
 <polygon id="XMLID_275_" class="st6" points="303.1,224.5 303.1,174.5 259.8,149.5 259.8,199.4  "/>
 <polygon id="XMLID_274_" class="st7" points="259.8,199.4 259.8,199.5 216.5,224.5 259.8,249.5 303.1,224.5 303.1,224.5  "/>
 <polygon id="XMLID_273_" class="st8" points="259.8,199.4 258.7,198.8 259.8,199.4 259.8,149.5 216.5,174.5 216.5,224.5
  259.8,199.5  "/>
</g>
<g id="XMLID_102_">
 <polygon id="XMLID_111_" class="st0" points="433,0 389.7,25 389.7,74.5 433,49.8  "/>
 <polygon id="XMLID_110_" class="st1" points="433,49.8 389.7,74.5 389.7,75 433,100 476.3,75 433,50  "/>
 <polygon id="XMLID_109_" class="st2" points="433,0 433,49.8 435.1,48.6 433,49.8 433,50 476.3,75 476.3,25  "/>
 <polygon id="XMLID_108_" class="st3" points="519.6,0 519.6,-50 476.3,-75 476.3,-25  "/>
 <polygon id="XMLID_107_" class="st4" points="476.3,-75 433,-50 433,0 476.3,-25  "/>
 <polygon id="XMLID_106_" class="st5" points="519.6,0 476.3,-25 476.3,-23.2 476.3,-25 433,0 476.3,25  "/>
 <polygon id="XMLID_105_" class="st6" points="562.9,75 562.9,25 519.6,0 519.6,49.9  "/>
 <polygon id="XMLID_104_" class="st7" points="519.6,49.9 519.6,50 476.3,75 519.6,100 562.9,75 562.9,75  "/>
 <polygon id="XMLID_103_" class="st8" points="519.6,49.9 518.5,49.3 519.6,49.9 519.6,0 476.3,25 476.3,75 519.6,50  "/>
</g>
<g id="XMLID_82_">
 <polygon id="XMLID_91_" class="st0" points="562.9,-75 519.6,-50 519.6,-0.5 562.9,-25.3  "/>
 <polygon id="XMLID_90_" class="st1" points="562.9,-25.3 519.6,-0.5 519.6,0 562.9,25 606.2,0 562.9,-25  "/>
 <polygon id="XMLID_89_" class="st2" points="562.9,-75 562.9,-25.3 565,-26.5 562.9,-25.3 562.9,-25 606.2,0 606.2,-50  "/>
 <polygon id="XMLID_88_" class="st3" points="649.5,-75 649.5,-125 606.2,-150 606.2,-100  "/>
 <polygon id="XMLID_87_" class="st4" points="606.2,-150 562.9,-125 562.9,-75 606.2,-100  "/>
 <polygon id="XMLID_86_" class="st5" points="649.5,-75 606.2,-100 606.2,-98.2 606.2,-100 562.9,-75 606.2,-50  "/>
 <polygon id="XMLID_85_" class="st6" points="692.8,-0.1 692.8,-50 649.5,-75 649.5,-25.1  "/>
 <polygon id="XMLID_84_" class="st7" points="649.5,-25.1 649.5,-25 606.2,0 649.5,25 692.8,0 692.8,-0.1  "/>
 <polygon id="XMLID_83_" class="st8" points="649.5,-25.1 648.4,-25.7 649.5,-25.1 649.5,-75 606.2,-50 606.2,0 649.5,-25  "/>
</g>
<g id="XMLID_72_">
 <polygon id="XMLID_81_" class="st0" points="433,149.5 389.7,174.5 389.7,224 433,199.3  "/>
 <polygon id="XMLID_80_" class="st1" points="433,199.3 389.7,224 389.7,224.5 433,249.5 476.3,224.5 433,199.5  "/>
 <polygon id="XMLID_79_" class="st2" points="433,149.5 433,199.3 435.1,198.1 433,199.3 433,199.5 476.3,224.5 476.3,174.5  "/>
 <polygon id="XMLID_78_" class="st3" points="519.6,149.5 519.6,99.5 476.3,74.5 476.3,124.5  "/>
 <polygon id="XMLID_77_" class="st4" points="476.3,74.5 433,99.5 433,149.5 476.3,124.5  "/>
 <polygon id="XMLID_76_" class="st5" points="519.6,149.5 476.3,124.5 476.3,126.3 476.3,124.5 433,149.5 476.3,174.5  "/>
 <polygon id="XMLID_75_" class="st6" points="562.9,224.5 562.9,174.5 519.6,149.5 519.6,199.4  "/>
 <polygon id="XMLID_74_" class="st7" points="519.6,199.4 519.6,199.5 476.3,224.5 519.6,249.5 562.9,224.5 562.9,224.5  "/>
 <polygon id="XMLID_73_" class="st8" points="519.6,199.4 518.5,198.8 519.6,199.4 519.6,149.5 476.3,174.5 476.3,224.5
  519.6,199.5  "/>
</g>
<g id="XMLID_62_">
 <polygon id="XMLID_71_" class="st0" points="303.1,74.5 259.8,99.5 259.8,149 303.1,124.3  "/>
 <polygon id="XMLID_70_" class="st1" points="303.1,124.3 259.8,149 259.8,149.5 303.1,174.5 346.4,149.5 303.1,124.5  "/>
 <polygon id="XMLID_69_" class="st2" points="303.1,74.5 303.1,124.3 305.2,123.1 303.1,124.3 303.1,124.5 346.4,149.5 346.4,99.5
  "/>
 <polygon id="XMLID_68_" class="st3" points="389.7,74.5 389.7,24.5 346.4,-0.5 346.4,49.5  "/>
 <polygon id="XMLID_67_" class="st4" points="346.4,-0.5 303.1,24.5 303.1,74.5 346.4,49.5  "/>
 <polygon id="XMLID_66_" class="st5" points="389.7,74.5 346.4,49.5 346.4,51.3 346.4,49.5 303.1,74.5 346.4,99.5  "/>
 <polygon id="XMLID_65_" class="st6" points="433,149.5 433,99.5 389.7,74.5 389.7,124.4  "/>
 <polygon id="XMLID_64_" class="st7" points="389.7,124.4 389.7,124.5 346.4,149.5 389.7,174.5 433,149.5 433,149.5  "/>
 <polygon id="XMLID_63_" class="st8" points="389.7,124.4 388.6,123.8 389.7,124.4 389.7,74.5 346.4,99.5 346.4,149.5 389.7,124.5
  "/>
</g>
<g id="XMLID_52_">
 <polygon id="XMLID_61_" class="st0" points="303.1,-75 259.8,-50 259.8,-0.5 303.1,-25.2  "/>
 <polygon id="XMLID_60_" class="st1" points="303.1,-25.2 259.8,-0.5 259.8,0 303.1,25 346.4,0 303.1,-25  "/>
 <polygon id="XMLID_59_" class="st2" points="303.1,-75 303.1,-25.2 305.2,-26.4 303.1,-25.2 303.1,-25 346.4,0 346.4,-50  "/>
 <polygon id="XMLID_58_" class="st3" points="389.7,-75 389.7,-125 346.4,-150 346.4,-100  "/>
 <polygon id="XMLID_57_" class="st4" points="346.4,-150 303.1,-125 303.1,-75 346.4,-100  "/>
 <polygon id="XMLID_56_" class="st5" points="389.7,-75 346.4,-100 346.4,-98.2 346.4,-100 303.1,-75 346.4,-50  "/>
 <polygon id="XMLID_55_" class="st6" points="433,0 433,-50 389.7,-75 389.7,-25.1  "/>
 <polygon id="XMLID_54_" class="st7" points="389.7,-25.1 389.7,-25 346.4,0 389.7,25 433,0 433,0  "/>
 <polygon id="XMLID_53_" class="st8" points="389.7,-25.1 388.6,-25.7 389.7,-25.1 389.7,-75 346.4,-50 346.4,0 389.7,-25  "/>
</g>
<g id="XMLID_42_">
 <polygon id="XMLID_51_" class="st0" points="562.9,74.5 519.6,99.5 519.6,149 562.9,124.3  "/>
 <polygon id="XMLID_50_" class="st1" points="562.9,124.3 519.6,149 519.6,149.5 562.9,174.5 606.2,149.5 562.9,124.5  "/>
 <polygon id="XMLID_49_" class="st2" points="562.9,74.5 562.9,124.3 565,123.1 562.9,124.3 562.9,124.5 606.2,149.5 606.2,99.5
  "/>
 <polygon id="XMLID_48_" class="st3" points="649.5,74.5 649.5,24.5 606.2,-0.5 606.2,49.5  "/>
 <polygon id="XMLID_47_" class="st4" points="606.2,-0.5 562.9,24.5 562.9,74.5 606.2,49.5  "/>
 <polygon id="XMLID_46_" class="st5" points="649.5,74.5 606.2,49.5 606.2,51.3 606.2,49.5 562.9,74.5 606.2,99.5  "/>
 <polygon id="XMLID_45_" class="st6" points="692.8,149.5 692.8,99.5 649.5,74.5 649.5,124.4  "/>
 <polygon id="XMLID_44_" class="st7" points="649.5,124.4 649.5,124.5 606.2,149.5 649.5,174.5 692.8,149.5 692.8,149.5  "/>
 <polygon id="XMLID_43_" class="st8" points="649.5,124.4 648.4,123.8 649.5,124.4 649.5,74.5 606.2,99.5 606.2,149.5 649.5,124.5
  "/>
</g>
<g id="XMLID_182_">
 <polygon id="XMLID_191_" class="st0" points="303.1,375 259.8,400 259.8,449.6 303.1,424.8  "/>
 <polygon id="XMLID_190_" class="st1" points="303.1,424.8 259.8,449.6 259.8,450 303.1,475 346.4,450 303.1,425  "/>
 <polygon id="XMLID_189_" class="st2" points="303.1,375 303.1,424.8 305.2,423.6 303.1,424.8 303.1,425 346.4,450 346.4,400  "/>
 <polygon id="XMLID_188_" class="st3" points="389.7,375 389.7,325 346.4,300 346.4,350  "/>
 <polygon id="XMLID_187_" class="st4" points="346.4,300 303.1,325 303.1,375 346.4,350  "/>
 <polygon id="XMLID_186_" class="st5" points="389.7,375 346.4,350 346.4,351.8 346.4,350 303.1,375 346.4,400  "/>
 <polygon id="XMLID_185_" class="st6" points="433,450 433,400 389.7,375 389.7,425  "/>
 <polygon id="XMLID_184_" class="st7" points="389.7,425 389.7,425 346.4,450 389.7,475 433,450 433,450  "/>
 <polygon id="XMLID_183_" class="st8" points="389.7,425 388.6,424.3 389.7,425 389.7,375 346.4,400 346.4,450 389.7,425  "/>
</g>
<g id="XMLID_172_">
 <polygon id="XMLID_181_" class="st0" points="303.1,225 259.8,250 259.8,299.5 303.1,274.8  "/>
 <polygon id="XMLID_180_" class="st1" points="303.1,274.8 259.8,299.5 259.8,300 303.1,325 346.4,300 303.1,275  "/>
 <polygon id="XMLID_179_" class="st2" points="303.1,225 303.1,274.8 305.2,273.6 303.1,274.8 303.1,275 346.4,300 346.4,250  "/>
 <polygon id="XMLID_178_" class="st3" points="389.7,225 389.7,175 346.4,150 346.4,200  "/>
 <polygon id="XMLID_177_" class="st4" points="346.4,150 303.1,175 303.1,225 346.4,200  "/>
 <polygon id="XMLID_176_" class="st5" points="389.7,225 346.4,200 346.4,201.8 346.4,200 303.1,225 346.4,250  "/>
 <polygon id="XMLID_175_" class="st6" points="433,300 433,250 389.7,225 389.7,274.9  "/>
 <polygon id="XMLID_174_" class="st7" points="389.7,274.9 389.7,275 346.4,300 389.7,325 433,300 433,300  "/>
 <polygon id="XMLID_173_" class="st8" points="389.7,274.9 388.6,274.3 389.7,274.9 389.7,225 346.4,250 346.4,300 389.7,275  "/>
</g>
<g id="XMLID_162_">
 <polygon id="XMLID_171_" class="st0" points="433,300 389.7,325 389.7,374.5 433,349.8  "/>
 <polygon id="XMLID_170_" class="st1" points="433,349.8 389.7,374.5 389.7,375 433,400 476.3,375 433,350  "/>
 <polygon id="XMLID_169_" class="st2" points="433,300 433,349.8 435.1,348.6 433,349.8 433,350 476.3,375 476.3,325  "/>
 <polygon id="XMLID_168_" class="st3" points="519.6,300 519.6,250 476.3,225 476.3,275  "/>
 <polygon id="XMLID_167_" class="st4" points="476.3,225 433,250 433,300 476.3,275  "/>
 <polygon id="XMLID_166_" class="st5" points="519.6,300 476.3,275 476.3,276.8 476.3,275 433,300 476.3,325  "/>
 <polygon id="XMLID_165_" class="st6" points="562.9,375 562.9,325 519.6,300 519.6,349.9  "/>
 <polygon id="XMLID_164_" class="st7" points="519.6,349.9 519.6,350 476.3,375 519.6,400 562.9,375 562.9,375  "/>
 <polygon id="XMLID_163_" class="st8" points="519.6,349.9 518.5,349.3 519.6,349.9 519.6,300 476.3,325 476.3,375 519.6,350  "/>
</g>
<g id="XMLID_152_">
 <polygon id="XMLID_161_" class="st0" points="303.1,524.5 259.8,549.5 259.8,599.1 303.1,574.3  "/>
 <polygon id="XMLID_160_" class="st1" points="303.1,574.3 259.8,599.1 259.8,599.5 303.1,624.5 346.4,599.5 303.1,574.5  "/>
 <polygon id="XMLID_159_" class="st2" points="303.1,524.5 303.1,574.3 305.2,573.1 303.1,574.3 303.1,574.5 346.4,599.5
  346.4,549.5  "/>
 <polygon id="XMLID_158_" class="st3" points="389.7,524.5 389.7,474.5 346.4,449.5 346.4,499.5  "/>
 <polygon id="XMLID_157_" class="st4" points="346.4,449.5 303.1,474.5 303.1,524.5 346.4,499.5  "/>
 <polygon id="XMLID_156_" class="st5" points="389.7,524.5 346.4,499.5 346.4,501.3 346.4,499.5 303.1,524.5 346.4,549.5  "/>
 <polygon id="XMLID_155_" class="st6" points="433,599.5 433,549.5 389.7,524.5 389.7,574.5  "/>
 <polygon id="XMLID_154_" class="st7" points="389.7,574.5 389.7,574.5 346.4,599.5 389.7,624.5 433,599.5 433,599.5  "/>
 <polygon id="XMLID_153_" class="st8" points="389.7,574.5 388.6,573.8 389.7,574.5 389.7,524.5 346.4,549.5 346.4,599.5
  389.7,574.5  "/>
</g>
<g id="XMLID_142_">
 <polygon id="XMLID_151_" class="st0" points="173.2,449.5 129.9,474.5 129.9,524.1 173.2,499.3  "/>
 <polygon id="XMLID_150_" class="st1" points="173.2,499.3 129.9,524.1 129.9,524.5 173.2,549.5 216.5,524.5 173.2,499.5  "/>
 <polygon id="XMLID_149_" class="st2" points="173.2,449.5 173.2,499.3 175.3,498.1 173.2,499.3 173.2,499.5 216.5,524.5
  216.5,474.5  "/>
 <polygon id="XMLID_148_" class="st3" points="259.8,449.5 259.8,399.5 216.5,374.5 216.5,424.5  "/>
 <polygon id="XMLID_147_" class="st4" points="216.5,374.5 173.2,399.5 173.2,449.5 216.5,424.5  "/>
 <polygon id="XMLID_146_" class="st5" points="259.8,449.5 216.5,424.5 216.5,426.3 216.5,424.5 173.2,449.5 216.5,474.5  "/>
 <polygon id="XMLID_145_" class="st6" points="303.1,524.5 303.1,474.5 259.8,449.5 259.8,499.5  "/>
 <polygon id="XMLID_144_" class="st7" points="259.8,499.5 259.8,499.5 216.5,524.5 259.8,549.5 303.1,524.5 303.1,524.5  "/>
 <polygon id="XMLID_143_" class="st8" points="259.8,499.5 258.7,498.8 259.8,499.5 259.8,449.5 216.5,474.5 216.5,524.5
  259.8,499.5  "/>
</g>
<g id="XMLID_132_">
 <polygon id="XMLID_141_" class="st0" points="173.2,300 129.9,325 129.9,374.6 173.2,349.8  "/>
 <polygon id="XMLID_140_" class="st1" points="173.2,349.8 129.9,374.6 129.9,375 173.2,400 216.5,375 173.2,350  "/>
 <polygon id="XMLID_139_" class="st2" points="173.2,300 173.2,349.8 175.3,348.6 173.2,349.8 173.2,350 216.5,375 216.5,325  "/>
 <polygon id="XMLID_138_" class="st3" points="259.8,300 259.8,250 216.5,225 216.5,275  "/>
 <polygon id="XMLID_137_" class="st4" points="216.5,225 173.2,250 173.2,300 216.5,275  "/>
 <polygon id="XMLID_136_" class="st5" points="259.8,300 216.5,275 216.5,276.8 216.5,275 173.2,300 216.5,325  "/>
 <polygon id="XMLID_135_" class="st6" points="303.1,375 303.1,325 259.8,300 259.8,350  "/>
 <polygon id="XMLID_134_" class="st7" points="259.8,350 259.8,350 216.5,375 259.8,400 303.1,375 303.1,375  "/>
 <polygon id="XMLID_133_" class="st8" points="259.8,350 258.7,349.3 259.8,350 259.8,300 216.5,325 216.5,375 259.8,350  "/>
</g>
<g id="XMLID_112_">
 <polygon id="XMLID_121_" class="st0" points="433,449.5 389.7,474.5 389.7,524.1 433,499.3  "/>
 <polygon id="XMLID_120_" class="st1" points="433,499.3 389.7,524.1 389.7,524.5 433,549.5 476.3,524.5 433,499.5  "/>
 <polygon id="XMLID_119_" class="st2" points="433,449.5 433,499.3 435.1,498.1 433,499.3 433,499.5 476.3,524.5 476.3,474.5  "/>
 <polygon id="XMLID_118_" class="st3" points="519.6,449.5 519.6,399.5 476.3,374.5 476.3,424.5  "/>
 <polygon id="XMLID_117_" class="st4" points="476.3,374.5 433,399.5 433,449.5 476.3,424.5  "/>
 <polygon id="XMLID_116_" class="st5" points="519.6,449.5 476.3,424.5 476.3,426.3 476.3,424.5 433,449.5 476.3,474.5  "/>
 <polygon id="XMLID_115_" class="st6" points="562.9,524.5 562.9,474.5 519.6,449.5 519.6,499.5  "/>
 <polygon id="XMLID_114_" class="st7" points="519.6,499.5 519.6,499.5 476.3,524.5 519.6,549.5 562.9,524.5 562.9,524.5  "/>
 <polygon id="XMLID_113_" class="st8" points="519.6,499.5 518.5,498.8 519.6,499.5 519.6,449.5 476.3,474.5 476.3,524.5
  519.6,499.5  "/>
</g>
<g id="XMLID_252_">
 <polygon id="XMLID_261_" class="st0" points="-86.6,449.5 -129.9,474.5 -129.9,524.1 -86.6,499.3  "/>
 <polygon id="XMLID_260_" class="st1" points="-86.6,499.3 -129.9,524.1 -129.9,524.5 -86.6,549.5 -43.3,524.5 -86.6,499.5  "/>
 <polygon id="XMLID_259_" class="st2" points="-86.6,449.5 -86.6,499.3 -84.5,498.1 -86.6,499.3 -86.6,499.5 -43.3,524.5
  -43.3,474.5  "/>
 <polygon id="XMLID_258_" class="st3" points="0,449.5 0,399.5 -43.3,374.5 -43.3,424.5  "/>
 <polygon id="XMLID_257_" class="st4" points="-43.3,374.5 -86.6,399.5 -86.6,449.5 -43.3,424.5  "/>
 <polygon id="XMLID_256_" class="st5" points="0,449.5 -43.3,424.5 -43.3,426.3 -43.3,424.5 -86.6,449.5 -43.3,474.5  "/>
 <polygon id="XMLID_255_" class="st6" points="43.3,524.5 43.3,474.5 0,449.5 0,499.5  "/>
 <polygon id="XMLID_254_" class="st7" points="0,499.5 0,499.5 -43.3,524.5 0,549.5 43.3,524.5 43.3,524.5  "/>
 <polygon id="XMLID_253_" class="st8" points="0,499.5 -1.1,498.8 0,499.5 0,449.5 -43.3,474.5 -43.3,524.5 0,499.5  "/>
</g>

</svg>

Body:
It looks like the polygons have unique ids? For example: XMLID_121_

If so, maybe you could do something like this:
1) Put all of the polygon ids in an array
2) randomly visit a location in the array
3) do something with the element in that array location ("visit the polygon with that id", etc.)
4) extract the visited array element from the array
5) keep doing this until there are no elements left in the id array.

Here is a simple JavaScript program to that effect:

var polygonIds = [1, 2, 3, 4, 5]; //the order doesn't matter
while (polygonIds.length > 0) { //repeat until no more elements left
   var position = Math.floor(Math.random() * polygonIds.length); //choose random location
   var extracted = polygonIds[position]; //get that element
   alert(extracted); //do whatever you want to do with the extracted element
   polygonIds.splice(position, 1); //remove the element from array
}

Maybe there is a better way to do this.  But it seems reasonable, and it looks like you are using JavaScript.  So something like this might work for you.


问:
alert doesn't appear in localhost
The below code works fine in jsfiddle but when i run in the locahost, alert box doesn't appear while there is no error in the console too. What could be the reason. Can anyone help?

index.html

```<code><title>App</title>

<script type="text/javascript" src="movieList.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
</code>```

movieList.js

```<code>$(document).ready(function(){
    alert('something');
});
</code>```

答:
Try this:

```<code>$(function(){
    alert('something');
});
</code>```

.ready()

Title: alert doesn't appear in localhost

Body:
The below code works fine in jsfiddle but when i run in the locahost, alert box doesn't appear while there is no error in the console too. What could be the reason. Can anyone help?

index.html

<title>App</title>

movieList.js

$(document).ready(function(){
    alert('something');
});

Body:
Try this:

$(function(){
    alert('something');
});

.ready()


问:
Returning boolean if set is empty
I am struggling to find a more clean way of returning a boolean value if my set is empty at the end of my function

I take the intersection of two sets, and want to return True or False based on if the resulting set is empty.

```<code>def myfunc(a,b):
    c = a.intersection(b)
    #...return boolean here
</code>```

My initial thought was to do

```<code>return c is not None
</code>```

However, in my interpreter I can easily see that statement will return true if c = set([])

```<code>>>> c = set([])
>>> c is not None
True
</code>```

I've also tried all of the following:

```<code>>>> c == None
False
>>> c == False
False
>>> c is None
False
</code>```

Now I've read from the documentation that I can only use and, or, and not with empty sets to deduce a boolean value. So far, the only thing I can come up with is returning not not c

```<code>>>> not not c
False
>>> not c
True
</code>```

I have a feeling there is a much more pythonic way to do this, by I am struggling to find it. I don't want to return the actual set to an if statement because I don't need the values, I just want to know if they intersect.

答:
Not as clean as bool(c) but it was an excuse to use ternary.

```<code>def myfunc(a,b):
    return True if a.intersection(b) else False
</code>```

Also using a bit of the same logic there is no need to assign to c unless you are using it for something else.

```<code>def myfunc(a,b):
    return bool(a.intersection(b))
</code>```

Finally, I would assume you want a True / False value because you are going to perform some sort of boolean test with it. I would recommend skipping the overhead of a function call and definition by simply testing where you need it.

Instead of:

```<code>if (myfunc(a,b)):
    # Do something
</code>```

Maybe this:

```<code>if a.intersection(b):
    # Do something
</code>```

Title: Returning boolean if set is empty

Body:
I am struggling to find a more clean way of returning a boolean value if my set is empty at the end of my function

I take the intersection of two sets, and want to return True or False based on if the resulting set is empty.

def myfunc(a,b):
    c = a.intersection(b)
    #...return boolean here

My initial thought was to do

return c is not None

However, in my interpreter I can easily see that statement will return true if c = set([])

>>> c = set([])
>>> c is not None
True

I've also tried all of the following:

>>> c == None
False
>>> c == False
False
>>> c is None
False

Now I've read from the documentation that I can only use and, or, and not with empty sets to deduce a boolean value. So far, the only thing I can come up with is returning not not c

>>> not not c
False
>>> not c
True

I have a feeling there is a much more pythonic way to do this, by I am struggling to find it. I don't want to return the actual set to an if statement because I don't need the values, I just want to know if they intersect.

Body:
Not as clean as bool(c) but it was an excuse to use ternary.

def myfunc(a,b):
    return True if a.intersection(b) else False

Also using a bit of the same logic there is no need to assign to c unless you are using it for something else.

def myfunc(a,b):
    return bool(a.intersection(b))

Finally, I would assume you want a True / False value because you are going to perform some sort of boolean test with it. I would recommend skipping the overhead of a function call and definition by simply testing where you need it.

Instead of:

if (myfunc(a,b)):
    # Do something

Maybe this:

if a.intersection(b):
    # Do something


问:
rails don't calls the engine's controller
I am trying to define some helper methods to be used in the app's controller, but it seems that rails don't even call the controller. just for the test I have the following controller in my app/controllers/my_engine/application_controller.rb and as the documents say rails should find it first and an error should raise because THIS_SHOULD_PRODUCE_ERROR is unknown, but the rspec happily executing without any errors!

```<code>class ApplicationController <  ActionController::Base
  THIS_SHOULD_PRODUCE_ERROR
end
</code>```

I even tried to mimic the devise's way but the results are the same!

答:
I noticed that I have got things wrong, and the application_controller in the engine does not get applied to application_controller in the app! Also,   I couldn't figure out how the devise did it, but I have come up with the simple workaround for this:

```<code>require_relative 'controllers/helpers'

module Acu
  module Injectors
    class << self

      ActiveSupport::Notifications.subscribe "start_processing.action_controller" do |**args|
        eval((Acu::Configs.get :base_controller).to_s).class_eval do
          include Acu::Controllers::Helpers
        end
      end

    end
  end
end
</code>```

This will inject controller helpers to the user's base controller (which I get from the user, default: :ApplicationController) at the end of the class, which is perfect for me (but don't know how to add it to begging of the class if anyone needs it)

Body:
I am trying to define some helper methods to be used in the app's controller, but it seems that rails don't even call the controller. just for the test I have the following controller in my app/controllers/my_engine/application_controller.rb and as the documents say rails should find it first and an error should raise because THIS_SHOULD_PRODUCE_ERROR is unknown, but the rspec happily executing without any errors!

class ApplicationController <  ActionController::Base
  THIS_SHOULD_PRODUCE_ERROR
end

I even tried to mimic the devise's way but the results are the same!

Body:
I noticed that I have got things wrong, and the application_controller in the engine does not get applied to application_controller in the app! Also,   I couldn't figure out how the devise did it, but I have come up with the simple workaround for this:

require_relative 'controllers/helpers'

module Acu
  module Injectors
    class << self

      ActiveSupport::Notifications.subscribe "start_processing.action_controller" do |**args|
        eval((Acu::Configs.get :base_controller).to_s).class_eval do
          include Acu::Controllers::Helpers
        end
      end

    end
  end
end

This will inject controller helpers to the user's base controller (which I get from the user, default: :ApplicationController) at the end of the class, which is perfect for me (but don't know how to add it to begging of the class if anyone needs it)


问:
Firebase data taking ages to load in tableview swift 3
I have a tableview that loads data from Firebase, and on load it seems to take ages, around 10-15 seconds before any data is shown in the tableview.  it also appears thet the app is frozen while this data is loading.

my function for getting the data is:  this is called in viewDidLoad

```<code>  func getTrackData() {
    let result = FIRDatabase.database().reference(withPath: "tracks")
    result.observe(.value, with: { snapshot in
        var newItems: [newTracks] = []
        for item in snapshot.children {
            let trackDetails = newTracks(snapshot: item as! FIRDataSnapshot)
            newItems.append(trackDetails)
        }
        self.items = newItems
        self.items.sort(by: {$0.distance < $1.distance})
        self.tableView.reloadData()
    })

}
</code>```

and my tableview is as follows:

```<code>func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    if let cell = tableView.dequeueReusableCell(withIdentifier: "TrackCell", for: indexPath) as? TrackCell {

        let tr: newTracks!
        if inSearchMode {
            tr = filteredTrack[indexPath.row]
            cell.configureCell(track: tr)
        } else {
            tr = items[indexPath.row]
            cell.configureCell(track: tr)
        }
        cell.configureCell(track: tr)

        cell.completion = {
            let coordinate = CLLocationCoordinate2DMake(tr.lat,tr.lon)
            let mapItem = MKMapItem(placemark: MKPlacemark(coordinate: coordinate,addressDictionary:nil))
            mapItem.name = tr.name
            mapItem.openInMaps(launchOptions: [MKLaunchOptionsDirectionsModeKey :MKLaunchOptionsDirectionsModeDriving])
            return()
        }

        cell.completion1 = {
            let url = URL(string: tr.link)!
            if #available(iOS 10.0, *) {
                UIApplication.shared.open(url, options: [:], completionHandler: nil)
            } else {
                UIApplication.shared.open(url)
            }
            return()
        }
        return cell
    } else {
        return UITableViewCell()
    }
}
</code>```

My question is, is this code written ok, or is there a better way to do it.  I have a concern that my function is getting each item and then reloading the tableview, and this may be slowing things down significantly.  My data isnt massive, here is an example.

that shows 1 full record, there are 131 of those records in total.

答:
Figured this out now, I had a calculation for distance in miles from current location being worked out with each set of data being loaded.  This significantly slowed down the tableview population.

Just need to figure how to do this calculation now, but maybe after the data has loaded

Body:
I have a tableview that loads data from Firebase, and on load it seems to take ages, around 10-15 seconds before any data is shown in the tableview.  it also appears thet the app is frozen while this data is loading.

my function for getting the data is:  this is called in viewDidLoad

  func getTrackData() {
    let result = FIRDatabase.database().reference(withPath: "tracks")
    result.observe(.value, with: { snapshot in
        var newItems: [newTracks] = []
        for item in snapshot.children {
            let trackDetails = newTracks(snapshot: item as! FIRDataSnapshot)
            newItems.append(trackDetails)
        }
        self.items = newItems
        self.items.sort(by: {$0.distance < $1.distance})
        self.tableView.reloadData()
    })

}

and my tableview is as follows:

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    if let cell = tableView.dequeueReusableCell(withIdentifier: "TrackCell", for: indexPath) as? TrackCell {

        let tr: newTracks!
        if inSearchMode {
            tr = filteredTrack[indexPath.row]
            cell.configureCell(track: tr)
        } else {
            tr = items[indexPath.row]
            cell.configureCell(track: tr)
        }
        cell.configureCell(track: tr)

        cell.completion = {
            let coordinate = CLLocationCoordinate2DMake(tr.lat,tr.lon)
            let mapItem = MKMapItem(placemark: MKPlacemark(coordinate: coordinate,addressDictionary:nil))
            mapItem.name = tr.name
            mapItem.openInMaps(launchOptions: [MKLaunchOptionsDirectionsModeKey :MKLaunchOptionsDirectionsModeDriving])
            return()
        }

        cell.completion1 = {
            let url = URL(string: tr.link)!
            if #available(iOS 10.0, *) {
                UIApplication.shared.open(url, options: [:], completionHandler: nil)
            } else {
                UIApplication.shared.open(url)
            }
            return()
        }
        return cell
    } else {
        return UITableViewCell()
    }
}

My question is, is this code written ok, or is there a better way to do it.  I have a concern that my function is getting each item and then reloading the tableview, and this may be slowing things down significantly.  My data isnt massive, here is an example.

that shows 1 full record, there are 131 of those records in total.


问:
global variables on mbed uvisor
I have an aplication running on a K64F board with ARM Mbed OS. I takes advantage of the RTOS capabilities and is runnign some different threads to perform various actions. Communication between threads is done using queues defined as global variables on the first part of the code (as defined in the RTOS examples).

```<code>MemoryPool<cMsg, 16> NMPool;
Queue<cMsg, 16> NMQueue;
</code>```

This way every thread can access the queue.

I want to convert these threads to uvisor isolated boxes. I have succesfully run independent threads this way but I have found no way of sharing common variables among diferent boxes. I have found no reference on how to make available the variables to the code defined in the box files that are compiled as a single project using uvisor. Any idea, example or help?

答:
You cannot share memory between boxes, uVisor boxes run in isolated memory spaces (which is the whole point of using uVisor).

The only way to communicate between boxes is through RPC channels. See this article under the 'Expose public secure entry points to the secure box' section.

I think you can only pass primitives and struct's (because they're fixed size) over the RPC channel, but that's worth an experiment.

Title: global variables on mbed uvisor

Body:
I have an aplication running on a K64F board with ARM Mbed OS. I takes advantage of the RTOS capabilities and is runnign some different threads to perform various actions. Communication between threads is done using queues defined as global variables on the first part of the code (as defined in the RTOS examples).

MemoryPool<cMsg, 16> NMPool;
Queue<cMsg, 16> NMQueue;

This way every thread can access the queue.

I want to convert these threads to uvisor isolated boxes. I have succesfully run independent threads this way but I have found no way of sharing common variables among diferent boxes. I have found no reference on how to make available the variables to the code defined in the box files that are compiled as a single project using uvisor. Any idea, example or help?


问:
How to print the first n lines of file?
I'm sure I'm missing something obvious and probably asked before but I can't seem to get the right combination of keywords together to give me an answer.

How can I write out the first n lines of a file (in effect, the opposite of file.readlines()[0:10])?

e.g. I have a function that takes in an input file, and needs to process information from the latter part, throwing out a header. However I want to keep the multi-line header, to be put back in to an output file.

```<code>def readInfile(infile):

    with open(infile, 'r') as ifh:
        # Skip exta info at top of file
        header = ifh.readline()[0:10] # Keep the header for later?

        noheader = ifh.readlines()[11:]
        for line in noheader:
        # Do the useful stuff
            usefulstuff = foo()

return usefulstuff, header
</code>```

Then later I want to write out in the format of the input file, using their header:

```<code>print(header)
for thing in usefulstuff:
   print(thing)
</code>```

Is there a method I'm missing, or is readlines no good for this as it returns a list?

I assumed

```<code>for line in header:
     print(line)
</code>```

would work, but it doesn't seem to in this case - so I must be doing something wrong?

EDIT

Why does trying to use readlines()[] twice fail for the second range?

I fixed the code as @pbuck pointed out, that the header line should have been readlines() not readline but now the noheader variable is empty? Do I really have to open the file twice?!

答:
Literally, read first n lines, then stop.</p>

```<code>def read_first_lines(filename, limit):
  result = []
  with open(filename, 'r') as input_file:
    # files are iterable, you can have a for-loop over a file.
    for line_number, line in enumerate(input_file):
      if line_number > limit:  # line_number starts at 0.
        break
      result.append(line)
  return result
</code>```

Title: How to print the first n lines of file?

Body:
I'm sure I'm missing something obvious and probably asked before but I can't seem to get the right combination of keywords together to give me an answer.

How can I write out the first n lines of a file (in effect, the opposite of file.readlines()[0:10])?

e.g. I have a function that takes in an input file, and needs to process information from the latter part, throwing out a header. However I want to keep the multi-line header, to be put back in to an output file.

def readInfile(infile):

    with open(infile, 'r') as ifh:
        # Skip exta info at top of file
        header = ifh.readline()[0:10] # Keep the header for later?

        noheader = ifh.readlines()[11:]
        for line in noheader:
        # Do the useful stuff
            usefulstuff = foo()

return usefulstuff, header

Then later I want to write out in the format of the input file, using their header:

print(header)
for thing in usefulstuff:
   print(thing)

Is there a method I'm missing, or is readlines no good for this as it returns a list?

I assumed

for line in header:
     print(line)

would work, but it doesn't seem to in this case - so I must be doing something wrong?

EDIT

Why does trying to use readlines()[] twice fail for the second range?

I fixed the code as @pbuck pointed out, that the header line should have been readlines() not readline but now the noheader variable is empty? Do I really have to open the file twice?!

Body:
Literally, read first n lines, then stop.

def read_first_lines(filename, limit):
  result = []
  with open(filename, 'r') as input_file:
    # files are iterable, you can have a for-loop over a file.
    for line_number, line in enumerate(input_file):
      if line_number > limit:  # line_number starts at 0.
        break
      result.append(line)
  return result


问:
Select element grows differently than input in display flex
I'm getting an unexpected behavior in my setup. The inputs grow horizontally as expected but on the row with a select control, the growth seems to be distorted.

I suspected some style to be different but a close inspection led me nowhere. Googling gave nothing and I can't find anything about implicit margin nor padding for selects.

What is this about and how do I kill it?

div.full-page {
  margin: 20px;
  padding: 20px;
  background: ghostwhite;
}

div.input-section {
  border: 3px none darkorchid;
  width: 600px;
}

div.input-title {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: bold;
  font-size: 18px;
  border-bottom: 2px solid darkorange;
  padding-bottom: 5px;
}

div.input-row {
  border: 3px none darkolivegreen;
  display: flex;
}

div.input-element {
  border: 3px none darkcyan;
  padding: 10px;
  flex-grow: 1;
  // display:flex;
}

div.input-element input,
div.input-element select {
  width: 100%;
  // border: solid 1px mediumvioletred;
  // padding: 0;
  // margin: 0;
}

div.input-caption {
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  color: darkgrey;
  font-size: 14px;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div class="full-page">

  <div>

    <div class="input-section">
      <div class="input-title">Title 1</div>

      <div class="input-row">
        <div class="input-element">
          <div class="input-caption">Uno</div>
          <input type="text" placeholder="Konrad">
        </div>
        <div class="input-element">
          <div class="input-caption">Duo</div>
          <input type="text" placeholder="Viltersten">
        </div>
      </div>

    </div>

    <div #privs class="input-section">
      <div class="input-title">Title 2</div>

      <div class="input-row">
        <div class="input-element">
          <div class="input-caption">Tress</div>
          <input placeholder="Is really">
        </div>

        <div class="input-element">
          <div class="input-caption">Quatro</div>
          <select>
            <option>The one and only</option>
          </select>
        </div>
      </div>

    </div>

</div></code>```

答: If you want all the flex-items to be the same length, you should use the css 'flex' property, so just set div.input-element to flex:1.</p>

Body:
I'm getting an unexpected behavior in my setup. The inputs grow horizontally as expected but on the row with a select control, the growth seems to be distorted.

I suspected some style to be different but a close inspection led me nowhere. Googling gave nothing and I can't find anything about implicit margin nor padding for selects.

What is this about and how do I kill it?

div.full-page {
  margin: 20px;
  padding: 20px;
  background: ghostwhite;
}

div.input-section {
  border: 3px none darkorchid;
  width: 600px;
}

div.input-title {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: bold;
  font-size: 18px;
  border-bottom: 2px solid darkorange;
  padding-bottom: 5px;
}

div.input-row {
  border: 3px none darkolivegreen;
  display: flex;
}

div.input-element {
  border: 3px none darkcyan;
  padding: 10px;
  flex-grow: 1;
  // display:flex;
}

div.input-element input,
div.input-element select {
  width: 100%;
  // border: solid 1px mediumvioletred;
  // padding: 0;
  // margin: 0;
}

div.input-caption {
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  color: darkgrey;
  font-size: 14px;
}

Title 1

Uno

          <input type="text" placeholder="Konrad">

Duo

          <input type="text" placeholder="Viltersten">

Title 2

Tress

          <input placeholder="Is really">

Quatro

          <select>
            <option>The one and only</option>
          </select>


问:
Laravel CRUD delete not working on foreign key
I have a foreign relationship with category_id column in database but while deleting i get error.
This is my code for delete:

```<code>  public function destroy($id)
{
    $category = Category::find($id);
    $category->delete();
    Session::flash('success', 'The category was successfully deleted.');
    return redirect()->route('categories.index');
}
</code>```

Error i seen is :

```<code>SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`fitilicious`.`products`, CONSTRAINT `products_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`)) (SQL: delete from `categories` where `id` = 2)
</code>```

Please help.

答:
My bet is on the foreign key being set to ON DELETE RESTRICT instead of CASCADE.

Cannot delete or update a parent row: a foreign key constraint fails (fitilicious.products, CONSTRAINT products_category_id_foreign FOREIGN KEY (category_id) REFERENCES categories (id)) (SQL: delete from categories where id = 2)

This tells us that there is a row in table "products" which is referencing the category you are attempting to delete.

ON DELETE CASCADE will also delete the product.

ON DELETE RESTRICT will prevent deletion of a non-empty category

ON DELETE SET NULL will delete the category and set category_id to NULL in products table

Each has its uses, but you need to choose which one you need.

Body:
I have a foreign relationship with category_id column in database but while deleting i get error.
This is my code for delete:

  public function destroy($id)
{
    $category = Category::find($id);
    $category->delete();
    Session::flash('success', 'The category was successfully deleted.');
    return redirect()->route('categories.index');
}

Error i seen is :

SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`fitilicious`.`products`, CONSTRAINT `products_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`)) (SQL: delete from `categories` where `id` = 2)

Please help.