问:
MSBuild cannot find a reference - ReactJs.NET
After upgrading Newtonsoft.Json to version 9.0.0 and ReactJS.Net packages to 2.5.0, the TransformBabel.proj stopped working:

```<code>  <?xml version="1.0" encoding="utf-8" ?>
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="TransformBabel">
      <!-- ReactJS.NET - Transpile JavaScript via Babel -->
      <UsingTask AssemblyFile="$(OutputPath)\React.MSBuild.dll" TaskName="TransformBabel" />
      <Target Name="TransformBabel">
          <TransformBabel SourceDir="$(MSBuildProjectDirectory)" />
      </Target>
  </Project>
</code>```

Returning the following:

```<code>TransformBabel.proj(6, 3): error MSB4018: The "TransformBabel" task failed unexpectedly.
[Exec] TransformBabel.proj(6, 3): error MSB4018: React.TinyIoC.TinyIoCResolutionException: Unable to resolve type: React.IReactSiteConfiguration ---> System.TypeInitializationException: The type initializer for 'React.ReactSiteConfiguration' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.
</code>```

It seems that it cannot load the Newtonsoft 6.0.0.0 version. The web.config has an assembly redirection:

```<code>  <dependentAssembly>
    <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
  </dependentAssembly>
</code>```

But I am not sure that, as it is starting a new msbuild process, if it is being ignored. I would like to hint msbuild the location of the assembly, but no success until now.

答:
A bit late to the party here, but hopefully my experience will help to anyone else having the same problem.

I have recently experienced the same issue with React.MSBuild 3.1.0. It seems that it has hardcoded a specific version as I have updated my Newtonsoft.Json to the latest (10.0.3) using NuGet and set redirection correctly, but the build kept failing on the same error as you have mentioned.

What I did is simply uninstall all the React packages (MSBuild and Core) and also Newtonsoft.Json (using -force as there were other dependencies) and then let NuGet install the React.MSBuild again. It has installed it with all dependencies what resulted in obtaining Newtonsoft.Json 9.0.1.

Not sure why do they restrict Newtonsoft.Json library to a specific version, but it is more a question to React developers. Unless you need a latest (or other specific version of it), this should fix the problem.

Body:
After upgrading Newtonsoft.Json to version 9.0.0 and ReactJS.Net packages to 2.5.0, the TransformBabel.proj stopped working:

  <?xml version="1.0" encoding="utf-8" ?>
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="TransformBabel">

      <UsingTask AssemblyFile="$(OutputPath)\React.MSBuild.dll" TaskName="TransformBabel" />
      <Target Name="TransformBabel">
          <TransformBabel SourceDir="$(MSBuildProjectDirectory)" />
      </Target>
  </Project>

Returning the following:

TransformBabel.proj(6, 3): error MSB4018: The "TransformBabel" task failed unexpectedly.
[Exec] TransformBabel.proj(6, 3): error MSB4018: React.TinyIoC.TinyIoCResolutionException: Unable to resolve type: React.IReactSiteConfiguration ---> System.TypeInitializationException: The type initializer for 'React.ReactSiteConfiguration' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.

It seems that it cannot load the Newtonsoft 6.0.0.0 version. The web.config has an assembly redirection:

  <dependentAssembly>
    <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
  </dependentAssembly>

But I am not sure that, as it is starting a new msbuild process, if it is being ignored. I would like to hint msbuild the location of the assembly, but no success until now.


来源: stackexchange

问:
Change element ID using Javascript?

  Content

```

How would I change the ID of this div using Javascript?

答:
You can replace a
 element's ID with .setAttribute("id", "newID"). This replaces the ID attribute of the target element with the value specified in the second parameter.

Here's an example showcasing this, changing the ID original to modified, and logging the change to the console:

console.log(document.getElementById("original").id);
document.getElementById("original").setAttribute("id", "modified");
console.log(document.getElementById("modified").id); // The same element```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div id="original">
  Content
</div></code>```

Note that you have to re-target with document.getElementById("modified") once the change has been applied.

Hope this helps! :)

ContentLicense: CC BY-SA 3.0

Title: Change element ID using Javascript?

Body:
  Content

How would I change the ID of this div using Javascript?

Body:
You can replace a <div> element's ID with .setAttribute("id", "newID"). This replaces the ID attribute of the target element with the value specified in the second parameter.

Here's an example showcasing this, changing the ID original to modified, and logging the change to the console:

console.log(document.getElementById("original").id);
document.getElementById("original").setAttribute("id", "modified");
console.log(document.getElementById("modified").id); // The same element

<div id="original">
  Content
</div>

Note that you have to re-target with document.getElementById("modified") once the change has been applied.

Hope this helps! :)


问:
what mean by this parameters in euclidean hash family?
in euclidean hash family library in java i do not understand  parameters w and if there is relation between choice the value of w and value of dimension.

```<code>public EuclidianHashFamily(int w,int dimensions){
        this.dimensions = dimensions;
        this.w=w;
</code>```

i want to know what mean by this integers to know what values assign to it.

```<code>public EuclideanHash(int dimensions,int w){
        Random rand = new Random();
        this.w = w;
        this.offset = rand.nextInt(w);

        randomProjection = new Vector(dimensions);
        for(int d=0; d<dimensions; d++) {
            //mean 0
            //standard deviation 1.0
            double val = rand.nextGaussian();
            randomProjection.set(d, val);
</code>```

答:
A bit of web search leading to me quoting Wikipedia:

One of the main applications of LSH is to provide a method for efficient approximate nearest neighbor search algorithms. Consider an LSH family . The algorithm has two main parameters: the width parameter k and the number of hash tables L.

So, w is the width.

Body:
in euclidean hash family library in java i do not understand  parameters w and if there is relation between choice the value of w and value of dimension.

public EuclidianHashFamily(int w,int dimensions){
        this.dimensions = dimensions;
        this.w=w;

i want to know what mean by this integers to know what values assign to it.

public EuclideanHash(int dimensions,int w){
        Random rand = new Random();
        this.w = w;
        this.offset = rand.nextInt(w);

        randomProjection = new Vector(dimensions);
        for(int d=0; d<dimensions; d++) {
            //mean 0
            //standard deviation 1.0
            double val = rand.nextGaussian();
            randomProjection.set(d, val);


问:
Yield Request call produce weird result in recursive method with scrapy
I'm trying to scrap all departures and arrivals in one day from all airports in all country using Python and Scrapy.

The JSON database used by this famous site (flight radar) need to query page by page when departure or arrival is > 100 in one airport. I also compute a timestamp based on an actual day UTC for the query.

I try to create a database with this hierarchy:

```<code>country 1
 - airport 1
    - departures
      - page 1
      - page ...
    - arrivals
      - page 1
      - page ...
- airport 2
    - departures
      - page 1
      - page ...
    - arrivals
      - page
      - page ...
...
</code>```

I use two methods to compute timestamp and url query by page :

```<code>def compute_timestamp(self):
    from datetime import datetime, date
    import calendar
    # +/- 24 heures
    d = date(2017, 4, 27)
    timestamp = calendar.timegm(d.timetuple())
    return timestamp

def build_api_call(self,code,page,timestamp):
    return 'https://api.flightradar24.com/common/v1/airport.json?code={code}&plugin\[\]=&plugin-setting\[schedule\]\[mode\]=&plugin-setting\[schedule\]\[timestamp\]={timestamp}&page={page}&limit=100&token='.format(
        code=code, page=page, timestamp=timestamp)
</code>```

I store result into CountryItem, which contain lots of AirportItem into airports. My item.py is :

```<code>class CountryItem(scrapy.Item):
    name = scrapy.Field()
    link = scrapy.Field()
    num_airports = scrapy.Field()
    airports = scrapy.Field()
    other_url= scrapy.Field()
    last_updated = scrapy.Field(serializer=str)

class AirportItem(scrapy.Item):
    name = scrapy.Field()
    code_little = scrapy.Field()
    code_total = scrapy.Field()
    lat = scrapy.Field()
    lon = scrapy.Field()
    link = scrapy.Field()
    departures = scrapy.Field()
    arrivals = scrapy.Field()
</code>```

My main parse builds a Country item for all countries (i limit here to Israel for example). Next, I yield for each country a scrapy.Request to scrape airports.

```<code>###################################
# MAIN PARSE
####################################
def parse(self, response):
    count_country = 0
    countries = []
    for country in response.xpath('//a[@data-country]'):
        item = CountryItem()
        url =  country.xpath('./@href').extract()
        name = country.xpath('./@title').extract()
        item['link'] = url[0]
        item['name'] = name[0]
        item['airports'] = []
        count_country += 1
        if name[0] == "Israel":
            countries.append(item)
            self.logger.info("Country name : %s with link %s" , item['name'] , item['link'])
            yield scrapy.Request(url[0],meta={'my_country_item':item}, callback=self.parse_airports)
</code>```

This method scrape information for each airport, and also call for each airport a scrapy.request with airport url to scrape departures and arrivals :

```<code>  ###################################
# PARSE EACH AIRPORT
####################################
def parse_airports(self, response):
    item = response.meta['my_country_item']
    item['airports'] = []

    for airport in response.xpath('//a[@data-iata]'):
        url = airport.xpath('./@href').extract()
        iata = airport.xpath('./@data-iata').extract()
        iatabis = airport.xpath('./small/text()').extract()
        name = ''.join(airport.xpath('./text()').extract()).strip()
        lat = airport.xpath("./@data-lat").extract()
        lon = airport.xpath("./@data-lon").extract()
        iAirport = AirportItem()
        iAirport['name'] = self.clean_html(name)
        iAirport['link'] = url[0]
        iAirport['lat'] = lat[0]
        iAirport['lon'] = lon[0]
        iAirport['code_little'] = iata[0]
        iAirport['code_total'] = iatabis[0]

        item['airports'].append(iAirport)

    urls = []
    for airport in item['airports']:
        json_url = self.build_api_call(airport['code_little'], 1, self.compute_timestamp())
        urls.append(json_url)
    if not urls:
        return item

    # start with first url
    next_url = urls.pop()
    return scrapy.Request(next_url, self.parse_schedule, meta={'airport_item': item, 'airport_urls': urls, 'i': 0})
</code>```

With the recursive method parse_schedule i add each airport to country item. SO members already help me on this point.

```<code>###################################
# PARSE EACH AIRPORT OF COUNTRY
###################################
def parse_schedule(self, response):
        """we want to loop this continuously to build every departure and arrivals requests"""
        item = response.meta['airport_item']
        i = response.meta['i']
        urls = response.meta['airport_urls']

        urls_departures, urls_arrivals = self.compute_urls_by_page(response, item['airports'][i]['name'], item['airports'][i]['code_little'])

        print("urls_departures = ", len(urls_departures))
        print("urls_arrivals = ", len(urls_arrivals))

        ## YIELD NOT CALLED
        yield scrapy.Request(response.url, self.parse_departures_page, meta={'airport_item': item, 'page_urls': urls_departures, 'i':0 , 'p': 0}, dont_filter=True)

        # now do next schedule items
        if not urls:
            yield item
            return
        url = urls.pop()

        yield scrapy.Request(url, self.parse_schedule, meta={'airport_item': item, 'airport_urls': urls, 'i': i + 1})
</code>```

the self.compute_urls_by_page method compute correct URLs to retrieve all departure and arrivals for one airport.

```<code>###################################
# PARSE EACH DEPARTURES / ARRIVALS
###################################
def parse_departures_page(self, response):
    item = response.meta['airport_item']
    p = response.meta['p']
    i = response.meta['i']
    page_urls = response.meta['page_urls']

    print("PAGE URL = ", page_urls)

    if not page_urls:
        yield item
        return
    page_url = page_urls.pop()

    print("GET PAGE FOR  ", item['airports'][i]['name'], ">> ", p)

    jsonload = json.loads(response.body_as_unicode())
    json_expression = jmespath.compile("result.response.airport.pluginData.schedule.departures.data")
    item['airports'][i]['departures'] = json_expression.search(jsonload)

    yield scrapy.Request(page_url, self.parse_departures_page, meta={'airport_item': item, 'page_urls': page_urls, 'i': i, 'p': p + 1})
</code>```

Next, the first yield in parse_schedule which normally call self.parse_departure_page recursive method produces weird results. Scrapy call this method, but I collect the departures page for only one airport i don't understand why... I have probably an ordering error in my request or yield source code, so perhaps you could help me to find out.

The complete code is on GitHub https://github.com/IDEES-Rouen/Flight-Scrapping/tree/master/flight/flight_project

You could run it using scrapy cawl airports commands.

Update 1 :

I try to answer the question alone using yield from, without success as you can see answer bottom ... so if you have an idea?

答:
I tried cloning locally and investigate a little better, but when it gets to the departure parsing I got some ConnectionRefused error so I am not sure my proposed answer will fix it, anyhow:

```<code>###################################
# PARSE EACH AIRPORT OF COUNTRY
###################################
def parse_schedule(self, response):
    """we want to loop this continuously to build every departure and arrivals requests"""
    item = response.meta['airport_item']
    i = response.meta['i']
    urls = response.meta['airport_urls']

    urls_departures, urls_arrivals = self.compute_urls_by_page(response, item['airports'][i]['name'], item['airports'][i]['code_little'])

    if 'urls_departures' in response.meta:
        urls_departures += response.meta["urls_departures"]

    if 'urls_arrivals' in response.meta:
        urls_arrivals += response.meta["urls_arrivals"]

    print("urls_departures = ", len(urls_departures))
    print("urls_arrivals = ", len(urls_arrivals))
    item['airports'][i]['departures'] = []

    # now do next schedule items
    if not urls:
        yield scrapy.Request(urls_departures.pop(), self.parse_departures_page, meta={'airport_item': item, 'page_urls': urls_departures, 'i':i , 'p': 0}, dont_filter=True)
    else:
        url = urls.pop()

        yield scrapy.Request(url, self.parse_schedule, meta={'airport_item': item, 'airport_urls': urls, 'i': i + 1, 'urls_departures': urls_departures, 'urls_arrivals': urls_arrivals})

###################################
# PARSE EACH DEPARTURES / ARRIVALS
###################################
def parse_departures_page(self, response):
    item = response.meta['airport_item']
    p = response.meta['p']
    i = response.meta['i']
    page_urls = response.meta['page_urls']

    jsonload = json.loads(response.body_as_unicode())
    json_expression = jmespath.compile("result.response.airport.pluginData.schedule.departures.data")

    # Append a new page
    item['airports'][i]['departures'].append(json_expression.search(jsonload))

    if len(page_urls) > 0:
        page_url = page_urls.pop()

        yield scrapy.Request(page_url, self.parse_departures_page, meta={'airport_item': item, 'page_urls': page_urls, 'i': i, 'p': p + 1}, dont_filter=True)
    else:
        yield item
</code>```

But basically these are your mistakes:

In your parse_schedule and on your parse_departures_page you have conditions for yielding the final item;

You are passing the wrong url to parse_departures_page;

You need dont_filter=True on parse_departures_page;

You are trying to keep a lot of loops for parsing more information to the same object

My proposed changes will keep track of all urls_departures on this airport so that you can iterate over then on parse_departures_page and should fix your problem.

Even if this fix your problem I REALLY recommend you change your data structure so that you can have multiple items for departures and be able to extract this information more efficiently.

Body:
I'm trying to scrap all departures and arrivals in one day from all airports in all country using Python and Scrapy.

The JSON database used by this famous site (flight radar) need to query page by page when departure or arrival is > 100 in one airport. I also compute a timestamp based on an actual day UTC for the query.

I try to create a database with this hierarchy:

country 1
 - airport 1
    - departures
      - page 1
      - page ...
    - arrivals
      - page 1
      - page ...
- airport 2
    - departures
      - page 1
      - page ...
    - arrivals
      - page
      - page ...
...

I use two methods to compute timestamp and url query by page :

def compute_timestamp(self):
    from datetime import datetime, date
    import calendar
    # +/- 24 heures
    d = date(2017, 4, 27)
    timestamp = calendar.timegm(d.timetuple())
    return timestamp

def build_api_call(self,code,page,timestamp):
    return 'https://api.flightradar24.com/common/v1/airport.json?code={code}&plugin\[\]=&plugin-setting\[schedule\]\[mode\]=&plugin-setting\[schedule\]\[timestamp\]={timestamp}&page={page}&limit=100&token='.format(
        code=code, page=page, timestamp=timestamp)

I store result into CountryItem, which contain lots of AirportItem into airports. My item.py is :

class CountryItem(scrapy.Item):
    name = scrapy.Field()
    link = scrapy.Field()
    num_airports = scrapy.Field()
    airports = scrapy.Field()
    other_url= scrapy.Field()
    last_updated = scrapy.Field(serializer=str)

class AirportItem(scrapy.Item):
    name = scrapy.Field()
    code_little = scrapy.Field()
    code_total = scrapy.Field()
    lat = scrapy.Field()
    lon = scrapy.Field()
    link = scrapy.Field()
    departures = scrapy.Field()
    arrivals = scrapy.Field()

My main parse builds a Country item for all countries (i limit here to Israel for example). Next, I yield for each country a scrapy.Request to scrape airports.

###################################
# MAIN PARSE
####################################
def parse(self, response):
    count_country = 0
    countries = []
    for country in response.xpath('//a[@data-country]'):
        item = CountryItem()
        url =  country.xpath('./@href').extract()
        name = country.xpath('./@title').extract()
        item['link'] = url[0]
        item['name'] = name[0]
        item['airports'] = []
        count_country += 1
        if name[0] == "Israel":
            countries.append(item)
            self.logger.info("Country name : %s with link %s" , item['name'] , item['link'])
            yield scrapy.Request(url[0],meta={'my_country_item':item}, callback=self.parse_airports)

This method scrape information for each airport, and also call for each airport a scrapy.request with airport url to scrape departures and arrivals :

  ###################################
# PARSE EACH AIRPORT
####################################
def parse_airports(self, response):
    item = response.meta['my_country_item']
    item['airports'] = []

    for airport in response.xpath('//a[@data-iata]'):
        url = airport.xpath('./@href').extract()
        iata = airport.xpath('./@data-iata').extract()
        iatabis = airport.xpath('./small/text()').extract()
        name = ''.join(airport.xpath('./text()').extract()).strip()
        lat = airport.xpath("./@data-lat").extract()
        lon = airport.xpath("./@data-lon").extract()
        iAirport = AirportItem()
        iAirport['name'] = self.clean_html(name)
        iAirport['link'] = url[0]
        iAirport['lat'] = lat[0]
        iAirport['lon'] = lon[0]
        iAirport['code_little'] = iata[0]
        iAirport['code_total'] = iatabis[0]

        item['airports'].append(iAirport)

    urls = []
    for airport in item['airports']:
        json_url = self.build_api_call(airport['code_little'], 1, self.compute_timestamp())
        urls.append(json_url)
    if not urls:
        return item

    # start with first url
    next_url = urls.pop()
    return scrapy.Request(next_url, self.parse_schedule, meta={'airport_item': item, 'airport_urls': urls, 'i': 0})

With the recursive method parse_schedule i add each airport to country item. SO members already help me on this point.

###################################
# PARSE EACH AIRPORT OF COUNTRY
###################################
def parse_schedule(self, response):
        """we want to loop this continuously to build every departure and arrivals requests"""
        item = response.meta['airport_item']
        i = response.meta['i']
        urls = response.meta['airport_urls']

        urls_departures, urls_arrivals = self.compute_urls_by_page(response, item['airports'][i]['name'], item['airports'][i]['code_little'])

        print("urls_departures = ", len(urls_departures))
        print("urls_arrivals = ", len(urls_arrivals))

        ## YIELD NOT CALLED
        yield scrapy.Request(response.url, self.parse_departures_page, meta={'airport_item': item, 'page_urls': urls_departures, 'i':0 , 'p': 0}, dont_filter=True)

        # now do next schedule items
        if not urls:
            yield item
            return
        url = urls.pop()

        yield scrapy.Request(url, self.parse_schedule, meta={'airport_item': item, 'airport_urls': urls, 'i': i + 1})

the self.compute_urls_by_page method compute correct URLs to retrieve all departure and arrivals for one airport.

###################################
# PARSE EACH DEPARTURES / ARRIVALS
###################################
def parse_departures_page(self, response):
    item = response.meta['airport_item']
    p = response.meta['p']
    i = response.meta['i']
    page_urls = response.meta['page_urls']

    print("PAGE URL = ", page_urls)

    if not page_urls:
        yield item
        return
    page_url = page_urls.pop()

    print("GET PAGE FOR  ", item['airports'][i]['name'], ">> ", p)

    jsonload = json.loads(response.body_as_unicode())
    json_expression = jmespath.compile("result.response.airport.pluginData.schedule.departures.data")
    item['airports'][i]['departures'] = json_expression.search(jsonload)

    yield scrapy.Request(page_url, self.parse_departures_page, meta={'airport_item': item, 'page_urls': page_urls, 'i': i, 'p': p + 1})

Next, the first yield in parse_schedule which normally call self.parse_departure_page recursive method produces weird results. Scrapy call this method, but I collect the departures page for only one airport i don't understand why... I have probably an ordering error in my request or yield source code, so perhaps you could help me to find out.

The complete code is on GitHub https://github.com/IDEES-Rouen/Flight-Scrapping/tree/master/flight/flight_project

You could run it using scrapy cawl airports commands.

Update 1 :

I try to answer the question alone using yield from, without success as you can see answer bottom ... so if you have an idea?

Body:
I tried cloning locally and investigate a little better, but when it gets to the departure parsing I got some ConnectionRefused error so I am not sure my proposed answer will fix it, anyhow:

###################################
# PARSE EACH AIRPORT OF COUNTRY
###################################
def parse_schedule(self, response):
    """we want to loop this continuously to build every departure and arrivals requests"""
    item = response.meta['airport_item']
    i = response.meta['i']
    urls = response.meta['airport_urls']

    urls_departures, urls_arrivals = self.compute_urls_by_page(response, item['airports'][i]['name'], item['airports'][i]['code_little'])

    if 'urls_departures' in response.meta:
        urls_departures += response.meta["urls_departures"]

    if 'urls_arrivals' in response.meta:
        urls_arrivals += response.meta["urls_arrivals"]

    print("urls_departures = ", len(urls_departures))
    print("urls_arrivals = ", len(urls_arrivals))
    item['airports'][i]['departures'] = []

    # now do next schedule items
    if not urls:
        yield scrapy.Request(urls_departures.pop(), self.parse_departures_page, meta={'airport_item': item, 'page_urls': urls_departures, 'i':i , 'p': 0}, dont_filter=True)
    else:
        url = urls.pop()

        yield scrapy.Request(url, self.parse_schedule, meta={'airport_item': item, 'airport_urls': urls, 'i': i + 1, 'urls_departures': urls_departures, 'urls_arrivals': urls_arrivals})

###################################
# PARSE EACH DEPARTURES / ARRIVALS
###################################
def parse_departures_page(self, response):
    item = response.meta['airport_item']
    p = response.meta['p']
    i = response.meta['i']
    page_urls = response.meta['page_urls']

    jsonload = json.loads(response.body_as_unicode())
    json_expression = jmespath.compile("result.response.airport.pluginData.schedule.departures.data")

    # Append a new page
    item['airports'][i]['departures'].append(json_expression.search(jsonload))

    if len(page_urls) > 0:
        page_url = page_urls.pop()

        yield scrapy.Request(page_url, self.parse_departures_page, meta={'airport_item': item, 'page_urls': page_urls, 'i': i, 'p': p + 1}, dont_filter=True)
    else:
        yield item

But basically these are your mistakes:

In your parse_schedule and on your parse_departures_page you have conditions for yielding the final item;

You are passing the wrong url to parse_departures_page;

You need dont_filter=True on parse_departures_page;

You are trying to keep a lot of loops for parsing more information to the same object

My proposed changes will keep track of all urls_departures on this airport so that you can iterate over then on parse_departures_page and should fix your problem.

Even if this fix your problem I REALLY recommend you change your data structure so that you can have multiple items for departures and be able to extract this information more efficiently.


问:
Not able to get new refresh token from azure AD with grant type refresh_token called with old refresh token
I am using Azure Service management API and OAuth API for generating Access token. But while making the call for grant type "refresh_token", to refresh access token it returns new access token but that response does not has new refresh token. So I have to use old refresh token for refreshing access token. And the problem is after 5-6 hours, refreshing token returns error invalid_client(Error validating credentials. Invalid client secret is provided).
In other cases like Office 365 app authentication via Azure AD it returns everything.

Is there is any specific parameter or header that I have to pass with the API call ?

Below is the screenshot of my code

Please help.

Thanks in advance

答:
If you use the v2 endpoint scopes are requested dynamically and a refresh token must be requested using "offline_access" scope. This is much different than in the v1 model, where scopes are pre-registered with the app registration and a refresh token is always returned w/o explicit scope. If you're using v1 & you don't get refresh token, it might be due to restricted security policy about refresh tokens by your ADFS provider, which is not sending back a refresh token to the API calling the OAuth authentication and authorization.

This is security enhancement/block to disable your application not to hold a lifetime refresh token that can be lived forever (if refreshed).

So if you can use v2 endpoint - use offline_access scope. Otherwise check security policies with you ADFS provider.

I run into the same problem as you & gathered most of the information that helped to answer this question from here:
https://stackoverflow.com/a/44813531/4446128.


问:
How can I execute an "Explain" statement with a prepared query in PostgrSQL that has bind parameters?
I would like to be able to execute an explain statement on a query that has bind parameters. For example:

```<code>EXPLAIN SELECT * FROM metasyntax WHERE id = $1;
</code>```

When I attempt to execute this, I get the following error:

```<code>ERROR: bind message supplies 0 parameters, but prepared statement "" requires 1
</code>```

I understand it's telling me that it wants me to supply a value for the query. However, I may not necessarily know the answer to that. In other SQL dialects such as Oracle, it will generate an explain plan without needing me to supply a value for the parameter.

Is it possible to get an explain plan without binding to an actual value? Thanks!

答:
No.

The optimiser is allowed to change the query plan based on the parameter. Imagine if the parameter was null - it's obvious that no rows will be returned, so the DB may return an empty rowset instantly.

Just use a representative value.

Body:
I would like to be able to execute an explain statement on a query that has bind parameters. For example:

EXPLAIN SELECT * FROM metasyntax WHERE id = $1;

When I attempt to execute this, I get the following error:

ERROR: bind message supplies 0 parameters, but prepared statement "" requires 1

I understand it's telling me that it wants me to supply a value for the query. However, I may not necessarily know the answer to that. In other SQL dialects such as Oracle, it will generate an explain plan without needing me to supply a value for the parameter.

Is it possible to get an explain plan without binding to an actual value? Thanks!


问:
Options for caching / memoization / hashing in R
I am trying to find a simple way to use something like Perl's hash functions in R (essentially caching), as I intended to do both Perl-style hashing and write my own memoisation of calculations.  However, others have beaten me to the punch and have packages for memoisation.  The more I dig, the more I find, e.g.memoise and R.cache, but differences aren't readily clear.  In addition, it's not clear how else one can get Perl-style hashes (or Python-style dictionaries) and write one's own memoization, other than to use the hash package, which doesn't seem to underpin the two memoization packages.

Since I can find no information on CRAN or elsewhere to distinguish between the options, perhaps this should be a community wiki question on SO: What are the options for memoization and caching in R, and what are their differences?

As a basis for comparison, here is a list of the options I've found.  Also, it seems to me that all depend on hashing, so I'll note the hashing options as well.  Key/value storage is somewhat related, but opens a huge can of worms regarding DB systems (e.g. BerkeleyDB, Redis, MemcacheDB and scores of others).

It looks like the options are:

Hashing

digest - provides hashing for arbitrary R objects.

Memoization

memoise - a very simple tool for memoization of functions.

R.cache - offers more functionality for memoization, though it seems some of the functions lack examples.

Caching

hash - Provides caching functionality akin to Perl's hashes and Python dictionaries.

Key/value storage

These are basic options for external storage of R objects.

stashr

filehash

Checkpointing

cacher - this seems to be more akin to checkpointing.

CodeDepends - An OmegaHat project that underpins cacher and provides some useful functionality.

DMTCP (not an R package) - appears to support checkpointing in a bunch of languages, and a developer recently sought assistance testing DMTCP checkpointing in R.

Other

Base R supports: named vectors and lists, row and column names of data frames, and names of items in environments. It seems to me that using a list is a bit of a kludge.  (There's also pairlist, but it is deprecated.)

The data.table package supports rapid lookups of elements in a data table.

Use case

Although I'm mostly interested in knowing the options, I have two basic use cases that arise:

Caching: Simple counting of strings.  [Note: This isn't for NLP, but general use, so NLP libraries are overkill; tables are inadequate because I prefer not to wait until the entire set of strings are loaded into memory.  Perl-style hashes are at the right level of utility.]

Memoization of monstrous calculations.

These really arise because I'm digging in to the profiling of some slooooow code and I'd really like to just count simple strings and see if I can speed up some calculations via memoization.  Being able to hash the input values, even if I don't memoize, would let me see if memoization can help.

Note 1: The CRAN Task View on Reproducible Research lists a couple of the packages (cacher and R.cache), but there is no elaboration on usage options.

Note 2: To aid others looking for related code, here a few notes on some of the authors or packages.  Some of the authors use SO.  :)

Dirk Eddelbuettel: digest - a lot of other packages depend on this.

Roger Peng: cacher, filehash, stashR - these address different problems in different ways; see Roger's site for more packages.

Christopher Brown: hash - Seems to be a useful package, but the links to ODG are down, unfortunately.

Henrik Bengtsson: R.cache & Hadley Wickham: memoise -- it's not yet clear when to prefer one package over the other.

Note 3: Some people use memoise/memoisation others use memoize/memoization.  Just a note if you're searching around.  Henrik uses "z" and Hadley uses "s".

答:
Related to @biocyperman solution. R.cache has a wrapping function for avoiding the loading, saving and evaluation of the cache. See the modified function:

R.cache provide a wrapper for loading, evaluating, saving. You can simplify your code like that:

```<code>simulate <- function(mean, sd) {
key <- list(mean, sd)
data <- evalWithMemoization(key = key, expr = {
    cat("Generating data from scratch...")
    data <- rnorm(1000, mean=mean, sd=sd)
    Sys.sleep(1) # Emulate slow algorithm
    cat("ok\n")
    data})
}
</code>```

Body:
Related to @biocyperman solution. R.cache has a wrapping function for avoiding the loading, saving and evaluation of the cache. See the modified function:

R.cache provide a wrapper for loading, evaluating, saving. You can simplify your code like that:

simulate <- function(mean, sd) {
key <- list(mean, sd)
data <- evalWithMemoization(key = key, expr = {
    cat("Generating data from scratch...")
    data <- rnorm(1000, mean=mean, sd=sd)
    Sys.sleep(1) # Emulate slow algorithm
    cat("ok\n")
    data})
}


问:
R DataFrame: conditional transformation for linked data
I have a dataframe of nodes. The dataframe can be created with this,

```<code>t1 <- c(1,0,1,0,1) #type 1
t2 <- c(1,0,1,0,1) #type 1

t3 <- c(1,1,0,0,1) #type 2
t4 <- c(1,1,0,0,1) #type 2

t5 <- c(1,0,1,0,1) #type 1
t6 <- c(1,0,1,0,1)

df <- data.frame(rbind(t1,t2,t3,t4,t5))
names(df) <- c('n1','n2','n3','n4','n5')
df
</code>```

The dataframe looks like this,

```<code>   n1 n2 n3 n4 n5
t1  1  0  1  0  1
t2  1  0  1  0  1
t3  1  1  0  0  1
t4  1  1  0  0  1
t5  1  0  1  0  1
</code>```

I want to achieve a transformed dataframe that is similar to an adjacency metrics. The first row can be transformed like this,

```<code>n1 n3 1 # Means, 1 link from n1 to n3
n3 n5 1 # Means, 1 link from n3 to n5
</code>```

Another example, the fourth row would be transformed like this,

```<code>n1 n2 1
n2 n5 1
</code>```

Now my question is, can I achieve this using any built-in R function?

答:
A solution from tidyverse. df2 is the final output.

```<code># Load packages
library(tidyverse)

# Process the data
df2 <- df %>%
  rownames_to_column("ID") %>%
  gather(From, Occur, -ID) %>%
  arrange(ID, From) %>%
  filter(Occur != 0) %>%
  group_by(ID) %>%
  mutate(To = lead(From)) %>%
  drop_na(To) %>%
  select(ID, From, To, Occur)

# View the result. df2 holds the transformed data
df2
# A tibble: 10 x 4
# Groups:   ID [5]
      ID  From    To Occur
   <chr> <chr> <chr> <dbl>
 1    t1    n1    n3     1
 2    t1    n3    n5     1
 3    t2    n1    n3     1
 4    t2    n3    n5     1
 5    t3    n1    n2     1
 6    t3    n2    n5     1
 7    t4    n1    n2     1
 8    t4    n2    n5     1
 9    t5    n1    n3     1
10    t5    n3    n5     1
</code>```

Body:
I have a dataframe of nodes. The dataframe can be created with this,

t1 <- c(1,0,1,0,1) #type 1
t2 <- c(1,0,1,0,1) #type 1

t3 <- c(1,1,0,0,1) #type 2
t4 <- c(1,1,0,0,1) #type 2

t5 <- c(1,0,1,0,1) #type 1
t6 <- c(1,0,1,0,1)

df <- data.frame(rbind(t1,t2,t3,t4,t5))
names(df) <- c('n1','n2','n3','n4','n5')
df

The dataframe looks like this,

   n1 n2 n3 n4 n5
t1  1  0  1  0  1
t2  1  0  1  0  1
t3  1  1  0  0  1
t4  1  1  0  0  1
t5  1  0  1  0  1

I want to achieve a transformed dataframe that is similar to an adjacency metrics. The first row can be transformed like this,

n1 n3 1 # Means, 1 link from n1 to n3
n3 n5 1 # Means, 1 link from n3 to n5

Another example, the fourth row would be transformed like this,

n1 n2 1
n2 n5 1

Now my question is, can I achieve this using any built-in R function?

Body:
A solution from tidyverse. df2 is the final output.

# Load packages
library(tidyverse)

# Process the data
df2 <- df %>%
  rownames_to_column("ID") %>%
  gather(From, Occur, -ID) %>%
  arrange(ID, From) %>%
  filter(Occur != 0) %>%
  group_by(ID) %>%
  mutate(To = lead(From)) %>%
  drop_na(To) %>%
  select(ID, From, To, Occur)

# View the result. df2 holds the transformed data
df2
# A tibble: 10 x 4
# Groups:   ID [5]
      ID  From    To Occur
   <chr> <chr> <chr> <dbl>
 1    t1    n1    n3     1
 2    t1    n3    n5     1
 3    t2    n1    n3     1
 4    t2    n3    n5     1
 5    t3    n1    n2     1
 6    t3    n2    n5     1
 7    t4    n1    n2     1
 8    t4    n2    n5     1
 9    t5    n1    n3     1
10    t5    n3    n5     1


问:
ChartJs won't appear in DIV in same page
I am having trouble to display the PieChart from ChartJs in the right DIV while I click from the left DIV. If I try to run the chart directly it works but I want to have them on the same page just in different DIVs.
I have put html file for every link and it works fine, but when I want to display the Pie chart which is inside html it is not working. I would like to know where should I check the problem i am confused right now.

check this: Fiddle project

this is my html that should appear:
file: bujanoci_chart.html

```<code><html>
<head>
    <title>ChartJS - Pie Chart</title>
    <link rel="stylesheet" href="/elections/jscss/svgcss.css">
    <script src="jquery-2.1.4.min.js"></script>
    <script src="Chart.js"></script>
</head>
<body>
<div id="b_chart">
    <canvas id="mycanvas" height="100" width="250"></canvas>
    <script>
        $(document).ready(function(){
            var ctx = $("#mycanvas").get(0).getContext("2d");
            //pie chart data
            //sum of values = 360
            var data = [
                {
                    value: 270,
                    color: "cornflowerblue",
                    highlight: "lightskyblue",
                    label: "Third"
                },
                {
                    value: 50,
                    color: "lightgreen",
                    highlight: "yellowgreen",
                    label: "First"
                },
                {
                    value: 40,
                    color: "orange",
                    highlight: "darkorange",
                    label: "Second"
                }
            ];
            //draw
            var piechart = new Chart(ctx).Pie(data);
        });
    </script>
    </div>
</body>
</code>```

JS Script:

```<code>$(document).ready( function() {
  $("#presheva").on("click", function() {
      $("#posht").load("elections/komuna_preshev.html");
  });
  $("#bujanoci").on("click", function() {
      $("#djathtas").load("elections/bujanoc/bujanoci_chart.html");
  });
  $("#trgovishte").on("click", function() {
      $("#djathtas").load("elections/trgovishte.html");
  });
  $("#bosilegrad").on("click", function() {
      $("#djathtas").load("elections/bosilegrad.html");
  });
  $("#vraja").on("click", function() {
      $("#djathtas").load("elections/vraja.html");
  });
  $("#vhan").on("click", function() {
      $("#djathtas").load("elections/vhan.html");
  });
  $("#surdulica").on("click", function() {
      $("#djathtas").load("elections/surdulica.html");
    }); });
</code>```

Mycss:

body {
max-width: 100%; margin: 0 auto
}
#majtas{
 background-color: #DCDCDC;
 width: 35%;
 height: 320px;
 display: inline-block;
}
#djathtas{

 width: 65%;
 height: 320px;
 float: right;
 display: inline-block;
}
#posht{
  width: 100%;
  height: 40%;
  display: inline-block;
}
#mycanvas{
 background-color: #DCDCDC;
 width:  35% !important;
 height: 35% !important;
 float: right;
 margin-right: 35%;
 margin-top: 20%;
}
.land{
 fill: #eff2f0;

}
a:hover .land{
 fill: yellow;
}```

答:
Try doing something like this? Click on #presheva to load a new data set.

var ctx = $("#mycanvas").get(0).getContext("2d");
//pie chart data
//sum of values = 360
var data = [{
    value: 270,
    color: "cornflowerblue",
    highlight: "lightskyblue",
    label: "Third"
  },
  {
    value: 50,
    color: "lightgreen",
    highlight: "yellowgreen",
    label: "First"
  },
  {
    value: 40,
    color: "orange",
    highlight: "darkorange",
    label: "Second"
  }
];
//draw
var piechart = new Chart(ctx).Pie(data);

function removeData(chart) {
    chart.data.labels.pop();
    chart.data.datasets.forEach((dataset) => {
        dataset.data.pop();
    });
    chart.update();
}

$("#presheva").on("click", function() {
 // $("#posht").load("elections/komuna_preshev.html");

var ctx = $("#mycanvas").get(0).getContext("2d");
//pie chart data
//sum of values = 360
var data = [{
    value: 200,
    color: "orange",
    highlight: "pink",
    label: "Third"
  },
  {
    value: 120,
    color: "green",
    highlight: "brown",
    label: "First"
  },
  {
    value: 40,
    color: "black",
    highlight: "darkorange",
    label: "Second"
  }
];
//draw
var piechart = new Chart(ctx).Pie(data);

});

$("#bujanoci").on("click", function() {});
$("#trgovishte").on("click", function() {});
$("#bosilegrad").on("click", function() {});
$("#vraja").on("click", function() {});
$("#vhan").on("click", function() {});

$("#surdulica").on("click", function() {});```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body {
  max-width: 100%;
  margin: 0 auto
}

#majtas {
  background-color: #DCDCDC;
  width: 35%;
  height: 320px;
  display: inline-block;
}

#djathtas {
  width: 65%;
  height: 320px;
  float: right;
  display: inline-block;
}

#posht {
  width: 100%;
  height: 40%;
  display: inline-block;
}

#mycanvas {
  background-color: #DCDCDC;
  width: 35% !important;
  height: 35% !important;
  float: right;
  margin-right: 35%;
  margin-top: 20%;
}

.land {
  fill: #eff2f0;
}

a:hover .land {
  fill: yellow;
}</code>```

    <svg preserveAspectRatio="xMinYMin meet" viewBox="0 0 790 1080" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" stroke="null" style="vector-effect: non-scaling-stroke;">

   <g stroke="null">
    <title stroke="null">Pcinjski Okrug</title>
    <path class="land" stroke="#000000" id="svg_4" d="m25.524693,415.428482c0,0 -15.759451,-0.809455 -15.759451,-0.809455c0,0 -9.630776,-14.570185 -9.630776,-14.570185c0,0 0,-17.808005 0,-17.808005c0,0 4.377625,-14.570186 4.377625,-14.570186c0,0 10.506301,0.809455 9.663146,0.629636c-0.843155,-0.179818 18.353657,-3.058 18.353657,-3.058c0,0 6.128675,-11.332367 6.128675,-11.332367c0,0 15.759452,2.428365 14.916295,2.248546c-0.843156,-0.179818 7.847357,-7.105274 7.847357,-7.105274c0,0 8.755251,-10.522912 8.755251,-10.522912c0,0 10.506301,8.904002 10.506301,8.904002c0,0 12.257351,6.475638 11.414193,6.29582c-0.843157,-0.179818 21.85576,5.846002 21.012602,5.666183c-0.843159,-0.179818 11.349459,-0.629636 11.349459,-0.629636c0,0 -6.128676,17.808005 -6.128676,17.808005c0,0 4.377626,14.570185 4.377626,14.570185c0,0 16.634976,5.666184 15.791817,5.486364c-0.843159,-0.179819 20.980236,-4.676909 20.137076,-4.856728c-0.84316,-0.17982 15.727086,2.608183 15.727086,2.608183c0,0 10.506301,12.141822 10.506301,12.141822c0,0 7.879726,7.285093 7.036565,7.105273c-0.843161,-0.17982 -8.787615,12.321641 -8.787615,12.321641c0,0 -17.510502,-0.809455 -15.759452,-1.618909c1.75105,-0.809455 -2.626575,7.285092 -3.469735,7.105272c-0.84316,-0.179821 -0.90789,9.083823 -1.75105,8.904002c-0.84316,-0.179821 -5.285516,9.083823 -5.285516,9.083823c0,0 -14.883926,4.047274 -14.883926,4.047274c0,0 -21.888127,4.856729 -22.731285,4.676907c-0.843158,-0.179821 -5.285517,13.131098 -5.285517,13.131098c0,0 -17.510502,-3.237819 -17.510502,-3.237819c0,0 -12.445147,4.595011 -23.639177,-5.666184c-11.19403,-10.261194 -15.759451,-4.047273 -15.759451,-4.047273c0,0 -16.634977,-4.856729 -16.634977,-4.856729c0,0 2.626576,-11.332367 2.626576,-11.332367c0,0 -16.634977,-16.99855 -16.634977,-16.99855c0,0 -0.875525,-9.713457 -0.875525,-9.713457z" fill="#eff2f0"/>
    <path class="land" stroke="#000000" id="svg_8" d="m190.528078,414.836065c0,0 0,-8.964079 0,-9.220195c0,-0.256117 10.803842,-1.280583 10.803842,-1.280583c0,0 6.648518,4.866214 6.648518,4.866214c0,0 3.878302,7.171263 3.878302,7.171263c0,0 4.155324,-0.256117 4.155324,-0.256117c0,0 3.601281,-2.817282 3.601281,-2.817282c0,0 3.601281,4.097865 3.601281,4.097865c0,0 5.540432,3.841748 5.540432,3.841748c0,0 7.202561,1.536699 7.202561,1.024466c0,-0.512233 16.067252,-10.244661 16.067252,-10.244661c0,0 0,-19.20874 0,-19.20874c0,0 2.216173,-7.171263 2.216173,-7.171263c0,0 -5.540432,-5.89068 -5.540432,-5.89068c0,0 6.371497,-7.171263 6.371497,-7.171263c0,0 6.371497,-4.353981 6.371497,-4.353981c0,0 -5.540432,-9.476312 -5.540432,-9.220195c0,0.256117 4.986389,-2.561165 4.986389,-2.561165c0,0 6.371497,-6.915146 6.371497,-6.915146c0,0 -8.310648,-5.122331 -8.310648,-5.122331c0,0 -3.601281,-6.915146 -3.601281,-6.915146c0,0 -15.236188,-0.512233 -15.236188,-0.512233c0,0 -10.803842,-8.195729 -10.803842,-8.195729c0,0 0.831065,-6.915146 0.716528,-6.930582c-0.114537,-0.015436 -12.628456,0.271552 -12.628456,0.271552c0,0 -17.45236,-20.745439 -17.45236,-20.745439c0,0 -14.682144,-7.427379 -14.682144,-7.427379c0,0 -13.297036,-16.903691 -13.297036,-16.903691c0,0 -8.310648,-13.31806 -8.310648,-13.31806c0,0 -16.067252,-13.31806 -16.067252,-13.31806c0,0 -8.310648,-3.073398 -8.310648,-3.073398c0,0 0.554043,-17.415924 0.554043,-17.415924c0,0 6.371497,-8.195729 6.256958,-8.211166c-0.114538,-0.015437 1.776668,-9.716991 1.776668,-9.716991c0,0 6.92554,-0.256117 6.811002,-0.271554c-0.114538,-0.015437 14.796683,-10.229224 14.796683,-10.229224c0,0 16.344274,-10.756894 16.344274,-10.756894c0,0 9.418734,-9.220195 9.418734,-9.220195c0,0 -4.432345,-8.707962 -4.432345,-8.707962c0,0 -4.986389,-9.732428 -4.986389,-9.732428c0,0 -6.371497,-9.476312 -6.371497,-9.476312c0,0 -13.020015,-0.512233 -13.020015,-0.512233c0,0 -8.310648,-5.122331 -8.310648,-5.122331c0,0 -6.371497,-0.76835 -6.371497,-0.76835c0,0 -3.324259,10.244661 -3.324259,10.244661c0,0 -3.878302,0 -3.878302,0c0,0 -6.094475,-1.792816 -6.094475,-1.792816c0,0 -4.432345,8.195729 -4.432345,8.195729c0,0 -0.554043,14.342526 -0.554043,14.342526c0,0 -12.18895,6.915146 -12.18895,6.915146c0,0 11.080864,21.769905 11.080864,22.026022c0,0.256117 -2.216173,8.964079 -2.216173,8.964079c0,0 -3.601281,6.915146 -3.601281,7.171263c0,0.256117 -10.803842,1.280583 -10.803842,1.280583c0,0 -11.634907,0 -11.634907,0c0,0 -6.648518,11.013011 -6.648518,11.013011c0,0 1.66213,9.988545 1.66213,9.988545c0,0 8.033626,5.378447 8.033626,5.378447c0,0 -0.831065,3.841748 -0.831065,3.841748c0,0 -10.249799,-1.536699 -10.249799,-1.536699c0,0 -1.108086,7.427379 -1.108086,7.427379c0,0 -12.465972,8.451846 -12.465972,8.451846c0,0 -2.216173,8.707962 -2.216173,8.707962c0,0 -8.587669,8.964079 -8.587669,8.964079c0,0 -16.621296,16.903691 -16.621296,16.903691c0,0 9.695756,16.391458 9.695756,16.391458c0,0 4.986389,12.54971 4.986389,12.54971c0,0 2.493194,12.293594 2.493194,12.293594c0,0 17.45236,11.269127 17.45236,11.269127c0,0 14.959166,2.817282 14.959166,2.817282c0,0 10.803842,1.024466 10.803842,1.024466c0,0 4.432345,4.097865 4.432345,4.097865c0,0 -1.66213,8.707962 -1.66213,8.707962c0,0 -1.385108,10.244661 -1.385108,10.244661c0,0 3.047238,9.476312 3.047238,9.476312c0,0 12.18895,5.634564 12.18895,5.634564c0,0 11.911928,-2.561165 11.911928,-2.561165c0,0 13.85108,-1.536699 13.85108,-1.536699c0,0 13.020015,3.841748 13.020015,3.841748c0,0 8.864691,9.476312 8.864691,9.476312c0,0 10.803842,7.427379 10.803842,7.427379z" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" fill="#eff2f0"/>
    <path class="land" stroke="#000000" id="svg_9" d="m247.129753,389.196212c0,0 6.744786,-0.479677 6.744786,-0.479677c0,0 14.52723,9.113861 15.04606,9.113861c0.51883,0 18.159038,11.512245 18.159038,11.512245c0,0 16.602549,16.309014 16.602549,15.34966c0,-0.959354 12.451912,-10.073214 12.451912,-10.073214c0,0 11.414252,8.634184 11.414252,8.634184c0,0 30.61095,-12.951276 30.61095,-12.951276c0,0 8.301275,6.715476 8.301275,6.715476c0,0 9.857763,-12.471599 9.857763,-12.471599c0,0 14.52723,3.837415 14.008401,3.357738c-0.51883,-0.479677 12.451912,-10.073214 12.451912,-10.073214c0,0 6.744786,-11.512245 6.744786,-11.512245c0,0 25.422653,2.878061 25.422653,2.878061c0,0 2.594148,-11.991922 2.594148,-11.991922c0,0 9.857763,-9.593538 9.857763,-9.593538c0,0 9.338934,1.439031 9.338934,1.439031c0,0 9.857763,-6.235799 9.857763,-6.235799c0,0 14.008401,-1.918708 14.008401,-1.439031c0,0.479677 2.075319,-31.178997 2.075319,-31.178997c0,0 2.594148,-9.593538 2.594148,-9.593538c0,0 -7.263615,-7.195153 -7.263615,-7.195153c0,0 -8.301275,-5.756123 -8.301275,-5.756123c0,0 0,-7.195153 0,-7.195153c0,0 -10.895423,-7.67483 -10.895423,-7.67483c0,0 -14.008401,-2.398384 -14.008401,-2.398384c0,0 -7.782445,-7.67483 -7.782445,-7.67483c0,0 -12.970741,-9.593538 -12.970741,-9.593538c0,0 -12.970741,11.991922 -12.970741,11.991922c0,0 1.037659,10.073214 1.037659,10.073214c0,0 -13.489571,1.439031 -13.489571,1.439031c0,0 -5.707126,9.593538 -5.707126,9.593538c0,0 -24.384994,-0.479677 -24.384994,-0.479677c0,0 -13.489571,-8.634184 -13.489571,-8.634184c0,0 -1.037659,25.422875 -1.037659,25.422875c0,0 -17.121379,-0.959354 -17.121379,-0.959354c0,0 -22.828505,14.390306 -22.828505,14.390306c0,0 -12.970741,-4.796769 -12.970741,-4.796769c0,0 -5.707126,-7.67483 -5.707126,-7.67483c0,0 -1.037659,10.552891 -1.037659,10.552891c0,0 -11.414252,0 -11.414252,0c0,0 -12.451912,5.276446 -12.970741,5.276446c-0.51883,0 -10.895423,5.756123 -10.895423,5.756123c0,0 -9.338934,11.991922 -9.338934,11.991922c0,0 2.075319,8.634184 2.075319,8.634184c0,0 -8.820104,10.552891 -8.820104,10.552891c0,0 4.150637,12.951276 4.150637,12.951276z" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" fill="#eff2f0"/>
    <path class="land" stroke="#000000" id="svg_10" d="m456.218105,177.658707c0,0 5.707126,14.869983 5.707126,14.869983c0,0 14.008401,-1.918708 13.489571,-1.439031c-0.51883,0.479677 6.744786,-4.317092 6.744786,-4.317092c0,0 8.301275,11.991922 8.301275,11.991922c0,0 41.506373,-0.959354 41.506373,-0.959354c0,0 6.225956,6.235799 6.225956,6.235799c0,0 8.301275,-2.398384 8.301275,-2.398384c0,0 3.631808,6.715476 3.631808,6.715476c0,0 11.933082,-0.959354 12.451912,-0.959354c0.51883,0 12.451912,0.479677 12.451912,0.479677c0,0 12.451912,12.471599 12.451912,12.471599c0,0 10.895423,14.869983 10.895423,14.869983c0,0 11.933082,0.959354 11.933082,0.959354c0,0 12.970741,16.788691 12.970741,16.788691c0,0 11.414252,26.861905 11.414252,26.861905c0,0 -9.857763,11.512245 -9.857763,11.512245c0,0 1.556489,13.91063 1.556489,13.91063c0,0 -6.744786,5.756123 -6.744786,5.756123c0,0 1.556489,11.512245 2.594148,11.512245c1.037659,0 -7.263615,17.748045 -7.263615,17.748045c0,0 -27.497972,5.276446 -27.497972,5.276446c0,0 0,8.634184 0,8.634184c0,0 -13.489571,10.073214 -13.489571,11.032568c0,0.959354 1.037659,24.463521 1.037659,24.463521c0,0 -12.451912,9.593538 -12.451912,9.593538c0,0 -15.04606,-3.357738 -15.04606,-3.357738c0,0 -10.895423,-1.439031 -10.895423,-1.439031c0,0 -19.196697,8.154507 -19.196697,8.154507c0,0 -7.263615,7.67483 -8.301275,7.67483c-1.037659,0 -43.581691,-26.382228 -44.100521,-26.861905c-0.51883,-0.479677 1.037659,-15.34966 1.037659,-15.34966c0,0 13.489571,-11.512245 13.489571,-11.512245c0,0 1.556489,-18.707398 1.556489,-18.707398c0,0 3.112978,-14.869983 3.112978,-14.869983c0,0 -11.933082,-11.991922 -11.933082,-11.991922c0,0 -4.150637,-2.878061 -4.150637,-2.878061c0,0 -3.631808,-9.593538 -3.631808,-9.593538c0,0 -12.451912,-4.317092 -12.451912,-4.317092c0,0 -11.414252,-5.276446 -11.414252,-5.276446c0,0 -11.933082,-9.113861 -11.933082,-9.113861c0,0 -9.338934,-6.235799 -9.338934,-6.235799c0,0 0,-26.382228 0,-26.382228c0,0 10.376593,-7.195153 10.376593,-7.195153c0,0 -1.556489,-14.869983 -1.556489,-14.869983c0,0 4.150637,-13.430953 4.150637,-13.430953c0,0 7.263615,-2.398384 7.263615,-2.398384c0,0 4.150637,-11.032568 5.188297,-11.991922c1.037659,-0.959354 11.414252,-19.666752 11.414252,-19.666752z" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" fill="#eff2f0"/>
    <path class="land" stroke="#000000" id="svg_11" d="m151.924511,145.760195c0,0 -2.594148,-6.715476 -2.594148,-6.715476c0,0 -9.338934,-11.991922 -9.338934,-11.991922c0,0 -6.225956,-8.154507 -6.225956,-8.154507c0,0 -5.188297,-11.512245 -5.188297,-11.512245c0,0 12.970741,0.479677 12.970741,0.479677c0,0 4.669467,-9.113861 4.669467,-9.113861c0,0 3.631808,-8.634184 3.631808,-8.634184c0,0 -2.594148,-18.707398 -2.594148,-18.707398c0,0 10.376593,0 10.376593,0c0,0 -0.51883,-8.154507 -0.51883,-8.154507c0,0 9.857763,-3.357738 9.857763,-3.357738c0,0 -2.594148,-8.154507 -2.594148,-8.154507c0,0 6.225956,-9.593538 6.225956,-9.593538c0,0 10.895423,0 10.895423,0c0,0 6.744786,-4.796769 6.225956,-4.796769c-0.51883,0 15.04606,4.796769 15.04606,4.796769c0,0 8.301275,-7.195153 8.301275,-7.195153c0,0 20.234357,0.479677 20.234357,0.479677c0,0 4.150637,-5.756123 4.150637,-5.756123c0,0 12.970741,6.715476 12.970741,6.715476c0,0 -2.075319,9.113861 -2.075319,9.113861c0,0 -6.744786,-1.439031 -7.782445,-1.439031c-1.037659,0 -0.51883,8.634184 -0.51883,8.634184c0,0 -6.225956,7.67483 -6.225956,7.67483c0,0 0.51883,10.552891 0.51883,10.552891c0,0 4.150637,9.113861 4.150637,9.113861c0,0 -4.669467,15.829337 -4.669467,15.829337c0,0 -3.631808,27.821259 -3.631808,27.821259c0,0 2.594148,34.536735 2.594148,34.536735c0,0 9.338934,10.073214 9.338934,10.073214c0,0 16.083719,-3.837415 16.083719,-3.357738c0,0.479677 7.782445,11.991922 7.782445,11.991922c0,0 3.112978,20.626106 3.112978,20.626106c0,0 20.753186,1.918708 20.753186,1.918708c0,0 22.309675,-18.227721 22.309675,-18.227721c0,0 27.497972,11.032568 27.497972,11.032568c0,0 26.460313,-1.918708 26.979142,-1.918708c0.51883,0 -0.51883,-12.471599 -0.51883,-12.471599c0,0 14.52723,-2.878061 14.52723,-2.878061c0,0 19.196697,23.02449 19.196697,23.02449c0,0 18.159038,-0.479677 18.159038,-0.479677c0,0 10.376593,13.91063 10.376593,13.91063c0,0 8.820104,1.439031 8.820104,1.439031c0,0 -4.150637,10.552891 -4.150637,10.552891c0,0 1.556489,15.829337 1.556489,15.829337c0,0 -9.857763,7.195153 -9.857763,7.195153c0,0 1.556489,30.69932 1.556489,30.69932c0,0 -12.451912,10.073214 -12.451912,10.073214c0,0 2.075319,8.634184 2.075319,8.634184c0,0 -12.970741,3.357738 -12.970741,3.357738c0,0 -5.707126,8.154507 -5.707126,8.154507c0,0 -23.866164,0.479677 -23.866164,0.479677c0,0 -14.52723,-8.634184 -14.52723,-8.634184c0,0 -1.556489,22.065137 -2.075319,22.544813c-0.51883,0.479677 -16.083719,1.918708 -16.083719,1.918708c0,0 -23.347335,14.390306 -23.347335,14.390306c0,0 -13.489571,-5.756123 -13.489571,-5.756123c0,0 -5.188297,-9.593538 -5.188297,-9.593538c0,0 -1.556489,12.471599 -1.556489,12.471599c0,0 -7.782445,-0.479677 -8.301275,0c-0.51883,0.479677 -26.460313,13.430953 -26.460313,13.430953c0,0 -10.895423,-10.073214 -10.895423,-10.073214c0,0 -12.970741,-2.398384 -14.008401,-2.398384c-1.037659,0 -11.933082,-8.154507 -11.933082,-8.154507c0,0 -1.037659,-8.154507 -1.037659,-8.154507c0,0 -10.895423,0.959354 -10.895423,0.959354c0,0 -18.677868,-21.58546 -18.677868,-21.58546c0,0 -11.933082,-6.235799 -11.933082,-6.235799c0,0 -26.979142,-34.057059 -26.979142,-34.057059c0,0 -20.753186,-13.91063 -20.753186,-13.91063c0,0 9.338934,-31.658674 9.338934,-31.658674c0,0 49.288817,-33.097705 49.288817,-33.097705c0,0 -19.196697,-29.26029 -19.196697,-29.26029c0,0 -14.52723,-0.959354 -14.52723,-0.959354c0,0 -6.225956,-4.317092 -6.225956,-4.317092z" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" fill="#eff2f0"/>
    <path class="land" stroke="#000000" id="svg_12" d="m237.25028,64.35004c0,0 -12.350267,12.711142 -12.350267,12.711142c0,0 9.128458,16.133373 9.128458,16.133373c0,0 -4.832713,22.488944 -5.369681,23.466724c-0.536968,0.97778 -2.684841,54.2668 -2.684841,54.2668c0,0 12.350267,11.733362 12.350267,11.733362c0,0 12.350267,-3.422231 12.350267,-3.422231c0,0 11.276331,13.688923 11.276331,13.688923c0,0 1.073936,17.111153 1.073936,17.111153c0,0 22.015694,3.422231 22.015694,3.422231c0,0 23.08963,-16.133373 23.08963,-16.133373c0,0 26.311439,10.266692 26.848407,9.777802c0.536968,-0.48889 26.848407,-2.44445 26.848407,-2.44445c0,0 -1.610904,-12.222252 -1.610904,-12.222252c0,0 -27.922343,-12.222252 -27.922343,-12.222252c0,0 -5.369681,-23.955615 -5.369681,-23.955615c0,0 17.182981,-7.822241 17.182981,-7.822241c0,0 4.295745,-23.955615 4.295745,-23.955615c0,0 22.015694,-1.95556 22.015694,-1.95556c0,0 2.684841,-17.600043 2.684841,-17.600043c0,0 -12.350267,-8.311132 -12.350267,-8.311132c0,0 11.813299,-20.533384 11.813299,-20.533384c0,0 17.719949,-1.95556 17.719949,-1.95556c0,0 3.758777,-8.311132 3.758777,-8.311132c0,0 24.163566,-7.333351 24.163566,-7.333351c0,0 -6.980586,-15.644483 -6.980586,-15.644483c0,0 -8.59149,7.822241 -8.59149,8.311132c0,0.48889 -17.719949,-5.377791 -17.719949,-5.377791c0,0 -1.073936,-11.733362 -1.073936,-12.711142c0,-0.97778 -10.202395,1.46667 -10.202395,1.46667c0,0 -10.739363,14.177813 -10.739363,14.177813c0,0 -22.015694,-9.777802 -22.015694,-9.777802c0,0 13.961172,-8.311132 13.961172,-8.311132c0,0 -9.128458,-15.155593 -9.128458,-15.155593c0,0 -20.941758,0.97778 -20.941758,0.97778c0,0 -21.478726,14.177813 -21.478726,14.177813c0,0 -13.961172,1.46667 -13.961172,1.46667c0,0 -3.221809,-12.222252 -3.221809,-12.222252c0,0 -16.109044,2.44445 -16.109044,2.44445c0,0 -3.758777,17.600043 -3.758777,17.600043c0,0 -9.665427,4.888901 -9.665427,4.888901c0,0 -13.961172,3.422231 -13.961172,3.422231c0,0 -5.369681,16.133373 -5.369681,16.133373z" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" fill="#eff2f0"/>
    <path class="land" stroke="#000000" id="svg_13" d="m417.176174,59.058598c0,0 24.903824,17.268368 24.903824,17.268368c0,0 21.272016,2.878061 21.272016,2.878061c0,0 5.188297,-12.951276 5.188297,-12.951276c0,0 16.602549,-7.195153 17.121379,-7.195153c0.51883,0 16.602549,-7.195153 16.602549,-7.195153c0,0 12.451912,-22.065137 12.451912,-22.065137c0,0 16.083719,-0.959354 16.083719,-0.959354c0,0 22.828505,-5.276446 22.828505,-5.276446c0,0 13.489571,23.983844 13.489571,23.983844c0,0 12.451912,21.105783 12.451912,21.105783c0,0 11.414252,16.309014 11.414252,16.309014c0,0 -8.820104,23.02449 -8.820104,23.02449c0,0 -10.376593,19.187075 -10.376593,19.187075c0,0 -2.075319,28.780613 -2.075319,28.780613c0,0 4.669467,19.187075 4.669467,19.187075c0,0 -4.669467,18.227721 -4.669467,18.227721c0,0 -11.414252,21.105783 -11.414252,21.105783c0,0 -6.225956,6.235799 -6.744786,6.235799c-0.51883,0 -11.414252,-2.878061 -11.414252,-2.878061c0,0 -14.52723,-5.276446 -14.52723,-5.276446c0,0 -30.61095,-0.959354 -30.61095,-0.959354c0,0 -11.414252,-9.113861 -11.414252,-9.113861c0,0 -19.196697,3.837415 -19.196697,3.357738c0,-0.479677 -7.263615,-15.34966 -7.263615,-15.34966c0,0 -18.159038,31.658674 -18.159038,31.658674c0,0 -14.008401,1.918708 -14.52723,1.918708c-0.51883,0 -12.451912,-12.951276 -12.451912,-12.951276c0,0 -18.159038,0 -18.159038,0c0,0 -19.196697,-23.504167 -19.715527,-23.504167c-0.51883,0 -14.52723,4.317092 -14.52723,4.317092c0,0 -28.535631,-11.991922 -28.535631,-11.991922c0,0 -5.188297,-23.504167 -5.188297,-23.504167c0,0 16.602549,-7.67483 16.602549,-7.67483c0,0 4.669467,-22.544813 4.669467,-22.544813c0,0 20.753186,-2.878061 20.753186,-2.878061c0,0 3.112978,-17.748045 3.112978,-17.748045c0,0 -11.933082,-11.032568 -11.933082,-11.032568c0,0 9.338934,-14.390306 9.338934,-14.390306c0,0 18.677868,-4.796769 18.677868,-4.796769c0,0 2.594148,-7.67483 2.594148,-7.67483c0,0 27.497972,-8.634184 27.497972,-8.634184z" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" fill="#eff2f0"/>
    <text xml:space="preserve" text-anchor="middle" font-family="serif" font-size="14" id="svg_18" y="423.917914" x="89.589524" opacity="0.4" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="0" stroke="#000000" fill="#000000">PRESEVO</text>
    <text xml:space="preserve" text-anchor="middle" font-family="serif" font-size="14" id="svg_19" y="352.089557" x="157.686539" opacity="0.4" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="0" stroke="#000000" fill="#000000">BUJANOVAC</text>
    <text xml:space="preserve" text-anchor="middle" font-family="serif" font-size="14" id="svg_20" y="275.597018" x="271.492509" opacity="0.4" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="0" stroke="#000000" fill="#000000">VRANJE</text>
    <text xml:space="preserve" text-anchor="middle" font-family="serif" font-size="14" id="svg_22" y="118.880599" x="288.171619" opacity="0.4" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="0" stroke="#000000" fill="#000000">V. HAN</text>
    <text xml:space="preserve" text-anchor="middle" font-family="serif" font-size="14" id="svg_23" y="148.731346" x="471.940279" opacity="0.4" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="0" stroke="#000000" fill="#000000">SURDULICA</text>
    <text xml:space="preserve" text-anchor="middle" font-family="serif" font-size="14" id="svg_24" y="282.126869" x="542.835798" opacity="0.4" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="0" stroke="#000000" fill="#000000">BOSILEGRAD</text>
    <text xml:space="preserve" text-anchor="middle" font-family="serif" font-size="14" id="svg_25" y="366.082094" x="363.73132" opacity="0.4" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="0" stroke="#000000" fill="#000000">TRGOVISTE</text>
    <text xml:space="preserve" text-anchor="middle" font-family="serif" font-size="14" id="svg_26" y="467.761198" x="359.999977" opacity="0.4" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="0" stroke="#000000" fill="#000000">MAKEDONIJA</text>
    <text transform="rotate(-91.32366943359375 619.5181884765625,173.4453125) " xml:space="preserve" text-anchor="middle" font-family="serif" font-size="24" id="svg_27" y="181.380601" x="619.328333" opacity="0.4" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="0" stroke="#000000" fill="#000000">BULGARIA</text>
    <text transform="rotate(-90.47331237792969 43.960937500000036,198.63281250000003) " xml:space="preserve" text-anchor="middle" font-family="serif" font-size="24" id="svg_28" y="206.567167" x="43.768631" opacity="0.4" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="0" stroke="#000000" fill="#000000">KOSOVO</text>
   </g>
  </svg>

    <canvas id="mycanvas"></canvas>

```

Body:
I am having trouble to display the PieChart from ChartJs in the right DIV while I click from the left DIV. If I try to run the chart directly it works but I want to have them on the same page just in different DIVs.
I have put html file for every link and it works fine, but when I want to display the Pie chart which is inside html it is not working. I would like to know where should I check the problem i am confused right now.

check this: Fiddle project

this is my html that should appear:
file: bujanoci_chart.html

    <title>ChartJS - Pie Chart</title>
    <link rel="stylesheet" href="/elections/jscss/svgcss.css">

    <canvas id="mycanvas" height="100" width="250"></canvas>

JS Script:

$(document).ready( function() {
  $("#presheva").on("click", function() {
      $("#posht").load("elections/komuna_preshev.html");
  });
  $("#bujanoci").on("click", function() {
      $("#djathtas").load("elections/bujanoc/bujanoci_chart.html");
  });
  $("#trgovishte").on("click", function() {
      $("#djathtas").load("elections/trgovishte.html");
  });
  $("#bosilegrad").on("click", function() {
      $("#djathtas").load("elections/bosilegrad.html");
  });
  $("#vraja").on("click", function() {
      $("#djathtas").load("elections/vraja.html");
  });
  $("#vhan").on("click", function() {
      $("#djathtas").load("elections/vhan.html");
  });
  $("#surdulica").on("click", function() {
      $("#djathtas").load("elections/surdulica.html");
    }); });

Mycss:

body {
max-width: 100%; margin: 0 auto
}
#majtas{
 background-color: #DCDCDC;
 width: 35%;
 height: 320px;
 display: inline-block;
}
#djathtas{

 width: 65%;
 height: 320px;
 float: right;
 display: inline-block;
}
#posht{
  width: 100%;
  height: 40%;
  display: inline-block;
}
#mycanvas{
 background-color: #DCDCDC;
 width:  35% !important;
 height: 35% !important;
 float: right;
 margin-right: 35%;
 margin-top: 20%;
}
.land{
 fill: #eff2f0;

}
a:hover .land{
 fill: yellow;
}

Body:
Try doing something like this? Click on #presheva to load a new data set.

var ctx = $("#mycanvas").get(0).getContext("2d");
//pie chart data
//sum of values = 360
var data = [{
    value: 270,
    color: "cornflowerblue",
    highlight: "lightskyblue",
    label: "Third"
  },
  {
    value: 50,
    color: "lightgreen",
    highlight: "yellowgreen",
    label: "First"
  },
  {
    value: 40,
    color: "orange",
    highlight: "darkorange",
    label: "Second"
  }
];
//draw
var piechart = new Chart(ctx).Pie(data);

function removeData(chart) {
    chart.data.labels.pop();
    chart.data.datasets.forEach((dataset) => {
        dataset.data.pop();
    });
    chart.update();
}

$("#presheva").on("click", function() {
 // $("#posht").load("elections/komuna_preshev.html");

var ctx = $("#mycanvas").get(0).getContext("2d");
//pie chart data
//sum of values = 360
var data = [{
    value: 200,
    color: "orange",
    highlight: "pink",
    label: "Third"
  },
  {
    value: 120,
    color: "green",
    highlight: "brown",
    label: "First"
  },
  {
    value: 40,
    color: "black",
    highlight: "darkorange",
    label: "Second"
  }
];
//draw
var piechart = new Chart(ctx).Pie(data);

});

$("#bujanoci").on("click", function() {});
$("#trgovishte").on("click", function() {});
$("#bosilegrad").on("click", function() {});
$("#vraja").on("click", function() {});
$("#vhan").on("click", function() {});

$("#surdulica").on("click", function() {});

body {
  max-width: 100%;
  margin: 0 auto
}

#majtas {
  background-color: #DCDCDC;
  width: 35%;
  height: 320px;
  display: inline-block;
}

#djathtas {
  width: 65%;
  height: 320px;
  float: right;
  display: inline-block;
}

#posht {
  width: 100%;
  height: 40%;
  display: inline-block;
}

#mycanvas {
  background-color: #DCDCDC;
  width: 35% !important;
  height: 35% !important;
  float: right;
  margin-right: 35%;
  margin-top: 20%;
}

.land {
  fill: #eff2f0;
}

a:hover .land {
  fill: yellow;
}

<script src="https://code.jquery.com/jquery-3.2.1.js" integrity="sha256-DZAnKJ/6XZ9si04Hgrsxu/8s717jcIzLy3oi35EouyE=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.js"></script>

<div class="komplet">
  <div id="majtas">
    <svg preserveAspectRatio="xMinYMin meet" viewBox="0 0 790 1080" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" stroke="null" style="vector-effect: non-scaling-stroke;">
   <!-- Created with SVG-edit - http://svg-edit.googlecode.com/ -->

   <g stroke="null">
    <title stroke="null">Pcinjski Okrug</title>
    <a href="#" id="presheva"><path class="land" stroke="#000000" id="svg_4" d="m25.524693,415.428482c0,0 -15.759451,-0.809455 -15.759451,-0.809455c0,0 -9.630776,-14.570185 -9.630776,-14.570185c0,0 0,-17.808005 0,-17.808005c0,0 4.377625,-14.570186 4.377625,-14.570186c0,0 10.506301,0.809455 9.663146,0.629636c-0.843155,-0.179818 18.353657,-3.058 18.353657,-3.058c0,0 6.128675,-11.332367 6.128675,-11.332367c0,0 15.759452,2.428365 14.916295,2.248546c-0.843156,-0.179818 7.847357,-7.105274 7.847357,-7.105274c0,0 8.755251,-10.522912 8.755251,-10.522912c0,0 10.506301,8.904002 10.506301,8.904002c0,0 12.257351,6.475638 11.414193,6.29582c-0.843157,-0.179818 21.85576,5.846002 21.012602,5.666183c-0.843159,-0.179818 11.349459,-0.629636 11.349459,-0.629636c0,0 -6.128676,17.808005 -6.128676,17.808005c0,0 4.377626,14.570185 4.377626,14.570185c0,0 16.634976,5.666184 15.791817,5.486364c-0.843159,-0.179819 20.980236,-4.676909 20.137076,-4.856728c-0.84316,-0.17982 15.727086,2.608183 15.727086,2.608183c0,0 10.506301,12.141822 10.506301,12.141822c0,0 7.879726,7.285093 7.036565,7.105273c-0.843161,-0.17982 -8.787615,12.321641 -8.787615,12.321641c0,0 -17.510502,-0.809455 -15.759452,-1.618909c1.75105,-0.809455 -2.626575,7.285092 -3.469735,7.105272c-0.84316,-0.179821 -0.90789,9.083823 -1.75105,8.904002c-0.84316,-0.179821 -5.285516,9.083823 -5.285516,9.083823c0,0 -14.883926,4.047274 -14.883926,4.047274c0,0 -21.888127,4.856729 -22.731285,4.676907c-0.843158,-0.179821 -5.285517,13.131098 -5.285517,13.131098c0,0 -17.510502,-3.237819 -17.510502,-3.237819c0,0 -12.445147,4.595011 -23.639177,-5.666184c-11.19403,-10.261194 -15.759451,-4.047273 -15.759451,-4.047273c0,0 -16.634977,-4.856729 -16.634977,-4.856729c0,0 2.626576,-11.332367 2.626576,-11.332367c0,0 -16.634977,-16.99855 -16.634977,-16.99855c0,0 -0.875525,-9.713457 -0.875525,-9.713457z" fill="#eff2f0"/></a>
    <a href="#" id="bujanoci"><path class="land" stroke="#000000" id="svg_8" d="m190.528078,414.836065c0,0 0,-8.964079 0,-9.220195c0,-0.256117 10.803842,-1.280583 10.803842,-1.280583c0,0 6.648518,4.866214 6.648518,4.866214c0,0 3.878302,7.171263 3.878302,7.171263c0,0 4.155324,-0.256117 4.155324,-0.256117c0,0 3.601281,-2.817282 3.601281,-2.817282c0,0 3.601281,4.097865 3.601281,4.097865c0,0 5.540432,3.841748 5.540432,3.841748c0,0 7.202561,1.536699 7.202561,1.024466c0,-0.512233 16.067252,-10.244661 16.067252,-10.244661c0,0 0,-19.20874 0,-19.20874c0,0 2.216173,-7.171263 2.216173,-7.171263c0,0 -5.540432,-5.89068 -5.540432,-5.89068c0,0 6.371497,-7.171263 6.371497,-7.171263c0,0 6.371497,-4.353981 6.371497,-4.353981c0,0 -5.540432,-9.476312 -5.540432,-9.220195c0,0.256117 4.986389,-2.561165 4.986389,-2.561165c0,0 6.371497,-6.915146 6.371497,-6.915146c0,0 -8.310648,-5.122331 -8.310648,-5.122331c0,0 -3.601281,-6.915146 -3.601281,-6.915146c0,0 -15.236188,-0.512233 -15.236188,-0.512233c0,0 -10.803842,-8.195729 -10.803842,-8.195729c0,0 0.831065,-6.915146 0.716528,-6.930582c-0.114537,-0.015436 -12.628456,0.271552 -12.628456,0.271552c0,0 -17.45236,-20.745439 -17.45236,-20.745439c0,0 -14.682144,-7.427379 -14.682144,-7.427379c0,0 -13.297036,-16.903691 -13.297036,-16.903691c0,0 -8.310648,-13.31806 -8.310648,-13.31806c0,0 -16.067252,-13.31806 -16.067252,-13.31806c0,0 -8.310648,-3.073398 -8.310648,-3.073398c0,0 0.554043,-17.415924 0.554043,-17.415924c0,0 6.371497,-8.195729 6.256958,-8.211166c-0.114538,-0.015437 1.776668,-9.716991 1.776668,-9.716991c0,0 6.92554,-0.256117 6.811002,-0.271554c-0.114538,-0.015437 14.796683,-10.229224 14.796683,-10.229224c0,0 16.344274,-10.756894 16.344274,-10.756894c0,0 9.418734,-9.220195 9.418734,-9.220195c0,0 -4.432345,-8.707962 -4.432345,-8.707962c0,0 -4.986389,-9.732428 -4.986389,-9.732428c0,0 -6.371497,-9.476312 -6.371497,-9.476312c0,0 -13.020015,-0.512233 -13.020015,-0.512233c0,0 -8.310648,-5.122331 -8.310648,-5.122331c0,0 -6.371497,-0.76835 -6.371497,-0.76835c0,0 -3.324259,10.244661 -3.324259,10.244661c0,0 -3.878302,0 -3.878302,0c0,0 -6.094475,-1.792816 -6.094475,-1.792816c0,0 -4.432345,8.195729 -4.432345,8.195729c0,0 -0.554043,14.342526 -0.554043,14.342526c0,0 -12.18895,6.915146 -12.18895,6.915146c0,0 11.080864,21.769905 11.080864,22.026022c0,0.256117 -2.216173,8.964079 -2.216173,8.964079c0,0 -3.601281,6.915146 -3.601281,7.171263c0,0.256117 -10.803842,1.280583 -10.803842,1.280583c0,0 -11.634907,0 -11.634907,0c0,0 -6.648518,11.013011 -6.648518,11.013011c0,0 1.66213,9.988545 1.66213,9.988545c0,0 8.033626,5.378447 8.033626,5.378447c0,0 -0.831065,3.841748 -0.831065,3.841748c0,0 -10.249799,-1.536699 -10.249799,-1.536699c0,0 -1.108086,7.427379 -1.108086,7.427379c0,0 -12.465972,8.451846 -12.465972,8.451846c0,0 -2.216173,8.707962 -2.216173,8.707962c0,0 -8.587669,8.964079 -8.587669,8.964079c0,0 -16.621296,16.903691 -16.621296,16.903691c0,0 9.695756,16.391458 9.695756,16.391458c0,0 4.986389,12.54971 4.986389,12.54971c0,0 2.493194,12.293594 2.493194,12.293594c0,0 17.45236,11.269127 17.45236,11.269127c0,0 14.959166,2.817282 14.959166,2.817282c0,0 10.803842,1.024466 10.803842,1.024466c0,0 4.432345,4.097865 4.432345,4.097865c0,0 -1.66213,8.707962 -1.66213,8.707962c0,0 -1.385108,10.244661 -1.385108,10.244661c0,0 3.047238,9.476312 3.047238,9.476312c0,0 12.18895,5.634564 12.18895,5.634564c0,0 11.911928,-2.561165 11.911928,-2.561165c0,0 13.85108,-1.536699 13.85108,-1.536699c0,0 13.020015,3.841748 13.020015,3.841748c0,0 8.864691,9.476312 8.864691,9.476312c0,0 10.803842,7.427379 10.803842,7.427379z" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" fill="#eff2f0"/></a>
    <a href="#" id="trgovishte"><path class="land" stroke="#000000" id="svg_9" d="m247.129753,389.196212c0,0 6.744786,-0.479677 6.744786,-0.479677c0,0 14.52723,9.113861 15.04606,9.113861c0.51883,0 18.159038,11.512245 18.159038,11.512245c0,0 16.602549,16.309014 16.602549,15.34966c0,-0.959354 12.451912,-10.073214 12.451912,-10.073214c0,0 11.414252,8.634184 11.414252,8.634184c0,0 30.61095,-12.951276 30.61095,-12.951276c0,0 8.301275,6.715476 8.301275,6.715476c0,0 9.857763,-12.471599 9.857763,-12.471599c0,0 14.52723,3.837415 14.008401,3.357738c-0.51883,-0.479677 12.451912,-10.073214 12.451912,-10.073214c0,0 6.744786,-11.512245 6.744786,-11.512245c0,0 25.422653,2.878061 25.422653,2.878061c0,0 2.594148,-11.991922 2.594148,-11.991922c0,0 9.857763,-9.593538 9.857763,-9.593538c0,0 9.338934,1.439031 9.338934,1.439031c0,0 9.857763,-6.235799 9.857763,-6.235799c0,0 14.008401,-1.918708 14.008401,-1.439031c0,0.479677 2.075319,-31.178997 2.075319,-31.178997c0,0 2.594148,-9.593538 2.594148,-9.593538c0,0 -7.263615,-7.195153 -7.263615,-7.195153c0,0 -8.301275,-5.756123 -8.301275,-5.756123c0,0 0,-7.195153 0,-7.195153c0,0 -10.895423,-7.67483 -10.895423,-7.67483c0,0 -14.008401,-2.398384 -14.008401,-2.398384c0,0 -7.782445,-7.67483 -7.782445,-7.67483c0,0 -12.970741,-9.593538 -12.970741,-9.593538c0,0 -12.970741,11.991922 -12.970741,11.991922c0,0 1.037659,10.073214 1.037659,10.073214c0,0 -13.489571,1.439031 -13.489571,1.439031c0,0 -5.707126,9.593538 -5.707126,9.593538c0,0 -24.384994,-0.479677 -24.384994,-0.479677c0,0 -13.489571,-8.634184 -13.489571,-8.634184c0,0 -1.037659,25.422875 -1.037659,25.422875c0,0 -17.121379,-0.959354 -17.121379,-0.959354c0,0 -22.828505,14.390306 -22.828505,14.390306c0,0 -12.970741,-4.796769 -12.970741,-4.796769c0,0 -5.707126,-7.67483 -5.707126,-7.67483c0,0 -1.037659,10.552891 -1.037659,10.552891c0,0 -11.414252,0 -11.414252,0c0,0 -12.451912,5.276446 -12.970741,5.276446c-0.51883,0 -10.895423,5.756123 -10.895423,5.756123c0,0 -9.338934,11.991922 -9.338934,11.991922c0,0 2.075319,8.634184 2.075319,8.634184c0,0 -8.820104,10.552891 -8.820104,10.552891c0,0 4.150637,12.951276 4.150637,12.951276z" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" fill="#eff2f0"/></a>
    <a href="#" id="bosilegrad"><path class="land" stroke="#000000" id="svg_10" d="m456.218105,177.658707c0,0 5.707126,14.869983 5.707126,14.869983c0,0 14.008401,-1.918708 13.489571,-1.439031c-0.51883,0.479677 6.744786,-4.317092 6.744786,-4.317092c0,0 8.301275,11.991922 8.301275,11.991922c0,0 41.506373,-0.959354 41.506373,-0.959354c0,0 6.225956,6.235799 6.225956,6.235799c0,0 8.301275,-2.398384 8.301275,-2.398384c0,0 3.631808,6.715476 3.631808,6.715476c0,0 11.933082,-0.959354 12.451912,-0.959354c0.51883,0 12.451912,0.479677 12.451912,0.479677c0,0 12.451912,12.471599 12.451912,12.471599c0,0 10.895423,14.869983 10.895423,14.869983c0,0 11.933082,0.959354 11.933082,0.959354c0,0 12.970741,16.788691 12.970741,16.788691c0,0 11.414252,26.861905 11.414252,26.861905c0,0 -9.857763,11.512245 -9.857763,11.512245c0,0 1.556489,13.91063 1.556489,13.91063c0,0 -6.744786,5.756123 -6.744786,5.756123c0,0 1.556489,11.512245 2.594148,11.512245c1.037659,0 -7.263615,17.748045 -7.263615,17.748045c0,0 -27.497972,5.276446 -27.497972,5.276446c0,0 0,8.634184 0,8.634184c0,0 -13.489571,10.073214 -13.489571,11.032568c0,0.959354 1.037659,24.463521 1.037659,24.463521c0,0 -12.451912,9.593538 -12.451912,9.593538c0,0 -15.04606,-3.357738 -15.04606,-3.357738c0,0 -10.895423,-1.439031 -10.895423,-1.439031c0,0 -19.196697,8.154507 -19.196697,8.154507c0,0 -7.263615,7.67483 -8.301275,7.67483c-1.037659,0 -43.581691,-26.382228 -44.100521,-26.861905c-0.51883,-0.479677 1.037659,-15.34966 1.037659,-15.34966c0,0 13.489571,-11.512245 13.489571,-11.512245c0,0 1.556489,-18.707398 1.556489,-18.707398c0,0 3.112978,-14.869983 3.112978,-14.869983c0,0 -11.933082,-11.991922 -11.933082,-11.991922c0,0 -4.150637,-2.878061 -4.150637,-2.878061c0,0 -3.631808,-9.593538 -3.631808,-9.593538c0,0 -12.451912,-4.317092 -12.451912,-4.317092c0,0 -11.414252,-5.276446 -11.414252,-5.276446c0,0 -11.933082,-9.113861 -11.933082,-9.113861c0,0 -9.338934,-6.235799 -9.338934,-6.235799c0,0 0,-26.382228 0,-26.382228c0,0 10.376593,-7.195153 10.376593,-7.195153c0,0 -1.556489,-14.869983 -1.556489,-14.869983c0,0 4.150637,-13.430953 4.150637,-13.430953c0,0 7.263615,-2.398384 7.263615,-2.398384c0,0 4.150637,-11.032568 5.188297,-11.991922c1.037659,-0.959354 11.414252,-19.666752 11.414252,-19.666752z" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" fill="#eff2f0"/></a>
    <a href="#" id="vraja"><path class="land" stroke="#000000" id="svg_11" d="m151.924511,145.760195c0,0 -2.594148,-6.715476 -2.594148,-6.715476c0,0 -9.338934,-11.991922 -9.338934,-11.991922c0,0 -6.225956,-8.154507 -6.225956,-8.154507c0,0 -5.188297,-11.512245 -5.188297,-11.512245c0,0 12.970741,0.479677 12.970741,0.479677c0,0 4.669467,-9.113861 4.669467,-9.113861c0,0 3.631808,-8.634184 3.631808,-8.634184c0,0 -2.594148,-18.707398 -2.594148,-18.707398c0,0 10.376593,0 10.376593,0c0,0 -0.51883,-8.154507 -0.51883,-8.154507c0,0 9.857763,-3.357738 9.857763,-3.357738c0,0 -2.594148,-8.154507 -2.594148,-8.154507c0,0 6.225956,-9.593538 6.225956,-9.593538c0,0 10.895423,0 10.895423,0c0,0 6.744786,-4.796769 6.225956,-4.796769c-0.51883,0 15.04606,4.796769 15.04606,4.796769c0,0 8.301275,-7.195153 8.301275,-7.195153c0,0 20.234357,0.479677 20.234357,0.479677c0,0 4.150637,-5.756123 4.150637,-5.756123c0,0 12.970741,6.715476 12.970741,6.715476c0,0 -2.075319,9.113861 -2.075319,9.113861c0,0 -6.744786,-1.439031 -7.782445,-1.439031c-1.037659,0 -0.51883,8.634184 -0.51883,8.634184c0,0 -6.225956,7.67483 -6.225956,7.67483c0,0 0.51883,10.552891 0.51883,10.552891c0,0 4.150637,9.113861 4.150637,9.113861c0,0 -4.669467,15.829337 -4.669467,15.829337c0,0 -3.631808,27.821259 -3.631808,27.821259c0,0 2.594148,34.536735 2.594148,34.536735c0,0 9.338934,10.073214 9.338934,10.073214c0,0 16.083719,-3.837415 16.083719,-3.357738c0,0.479677 7.782445,11.991922 7.782445,11.991922c0,0 3.112978,20.626106 3.112978,20.626106c0,0 20.753186,1.918708 20.753186,1.918708c0,0 22.309675,-18.227721 22.309675,-18.227721c0,0 27.497972,11.032568 27.497972,11.032568c0,0 26.460313,-1.918708 26.979142,-1.918708c0.51883,0 -0.51883,-12.471599 -0.51883,-12.471599c0,0 14.52723,-2.878061 14.52723,-2.878061c0,0 19.196697,23.02449 19.196697,23.02449c0,0 18.159038,-0.479677 18.159038,-0.479677c0,0 10.376593,13.91063 10.376593,13.91063c0,0 8.820104,1.439031 8.820104,1.439031c0,0 -4.150637,10.552891 -4.150637,10.552891c0,0 1.556489,15.829337 1.556489,15.829337c0,0 -9.857763,7.195153 -9.857763,7.195153c0,0 1.556489,30.69932 1.556489,30.69932c0,0 -12.451912,10.073214 -12.451912,10.073214c0,0 2.075319,8.634184 2.075319,8.634184c0,0 -12.970741,3.357738 -12.970741,3.357738c0,0 -5.707126,8.154507 -5.707126,8.154507c0,0 -23.866164,0.479677 -23.866164,0.479677c0,0 -14.52723,-8.634184 -14.52723,-8.634184c0,0 -1.556489,22.065137 -2.075319,22.544813c-0.51883,0.479677 -16.083719,1.918708 -16.083719,1.918708c0,0 -23.347335,14.390306 -23.347335,14.390306c0,0 -13.489571,-5.756123 -13.489571,-5.756123c0,0 -5.188297,-9.593538 -5.188297,-9.593538c0,0 -1.556489,12.471599 -1.556489,12.471599c0,0 -7.782445,-0.479677 -8.301275,0c-0.51883,0.479677 -26.460313,13.430953 -26.460313,13.430953c0,0 -10.895423,-10.073214 -10.895423,-10.073214c0,0 -12.970741,-2.398384 -14.008401,-2.398384c-1.037659,0 -11.933082,-8.154507 -11.933082,-8.154507c0,0 -1.037659,-8.154507 -1.037659,-8.154507c0,0 -10.895423,0.959354 -10.895423,0.959354c0,0 -18.677868,-21.58546 -18.677868,-21.58546c0,0 -11.933082,-6.235799 -11.933082,-6.235799c0,0 -26.979142,-34.057059 -26.979142,-34.057059c0,0 -20.753186,-13.91063 -20.753186,-13.91063c0,0 9.338934,-31.658674 9.338934,-31.658674c0,0 49.288817,-33.097705 49.288817,-33.097705c0,0 -19.196697,-29.26029 -19.196697,-29.26029c0,0 -14.52723,-0.959354 -14.52723,-0.959354c0,0 -6.225956,-4.317092 -6.225956,-4.317092z" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" fill="#eff2f0"/></a>
    <a href="#" id="vhan"><path class="land" stroke="#000000" id="svg_12" d="m237.25028,64.35004c0,0 -12.350267,12.711142 -12.350267,12.711142c0,0 9.128458,16.133373 9.128458,16.133373c0,0 -4.832713,22.488944 -5.369681,23.466724c-0.536968,0.97778 -2.684841,54.2668 -2.684841,54.2668c0,0 12.350267,11.733362 12.350267,11.733362c0,0 12.350267,-3.422231 12.350267,-3.422231c0,0 11.276331,13.688923 11.276331,13.688923c0,0 1.073936,17.111153 1.073936,17.111153c0,0 22.015694,3.422231 22.015694,3.422231c0,0 23.08963,-16.133373 23.08963,-16.133373c0,0 26.311439,10.266692 26.848407,9.777802c0.536968,-0.48889 26.848407,-2.44445 26.848407,-2.44445c0,0 -1.610904,-12.222252 -1.610904,-12.222252c0,0 -27.922343,-12.222252 -27.922343,-12.222252c0,0 -5.369681,-23.955615 -5.369681,-23.955615c0,0 17.182981,-7.822241 17.182981,-7.822241c0,0 4.295745,-23.955615 4.295745,-23.955615c0,0 22.015694,-1.95556 22.015694,-1.95556c0,0 2.684841,-17.600043 2.684841,-17.600043c0,0 -12.350267,-8.311132 -12.350267,-8.311132c0,0 11.813299,-20.533384 11.813299,-20.533384c0,0 17.719949,-1.95556 17.719949,-1.95556c0,0 3.758777,-8.311132 3.758777,-8.311132c0,0 24.163566,-7.333351 24.163566,-7.333351c0,0 -6.980586,-15.644483 -6.980586,-15.644483c0,0 -8.59149,7.822241 -8.59149,8.311132c0,0.48889 -17.719949,-5.377791 -17.719949,-5.377791c0,0 -1.073936,-11.733362 -1.073936,-12.711142c0,-0.97778 -10.202395,1.46667 -10.202395,1.46667c0,0 -10.739363,14.177813 -10.739363,14.177813c0,0 -22.015694,-9.777802 -22.015694,-9.777802c0,0 13.961172,-8.311132 13.961172,-8.311132c0,0 -9.128458,-15.155593 -9.128458,-15.155593c0,0 -20.941758,0.97778 -20.941758,0.97778c0,0 -21.478726,14.177813 -21.478726,14.177813c0,0 -13.961172,1.46667 -13.961172,1.46667c0,0 -3.221809,-12.222252 -3.221809,-12.222252c0,0 -16.109044,2.44445 -16.109044,2.44445c0,0 -3.758777,17.600043 -3.758777,17.600043c0,0 -9.665427,4.888901 -9.665427,4.888901c0,0 -13.961172,3.422231 -13.961172,3.422231c0,0 -5.369681,16.133373 -5.369681,16.133373z" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" fill="#eff2f0"/></a>
    <a href="#" id="surdulica"><path class="land" stroke="#000000" id="svg_13" d="m417.176174,59.058598c0,0 24.903824,17.268368 24.903824,17.268368c0,0 21.272016,2.878061 21.272016,2.878061c0,0 5.188297,-12.951276 5.188297,-12.951276c0,0 16.602549,-7.195153 17.121379,-7.195153c0.51883,0 16.602549,-7.195153 16.602549,-7.195153c0,0 12.451912,-22.065137 12.451912,-22.065137c0,0 16.083719,-0.959354 16.083719,-0.959354c0,0 22.828505,-5.276446 22.828505,-5.276446c0,0 13.489571,23.983844 13.489571,23.983844c0,0 12.451912,21.105783 12.451912,21.105783c0,0 11.414252,16.309014 11.414252,16.309014c0,0 -8.820104,23.02449 -8.820104,23.02449c0,0 -10.376593,19.187075 -10.376593,19.187075c0,0 -2.075319,28.780613 -2.075319,28.780613c0,0 4.669467,19.187075 4.669467,19.187075c0,0 -4.669467,18.227721 -4.669467,18.227721c0,0 -11.414252,21.105783 -11.414252,21.105783c0,0 -6.225956,6.235799 -6.744786,6.235799c-0.51883,0 -11.414252,-2.878061 -11.414252,-2.878061c0,0 -14.52723,-5.276446 -14.52723,-5.276446c0,0 -30.61095,-0.959354 -30.61095,-0.959354c0,0 -11.414252,-9.113861 -11.414252,-9.113861c0,0 -19.196697,3.837415 -19.196697,3.357738c0,-0.479677 -7.263615,-15.34966 -7.263615,-15.34966c0,0 -18.159038,31.658674 -18.159038,31.658674c0,0 -14.008401,1.918708 -14.52723,1.918708c-0.51883,0 -12.451912,-12.951276 -12.451912,-12.951276c0,0 -18.159038,0 -18.159038,0c0,0 -19.196697,-23.504167 -19.715527,-23.504167c-0.51883,0 -14.52723,4.317092 -14.52723,4.317092c0,0 -28.535631,-11.991922 -28.535631,-11.991922c0,0 -5.188297,-23.504167 -5.188297,-23.504167c0,0 16.602549,-7.67483 16.602549,-7.67483c0,0 4.669467,-22.544813 4.669467,-22.544813c0,0 20.753186,-2.878061 20.753186,-2.878061c0,0 3.112978,-17.748045 3.112978,-17.748045c0,0 -11.933082,-11.032568 -11.933082,-11.032568c0,0 9.338934,-14.390306 9.338934,-14.390306c0,0 18.677868,-4.796769 18.677868,-4.796769c0,0 2.594148,-7.67483 2.594148,-7.67483c0,0 27.497972,-8.634184 27.497972,-8.634184z" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" fill="#eff2f0"/></a>
    <text xml:space="preserve" text-anchor="middle" font-family="serif" font-size="14" id="svg_18" y="423.917914" x="89.589524" opacity="0.4" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="0" stroke="#000000" fill="#000000">PRESEVO</text>
    <text xml:space="preserve" text-anchor="middle" font-family="serif" font-size="14" id="svg_19" y="352.089557" x="157.686539" opacity="0.4" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="0" stroke="#000000" fill="#000000">BUJANOVAC</text>
    <text xml:space="preserve" text-anchor="middle" font-family="serif" font-size="14" id="svg_20" y="275.597018" x="271.492509" opacity="0.4" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="0" stroke="#000000" fill="#000000">VRANJE</text>
    <text xml:space="preserve" text-anchor="middle" font-family="serif" font-size="14" id="svg_22" y="118.880599" x="288.171619" opacity="0.4" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="0" stroke="#000000" fill="#000000">V. HAN</text>
    <text xml:space="preserve" text-anchor="middle" font-family="serif" font-size="14" id="svg_23" y="148.731346" x="471.940279" opacity="0.4" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="0" stroke="#000000" fill="#000000">SURDULICA</text>
    <text xml:space="preserve" text-anchor="middle" font-family="serif" font-size="14" id="svg_24" y="282.126869" x="542.835798" opacity="0.4" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="0" stroke="#000000" fill="#000000">BOSILEGRAD</text>
    <text xml:space="preserve" text-anchor="middle" font-family="serif" font-size="14" id="svg_25" y="366.082094" x="363.73132" opacity="0.4" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="0" stroke="#000000" fill="#000000">TRGOVISTE</text>
    <text xml:space="preserve" text-anchor="middle" font-family="serif" font-size="14" id="svg_26" y="467.761198" x="359.999977" opacity="0.4" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="0" stroke="#000000" fill="#000000">MAKEDONIJA</text>
    <text transform="rotate(-91.32366943359375 619.5181884765625,173.4453125) " xml:space="preserve" text-anchor="middle" font-family="serif" font-size="24" id="svg_27" y="181.380601" x="619.328333" opacity="0.4" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="0" stroke="#000000" fill="#000000">BULGARIA</text>
    <text transform="rotate(-90.47331237792969 43.960937500000036,198.63281250000003) " xml:space="preserve" text-anchor="middle" font-family="serif" font-size="24" id="svg_28" y="206.567167" x="43.768631" opacity="0.4" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="0" stroke="#000000" fill="#000000">KOSOVO</text>
   </g>
  </svg>
  </div>
  <div id="djathtas">

    <canvas id="mycanvas"></canvas>

  </div>
  <div id="posht"></div>
</div>


问:
TabHost inside Fragment
I'm trying to create a tabHost inside a Fragment, so I can create a tabs inside that fragment I've tried changing the extends to android.support.v4.app.Fragment but then the complete app won't build. This issue I have is the following:

```<code>wrong 2nd argument type. found'android.app.fragment' required 'android.support.v4.app.fragment'
</code>```

This is the code I wrote:

```<code>public class TimeTableFragment extends Fragment {
FragmentNameFactory nameFactory = new FragmentNameFactory();
String body;
String major;
String status;
private FragmentTabHost mTabHost;
public TimeTableFragment(){

}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceStatus){
    ((MainActivity) getActivity()).setFragmentName(nameFactory.getNameNL(7));
    View view = inflater.inflate(R.layout.ftimetable, container, false);
    mTabHost = (FragmentTabHost) view.findViewById(android.R.id.tabhost);
    mTabHost.setup(getActivity(), getChildFragmentManager(), R.id.realtabcontent);
    mTabHost.setup();
    mTabHost.addTab(mTabHost.newTabSpec("fragmentb").setIndicator("Fragment B"));
    mTabHost.addTab(mTabHost.newTabSpec("fragmentc").setIndicator("Fragment C"));
    mTabHost.addTab(mTabHost.newTabSpec("fragmentd").setIndicator("Fragment D"));

    return view;
}
@Override
public void onViewCreated(View view, Bundle savedInstance){
    super.onViewCreated(view, savedInstance);
}
@Override
public void onActivityCreated(Bundle savedInstance){
    super.onActivityCreated(savedInstance);
}}
</code>```

The .xml (ftimetables):

```<code><?xml version="1.0" encoding="utf-8"?>
<TabHost
    android:id="@android:id/tabhost"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:android="http://schemas.android.com/apk/res/android">

    <LinearLayout
        android:layout_width="match_parent"
        android:id="@+id/linearLayout1"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <TabWidget
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@android:id/tabs">
        </TabWidget>

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:id="@android:id/tabcontent">
        </FrameLayout>
    </LinearLayout>
</TabHost>
</code>```

I hope someone can help me fix this issue!

答:
change your TimeTableFragment import code</p>

```<code>import android.app.fragment(x)
import android.support.v4.app.fragment(o)
</code>```

Title: TabHost inside Fragment

Body:
I'm trying to create a tabHost inside a Fragment, so I can create a tabs inside that fragment I've tried changing the extends to android.support.v4.app.Fragment but then the complete app won't build. This issue I have is the following:

wrong 2nd argument type. found'android.app.fragment' required 'android.support.v4.app.fragment'

This is the code I wrote:

public class TimeTableFragment extends Fragment {
FragmentNameFactory nameFactory = new FragmentNameFactory();
String body;
String major;
String status;
private FragmentTabHost mTabHost;
public TimeTableFragment(){

}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceStatus){
    ((MainActivity) getActivity()).setFragmentName(nameFactory.getNameNL(7));
    View view = inflater.inflate(R.layout.ftimetable, container, false);
    mTabHost = (FragmentTabHost) view.findViewById(android.R.id.tabhost);
    mTabHost.setup(getActivity(), getChildFragmentManager(), R.id.realtabcontent);
    mTabHost.setup();
    mTabHost.addTab(mTabHost.newTabSpec("fragmentb").setIndicator("Fragment B"));
    mTabHost.addTab(mTabHost.newTabSpec("fragmentc").setIndicator("Fragment C"));
    mTabHost.addTab(mTabHost.newTabSpec("fragmentd").setIndicator("Fragment D"));

    return view;
}
@Override
public void onViewCreated(View view, Bundle savedInstance){
    super.onViewCreated(view, savedInstance);
}
@Override
public void onActivityCreated(Bundle savedInstance){
    super.onActivityCreated(savedInstance);
}}

The .xml (ftimetables):

<?xml version="1.0" encoding="utf-8"?>
<TabHost
    android:id="@android:id/tabhost"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:android="http://schemas.android.com/apk/res/android">

    <LinearLayout
        android:layout_width="match_parent"
        android:id="@+id/linearLayout1"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <TabWidget
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@android:id/tabs">
        </TabWidget>

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:id="@android:id/tabcontent">
        </FrameLayout>
    </LinearLayout>
</TabHost>

I hope someone can help me fix this issue!

Body:
change your TimeTableFragment import code

import android.app.fragment(x)
import android.support.v4.app.fragment(o)


问:
Getting all the rows of a MySQL table and putting them in a listbox
I want to get all the rows of table of a MySQL database and store them in a listbox. I am using vb.net. Thanks in advance.</p>

答:
```<code>    Dim connection As New SqlConnection
    Dim cmd As New SqlCommand
    Dim dr As SqlDataReader
    Dim Column0 As String

    connection.ConnectionString = "Data Source=localhost; Initial Catalog=catalogname; Integrated Security=True; Connection Timeout=3"

    Dim query As String = "SELECT * FROM MyDB"

    connection.Open()

    cmd = New SqlCommand(query, connection)
    dr = cmd.ExecuteReader

    If dr.Read() Then
    Column0 = dr(0)
    End If

    connection.Close()
</code>```