225 Matching Annotations
  1. Last 7 days
    1. Emphasizing lifetime-polymorphism can also make type inference untenable, a design choice that wouldn’t fit OCaml.

      References or sources? Why? Presumably there's some research into this?

  2. May 2023
    1. Typewriter Cleaning and Repair Basics #2 Type Bars, Case, and Crinkle Finish

      https://www.youtube.com/watch?v=82O_iUAI5og


      Segment comb cleaning - isopropyl alcohol (gentler solvent) - odorless mineral spirits - Lacquer thinner (maybe a bit too aggressive) - naphtha (lighter fluid) take care for flammability and ventilation

      Work solvent into bearing between type bar and segment comb. To dry things out one can used compressed air when done or just air dry.

      If sticking keys not due to being gummed up, bend portions slightly for better alighment.

      Do not lubricate the segment comb.

      Only lubricate the carriage rails when necessary.

      Exterior cleaning

      Brass bristle or nylon bristle brushes (toothbrushes) can be used to clean the exterior of the typewriter and/or cases with mild detergents or other solvents. Depending on the finish, try the brush and solvent on a small portion to determine colorfastness and potential scratching first.

  3. Apr 2023
  4. Mar 2023
  5. Feb 2023
    1. [Episode!]! represents an array of Episode objects. Since it is also non-nullable, you can always expect an array (with zero or more items) when you query the appearsIn field. And since Episode! is also non-nullable, you can always expect every item of the array to be an Episode object.

      Note that this still allows an empty array, []. It only disallows: null and [null].

    1. If you want a workaround for the case where you can't just replace key with a string literal, you could write your own user-defined type guard function called hasProp(obj, prop). The implementation would just return prop in obj, but its type signature explicitly says that a true result should cause obj to be narrowed to just those union members with a key of type prop: function hasProp<T extends object, K extends PropertyKey>( obj: T, prop: K ): obj is Extract<T, { [P in K]?: any }> { return prop in obj; } and then in your function, replace key in a with hasProp(a, key): function f3(a: A) { const key = 'b'; if (hasProp(a, key)) { return a[key]; // okay } return 42; }
  6. Dec 2022
    1. type switches

      type switch 是一种固定的格式吗?还是基于 switch 条件控制的?

      A type switch is a construct ``` func do(i interface{}) { switch v := i.(type): case int:

      case string:

      default:

      } ```

    2. Type switches

      type switch 是一种固定的格式吗?还是基于 switch 条件控制的? A type switch is a construct ``` func do(i interface{}) { switch v := i.(type): case int:

      case string:

      default:

      } ```

    1. in this moment Chris and the deer have their owncoagulation: fusing into one “buck” (and obviously Peele was playing uponthis terminology associated with the Black male slave), they jointly chargeand kill their enemy. Together, the “vermin” strike back
    2. Chris makes use of thedead deer; another (more mystical) analysis could posit that the deer takesrevenge on the hunter, using Chris’s body as a vehicle
    3. First, the conflation of the deerwith the devaluation of Black life nods to the long-standing tradition of usinganimals to speak back to the power structures upheld by plantation slaveryin the form of animal folktales. And second, this deer comes roaring back tolife. He gets his revenge on the family that made his noble head into a trophy.The taxidermied deer is a speaking animal that has a kind of second life, andthere are multiple ways we might read its importance in Chris’s escape

      back to life, revenge, trophy, head, speaking animal with second life, the deer also fights back

    4. the deer strikes back
    5. Like the trickster tales discussed above, the films we are lookingat here do not make animals the focal point, but use them as a means of“thinking with” humans.
    6. The trickster is an animal low on the peckingorder (like a rabbit) who finds himself in a jam and must use his wits, charms,and other skill sets to outfox his more powerful enemies. He is an animalsurrogate that speaks softly of strategies for resistance
    7. Wagner emphasizes thatsuch animal tales often provided coded ways of imparting strategies forresistance and that this story has historical connections not only to the tropeof the speaking animal from African trickster mythologies like the spiderAnansi, but also perhaps, to Aesop’s animal fable
    8. educe animals to mere metaphors, similes, or symbolsdo not seem promising for theorizing ethical recognition of actual animals.Donna Haraway, for example, criticizes philosophical texts that show a “pro-found absence of curiosity about or respect for and with actual animals,even as innumerable references to diverse animals are invoked.” 15 SusanMcHugh, meanwhile, suggests that “the aesthetic structures of metaphor,though precariously supporting the human subject, seem unable to bearanimal agency.”16 An
    9. She maybelieve the comparison reveals the moral horror of industrial animal agri-culture, but, as Bénédicte Boisseron argues, such comparisons “instrumen-talize” Blackness in a “self-serving” way, ignoring the complex and ongoingBlack struggle against dehumanizing discourses and institutions in order toframe “the animal” as “the new black.
    10. remind us of the historical reduction of the human to the status of ananimal under transatlantic slavery, but also were used as a mode of resistancefor enslaved peoples

      first half is type 1, first half is type 2

    11. Rather than viewing fables as operating with a purely substitutivelogic, where the animal stands in for the human, recent criticism explores thepossibility that the fable can imagine relationality and even allyship amongspecies
    12. lens of alliance, not solely analogy
    13. Rather, the appearance of animals in some recentfilms highlights the unequal treatment of Black lives in America in a mannerthat continues the fable tradition, and simultaneously emphasizes the human
    14. Theseworks encode various strategies of survival in an era in which Black livescontinue to be devalued
    15. Any resistance must be sanitized soas to be tolerable” for the general audience. 5 But resistance also works not bybeing sanitized, but by being hidden in plain sight, coded as symbols legibleto some but not to all. The use of animal fables has a long-standing historydating back to slavery as providing such a coded language of resistance

      get out use of deer ... chris, black resistance, fables...taxidermy hidden in plain sight, coded/only chris to understand

    16. Wagner notes that theweaker animals use their wits as a means of overcoming the unequal powerdistribution in the world they navigated

      slavery fables weak/vermin intro get out deer...wits and taxidermy

    17. he “speaking animal,” which acknowledgesthe dialectic capacity of the symbolic animal of fables to stage a conversationabout subjugation and resistance, but simultaneously, to point beyond itselfto the reality of animal life.

      speaking animals ... speaking through eyes/perspective

    18. Paraphrasing Joel Chandler Harris, BryanWagner writes that animal stories were “political allegories in which therelative position of the weaker animals corresponded to the global per-spective of the race.”

      thow dean uses deer and how poe uses cat ... not how chris uses deer

    1. interval values can be written using the following verbose syntax: [@] quantity unit [quantity unit...] [direction] where quantity is a number (possibly signed); unit is microsecond, millisecond, second, minute, hour, day, week, month, year, decade, century, millennium, or abbreviations or plurals of these units
    1. My freely downloadable Beginning Mathematical Logic is a Study Guide, suggesting introductory readings beginning at sub-Masters level. Take a look at the main introductory suggestions on First-Order Logic, Computability, Set Theory as useful preparation. Tackling mid-level books will help develop your appreciation of mathematical approaches to logic.

      This is a reference to a great book "Beginning Mathematical Logic: A Study Guide [18 Feb 2022]" by Peter Smith on "Teach Yourself Logic A Study Guide (and other Book Notes)". The document itself is called "LogicStudyGuide.pdf".

      It focuses on mathematical logic and can be a gateway into understanding Gödel's incompleteness theorems.

      I found this some time ago when looking for a way to grasp the difference between first-order and second-order logics. I recall enjoying his style of writing and his commentary on the books he refers to. Both recollections still remain true after rereading some of it.

      It both serves as an intro to and recommended reading list for the following: - classical logics - first- & second-order - modal logics - model theory<br /> - non-classical logics - intuitionistic - relevant - free - plural - arithmetic, computability, and incompleteness - set theory (naïve and less naïve) - proof theory - algebras for logic - Boolean - Heyting/pseudo-Boolean - higher-order logics - type theory - homotopy type theory

  7. Nov 2022
    1. by using symbols as keys, you will be able to use the implicit conversion of a Mash via the #to_hash method to destructure (or splat) the contents of a Mash out to a block

      Eh? The example below:

      symbol_mash = SymbolizedMash.new(id: 123, name: 'Rey') symbol_mash.each do |key, value| # key is :id, then :name # value is 123, then 'Rey' end

      seems to imply that this is possible (and does an implicit conversion) because it defines to_hash. But that's simply not true, as these 2 examples below prove:

      ``` main > symbol_mash.class_eval { undef :to_hash } => nil

      main > symbol_mash.each {|k,v| p [k,v] } [:id, 123] [:name, "Rey"] => {:id=>123, :name=>Rey} ```

      ``` main > s = 'a' => a

      main > s.class_eval do def to_hash chars.zip(chars).to_h end end => :to_hash

      main > s.to_hash => {a=>a}

      main > s.each Traceback (most recent call last) (filtered by backtrace_cleaner; set Pry.config.clean_backtrace = false to see all frames): 1: (pry):85:in __pry__' NoMethodError: undefined methodeach' for "a":String ```

    2. Hashie does not have built-in support for coercing boolean values, since Ruby does not have a built-in boolean type or standard method for coercing to a boolean. You can coerce to booleans using a custom proc.

      I use: ActiveRecord::Type::Boolean.new.cast(value)

  8. Oct 2022
    1. disport itself happily in its new and extended Quadrivium withoutpassing through the Trivium. But the scholastic tradition, though broken andmaimed, still lingered in the public schools and universities:

      Is it possible that with the flowering of the storehouse of knowledge and the rise of information overload following Gutenberg's moveable type, we became overly enamored with Sayers' subject-based Quadrivium that we forgot to focus on the basics of the Trivium?

  9. Sep 2022
    1. get usually

      This apparent error in the text is most likely a typo where two words should appear in the opposite order, making the sentence read "People working together in organizations usually get things done..."

  10. Aug 2022
  11. Jun 2022
  12. May 2022
    1. ```html

      Choose your monster's colors:

      <div> <input type="color" id="head" name="head" value="#e66465"> <label for="head">Head</label> </div> <div> <input type="color" id="body" name="body" value="#f6b73c"> <label for="body">Body</label> </div>

      ```

      ```js colorPicker.addEventListener("input", updateFirst, false); colorPicker.addEventListener("change", watchColorPicker, false);

      function watchColorPicker(event) { document.querySelectorAll("p").forEach(function(p) { p.style.color = event.target.value; }); } ```

    1. DICER1 syndrome is a rare genetic condition predisposing to hereditary cancer and caused by variants in the DICER1

      GeneName: DICER1 PMCID: PMC7859642 HGNCID: Unavailable Inheritance Pattern: Autosomal dominant. Disease Entity: Familial pleuropulmonary blastoma (PPB), cervix embryonal rhabdomyosarcoma, multinodular goiter, nasal chondromesenchymal hemartoma, Ciliary body medulloepithelioma, Sertoli-Leydig Cell Tumor (SLCT), differentiated thyroid carcinoma, pituitary blastoma, pineoblastoma, cystic nephroma, Wilm's tumor and sarcomas of different sites including, amongst others, the uterine cervix, kidney and brain. Mutation: Germline Zygosity: Heterozygose Variant: No ClinVarID present. Family Information: No family outline Case: No specified information of patients included. CasePresentingHPO's: n/a CasePrevious Testing: n/a gnomAD: n/a Mutation Type: nonsense, frameshift, or splice affected.

    1. DICER1 syndrome is an autosomal-dominant,pleiotropic, tumor-predisposition disorder arisingfrom pathogenic germline variants in DICER1, whichencodes an endoribonuclease integral to processingmicroRNAs

      DICER1 is the gene name. PubMed ID, HGCNCID, and Variant: I can't find Inheritance Pattern: autosomal-dominant The disease entity: DICER1 syndrome The type of mutation: germline. Zygosity: not known. Family Information: a family was used, DICER1 carriers, and non DICER1 variant used, some of the family members had tumors from DICER1 Case Information: mean age is 34, the range of age is 18.6 to 43 years, male, and female used, ethnicity can't find Case Presenting HPO: cancer testing, chemotherapy, radiotherapy gnomeAD: 9.2,8.3.2 Mutation type: Pleiotropic, loss of function, missense

  13. Apr 2022
    1. As we all experience the world differently, the way of learning each of us is diverse. Comprehending how we learn things would help the teachers to understand their students and they don’t have to see any students lagging. Every kid doesn’t come first in the class. It is not because they have a smaller brain size. It is because their brain would acknowledge a different procedure of learning. In this article we are going to discuss the 4 types of learning styles so that you can understand – what type of learner are you?
    1. Marc Lipsitch. (2021, July 20). At the risk of boiling down too much and certainly losing some detail, one way to summarize this wonderful thread is that when we think about vaccine effectiveness, we should think of 4 key variables: 1 which vaccine, 2 age of the person, 3 how long after vax, 4 vs what outcome. [Tweet]. @mlipsitch. https://twitter.com/mlipsitch/status/1417595538632060931

    1. Gutenberg used his second edition of the Catholicon to experiment with casting type not letter by letter but in two- line slugs that could be reused in later printings, saving the labor of distributing then resetting the type letter by letter.
  14. Mar 2022
    1. assumes that the function identifier f has a particular type

      How is the initial assumption choosen? Does it start with a completely generic type and then tries to narrow it down?

  15. Feb 2022
    1. Deepti Gurdasani. (2022, January 10). Lots of people dismissing links between COVID-19 and all-cause diabetes. An association that’s been shown in multiple studies- whether this increase is due to more diabetes or SARS2 precipitating diabetic keto-acidosis allowing these to be diagnosed is not known. A brief look👇 [Tweet]. @dgurdasani1. https://twitter.com/dgurdasani1/status/1480546865812840450

    1. Su, Y., Yuan, D., Chen, D. G., Ng, R. H., Wang, K., Choi, J., Li, S., Hong, S., Zhang, R., Xie, J., Kornilov, S. A., Scherler, K., Pavlovitch-Bedzyk, A. J., Dong, S., Lausted, C., Lee, I., Fallen, S., Dai, C. L., Baloni, P., … Heath, J. R. (2022). Multiple Early Factors Anticipate Post-Acute COVID-19 Sequelae. Cell, 0(0). https://doi.org/10.1016/j.cell.2022.01.014

  16. Jan 2022
  17. Dec 2021
    1. Similar to the idea of {{ if .Title }}, does Micro.blog (or Hugo) have a way to identify if a post only contains images and capture that to a variable?

      Another potential method (or an additional filter) for finding posts with photos, or more specifically posts whose main purpose is a photo or image is to use use the post type discovery algorithm. Given that Micro.blog is built on a variety of IndieWeb building blocks, most photos could/should have a class of u-photo on their img tags, so you could search for these instead or in addition to. I believe there are a set of parsers and tools out there that do this in a few languages already and someone in the IndieWeb Dev chat can direct you to them if they’re not linked to the page above.

    1. Over these two centuries, an in-creasing impatience for the ancient art of memory based on the use of imagi-nation could be detected in the academic milieu.

      Following the invention of moveable type, the information overload created in the two centuries between 1550 and 1750, placed a major burden and impatience, particularly on academic scholars, on the use of the ancient arts of memory based on the use of imagination. In addition to the education reforms by those like Peter Ramus, this may have been a major motivating factor for forgetting this prior tradition of knowledge acquisition and management.

      What is one to do when there's seemingly "too much to memorize"?

    1. All this bears little resemblance to modern literary ideals, in which the author is constructed somewhat heroically as an individual creative source.

      This is broadly true in the early West, but becomes far more prevalent after the time of Konrad Gessner (1516 - 1565) whose work coincided with the explosion of information following the use of moveable type in Europe.

    1. Behind this order of paper slips that guarantees mobility and rearrange-ment, one can recognize the same economy of signs that a century earlier contributes to a major paradigmatic shift. Johannes Gutenberg ’ s invention of the printing press not only forges most obviously associations of typeset-ting, steel models, pouring mechanisms for individual letter types, special alloys, and composing sticks for setting lines of type. 28

      Much the same way printing was automated with Johannes Gutenberg's moveable type invention, the writing of longer pieces may be automated with moveable ideas. Ideas written down on slips (index cards) can be moved around easily and re-used as necessary in composing longer articles.

  18. Nov 2021
    1. the name union comes from type theory. The union number | string is composed by taking the union of the values from each type. Notice that given two sets with corresponding facts about each set, only the intersection of those facts applies to the union of the sets themselves.
    2. For example, if we had a room of tall people wearing hats, and another room of Spanish speakers wearing hats, after combining those rooms, the only thing we know about every person is that they must be wearing a hat.
    3. Type aliases and interfaces are very similar, and in many cases you can choose between them freely. Almost all features of an interface are available in type, the key distinction is that a type cannot be re-opened to add new properties vs an interface which is always extendable.
    1. Regarding mapped types, remember that { [K in T]: U } is a special form - it can't be combined with other properties within the { }. So there's not really a name for the [K in T: U] part because it's just part of the overall "mapped type" syntax { [K in T]: U }
    2. Which... is confusing because Palette technically does have an index signature Palette is a mapped type, and mapped types don't have index signatures. The fact that both use [ ] is a syntactic coincidence.
    1. So now the question is, why does Session, an interface, not get implicit index signatures while SessionType, an identically-structured typealias, *does*? Surely, you might again think, the compiler does not simply deny implicit index signatures tointerface` types? Surprisingly enough, this is exactly what happens. See microsoft/TypeScript#15300, specifically this comment: Just to fill people in, this behavior is currently by design. Because interfaces can be augmented by additional declarations but type aliases can't, it's "safer" (heavy quotes on that one) to infer an implicit index signature for type aliases than for interfaces. But we'll consider doing it for interfaces as well if that seems to make sense And there you go. You cannot use a Session in place of a WithAdditionalParams<Session> because it's possible that someone might merge properties that conflict with the index signature at some later date. Whether or not that is a compelling reason is up for rather vigorous debate, as you can see if you read through microsoft/TypeScript#15300.
    1. The type-fest package contains only types, meaning they are only used at compile-time and nothing is ever compiled into actual JavaScript code. This package contains functions that are compiled into JavaScript code and used at runtime.
  19. Oct 2021
    1. Hulme, W. J., Williamson, E. J., Green, A., Bhaskaran, K., McDonald, H. I., Rentsch, C. T., Schultze, A., Tazare, J., Curtis, H. J., Walker, A. J., Tomlinson, L., Palmer, T., Horne, E., MacKenna, B., Morton, C. E., Mehrkar, A., Fisher, L., Bacon, S., Evans, D., … Goldacre, B. (2021). Comparative effectiveness of ChAdOx1 versus BNT162b2 COVID-19 vaccines in Health and Social Care workers in England: A cohort study using OpenSAFELY [Preprint]. Epidemiology. https://doi.org/10.1101/2021.10.13.21264937

    1. When I was looking for a way to build small, maintainable websites as an independent contractor, I found a local Vancouver company, Chloi, that was working on a static site generator called Harp. It was a plus that Kenneth Ormandy of Type Brigade had been involved in the project. (See his contributions on GitHub)

  20. Sep 2021
  21. Aug 2021
    1. the tuple() function you need can be succinctly written as: export type Lit = string | number | boolean | undefined | null | void | {}; export const tuple = <T extends Lit[]>(...args: T) => args;
    2. const list = ['a', 'b', 'c'] as const; // TS3.4 syntax type NeededUnionType = typeof list[number]; // 'a'|'b'|'c';
    3. possible to tell the compiler to infer the type of a tuple of literals as a tuple of literals, instead of as, say, string[], by using the as const syntax.
    4. Or, maybe better, interpret the list as a tuple type: const list: ['a','b','c'] = ['a','b','c']; // tuple
    5. One problem is the literal ['a','b','c'] will be inferred as type string[], so the type system will forget about the specific values.
    1. function strictIsDog<T extends Dog extends T ? unknown : never>( // like <T super Dog> candidate: Dog | T // if Dog extends T then Dog | T is T ): candidate is Dog { // compiler recognizes that Dog | T can narrow to T return "bark" in candidate; } if (strictIsDog(animal)) {} // okay if (strictIsDog(dog)) {} // okay if (strictIsDog(mixed)) {} // okay if (strictIsDog(cat)) {} // error! // ~~~ <-- Cat is not assignable to Dog
    2. * Now it's correct within the laws of the type system, but makes zero practical sense, * because there exists no runtime representation of the type `Date & string`. * * The type system doesn't care whether a type can be represented in runtime though.

      new tag?: makes zero practical sense

      makes zero practical sense because there exists no runtime representation of the type

    3. Using the second type guard forces the user to write a more precise type and therefore manifest any nonsensical type guards that produce never, like: function silly<T extends number>(candidate: T): candidate is T & boolean { … }
    1. function isKeyOfMcuParams(x: string): x is keyof McuParams { switch (x) { case 'foo': case 'bar': case 'baz': return true; default: return false; } }
    2. Is it possible to write a user defined type guard for a keyof string type such as keyOf foo when foo is defined ONLY as a type (and not in an array)?
    1. It means that when having a type guard:TypeScript and JavaScript runtime are tied to the same behaviour.
    2. Inside the if statement, TypeScript will assume that amount cannot be anything else than a string, which is true also at the runtime thanks to typeof JavaScript operator.
    3. This “gap” between what we call “runtime” and “static analysis” can be filled using TypeScript Type Guards.
    1. we use a type guard here to say that, if this function returns true, any further usage of key will be of the specified type. Otherwise, it's still just a string.
    2. function hasKey<O>(obj: O, key: PropertyKey): key is keyof O { return key in obj }
    1. Adding to the accepted answer, if you happen to need to use a type guard against a mixin, you'll get this error too, since the is operator doesn't behave as an implements would.
    2. Regarding the error message, the predicate type must be assignable to the value type because the type guard is used to check whether a value with a less-specific type is in fact a value with a more-specific type. For example, consider this guard: function isApe(value: Animal): value is Ape { return /* ... */ } Ape is assignable to Animal, but not vice versa.
    3. If there is no relationship between the value's type and the type in the type predicate, the guard would make no sense. For example, TypeScript won't allow a user-defined guard like this: function isString(value: Date): value is string { return typeof value === "string"; }
    1. Type Annotations:These annotations can be applied to any place where a type is being used. For example, we can annotate the return type of a method.
    1. We can also define these properties for data types that we do not control, for example providing a custom way of hashing a data type implemented by someone else
    1. Moss points out the implied analogy between the commonplace-book and "moveable type, capable of both setting a page of text in an apparentiy immutable form and of rearranging all the eléments of that page into other pattems for other meanings" (p. 252); with characteristie prudence, she mentions this analogy only when it finally becomes explicit in one of her later texts, Jean Oudart's Methode des orateurs oí 1668

      The ideas of moveable type and moveable information can be an important idea in the evolution of commonplace books to zettelkasten and thence into digital forms of commonplaces.

  22. May 2021
  23. Mar 2021
    1. We added the X-Content-Type-Options: nosniff header to our raw URL responses way back in 2011 as a first step in combating hotlinking. This has the effect of forcing the browser to treat content in accordance with the Content-Type header. That means that when we set Content-Type: text/plain for raw views of files, the browser will refuse to treat that file as JavaScript or CSS.
    1. The distinction in computer programming between classes and objects is related, though in this context, "class" sometimes refers to a set of objects (with class-level attribute or operations) rather than a description of an object in the set, as "type" would.
    2. The distinction is important in disciplines such as logic, linguistics, metalogic, typography, and computer programming.
    3. The sentence "they drive the same car" is ambiguous. Do they drive the same type of car (the same model) or the same instance of a car type (a single vehicle)?
    1. In the simple biology example, dog is a hypernym and Fido is one of its hyponyms. A word can be both a hyponym and a hypernym. For example, dog is a hyponym of mammal and also a hypernym of Fido.

      I wish they hadn't used tokens/objects in this example. Wouldn't it be just as clear or clearer if they had stuck to only comparing types/classes?

      It may be okay to mix them like that in some contexts, but in other cases it seems like this would be suffering from ignoring/conflating/[better word?] the Type–token distinction.

      Does linguistics just not make the https://en.wikipedia.org/wiki/Type%E2%80%93token_distinction ?

      This statement seems to reinforce that idea:

      words that are examples of categories are hyponyms

      because an example of a category/class/type could be either a sub-class or an instance of that category/class/type, right?

    2. words that are examples of categories are hyponyms
    1. “There is very little incentive for Microsoft to make a significant change to features that are used extremely widely by the rest of the massive community of Excel users.”

      Microsoft did the right thing here. Most users are not geneticists and they rely on automatic date conversion.

  24. Feb 2021
    1. And we can specify types of wrapped values in a function return annotation, for example Result[float, ZeroDivisionError] returns either Success[float] or Failure[ZeroDivisionError].
    2. Now you can easily spot them! The rule is: if you see a Result it means that this function can throw an exception. And you even know its type in advance.
    3. So, despite your code is type safe it is not safe to be used.