1,216 Matching Annotations
  1. Aug 2021
    1. In the vast majority of cases when I'm using prettier-ignore I'm only really looking to prevent it from breaking my code into new lines, whilst keeping its other transformations such as switching quotes and adding space between brackets. When ignoring single lines, fixing these formatting problems by hand is very manageable. With the ability to have Prettier ignore entire blocks of code I think the ability to specify what you want it to ignore is essential.
    1. Using a flag to disable prettier for a line, the next line or until I activate it again (ESLint like syntax). // prettier-disable border: { sep: "║", topLeft: "╔", topMid: "╦", top: "═", topRight: "╗", midLeft: "╠", midMid: "╬", mid: "═", midRight: "╣", botLeft: "╚", botMid: "╩", bot: "═", botRight: "╝" }, // prettier-enable
    1. We focus so much on black magic and avoiding it that we rarely have a chance to enjoy any of the benefits. When used responsibly and when necessary, it gives a lot of power and expressiveness.
    1. Isolation ensures that concurrent execution of transactions leaves the database in the same state that would have been obtained if the transactions were executed sequentially
    1. Here is one of the most confusing cases: def foo(x, **kwargs) p [x, kwargs] end def bar(x=1, **kwargs) p [x, kwargs] end foo({}) #=> [{}, {}] bar({}) #=> [1, {}] bar({}, **{}) #=> expected: [{}, {}], actual: [1, {}]
    2. If you extend a method to accept keyword arguments, the method may have incompatibility as follows: # If a method accepts rest argument and no `**nil` def foo(*args) p args end # Passing keywords are converted to a Hash object (even in Ruby 3.0) foo(k: 1) #=> [{:k=>1}] # If the method is extended to accept a keyword def foo(*args, mode: false) p args end # The existing call may break foo(k: 1) #=> ArgumentError: unknown keyword k
    3. However, this style is not recommended in new code, unless you are often passing a Hash as a positional argument, and are also using keyword arguments
  2. Jul 2021
    1. For user-contributed data that's freeform and unstructured, use jsonb. It should perform as well as hstore, but it's more flexible and easier to work with.
    1. The difference between PUT and POST is that PUT is idempotent: calling it once or several times successively has the same effect (that is no side effect), whereas successive identical POST requests may have additional effects, akin to placing an order several times.
  3. Jun 2021
    1. I wouldn't consider it switching behavior. Ultimately it's including a module -- either a manually defined and referenced one from the user, or a RSpec::Core::SharedExampleGroupModule created for the user when they defined the shared example group and referenced via the group name.
    1. When we use a GraphQL API there are two kinds of errors we may encounter: Network Errors and GraphQL Errors from the API. Since it's common to encounter either of them, there's a CombinedError class that can hold and abstract either.
    1. Whether you agree or not, to me there's nothing in this world that is entirely apolitical - when there are people there is politics. You don't have to agree with my views, nor do I expect you to. Diversity and disagreement is what drives mankind forward.
    2. I'm not sure if there's any cost in terms of contributing either, especially when by design git can have any branch as default, and will not hinder your experience when you use something other than master.

      git is neutral/unbiased/agnostic about default branch name by design

      And that is a good thing

    3. to be honest I think it is more about sentiment than actual engineering practices now.
    4. The primary branch in git can have any name by design.
    5. Personally I think it is a very bad idea to leverage political views, even if I may share them, through software.
    1. There's no official Chrome or Chromium package for Linux don't install it this way because it's either outdated or unofficial, both are bad. Download it from official source.
    1. The problem domain and the data involved in this project was complicated enough. We decided that not having to worry about unknowns with the frontend end-to-end testing stack helped mitigate risk. This isn’t to say you should always going with the tool you know, but in this instance we felt it was the right choice.
    2. There are times to stretch individually and as a team, but there are also times to take advantage of what you already know.
    1. “The data does not exist independently in the world, nor is it generated spontaneously. Data is constructed by people, from people,” (source 1).
    1. TensorFlow.js provides theLayers API,which mirrors the Keras API as closely as possible, in-cluding the serialization format.

      Surfing TensorFlow I was orbiting this conclusion. It's good to see it it stated clearly.

    1. I've seen (and fixed) Ruby code that needed to be refactored for the client objects to use the accessor rather than the underlying mechanism, even though instance variables aren't directly visible. The underlying mechanism isn't always an instance variable - it can be delegations to or manipulations of a class you're hiding behind a facade, or a session store with a particular format, or all kinds. And it can change. 'Self-encapsulation' can help if you need to swap a technology, a library, an object specification, etc.
    2. a principle I use is: If you have an accessor, use the accessor rather than the raw variable or mechanism it's hiding. The raw variable is the implementation, the accessor is the interface. Should I ignore the interface because I'm internal to the instance? I wouldn't if it was an attr_accessor.
    1. SELECT base.nr, multiples.multiple FROM (SELECT generate_series(1,10) AS nr) base, LATERAL ( SELECT multiples.multiple FROM ( SELECT generate_series(1,10) AS b_nr, base.nr * 2 AS multiple ) multiples WHERE multiples.b_nr = base.nr ) multiples;
    1. Critical to the acceptance of the position of the script subtag was the inclusion of information in the registry to make clear the need to avoid script subtags except where they add useful distinguishing information. Thus, the registry entry for the language subtag "en" (English) has a field called "Suppress-Script" indicating that the script subtag "Latn" should be avoided with that language, since virtually all English documents use the Latin script.
      • not worth saying
      • not necessary to say/write
      • useless information

      Suppress-Script

    2. Language Range ... matches ... does not match de de, de-CH, de-AT, de-DE, de-1901, de-AT-1901 en, fr-CH
    1. Mitch Hedberg - "I play the guitar. I taught myself how to play the guitar, which was a bad decision... because I didn't know how to play it, so I was a shitty teacher. I would never have went to me."
    1. SELECT * FROM ( -- build virtual table of all hours between -- a date range SELECT start_ts, start_ts + interval '1 hour' AS end_ts FROM generate_series( '2017-03-01'::date, '2017-03-03'::timestamp - interval '1 hour', interval '1 hour' ) AS t(start_ts) ) AS cal LEFT JOIN ( -- build virtual table of uptimes SELECT * FROM ( VALUES ('2017-03-01 01:15:00-06'::timestamp, '2017-03-01 02:15:00-06'::timestamp), ('2017-03-01 08:00:00-06', '2017-03-01 20:00:00-06'), ('2017-03-02 19:00:00-06', null) ) AS t(start_ts, end_ts) ) AS uptime ON cal.end_ts > uptime.start_ts AND cal.start_ts <= coalesce(uptime.end_ts, current_timestamp)
    1. We need to be really careful about what's 'same origin' because the server has no idea what host/path the various cookies are associated with. It just has a list of cookies that the browser had determined to be relevant for this SSR'd page, and not for any other subrequests.
    1. I've been thinking more about how to best do this. The preferred way might be to use the same domain and have an application load balancer like nginx split traffic on the URL path (e.g. /api). This is for two reasons. Firstly, you might not necessarily want to cookie the primary/apex domain and have the cookie shared across all subdomains. You also might not want to do CORS because preflight requests add latency and CORS adds complication.
  4. May 2021
    1. Budget your time. MTH 124 is a 5-credit course with no meetings, so you will need to plan on spending about 15-20 hours per week doing mindful work. That’s 3-4 hours per weekday if you choose not to work on weekends. If you are taking other courses or have job of family responsibilities, you’ll need to think about where to put these hours in your daily and weekly schedules. In my experience, the #1 reason students don’t succeed in online courses is overcommitment and not managing time well.
    1. Feel free to hint, brag, or both! The best CS reps should easily take a hint from clear language and a signature like John Appleseed, JavaScript/Ruby Developer, but any will catch on with a simple line like "I know what I'm doing, so I'd appreciate an extra-technical explanation!"
    2. One solution that fixed this issue with my ISP was that when I went through the first and second line and got in touch with the people that fixed my problem, I asked them if they could give me one of their personal numbers in case the same problem happened again. The problem did occur a couple more times, and I just directly called the same guy.
    3. Some people, regardless of their experience level are horrible as teachers. A school teacher gets asked the same question every year. Every year they answer them, even if it seems redundant, and the answers are simple to THEM. Teaching requires patience and the acceptance of being asked "dumb questions" repeatedly. If they cannot handle that, then they should simply not teach or pretend to be a teacher.
    4. If the person answering the call misses something, nothing prevents them from asking you to repeat something. I think the key point that should be added to this answer is to not sound or act annoyed if the support tech asks for something you've already rattled off. To accept that you gave them a whole bunch of information at once, and that they might legitimately have missed or forgot one bit of it. Or, especially if you know the order in which they ask these questions, to take it slower; don't say it all in five seconds, take half a minute. Give them time to click!
    5. So, +1 for play ball. Level 1 is supposed to filter out all simple issues (and once upon a time, you'll have forgotten something, happens to all of us), and they are not supposed to be creative. They get a script that has been refined over and over. Learn the scripts, prepare the answers, and you'll get to Level 2 more quickly than with any other method.
    6. Please don't write answers in comments; we have a policy against this. If you have an answer to the question, write it up as an answer. Thanks.
    7. So my best advice if you need to stick with them is just to expect the treatment you have become used to and 'play along'. Actually, I find some things often run smoother when you act dumber than you are.
    1. Also, it is definitely NOT okay to recommend --force on forums, Q&A sites, or in emails to other users without first carefully explaining that --force means putting your repositories’ data at risk. I am especially bothered by people who suggest the flag when it clearly is NOT needed; they are needlessly putting other peoples' data at risk.
    1. Use cases: Volumes are most useful when you need more storage space but don’t need the additional processing power or memory that a larger Droplet would provide, like: As the document root or media upload directory for a web server To house database files for a database server As a target location for backups As expanded storage for personal file hosting platforms like ownCloud As components for building more advanced storage solutions, like RAID arrays
    1. For this very reason, we have the hx’s on our site dynamically create id’s. I love being able to direct people directly to a particular part of a page when I find something interesting, but the problem is that only we, as developers, know how to do this.
    2. I like the idea in theory, however it doesn’t feel very robust – you are relying on the layout of the page in question. Many authors regularly revisit articles and add new sections and paragraphs. Now your #h2:3 link points to a previous section. (This is far less likely to happen with IDs.)
    3. Linking directly to someone’s blog comment is very useful. Even if a blog doesn’t have an active link for each comment, it’s pretty easy to use developer tools to find the comment’s id and link to it. I’ve done this many times on Smashing Magazine (they don’t have live links on each comment). If there was no way to link to an individual blog comment, this would be a great hindrance to linking on the web. It would not be enough to link to the “#comments” section and then hope for the best. So CMSs like WordPress do the right thing by dynamically adding a unique identifier to each comment.
    4. The reason fragments should be identifiable by users is because a user, not the content creator or the developer, will ultimately decide whether or not a portion of content is valuable or notable in some way.
    5. Yes, the content creator should have the ability to decide how a page is generally divided, if they choose to do so. But the end user should not be restricted from linking to content fragments just because a developer couldn’t be bothered to add id attributes to every element on the page. And that’s besides the fact that it would be a waste of time for a developer to do that or to have to build a CMS that does it automatically.
    6. The simple problem that I see with fragment identifiers is that their existence and functionality relies completely on the developer rather than the browser. Yes, the browser needs to read and interpret the identifier and identify the matching fragment. But if the developer doesn’t include any id attributes in the HTML of the page, then there will be no identifiable fragments. Do you see why this is a problem? Whether the developer has coded identifiers into the HTML has nothing to do with whether or not the page actually has fragments. Virtually every web page has fragments. In fact, sectioning content as defined in the HTML5 spec implies as much. Every element on the page that can contain content can theoretically be categorized as a “fragment”.

      at the mercy of author

    7. So why is it up to the developer (or content creator) to define whether or not a specific portion of the content can be linked to? When any page of content is created, there is no way of knowing which sections of the page are worthy of being identified.
    1. Making effective use of this mechanism requires either control of the targeted document or generous creators of targeted documents who have liberally applied id attributes throughout a document.

      unlikely for anyone/most people to actually do that

    1. Why are there so many programming languages and frameworks? Everyone has their own opinion on how something should be done. Some of these systems, like AOL, Yahoo, etc... have been around for a decade, and probably not updated much.
    2. Simple fact is that HTML support is different in them because mail clients are so old, or others are allowed to operate in browsers where not all CSS or even HTML can be applied in a secure manner. Older clients have outdated browsers that you'll likely NEVER see brought up to standards; what with Opera's standalone aging like milk, and thunderbird lagging behind the firefox on which it's even built. Don't even get me STARTED on older clients like Eudora or Outlook.
    3. That's something that has been bugging me too. I mean, it's fine if not everything is supported, but if everyone could agree on what is or should be supported then that would make a huge difference. But until then, it's going to be a struggle.
    1. Components are the core of MJML. A component is an abstraction of a more complex email-responsive HTML layout. It exposes attributes, enabling you to interact with the final component visual aspect.
    2. MJML has been designed with responsiveness in mind. The abstraction it offers guarantee you to always be up-to-date with the industry practices and responsive. Email clients update their specs and requirements regularly, but we geek about that stuff - we’ll stay on top of it so you can spend less time reading up on latest email client updates and more time designing beautiful email.
    1. They don't look like advertisements. The second the recipient interprets your email as an ad, promotion, or sales pitch—and it does take just a second—its chances of being read or acted upon plummet towards zero. A plain email leads people to start reading it before jumping to conclusions.

      forces you to read before deciding

    1. An escalator is a great example of progressive enhancement and graceful degradation in real life. The late comedian Mitch Hedberg joked, “An escalator can never break: it can only become stairs. You should never see an Escalator Temporarily Out Of Order sign, just Escalator Temporarily Stairs. Sorry for the convenience.” Regardless of its environment, an escalator maintains its functionality.
  5. Apr 2021
    1. That should make for interesting puzzles, except they're timed, your guys never stop moving (why not?), and the camera and controls mean it's very hard to translate intent into the game world.
    1. You don’t see a lot of them, but there are a number of “super trucks,” that people build custom. They’re essentially RVs built onto a stretched truck and used like a truck. These trucks, depending on how built, often have the same facilities RVs have, including private showers, toilets, and other plumbing essentials. They dump and refill at rest areas and rv parks that have these facilities, and live the best of both worlds - trucking without the hassle.
    1. Actually a very interesting concept allthough not perfectly executed (even considering it's based on a board game)
    2. It's a nice idea but godawful implementation.
    3. Unfortunately, it’s in the execution where “US and THEM” starts to fall apart. The game’s major problems stem from the user interface and some design choices range from questionable to downright horrible. For starters, the world map that takes up more than half of the screen can be neither scrolled nor zoomed. In a game where your interaction heavily relies on clicking various nations, this becomes a problem. While larger countries like Canada, the US and Russia are easily accessible, smaller nations require pixel perfect accuracy to interact with. Try clicking on Cuba, Ireland or Hungary and you’ll find yourself maniacally clicking shades and outlines and a handful of visible pixels in the area of these countries in vain hope that the game will acknowledge your actions.
    1. >(...) starts the process ... and returns a file representing its standard input. exec &> ... redirects both standard output and standard error into ... for the remainder of the script (use just exec > ... for stdout only). tee -a appends its standard input to the file, and also prints it to the screen.
    1. Why your original solution does not work: exec 2>&1 will redirect the standard error output to the standard output of your shell, which, if you run your script from the console, will be your console. the pipe redirection on commands will only redirect the standart output of the command.
    1. This gem uses a Rack middleware to clear the store object after every request, but that doesn't translate well to background processing with Sidekiq. A companion library, request_store-sidekiq creates a Sidekiq middleware that will ensure the store is cleared after each job is processed, for security and consistency with how this is done in Rack.
    1. Don’t replace words with emojis One thing you definitely don’t want to do is have your emojis get in the way of people being able to comprehend your subject lines. Emojis should be a complement to the words in your subject lines – they should never replace words themselves. It’s when people leave out words, right?
    1. It should be defined inline. If you are using the img tag, that image should have semantic value to the content, which is why the alt attribute is required for validation. If the image is to be part of the layout or template, you should use a tag other than the img tag and assign the image as a CSS background to the element. In this case, the image has no semantic meaning and therefore doesn't require the alt attribute. I'm fairly certain that most screen readers would not even know that a CSS image exists.

      I believed this when I first read it, but changed my mind when I read this good rebuttal: https://hyp.is/f1ndKJ5eEeu_IBtubiLybA/stackoverflow.com/questions/640190/image-width-height-as-an-attribute-or-in-css

    2. From a practical point of view it's highly desirable to specify them to prevent page reflows as mentioned above. However those suggesting it should be in the html because of this are missing the fact browsers use css when building the page initially. If they didn't the page would have to be redrawn for floated elements, specified padding, margins etc.
    3. Ah yes, excactly the right answer. Img tags are for information, css backgrounds are for layout.
    4. CSS seems like the right place to put visual information. On the other hand, few would argue that image "src" should not be specified as an attribute and the height/width seem as tied to the binary image data as the "src" is.
    5. What's the "correct" semantic way to specify image height and width? In CSS... width:15px; or inline... <img width="15" ?
    1. the double bind faced by every politician: responding to scurrilous charges only gives them unwarranted publicity; not responding to such charges is often interpreted as an admission of guilt
    1. is a mechanism designed for creating an external host for character-mode subsystem activities that replace the user interactivity portion of the default console host window

      My paraphrase: A pseudoterminal replaces (fakes/pretends to be?) the user interactivity portion.

    1. "It ain't over 'til it's over,"
    2. "You can observe a lot by watching."
    3. Yet, in all these instances, life offers no crystal ball; there's no way of knowing what the future holds, or to be cognizant of something we are unaware of. This is the essence of "You don't know what you don't know," only it's being expressed in a comical way
    4. If I had known your plane was going to be two hours late, I wouldn't have rushed to the airport.
    1. I intend to live forever. So far, so good. Whenever I think of the past, it brings back so many memories. I think it's wrong that only one company makes the game Monopoly. If it's a penny for your thoughts and you put in your two cents worth, then someone, somewhere is making a penny. What's another word for Thesaurus? I used to work in a fire hydrant factory. You couldn't park anywhere near the place.
    2. Adding another Steven Wright gem: "24 hour banking? I don't have time for that."
    3. Comedian Henny Youngman was famous for one-liners delivered in a deadpan manner. Much of his humor was both wry and dry. For example, his most famous line: Take my wife ... please. If you never saw the delivery, "Take my wife" was said as if he was using his wife as an example to set up a situation, as in "Take my wife [for example]." After a brief pause, the "please" turned it into a request.
    4. I'm sorry I hurt your feelings when I called you stupid. I really thought you already knew.
    1. British HumorDry humor is particularly associated with British humor. Fawlty Towers, a British television comedy that aired from 1975 to 1979 is considered an unusually good example of dry humor. The series is set in a family run seaside hotel operated by a cynical and snobbish man, played by John Cleese, who finds himself in constant conflict with hotel guests. No matter how outlandishly silly each episode becomes, there is never any sense that the characters are trying to be funny.
    1. Is there an OS agnostic way of doing this? I like the script command on macOS because you don't have to wrap the command in quotes. The script runs and sends output to the tty which is duplicated in the supplied file, but I can't seem to get the linux version to behave the same way... I'm probably doing something wrong. So what's the equivalent linux script command for this on macOS: script -q -t 0 tmp.out perl -e 'print "Test\n"' Test cat tmp.out Test
    2. If you want to pipe it into something interactive, like less -R, where terminal input goes to less -R, then you need some extra trickery. For example, I wanted a colourful version of git status | less. You need to pass -R to less in order that it respect the colours, and you need to use script to get git status to output colour. But we don't want script to keep ownership of the keyboard, we want this to go to less. So I use this now and it works well: 0<&- script -qfc "git status" /dev/null | less -R . Those first few characters close stdin for this one commmand.

      Just git status | less -R worked for me without any additional trickery, but I see now that's because I told it to "always" use color in my .gitconfig:

      .[color]
        ui = always
        status = always
      

      I tried disabling that and then trying the

      0<&- script -qfc "git status" /dev/null | less -R
      

      trick, but it didn't work for me. It didn't show any output and I couldn't exit out with Ctrl-C or anything I tried. Had to force kill from another terminal.

      But it's a good example of the related but different problems:

      1. forcing less to respect colors (easy)
      2. force/trick git status to think it has a terminal
      3. force/trick it so you can control keyboard with less
    1. I just don't understand why a finished episodically released game is still offered episodic.
    1. Building a wonky factory is way more fun than it has any right to be - and being rewarded for leaving last turn's pieces where they are (or punished for moving them) means that you're always working on top of the mess you made last turn, though you're never completely stuck.
    1. This question does not show any research effort; it is unclear or not useful Bookmark this question. Show activity on this post. I'm trying to filter the output of the mpv media player, removing a particular line, but when I do so I am unable to control mpv with the keyboard. Here is the command: mpv FILE | grep -v 'Error while decoding frame' When I run the command, everything displays correctly, but I am unable to use the LEFT and RIGHT keys to scan through the file, or do anything else with the keyboard. How do I filter the output of the program while retaining control of it?
    1. But we can use a two characters delimiter: / (space slash) That pair of characters could only exist at the beginning of a new (absolute) path:
    2. If a program receives file names as arguments, don't join them with spaces. Use "$@" to access them one by one.
    1. “Who cares? Let’s just go with the style-guide” — to which my response is that caring about the details is in the heart of much of our doings. Yes, this is not a major issue; def self.method is not even a code smell. Actually, that whole debate is on the verge of being incidental. Yet the learning process and the gained knowledge involved in understanding each choice is alone worth the discussion. Furthermore, I believe that the class << self notation echoes a better, more stable understanding of Ruby and Object Orientation in Ruby. Lastly, remember that style-guides may change or be altered (carefully, though!).
    1. Secondly, the difficulty ramps up very quickly - once I'd got a handle on things and started getting in to it, it threw me off that the Novice level 7 is just WAY TOO HARD - it's not a game centered on difficulty so it's not like that's an excuse, nor is this a later on level where you'd except difficulty, but having just 15 seconds to do that lap, that needs to be changed to 20 at least!
    1. You'll usually only take this sales tax deduction if you live in a state that doesn't have state income tax, but it's available to everyone.
    1. He says: Did you know that all sod is grown on 100% sunny sod farms? Have you ever seen a tree on a sod farm? So if you take that sunny seed sod and transplant to shady area, it will slowly die off.

      So you should overseed your sod after transplanting.

    1. shared_contexts is any setup code that you can use to prepare a test case . This allows you to include test helper methods or prepare for the tests to run.
    1. Incredible Mandy is a great example of design by subtraction, focusing on puzzle-solving and atmosphere and eschewing mechanics which do not contribute to the developer’s singular vision.
    1. The good news: everyone had a genuine blast. We knew we had experimented our way into something fun, even if the rules and designs still needed a lot of work.
    1. An example of this would be a button that looks clickable but isn’t, underlined text that doesn’t contain a link, or a TV remote that turns on your lights but not the TV. False affordances are often present by mistake or occur due to lack of effective design techniques.
    2. Many designers strive to create products that are so easy to navigate, their users can flow through them at first glance. To design something with this level of intuitiveness, it’s imperative designers understand affordances—what they are and how to use them.
    1. Which HTML tag I should use to enclose such notes to add a semantic meaning of a note that may be useful to read at a given point of a tutorial, but is not part of the main tutorial flow?
    2. I respectfully disagree with your assessment. You are referencing the quote "It's not appropriate to use the aside element just for parentheticals, since those are part of the main flow of the document." However the OP specifically said that they are looking for a semantic element for "a note that may be useful to read at a given point of a tutorial, but is not part of the main tutorial flow". That is what "aside" is for. It's not part of the main content flow.

      That's a tough one. I can see it both ways.

    1. I actually think this is Not Constructive, since there's no absolute rule about which pairings can be joined into a single word or hyhenated, and it's pointless having "votes" here about each specific case. Follow a style guide if you have one, or search Google Books and copy whatever the majority do. Or just make your own decision.
    1. If you like puzzle games, this is certainly a game for you. Well designed level progression that helps you build a good understanding of the underlying rules of the world
    1. Motivation is provided by an ever-escalating difficulty, though not to the point where you feel frustrated.
    1. There were a few times I felt like making notes, but never ended up needing to because the scale of the puzzles is kept manageable throughout.
    1. class AuthConstraint def initialize(&block) @block = block || ->(_) { true } end def matches?(req) user = current_user(req) user.present? && @block.call(user) end def current_user(req) User.find_by_id(session[:user_id]) end end This is a flexible approach to defining route access based on any desired variable (roles, auth, etc...)

      Good solution, and might be needed if you want to base routes on roles, etc. — but this one is even easier if all you need is for it to be conditional based on signed in or not (because devise provides authenticated helper):

      https://hyp.is/lRq8tpNXEeuNn_9NxqJvdA/stackoverflow.com/questions/32407598/rails-4-devise-set-default-root-route-for-authenticated-users

  6. Mar 2021
    1. The reason Final Form does this is so that pristine will be true if you start with an uninitialized form field (i.e. value === undefined), type into it (pristine is now false), and then empty the form field. In this case, pristine should return to true, but the value that the HTML DOM gives for that input is ''. If Final Form did not treat '' and undefined as the same, any field that was ever typed in would forever be dirty, no matter what the user did.
    1. A business with a low barrier to entry would be those people in poor countries who “wash” your windscreen at traffic lights. A bucket, a cloth, some water and you are in business. A business with a high barrier to entry might be airlines: planes are expensive, staff with the right skills hard to find, the necessary permits to fly hard to obtain.
    1. The hierarchical structure of semantic fields can be mostly seen in hyponymy.

      Good explanation about semantic fields.

      I assume the same or an even stronger statement can be made about semantic classes (which to me are like more clear-cut, distinct semantic fields), then? 

    1. Some types exist as descriptions of objects, but not as tangible physical objects. One can show someone a particular bicycle, but cannot show someone, explicitly, the type "bicycle", as in "the bicycle is popular."
    2. 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. For instance, in basketball there are many words that are specific to the sport. Free throw, court, half court, three pointer, and point guard are all terms that are specific to the sport of basketball. These words make very little sense when used outside of the semantic domain of basketball.

      But this example seems so different than the first example they gave, "rain", which seems more like a semantic field — a group of very related or nearly synonymous words.

    1. Every woman talked to a student. This has two interpretations. Under one reading, every woman talked to the same student (the class president, for example), and here the noun phrase a student is specific. Under the second reading, various students were talked to. In this case, a student is non-specific.
    1. However, if the distinctions between the two concepts appear to be superficial, intentional conflation may be desirable for the sake of conciseness and recall
    1. Dictionary writers list polysemes under the same entry; homonyms are defined separately.

      This describes how you can tell which one it is by looking at the dictionary entry.

    2. Polysemy is thus distinct from homonymy—or homophony—which is an accidental similarity between two words (such as bear the animal, and the verb to bear); while homonymy is often a mere linguistic coincidence, polysemy is not.
    1. Note how a handful of default steps lead into six standardized termini, allowing to plug protocols into different adapters. Imagine replacing your self-written API adapter with a canonical JSON-API adapter, for example.
    2. endpoint Diagram::Operation::Create do |ctx, **| redirect_to diagram_path(ctx[:diagram].id) end.Or do |ctx, **| render :form end
    1. vim-athena doesn't depend on or use any version of GTK+. If you use sudo apt-get build-dep vim-athena, it probably will install GTK+ and GNOME related libraries, because the vim-athena binary package is built from the same source package as vim and other vim-providing packages. In any case, you shouldn't need to build from source, as the binaries provided by vim-athena are already built against Athena and not against GTK+ or other graphical toolkits.
    2. If you built vim against Qt rather than GTK+ and python-complete still isn't working, that suggests the problem isn't actually a consequence of trying to link to both GTK+2 and GTK+3.
    1. I have VIM on Mac & CentOS. So, I see people are writing about -xterm_clipboard, -lua, ... Is there an simple way to install it all? or we have to enable options one-by-one and compile/recompile it?

      I had similar question... how to get --servername support.

    1. This is the only answer that does not require manually parsing the .desktop file, so it's the most sane (and safe) approach.
    1. Sorry you’re surprised. Issues are filed at about a rate of 1 per day against GLib. Merge requests at a rate of about 1 per 2 days. Each issue or merge request takes a minimum of about 30 minutes (across at least 2 people) to analyse, put together a fix, test it, review it, fix it, review it and merge it. I’d estimate the average is closer to 3 hours than 30 minutes. Even at the fastest rate, it would take 3 working months to clear the backlog of ~1000 issues. I get a small proportion of my working time to spend on GLib (not full time).
    2. This issue hasn’t been deemed a high enough priority to be fixed yet. It will be addressed one day, I’m sure. There are many issues in GLib which many people on the internet think are important.
    1. I don't use remote editing much so vim-dirvish is powerful enough to manage my workflow (It's actually faster than netrw ~ the author claims 2x, I feel it's faster than that - it's really instantaneous ⚡) very useful on large codebase/repositories
    1. Or even a simple 1-liner in the Contract that references an AR Model so you don't have to rewrite the validations again in that contract, or have to choose between writing the validations once either in the contract there or in the AR Model?
    1. Have you ever played the game 20 questions? Most of us have played that game at one point in our lives. One person thinks of something that could be an animal, vegetable, or mineral and then they answer yes/no questions that are asked of them. The point of the game is to ask as few questions as possible in order to accurately guess what the person is thinking.  This is how I think of the unit tests that I write the specified behavior as I’m doing test-first development. I ask what are the fewest tests that I need to write in order to assert the behavior I want to create.
    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.)
    2. here is my set of best practices.I review libraries before adding them to my project. This involves skimming the code or reading it in its entirety if short, skimming the list of its dependencies, and making some quality judgements on liveliness, reliability, and maintainability in case I need to fix things myself. Note that length isn't a factor on its own, but may figure into some of these other estimates. I have on occasion pasted short modules directly into my code because I didn't think their recursive dependencies were justified.I then pin the library version and all of its dependencies with npm-shrinkwrap.Periodically, or when I need specific changes, I use npm-check to review updates. Here, I actually do look at all the changes since my pinned version, through a combination of change and commit logs. I make the call on whether the fixes and improvements outweigh the risk of updating; usually the changes are trivial and the answer is yes, so I update, shrinkwrap, skim the diff, done.I prefer not to pull in dependencies at deploy time, since I don't need the headache of github or npm being down when I need to deploy, and production machines may not have external internet access, let alone toolchains for compiling binary modules. Npm-pack followed by npm-install of the tarball is your friend here, and gets you pretty close to 100% reproducible deploys and rollbacks.This list intentionally has lots of judgement calls and few absolute rules. I don't follow all of them for all of my projects, but it is what I would consider a reasonable process for things that matter.
    1. JavaScript needs to fly from its comfy nest, and learn to survive on its own, on equal terms with other languages and run-times. It’s time to grow up, kid.
    2. As to opinions about the shortcomings of the language itself, or the standard run-times, it’s important to realize that every developer has a different background, different experience, different needs, temperament, values, and a slew of other cultural motivations and concerns — individual opinions will always be largely personal and, to some degree, non-technical in nature.
    1. Suppose an administrator creates a forum using open source forum software, and then heavily modifies it by adding new features and options. This process requires extensive modifications to existing code and deviation from the original functionality of that software.
    2. cannot be run on any modern day computer or computer simulator, as it was developed during the days when LISP and PLANNER were still in development stage, and thus uses non-standard macros and software libraries which do not exist anymore
    1. This semi-colon is added to prevent changing the code behaviour (the famous line ending with parentheses, etc) Most people will use a JS minifier If they don't, a single extra character is unlikely to change much If I'm right about all the above: Why don't we simply always add a semi-colon regardless of what the file ends with?
    1. Here's the four case: foo.js Load/Require dependencies Concatenate dependencies foo.js.map Load foo.js Currently grabs metadata[:map] from asset to build an asset, need to move that generation somewhere else to accomplish de-coupling map generation foo.debug.js Load foo.js Load foo.js.map Add comment to end of foo.js with path to foo.js.map foo.source.js The raw file on disk, the map file will need to point to source files.
    2. Money could be good if it is spent to provide some of the above things. Money on it's own is hard because then it means I would have to spend time book-keeping and managing instead of programming.
    1. Opal is a Ruby to JavaScript source-to-source compiler. It comes packed with the Ruby corelib you know and love. It is both fast as a runtime and small in its footprint.