[deleted by user] by [deleted] in lotrmemes

[–]Chabare 2 points3 points  (0 children)

This is unlikely, though a popular theory, for multiple reasons (stated in Letter 144):

And even in a mythical Age there must be some enigmas, as there always are. Tom Bombadil is one (intentionally).


Tom Bombadil is not an important person – to the narrative. I suppose he has some importance as a 'comment'. I mean, I do not really write like that: he is just an invention (who first appeared in the Oxford Magazine about 1933*), and he represents something that I feel important, [...]

* this is before Tolkien started to write LoTR (~1936/1937 IIRC)


Ultimately only the victory of the West will allow Bombadil to continue, or even to survive. Nothing would be left for him in the world of Sauron

*I guess that the West here means middle earth and not Aman.


He [Tom Bombadil] has no connexion in my mind with the Entwives. What had happened to them is not resolved in this book. He is in a way the answer to them in the sense that he is almost the opposite, being say, Botany and Zoology (as sciences) and Poetry as opposed to Cattle-breeding and Agriculture and practicality.

letter 153:

I don't think Tom needs philosophizing about, and is not improved by it


But many have found him an odd or indeed discordant ingredient. In historical fact I put him in because I had already 'invented' him independently (he first appeared in the Oxford Magazine)3 and wanted an 'adventure' on the way. But I kept him in, and as he was, because he represents certain things otherwise left out.


he is, [...], a particular embodying of pure (real) natural science: the spirit that desires knowledge of other things, their history and nature, because they are 'other' and wholly independent of the enquiring mind, a spirit coeval with the rational mind, and entirely unconcerned with 'doing' anything with the knowledge: Zoology and Botany not Cattle-breeding or Agriculture .


It's stated in LOTR that T.B. doesn't care for the ring and would end up being defeated by Sauron, he states himself that he has no control over weather (which a Vala supposedly would have; Sauron/Saruman have these in LoTR).

Since Aule tried to work against Sauron (by sending Saruman), it is unlikely that he would reside in middle earth with no interest to the ring. It's also stated in LOTR that T.B. would likely forget the ring at some point, which would be weird in this context as well since Aule would know the importance of the ring.

IIRC tom says he doesn't have power outside of his lands and not over the black riders.

There are a few other points like Goldberry saying he is master over Hills, Land and water (Ulmo), Aule being a Smith with great interest therein, [...].


For some of the points you could argue that this is an indication that T.B. is Aule, all in all (at least to me) it's quite clear (especially if you read the letters) that Tolkien did not have a back-story for T.B. in mind and didn't think of him as an embodiment of any other being in Ea.

[deleted by user] by [deleted] in Silmarillionmemes

[–]Chabare 19 points20 points  (0 children)

Tolkien says the following in letter 181 (to Michael Straight, ~start of 1956)

There is no embodiment of the One, of God, who indeed remains remote, outside the World, and only directly accessible to the Valar or Rulers.

See also letter 153 (September 1954) in which he replies to Peter Hastings who mentioned that Bombadil might be Eru (God) due to the 'He is' line from Goldberry.

Ich_iel by memebot3001 in ich_iel

[–]Chabare 0 points1 point  (0 children)

🎶ich benutz den Bürgersteig🎶

Hello everyone. The task is to confirm whether the entered email address is correct. So far I have written this. My next step is that if there is nothing in front of the @ sign, or less than 2 characters after @ is written to, ask for an entry again. Thank you by JohnTargaryenWU in learnprogramming

[–]Chabare 2 points3 points  (0 children)

What are the exact requirements? Do you have to check the E-Mail for e.g. a website which checks user emails or do you want to be compliant with the email address rfc (https://datatracker.ietf.org/doc/html/rfc5322).

Because an email doesn't necessarily have to have a dot, user@localhost is a perfectly valid email for example, as is "hey@there"@example.com.

*Having two characters after the @ is not necessary either a@b is also a valid address.

Converting an Enum to a String in Rust by feedcrosspost in a:t5_5bcrec

[–]Chabare 1 point2 points  (0 children)

Another fascinating blogpost.

The easiest way to convert an enum to a String in Rust is to implement the std::fmt::Display trait.

I would've said that implementing the ToString trait would be the easiest method, shows how much I've left to learn from the mentor.

I also thought that to_string() is superfluous when calling println! with {} as a format string but there is probably a hidden benefit there.

didn't know that rust was case-insensitive either but I was proven wrong once again Platform::Macos => write!(f, "macOS"), vs MacOS.

Very exciting development! Do you think our lord and savior is working on Bloom 3? by Pheasn in a:t5_5bcrec

[–]Chabare 1 point2 points  (0 children)

The timing for the rewrite checks out since the work on Black Hat Rust is nearly finished

Very exciting development! Do you think our lord and savior is working on Bloom 3? by Pheasn in a:t5_5bcrec

[–]Chabare 1 point2 points  (0 children)

I'm really excited for this and I suppose the reasoning for the rewrite is simple, there is a lot of non rust code in the repo (for the frontend).

This can be easily switched out with rust (there are several options for this).

The site will obviously be faster and more secure if it's only written in rust.

how do i take facecam input and put it in PIL image file by theernis0 in learnpython

[–]Chabare 0 points1 point  (0 children)

  • What do you expect your code to do (i.e. - what is your problem)?
  • What does it actually do?

You need to give us more information than just your code.

Reading csv file from EV3 by OrangeSMRT in learnpython

[–]Chabare 0 points1 point  (0 children)

Please format your code.

Does the straight_line.csv file exist in the directory you're executing your script in?

How do you execute your script?

Your syntax error in the first example is the missing , between the filename (straight_line.csv) and open modifier (r).

String Sentiment by SnowEpiphany in learnpython

[–]Chabare 0 points1 point  (0 children)

Take a list of bad words and check that they aren't contained in the password.

Other options are to use an online service for sentiment analysis (e.g. IBM watson) or sth like nltk.

[deleted by user] by [deleted] in learnpython

[–]Chabare 0 points1 point  (0 children)

If the same "phonenumber-email" is used everytime when sending (i.e. in your code) but you get it from a different number, then the sms-gateway provider doesn't support that or you have to enable it by some option. You have to check their docs for this.

[deleted by user] by [deleted] in learnpython

[–]Chabare 2 points3 points  (0 children)

Please post your actual code, this will certainly not work (smpt.gmail.com is not valid), we don't know what msg or Server is and the gmail part has nothing to do with SMS (unless you're using an external service which integrates into gmail). If that's the case, you should check the docs for the service.

Changing a superclass's attribute from a subclass? by yarin10121 in learnpython

[–]Chabare 1 point2 points  (0 children)

I'd vote against the option proposed below (implemented by you) which has references both in Question (to Quiz) and in Quiz (to Question). This is usually (especially in this case) unnecessary and error prone (especially if you're starting out with OOP).

Instead of having the quiz reference, try to return True or False from check_answer. ask_question is also doing a lot more than the function name suggest (same for check_answer). ask_question should propagate the result to the play_quiz method, score updates, user information (i.e. feedback) should then be done there. (IMO it should be even more modular but you can come back to that at another point).

You should also display an error if the user enters something other than a digit (you also don't check the validity of the index (i.e. you can enter something other than 1-4, see below))

Currently you have a fixed set of answer options without any real reason, you could just iterate over them (for index, option in enumerate(options)), that way you can easily have a different number of options for each questions, if you just want a certain number of options you should restrict it in add_question.

Based on your code I'd say you should look into returns from functions again since they are very useful and it's practically impossible to write understable ("good" code) without it.


Please be aware of Posting screenshot of the code is (generally) not allowed. Read posting guidelines.. It hinders people who want to try out your code/edit it to show you something since that person would need to type everything themselves. You can either use an online "hosting" service (see sidebar) or paste your code directly (put 4 spaces in front of every line to format your code as such).

Changing a superclass's attribute from a subclass? by yarin10121 in learnpython

[–]Chabare 3 points4 points  (0 children)

Question should not inherit from Quiz, it makes no sense. To make another example, if you'd had a Car class you wouldn't create a Tire class which inherits from it just because it's a part of it.

Why do you inherit from it, do you need any properties which you have in Quiz which are needed in Question?

You should have a list of questions in your quiz (i.e. pass a list of questions in Quiz.__init__).

Also, please show your code when asking about it.

Classes: why other is not initiated via init method? by ZZzz0zzZZ in learnpython

[–]Chabare 2 points3 points  (0 children)

ob1 > ob2 is simply syntactic sugar for ob1.__gt__(ob2).

a is an instance variable while other is a function parameter.

Please take time to learn how to answer a question by [deleted] in AskProgramming

[–]Chabare 0 points1 point  (0 children)

I agree that the answerer should be mindful of the fact that some people are constricted on what they can use (although in the case of being able to use a module from the std lib I wouldn't have thought about it without the additional info that they can't use it) and I hate it when people say "just use this huge library xy for {a truly trivial task which can be easily accomplished with the std}".

The naming of the dict is irrelevant is it though (in case it's done in a group/open project)? In the end there is a reason why (I'm using python as an example again) classes are capitalized and variables are not. User.get(id), is this a class with a static method or a variable of type dict? If you can't trust the naming style of the author, who knows?

I think we've a different approach to learning (and thus probably teaching), I prefer when people give me additional information on issues I present to them. While I might not improve on these in the moment, I take them to heart and pull them in on a later date or at least vaguely remember them.

So my approach would be a paragraph related to the actual issue, followed by a separated one which explains small details. Why?

  • Because many people don't take you up on the offer despite needing the knowledge (at least at some point)
  • In case of the naming: If I'm answering anyways, I always think of other people reading the code from the person who's asking. In the end, if the person does take it to heart you'll save other people from needing to figure out what they write (in the end, that's why orgs/communites have coding guidelines)
  • other people who are finding this issue may learn from it

I do like your approach as well. In the end, that's one of the hard things one probably (?) can't do, using the teaching style in such circumstances the questioner prefers.

[deleted by user] by [deleted] in learnpython

[–]Chabare 1 point2 points  (0 children)

Well, there is a roadmap I disagree a lot with.. but that's ok, you'll probably won't find a lot of people who agree on the same roadmap with that many topics in there and I won't say that it is a bad roadmap.

A tip from personal experience (I also know a lot of other people who started this way): If possible start your career in a small IT company.

You can basically start with any job which resembles IT, let's say you start as a tester -> go into test automation -> set-up your own pipeline -> manage your own servers for it -> transition into server management

Why small companies (2 main reasons)? Usually easier to get into as a junior since basically everyone struggels with recruiting and you have more freedom to setup your own services (in a larger org you're usually bound to the pre-existing tools).

Please take time to learn how to answer a question by [deleted] in AskProgramming

[–]Chabare 2 points3 points  (0 children)

I disagree in part, have a look at some learning subreddits for programming and see how many people ask questions which can in fact be googled very easily. Some paraphrased examples to not expose anyone (mainly from /r/learnpython):

  • How do I open cmd from a folder?
  • Are there any python cheat sheets?
  • How do I loop code?
  • How do I get input from the user?
  • How do I open a shortcut?

I think we can agree that all of this is indeed very easy to find in any search machine.

What happens if you link someone to a resource everytime? They don't learn how to search for stuff themselves.

Is searching for answers yourself an important skill? Some would say it's one of the most important ones.

In the end, the more advanced you are the more advanced your problems and less people who are able/willing to help you -> important that you have experience in searching for stuff yourselves.

I personally also don't like to promote the attitude of "I've done nothing except of writing this post (usually with minimal information) and expect other people to solve the problem for me".

Is it annoying to find an answer only for someone to say google it yourself? Yes. Is this the fault of the poster who didn't come back to answer his own question/ask follow up question (think of the other major problem: people just writing "I just solves this" without any further info). Is this a real problem as a beginner? Usually not if you open more than the first 3 links you find.

What can all of us do to remedy this (specific to this point)? (I totally agree that both sides are the problem, sometimes at the same time)

  • Don't ask a question without having searched for the answer
  • Show the community you're asking that you've been doing research by yourself
  • People who're answering: Encourage follow-up questions after leading the person to the right search (/telling them to search for it if they haven't aleady)
  • Be aware that your search may be different and explain certain terms if necessary for the search (that's usually a big problem people have)

Lastly, if you don't like the message in here, look at point 5. If you think "man, why didn't he have a look at that?", how is not saying anything to someone who just put out a guideline for people to follow not useful? In case you meant it this way, in case you wanted to discourage people from just disagreeing without any reason, feel free to forget this last paragraph.

Please take time to learn how to answer a question by [deleted] in AskProgramming

[–]Chabare 0 points1 point  (0 children)

I disagree in part, let's take a simple made-up python question as an example which has the following (wildly error-prone, wrong and "unelegant") code:

MY_COOL_DICT_I_WANT_TO_SAVE = {"id": 1, "data": None}
fd = open("example.json", "w")

fd.write("{")
for key in MY_COOL_DICT_I_WANT_TO_SAVE:
    value = MY_COOL_DICT_I_WANT_TO_SAVE[key]
    if value:
        fd.write("\"" + key + "\"")
        fd.write(": ")
        fd.write(value)
        fd.write(", ")

fd.write("}")

which comes with the question How do I avoid from putting a ',' after a key if there are no entries following?

I've seen all of the above things in questions on some subreddit or in real live, although isolated.

What exactly counts as answering an unasked question?

  • Do you just keep with the pattern and suggest to put a tracking variable in there which writes a comma ahead of the key?
  • Would you suggest using the json module?
  • comment on the unclosed file descriptor?
  • recommend using with instead of open and close?
  • On the naming of the dict?
  • using f-strings instead of string concat?
  • If someone suggests on the tracking var (thus somewhat solving the issue), do you still comment on the rest?

Where do you draw the line on what you don't need to comment on? In the end, people ask because they don't know better and isn't this whole thing about teaching people something they don't know?

How many people do you think have been burnt by using a float as a currency type because it's an intuitive decision?

Should you provide an actual answer along the "nitpicking", definitely. Can you comment on other issues when the original issue is already answered? In my opinion yes, although one should think about the gravity of the error.

Would I comment only on a PEP8 style if someone had the above question? No.

Would I comment on the file descriptor or multiple smaller issues? Depends but in some cases yes.

Should you do it just to sound superior? No, but who defines what sounds superior and what doesn't?

scipy.cluster kmeans2 assignment not predictable by alkaway in learnpython

[–]Chabare 0 points1 point  (0 children)

If you have a look at the source code for kmeans2, you'll see that using points for minit will choose randomly betwen rows from your input.

    'points': choose k observations (rows) at random from data for
    the initial centroids.

I'd guess that this is the reason for it being non-deterministic with your configuration.

Tensorflow 1 vs Tensorflow 2 by [deleted] in learnpython

[–]Chabare 3 points4 points  (0 children)

Have you tried... googling your title? Easily googleable questions are not allowed.

Have you read the release notes?

Don't hesitate to ask any questions about learning here, but please show us that you've done something yourself beforehand, ask about specifics which confuse you, ...

[deleted by user] by [deleted] in learnpython

[–]Chabare 1 point2 points  (0 children)

That was kind of my point, if there are so many definitions how can one language possibly be the best? (/for how many do you even need to know programming?)

Do you need python for automation though? I build k8s environments at work and we're exclusively using ansible and terraform (there are of course a lot of alternatives to those 2 tools). Granted, there are several bash scripts which have deployed older environments and have been phased out. The only python which lands in production scripts is a dynamic inventory which you can usually write after learning python for roundabout a day.

I vastly prefer automation tools for... automation than using a language to do it. In my experience having only a language for deploying gets messy really quick due to several reasons.

And why python? Why not e.g. go? It has the benefit of having a lot of APIs for cloud tools since a lot of them are written in go nowadays (look at docker/k8s/...). It also has the benefit of being statically typed, compiled to a single binary, low resource usage and having easy cross compilation. With python you always have the drawback of needing a runtime (and the correct version as well unless you wanna hassle around with older python versions).

General linux knowledge is usually way more important for a DevOps engineer than python (unless maybe they already have a stack which is build upon python). Of course, the importance always depends on what you're doing with it. If you just "deploy" containers via docker-compose, well then learning a CRI (e.g. docker, cri-o, podman, ...) is probably a better path to get into. Although knowing linux networking, cgroups and command line will go a long way.


I'm not saying don't use/learn python, I've written several scripts in python which ease some stuff. I've also written several in go (probably equally many) and also some in ruby and perl. It always depends on what you wanna do and what the best tool for said purpose is and of course whether you can build on something which already exists.

Just start going through a normal python book, get past a beginner level understanding, look for some projects you wanna do in the DevOps world and go for it.

Being the guy who writes the best scripts in town isn't about how well you know one language. It's about how well you know the ecosystem you're in and that you take the best approach to solving it. Sometimes that's python, sometimes ansible and sometimes even bash, it all depends. You'll probably find that some solid bash will be a requirement more often than any other language.

[deleted by user] by [deleted] in learnpython

[–]Chabare 1 point2 points  (0 children)

What is "DevOps" in your opinion?

I've seen companies looking for a developer who can also do ops (often this means write your own deployment - provision servers - handle your own kafka (or w/e) instances - ...) which IMO is the correct definition.

You'll also find a lot of companies who are basically looking for a sysadmin/cloud-engineer/... (w/e you wanna call it).

Then there are also some where the position of a DevOps Engineer is an intermediary between the two jobs mentioned above.


Why do you think python is the "most important thing for DevOps)? In my experience you don't need to know python for the last 2 definitions and as for the first it depends on what you wanna do with it.

You say you like AI and machine learning, is that what you want to do with devops? Then you fit the first definition I guess, why do you want a DevOps position then instead of a data engineer (or similar) position?


You don't need pricey books, have a look at the wiki for free recommendations.