57 Matching Annotations
  1. Feb 2025
  2. Sep 2024
  3. Jul 2024
  4. May 2024
    1. commonAddress := 'https://docutopia.sustrato.red/semanticas:24A'

      Para este caso es un tipo de mensaje unario en donde

      • El objeto es 'https://docutopia.sustrato.red/semanticas:24A', siendo esta un literal de cadena (string).

      • Seguidamente, el mensaje es la variable commonAddress que al ejecutar esta acción devuelve como resultado

  5. Apr 2024
    1. commonAddress := 'https://docutopia.sustrato.red/semanticas:24

      Para este caso es un tipo de mensaje unario en donde

      • El objeto es 'https://docutopia.sustrato.red/semanticas:24A', siendo esta un literal de cadena (string).
      • Seguidamente, el mensaje es la variable commonAddress que al ejecutar esta acción devuelve como resultado
    1. commonAddress := 'https://docutopia.sustrato.red/semanticas:24A'

      Para este caso es un tipo de mensaje unario en donde

      • El objeto es 'https://docutopia.sustrato.red/semanticas:24A', siendo esta un literal de cadena (string).
      • Seguidamente, el mensaje es la variable commonAddress que al ejecutar esta acción devuelve como resultado
  6. Mar 2024
  7. Feb 2024
  8. Dec 2023
    1. How many methods are there in the arithmetic method category of the CharacterSequence class?

      There are no messages categorized as arithmetic in String but in CharacterSequence, which String subclassifies. Squeak Strings on the other hand, implement arithmetic messages, exactly those mentioned in the solution to the exercise; Note however that String allMethodsInCategory: #arithmetic in both Cuis and Squeak include a seventh method #raisedTo: because #allMethodsInCategory also looks up for inherited methods from superclasses. Yes! you can raise the empty string to the power of n for n ∈ Number and the result is another empty string! WAT :) The fact that we can evaluate '' raisedTo: n without error seems like an unforeseen consequence of #adaptToCollection:andSend: relying on #collect and how the latter works on empty collections.

      See this thread in the Squeak-dev mailing list

  9. May 2023
    1. Hyper-zettelkastenStudents stick all of their zettels on the walls with sticky tack or tape (be sure students initial or mark their zettels before doing this).Then, students walk around the room and search for connections and create original ideas using those connections.Students physically attach those zettels with string (like a conspiracy theorist would) and stick a zettel on the string explaining the connection.
  10. Jan 2023
  11. Dec 2022
    1. Note: it is not possible to apply a boolean scope with just the query param being present, e.g. ?active, that's not considered a "true" value (the param value will be nil), and thus the scope will be called with false as argument. In order for the scope to receive a true argument the param value must be set to one of the "true" values above, e.g. ?active=true or ?active=1.

      Is this behavior/limitation part of the web standard or a Rails-specific thing?

  12. Jul 2022
  13. Apr 2022
  14. Jan 2022
  15. Aug 2021
  16. Jun 2021
  17. Oct 2020
  18. Jul 2020
  19. Jun 2020
    1. What would be nice is if JavaScript had a built-in way to do what I can do in Ruby with:

      > I18n.interpolate('Hi, %{name}', name: 'Fred')
      => "Hi, Fred"
      

      But to be fair, I18n comes from i18n library, so JS could just as easily (and I'm sure does) have a library that does the same thing.

      Update: Actually, you can do this in plain Ruby (so why do we even need I18n.interpolate?):

      main > "Hi, %{name}" % {name: 'Fred'}
      => "Hi, Fred"
      
      main > ? String#%
      
      From: string.c (C Method):
      Owner: String
      Visibility: public
      Signature: %(arg1)
      Number of lines: 9
      
      Format---Uses str as a format specification, and returns the result
      of applying it to arg. If the format specification contains more than
      one substitution, then arg must be an Array or Hash
      containing the values to be substituted. See Kernel::sprintf for
      details of the format string.
      
         "%05d" % 123                              #=> "00123"
         "%-5s: %016x" % [ "ID", self.object_id ]  #=> "ID   : 00002b054ec93168"
         "foo = %{foo}" % { :foo => 'bar' }        #=> "foo = bar"
      

      I guess that built-in version is fine for simple cases. You only need to use I18n.translate if you need its more advanced features like I18n.config.missing_interpolation_argument_handler.

  20. May 2020
  21. Apr 2020
  22. Sep 2019
  23. Aug 2019
  24. Mar 2019
    1. print(self.num,"/",self.den)

      i particularly like an alternate construction better, because it allows you better control of the output string(this example will not insert spaces before and after the slash, unless you deliberately put them there)

      print('{}/{}'.format(self.num,self.den))
      

      It uses the .format module, that lets you replace {} structures with the print verions of variables, you can set names for them like

      print('{numerator}/{denominator}'.format(denominator = self.den, numerator = self.num))
      

      and a lot of other stuff, you can learn more reading the python documentation of the string class

  25. May 2017
  26. citeseerx.ist.psu.edu citeseerx.ist.psu.edu
  27. Apr 2017
  28. Apr 2015
    1. Basically how CORS works is that if the Access-Control-Allow-Orign header is set in the HTTP response, then the content loaded by AJAX can be used in our script regardless of the fact it is on the same domain or some other. Now for your purpose, you can upload your local JSON file to Dropbox's Public folder and get a Public URL, that you can load by a simple AJAX call.

      Sounds interseting