39 Matching Annotations
  1. Jan 2023
    1. Algerien profitiert vom Bedarf an Öl und Gas nach den Angriff auf die Ukraine und hat seine Einnahmen um 70% gesteigert. Die Regierung nutzt die Abhängigkeit des Westens aus, um die Repression gegen Journalist:innen und Opposition zu verschärfen. Algerien hat mir dem Bau einer zweiten Gaspipeline nach Sizilien beginnen und will in Zukunft 25 bis 35 Milliarden m<sup>3</sup> nach Italien und darüber an den Rest Europas liefern.

  2. Dec 2022
    1. In Deutschland scheitert der Ausbau der Windkraft nach wie vor an Vorschriften und an mangelndem Engagement von Landes-, aber auch Bundesbehörden. Die taz dokumentiert die aktuelle Lage ausführlich, unter anderem mit einer interaktiven Karte, die zeigt, wo Windkraftanlagen möglich wären. Sie hat dazu Claudia Kemfert und Thorsten Lenk von Agora Energiewende befragt.

  3. Nov 2022
    1. Der österreichische Energieverbrauch beträgt zirka 404 TWh (1 Terawattstunde = 1012 Wattstunden) und steigt jährlich um mehr als 2 %. Etwa 25 % davon stammen aus erneuerbaren Energiequellen. Eine grobe Betrachtung zeigt, dass etwa je ein Drittel des Energieverbrauchs auf Verkehr, Industrie und andere Verbraucher entfällt. Ein Anteil von etwa 60 TWh wird in der Form von elektrischer Energie verbraucht. Durch die günstigen natürlichen Gegebenheiten in Österreich können etwa 60 % davon aus Wasserkraft gewonnen werden. Auf Grund des stetig steigenden Verbrauchs und in geringerem Ausmaß wegen der Liberalisierung der Strommärkte erzeugt Österreich seit dem Ende der 90-er Jahre auch bei der Elektrizität nicht mehr selbst seinen Eigenbedarf. Im europäischen Vergleich hat Österreich - vor allem auf Grund der Wasserkraft - einen hohen Anteil an erneuerbarer Energie. In Europa erfolgt die Stromgewinnung zu etwa 85 % aus fossilen Rohstoffen sowie Kernenergie und zu 15 % aus erneuerbaren Quellen. Es ist also derzeit in allen Bereichen eine überwiegende Abhängigkeit von fossilen Energieträgern gegeben.
    1. What does 'passing an argument' mean in programming?You have a grinder that will grind anything that you pass on to her. You give her Rice. She grind it. You give her wheat. She grind it. You give her a Justin Bieber song CD. She grind it. She grinds every thing that you hand over to her. In programming, we create function that does the stuff we need. Say add, subtract, multiply or print the stuff that you pass on to it. Then we pass on stuff upon which the function will operate and return us the results. This process of passing the 'stuff' to be processed is referred to as passing an 'argument' in programming. Thank You.
    1. An argument is a way for you to provide more information to a function. The function can then use that information as it runs, like a variable. Said differently, when you create a function, you can pass in data in the form of an argument, also called a parameter.

      argument and parameter

  4. Sep 2022
  5. Apr 2022
  6. Jul 2021
  7. Jun 2021
    1. Same feature in TypeScript¶ It's worth mentioning that other languages have a shortcut for assignment var assignment directly from constructor parameters. So it seems especially painful that Ruby, despite being so beautifully elegant and succinct in other areas, still has no such shortcut for this. One of those other languages (CoffeeScript) is dead now, but TypeScript remains very much alive and allows you to write this (REPL): class Foo { constructor(public a:number, public b:number, private c:number) { } } instead of this boilerplate: class Foo { constructor(a, b, c) { this.a = a; this.b = b; this.c = c; } } (The public/private access modifiers actually disappear in the transpiled JavaScript code because it's only the TypeScript compiler that enforces those access modifiers, and it does so at compile time rather than at run time.) Further reading: https://www.typescriptlang.org/docs/handbook/2/classes.html#parameter-properties https://basarat.gitbook.io/typescript/future-javascript/classes#define-using-constructor https://kendaleiv.com/typescript-constructor-assignment-public-and-private-keywords/ I actually wouldn't mind being able to use public/private modifiers on instance var parameters in Ruby, too, but if we did, I would suggest making that be an additional optional shortcut (for defining accessor methods for those instance vars) that builds on top of the instance var assignment parameter syntax described here. (See more detailed proposal in #__.) Accessors are more of a secondary concern to me: we can already define accessors pretty succinctly with attr_accessor and friends. The bigger pain point that I'm much more interested in having a succinct shortcut for is instance var assignment in constructors. initialize(@a, @b, @c) syntax¶ jsc (Justin Collins) wrote in #note-12: jjyr (Jinyang Jiang) wrote: I am surprised this syntax has been repeatedly requested and rejected since 7 years ago. ... As someone who has been writing Ruby for over 10 years, this syntax is exactly that I would like. I grow really tired of writing def initialize(a, b, c) @a = a @b = b @c = c end This would be perfect: def initialize(@a, @b, @c) end I'm a little bit sad Matz is against this syntax, as it seems so natural to me. Me too!! I've been writing Ruby for over 15 years, and this syntax seems like the most obvious, simple, natural, clear, unsurprising, and Ruby-like. I believe it would be readily understood by any Rubyist without any explanation required. Even if you saw it for the first time, I can't think of any way you could miss or misinterpret its meaning: since @a is in the same position as a local variable a would normally be, it seems abundantly clear that instead of assigning to a local variable, we're just assigning to the variable @a instead and of course you can reference the @a variable in the constructor body, too, exactly the same as you could with a local variable a passed as an argument. A workaround pattern¶ In the meantime, I've taken to defining my constructor and list of public accessors (if any) like this: attr_reader \ :a, :b def new( a, b) @a, @b = a, b end ... which is still horrendously boilerplatey and ugly, and probably most of you will hate — but by lining up the duplicated symbols into a table of columns, I like that I can at least more easily see the ugly duplication and cross-check that I've spelled them all correctly and handled them all consistently. :shrug: Please??¶ Almost every time I write a new class in Ruby, I wish for this feature and wonder if we'll ever get it. Can we please?
    1. TypeScript offers special syntax for turning a constructor parameter into a class property with the same name and value. These are called parameter properties

      Doesn't thisk violate their own non-goal #6, "Provide additional runtime functionality", since it emits a this.x = x run-time side effect in the body that isn't explicitly written out in the source code?

  8. basarat.gitbook.io basarat.gitbook.io
    1. Having a member in a class and initializing it like below:class Foo { x: number; constructor(x:number) { this.x = x; }}is such a common pattern that TypeScript provides a shorthand where you can prefix the member with an access modifier and it is automatically declared on the class and copied from the constructor. So the previous example can be re-written as (notice public x:number):class Foo { constructor(public x:number) { }}
  9. Apr 2021
  10. Feb 2021
  11. Dec 2020
    1. In statistics, a population parameter is a number that describes something about an entire group or population.

      Descriptive statistics provides numbers to describe the population.

  12. Oct 2020
    1. const debounceFunc = debounce(1000, false, (num) => {    console.log('num:', num);}); // Can also be used like this, because atBegin is false by defaultconst debounceFunc = debounce(1000, (num) => {    console.log('num:', num);});
  13. Sep 2020
  14. Aug 2020
  15. Jul 2020
  16. Jun 2020
  17. Feb 2019
    1. Engineering Challenges
      • Communication 通常的存储都是kv,更新粒度是单个数值,但是ML算法通常的数据集类型是matrix,vector,tensor,更新的是part matrix或者vector,所以可以更进一步优化通信数据类型。

      • Fault tolerance