News for hackers. Stuff that matters.

nitroll

Re:Touchpad Blocker: Disable touch-pad while typing on Tuesday March 14, 2023 @08:17AM (#35150273)
The trackpoint on Thinkpads is fantastic once you get used to it.
Re:Mutable value types are evil Sort of on Tuesday November 15, 2022 @05:30AM (#33607504)
But isn't that pretty much the distinction between value and reference types?
Re:My lab went from 4000 kg to 130 kg of waste a year on Thursday August 04, 2022 @03:45AM (#32340271)
https://fr.wikipedia.org/wiki/Grave_(titre) somewhat equivalent of count or earl
Re:Design of This Website (2021) on Wednesday April 06, 2022 @05:13AM (#30930044)
My solution was to close the tab...
In Python you could do something like:

  class Base:
     def func(self):
         print("In Base.func:", self.name)
  
  class Child:
     def __init__(self, name):
         self.name = name
     func = Base.func
  
  c = Child("Foo")
  c.func() #=> In Base.func: Foo
Re:It’s not a self-driving car unless you can sleep in it on Wednesday July 28, 2021 @05:52AM (#27982012)
Most alarms wake you at a certain time, not a certain location.
Re:Teeing, a hidden gem in the Java API on Tuesday May 11, 2021 @11:03AM (#27118918)
Actually it seems sum is special cased to fail for strings, but otherwise you are correct
One big reason is that ubuntu splits out venv into its own package basically "breaking" python. People then don't know about the venv module and continues using the virtualenv, both due to this preceding venv, and because that is usually the word used to describe the concept.
Re:One Year of Nushell on Tuesday August 25, 2020 @04:55PM (#24275994)
Like which nu | xargs dirname
Re:GitHub Super Linter: one linter to rule them all on Saturday June 20, 2020 @07:24PM (#23588309)
No, you need an editor that abstracts away the indentation and uses the existing style of the file. I use the tab key to indent code, my editor (Emacs) is configured to just cycle through sane choices.
Re:Linear types are merged in GHC on Friday June 19, 2020 @04:37PM (#23578643)
Because you can see their usage as a series of "points" linked to exactly one other point, that forms a "line", as opposed to other systems where you could have more of a graph or tree.
Yeah, because it's not like we don't appropriate words all over the place anyway, and reuse words for all kinds of similar and dissimilar purposes.

Using "breakpoints" to describe the /points/ where the layout /breaks/ over is not a new term and quite well understood when talking design / layout.

https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layou...

https://www.w3schools.com/css/css_rwd_mediaqueries.asp

And is that so bad? So often i did stuff like that, then finding I actually need the result of x.calculate_weight() inside the condition, or to debug it or log it in some way. Then it has to be extracted anyway.
Re:SICP in Python on Tuesday April 28, 2020 @05:50PM (#23012552)
It does make sense to evaluate the default value for the parameter at the point of definition for serveral reasons. First of all, the default value does not have to be a literal value, and if you wanted it to be evaluated at call time the function would need to capture all of the default values in a closure.

  default = 10
  def foo(x=default):
      return x
  default = 20
  assert foo() == 10
I think tat makes a lot of sense.

It could also be that the default value is a more ocmplex expression, we could use a function to generate a default argument.

  def foo(x=create_default(y, z))
By evaluating it at definition time we only have to evaluate the expression once and not have this weird lazy expression.

And yes it is used, for example the fastapi Dependency Injection system has been build quite cleverly using the ability to construct default values

https://fastapi.tiangolo.com/tutorial/query-params-str-valid...

Yes it is one of those things you just have to learn, but there are tons of stuff like that in most programming languages.

Re:Python 2.7.18, the last release of Python 2 on Tuesday April 21, 2020 @05:16PM (#22939412)
What difference would it make whether the change had been called 3.8 or 4.0?
Re:Codeberg: a free, non-commercial GitHub alternative on Tuesday April 07, 2020 @05:54PM (#22807889)
I would rather just use google translate to do it automatically on the entire page, and yes I do that quite regularly from German.
Distributing a container, virtual machine or something similar.
Re:What's Coming in Python 3.8 on Thursday July 18, 2019 @06:01PM (#20474353)
I think the importance is the orthogonality of the features. Eg. having so many ways to do string formatting or now multiple ways of doing assigments are not ortogonal and thus can be seen as cluttering.
Re:What, No Python in RHEL 8 Beta? on Wednesday December 19, 2018 @05:22PM (#18720392)
python3 -m pip install foo

It also works for python2. I try to avoid using python tools that installs their own scripts and go for calling the module through python. This also works for python3/2 -m venv venv

Re:This VR cycle is dead on Monday August 28, 2017 @07:08PM (#15120904)
Portals main mechanic is movement, portals are created to enable new venues of movement. If portals were simply point at somewhere and click to teleport there the game would hardly be portal anymore and probably not fun at all.
Re:Javascript Arrays and Functional Programming on Thursday August 03, 2017 @02:23PM (#14922247)
Both map and filter returns an iterator, so you only iterate once when creating the list.
Re:Not Lisp again (2009) on Thursday May 04, 2017 @08:58PM (#14270341)
I hate when I code python and refactor stuff, moving stuff around and such, that I cant just copy/clip around and then do a final 'indent all my work correctly' like I can in a language like lisp.

I am kind of developing a grudge against whitespace sensitive languages. Not because it forces the programmer to indent properly, but because it disables my editors abilities to do it for me.

One of the problems of being the sole developer...
Re:Lisp is not functional (2010) on Wednesday February 08, 2017 @10:21PM (#13604387)
Having higher order functions is not really what makes a language functional.
Re:Rust is Software's Salvation on Thursday December 29, 2016 @06:22PM (#13281111)
It is, especially if these checks are done at compile time, not at runtime.
Re:LLVM's New Versioning Scheme on Wednesday December 14, 2016 @05:19PM (#13180196)
I totally agree. When you release bi-annually anyway, dont really care about how much breakage a Major release introduces, totally ignore minor versions and with patch versions being more or less insignificant, why not just go with $year.$month
Re:Battling the Gods: Atheism in the Ancient World on Wednesday November 16, 2016 @06:16PM (#12972533)
Or use the zoom feature of your browser...
Re:Twittering every boolean value on Monday November 14, 2016 @07:04PM (#12954498)
true

Older »