19,785 Matching Annotations
  1. Oct 2022
    1. It's really not always a better user experience to keep things in one browser... What if they are in a sign-up or check-out flow in your SPA, and at the last step they need to agree to some conditions in an external page? Unless you use a modal, opening in a new window would really be preferable to the user completely losing context and having to go through the whole process again.
    1. It acts as a black hole null object, allowing arbitrarily deep method chains.

      If that's what it does, then perhaps the name should reflect that in the name!

    2. For any message that has not explicitly allowed or expected, the double will return itself.

      If that's what it does, then perhaps the name should reflect that in the name!

    3. to make the double "loose"

      If that's what it does, then perhaps the name should reflect that in the name!

    4. Null object doubles

      as_loose_object or as_black_hole or allow_any_message would have been better names.

      "null" makes it sound like nil, which you can't send any (almost) message to! So it sounds like it does the opposite (disallows random messages) of what it does (allows random messages).

    1. Computer Gaming World named this the 34th worst game ever made? lol First of all, gaming mainstream media sucks. Yeah, they are terrible reviewers. IGN, Metacritic, GameSpot, all of them, I don't like or follow them. CGW is today a defunct 80s/90s magazine which I never read because I live in Brazil, but here we had similar ones which reviews sucked and they are all dead by now too.

      .

    2. in 1994, this was a great game for MS-DOS, a classic today, even a masterpiece as much as SimCity is if you ask me so. It's fun, difficult, complex, had decent graphics for MS-DOS, it's too robust for its time, just don't believe the mass media

      .

    1. Note that one extra type that is accepted by convention is the Boolean type, which represents both the TrueClass and FalseClass types.
    2. This type does not exist in Ruby, however.
    3. Note: For keyword parameters, use @param, not @option.

      I sure was looking for @option (knowing already about @param) and assuming/expecting that (if it exists) it would totally be the right thing to use for documenting keyword parameters. So I was quite surprised to see this much-needed warning (for me and others like me who came here expecting/assuming the same thing).

    1. created an ancillary tool, named Yardstick, which verifies YARD (or RDoc) documentation coverage.
    2. Several templates and tools are available to assist in formatting, such as Reflinks (documentation), reFill (documentation) and Citation bot (documentation)

      I clicked the link for reFill and thought it looked interesting. Would like to look into this further.

    1. Another possibility is that the alternator will take on the task of recharging a depleted automotive battery. As a result of this increased strain on your alternator, you may notice that your car’s alternator begins to fail.
    1. Your alternator is NOT a chargerThe alternator’s job is to supply the power needed for all electrical items on the vehicle, plus replenish the battery from the last start up. The alternator is not a battery charger so much as it is a battery maintainer. If the alternator has to recharge an overly discharged battery, the alternator will become over-worked, which will shorten its life.If you use your alternator to charge your dead battery, you will overheat the alternator during its charging process. The greater the amperage flowing through it, the higher the heat an alternator creates.Maximum Alternator Output Only Occurs at high RPMSAfter you start your car with jumper cables, the voltage regulator sees a discharged battery and commands maximum field in the rotor. But at 600 RPM, the alternator can only provide about 1/4th of its rated output. Let it idle for a long period and all you’ll do it overheat the rotor windings and burn up your expensive alternator. A 110-amp alternator can only output 110-amps at RPMS of 2,500 or more. So don’t even think about letting it idle to recharge the battery.A battery charger costs $40. A new Alternator $350Not exactly brain surgery, is it?The correct way to deal with this situation is to jump the battery (using a jumper pack is much safer than jumper cables) and driving it to a place where you can place a REAL battery charger on the battery.
    1. Your Alternator Is Not A ChargerYes, you read that right. An alternator is designed to MAINTAIN your car battery, not recharge it from a deeply discharged state. Its designed to run at only 35-50% of its fully rated output. When you use your cars alternator to recharge a dead battery, you force it to run at nearly 100% of its rated capacity and that overheats the alternator and dramatically shortens its life.
    1. In the interest of reducing warranty claims (which are much more expensive than that incremental manufacturing cost) carmakers are sizing the whole unit to reliably accommodate the worst case draw (driver turns everything on at the same time, at idle).
    2. This was much more of an issue a generation ago, when your ‘74 Chevy Nova or ‘69 Ford F-100 had a 35 amp alternator. Any car made in the last 15-20 years will have a 75 amp alternator as a bare minimum, and ratings well north of 100 amps are common in larger vehicles.There’s dozens of amps of headroom to charge the battery at idle speed, especially if you turn off the lights, stereo, HVAC, etc. That said, it’ll charge even more quickly if you drive the car.

      In reply to: https://hyp.is/YNQwwlF0Ee206UcS3HYLnA/www.reddit.com/r/Cartalk/comments/aoks7b/how_much_idling_needed_after_jump_start_to/

      This seems like more sound/trustworthy advice than the replied-to's advice/info.

    3. This will KILL your alternator. You should get a battery charger or a trickle charger. Alternators go through hell when trying to recharge a fully depleted battery.
    1. After the first week of the campaign, we realized what are the main problematic pillars and fixed them right away. Nevertheless, even with these improvements and strong support from the Gamefound team, we’re not even close to achieving the backer numbers with which we could safely promise to create a game of the quality we think it deserves.
    2. First and foremost, we need to acknowledge that even though the funding goal has been met–it does not meet the realistic costs of the project. Bluntly speaking, we did not have the confidence to showcase the real goal of ~1.5 million euros (which would be around 10k backers) in a crowdfunding world where “Funded in XY minutes!” is a regular highlight.

      new tag: pressure to understate the real cost/estimate

    1. Welch eine Perle da beinahe an mir vorüber gegangen wäre!Super Story, gute Steuerung, stimmige Musik, tolle Sprecher [DE], ...Ein rundum gutes Paket - und leider [zu] kurz ...Passiert in letzter Zeit selten, dass ich mich an an Game setze und es in einer Tour durchspiele.Hier war dem aber so - ich wollte wissen: was, warum, wieso, wer ... orrrrrrrrrrr Hier und da n Rätselchen - da wollte ich ja zuerst nicht mehr, sind nicht so mein Fall.Sind aber alle nach den zweiten mal "schauen" mit dem Hausverstand lösbar, haben also keinesfalls den Spielfluss gehemmt und eher der [etwas] spielverlängernden Unterhaltung gedient, waren okay.Von mir bekommt das Game solide 8.5/10 Read More  
    1. i was a bit unsure what to think of it, as i wished to go into this 100% blind. And boy am i glad i did.
    1. Auto Margins With auto margins, flex items can be centered, spaced away or packed into sub-groups. Unlike justify-content, which is applied to the flex container, auto margins go on flex items. They work by consuming all free space in the specified direction. Align group of flex items to the right, but first item to the left Scenario from the question: making a group of flex items align-right (justify-content: flex-end) but have the first item align left (justify-self: flex-start) Consider a header section with a group of nav items and a logo. With justify-self the logo could be aligned left while the nav items stay far right, and the whole thing adjusts smoothly ("flexes") to different screen sizes.
    1. The answer is simple and here is an oversimplified example: // Your browser is identifying itself as this $ua_string = 'EDGE'; // The website logic is this if($ua_string === 'IE') { echo 'You are using IE'; } elseif($ua_string === 'FIREFOX') { echo 'You are using Firefox'; } else { echo 'You are using Chrome, and we don\'t support that.'; }

      answering using source code

    1. But what if we’ve more elements to ignore? people = { "Alice" => ["green", 34, "alice@example.com"], "Bob" => ["brown", 27, "bob@example.com"] } No problem. Just re-use the underscore: people.map { |name, (_, _, email)| [name, email] } You can’t do it with any variable, though, at least in Ruby 1.9. It only works with variables that are called _: people.map { |name, (x, x, email)| [name, email] } # SyntaxError: (eval):2: duplicated argument name
    1. No, I am interested in gathering all of the optional, named Keyword Parameters into a hash. I am not trying to create a new options hash. I want a hash of {:name => val, :color => val, etc.}, which are named in the method signature.
    2. opts = method(__method__).parameters.map(&:last).map { |p| [p, eval(p.to_s)] }.to_h SomeOtherObject.some_other_method(opts)
    3. Better to use binding.local_variable_get(p) instead of eval(p.to_s) when using local_variables, just to avoid that evil eval

      .

    4. that's right, we don't want to do params = { ... } because then we're hardcoding the implementation and it becomes very coupled. The benefit of doing it like in my examples is that you can change the method signature and still automatically capture all keyword parameters.
    5. Ruby 2.2 introduced Binding#local_variables which can be used instead of Method#parameters
    1. While splits on each bundle will vary, on average, there will be a minimum amount for Humble Bundle, generally between 15 - 30%. This minimum amount will allow Humble Bundle to continue offering great prices on amazing games, books, and software, all while supporting important charitable initiatives with every purchase. This minimum amount also lets us invest in exciting content to continue to grow the Humble community which ultimately drives more donations for charitable causes.

      positive spin on the required minimum

    1. git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main

      Probably would be better to use:

      git remote set-head origin -a

    2. git config --global init.defaultBranch main
    1. git remote set-head origin -aThe above command will query the remote host for the HEAD upstream and it updates that upstream in the local.
    2. There is evidence that states it was intended to mention master-copy or master recording. And it is not intended to master-slave.

      .

    1. I like it. I’m biased though since I’m a sucker for opportunities to simplify like this one.
    2. Current ruby releases generate *.tar.gz, *.tar.bz2, *.tar.xz, and *.zip. But I think we can stop generating *.tar.bz2. I think *.tar.bz2 are less merit. For better size, *.tar.xz exist. For better compatibility, *.tar.gz and *.zip exist.
    1. passenger-docker images contain an Ubuntu 20.04 operating system. You may want to update this OS from time to time, for example to pull in the latest security updates. OpenSSL is a notorious example. Vulnerabilities are discovered in OpenSSL on a regular basis, so you should keep OpenSSL up-to-date as much as you can. While we release passenger-docker images with the latest OS updates from time to time, you do not have to rely on us. You can update the OS inside passenger-docker images yourself, and it is recommend that you do this instead of waiting for us.
    2. apt-get upgrade -y -o Dpkg::Options::="--force-confold"
    1. multitenancy. The Nginx and Apache integration modes can host multiple apps at the same time.
    2. The Ruby on Rails framework provides a builtin server tool, which you can access with the rails server command. The "rails server" is not an application server by itself, but just a small wrapper that launches your application in an application server. This is why people do not use "rails server" in production. They use an application server – such as Passenger – directly. "rails server" uses Puma by default as of Rails 5.
    1. Please be sure to read Ruby’s License.

      Why draw attention to this?

    1. def initialize_copy(original_animal) self.age = 0 super end def initialize_dup(original_animal) self.dna = generate_dna self.name = "A new name" super end def initialize_clone(original_animal) self.name = "#{original_animal.name} 2" super end
    2. Now that we have seen this implementation, you might be wondering what is the use case for having two #initialize_* methods. The answer is: there is another way to copy objects, called #clone. You generally use #clone if you want to copy an object including its internal state. This is what Rails is using with its #dup method on ActiveRecord. It uses #dup to allow you to duplicate a record without its "internal" state (id and timestamps), and leaves #clone up to Ruby to implement.
    3. Are There Other Methods to Copy Something?
    4. If we would have kept the call to super out of the #initialize_dup method, we would never have called initialize_copy, so it is important to keep that in.
    5. An interesting fact here is that Rails deliberately chose to override the #initialize_dup method instead of the #initialize_copy method. Why would it do that? Let's investigate.
    1. what fixed my issue was: remove the node-sass from package.json npm install install it again in latest version via npm install --save-dev node-sass if you find this helpful, I assume you just need to upgrade your node-sass for the latest version because it uses node-gyp as a lower version.
    1. "I thought WSL ran as root in Windows" ... ABSOLUTELY NOT! Do you think we're crazy? ;) When opened normally, your Bash instances are launched with standard Windows user rights. If you want to edit your Windows hosts file, you must do so from an elevated Bash instance ... though only do this with enormous care - any other script you run in the same elevated Bash Console will also get admin rights to the rest of your machine!!
    1. The bash manual contains the statement For almost every purpose, aliases are superseded by shell functions.
    2. Functions are much more flexible than aliases. The following would overload the usual ls with a version that always does ls -F (arguments are passed in $@, including any flags that you use), pretty much as the alias alias ls="ls -F" would do: ls () { command ls -F "$@" }
    3. Simply don't use aliases in scripts. It makes little sense to use a feature designed for interactive use in scripts. Instead, use functions
    1. Options to import/export locally stored passwords have been a staple of Chrome for years. For god knows what reason either option seemed to randomly disappear in one Chrome Version and then re-appear in the next.Sometimes there was an import option with no export option, sometimes the other way round like right now, sometimes neither option was available, but you could always add either Option via chrome://flags.If they wanted to force people to use online sync only, why have options for local export still, but not import?
    1. You can even simplify this with the *** pattern that was added in version 2.6.7: + /mnt/ + /mnt/data/ + /mnt/data/i-want-to-rsyncthisdirectory/*** - /mnt/** This operator allows you to use the ** wildcard for exclusion and consequently to have only one exclude line.

      What does * mean? And why is it used in the + line but is used in the - line?

    2. which failed to work because of the trailing slash before the **. Removing the / made it all spring in to life as intended!
    1. I had to do 13 steps just to get to the point where I can start writing. To make matters worse, I often compulsively close terminal windows after I am done. This is a process that gets repeated single every time I feel like writing.It’s actually a huge barrier of entry. Sure they are trivial tasks, but they take up a whole lot of mental energy.Living the good life is not all about money, it’s about avoiding stupid things like having to perform a tedious 30 second routine just to get started working on what you want to do.
    1. Note that fixing a deleted ESP requires re-creating not just the ESP itself, but the boot loader(s) that it used to contain. Such a repair will require the use of an emergency boot disk, like an Ubuntu disk in its "try before installing" mode. You'll also need to restore all the boot loader files. In the case of a Windows/Ubuntu dual-boot, this means recovering both OS's boot loaders. To simplify this task, I strongly recommend backing up the ESP. A file-level backup (using tar, cp, or similar tools) should be sufficient.
    1. In all honesty, I haven't had the patience to experiment with the latter in order to gain certainty about it. Ditto for trusting the boundaries of firmware settings and booted drivers. Indeed, I don't really trust the standard 'buntu installer to reliably ensure that the external drive will even get an ESP partition - at least, without being explicitly told by a custom partitioning step.
    1. Yep, the easiest thing is to create a second EFI partition: https://pop.system76.com/docs/dual-booting-windows/It is still possible to encrypt your popOS ext4 partition using LUKS and LVM, though this won't just work out of the box.
    1. I'd like rsync to create the source dir structure on the remote, when I'm only synching a file in a sub-dir. At the moment it seems I need to do this in 2 commands, e.g.. ssh <remote> mkdir -p /backup/var/spool/cron/crontabs rsync -vauz /var/spool/cron/crontabs <remote>:/backup/home/var/spool/cron/. Ideally, I'd like to be able to do this: rsync -Mvauz /var/spool/cron/crontabs <remote>:/backup/home/var/spool/cron/.
    1. I'd like rsync to create the source dir structure on the remote, when I'm only synching a file in a sub-dir. At the moment it seems I need to do this in 2 commands, e.g.. ssh <remote> mkdir -p /backup/var/spool/cron/crontabs rsync -vauz /var/spool/cron/crontabs <remote>:/backup/home/var/spool/cron/. Ideally, I'd like to be able to do this: rsync -Mvauz /var/spool/cron/crontabs <remote>:/backup/home/var/spool/cron/. ...where M (make parents) is a new option that tells mkdir to do 'mkdir -p' on the remote target dir.
    1. refused connect from [IP-ADDRESS] ([IP-ADDRESS]) This particular message is emitted by the TCP wrappers library when it decides to reject a connection. Ubuntu's sshd is built to use TCP wrappers. Check the two files "/etc/hosts.allow" and "/etc/hosts.deny" on the ssh server. You have an entry in one of those files which causes ssh connections from that address to be rejected. See the Ubuntu man page for these files.

      answered question: error message in logs but don't know where coming from

    1. Going first through an inverter from 12 V D.C to house hold 120 or 240 and than back again to laptop charger is very inefficient. You have the magnetization losses of both the inverter and the charger, which could be 8 or 10 VA each , it does not sound much but 16 VA at 12 Volt = 1.33 Amps without doing any real work for you.

      inefficient

    1. With JSON Schema, you don't have to specify things. The syntax is declarative and adds restrictions. So if you don't want a restriction on the type of value that's allowed, don't use the type keyword.
    1. Why is the price of my Unity plan changing? The new price reflects the value of our products today, and it’s our first increase in almost three years. In that time, we’ve expanded our R&D resources by 172%, with the Unity Editor being our largest focus for R&D investment at Unity. This continued investment has helped us deliver Unity 2021 LTS with powerful improvements to workflows, rendering capabilities, and supported platforms. We will continue delivering improvements based on your feedback in every release to enhance your productivity, performance and stability.

      positive spin

    1. I expect RuboCop to either make no suggestion on how to resolve the ambiguity, or to suggest something that does not change the semantics of the code as it stands.
    2. However, the code as it stands associates the block with bar, and if the code is currently working, the programmer should definitely not parenthesize the parameter, because it would change the meaning of the code.
    1. A better message, clarifying the true purpose of the cop, which I guess is to differentiate empty Hash literals and blocks.
    2. But this sounds like spreading fear and doubt when the Ruby parser has no such concepts :) {} always binds tightly to the call right next to it. This block {} will never go to using, unless it's rewritten as do ... end.
    1. new top-level element for describing Webhooks that are registered and managed out of band
    1. Machines understand languages, that are formal and rigid, with unique and unambiguous instructions that are interpreted in precisely one way. Those formal, abstract languages, and programming languages in general, are hard to understand for humans like ourselves. Primarily, they are tailored towards the requirements of the machine. The user is therefore forced to adapt to the complexity of the formal language.

      .

    2. Instead of forcing humans to understand the complex inner workings of machines, we should construct machines in a way, so they better understand us humans!

      .

    1. This distinguishes this grammar from other programming languages or domain-specific languages.
    2. The additional content is only relevant for human readability. The machine, on the other hand, ignores this addition. Thus it is possible to express the rules in a grammatically correct way on the one hand and to give them a semantic context on the other.
    3. Rules formulated with openVALIDATION are thus at the same time a formal, machine-processable specification, but also a documentation that is easy for people to understand.
    1. Also it expects you to buy a bunch of hardware like a raspberry pi and such in order to do the project. I kind of thought there was going to be some kind of public API that acted like a virtual weather sensor but apparently we're building a real one.
    1. I failed to notice that, unlike the Whiz, which has the same distribution settings as a Scotts push spreader (i.e., settings 2 - 9 with half- and quarter-steps between) and which all products you use in a spreader, Scotts or not, conforms to in their instructions for telling you what to set the spreader at, the Whirl does NOT have these settings, meaning there's no way to follow directions on the packages of products you'll be using the Whirl spreader for, not even on the packages of products made by Scotts itself. That makes knowing what to set it at total guesswork, stabbing in the dark, which, as anyone knows who has ever burned their lawn with fertilizer knows, is very risky and potentially very costly. All Scotts gives you with the Whirl, after giving a disclaimer that you must "READ AND FOLLOW ALL LABEL DIRECTIONS OF THE PRODUCT YOU ARE APPLYING," which of course you can't do because those label directions give you a spreader setting that does NOT apply to this spreader, is generic instructions that say to set it at 1 for light seed, 3 for moderate fertilizer, and 5 for heavy ice-melt, only that's all very subjective and products, like fertilizers (even Scotts' own), don't all provide the same spreader setting by type but vary, meaning one fertalizer will tell you to set a standard spreader at 3 3/4, but another will tell you to set it at 5, while if you put any fertalizer on your lawn as heavily as you put ice-melt down, which is what the Whirl suggests for ice-melt, you'll burn your lawn.
    1. Topsoil has different grades. Lower-grade topsoils are meant for filling and leveling holes and should only be used for that purpose. Higher-grade topsoils are great for conditioning or adding organic matter to the native soil. Neither grade should be used when planting.

      Should not be used for planting anything?? Hmm.

  2. Sep 2022
    1. In other words, i18n allows applications to support and satisfy the needs of multiple locales, thus “enabling” l10n.

      one feature enables the other

    2. “Internationalization is the design and development of a product, application or document content that enables easy localization for target audiences that vary in culture, region, or language. Localization refers to the adaptation of a product, application or document content to meet the language, cultural and other requirements of a specific target market (a locale).”
    1. First, to clarify - what is "code", what is "data"? In this article, when I say "code", I mean something a human has written, that will be read by a machine (another program or hardware). When I say "data", I mean something a machine has written, that may be read by a machine, a human, or both. Therefore, a configuration file where you set logging.level = DEBUG is code, while virtual machine instructions emitted by a compiler are data. Of course, code is data, but I think this over-simplified view (humans write code, machines write data) will serve us best for now...
    1. @path.yield_self(&File.method(:read)).yield_self(&Parser.method(:new)) ...
    2. Why not use map, which we already have for collections? Generally speaking, the map function isn't just about collections (though that's usually how it's used in Ruby). map is more about putting an object in a context (a block in Ruby's case), modifying the object, and returning the modified object.
    3. I use only a subset of ruby that makes sense to me and I find appealing. Thankfully one can use ruby just fine without having to use everything.

      not all or nothing

      use just the parts you want

    1. TylerRick commented
    2. I ended up using a really poor hack, in my package.json, scripts: { ... "prebundle": "openapi bundle -o src/openapi.preprocessed.json spec/openapi.yaml --force --config .redocly.pre-processor.yaml 2>/dev/null && echo 'warning: errors from pre-processing step have been supressed'", "bundle": "openapi bundle -o src/openapi.json src/openapi.preprocessed.json ... }
    1. I don't know about you guys but I like dots on the second line when combined with indentation : # Example 1 one.two.three .four # Example 2 my_array.select { |str| str.size > 5 } .map { |str| str.downcase }
    2. They require the continuation to be present at precisely next line. (I.e. you cannot put more than one in-line comment in between.)

      .

    3. The order of these method calls may or may not matter. With leading dots, editing is a bit easier, particularly when you need to add a new method call or change the order.

      easier to edit

    4. (Similar to the javascript issue, you always have to remember to remove/add the trailing comma, so some developers prefer to put 'comma' in the beginning of each property.)
    1. Due to their lightweight nature, it is not uncommon to have hundreds of thousands of processes running concurrently in the same machine.
    2. Spawn an Elixir process (not an operating system one!)
    1. Writing Code for Humans — A Language-Agnostic Guide…because code which people can’t read and understand is easy to break and hard to maintain.
    1. Also, the chances of breaking something are really high, because not even you remember how the code actually works.
    2. Some people eventually realize that the code quality is important, but they lack of the time to do it. This is the typical situation when you work under pressure or time constrains. It is hard to explain to you boss that you need another week to prepare your code when it is “already working”. So you ship the code anyway because you can not afford to spent one week more.
    3. your cognitive load increases with the level of indentation. 1 2 3 4 5 6 7 8 9 10 if r.Method == "GET" { if r.Header.Get("X-API-KEY") == key { // ok return nil }else{ return errors.New("Key is not valid") } } else { return errors.New("Invalid Method") }
    4. Cognitive capacity is the total amount of information the brain is capable of retaining at any particular moment. This amount is finite, so we can say our total capacity is only ever 100%. How much of one’s cognitive capacity is being used towards a particular task at any given time is called the cognitive load
    5. Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
    6. netstat -tn 2>/dev/null | grep :80 | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr | head
    7. To see if you are writing good code, you can question yourself. how long it will take to fully transfer this project to another person? If the answer is uff, I don’t know… a few months… your code is like a magic scroll. most people can run it, but no body understand how it works. Strangely, I’ve seen several places where the IT department consist in dark wizards that craft scrolls to magically do things. The less people that understand your scroll, the more powerfully it is. Just like if life were a video game.
    8. it quickly becomes a mess of non related functions that anyone but the owner feels brave enough to import
    9. A little copy paste is better than a little dependency.
    10. Avoid indentation levels, If you find yourself with more than 3, you should create a function.
    11. Code explains what and how Documentation explains why.
    12. So make sure to write your documentation, but do not explain your spells.
    13. This is so clear that you don’t even need comments to explain it.
    14. Another type of comments are the ones trying to explain a spell.
    15. Do not explain your spells, rewrite them.
    16. Do you really need those lines? Isn’t it clear enough? Well, I still find comments like this in a lot of cases and it gets funnier when the comment is obsolete and the code is doing other things. Following the example, let’s imagine that another developer adds support for PUT method. I think that this is what would happen.
    17. This code is much easier to understand as it do not add levels of indentation and follows the principle where the 0 indentation level is the principal path of the application where other paths are exceptions or rare cases.
    18. people usually forgets about one of the greatest advantages of Open Source. YOU can fix the issue. You can download the source code and dig deep into the code allow you to keep moving. Also, you can merge this changes back to the original repository so others doesn’t have to fix it again. win-win relationship.
    19. The rule of thumbs is, never use code that you do not understand.
    1. I don't like the first syntax because then you have weird looking code due to all the leading whitespace, and you lose a lot of real estate.
    2. Aligning everything with however long the method name is makes every indention different. belongs_to :thing, class_name: 'ThisThing', foreign_key: :this_thing_id has_many :other_things, class_name: 'ThisOtherThing', foreign_key: :this_other_thing_id validates :field, presence: true Compared to the following, which all align nicely on the left. belongs_to :thing, class_name: 'ThisThing', foreign_key: :this_thing_id has_many :other_things, class_name: 'ThisOtherThing', foreign_key: :this_other_thing_id validates :field, presence: true
    3. This one bugs me a lot, but honestly, I don't like either style of the "normal method calls" above. I'm definitely voting to change the rule, but I'd also recommend trying to use the following syntax. In my opinion, it's the best of both worlds. a_relatively_long_method_call( :thing, :another_thing ) Or, if there are a lot or arguments, or the arguments are long: a_relatively_long_method_call( :a_long_argument, :another_long_argument, :a_third_long_argument )
    1. When I ask people about any part of their code, they usually say it's easy to understand. But when I open the code, it takes me a couple hours slapping to my face to keep myself alive to understand just a little part of their code.
    2. The best book that I can recommend to any developer to shape up their attitude about programming.
    3. But how much readability are enough?
    4. In collusion, writing good code not only require knowledge but also require compassion. To understand people's pain and mistakes, to think about your teammate and to help everyone achieve a better life.
    5. collusion
    6. Think about how good it is if you can build a system at “2 half brain quality” and then people just need use 1 half of their brain to maintain it. You can fix bug in a blink of an eye, run tests and give it to tester, done. Everything will be done in a easiest way and fixing bug or refactoring can be easy like breathing. The most heavy task in programming is not about building application, but it’s about maintain them and if you wrote something you can’t understand, then you will suffer for the rest of your life.
    7. they’re just too familiar with the code to think it's complicated
    8. Write code for human, not for God
    1. 400 Bad Request is the status code to return when the form of the client request is not as the API expects.401 Unauthorized is the status code to return when the client provides no credentials or invalid credentials.403 Forbidden is the status code to return when a client has valid credentials but not enough privileges to perform an action on a resource.
    2. Is there a problem or not?If there is a problem, on which side is it? On the client or on the server side?
    1. Hey, checking from a few months in the future here. Is there by chance an update on this issue?
    2. Unfortunately, the conversation on both PRs died off (no hard feelings, people have other things going on in their lives).
    3. The RuboCop way is to offer an opinion in the way of a good default, but to accommodate all reasonable style choices.
    4. really begin/end is just a way to pass several expressions where you normally need to pass only one. In this way I think it's much closer to something like conditionals (e.g. if, than to do).
    5. in my personal opinion, there shouldn't be a special treatment of do-end blocks in general. I believe that anything that starts a "block", i.e. something that is terminated by and end, should have the same indentation logic
    1. The point of that line was, "I tried irrelevant things and they obviously didn't work." I ate a banana while trying it- should I include that in the steps as well? The other work I did was not relevant, therefore, not mentioned explicitly outside of "I'm frustrated and just trying rubbish at this point." I could have been more clear saying that I've tried each of the available options on the 3 relevant to no avail, you are correct.
    1. I have a simple coding principle: write lines of code as though instructing a real person how to do the job. And that naturally expands to designing and modelling systems like real organisations with their own divisions, departments, branches, and all the various “job positions” that need to be filled. Make the whole system appear as human as possible.
    2. Conventions are good, but they are very limited: enforce them too little and the programmer becomes coupled to the code—no one will ever understand what they meant once they are gone. Enforce too much and you will have hour-long debates about every space and colon (true story.) The “habitable zone” is very narrow and easy to miss.
    1. concurrent-safe
    2. The variable a is incremented thanks to the atomic memory primitives function addInt that is concurrent-safe. However, we assign the result to the same variable, which is a not a concurrent-safe write operation. This a careless mistake detected by the atomic analyzer.

      first sighting: concurrent-safe

    1. The rules recorded in natural language are readable not only by humans but also by the computer and therefore no longer need to be programmed by a software developer. This task is now taken over by openVALIDATION.
    2. openVALIDATION enables programming of complex validation rules using natural language, such as German or English.
    1. "detail": [ { "loc": [ "body", "name" ], "message": "Field required" }, { "loc": [ "body", "email" ], "message": "'not-email' is not an 'email'" } ]

      not complient with Problem Details, which requires details to be a string

    1. For example, let’s consider the type property. For most of the projects I am working on, it isn’t practical to have a webpage dedicated to each type of possible error.

      That's not required. The standard doesn't require this to be a URL locator — merely a URI! So you can just make up a URI and use it even if it's not resolvable. ... like you did for the URN below.

    2. For the instance property, the most practical way I’ve found of implementing this is to define a URN that encapsulates additional information regarding the error. Here is an example URN for reference. urn:companyname:api:error:protocol:badRequest:f29f57d7-e1f8-4643-b226-fa18f15e9b71
    1. We decided to follow their rules to stay in their affiliate program, because that's how we are able to actually run the site (without any ads).And if you look on the issue from the usability point of view, not having their price history isn't that big of a deal, unless the game is sold only on Amazon - and most games aren't - so you always have other stores to compare the price to.
    2. Hi L0ki,as we depend on retailers with affiliate programs to run the site without ads, and Amazon being one of them, yes, we are following their rules so we can use API and their affiliate program.As Tomas said, we are also trying to get the history back, though we noticed we aren't the only site being affected by this.As for ignoring their API and doing it the hard way - that could be possible I guess but really not preferable.And we also understand anybody not wanting to buy from Amazon anymore (as some already told us), but to be fair, if the game is available anywhere else (and I have yet to randomly find a game which is available only at Amazon), you can always check the game info on ITAD to compare the price to other retailers.
    3. If it's not, it should be illegal for them to forbid you from showing price history. This is restricting access to information, and it's probably supposed to benefit them from shady sales (increasing the base price just before a sale, so that the "X % off" is higher).
    4. "We are not allowed to show you Amazon history"? What prompted this? Fill me in if I missed something :).EDIT: Camelcamelcamel can still show Amazon price history, so a bit befuddled here.
    5. I would be interested to know what the legality of this is either way. I mean, do they really have any legal right to compel you not to list their price history? However, just knowing that Amazon doesn't want you to do this will make me less likely to purchase from them in the future. Anti-consumer behavior pisses me off. Edit: If this is related to API access couldn't you just manually scrape prices off the site instead and hammer their server? Or is this more related to not wanting to bite the hand that feeds you so to speak related to the funding you can get through referral links?