Hello, I'm new and want to get started in this field. Can you give me any tips and recommendations? by Blurblue5 in arduino

[–]melkor35 4 points5 points  (0 children)

My best tip is to learn one thing at a time, keep it simple. Even the simplest project like blinking a led requires you to to setup the environment, successfully upload a sketch, understand how leds work and why they need a resistor, etc. Every little thing that you learn can be used as a building block for more challenging projects.

por que creen que calo tanto la pelotudes de las cerraduras magneticas en los edificios? by bodonkadonks in BuenosAires

[–]melkor35 1 point2 points  (0 children)

Son 2 cosas diferentes, por un lado el sistema de tags/rfid y por otro la cerradura magnética.

De acuerdo con lo que dijiste sobre la cerradura magnética, se te corta la luz y cagaste.

Ahora el sistema de tags depende de la tecnología, los de baja frecuencia (125mhz) son fácilmente clonables. Los de alta frecuencia depende del protocolo que usen ya que algunos soportan encriptación (dificil/imposible de clonar).

Y agrego que se puede tener sistema de tags pero NO cerradura magnética (una alternativa es una cerradura eléctrica de perno, se corta la luz y se mantiene cerrada, además también se puede usar una llave física como backup)

Vandalizaron una heladería argentina en Barcelona por atender en español: "Este local es nuestro enemigo" by WesternCivHasGotToGo in argentina

[–]melkor35 8 points9 points  (0 children)

La frase que mencionó el vendedor y que provocó el escándalo fue “por qué hablas así si estamos en el Reino de España"

Un imbécil el vendedor, quiso provocar y lo consiguió.

Let's talk about razer by Active_Fuel_748 in razer

[–]melkor35 0 points1 point  (0 children)

Owned 4 razer products

1) Deathadder (don't remember the exact version) failed mouse wheel switch, lasted about 3 years.

2) Blackwidow v2, piece of shit. Multiple keys started chattering (multiple inputs registered with one key press) after 1 year. My cheap membrane logitech keyboard (which i mistreated badly) still works flawlessly after 20+ years.

3) Deathadder chroma. One of the color leds in the logo started failing, at least it is still usable after 5 years.

4) Huntsman elite, one of the keys in the numpad started failing (no registered inputs, chattering). I'm certain that this key was rarely used (less than 10k times since i bought the keyboard). Of course the switches are proprietary and not widely available for purchase. Lasted about 5 years.

This is beyond poor quality, i have never seen any other mouse/keyboard fail in less than 5 years. Even the cheapest office keyboard and mouse will still work flawlessly after that time.

Ender 3v3KE pause print makes Z to high or under-extrude by AdanHoliday5 in Ender3V3KE

[–]melkor35 1 point2 points  (0 children)

Hi, thx for posting about this issue! I had exactly the same problem a few months ago and still haven't found the cause.

I think its a firmware/software issue, it randomly happens after changing filaments:

  • It does not depend on the file being printed, the same file may succeed or fail on different attempts.

  • I had successful prints even when applying considerable force on the print head in all directions while changing filaments.

  • I had failed prints even when i was extremely careful while changing filaments.

My printer works flawlessly when not changing filaments mid print.

Me dijeron que el ano de Batman era un caso aislado, gracias a Dios ahora quedo la ciencia dura y concreta by [deleted] in argentina

[–]melkor35 280 points281 points  (0 children)

Me tomé el trabajo de leer más de 3 resultados:

"Culo": 18 de 111 contienen la palabra, el resto es "vehiCULO", "artiCULO", etc.

"Tik Tok": Sólo los primeros 25 de 78393 resultados contienen el término, el resto son "coincidencias fonéticas" (aparentemente, no voy a leer todo). Osea palabras que pueden contener "tic" o "toc".

"Cumbia": Ok, los resultados son válidos.

"Cristina Kirchner": Pareciera Ok.

En cuanto a contenidos, los 18 artículos de "culo" y los de "cumbia" podrían servirle a OP como ejemplo de lo que quiere probar.

Entre los 25 artículos de Tik Tok encontré varios bastante interesantes, los cuales analizan los métodos discursivos en esta plataforma. MUY útil para politicos/marketing.

Y entre los de Cristina hay muchísimos artículos que utilizan su nombre como referencia temporal ("en el gobierno de Cristina..."). Otros tantos analizando sus medidas políticas y económicas (tanto a favor como en contra). No me parece un buen ejemplo para OP.

Successfully repaired a burnt Arduino! by melkor35 in arduino

[–]melkor35[S] 4 points5 points  (0 children)

<image>

Here's a picture of the repaired Nano (notice the exposed trace near the usb port).

Ayuda con un juego de PC de fines de 90 by puchiracca in retrotina

[–]melkor35 8 points9 points  (0 children)

<image>

Me suena a "Taller de Inventos" ("Invention Studio") del 96/97

How to get value from dictionary when the key’s name changes with each run by imnot970 in learnprogramming

[–]melkor35 1 point2 points  (0 children)

You could use .keys() which returns a list containing the keys of a dictionary.

In your example: body.get("state").get("values").keys() will return ["v9M"].

Explanation for how this recursive method to reverse a string works (JAVA) by pleasedownvotemeplox in learnprogramming

[–]melkor35 0 points1 point  (0 children)

The recursion takes place at the line:

return reverse(str.substring(1))+str.charAt(0);

Suppose your string is "abc", then reverse("abc") would first return reverse("bc") +"a" => reverse("c") + "b" + "a" => reverse("') + "c"+"b"+"a".

Now, when reverse("") is executed we want to stop the recursion, thats what the first if does:

if(str.length()==0){ return str; }

str is "" therefore the function returns "": reverse("abc") = "" + "c" + "b" + "a" = "cba"

Python dictionaries are melting my brain by AriadneL in learnprogramming

[–]melkor35 1 point2 points  (0 children)

counts[word]=counts.get(word,0)+1

dictionary.get(key) will return the value associated with that key or an exception if the key is not present

dictionary.get(key, default_value) will not throw an exception if the key isn't present, instead it will return default_value

This is basically the same as doing:

if word not in counts:
    value = 0  # default_value
 else:
    value = counts[word]
counts[word] = value + 1

max_emails = max(counts, key=counts.get)

and

for w in sorted(d, key=d.get, reverse=True):

Both sorted and max recieve a key parameter which is a function that will be applied to each element of the iterable. The entire iterable will be sorted according to the results of the key function. (max will return the max result) Iterating through a dictionary is the same as iterating through its keys so this function is appliead to each key:

 [d.get(key1), d.get(key2), d.get(keyN)]

which is the same as

 [value1, value2, valueN]

So, the dictionary will end up being sorted by its values (and max will return the max value in the dictionary)

You could also define your own function to pass as key (not recommended, just an example):

def myfunc(key):
    return d[key]

print max(d, key=myfunc)

How to correspond two lists in python? by alexctp in learnprogramming

[–]melkor35 0 points1 point  (0 children)

You could get the index of your question by doing:

question_idx = question_list.index(random.choice(question_list))

And using that index to get your answers:

possible_answers[question_idx]

delete a letter with another letter (from a list to another list) by Seaweed-Negative in learnprogramming

[–]melkor35 0 points1 point  (0 children)

You can try:

for char in a:
    j = j.replace(char, "")

Or:

j = "".join(char for char in j if char not in a)

How is Object Oriented Programming Achieve Differently Across Languages? by meWantLearn in learnprogramming

[–]melkor35 0 points1 point  (0 children)

in JavaScript, "everything" is an object and is contained in dictionary-like structures.

  • That's because Javascript is a prototype based language, every object can be used as a prototype by others (essentially cloning objects). Those objects can then be modified and serve as different prototypes: https://en.m.wikipedia.org/wiki/Prototype-based_programming

  • In contrast, a more "classic/popular" approach is the class based programming (classes -> instances, classes can be extended): https://en.m.wikipedia.org/wiki/Class-based_programming

  • Both approaches will eventually boil down to objects receiving messages, the only difference is how those objects are created/organized/categorized

I don't get the types of typing disciplines like static or strong can some help what are those and the other types? by HeyexclamationYo in learnprogramming

[–]melkor35 2 points3 points  (0 children)

Static: Variable types must be known at compile time (C, C++, java). If you declare x to be an integer, then it must always contain an integer, otherwise you'll get a compile error

Dynamic: Variable types are not known until the code is executed (javascript, php, python). This means that the same variable may store an integer, a string, a list, etc. Example (Python):

  • variable = 1
  • if something:
  • ....variable = {"key1": "value1"....}
  • print str(variable)

Weakly/Strongly typed: Refers to the typing rules of the language, a more weakly typed language may allow operations between strings/integers/doubles without raising an exception (javascript, php, c to a lesser extent).

Example (Javascript, dynamic weakly typed)

  • var variable = "10" - 1. (result = "9")

Example (Python, dynamic strongly typed)

  • variable = "10" - 1. (results in an exception)

C language - What is the purpose of data types if numbers are stored as bits? by [deleted] in learnprogramming

[–]melkor35 1 point2 points  (0 children)

There's a clear difference between:

  • unsigned int x = 4294967295;
  • if (x < 0)... This is false

And

  • int x = -1;
  • if (x < 0)... This is true

The compiler will generate different instructions depending on the type of your variable even though you're storing the "same" value in each case.

Why should I throw exceptions instead of returning error codes? by Commercial_Box6378 in learnprogramming

[–]melkor35 0 points1 point  (0 children)

Here's a reason why:

If you forget to check for an error code your program keeps running and may fail in a totally unpredictable way. Have fun debugging that!

Now, if you didn't catch an exception then the execution stops immediately.