35 Matching Annotations
  1. Feb 2021
    1. The sole purpose to add Dev::Trace::Inspector module is to make custom inspection possible and efficient while tracing. For example, ActiveRecord::Relation#inspect makes additional queries to fetch top 10 records and generate the output everytime. To avoid this, Inspector will not call inspect method when it finds such objects (deeply nested anywhere). Instead, it’ll call AR::Relation#to_sql to get plain SQL query which doesn’t make additional queries and is better to understand in tracing output.
  2. Nov 2020
    1. It starts truncating it's output (shortening strings with ...) once you pipe it's output into grep. That is quite unacceptable. When I am checking if something is inhibited in a script, I should have all possible information available and not have to consider if a string will get truncated when being piped into a tool, that is perfectly readable on a wide terminal.
  3. Oct 2020
    1. Especially when rollup is configured with multiple outputs, I find this particular onwarn to be helpful in reducing warning clutter. It just displays each circular reference once and doesn't repeat the warning for each output:
    2. I think my personal preference would be to see them all at once. Or maybe limit it to up to 10 messages and then list the count of how many more messages were not displayed. Pick your reaction
    3. Another thing we could do to limit output would be to only every show the first circular dependency warning. I think we already do this for other types of warnings. Then you would need to tackle the warnings one-by-one, though.
    1. Yet it can be deceivingly difficult to properly encode (user) input

      They were talking about output encoding but then switched to input encoding? Did they really mean to say input encoding here?

    2. When processing untrusted user input for (web) applications, filter the input, and encode the output.
    3. Encoding is dependent on the type of output - which means that for example a string, which will be used in a JavaScript variable, should be treated (encoded) differently than a string which will be used in plain HTML.
  4. Sep 2020
  5. Aug 2020
  6. Jul 2020
  7. May 2020
  8. Apr 2020
    1. What we actually want to do is to escape content if it is unsafe, but leave it unescaped if it is safe. To achieve this we can simply use SafeBuffer's concatenation behavior:
    2. Our helper still returns a safe string, but correctly escapes content if it is unsafe. Note how much more flexible our group helper has become because it now works as expected with both safe and unsafe arguments. We can now leave it up to the caller whether to mark input as safe or not, and we no longer need to make any assumptions about the safeness of content.
    3. A common mistake is to see those escaped angle brackets, and "improve" the helper by making everything html_safe:
    1. 1- Validation: you “validate”, ie deem valid or invalid, data at input time. For instance if asked for a zipcode user enters “zzz43”, that’s invalid. At this point, you can reject or… sanitize. 2- sanitization: you make data “sane” before storing it. For instance if you want a zipcode, you can remove any character that’s not [0-9] 3- escaping: at output time, you ensure data printed will never corrupt display and/or be used in an evil way (escaping HTML etc…)
  9. Feb 2018
  10. Oct 2016
    1. Previously, intensity-dependent metabolic changes have been found with positron emission tomography and blood oxygen level dependent magnetic resonance imaging after TMS to motor/prefrontal cortex; bilateral motor/prefrontal and auditory activation is induced, which becomes stronger with increasing pulse intensity [Bohning et al.,1999,2000; Fox et al.,1997; Nahas et al.,2001; Siebner et al.,1999; Speer et al.,2003]. However, these results are not directly comparable with our EEG findings. Arising a few seconds poststimulus, metabolic changes reflect relatively long-lasting activity of interconnected neuronal networks, whereas we were interested in the TMS-evoked events that occurred within a fraction of a second.