Message from @Deleted User

Discord ID: 444310608649650179


2018-05-11 00:24:29 UTC  

wrong chat ni🅱️🅱️a

2018-05-11 00:42:06 UTC  

If you don't have time to do it right, when will you have time to do it over?

2018-05-11 00:43:00 UTC  

But it's understandable, exception safety doesn't come for free in Python the way it is in C++.

2018-05-11 00:44:47 UTC  

As it turns out, RAII is essential for exception safety.

2018-05-11 00:45:01 UTC  

Closest thing Python has to RAII is the `with` statement.

2018-05-11 00:59:17 UTC  

@Deleted User Because it only does everything

2018-05-11 01:00:54 UTC  

does it bake cookies @Legiondude ?

2018-05-11 01:02:10 UTC  

It can

2018-05-11 01:02:13 UTC  

Not the kind you eat though

2018-05-11 01:03:21 UTC  

You have to choose the right tool for your use-case.

2018-05-11 01:03:24 UTC  

@meratrix C# has those as well

2018-05-11 01:05:05 UTC  

I should finish learning C at some point

2018-05-11 01:05:21 UTC  

I get through the first few chapters of K & R and then get bored

2018-05-11 01:05:21 UTC  

Ditto

2018-05-11 01:06:58 UTC  

You must be good and educated at C, otherwise you will make constantly mistakes. Memory leaks, etc.

2018-05-11 01:07:24 UTC  

More so than in high-level languages.

2018-05-11 01:08:17 UTC  

@Legiondude what languges do you know?

2018-05-11 01:10:42 UTC  

@Deleted User I mainly do C#, TypeScript and Python. I probably won't ever do any C professionally.

2018-05-11 01:24:22 UTC  

@Deleted User I used to know Racket, some C/C++, some C#, and then internet page scripting languages

2018-05-11 01:25:01 UTC  

cool

2018-05-11 01:31:43 UTC  

```
Date: 2018-05-11T01:31:12.056Z
Hash: 554c5c5bd86a2d0998c2
Time: 2324ms
chunk {main} main.js, main.js.map (main) 1.93 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 683 bytes [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 5.4 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 15.6 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 325 kB [initial] [rendered]

ERROR in The Angular Compiler requires TypeScript >=2.7.2 and <2.8.0 but 2.8.3 was found instead.
```

FFS

2018-05-11 01:50:09 UTC  

Reminds me of cmake, back when it couldn't do version checks properly.

2018-05-11 01:50:22 UTC  

Maybe it still can't, thank god I don't use it.

2018-05-11 01:51:25 UTC  

It would fail a check like `1.25.3 > 1.8.0` because it was doing string comparison.

2018-05-11 01:58:21 UTC  

Basically npm was saying "you got some packages here which aren't secure". Ok that is fine. I use angular to update the packages and then it breaks it own build. It is really frustrating.

2018-05-11 02:13:55 UTC  

Oh, I didn't read that right, it has a minimum AND maximum version requirement.

2018-05-11 02:15:42 UTC  

2.8.3 will work fine, it just has a check somewhere in there

2018-05-11 02:27:58 UTC  

It says `< 2.8.0`, not `<= 2.8.0`.

2018-05-11 02:28:18 UTC  

So it's possible it's not backwards compatible.

2018-05-11 02:36:14 UTC  

I've just used 2.7.2 now. Yeah I know what it says. The typescript version is a minor update it will probably work fine, but you can't turn the check off.

2018-05-11 02:39:38 UTC  

(or I can't spot it in the angular docs)

2018-05-12 20:49:18 UTC  

```java
package jab.util.definition.resolver;

import jab.util.definition.exception.DefinitionSyntaxException;
import org.jetbrains.annotations.NotNull;

/**
* This resolves Short definitions from numerical definitions, and attempts to parse Shorts from
* given String definitions.
*
* @author Jab
*/
public class ShortResolver implements DefinitionResolver<Short> {

/**
* @param object The serialized definition.
* @return Returns the resolved definition.
*/
@Override
public Short resolve(@NotNull Object object) {
// If the object is a string, try to parse it.
if (object instanceof String) {
try {
return Short.parseShort((String) object);
} catch (NumberFormatException e) {
throw new DefinitionSyntaxException(
"Cannot cast String definition to Short definition: " + object);
}
}
// Return the numerical cast of the value as a Short.
return ((Number) object).shortValue();
}

/** @return Returns the class to registered that is also returned when resolving definitions. */
@Override
public Class getResolvedClass() {
return Short.class;
}

/**
* This is called to verify if the Object is valid for the entry.
*
* @param object The definition to test.
* @return Returns true if the resolver can resolve this definition.
*/
@Override
public boolean isValidDefinition(@NotNull Object object) {
return object instanceof Number || object instanceof String;
}
}
```

2018-05-12 22:06:09 UTC  

Isn't this shit just a parser of integers?

2018-05-12 22:06:20 UTC  

Talk about verborragic code.

2018-05-12 22:31:32 UTC  

Same code in C++:
```cpp
template<typename To, typename From>
To safe_cast(From val)
{
if (val < std::numeric_limits<To>::min() || val > std::numeric_limits<To>::max())
throw std::range_error{"value out of range"};
return static_cast<To>(val);
}

short resolve_short(const std::any& obj)
{
try {
return std::any_cast<short>(obj);
}
catch (const std::bad_any_cast&) {
return safe_cast<short>(std::stol(std::any_cast<std::string>(obj)));
}
}
```

2018-05-12 22:32:40 UTC  

Hm... the syntax highlight for C++ is so broken.

2018-05-13 17:07:19 UTC  

So I was thinking of working on a Discord bot that can be used to run poll’s on a server. A moderator could use a command to create a new poll and then users could use a command to vote in a poll, the moderator could then also close a poll with another command.

2018-05-13 17:07:38 UTC  

a bot to run /pol/'s on a server?

2018-05-13 17:07:46 UTC  

lol 😂

2018-05-13 17:09:12 UTC  

I’ll probably do it in Scala.

2018-05-13 17:16:09 UTC  

@meratrix its not very hard to do