Youtube comments of LoneTech (@0LoneTech).

  1. 2000
  2. 577
  3. 312
  4. 192
  5. 178
  6. 158
  7. 126
  8. 118
  9. 78
  10. 77
  11. 75
  12. 73
  13. 60
  14. 60
  15. 52
  16. 45
  17. 44
  18. 41
  19. 39
  20. 38
  21. 36
  22. 32
  23. 32
  24. 30
  25. 28
  26. 27
  27. 25
  28. 24
  29. 24
  30. 24
  31. 23
  32. 23
  33. 22
  34. 22
  35. 22
  36. 22
  37. 20
  38. 20
  39. 19
  40. 18
  41. 17
  42. 17
  43. 17
  44. 17
  45. 16
  46. 16
  47. 15
  48. 15
  49. 14
  50. 14
  51. 14
  52. 14
  53. 13
  54. 13
  55. 13
  56. 13
  57. 13
  58. 13
  59. 13
  60. 13
  61. 12
  62. 12
  63. 12
  64. 12
  65. 12
  66. 11
  67. 11
  68. 11
  69. 11
  70. 11
  71. 11
  72. 10
  73. 10
  74. 10
  75. 10
  76. 10
  77. 10
  78. 10
  79. 9
  80. 9
  81. 9
  82. 9
  83. 9
  84. 9
  85. 9
  86. 8
  87. 8
  88. 8
  89. 8
  90. 8
  91. 8
  92. 8
  93. 8
  94. 8
  95. 8
  96. 8
  97. 8
  98. 8
  99. 8
  100. 7
  101. 7
  102. 7
  103. 7
  104. 7
  105. 7
  106. 7
  107. 7
  108. 7
  109. 7
  110. 7
  111. 7
  112. 7
  113. 7
  114. 7
  115. The summary in the first sentence is a bit off target; the first part describes a type class (which Monad is; another example is Num for numeric, which contains arithmetic operations), and the second part is already enabled by sum types holding fields (which Maybe is; so is Either, and both have instances of Monad). But neither describes the concept of a monad. The prelude describes it thusly: "it is best to think of a monad as an abstract datatype of actions". A monad in Haskell provides a way to sequence processing steps; they could pass information from one to the next, return information, be skipped, repeated, or even reordered. For instance, the STM monad (which allows shared mutable state in multithreaded programs without locking) can repeat actions which it determines need to be retried, and the Maybe monad can skip actions it determines receive no input. The IO monad is the most flexible, as it can perform anything at all, including non-deterministic behaviour; it is also isolated, in that the only thing that performs IO actions is the main function. In effect, the main function's job is to produce the sequence of actions that shall be performed. The Either monad can be easily applied as exceptions are, in that it carries information down the fast Left path as well as the thorough Right path, and the Control.Exception module contains support for translating between this form and IO monad exceptions. Many monads do much simpler work; for instance Identity, First, Last, Max, Min, List (called simply [] in the library), Product and Sum. These are used to take the same internal steps and produce different results from them. State provides a way to carry data past steps, so the steps themselves don't need to forward all state. All of these are deterministic and polymorphic.
    7
  116. 7
  117. 7
  118. 6
  119. 6
  120. 6
  121. 6
  122. 6
  123. 6
  124. 6
  125. 6
  126. 6
  127. 6
  128. 6
  129. 6
  130. 6
  131. 6
  132. 6
  133. 6
  134. 6
  135. 6
  136. 6
  137. 6
  138. 6
  139. 6
  140. 6
  141. 6
  142. 6
  143. 5
  144. 5
  145. 5
  146. 5
  147. 5
  148. 5
  149. 5
  150. 5
  151. 5
  152. 5
  153. 5
  154. 5
  155. 5
  156. 5
  157. 5
  158. 5
  159. 5
  160. 5
  161. 5
  162. 5
  163. 5
  164. 5
  165. 5
  166. 5
  167. 5
  168. 5
  169. 5
  170. 5
  171. 5
  172. 5
  173. 4
  174. 4
  175. 4
  176. 4
  177. 4
  178. 4
  179. 4
  180. 4
  181. 4
  182. 4
  183. 4
  184. 4
  185. 4
  186. 4
  187. 4
  188. 4
  189. 4
  190. 4
  191. 4
  192. 4
  193. 4
  194. 4
  195. 4
  196. 4
  197. 4
  198. 4
  199. 4
  200. 4
  201. 4
  202. 4
  203. 4
  204. 4
  205. 4
  206. 4
  207. 4
  208. 3
  209. 3
  210. 3
  211. 3
  212. 3
  213. 3
  214. 3
  215. 3
  216. 3
  217. 3
  218. 3
  219. 3
  220. 3
  221. 3
  222. 3
  223. 3
  224. 3
  225. 3
  226. 3
  227. 3
  228. 3
  229. 3
  230. 3
  231. 3
  232. 3
  233. 3
  234. 3
  235. 3
  236. 3
  237. 3
  238. 3
  239. 3
  240. 3
  241. 3
  242. 3
  243. 3
  244. 3
  245. 3
  246. 3
  247. 3
  248. 3
  249. 3
  250. 3
  251. 3
  252. 3
  253. 3
  254. 3
  255. 3
  256. 3
  257. 3
  258. 3
  259. 3
  260. 3
  261. 3
  262. 3
  263. 3
  264. 3
  265. 3
  266. 3
  267. 3
  268. 3
  269. 3
  270. 3
  271. 3
  272. 3
  273. 3
  274. 3
  275. 3
  276. 3
  277. 3
  278. 3
  279. 3
  280. 3
  281. 3
  282. 3
  283. 3
  284. 3
  285. 3
  286. 3
  287. 2
  288. 2
  289. 2
  290. 2
  291. 2
  292. 2
  293. 2
  294. 2
  295. 2
  296. 2
  297. 2
  298. 2
  299. 2
  300. 2
  301. 2
  302. 2
  303. 2
  304. 2
  305. 2
  306. 2
  307. 2
  308. 2
  309. 2
  310. 2
  311. 2
  312. 2
  313. 2
  314. 2
  315. 2
  316. 2
  317. 2
  318. 2
  319. 2
  320. 2
  321. 2
  322. 2
  323. 2
  324. 2
  325. 2
  326. 2
  327. 2
  328. 2
  329. 2
  330. 2
  331. 2
  332. 2
  333. 2
  334. 2
  335. 2
  336. 2
  337. 2
  338. 2
  339. 2
  340. 2
  341. 2
  342. 2
  343. 2
  344. 2
  345. 2
  346. 2
  347. 2
  348. 2
  349. 2
  350. 2
  351. 2
  352. 2
  353. 2
  354. 2
  355. 2
  356. 2
  357. 2
  358. 2
  359. 2
  360. 2
  361. 2
  362. 2
  363. 2
  364. 2
  365. 2
  366. 2
  367. 2
  368. 2
  369. 2
  370. 2
  371. 2
  372. 2
  373. 2
  374. 2
  375. 2
  376. 2
  377. 2
  378. 2
  379. 2
  380. 2
  381. 2
  382. 2
  383. 2
  384. 2
  385. 2
  386. 2
  387. 2
  388. 2
  389.  @Mad_Elf_0  I want to treat it as impossible, because the number of discs is a non-negative integer. It's just not part of the problem domain, and in a statically typed language, shouldn't be a possible call. It's just as helpful as passing a non-numeric object. The problem operates in discrete non-negative integer space and functions correctly if and only if it reaches zero for all its reductions. If your program reaches an impossible state, failing as early as possible (typically, user input validation) helps pinpoint why. In the interest of failing early, it would make sense to assert that the number is a non-negative integer, but it would not help to make a subset of invalid values appear valid. This is like someone telling you to solve the puzzle with nothing but a ball. There are no discs or pegs; you can't perform the task. You're proposing that "I did it!" is the proper response. Adding a successful return of your function when called with bad input is removing the option for the call site to handle the problem, because you never alerted them. This is why "except: pass" is generally a very bad idea; you don't know why there was an exception (or even that there was one or which), and you've removed the opportunity for someone else to interpret it. An example of one that should generally not be silenced, certainly not in a loop, is KeyboardInterrupt - the user has told you to stop, probably for real world reasons your program doesn't understand. PEP 20, the Zen of Python, captures this as "Errors should never pass silently." You should run "import this" from time to time.
    2
  390. 2
  391. 2
  392. 2
  393. 2
  394. 2
  395. 2
  396. 2
  397. 2
  398. 2
  399. 2
  400. 2
  401. 2
  402. 2
  403. 2
  404. 2
  405. 2
  406. 2
  407. 2
  408. 2
  409. 2
  410. 2
  411. 2
  412. 2
  413. 2
  414. 2
  415. 2
  416. 2
  417. 2
  418. 2
  419. 2
  420. 2
  421. 2
  422. 2
  423. 2
  424. 2
  425. 2
  426. 2
  427. 2
  428. 2
  429. 2
  430. 2
  431. 2
  432. 2
  433. 2
  434. 2
  435. 2
  436. 2
  437. 2
  438. 2
  439. 2
  440. 2
  441. 2
  442. 2
  443. 2
  444. 2
  445. 2
  446. 2
  447. 2
  448. 2
  449. 2
  450. 2
  451. 2
  452. 2
  453. 2
  454. 2
  455. 2
  456. 2
  457. 2
  458. 2
  459. 2
  460. I also once paid for YouTube Premium and stopped because of their hostility. For starters, I requested the function to pay instead of getting ads years before they even introduced Red; and when they did, they decided to refuse me that service for another year or so just because of where I live (Sweden). Before offering it, they more than quadrupled the amount of ads, and they've kept going since. Well, I tried once they let me. Turns out, not only didn't I consistently get the ads removed, they told my mother she wasn't my family, based on a hidden requirement and hidden measurements. They never told me, the person paying. So one thing they'd have to do is publicly apologize for actively treating their paying customers worse than their ad-suffering viewers. Google spyware don't get to tell me who my family is. It's offensive and likely illegal that they spy in the first place, and using it to target and abuse customers is perverse. Another thing they'd have to do is actually fight fraud. Currently they're fighting the people trying to remove spam from the comment sections, not the spammers. And their ad system is at least 70% fraud too, without even the flagging option. Flagging comments doesn't get them removed, and it's not even possible to flag ads. One more thing. It would be nice if they actually took viewers into account at all before breaking things, e.g. dislike statistics and stereoscopic video. There are swathes of videos out there that were once correctly tagged for 3D viewing (and a mechanism to add the tags if they were missing) but youtube simply broke them.
    2
  461. 1
  462. 1
  463. 1
  464. 1
  465. 1
  466. 1
  467. 1
  468. 1
  469. 1
  470. 1
  471. 1
  472. 1
  473. 1
  474. 1
  475. 1
  476. 1
  477. 1
  478. 1
  479. 1
  480. 1
  481. 1
  482. 1
  483. 1
  484. 1
  485. 1
  486. 1
  487. 1
  488. 1
  489. 1
  490. 1
  491. 1
  492. 1
  493. 1
  494. 1
  495. 1
  496. 1
  497. 1
  498. 1
  499. 1
  500. 1
  501. 1
  502. 1
  503. 1
  504. 1
  505. 1
  506. 1
  507. 1
  508. 1
  509. 1
  510. 1
  511. 1
  512. 1
  513. 1
  514. 1
  515. 1
  516. 1
  517. 1
  518. 1
  519. 1
  520. 1
  521. 1
  522. 1
  523. 1
  524. 1
  525. 1
  526. 1
  527. 1
  528. 1
  529. 1
  530. 1
  531. 1
  532. 1
  533. 1
  534. 1
  535. 1
  536. 1
  537. 1
  538. Assign multiple variables": This doesn't work exactly the same way as multiple assignment statements. In fact, that's the main reason it exists; you can do "a, b = b, a" to swap two variables. With sequential assignments that would require a third variable. Color: That's not even a Python feature, but a terminal escape sequence. For a Pythonic way to do it, look at e.g. the click library's echo and style functions. Concat without +: This is string literal contatenation. Unlike + it operates at compile time, not run time. There's no problem assigning it to a variable, but you broke the strings apart when you removed the parenthesis. Substring with in: "I don't really like" is a very vague argument. The problem is repeating the search using both in and index. You can also use the exception as your conditional: try: print(haystack.index(needle)) except ValueError: pass id to get identity: Do not use id to check if variables are identical; this is already what the "is" operator does, e.g. "assert data1 is data2", which is both clearer and more efficient. Do not save an id by itself as they could be reused if the object is freed. Aliases: data1 and data2 were just equal names referring to the same object. Names hold references to values, they do not define them. "Primitive types": All values in Python, including types, are objects. You can create new immutable types easily, e.g. using namedtuple. The closest you get to a "primitive" type is types that have a literal syntax, but that includes mutable ones like list, set and dict. There are also objects that can only hold specific kinds of values, like in array and ctypes. "Replace list vs replace list content": id is a property of an object, not of a name. The name data within change_list is what was changed, not the object it initially pointed to. "Check if exists": Those aren't tiers of nothing; None is a value like any other, a falsy one with a singleton type. It's used as a placeholder; the most common occurrence is when you don't specify anything to return. In general, looking for existence of a name is rather strange metaprogramming; per duck typing, you'd normally just try to use things, and maybe handle if it fails, like hasattr does. I'm tired and won't be writing exhaustive commentary.
    1
  539. 1
  540. 1
  541. 1
  542. 1
  543. 1
  544. 1
  545. 1
  546. 1
  547. 1
  548. 1
  549. 1
  550. 1
  551. 1
  552. 1
  553. 1
  554. 1
  555. 1
  556. 1
  557. 1
  558. 1
  559. 1
  560. 1
  561. 1
  562. 1
  563. 1
  564. 1
  565. 1
  566. 1
  567. 1
  568. 1
  569. 1
  570. 1
  571. 1
  572. 1
  573. 1
  574. 1
  575. 1
  576. 1
  577. 1
  578. 1
  579. 1
  580. 1
  581. 1
  582. 1
  583. 1
  584. 1
  585. 1
  586. 1
  587. 1
  588. 1
  589. 1
  590. 1
  591. 1
  592. 1
  593. 1
  594. 1
  595. 1
  596. 1
  597. 1
  598. 1
  599. 1
  600. 1
  601. 1
  602. 1
  603. 1
  604. 1
  605. 1
  606. 1
  607. 1
  608. 1
  609. 1
  610. 1
  611. 1
  612. 1
  613. 1
  614. 1
  615. 1
  616. 1
  617. 1
  618. 1
  619. 1
  620. 1
  621. 1
  622. 1
  623. 1
  624. 1
  625. 1
  626. 1
  627. 1
  628. 1
  629. 1
  630. 1
  631. 1
  632. 1
  633. 1
  634. 1
  635. 1
  636. 1
  637.  @artit91  That's almost fully mistaken. The stack is the simplest, most fundamental form of dynamic memory allocation; it uses one pointer, with one side being free memory and the other occupied. alloca() can therefore just change the stack pointer, relying on the frame pointer to restore it, while functions not using dynamic allocation on the stack (like alloca or dynamically sized automatic arrays) can outright omit the frame pointer. malloc's heap allocation, by contrast, requires tracking at least two pieces of information per chunk of memory; size and if it's free. Added to this is often a heap size which may or may not be dynamic (program break). On top of that it requires the appropriate search algorithms to transfer, split and merge chunks, and will handle fragmentation (when you can't allocate a size that is free, because the free memory is divided by allocated memory). The advantage is that you can free things in arbitrary order. For machines without an MMU, stack placement is trivial; you place static allocations at one end of memory and start the stack pointer at one end of the remaining free space. The heap is frequently statically sized, such that a stack exhaustion is when the stack and heap meet. Often it is assumed that they never will meet, so there's no overhead checking for it, which an MMU would otherwise assist with. The stack is so simple and fundamental it exists even on some computers that don't support indirect memory addressing in the first place, like PIC10. What does typically complicate matters is multithreading, when you need more than one stack. That's why we have calls like pthread_attr_setstacksize, so you can allocate a suitable size for threads depending on their task.
    1
  638. 1
  639. 1
  640. 1
  641. 1
  642. 1
  643. 1
  644. 1
  645. 1
  646. 1
  647. 1
  648. 1
  649. 1
  650. 1
  651. 1
  652. 1
  653. 1
  654. 1
  655. 1
  656. 1
  657. 1
  658. 1
  659. 1
  660. 1
  661. 1
  662. 1
  663. 1
  664. 1
  665. 1
  666. 1
  667. 1
  668. 1
  669. 1
  670. 1
  671. 1
  672. 1
  673. 1
  674. 1
  675. 1
  676. 1
  677. 1
  678. 1
  679. 1
  680. 1
  681. 1
  682. 1
  683. 1
  684. 1
  685. 1
  686. 1
  687. 1
  688. 1
  689. 1
  690. 1
  691. 1
  692. 1
  693. 1
  694. 1
  695. 1
  696. 1
  697. 1
  698. 1
  699. 1
  700. 1
  701. 1
  702. 1
  703. 1
  704. 1
  705. 1
  706. 1
  707. 1
  708. 1
  709. 1
  710. 1
  711. 1
  712. 1
  713. 1
  714. 1
  715. 1
  716. 1
  717. 1
  718. 1
  719. 1
  720. 1
  721. 1
  722. 1
  723. 1
  724. 1
  725. 1
  726. 1
  727. 1
  728. 1
  729. 1
  730. 1
  731. 1
  732. 1
  733. 1
  734. 1
  735. 1
  736. 1
  737. 1
  738. 1
  739. 1
  740. 1
  741. 1
  742. 1
  743. 1
  744. 1
  745. 1
  746. 1
  747. 1
  748. 1
  749. 1
  750. 1
  751. 1
  752. 1
  753. 1
  754. 1
  755. 1
  756. 1
  757. 1
  758. 1
  759. 1
  760. 1
  761. Operating systems are indeed written in particular styles; mostly state machine, but some higher algorithms in scheduling and memory management, with a focus on actual steps in hardware. While they likely won't have a mark and sweep style garbage collector, they will have reference counting and implicit priorities (e.g. which memory page can you discard when you need more? when do you run the work of wiping freed pages for reuse?). The key tends to be isolation; if you're mutating your state, make sure you're alone in accessing that state. If your work takes time, see if you can do it without interrupting other work. Side effects remain anathema; so make very clear where they exist, e.g. scheduling points. If your work doesn't take notable time, make sure to squeeze it in before you do the overhead of switching back to user space. OS developers thus focus on costs and risks that are often further from mind in functional styles, even if they're not necessarily less efficient at them. If we could have a class of drivers that operate entirely in STM with bounded RAM, that could provide a considerable gain. Engineers have planned for such usages, e.g. with microkernel architectures and multiple privilege rings, but it hasn't quite caught on. I think two factors tend to dominate why not: short path to understanding what precisely is executed, and (sometimes excessive) focus on overhead. The really sad thing is, a lot of that overhead could have been removed on a hardware level. If you have the interest, take a look at e.g. CRASH/SAFE. A seemingly more successful initiative today is F* and Project Everest.
    1
  762.  @frustrateduser9933  I believe the case I was thinking about involved Peter Bergman, at least that case was widely publicized (possibly starting with Östran). At the time he had some vision, using a computer with great magnification (Synskadades Riksförbund and Aftonbladet referred to him as blind). Radiotjänst i Kiruna did everything they could to be unreasonable, including immediately shouting they wouldn't be paying anything back after being specifically instructed that was their duty by the supreme court. I personally found it most remarkable when they specifically published a statement claiming their interpretation was what decided what the law said, not the intent or product of the lawmaking process. The core of the case was that they'd decided to unilaterally claim every computer was a TV receiver, specifically so they could extort more money. They claimed public service had become more expensive to produce and income was dropping while their public accounting disagreed. The law stated that a TV receiver was a device built for the purpose (e.g. a computer with a TV card), and had a specific definition of TV transmissions which excluded any Internet streaming service. In the end their campaign really highlighted that SVT's broadcasting license didn't actually cover Internet streaming. Another fun revelation was that RIKAB employed their own court that never ruled against them or even acknowledged arguments; they only existed to force people to go to court at least twice, and if you did win the case (in the second court) to show you had no TV, nothing stopped RIKAB from again deciding you did anyway the next day. I'm a little uncertain why they employed squealers to point out people as having TVs when they didn't have any burden of proof anyhow, but those were both incompetent and deceitful. We ended up with a reform where the public service is now paid for by plain taxation per individual. Not necessarily more fair, but less actively corrupt.
    1
  763. 1
  764. 1
  765. 1
  766. 1
  767. 1
  768. 1
  769. 1
  770. 1
  771. 1
  772. 1
  773. 1
  774. 1
  775. 1
  776. 1
  777. 1
  778. 1
  779. 1
  780. 1
  781. 1
  782. 1
  783. 1
  784. 1
  785. 1
  786. 1
  787. 1
  788. 1
  789. 1
  790. 1
  791. 1
  792. 1
  793. 1
  794. 1
  795. 1
  796. 1
  797. 1
  798. 1
  799. 1
  800. 1
  801. 1
  802. 1
  803. 1
  804. 1
  805. 1
  806. 1
  807. 1
  808. 1
  809. 1
  810. 1
  811. 1
  812. 1
  813. 1
  814. 1
  815. 1
  816. 1
  817. 1
  818. 1
  819. 1
  820. 1
  821. 1
  822. 1
  823. 1
  824. 1
  825. 1
  826. 1
  827. 1
  828. 1
  829. 1
  830. 1
  831. 1
  832. 1
  833. 1
  834. 1
  835. 1
  836. 1
  837. 1
  838. 1
  839. 1
  840. 1
  841. 1
  842. 1
  843. 1
  844. 1
  845. 1
  846. 1
  847. 1
  848. 1
  849. 1
  850. 1
  851. 1
  852. 1
  853. 1
  854. 1
  855. 1
  856. 1
  857. 1
  858. 1
  859. 1
  860. 1
  861. 1
  862. 1
  863. 1
  864. 1
  865. 1
  866. 1
  867. 1
  868. 1
  869. 1
  870. 1
  871. 1
  872. 1
  873. 1
  874. 1
  875. 1
  876. 1
  877. 1
  878. 1
  879. 1
  880. 1
  881. 1
  882. 1
  883. 1
  884. 1
  885. 1
  886. 1
  887. 1
  888. 1
  889. 1
  890. 1
  891. 1
  892. 1
  893. 1
  894. 1
  895. 1
  896. 1
  897. 1
  898. 1
  899. 1
  900. 1
  901. 1
  902. 1
  903. 1
  904. 1
  905. 1
  906. 1
  907. 1
  908. 1
  909. 1
  910. 1
  911. 1
  912. 1
  913. 1
  914. 1
  915. 1
  916. 1
  917. 1
  918. 1
  919. 1
  920. 1
  921. 1
  922. 1
  923. 1
  924. 1
  925. 1
  926. 1
  927. 1
  928. 1
  929. 1
  930. 1
  931. 1
  932. 1
  933. 1
  934. 1
  935. 1
  936. 1
  937. 1
  938. 1
  939. 1
  940. 1
  941. 1
  942. 1
  943. 1
  944. 1
  945. 1
  946. 1
  947. 1
  948. 1
  949. 1
  950. 1
  951. 1
  952. 1
  953. 1
  954. 1
  955. 1
  956. 1
  957. 1
  958. 1
  959. 1
  960. 1
  961. 1
  962. 1
  963. 1
  964. 1
  965. 1
  966. 1
  967. 1
  968. 1
  969. 1
  970. 1
  971. 1
  972. 1
  973. 1
  974. 1
  975. 1
  976. 1
  977. 1
  978. 1
  979. 1
  980. 1
  981. 1
  982. 1
  983. 1
  984. 1
  985. 1
  986. 1
  987. 1
  988. 1
  989. 1
  990. 1
  991. 1
  992. 1
  993. 1
  994. 1
  995. 1
  996. 1
  997. 1
  998. 1
  999. 1
  1000. 1
  1001. 1
  1002. 1
  1003. 1
  1004. 1
  1005. 1
  1006. 1
  1007. 1
  1008. 1
  1009. 1
  1010. 1
  1011. 1
  1012. 1
  1013. 1
  1014. 1
  1015. 1
  1016. 1
  1017. 1
  1018. 1
  1019. 1
  1020. 1
  1021. 1
  1022. 1
  1023. 1
  1024. 1