《ELON MUSK》

阿什利·万斯 (Ashlee Vance) 专栏作家

a fly whose buzzing had been driving me insane
the townspeople have a sturdy independence
the government's chief adviser
no man is so evil as to be beyond redemption
bust out
I was mesmerized: she looked so incredible

his health will no longer enable him to sustain the heavy burdens of office
they equated the railroad with progress and civilization
well-intentioned dreamer
hyperlogical worldviews
the film is seriously intentioned and honorable in purpose
I have broadened my worldview by experiencing a whole new culture

techno-utopian
it is easy to dismiss this as naive or utopian
a utopian ideology
the managing director and his assistant
loyal service
they treat Scotland as a mere appendage of England
some kind of architectural boring rectangle movement
Wootton Bassett has retained much of its architectural heritage
Los Angeles Clippers
Los Angeles Lakers

high-profile : attracting much attention or publicity.
the money was spent without congressional authority
an officer in uniform
their goggle mesmerizes even fishmongers
it is not capable of mathematical demonstration

there is no issue as to excess of jurisdiction
he attempted to plead insanity
expected to pull all-nighters
wear a dirt-inspired ensemble of khaki pants、khaki jackets
the pale khaki sand
the company's failure to diversify and innovate competitively
may I venture to add a few comments?
Warsaw is the capital of Poland
Silicon Valley

assassin creed
his blackly comic futuristic fantasy
issues of race and national identity
a show of independence is its only hope of avoiding annihilation in next year's elections
she's both sensitive and tough
a cold compress

he went to the cathedral because he chose to worship in a spiritually inspiring building
the essence of steampunk is homage to vintage fashion with a modern, sassy twist
a samurai sword

Its principal advantage, and a major difference from other methods, is that it provides you with constant positive reinforcement.

a military historian
big, muscular, athletic boys
the company is heavily reliant on the baby market
neither did she want a secret affair, snatching odd moments together
calf-ropers are the whiz-kids of rodeo
chiropractor

individual serving dishes
the unnecessary bureaucracy in local government
a gaggle of meddlesome politicians
a single incident of rudeness does not support a finding of contemptuous conduct
there was a tremendous explosion
you want to flip for it?
species were grouped according to pollution tolerance

a mechanical and electrical engineer
retail complexes residential subdivisions

the interrelationship between the comprehension and production of early vocabulary
surge pricing is algorithmic and responds automatically to the large increase in demand
he dismissed the allegation as absolute fiction
comic and fantastic exaggeration
a plowed field

high-tech digital photographic equipment
encyclopedias  : a book or set of books giving information on many subjects or on many aspects of one subject and typically arranged alphabetically
strong affectionate attachment to his siblings and cousins
a happy and affectionate family
this young man is my good genius, my guardian angel
a portrait of George III

one in three marriages ends in divorce
the team's defense is excellent, particularly their two center backs
read from cover to cover
from time to time / sometimes
this disorder is inherited as a dominant
some enterprising teachers have started their own recycling programs
profound social changes
the place smelled awful

accomplish ： achieve or complete successfully.
the corresponding Jamaican word is ‘bada’
atoms which possess an odd number of electrons
The marked-up document clearly highlighted the important sections, making it easier for the team to review and understand the content.
the wealthy nations of the world
a compound of hydrogen and oxygen
their goggle mesmerizes even fishmongers
his formative years

the noise from the crowd was incredible
I'm going to motivate kids to study civics
their past record does not inspire confidence
the institution of marriage

as a likable , quiet ,unspectacular student : not spectacular; unremarkable
my favorite aunt is very eccentric
the children arrange and rearrange the objects in a set and recount them each time
so you think I'm a spy? How absurd!
academic feats: an achievement that requires great courage, skill, or strength.

press coverage
the book is ready to go to press
outrank  ： have a higher rank than (someone else)
plans offering financial assistance to employers
I need to catch up on some paperwork
the refugees could be granted dual citizenship
escape can be a strong motivation for travel

as a young man he joined the military and pursued a career in the Army
I'll clean the basement and shovel the walk
reunite  : come together or cause to come together again after a period of separation or disunity
I am headstrong and like getting my own way

homemade apple pies
a prominent political thinker and intellectual
she gave him a melting smile
the torrid heat of the afternoon
the romance from The Gadfly became a popular favorite

the great books of Western civilization
it's your own fault, chum
his mother was hard-working and ambitious for her four children
her business empire grew
there's an intensity in his eyes that's downright scary
the competitiveness of the agricultural sector

Mexico's hybrid postconquest culture
a long and complicated saga
he was ingenious enough to overcome the limited budget
the Boston metropolitan area
he received a rudimentary education

his seminal work on chaos theory
investor ：a person or organization that puts money into financial plans, property, etc. with the expectation of achieving a profit.

a classified catalog of books
in his will, he divided his estate between his wife and daughter
everyone just sits in front of the TV for entertainment
a blockbuster pay-per-view special event
the club's financial predicament
he looks at the mechanics of a car before the bodywork
each man has only a quantum of compassion

I am convinced the war will be over in a matter of months
relatively affluent people
a total investment of $50,000
the social and economic infrastructure of a country

add the cheeses and butter and process briefly to incorporate them
rumors of prodigious happenings, such as monstrous births
may I venture to add a few comments?
windfall profits
he was gazing into the water with absorbed attention

a joint founder
may I venture to add a few comments?
the global economy is essentially capitalist
a promotion to divisional sales director

the social and economic infrastructure of a country

That's my lesson for taking a vacation.


request JSON encode

So Fuel can parse a JSON response... but can it encode an object to JSON for a request?

No, it can't.

However, you can easily add extension method for Fuel or for String with your json library.


convert solr schema configuration from schema api fields to configset

We were able to setup the test solr core in PUL test infrastructure with the new ansible playbook, indexed content into Solr, and it seems like searching the public interface is working as expected — so I think this can be considered done also.


Documentation of complicated options

The plot module is very powerful and very complicated to fully understand.  There is an ocean of complexity between specifying how to plot a circle and how to plot a quoted line.  The circle only has size, color, and pen to worry about, while for the quoted line we have six directives that determine where the text will be placed, then up to 20 modifiers to control various aspects of the result, from fonts to alignments to text being placed.  Decorated lines are simpler in that there are only 8 modifiers to worry about.  The segmentation option (-F) is another plot option that I think is extremely difficult to penetrate without more explanations in the form of examples. The error bar option -E, which includes box-and-whisker specifications, could also need a simple plot to explain the moving parts.  There are probably others.
We actually have many examples of these options spread across our tests and gallery.  However, I do not think we want to add page-size plots needed to fully cover quoted lines directly in the plot documentation.  My proposal is therefore this:
Have more of a teaser figure as a heading for quoted lines and similar complicated options.  This has been implemented.  Then, there should be a link to a separate page for more details, similar to how we punt off the full explanation for all the modifiers related to vectors.  I think the same applies to decorated lines, segmentation, and probably fronts. And custom symbols.  We have an appendix on the custom symbol macro but very few pictures.  The simpler stuff like error bars can fit in a small figure beneath that option.
The new pages should also form the backbone of another entry to the documentation that does not go through the modules. We have talked about this before as well.  E.g., maybe a HOW-TO page that lists various how-tos:

How to plot symbols?
How to draw lines?
How to plot polygons?
How to plot text?
How to plot grids?

etc.  These would cross-link to the detailed pages and back to the corresponding modules.  The modules would also link to the same pages.  So whether you know you need to use plot of whether you just know you want to plot lines, in either case you will find eventually yourself on the same page discussing the details, with examples.  I note the vector attribute page that explains all the modifiers is completely free of illustrations. I think with GMT, a picture really is worth a 1000 words, so there is much to do here.  A competent GMT scripter could make many of these illustrations.

I moved this issue over to the gmt-examples repository as a place to host the simple how-to guides in the gallery section.


docker exec run under the user when container was created

I wanna use macvlan to manage my network between containers and then I have to run ip link addr add <IP_ADDRESS>/16 dev veth in container,  of course this requires root, but my container runs under its own user like 2001, so I am wondering if docker exec can be run in root mode as an option.

@tonicbupt  yes, docker exec can be run in root mode as an option. see #12025

@coolljt0725 bravo! so I can wait the next release! thanks!
@CMGS your agent can now get rid of nsenter


Fix for issue #99 - Shallow copy methods (and tests) for categories

Adding shallow copy methods for the ExpenseCategory and IncomeCategory classes - as well as accompanying unit tests

Welcome on board. Thank you for contributing.
The code looks great, one little nitpick - can you add a similar Copy method for the PaymentMethod type?

There's quite a lot of duplicate code here. Would it be better to have a generic Copy method, that takes a type? I think I could make it work. Let me know what you think.

That definitely sounds interesting. Would love to see a POC.
In the meantime I will merge this, so if you don't mind open a new PR with the updated code


Roll engine cb549c41d314..deaf14ec7de9 (2 commits)

https://github.com/flutter/engine/compare/cb549c41d314...deaf14ec7de9
git log cb549c41d314..deaf14ec7de9 --first-parent --oneline
2020-04-22<EMAIL_ADDRESS>Use Float32List as Matrix storage inside the Web engine (flutter/engine#17856)
2020-04-22<EMAIL_ADDRESS>Roll fuchsia/sdk/core/linux-amd64 from 7Q4KR... to kEtiu... (flutter/engine#17875)
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC<EMAIL_ADDRESS>on the revert to ensure that a human
is aware of the problem.
To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

Gold has detected one or more untriaged digests on patchset 2.
Please triage them at https://flutter-gold.skia.org/search?issue=55398.

Commit queue failed; closing this roll.


Support navigation during prerendering

OnInit of a page, I check to see if the user is logged in. If they are not, I use IUriHelper to redirect to the login page. Right now, there is an error when I try do this:
"Navigation is not allowed during prerendering"
After the error, it does indeed navigate to the login page.
Not sure if it is related to this bug: https://github.com/aspnet/AspNetCore/issues/8422
Sounds like it could be similar.

Thanks for contacting us, @sbuchok.
We will try to add an ability of navigating while prerendering on the server side.
A component which requires authorization and redirects if not authorized is one example.

No no, thank you. BTW, I'm loving working with Blazor/Razor Components so far. You guys are doing awesome.


Bug: VRF and IP Prefixes menu

After clicking on an IP Prefix from the VRF view.
When you want to go back to the VRF clicking on the ribbon menu, the VRF menu links to:
http://netbox.localdomain/ipam/prefixes/?vrf=1 instead of http://netbox.localdomain/ipam/vrfs/1/

Duplicate of #696


Feature request: Nexus plugins

I would LOVE to see support to create plugins in Nexus so that we can create plugins like nexus-prisma.
I think this is the best way to do schema stitching within Nexus.
My current use case, as an example, is with Stripe. I am working on stripe-graphql and I would like to use it for some projects within Nexus to do schema stitching but in a more powerful way so that I can save time.
This "powerful way" allow us to:

Select/hide only the fields we want.
Rename fields.
Override the resolver.

const Card = stripeObjectType({
  name: "Card",
  definition(t) {
    t.stripeFields([
      "id",
      "brand",
      "last4",
      { name: "exp_month", alias: "expMonth" },
      { name: "exp_year", alias: "expYear" }
    ])
  },
});

Pros that I see:

It is easy to use/understand.
It is more clear than the current ugly schema stitching.
Nexus becomes more robust.
Type-safe with TypeScript.
With the ability to create plugins in Nexus, developers will be familiarized with the same syntax for any plugin.
nexus-prisma won't have to maintain its own plugin, just the logic.

However, I got a question. How to use more than one plugin for the same object type? (I am not sure if there are important use cases for that.)
How many of you would be up for this? Let's see the support.

I would LOVE to see support to create plugins in Nexus so that we can create plugins like nexus-prisma.

Actually considered this when building Nexus, (adding the ability to extend the t. namespace) and opted against it, in favor of composition. Prisma is sort of a special case in what they're doing with mapping a against a completely different generated GraphQL schema internally.
For cases like what you're suggesting you can usually just create "higher order functions" that expose a custom/configurable options object to achieve something like what you're going for:
const cardFieldTypeMapping = {
  id: 'ID',
  exp_month: 'Int',
  exp_year: 'Int',
  brand: 'String',
  last4: 'String'
}

interface TodoStripeTypes {
  // ... not taking the time to define these right now,
  // but it should be fairly straightforward
}

function stripeObjectType(cfg: TodoStripeTypes) {
   const {
     definition,
     cardFields = ['id', 'brand', 'last4', 'exp_month', 'exp_year']
   } = cfg
   return objectType({
      name: cfg.name,
      definition(t) {
        cardFields.forEach(field => {
          if (typeof field === 'string') {
            t.field(field, { type: cardFieldTypeMapping[field] })
          } else if (field && typeof field === 'object')  {
            Object.keys(field).forEach((key) => {
              t.field(field[key], {
                type: cardFieldTypeMapping[key],
                resolve: (root) => root[key]
              })
            })
          }
        })
        if (typeof definition === 'function') {
          definition(t)
        }
      }
   })
}

then you can do:
const Card = stripeObjectType({
  name: "Card",
  cardFields: ["id", "brand", "last4", { exp_month: "expMonth" }, { exp_year: "expYear" }]
});

and optionally add new fields by providing a definition block:
const Card = stripeObjectType({
  name: "Card",
  cardFields: ["id", "brand", "last4", { exp_month: "expMonth" }, { exp_year: "expYear" }],
  definition(t) {
    t.field('filteredCharges', {
      type: 'SomeCustomType',
      list: true,
      resolve() {
        // ...
      }
    })
  }
});

How many of you would be up for this? Let's see the support.

Before we use a popular vote to determine this feature, let's think more through the cases we're solving for and how they can be accomplished with the existing features of nexus. I do plan on simplifying some of the patterns used internally by nexus-prisma within nexus in order to help make the schema-composition work a little clearer than it does now.

@tgriesser Thanks for your detailed response. However, it is still confusing to me.
I would like that stripe-graphql exposes stripeObjectType so that I can use it in my projects. I already did this but I think I am missing something because I am not connecting the schemes. How can I do so? Does it require extra config? Right now I am getting an error which is "Error: prismaObjectType can only be used by makePrismaSchema". I have no idea about this.
PS: I know this issue is labeled as discussion but I would like to get it working so I can see pros and cons, and bring to this thread a more robust opinion.

Are you using makePrismaSchema or makeSchema to construct your schema?

Everything works well in the same repo (stripe-graphql) but this is not what I want. My issue is when I import stripeObjectType from stripe-graphql in another project (for example, my-awesome-app. How should I wire up both schemes? (I am using Yoga2 for the app.)

@tgriesser I think there's no way easy way right now for jferrettiboke to accomplish what's he's trying to do.
If I'm understanding his problem well, he's trying to "merge" several schemas at the same time: One from prisma, and one from stripe.
However, afaik the current plugin architecture doesn't seem composable.
nexus-prisma has its own makeSchema function to get access to the prisma's graphql schema, but if you wanted to build your graphql server from yet another graphql source, then you'd have to build your own PrismaStripeSchemaBuilder and makePrismaAndStripeSchema() to read the schemas from both prisma and stripe.
TLDR: I think prisma's use-case is not special and we probably need a way to easily be able to compose these plugins and schemas.
On your example for instance, where would stripeObjectType read the schema from?
const Card = stripeObjectType({
  name: "Card",
  cardFields: ["id", "brand", "last4", { exp_month: "expMonth" }, { exp_year: "expYear" }],
  definition(t) {
    t.field('filteredCharges', {
      type: 'SomeCustomType',
      list: true,
      resolve() {
        // ...
      }
    })
  }
});

@Weakky I think you are very close to what I need. However, my use case is not about using Prisma (but other developers could have this use case where they need to mix both plugins at the same time).
I will provide more context so both of you can understand better my needs.

stripe-graphql is a Stripe GraphQL API which exports the schema, provide bindings and also a stripeObjectType function to be used within Nexus in order to simplify the process of connecting with Stripe (this is very similar to what nexus-prisma does).
Developers set up their own projects and use stripe-graphql as a third-party library.
If they use, stripeObjectType, they will avoid wasting time creating fields and resolvers. However, they can rename some specific fields and/or create some custom resolvers which could return data using the Stripe bindings provided by stripe-graphql.

The main use case for stripeObjectType is to simplify and save time to developers. So, instead of creating a whole entire structure of Stripe types and fields by their own, they can extend things very easy using stripeObjectType.

On your example for instance, where would stripeObjectType read the schema from?

The ideal way would be that the stripeObjectType function could work without merging its own schema from stripe-graphql with the schema of the app, but I think this is not possible and they must be merged together at some point.

And how would you access t.prismaFields() at the same time?

As I already said, I don't have that need yet. However, some developers could be interested in extending an object type from stripeObjectType but also from prismaObjectType at the same time. As a quick example, think in a Customer object type. They could want to expose fields from the database using prismaObjectType but also the cards field from stripeObjectType.
For more context, here is app example using Yoga2 with stripeObjectType. You have also here the stripeObjectType implementation for more context. Note that this is just a POC in order to illustrate better what my current use case is all about.

I have been thinking about how I would like to see this. Here's my proposal. What do you guys think?
 // Creates the `Customer` type in app schema
export const Customer = objectType({
  name: "Customer",
  definition(t) {
    // Refers to the `User` type in Prisma schema
    t.prismaObjectType({
      name: "User",
      fields: ["email"]
    });

    // Refers to the `Customer` type in Prisma schema
    t.prismaObjectType({
      name: "Customer",
      fields: ["stripeCustomerId"]
    });

    // Refers to the `Customer` type in Stripe schema
    t.stripeObjectType({
      name: "Customer",
      fields: [
        "id",
        "cards",
        {
          name: "created",
          alias: "createdAt"
        }
      ]
    });

    // Custom field
    t.field("subscription", {
      ...t.stripeType.subscription,
      resolve(root, args, ctx) {
        // Custom implementation
      }
    });
  }
});

Output:
type Customer {
  email: String!
  stripeCustomerId: ID!
  id: ID!
  cards: [Card!]!
  createdAt: DateTime!
  subscription: Subscription
}

In this way, we can extend very easily without having to type by ourselves third-party schemes and/or fields.

Could this also be accomplished by having the stripeObjectType take the "builder" as an argument?
import { stripeType, stripeObjectType } from 'stripe-graphql'

 // Creates the `Customer` type in app schema
export const Customer = objectType({
  name: "Customer",
  definition(t) {
    // Refers to the `User` type in Prisma schema
    t.prismaObjectType({
      name: "User",
      fields: ["email"]
    });

    // Refers to the `Customer` type in Prisma schema
    t.prismaObjectType({
      name: "Customer",
      fields: ["stripeCustomerId"]
    });

    // Refers to the `Customer` type in Stripe schema
    stripeObjectType(t, {
      name: "Customer",
      fields: [
        "id",
        "cards",
        {
          name: "created",
          alias: "createdAt"
        }
      ]
    });

    // Custom field
    t.field("subscription", {
      ...stripeType.subscription,
      resolve(root, args, ctx) {
        // Custom implementation
      }
    });
  }
});

I believe this is the API I had originally suggested to Prisma specifically because it makes things a lot more difficult internally and from a type-generation standpoint to have things dynamically attached to the "builder" in the way that nexus-prisma does, and it's something I'll consider but I'm not sure it's something that will be generalized in the way you're describing in the short-term.
On a related note that might be relevant for your stripe-graphql project (which looks pretty neat btw), I personally find the merging of type fields from various schemas into a single type to be an anti-pattern, particularly when they're coming from external API sources like Stripe (with Prisma, you at least are in control of the data-source).
If I had a Customer object in my application, I would much prefer to have a field named stripeCustomer which would be an association to a StripeCustomer type rather than merging all of the fields into a single type, makes it clearer where the information is resolved from, simpler to cache, etc:
type Customer {
  email: String!
  stripeCustomer: StripeCustomer
}

I integrated nexus with ´graphql-shield` in the following way:
import {
  objectType,
  extendType,
  queryField,
  mutationField,
  subscriptionField,
} from 'nexus'
import {
  NexusObjectTypeConfig,
  NexusExtendTypeConfig,
  GetGen,
  FieldOutConfig,
  SubscribeFieldConfig,
} from 'nexus/dist/core'
import {
  ShieldRule,
  IRuleFieldMap,
  IRuleTypeMap,
} from 'graphql-shield/dist/types'
import { merge, capitalize } from 'lodash'
import { Rules } from './rules'
import { graphql as Log } from '../log'

export const isShieldRule = (
  rule: ShieldRule | IRuleFieldMap | IRuleTypeMap
): rule is ShieldRule => {
  // FieldMaps and TypeMaps have the Object constructor, whereas
  // Rule and LogicRule have a dedicated constructor (e.g. Rule, RuleAnd, RuleTrue, ...)
  return rule.constructor.name !== 'Object'
}

enum ParentType {
  NONE,
  QUERY,
  MUTATION,
  SUBSCRIPTION,
}

const mergeShieldRule = (
  type: ParentType,
  field: string,
  rule: ShieldRule | IRuleFieldMap
) => {
  let existingRule
  const fieldFullName =
    type === ParentType.NONE
      ? field
      : `${capitalize(ParentType[type])}.${field}`

  if (type === ParentType.NONE) {
    existingRule = Rules[field]
  } else {
    const accessor = capitalize(ParentType[type])

    // Query, Mutation and Subscription are already RuleFieldMaps.
    // Fields inside must be ShieldRules.
    // We can't have a RuleFieldMap inside a RuleFieldMap.
    if (!isShieldRule(rule)) {
      throw new Error(`Tried to assign RuleFieldMap to ${fieldFullName}`)
    }

    // Convert a ShieldRule on Query, Mutation or Subscription to a RuleFieldMap.
    // So { Query: allow } becomes { Query: { '*': allow }}.
    // This ensures the new field can correctly be added.
    const existingQMSRule = Rules[accessor]
    if (existingQMSRule === undefined) {
      Log.debug(
        `${accessor} type does not exist currently, initiating RuleFieldMap`
      )
      Rules[accessor] = {}
    } else if (isShieldRule(existingQMSRule)) {
      Log.debug(
        `${accessor} type is currently a ShieldRule, converting to a RuleFieldMap`
      )
      Rules[accessor] = { '*': existingQMSRule }
    }

    existingRule = (Rules[accessor] as IRuleFieldMap)[field]
  }

  // If there is no rule that currently exist, just assign the new rule.
  let newRule = rule

  if (!existingRule) {
    Log.debug(`Assigning ShieldRule to type ${fieldFullName}`)
  } else if (isShieldRule(existingRule)) {
    if (isShieldRule(rule)) {
      // If the existing rule and the new rule are both single rules that apply to the whole type, we will overwrite the existing rule with the new rule.
      Log.debug(
        `Type ${fieldFullName} already has an active ShieldRule. Overwriting with another ShieldRule`
      )
    } else {
      Log.debug(
        `Type ${fieldFullName} already has an active ShieldRule. Overwriting with a RuleFieldMap. The old rule will still be the default rule if no other default rule has been specified.`
      )

      newRule = merge({ '*': existingRule }, rule)
    }
  } else if (isShieldRule(rule)) {
    Log.debug(
      `Type ${fieldFullName} already has an active RuleFieldMap. Assigning new ShieldRule as default rule.`
    )
    newRule = merge(existingRule, {
      '*': rule,
    })
  } else {
    Log.debug(
      `Type ${fieldFullName} already has an active RuleFieldMap. Merging with new RuleFieldMap.`
    )
    newRule = merge(existingRule, rule)
  }

  if (type === ParentType.NONE) {
    Rules[field] = newRule
  } else {
    // We already ensured that Query, Mutation and Subscription are IRuleFieldMaps
    // and the new rule for the field is a ShieldRule.
    ;(Rules[capitalize(ParentType[type])] as IRuleFieldMap)[
      field
    ] = newRule as ShieldRule
  }
}

export const shieldedObjectType = <TypeName extends string>(
  config: NexusObjectTypeConfig<TypeName> & {
    rules?: ShieldRule | IRuleFieldMap
  }
) => {
  if (config.rules) {
    mergeShieldRule(ParentType.NONE, config.name, config.rules)
  }

  return objectType(config)
}

export const shieldedExtendType = <
  TypeName extends GetGen<'objectNames', string> | 'Query' | 'Mutation'
>(
  config: NexusExtendTypeConfig<TypeName> & {
    rules?: ShieldRule | IRuleFieldMap
  }
) => {
  if (config.rules) {
    mergeShieldRule(ParentType.NONE, config.type, config.rules)
  }

  return extendType(config)
}

export const shieldedQueryField = <FieldName extends string>(
  fieldName: FieldName,
  config:
    | FieldOutConfig<'Query', FieldName> & {
        rule?: ShieldRule
      }
    | (() => FieldOutConfig<'Query', FieldName> & {
        rule?: ShieldRule
      })
) => {
  if (typeof config === 'function') {
    // eslint-disable-next-line no-param-reassign
    config = config()
  }

  if (config.rule) {
    mergeShieldRule(ParentType.QUERY, fieldName, config.rule)
  }

  return queryField(fieldName, config)
}

export const shieldedMutationField = <FieldName extends string>(
  fieldName: FieldName,
  config:
    | FieldOutConfig<'Mutation', FieldName> & {
        rule?: ShieldRule
      }
    | (() => FieldOutConfig<'Mutation', FieldName> & {
        rule?: ShieldRule
      })
) => {
  if (typeof config === 'function') {
    // eslint-disable-next-line no-param-reassign
    config = config()
  }

  if (config.rule) {
    mergeShieldRule(ParentType.MUTATION, fieldName, config.rule)
  }

  return mutationField(fieldName, config)
}

export const shieldedSubscriptionField = <FieldName extends string>(
  fieldName: string,
  config:
    | SubscribeFieldConfig<'Subscription', FieldName> & { rule?: ShieldRule }
    | (() => SubscribeFieldConfig<'Subscription', FieldName> & {
        rule?: ShieldRule
      })
) => {
  if (typeof config === 'function') {
    // eslint-disable-next-line no-param-reassign
    config = config()
  }

  if (config.rule) {
    mergeShieldRule(ParentType.SUBSCRIPTION, fieldName, config.rule)
  }

  return subscriptionField(fieldName, config)
}

Sorry for the huge code block.
There are some problems with this approach though when it comes to combining it with other object type modifications.
It would be great if there was an api to register plugins, which can add fields to different object types and do something with it. The added fields could then be automatically added to the generated nexus typings for automatic type safety.
I haven't thought a lot about a good api to realise this. In my case it could look something like this:
import { registerPlugin } from 'nexus'

registerPlugin({
  objectType: {
    rule: {
      type: '' // Somehow get the type info here.
      onRegister: config => {
        // Do something with the  added field here.
      }
  }
})

Check out #143 - it's an initial pass at solving the problem of defining custom definition block fields.

@tgriesser I just checked out dynamicOutputMethod and play a bit with it. It's great to work within the same schema. However, I am not sure if I can delegate to another different schema.
To illustrate better my needs, I can give you an example of what I would like to achieve.
stripe-graphql/src/StripeObjectType.ts
import { dynamicOutputMethod } from "nexus";
import generatedTypes from "../generated/mapped-types";

interface TypeFields {
  [key: string]: string | any;
}

interface Types {
  [key: string]: TypeFields;
}

const types: Types = generatedTypes;

interface Field {
  name: string;
  alias: string;
}

interface StripeObjectType {
  name: string;
  fields: Array<string | Field>;
}

export const StripeObjectType = dynamicOutputMethod({
  name: "stripeObjectType",
  typeDefinition: `(opts: {
    name: string,
    fields: Array<string | {
      name: string;
      alias: string;
    }>
  }): void`,
  factory({ typeDef: t, args: [{ name, fields }] }) {
    if (fields && fields.includes("*")) {
      fields = Object.keys(types[name]).map(key => key);
    }

    fields.forEach(field => {
      if (typeof field === "string") {
        t.field(field, { type: types[name][field] });
      } else if (field && typeof field === "object") {
        t.field(field.alias, {
          type: types[name][field.name],
          resolve: root => root[field.name]
        });
      }
    });
  }
});

app/src/graphql/Query.ts
import { objectType, stringArg } from "nexus";
import { StripeObjectType as SOT } from "stripe-graphql";

export const StripeObjectType = SOT;

export const Query = objectType({
  name: "Query",
  definition(t) {
    // I DON'T WANT THIS! Time is gold.
    t.string("customer", {
      args: {
        id: stringArg()
      },
      async resolve(root, args, ctx) {
        return await stripe.customer({ id });
      }
    });

    // I WOULD LIKE SOMETHING LIKE THIS! Save me time and I will love you forever!

    // Expose all fields in `Query`.
    t.stripeObjectType({
      name: "Query",
      fields: ["*"]
    });

    // Expose only `customer` and `customers` fields in `Query`.
    t.stripeObjectType({
      name: "Query",
      fields: ["customer", "customers"]
    });

    // Rename `customer` field to `getCustomer` in `Query` and expose it.
    t.stripeObjectType({
      name: "Query",
      fields: [{ name: "customer", alias: "getCustomer" }]
    });

    // Expose all args for `customer` field in `Query`.
    t.stripeObjectType({
      name: "Query",
      fields: [{ name: "customer", args: ["*"] }]
    });

    // Rename `id` argument to `customerId` for `customer` field in `Query`.
    t.stripeObjectType({
      name: "Query",
      fields: [
        { name: "customer", args: [{ name: "id", alias: "customerId" }] }
      ]
    });

    // Custom field.
    t.field("customField", {
      ...t.stripeType.customers,
      resolve(root, args, ctx) {
        // Custom implementation
      }
    });
  }
});

Would something like this work? Can I merge parts of other schemes into my app schema? I just want to compose my app schema from third-party schemes easily and save time without having to mirror by myself everything.

@tgriesser I just found this. This is what I need in Nexus. I would like to merge and extend my schema with other third-party schemes. Is this possible in Nexus today?

It seems like Hasura is trying to solve the same issue with “remote joins”. Having a similar feature in Nexus would be awesome. Please, let’s consider to prioritize this. We should have a easy way in Nexus to connect different with different data-sources. https://blog.hasura.io/remote-joins-a-graphql-api-to-join-database-and-other-data-sources/

Hey 👋,
I'd like give a quick sum-up of the state of what we think plugins could be after some discussions with @tgriesser at GraphQL Conf:
In a sense, dynamicOutputMethod and dynamicInputMethod already provides a solid foundation for (type-safe) plugins. The next version of nexus-prisma already greatly benefits from that by simplifying a lot the surface API.
We think plugins can be used for 3 different use-cases:

The first one is augmenting the DefinitionBlock capabilities (the t param). (using dynamicOutputMethod, dynamicInputMethod, and eventually dynamicOuputObjectProperty (as explained in #161)).
These are useful to add any kind of additional behavior to your daily development workflow. nexus-prisma is now entirely built on that feature.

The second one is augmenting type/field options. A plugin could be used to add new options to type/field configurations. One immediate use-case that we thought about was middlewares. The whole middleware system could probably be developed as a nexus plugin

CLI plugins. This should probably be put in a separate issue, but nexus should soon have a CLI to help with daily workflows (such as scaffolding, generating types, dev command etc..), and we think the CLI itself should also be plugin-based to allow for third-party libraries to integrate with it. At Prisma, we think this plugin system could partly replace yoga2, by providing scaffolding capabilities specific to nexus-prisma

Hello All,
I'm also combining multiple GraphQL End Points, two of them being Prisma.
But I have two endpoints that are external. I'm using GraphQL Binding to connect to them and bass their data in the context, however I can't figure out how to easily integrate them into Nexus.
GraphQL-Binding has already created TS files, which I believe I just need to integrate into the makeSchema function:
`
import * as path from "path";
import Query from "./Query";
import { makeSchema } from "nexus";
const schema = makeSchema({
types: [Query],
outputs: {
schema: path.join(
__dirname,
"../../generated/localord/server/localord.graphql"
),
typegen: path.join(__dirname, "../../generated/localord/serverlocalord.ts")
},
typegenAutoConfig: {
sources: [
{
source: path.join(__dirname, "../../generated/types.ts"),
alias: "t"
}
],
contextType: "t."
}
});
export { schema as default };
`
Is this even possible? I think that there has be be a way to use Nexus with Graphql-binding and seems like the easiest and best solution to this issue.
Thanks for the help in advance.

Related https://github.com/prisma/nexus/pull/200

For anyone interested I have started to put together a proposal for plugins here https://www.notion.so/prismaio/Nexus-Plugin-System-cf2025b1f1084e4e98035c2acc2d3723.

is there support for generating dynamic root types (not just t.field but objectType outputs)? it seems to currently work with dynamicOutputMethod but not sure if the approach I took is correct or meant to be supported.
my use-case is that I need to filter an objects nested relation fields by the same parent status.
i.e. if I query a notebook Notebook that has published: true then for it's Notes I'd like to ensure only published ones are shown as well.
here's code for how I'm currently handling that:
// create a notebook factory using `DynamicOutputMethod`
dynamicOutputMethod({
  name: 'notebook',
  typeDefinition: `args: {
    typeName: string,
    fieldName: string,
    where: { published: boolean }
  }`,
 factory({ typeDef: t, args }) {
    args.forEach(({ typeName, fieldName, where: { published } }) => {
      const CustomNotebook = objectType({
        name: typeName,
        definition: t => {
          t.string('name')
          t.field('notes', {
            type: 'Notes',
            resolve: async (notebook, _, { db }) => db.Note.findMany({
              where: { notebookId: notebook.id, published },
            })
          })
        },
      })

      t.field(fieldName, {
        type: CustomNotebook,
        args: { slugPath: stringArg() },
        resolve: (authUser, { id }, { db }) => db.Notebook.find({
          where: { id, ownerId: authUser.id, published }
        })
      })
    })
})

//  instantiate notebook object type as custom field definition
objectType({
  type: 'Profile',
  definition: t => {
   t.notebook({
      typeName: 'PublishedNotebook',
      fieldName: 'publishedNotebook',
      where: { published: true }
    })
 }
})

Hey @alidcastano thanks for sharing that. Your solution seems reasonable but I've noted your comment to think about later, and if there's a way the underlying API can better serve your use-case. It's interesting.
If you're motivated, please open a new feature request for an API that would better serve your use-case. Maybe we'll conclude that your approach is the idiomatic way but I think we need to talk that through more.

Closing, since Plugins are now possible in the latest 0.12.0-rc.4. Feel free to open additional issues / PRs to improve the docs, they're a little bare bones at the moment.


Competitor - Grist

If you haven't heard of Grist yet, I can only advice to take a look at.
It's getting closer and closer to my vision of a simple DB for my use cases.
It's built around a sophisticated model of permissions and roles which is what I was always looking for. But with a simple to use interface not trying to hide anything:
https://support.getgrist.com/access-rules/
It's also fully built around newest Python, so all expressions are Python, all conditions etc. in rules are pure python scripts.
It also nicely solves the problem of data types by allowing one to seamlessly integrate custom widgets (with both read & write capabilities). But there's more - the API is built around the live principle - so shown data are automatically reflecting the current state of the changes in the backend DB (i.e. reactive programming with automated 0-effort persistency). Hopefully fully custom widget stack will become true at some point.
To me it seems it's a strong "competition" to Grafito. And I think it's good to have a competitor - you can learn a lot which saves a lot of work and accelerates innovation.

This looks definitely interesting! I will have a look into it.
Any inspiration is more than valuable.
Thanks! 😉


Remove some seccomp deny rules to make it work with cuda

Side note: I may be mistaken but should there be some other issues, only blocking connect syscalls should actually be enough to prevent users from downloading stuff from the internet

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

reproduce:
# cat reproduce.py
import torch
print(torch.cuda.is_available())

call strace on it we can see the following syscalls
socket(AF_UNIX, SOCK_SEQPACKET|SOCK_CLOEXEC, 0) = 9
unlink("")                              = -1 ENOENT (No such file or directory)
bind(9, {sa_family=AF_UNIX, sun_path=@"cuda-uvmfd-4026533300-1236\0"}, 30) = 0
listen(9, 128)


Custom tf.keras.Model memory footprint drastically affects performance

System information
16.04.6 LTS
Python 3.5.2
GPU TITAN X (Pascal) 13GB
Describe the current behavior
The memory footprint of a custom tf.keras.Model object affects training performance by almost two orders of magnitude.
Code to reproduce the issue
The following is a stripped-down implementation of an RNN for text data loosely resembling the one in the Effective Tensorflow 2.0 Tutorial
class DynamicRNN(tf.keras.Model):

  def __init__(self, state_size, embedding_size, vocab_size, something):
    super(DynamicRNN, self).__init__(self)

    self.state_size = state_size
    self.embedding_size = embedding_size
    self.vocab_size = vocab_size
    self.something = something

    # The internal GRU
    self.cell = tf.keras.layers.GRUCell(state_size)

    # Input embedding and softmax parameters
    emb_initializer = tf.initializers.RandomUniform(-0.5, 0.5)
    self.emb = tf.Variable(emb_initializer(shape=[self.vocab_size, self.embedding_size]), name="emb")
    softmax_w_initializer = tf.initializers.GlorotUniform()
    self.softmax_w = tf.Variable(softmax_w_initializer(shape=[self.vocab_size, self.state_size]), name="softmax_w")
    self.softmax_b = tf.Variable(tf.zeros([self.vocab_size]), name="softmax_b")

  @tf.function
  def _step(self, last_state, last_symbol):
    # Embed last symbol
    last_symbol_emb = tf.nn.embedding_lookup(self.emb, last_symbol)

    # Compute new state
    _, state = self.cell(last_symbol_emb, [last_state], training=False)
    state = state[0]

    # Predict new symbol
    logits = tf.matmul(state, self.softmax_w, transpose_b=True) + self.softmax_b

    return state, logits

  @tf.function
  def __call__(self, inputs):
    batch_size, L = tf.shape(inputs)[0], tf.shape(inputs)[1]

    last_state = self.cell.get_initial_state(batch_size=batch_size, dtype=tf.float32)
    last_symbol = tf.fill([batch_size], 0)

    # One loss term per time-step
    total_loss = 0.0
    for i in tf.range(L):
      last_state, logits = self._step(last_state, last_symbol)
      last_symbol = inputs[:, i]

      batch_loss = tf.nn.sparse_softmax_cross_entropy_with_logits(logits=logits, labels=inputs[:,i])
      total_loss += tf.reduce_mean(batch_loss)

    total_loss /= tf.cast(L, tf.float32)

    return total_loss

To rule out one culprit, the TensorArrays have been removed. Clearly, an efficient model would not perform embedding and loss computation in every step but that's not relevant here.
To perform training I use a standard tensorflow 2.0 loop (with dummy input for simplicity)
# Parameters
batch_size = 64
vocab_size = 30000
seq_length = 28

# Model
something = {str(i) : i for i in range(400000)}
rnn = DynamicRNN(512, 100, vocab_size, something)
# Optimizer
optimizer = tf.keras.optimizers.Adam(learning_rate=0.001, clipvalue=0.5)

# Dummy input
seq = tf.ones([batch_size, seq_length], dtype=tf.int32)

# Training loop
for step in tqdm.tqdm(range(100000)):
  with tf.GradientTape() as tape:
    loss = rnn(seq)
  grads = tape.gradient(loss, rnn.trainable_variables)
  optimizer.apply_gradients(zip(grads, rnn.trainable_variables))

The crucial part here is the something object which is passed to the model. Note that the object is never used inside the model, hence we can also pass None instead.
My point is that the training performance on GPU and CPU is significantly degraded when the relatively memory costly  something object is passed instead of None. Precisely, I get a slowdown from 0.13s/it to 7.7s/it on the GPU and 2s/it to 9s/it on the CPU. Utilization drops from ~65% to %5 on the GPU and from 800% to 300% (24 cores available) on the cpu.
The above makes me suspicious that the model is being copied in every training step. I found this behavior nowhere documented. Is it? Also note that such an something dictionary is entirely realistic if what you do is NLP and you need to carry your vocabulary around. If that object is being used internally, a more efficient alternative might be to pass it as a function argument, instead of storing it internally.

@schmiflo,
Tried reproducing your code, but it is resulting in the error, NameError: name 'tqdm' is not defined. Here is the Gist.
Can you please help us reproduce the issue. Thanks!

@rmothukuru
Sorry, I forgot to add imports. Either add
import tensorflow as tf
import tqdm

if you have tqdm installed (pip3 install --user tqdm) or turn tqdm.tqdm(range(100000)) into range(100000) but then you have to measure time per iteration in some other way.

Could reproduce the issue with TF Version 2.0. Here is the Gist.

Thanks for reporting the issue and sorry for the very late reply. Let me explain in details.

In tensorflow, there is a concept for trackable item, which we use to track dependency between python objects, and we use this dependency graph to determine which part of the execution graph we need to save when we do model checkpointing and saving.

For keras subclass model, like the DynamicRNN class in your example, we by default track any fields that is created by user as the attribute, eg user can do:

self.variable1 = tf.Variable()

If we don't track those information, we won't be able to save the model correctly.

When tracking attributes, we also check the type of value, and see if it worth tracking. Eg, tensors, and variables are key concepts which we want to track. On the other hand, int, string and primitive types  that are not mutable is not in the scope. For mutable container like list, dict, since we don't know whether user will add anything to it during training, we by default track them. And this is causing the slowdown in your example.

To test my theory, you can do

from tensorflow.python.training.tracking import data_structures
....
    self.something = data_structures.NoDependency(something)

This will force tensorflow to not track the object, and bring the performance back to normal. Also you can change to something = tuple(str(i) for i in range(400000)) and see the performance (tuple is immutable and we don't track them as long as it doesn't contain tensor or variable).
Hope this resolve your confusion. I am closing this bug for now, feel free to reopen it if u feel there is anything else need to be addressed here.


Filter By Asset Category Functionality

As a user I want to be able to filter by category in the item grid view. Therefore a get paramter needs to be set to filter for one or multiple categories (book, movie, game, other).
The drop down menu for selecting the categories is implement in #167.
Acceptance Criteria

[ ] The items in the grid view are filtered by a filter parameter specified in the url.

estimate: 13


ServiceBus triggered function fails on startup on net4.8 after updating Microsoft.Azure.Functions.Worker.Sdk from 1.15.1 to 1.16.1

The following Assembly load fails during start up on net4.8 after updating Microsoft.Azure.Functions.Worker.Sdk from 1.15.1 to 1.16.1
[2023-11-10T18:27:53.827Z] Worker failed to load function: 'LmsWorker' with functionId: '265042846'.
[2023-11-10T18:27:53.828Z] Worker failed to load function: 'TokenWorker' with functionId: '1737301676'.
[2023-11-10T18:27:53.828Z] Result: Failure
Exception: System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\$tfs\ISL\Brightspace.Worker.AzFunc\bin\Debug\net48\Brightspace.Worker.AzFunc.dll' or one of its dependencies. The system cannot find the file specified.[2023-11-10T18:27:53.829Z] Result: Failure
Exception: System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\$tfs\ISL\Brightspace.Worker.AzFunc\bin\Debug\net48\Brightspace.Worker.AzFunc.dll' or one of its dependencies. The system cannot find the file specified.[2023-11-10T18:27:53.829Z] File name: 'file:///C:\$tfs\ISL\Brightspace.Worker.AzFunc\bin\Debug\net48\Brightspace.Worker.AzFunc.dll'
[2023-11-10T18:27:53.830Z] File name: 'file:///C:\$tfs\ISL\Brightspace.Worker.AzFunc\bin\Debug\net48\Brightspace.Worker.AzFunc.dll'
[2023-11-10T18:27:53.831Z]    at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
[2023-11-10T18:27:53.831Z]    at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
[2023-11-10T18:27:53.832Z]    at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
[2023-11-10T18:27:53.832Z]    at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
[2023-11-10T18:27:53.834Z]    at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
[2023-11-10T18:27:53.835Z]    at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
[2023-11-10T18:27:53.836Z]    at System.Reflection.Assembly.LoadFrom(String assemblyFile)
[2023-11-10T18:27:53.837Z]    at System.Reflection.Assembly.LoadFrom(String assemblyFile)
[2023-11-10T18:27:53.838Z]    at Microsoft.Azure.Functions.Worker.Invocation.DefaultMethodInfoLocator.GetMethod(String pathToAssembly, String entryPoint) in D:\a\_work\1\s\src\DotNetWorker.Core\Invocation\DefaultMethodInfoLocator.cs:line 27[2023-11-10T18:27:53.839Z]    at Microsoft.Azure.Functions.Worker.Invocation.DefaultMethodInfoLocator.GetMethod(String pathToAssembly, String entryPoint) in D:\a\_work\1\s\src\DotNetWorker.Core\Invocation\DefaultMethodInfoLocator.cs:line 27[2023-11-10T18:27:53.840Z]    at Microsoft.Azure.Functions.Worker.Definition.GrpcFunctionDefinition..ctor(FunctionLoadRequest loadRequest, IMethodInfoLocator methodInfoLocator) in D:\a\_work\1\s\src\DotNetWorker.Grpc\Definition\GrpcFunctionDefinition.cs:line 56
[2023-11-10T18:27:53.841Z]    at Microsoft.Azure.Functions.Worker.Definition.GrpcFunctionDefinition..ctor(FunctionLoadRequest loadRequest, IMethodInfoLocator methodInfoLocator) in D:\a\_work\1\s\src\DotNetWorker.Grpc\Definition\GrpcFunctionDefinition.cs:line 56
[2023-11-10T18:27:53.845Z]    at Microsoft.Azure.Functions.Worker.GrpcWorker.FunctionLoadRequestHandler(FunctionLoadRequest request, IFunctionsApplication application, IMethodInfoLocator methodInfoLocator) in D:\a\_work\1\s\src\DotNetWorker.Grpc\GrpcWorker.cs:line 269
[2023-11-10T18:27:53.846Z]    at Microsoft.Azure.Functions.Worker.GrpcWorker.FunctionLoadRequestHandler(FunctionLoadRequest request, IFunctionsApplication application, IMethodInfoLocator methodInfoLocator) in D:\a\_work\1\s\src\DotNetWorker.Grpc\GrpcWorker.cs:line 269
[2023-11-10T18:27:53.847Z]
[2023-11-10T18:27:53.848Z]
[2023-11-10T18:27:53.849Z] === Pre-bind state information ===
[2023-11-10T18:27:53.849Z] === Pre-bind state information ===
[2023-11-10T18:27:53.850Z] LOG: Where-ref bind. Location = C:\$tfs\ISL\Brightspace.Worker.AzFunc\bin\Debug\net48\Brightspace.Worker.AzFunc.dll
[2023-11-10T18:27:53.851Z] LOG: Where-ref bind. Location = C:\$tfs\ISL\Brightspace.Worker.AzFunc\bin\Debug\net48\Brightspace.Worker.AzFunc.dll
[2023-11-10T18:27:53.853Z] LOG: Appbase = file:///C:/$tfs/ISL/Brightspace.Worker.AzFunc/bin/Debug/net48/
[2023-11-10T18:27:53.854Z] LOG: Appbase = file:///C:/$tfs/ISL/Brightspace.Worker.AzFunc/bin/Debug/net48/
[2023-11-10T18:27:53.855Z] LOG: Initial PrivatePath = NULL
[2023-11-10T18:27:53.856Z] LOG: Initial PrivatePath = NULL
[2023-11-10T18:27:53.856Z] Calling assembly : (Unknown).
[2023-11-10T18:27:53.857Z] Calling assembly : (Unknown).
[2023-11-10T18:27:53.858Z] ===
[2023-11-10T18:27:53.861Z] ===
[2023-11-10T18:27:53.861Z] LOG: This bind starts in LoadFrom load context.
[2023-11-10T18:27:53.862Z] LOG: This bind starts in LoadFrom load context.
[2023-11-10T18:27:53.863Z] WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
[2023-11-10T18:27:53.864Z] WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
[2023-11-10T18:27:53.865Z] LOG: Using application configuration file: C:\$tfs\ISL\Brightspace.Worker.AzFunc\bin\Debug\net48\Brightspace.Worker.AzFunc.exe.Config
[2023-11-10T18:27:53.866Z] LOG: Using application configuration file: C:\$tfs\ISL\Brightspace.Worker.AzFunc\bin\Debug\net48\Brightspace.Worker.AzFunc.exe.Config
[2023-11-10T18:27:53.867Z] LOG: Using host configuration file:
[2023-11-10T18:27:53.869Z] LOG: Using host configuration file:
[2023-11-10T18:27:53.869Z] LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
[2023-11-10T18:27:53.870Z] LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
[2023-11-10T18:27:53.871Z] LOG: The same bind was seen before, and was failed with hr = 0x80070002.
[2023-11-10T18:27:53.872Z] LOG: Attempting download of new URL file:///C:/$tfs/ISL/Brightspace.Worker.AzFunc/bin/Debug/net48/Brightspace.Worker.AzFunc.dll.[2023-11-10T18:27:53.873Z]
Stack:    at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)

[2023-11-10T18:27:53.877Z]    at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
[2023-11-10T18:27:53.877Z]
Stack:    at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
[2023-11-10T18:27:53.879Z]    at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
[2023-11-10T18:27:53.880Z]    at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
[2023-11-10T18:27:53.881Z]    at System.Reflection.Assembly.LoadFrom(String assemblyFile)
[2023-11-10T18:27:53.882Z]    at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
[2023-11-10T18:27:53.883Z]    at Microsoft.Azure.Functions.Worker.Invocation.DefaultMethodInfoLocator.GetMethod(String pathToAssembly, String entryPoint) in D:\a\_work\1\s\src\DotNetWorker.Core\Invocation\DefaultMethodInfoLocator.cs:line 27[2023-11-10T18:27:53.884Z]    at System.Reflection.Assembly.LoadFrom(String assemblyFile)
[2023-11-10T18:27:53.886Z]    at Microsoft.Azure.Functions.Worker.Definition.GrpcFunctionDefinition..ctor(FunctionLoadRequest loadRequest, IMethodInfoLocator methodInfoLocator) in D:\a\_work\1\s\src\DotNetWorker.Grpc\Definition\GrpcFunctionDefinition.cs:line 56
[2023-11-10T18:27:53.886Z]    at Microsoft.Azure.Functions.Worker.Invocation.DefaultMethodInfoLocator.GetMethod(String pathToAssembly, String entryPoint) in D:\a\_work\1\s\src\DotNetWorker.Core\Invocation\DefaultMethodInfoLocator.cs:line 27[2023-11-10T18:27:53.888Z]    at Microsoft.Azure.Functions.Worker.GrpcWorker.FunctionLoadRequestHandler(FunctionLoadRequest request, IFunctionsApplication application, IMethodInfoLocator methodInfoLocator) in D:\a\_work\1\s\src\DotNetWorker.Grpc\GrpcWorker.cs:line 269.
[2023-11-10T18:27:53.889Z]    at Microsoft.Azure.Functions.Worker.Definition.GrpcFunctionDefinition..ctor(FunctionLoadRequest loadRequest, IMethodInfoLocator methodInfoLocator) in D:\a\_work\1\s\src\DotNetWorker.Grpc\Definition\GrpcFunctionDefinition.cs:line 56
[2023-11-10T18:27:53.890Z] Worker failed to load function: 'IslWorker' with functionId: '1297590910'.
[2023-11-10T18:27:53.893Z]    at Microsoft.Azure.Functions.Worker.GrpcWorker.FunctionLoadRequestHandler(FunctionLoadRequest request, IFunctionsApplication application, IMethodInfoLocator methodInfoLocator) in D:\a\_work\1\s\src\DotNetWorker.Grpc\GrpcWorker.cs:line 269.
[2023-11-10T18:27:53.894Z] Result: Failure
Exception: System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\$tfs\ISL\Brightspace.Worker.AzFunc\bin\Debug\net48\Brightspace.Worker.AzFunc.dll' or one of its dependencies. The system cannot find the file specified.[2023-11-10T18:27:53.896Z] File name: 'file:///C:\$tfs\ISL\Brightspace.Worker.AzFunc\bin\Debug\net48\Brightspace.Worker.AzFunc.dll'
[2023-11-10T18:27:53.897Z]    at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
[2023-11-10T18:27:53.898Z]    at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
[2023-11-10T18:27:53.899Z]    at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
[2023-11-10T18:27:53.901Z]    at System.Reflection.Assembly.LoadFrom(String assemblyFile)
[2023-11-10T18:27:53.902Z]    at Microsoft.Azure.Functions.Worker.Invocation.DefaultMethodInfoLocator.GetMethod(String pathToAssembly, String entryPoint) in D:\a\_work\1\s\src\DotNetWorker.Core\Invocation\DefaultMethodInfoLocator.cs:line 27[2023-11-10T18:27:53.903Z]    at Microsoft.Azure.Functions.Worker.Definition.GrpcFunctionDefinition..ctor(FunctionLoadRequest loadRequest, IMethodInfoLocator methodInfoLocator) in D:\a\_work\1\s\src\DotNetWorker.Grpc\Definition\GrpcFunctionDefinition.cs:line 56
[2023-11-10T18:27:53.904Z]    at Microsoft.Azure.Functions.Worker.GrpcWorker.FunctionLoadRequestHandler(FunctionLoadRequest request, IFunctionsApplication application, IMethodInfoLocator methodInfoLocator) in D:\a\_work\1\s\src\DotNetWorker.Grpc\GrpcWorker.cs:line 269
[2023-11-10T18:27:53.908Z]
[2023-11-10T18:27:53.909Z] === Pre-bind state information ===
[2023-11-10T18:27:53.910Z] LOG: Where-ref bind. Location = C:\$tfs\ISL\Brightspace.Worker.AzFunc\bin\Debug\net48\Brightspace.Worker.AzFunc.dll
[2023-11-10T18:27:53.911Z] LOG: Appbase = file:///C:/$tfs/ISL/Brightspace.Worker.AzFunc/bin/Debug/net48/
[2023-11-10T18:27:53.913Z] LOG: Initial PrivatePath = NULL
[2023-11-10T18:27:53.915Z] Calling assembly : (Unknown).
[2023-11-10T18:27:53.916Z] ===
[2023-11-10T18:27:53.918Z] LOG: This bind starts in LoadFrom load context.
[2023-11-10T18:27:53.919Z] WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
[2023-11-10T18:27:53.920Z] LOG: Using application configuration file: C:\$tfs\ISL\Brightspace.Worker.AzFunc\bin\Debug\net48\Brightspace.Worker.AzFunc.exe.Config
[2023-11-10T18:27:53.921Z] LOG: Using host configuration file:
[2023-11-10T18:27:53.924Z] LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
[2023-11-10T18:27:53.925Z] LOG: Attempting download of new URL file:///C:/$tfs/ISL/Brightspace.Worker.AzFunc/bin/Debug/net48/Brightspace.Worker.AzFunc.dll.
[2023-11-10T18:27:53.926Z]
Stack:    at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
[2023-11-10T18:27:53.927Z]    at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
[2023-11-10T18:27:53.928Z]    at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
[2023-11-10T18:27:53.929Z]    at System.Reflection.Assembly.LoadFrom(String assemblyFile)
[2023-11-10T18:27:53.930Z]    at Microsoft.Azure.Functions.Worker.Invocation.DefaultMethodInfoLocator.GetMethod(String pathToAssembly, String entryPoint) in D:\a\_work\1\s\src\DotNetWorker.Core\Invocation\DefaultMethodInfoLocator.cs:line 27[2023-11-10T18:27:53.931Z]    at Microsoft.Azure.Functions.Worker.Definition.GrpcFunctionDefinition..ctor(FunctionLoadRequest loadRequest, IMethodInfoLocator methodInfoLocator) in D:\a\_work\1\s\src\DotNetWorker.Grpc\Definition\GrpcFunctionDefinition.cs:line 56
[2023-11-10T18:27:53.932Z]    at Microsoft.Azure.Functions.Worker.GrpcWorker.FunctionLoadRequestHandler(FunctionLoadRequest request, IFunctionsApplication application, IMethodInfoLocator methodInfoLocator) in D:\a\_work\1\s\src\DotNetWorker.Grpc\GrpcWorker.cs:line 269.

Note 1.16.0 seems to have the same issue

Appears to be the issue described in #2052

Thank you @Pepsi1x1 . Can you confirm you have the same condition captured in #2052 ? If so, we'll close this as a duplicate and will be releasing that fix soon.

Hi @fabiocav, I can confirm that the mitigation described in the issue resolved the exception. So I believe it is the same position. Happy to close


Website has been down in nigeria for over 4months & Object array to session data error

Hello,
please your website www.codeigniter.com has been down for over 4 months in my country nigeria, i've complained earlier but got no response , now i just downloaded the latest version via github and alot of things have changed , please can you kindly attach the html documentation for me so i can follow up  with the updates

thank you!!.
and i just tried to add an object array to my sessiondata like i did with the earlier version 3 but its returning an error
A PHP Error was encountered
Severity: Warning
Message: Illegal offset type
Filename: Session/Session.php

Hi Douglas,
am in Nigeria & the URL is working perfectly. I suggest you clear your
browser cache or simply check if your IP or ISP has not been blacklisted.
As for the session error, sharing a more detailed iterative steps you took
may help.
However, here is the URL for session handling:
https://ellislab.com/codeigniter/user-guide/libraries/sessions.html
On Tue, May 26, 2015 at 7:52 PM, Douglas Kesi-Ayeba Kendyson <
<EMAIL_ADDRESS>wrote:

Hello,
please your website www.codeigniter.com has been down for over 4 months
in my country nigeria, i've complained earlier but got no response , now i
just downloaded the latest version via github and alot of things have
changed , please can you kindly attach the html documentation for me so i
can follow up with the updates
[image: screen shot 2015-05-26 at 19 44 54 1]
https://cloud.githubusercontent.com/assets/5365813/7820431/57c28464-03e0-11e5-84b5-ae9b67856711.png
thank you!!.
and i just tried to add an object array to my sessiondata like i did with
the earlier version 3 but its returning an error
A PHP Error was encountered
Severity: Warning
Message: Illegal offset type
Filename: Session/Session.php
—
Reply to this email directly or view it on GitHub
https://github.com/bcit-ci/CodeIgniter/issues/3879.

Your two issues should be addressed on forum.codeigniter.com, not here - github is for development.
Our main website does not use any IP blacklists, so I suspect your IP or ISP has been blacklisted somewhere else along the way, as daviskoko suggested.
The URL he provided for session handling, however, is for CodeIgniter 2.2; the current one is http://www.codeigniter.com/user_guide/libraries/sessions.html


Automagically Bind notify Methods

Automagically bind notify methods on all wrapper classes so the notify method can be destructured within the import statement and not run into any this related errors.

Thanks!

Why is this breaking? 🤔

Strictly not very breaking. The most notable breaking I found was sanitizing timeout on snoretoast handling (see changelog https://github.com/mikaelbr/node-notifier/blob/master/CHANGELOG.md#breaking-changes). But I also marked this as breaking in the changelog as it, in theory, does break from existing API.

Thanks


CSRF error in API for one page application

Hello i'm going to develop a backend only to provide a set of API (that retus a json repsonde, so without pug templater) for an angular 9 application that was builded and serverd with a static route (the root). Nervertheless, i'm still having the CSRF token missing error on POST request, how could i fix it? (server seems does not release the token in the headers for the client)

It might be a tad bit overkill to strip and modify hackathon-starter to turn it into a JSON only API backend.  Are there features in this project that are gravitating you to use it as only the backend instead of having a custom JSON serving server for your application?
The CSRF token is provided as a meta tag under the Head section of the HTML response

In your response for POST, you would need to provide it as part of the body.  For troubleshooting, In the app.js right about line 95 you can add a console.log(req.body); to dump the received submission by the backend, and in there look for the value that is being returned as the _csrf value. Feel free to use an unmodified clone of this project to see how the response is supposed to look like.  The Contact page is probably the easiest for such testing since it doesn't require a registered user.


docs: Flux-v1-migration add details about flux2's server side validation

Signed-off-by: surya<EMAIL_ADDRESS>

LGTM 👍 thanks @suryapandian for making this improvement to the migration docs!

Thanks could you also please review this tiny other PR https://github.com/fluxcd/website/pull/1196/files @kingdonb


Row selection API

I'm adding some of my own things to the multi-select feature that's built into the table.  I've found myself in a situation where I'm referencing the VTablecomponent and accessing some methods that way.
https://github.com/tochoromero/vuejs-smart-table/blob/08c381836499dd0a08817b947be942d9d32becd4/src/VTable.vue#L201-L220
I know this is a dangerous thing to do but I couldn't find another way.
Any chance there could be a "more public" API for these methods?
Thanks. I really like this component.

Hello there.
I created those methods in the VTable component with the intention of being used with ref.
I cannot think of a better way to expose those methods. If you have any ideas please tell.

I can't think of a better way. I feel better knowing that you intended for people to do what I'm doing. I'm not as worried about breaking changes being introduced.
Thanks so much for everything.


truncate clean up method

By now JFixtures generates clean up SQL for every table(before inserts):
DELETE FROM $table_name;

Add ability to change the instruction from DELETE to TRUNCATE in order to produce SQL like:
TRUNCATE $table_name;

A new table property is required:
tables:
   no_clean_up:
     tables: /.+
     clean_method: truncate # might be delete or none

done https://github.com/vkorobkov/jfixtures/pull/60


Salsa does not understand parameters with properties JSDoc

From @alexandrudima on January 27, 2016 12:57
Testing #2218
Please see http://usejsdoc.org/tags-param.html#parameters-with-properties
/**
 * Assign the project to an employee.
 * @param {Object} employee - The employee who is responsible for the project.
 * @param {string} employee.name - The name of the employee.
 * @param {string} employee.department - The employee's department.
 */
function helloWorld(employee) {
    employee.
}

Copied from original issue: Microsoft/vscode#2441

We support the object literal format, or a type name, currently for a param. There are several JsDoc variations and formats in use, and we have tried to pick the most common initially, and then expand if/when feedback indicates a pattern is common enough to support, or is needed to fill a gap.
Please reopen if you believe this is a common format for your users and we should add support. Else we'll add later based on demand (or a ready to go pull request :wink: ).

Works for me :+1:

Oh darn, I was just about to report this very issue now that https://github.com/Microsoft/TypeScript/issues/6825 is fixed and I ran into it myself. Is there somewhere else I should go to request support for this?
As far as I'm aware, it's a pretty common pattern for describing properties of object params:

http://usejsdoc.org/tags-param.html#parameters-with-properties
http://stackoverflow.com/questions/6460604/how-to-describe-object-arguments-in-jsdoc

P.S. Thank you all for your awesome work!

@astral-sa we'll revisit this if we decide to increase the set of JSDoc constructs we understand.
If you're feeling ambitious and want to send a PR to implement it, I'd be happy to take a look.

Has there been any additional work on this? This is the pattern I use for documenting object properties as well, so it would be great to be able to get intellisense from it.

@abgivant the example in the OP is working locally for me, as well as using it inside an object literal declaration. if you have a different pattern that is not working please file a new issue and give us more details to be able to diagnose the problem.

I just tried it again, and the object literal syntax is working, but the separately defined properties are not working for me. I tried on both the most recent stable build, as well as on the most recent insiders build. I am also updated to the latest version of TypeScript.
Here are my examples:

Also, and this isn't really a problem, but I noticed that the object literal syntax doesn't work when it is broken up over multiple lines.

Please file another issue for the multiline case.

Just opened #10535 for the multiline issue.

+1. We are facing the same problem here.

So the JSDoc standard way of specifying parameter properties is broken, but it's OK because the non-standard object literal syntax works?


API fails to build monorepo with yarn workspaces

Describe the bug
After repackaging my multirepo project into a monorepo based on yarn workspaces, I noticed the app won't deploy to Azure Static Web Apps anymore.  The issue is that when building the Functions app yarn does not pick up one of the dependencies is found in one of the yarn workspace packages. As a result it tries to find the package in the public registry and fails.
To Reproduce
See this test repo I've created based on my setup.
Expected behavior
Similar to my development setup: after building the Functions app should be able to run.
Screenshots
More details can be found in my test repo.

Additional context
One part I'm a bit concerned about is that I added a dummy yarn.lock file in the packages/api folder to trigger Oryx to use yarn instead of npm. The lockfile didn't hinder me to build the Functions app locally, but if there are better ways to trigger Oryx to use yarn, I'm happy to give them a try to rule out this could affect the build process.

We will be working on a solution for #343 that should work for monorepos where you handle the build yourself. No ETA at the moment but hoping we’ll have something in 2-3 months.

@anthonychu Thanks for your reply. Good to know about the upcoming feature to allow for custom API build steps. Could you share some insights into why the API is unable to build in Oryx? As far as I can tell I'm not doing anything special to successfully build the API locally: running yarn install and yarn build. Understanding what Oryx does differently might give me ideas to circumvent this problem while waiting for #343 to be implemented.

We currently treat the app and API folders as completely separate projects. We tell oryx to build them separately. For most monorepos, the install and build commands actually need to be run at the root of the repo, which we don’t support right now.
In your case specifically, it sounds like you needed to trick Oryx into detecting yarn for the API folder.

I've found a workaround that enables me to build my project which uses workspaces. My directory structure is:
/package.json
/api/package.json
/common/package.json

whereas the api project has a dependency on the common package.
Right before the Azure/static-web-apps-deploy@v1 action, I added
- name: Workaround for oryx not supporting yarn workspaces. See https://github.com/Azure/static-web-apps/issues/542
  run: |
    echo "# This is a fake lock file to trick oryx" > yarn.lock
    sed -i 's/"@myproject\/common": ".*"/"@myproject\/common": "file:..\/..\/common"/g' package.json
  working-directory: api

to my pipeline. This will replace the version number of my common project, with a file path directly pointing to it. Since oryx executes the build in a subfolder, we need to go one more level up than you would usually expect.

Hey @jeroenvdmeer!
A quick update on #343
skip_api_build should now be enabled in GitHub Actions!🎉🎉
In order to use it, we need to set skip_api_build: true in the GitHub workflow yaml and specify the ApiRuntime version  in the staticwebapp.config.json file in source repository.
Azure DevOps changes are being merged meanwhile and can be tracked in the following PR
Let us know if this helps in solving your issue :)


Validator dismantles fully-qualified name of branch location

Mathnasium of Blue Ash is tagged name=Mathnasium of Blue Ash brand=Mathnasium branch=Blue Ash. The validator wants to turn it into name=Mathnasium brand=Mathnasium branch=Blue Ash. I would regard this suggestion as mild dataloss.
One could argue that name=Mathnasium would reduce clutter on a rendered map and avoid redundancy in search results (avoiding “Mathnasium of Blue Ash, Blue Ash, Ohio”[^1]). But a search engine would benefit from indexing “Mathnasium of Blue Ash” in case it receives that string as input. It shouldn't be expected to know that the fully qualified name can be derived from “brand of branch” for this particular brand, whereas another brand would derive the fully qualified name from “branch brand”, and a chain in a language other than English would have a completely different formulation.[^2]
This validator rule is already disabled for some POI types that are commonly known by a fully qualified name, such as shop=car. But the POI in question is an amenity=prep_school: some amenity=prep_school chains like Mathnasium routinely qualify the name with the branch name, while others like Kumon usually do not. There may even be inconsistency within some chains that operate as franchises. This is messy enough that I think the validator should take a less prescriptive approach.
The validator rule should be disabled when branch is already tagged. At the very least, the suggestion should move the fully qualified name to official_name to avoid dataloss.[^3] This would override some official_names coming from NSI, like “Applebee’s Neighborhood Grill”, but those brand-wide tags are less important than the branch-specific one being dismantled here.
[^1]: It just so happens that the branch in this case is the name of the surrounding city, but for some chains it can be the name of the neighborhood, the street, or the owner, or the owner’s favorite child.
[^2]: Or if it is expected to know this, then the name suggestion index should store a format string for each brand. Perhaps it could also store some grammar rules, for languages that would apply the locative case.
[^3]: openstreetmap/id-tagging-schema#215 adds an Official Name field, so that it wouldn’t appear to the user as though the information had gone missing.

This validator rule is already disabled for some POI types that are commonly known by a fully qualified name, such as shop=car. But the POI in question is an amenity=prep_school: some amenity=prep_school chains like Mathnasium routinely qualify the name with the branch name, while others like Kumon usually do not. There may even be inconsistency within some chains that operate as franchises.

Yes I think we can just mark this Mathnasium brand (or even the entire category) with a preserveTags property in the NSI to prevent this.
https://github.com/osmlab/name-suggestion-index/wiki/Category-Property-Reference#preserveTags

The validator rule should be disabled when branch is already tagged.

I agree - I thought it was already doing this but I will double check it.


Minor API cleanup

Remove data_includes, unimplemented.
lookupInKeys -> lookup_in_keys
KBase SDK version 1.0.18 (commit
e29f39ed467111aa60bdca74b3d45439d76e71c2)

@eapearson

This comment can go
https://github.com/kbase/KBaseSearchEngine/blob/master/lib/src/kbasesearchengine/search/ElasticIndexingStorage.java#L1173

Removed it locally, it'll be in my next PR if that's ok


More database optimizations

This PR contains a couple of database-related performance
improvements.
The profiling method I'm using here will be a little different from
usual. Rather than running transactions through a network, I'm running
the state verifier over a 300-block blockstore that was taken from an
actual LR network run (many of the functions in the graphs below are
called exactly 300 times). This profiles just the components involved
in transaction execution. Notably, it does not involve the block
publisher or any inter-validator communication, although does include
communcation between the validator and several transaction processors.
Here is a Yappi graph of this setup running master:

The first commit adds a dedicated single-key get method to
LMDBNoLockDatabase, where previously get was delegated to
get_multi. This shaves off almost 2% of CPU time from
LMDBNoLockDatabase.get. It also slightly reduces (by ~0.2%) the time
taken by LMDBNoLockDatabase.update. I'm not sure why this is; maybe
the database writes don't have to wait as long for the reads?
Here is a Yappi graph after this change:

The second commit caches the settings views obtained by the executor.
This seems to be an impactful change. For one thing, database reads
are reduced by about one third. The total CPU time taken by
TransactionExecutorThread._execute_schedule goes from ~18% to ~15%.
Here is a Yappi graph after this change:

Can you split these into two PRs, or just submit a PR with the database get() commit by itself? The settings view change will require more discussion given the need for the cache to be aware of intra-block txns which change settings and their potential effect on downstream txns in that block.

Closing in favor of https://github.com/hyperledger/sawtooth-core/pull/1522


srun: error: Unable to resolve "mgmt": Unknown host

srun: error: Unable to resolve "mgmt": Unknown host
srun: error: Unable to establish control machine address
srun: error: Unable to confirm allocation for job 90: No error
srun: Check SLURM_JOB_ID environment variable. Expired or invalid job 90
slurmstepd: error: Unable to resolve "mgmt": Unknown host
When I run my job, it shows this. How to fix this issue?

Thanks for your patience when encountering all these issues.
Root cause
It seems that the root cause for this is the Oracle Linux DHCP updating logic in /etc/dhcp/exit-hooks.d/dhclient-exit-hook-set-hostname.sh has gone awry. It is only supposed to change the "search" line in /etc/resolve.conf if in needs to be different, but every time the DHCP lease is renewed it appends a new line in the file like:
; Any changes made to this file will be overwritten whenever the
; DHCP lease is renewed. To persist changes you must update the
; /etc/oci-hostname.conf file. For more information see
;[https://docs.cloud.oracle.com/iaas/Content/Network/Tasks/managingDHCP.htm#notes]
;
; generated by /usr/sbin/dhclient-script
search clustervcn.oraclevcn.com subnetad2.clustervcn.oraclevcn.com
nameserver <IP_ADDRESS>
search clustervcn.oraclevcn.com subnetad1.clustervcn.oraclevcn.com subnetad2.clustervcn.oraclevcn.com subnetad3.clustervcn.oraclevcn.com

search subnetad2.clustervcn.oraclevcn.com clustervcn.oraclevcn.com
search subnetad2.clustervcn.oraclevcn.com clustervcn.oraclevcn.com
search subnetad2.clustervcn.oraclevcn.com clustervcn.oraclevcn.com
search subnetad2.clustervcn.oraclevcn.com clustervcn.oraclevcn.com

None of those last four lines should be there. The last search line takes precedence.
Fix
We have a fix in development that removes the need for three separate subnets and therefore eliminates the  problems of DNS resolution in different subnets.
Workaround
However to get your existing cluster working properly we can fix /etc/resolv.conf and prevent dhclient from changing it again. Finally we'll need to restart slurmd on the compute nodes to get it talking to the mgmt node again.
I'm just trying to come up with a procedure for that

@christopheredsall Cool! I am glad you can find the crux of the problem. Please let me know if you already fix this issue in my specific cluster. I am waiting for this cluster to rush my deadline:-)

OK, try this as the opc user on the management node
clush -w @compute,@role:mgmt sudo sed -i -e "/PRESERVE_HOSTINFO/ s/0/2/" /etc/oci-hostname.conf
clush -w @compute,@role:mgmt sudo sed -i -e "\$asearch clustervcn.oraclevcn.com subnetad1.clustervcn.oraclevcn.com subnetad2.clustervcn.oraclevcn.com subnetad3.clustervcn.oraclevcn.com"
clush -w @compute sudo systemctl restart slurmd

mgmt: Warning: Permanently added 'mgmt,<IP_ADDRESS>' (ECDSA) to the list of known hosts.
vm-standard2-24-ad2-0005: ssh: Could not resolve hostname vm-standard2-24-ad2-0005: Name or service not known
clush: vm-standard2-24-ad2-0005: exited with exit code 255
vm-standard2-24-ad3-0001: ssh: Could not resolve hostname vm-standard2-24-ad3-0001: Name or service not known
clush: vm-standard2-24-ad3-0001: exited with exit code 255
vm-standard2-24-ad3-0002: ssh: Could not resolve hostname vm-standard2-24-ad3-0002: Name or service not known
clush: vm-standard2-24-ad3-0002: exited with exit code 255
vm-standard2-24-ad2-0006: ssh: Could not resolve hostname vm-standard2-24-ad2-0006: Name or service not known
clush: vm-standard2-24-ad2-0006: exited with exit code 255
vm-standard2-24-ad3-0003: ssh: Could not resolve hostname vm-standard2-24-ad3-0003: Name or service not known
clush: vm-standard2-24-ad3-0003: exited with exit code 255
mgmt: sed: -e expression #1, char 19: missing command
clush: mgmt: exited with exit code 1

Ah, looks like the management node can't resolve names in AD3
We'll need those three lines in a different order. I put the PRESERVE_HOSTINFO line first in case it tried to change the file while we were editing it. Try the second line, then the first one, then the third:
clush -w @compute,@role:mgmt sudo sed -i -e "\$asearch clustervcn.oraclevcn.com subnetad1.clustervcn.oraclevcn.com subnetad2.clustervcn.oraclevcn.com subnetad3.clustervcn.oraclevcn.com"
clush -w @compute,@role:mgmt sudo sed -i -e "/PRESERVE_HOSTINFO/ s/0/2/" /etc/oci-hostname.conf
clush -w @compute sudo systemctl restart slurmd

I made two errors, the filename is missing off the sed command. And I think we will have to do the managment node first on it's own, then the compute nodes
clush -w @role:mgmt sudo sed -i -e "\$asearch clustervcn.oraclevcn.com subnetad1.clustervcn.oraclevcn.com subnetad2.clustervcn.oraclevcn.com subnetad3.clustervcn.oraclevcn.com" /etc/resolv.conf
clush -w @compute,@role:mgmt sudo sed -i -e "\$asearch clustervcn.oraclevcn.com subnetad1.clustervcn.oraclevcn.com subnetad2.clustervcn.oraclevcn.com subnetad3.clustervcn.oraclevcn.com" /etc/resolv.conf
clush -w @compute,@role:mgmt sudo sed -i -e "/PRESERVE_HOSTINFO/ s/0/2/" /etc/oci-hostname.conf
clush -w @compute sudo systemctl restart slurmd

Also it's getting a bit late, local time here. we may have to pick this up tomorrow.

[opc@mgmt ~]$ clush -w @role:mgmt sudo sed -i -e "$asearch clustervcn.oraclevcn.com subnetad1.clustervcn.oraclevcn.com subnetad2.clustervcn.oraclevcn.com subnetad3.clustervcn.oraclevcn.com" /etc/resolv.conf
mgmt: sed: can't read subnetad1.clustervcn.oraclevcn.com: No such file or directory
mgmt: sed: can't read subnetad2.clustervcn.oraclevcn.com: No such file or directory
mgmt: sed: can't read subnetad3.clustervcn.oraclevcn.com: No such file or directory
clush: mgmt: exited with exit code 2
[opc@mgmt ~]$

I manually edited /etc/resolv.conf - it was quite mangled, and missing the nameserver. It now contains:
search clustervcn.oraclevcn.com subnetad2.clustervcn.oraclevcn.com
nameserver <IP_ADDRESS>
search clustervcn.oraclevcn.com subnetad1.clustervcn.oraclevcn.com subnetad2.clustervcn.oraclevcn.com subnetad3.clustervcn.oraclevcn.com_
I also manually edited /etc/oci-hostname.conf. It now contains:
PRESERVE_HOSTINFO=2
I'm now able to ping the internet (e.g., google.com, github.com, etc.).

We have now made a change so that there is a single subnet containing all ADs so the DNS search path is now simplified. It was fixed in #16.


Indicator only orange and blue...no green

(sorry for my bad English)
What else I can think of.  I don't get any green display.
Even when the temperature is reached, it says "is being cooled" ...
Is it wanted like that?
And is it possible to get a message if window open. That i can see in homekit when the window is opened.

The green indicator if for the "auto" mode reserved.

Oh ok thats bad.
Because look at the picture.
Red and Yellow same room. One with your plugin, one with Tado original HomeKit integration.
When the temperature in the room is reached, it does not have to display heating / cooling and should turn green.
For me, blue means that the heating is off because it is too warm in the room. But that's not true at all, so the Plugin shows wrong values in my opinion.
"Auto" means that he uses the time schedule.

There is an open window option to enable a sensor in homekit, look at example config
https://github.com/SeydX/homebridge-tado-platform/blob/ac28ff456907e59c12bf20babc6533cc43012062/example-config.json#L81

@T-Bone90
Fixed in v6.0.9 (for HEATING devices "easyMode" must be enabled in config to show this state)

@SeydX thank you but I get error and it doesn't work for me.
TypeError: Cannot read property 'getCharacteristic' of undefined     at /usr/local/lib/node_modules/homebridge-tado-platform/src/helper/handler.js:1022:24     at Array.forEach (<anonymous>)     at updateZones (/usr/local/lib/node_modules/homebridge-tado-platform/src/helper/handler.js:900:29)     at processTicksAndRejections (internal/process/task_queues.js:93:5)     at getStates (/usr/local/lib/node_modules/homebridge-tado-platform/src/helper/handler.js:699:9) [22.3.2021, 17:08:39] [TadoPlatform] TypeError: Cannot read property 'getCharacteristic' of undefined     at /usr/local/lib/node_modules/homebridge-tado-platform/src/helper/handler.js:1022:24     at Array.forEach (<anonymous>)     at updateZones (/usr/local/lib/node_modules/homebridge-tado-platform/src/helper/handler.js:900:29)     at processTicksAndRejections (internal/process/task_queues.js:93:5)     at getStates (/usr/local/lib/node_modules/homebridge-tado-platform/src/helper/handler.js:699:9) TypeError: Cannot read property 'getCharacteristic' of undefined     at /usr/local/lib/node_modules/homebridge-tado-platform/src/helper/handler.js:1022:24     at Array.forEach (<anonymous>)     at updateZones (/usr/local/lib/node_modules/homebridge-tado-platform/src/helper/handler.js:900:29)     at processTicksAndRejections (internal/process/task_queues.js:93:5)     at getStates (/usr/local/lib/node_modules/homebridge-tado-platform/src/helper/handler.js:699:9) [22.3.2021, 17:09:10] [TadoPlatform] TypeError: Cannot read property 'getCharacteristic' of undefined     at /usr/local/lib/node_modules/homebridge-tado-platform/src/helper/handler.js:1022:24     at Array.forEach (<anonymous>)     at updateZones (/usr/local/lib/node_modules/homebridge-tado-platform/src/helper/handler.js:900:29)     at processTicksAndRejections (internal/process/task_queues.js:93:5)     at getStates (/usr/local/lib/node_modules/homebridge-tado-platform/src/helper/handler.js:699:9)
Red Rooms are the same (original Tado and your plugin) and purple rooms are the same.
The Thermostat in "Badezimmer" is 20°. Your plugin shows "AUS/OFF"
The same with "Wohnzimmer".


[Enhancement]: The format of the documented cases needs to be improved

Is there an existing issue for this?

[X] I have searched the existing issues

What would you like to be added?
https://towhee.readthedocs.io/en/main/data_collection/mixins.html
The code in this section is incorrectly formatted

Why is this needed?
No response
Anything else?
No response

Reopen for verification.
@jingkl

Already verified, fixed