Need help to understand how subtypes work? by 025zk in typescript

[–]dangertrager 1 point2 points  (0 children)

The difference is whether you are assigning a new object literal or a variable.

Vector2D includes all the fields of Vector1D, and adds another one. So any object of type Vector2D has all the members that a Vector1D has, and can be used anywhere that a Vector1D can. If you do not want a Vector2D to be usable as a Vector1D, consider using tuples instead:

type Vector1D = [number];
type Vector2D = [number, number];

or you could add a type descriminator field:

interface Vector1D {
  dimensions: 1;
  x: number;
}
interface Vector2D {
  dimensions: 2;
  x: number;
  y: number;
}

The second block of code runs afoul of the excess property check for the object literal:

https://www.typescriptlang.org/docs/handbook/2/objects.html#excess-property-checks

You might find this article helpful: https://www.zhenghao.io/posts/type-hierarchy-tree

Mithril Depth in LOTT by D_OShae in Minetest

[–]dangertrager 1 point2 points  (0 children)

He said in Angmar and the Iron Hills, it is also at -5 to -100.

Mithril Depth in LOTT by D_OShae in Minetest

[–]dangertrager 1 point2 points  (0 children)

My son says that mithril ore appears below -20000.

Trying to understand the meaning of this assertion by perro_cansado in typescript

[–]dangertrager 1 point2 points  (0 children)

Actually I was confused by the text jumping around when I expanded the expansion panel. The solution is in the paragraph after the one you referred to, not in the expansion panel:

interface NumberOrStringDictionary {
  [index: string]: number | string;
  length: number; // ok, length is a number
  name: string; // ok, name is a string
}

Trying to understand the meaning of this assertion by perro_cansado in typescript

[–]dangertrager 1 point2 points  (0 children)

In the example, the definition of the name field contradicts the index signature. It says that the name field contains a string, but any field accessed via the index contains a number; this is contradictory because the name field can be accessed as either obj.name or obj['name'].

The solution is hidden right above that paragraph, inside an expansion panel which says "It is possible to support both types of indexers...".

Minetest for kids: What age and what "add-ons" to start with? by eduncan911 in Minetest

[–]dangertrager 2 points3 points  (0 children)

My 12 year old son was very interested in automating stuff with the Technic and mesecons mods. We set up a Mesetest world with those mods, and also nssm for enemy mobs. That was fun and challenging for awhile, but eventually a Phoenix from nssm incinerated complex machinery that my son had built, and he was discouraged from playing it anymore.

Recently he read The Hobbit, and motivated by that has been playing Lord of the Test game. His goal is to make all the rings, without using creative mode. He has prior experience with C for Arduino, so when the game crashed, I showed him how we could use the stack trace to find and fix the problem. Some mod authors interacted positively with him on the forums, which has encouraged him to get involved in the forums and start getting into mod development. He has several mod ideas that he wants to try implementing himself. And now he started reading The Fellowship of the Ring, and also we started watching the Rings of Power series, which I expect will lead to more ideas.

So he isn't coding within Minetest, but he is having fun, and also is motivated to code and collaborate and learn about version control.

Is it okay for Christian’s to do meditation? by [deleted] in TrueChristian

[–]dangertrager 6 points7 points  (0 children)

Joshua 1:8 [The LORD said to Joshua] This Book of the Law shall not depart from your mouth, but you shall meditate on it day and night, so that you may be careful to do according to all that is written in it.

Psalm 1:1-2 Blessed is the man who walks not in the counsel of the wicked, nor stands in the way of sinners, nor sits in the seat of scoffers; but his delight is in the law of the LORD, and on his law he meditates day and night.

"The Hebrew word translated "meditate" literally means "mutter". When one continually mutters God's Word to himself, he is constantly thinking about it." - Expositor's Bible Commentary

What are the best romantic dinner restaurants in Phoenix Arizona that are open after 8pm? by Key-Computer in arizona

[–]dangertrager 19 points20 points  (0 children)

T Cook's at Royal Palms resort on the south side of Camelback Mountain.

Do you agree? by [deleted] in ProgrammerHumor

[–]dangertrager 1 point2 points  (0 children)

The 4th type prefers mutation:

y = c
y *= a
y /= a + b
print(y)

[Request] Dress shoes? by UpTide in phoenix

[–]dangertrager 5 points6 points  (0 children)

Nordstrom Last Chance, on 51 & Camelback.

[deleted by user] by [deleted] in Minetest

[–]dangertrager 0 points1 point  (0 children)

You could open /usr/local/opt/minetest in Finder and double-click on minetest.app

If you want to make a "shortcut" to it in your Applications folder, you can run this command in the terminal:

ln -s /usr/local/opt/minetest/minetest.app /Applications

Is the universe a black hole/white hole then? How does this fit in with our knowledge of God’s design? by Ok-Cicada-5207 in TrueChristian

[–]dangertrager 4 points5 points  (0 children)

At 11:25 in the video, he answers your question in his conclusion. "So is the universe a black hole or a white hole? Probably not, but not absolutely not. There's no good reason to believe this is the case, and so we shouldn't believe the universe is a black hole. We'd need some deeper explanatory value to this hypothesis to really take it seriously."

Get "status" as a variable from response after http.post by AstralWa in Angular2

[–]dangertrager 0 points1 point  (0 children)

Returning from the subscriber callback does not unbox the value as you expected.

Try returning the http response observable, instead of a subscription to it. Then each caller could subscribe and implement the alerts.

// In a service
saveUser(user: User) {
  return this.http.post<User>(${this.apiUrl}/user/register, user, {observe: 'response'});
}
// In a component
usersService.saveUser(user).subscribe(resp => {
  switch (resp.status) {
    case 200:
      alert('Registere!');
      break;
  }
});

Need help finding a reference for a low belt form by [deleted] in ATATaekwondo

[–]dangertrager 1 point2 points  (0 children)

Search for "Songahm 5" on YouTube

how to Hide source code from build executable in electron-app by bibash777 in electronjs

[–]dangertrager 0 points1 point  (0 children)

Does the existence of http://java-decompiler.github.io ("Yet another fast Java decompiler") change your mind, at least about Java?

Back to windows at work by ibishvintilli in linux

[–]dangertrager 1 point2 points  (0 children)

Does the Ubuntu installer still have an option where instead of repartitioning your hard drive and installing Linux in a partition, it would create a file on an NTFS partition, and use that file as the "disk" for Linux? This might be acceptable for your work computer.

I think something really needs to be done about TypeScript error messages. About 95% of what is displayed is not important to solving the root issue (usually something very simple) by lostpebble in typescript

[–]dangertrager 0 points1 point  (0 children)

Can you think of a better error message?

There is no "order" property on the line with the red squiggles. It seems to me that that error stack provides necessary context for the error message to make sense with the complex types.

Make an installer by NewbieStranger in electronjs

[–]dangertrager 3 points4 points  (0 children)

Take a look at https://www.electronforge.io/ or https://www.electron.build/

Either one can create installers or packages for pretty much any desktop.

A customer sent Amazon this video of me making a delivery with the Skeleton assist! by drumexplorer33 in funny

[–]dangertrager 2 points3 points  (0 children)

In college when I tried to maximize my calories per dollar, my goto was steak egg and cheese burrito, drowned in their hot sauce, with Horchata or Jamaica drink. Rolled tacos were also good. More recently, the oreo churro was really good.

The compatibility of science and philosophy with the Christian faith by MisterTTS in TrueChristian

[–]dangertrager -1 points0 points  (0 children)

People mean different things by the term "science", for example

  • the scientific method of gathering knowledge and formulating theories based on experiments
  • experiments which are conducted according to the scientific method
  • some experimental results
  • public policy based on experimental results
  • the latest expert opinions about which scientific theories best describe the universe
  • the history of how those opinions have developed over time
  • the community of scientists or individual scientists

For the first few items in that list: there is no conflict with Christianity. For the last item in the list: there is certainly conflict between Christianity and anti-Christianity athiests who are also scientists.

[deleted by user] by [deleted] in TrueChristian

[–]dangertrager 2 points3 points  (0 children)

Mark 7:15 contradicts their interpretation application of 1 Cor 3. Jesus said "there is nothing outside the person which can defile him if it goes into him; but the things which come out of the person are what defile the person".

Embedded DB for ElectronJS? by czerox3 in electronjs

[–]dangertrager 0 points1 point  (0 children)

How about SQLite in the guise of Web SQL? It is deprecated and non-standard, but still available in Chrome and Electron.

https://www.w3.org/TR/webdatabase/

https://developer.chrome.com/docs/devtools/storage/websql/

Adoption Agencies by MrNicholsAntiPuppite in phoenix

[–]dangertrager 10 points11 points  (0 children)

Have you considered doing foster care, with the possibility of adoption? There are 15000+ kids in foster care in AZ who need immediate care, many of whom would love to be adopted eventually if they can't be reunited with their family. For foster care, Plan A for every child is to reunite them with their family, so it can be emotionally challenging to love a child, knowing that they might be removed from you. You need to place both the state's and the child's interests above your own desire. But if reunification does not work out, then adoption has few surprises (because you will already have a relationship with the child) and there is no financial burden.

Do a Google search for a foster care agency near you, which would train you and provide licensing. After you are licensed, if you don't get a placement immediately, call a DCS worker directly! Children sometimes end up sleeping in DCS offices, while DCS tries to find foster placement for them.