210 Matching Annotations
  1. Last 7 days
  2. 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. Thanks, this was just what I was looking for! This is a perfect appropriate use of instance_eval. I do not understand the nay-sayers. If you already have your array in a variable, then sure, a.reduce(:+) / a.size.to_f is pretty reasonable. But if you want to "in line" find the mean of an array literal or an array that is returned from a function/expression — without duplicating the entire expression ([0,4,8].reduce(:+) / [0,4,8].length.to_f, for example, is abhorrent) or being required to assign to a local, then instance_eval option is a beautiful, elegant, idiomatic solution!!
    2. instance_eval is analogous to using tap, yield_self, … when you are dealing with a chain of method calls: do use it whenever it's appropriate and helpful! And in this case, I absolutely believe that it is.
  3. Apr 2021
    1. What a convenient little elision for the Valley, the seat of real power. They’re not the repressive force; opposing them is. All they want is to let us be as free as when we were kids.

    1. Close all office applications on your computer to repair outlook. Go to the Start icon on your desktop’s taskbar and open control panel. Select Category view and go to the programs section to fix why won't my outlook open. Select uninstall program next and right-click Microsoft Office. Now choose Change and select Online Repair or Repair. Select Yes if a user account control prompt appears. Restart Outlook to finish the process and check if your Outlook is working fine.

      For more details: Outlook not Working

  4. Mar 2021
    1. Essentially we're trying to figure out when it's appropriate for "my" code to become "everyones" code, and if there are steps in between. ("Standard library", for example.)
    1. // A general key transform method. Pass it a function that accepts the old key and returns // the new key. // // @example // obj = transformKeys(obj, (key) => ( // key.replace(/\b(big)\b/g, 'little') // )) export function transformKeys(source, f) { return Object.entries(source).reduce((o, [key, value]) => { o[f(key) || key] = value return o }, {}) } // Provide an object that maps from old key to new key export function rekeyObject(source, keyMap) { transformKeys(source, key => keyMap[key]) }
    1. Maa ngiy waxtaan ak sama xarit.

      Je parle avec mon ami.

      (Note: it says "walking with" but should say "talking with" -- might've been fixed by the time you read this!)

      maa -- me.

      ngiy -- I am.

      waxtaan v. -- conversation, chat, interview. 💬

      ak -- and, with.

      sama -- my.

      xarit bi -- part of a split set; friend. 👯

      https://www.youtube.com/watch?v=QQiWG98Bsys

    2. Sama nijaay aj na ñaari yoon.

      Mon oncle a effectué deux fois le pèlerinage à La Mecque.

      sama -- my.

      nijaay ji n. -- maternal uncle; term of reference and address to designate the husband, in conservative circles.

      aj (Arabic) v. -- make the pilgrimage to Mecca. 🕋; deceased ☠️ (for a religious personality).

      na -- he (?).

      ñaar+i (ñaar) -- twice; two. 2️⃣

      yoon wi n. -- lane, path, track 🛤; law, regulation, legislation; times.

  5. Feb 2021
    1. You can utilize the ‘Where’s my Refund?’ tool on TurboTax to track your refund. When you open Where’s My Refund tool, three separate boxes will display on your screen – one for your filing status, one for your refund amount, and last one for your Social Security Number. You have to enter the asked details, and when you finish entering them, click on Submit to see your status of refund. This can be done for TurboTax Login Track My Refund.

    1. There are possible two ways to TurboTax login track my refund process. However, direct deposit seems to be the best option. Direct Deposit E-files is the quickest way to get your federal tax refund. According to IRS, 9 out of 10 e-filed tax returns with direct deposit will be processed within 21 days of IRS e-file acceptance. The second option involves mailing papers, but it takes a lot of time in processing that.

  6. Jan 2021
  7. Dec 2020
  8. Nov 2020
    1. About auto-close bots... I can appreciate the need for issue grooming, but surely there must a better way about it than letting an issue or PR's fate be semi-permanently decided and auto-closed by an unknowing bot. Should I be periodically pushing up no-op commits or adding useless "bump" comments in order to keep that from happening? I know the maintainers are busy people, and that it can take a long time to work through and review 100s of open issues and PRs, so out of respect to them, I was just taking a "be patient; they'll get to it when they get to it" approach. Sometimes an issue is not so much "stale" as it is unnoticed, forgotten about, or consciously deferred for later. So if anything, after a certain length of time, if a maintainer still hasn't reviewed/merged/accepted/rejected a pull request, then perhaps it should instead be auto-bumped, put on top of the queue, to remind them that they (preferably a human) still need to review it and make a decision about its fate... :)
  9. Oct 2020
  10. Sep 2020
    1. If you are facing Google Chrome not downloading issues, then check for the internet connection and device compatibility. After installation, you can reset Google Chrome and make Chrome my default browser. Follow the steps to download and install Chrome browser; also you can follow the same process to fix Chrome won’t update.

    1. The dynamic routes are a great way to keep the routing.rb DRY and avoid unneeded dependencies between the routing and the controller files That is exactly the problem: I've already defined the (white)list of actions in the controller; I just want to make them all available via routes. I shouldn't have to repeat myself in the routes file.
  11. Aug 2020
  12. Jul 2020
  13. Jun 2020
  14. May 2020
    1. Updated to add .join. Also looked like the 2nd example was missing result.save so added that too. Haven't tested the code, so hopefully it is correct...
  15. Apr 2020
    1. Our hope is that once a formal specification for these extensions is settled, this patchset can be used as a base to upstream the changes in the original project.

      What does "can be used as a base to upstream the changes in the original project" mean here?

    1. Links to https://github.com/amirrajan/rubymotion-applied, but that is only for documentation so doesn't seem like an exact replacement for (to supersede) this project.

    1. Secure input fields. 1Password uses secure input fields to prevent other tools from knowing what you type in the 1Password apps. This means that your personal information, including your Master Password, is protected against keyloggers.

      How can this prevent keyloggers from intercepting the passwords? If keylogger is running at low enough level....

    1. “By using a mask, even if it doesn’t do a lot, it moves the locus of control to you, away from the virus. It gives the individual a greater sense of control in this otherwise not-controlled situation.”
  16. Mar 2020
    1. just a shift from companies focused on second-party data to those focused on first-party data

      What does this mean? What is second-party data and first-party data? Is second-party just a more accurate name for what others call third-party? Who are the three parties?

    2. Such a corporate structure helps contain the otherwise massive potential fines which are derived from the company's worldwide revenue.  However, the worldwide part would in practice be limited to the EU as that is the only market such a subsidiary would operate in.

      How does this structure helps contain the fines which are derived from the company's worldwide revenue?

      If fines are based on worldwide revenue anyway, then what good does having a EU subsidiary even do in that respect? None, it seems.

      This seems to even confirm that, but it is unclear/confusing how this is worded:

      However, the worldwide part would in practice be limited to the EU as that is the only market such a subsidiary would operate in.

    1. Matomo continues to champion the right for people to be in control of their own information.
    1. It may not sound that impressive today, now that file sharing is built into most modern operating systems, but it was cutting edge stuff 25 years ago.

      file sharing is built into most modern operating systems

      Which file sharing are you referring to specifically? scp? Probably not. FTP support built into file explorer? Probably not.

      The only things I'm thinking of are for manual copying, not for automatic "availability" in multiple places like NFS seems to be for.

    1. select an origin

      It's interesting that under my site's origin it lists cookies for other domains. Are these considered 3rd-party cookies or 1st-party cookies written by a 3rd-party script? How is it allowed to set them on my site? Presumably because I loaded a script from their origin.

      Loading scripts from other origins allows them to set cookies on which domains? Only their origin? And which cookies can they read?

  17. Feb 2020
  18. Jan 2020
    1. To execute Arel queries, we first need to get the SQL out of Arel and then feed it into find_by_sql.

      Surely there's a more elegant way nowadays???

  19. Dec 2019
    1. For example: I wanted a way to add recurring tasks to my list, so I wrote a simple bash script called goodmorning.sh. It uses the command prompt client to quickly add a bunch of tasks to my todo list of choice. I run this script first thing in the morning every workday, and I like it better than any built-in system I’ve found for recurring tasks, because it’s fully under my control.
  20. Nov 2019