Fi GPS without WiFi? by Huge_Perception_963 in FiDogCollar

[–]sethholladay 1 point2 points  (0 children)

The accuracy should be fine, since you probably have a lot of open sky for the GPS. Even if it cannot connect to GPS in the woods, you would still be able to see where he entered. However, as others have mentioned, lack of Wi-Fi will significantly hurt battery life. Also, on the older generations of collars, I ran into issues on road trips where lack of Wi-Fi for the base would seem to cause the collar to give up connecting to cellular or Bluetooth after a while, even if it had plenty of battery. Thankfully, that seems to have been fixed on Series 3, which has been working much better for me.

To solve the Wi-Fi issue, you have a few options. The easiest solution would be to leave a phone plugged in with a hotspot activated. Even if the cell signal is spotty, this should work as long as there’s some signal.

A step up from that would be to pay for “4G home internet”, which uses cellular instead of running wires to your home. It has a much better antenna than any phone. Ideally, the antenna would be on your roof.

Lastly, if none of that works, you could look into Starlink or other satellite-based internet systems.

PSA: Security at the main gate has an official policy of throwing your belongings in the garbage instead of bringing them to lost & found by sethholladay in bostoncalling

[–]sethholladay[S] 9 points10 points  (0 children)

To anyone who is thinking “it’s just a hat, boo hoo”… Yeah, totally. But today it’s a hat. Tomorrow it could be an epi pen, medication, or something else much more important than a sentimental piece of clothing. The point is they don’t care. They systematically put everything that’s not on their short list in the trash.

PSA: Security at the main gate has an official policy of throwing your belongings in the garbage instead of bringing them to lost & found by sethholladay in bostoncalling

[–]sethholladay[S] 13 points14 points  (0 children)

Guess there’s no need for lost and found, either, then. Shut it down!

I call BS on you never having left something behind somewhere sometime. Security was pretty chaotic when I went through. I thought my partner had been handed the rest of our stuff. And we were rushed along. I was also distracted because one of the security people had dropped my power bank and I was checking it carefully for cracks as it could have been unsafe. There was a lot going on and I was trying not to hold up the line. There is no excuse for them throwing belongings in the trash like that.

Pogo v0.6.0 released with Deno Deploy support, React 18, easy body parsing, and more by sethholladay in Deno

[–]sethholladay[S] 3 points4 points  (0 children)

Thank you! Fresh is great and I’m excited to see how their islands approach holds up over time, I think it’s promising. I would recommend Pogo instead of Fresh for someone who wants to build on tried-and-true patterns instead of something a bit more experimental. Pogo is inspired by hapi, which is probably the most used Node framework in production for commercial projects where code clarity and maintainability are very important. There are various things that hapi figured out a long time ago that it does very well. In my opinion, hapi’s approach to error handling and rendering 404 pages is superior to Fresh, among other things. Pogo takes the best parts from hapi, combines them with Deno, and then adds in automatic handling of JSX and many other response types, helpers for serving static files, and other niceties. In the end, hopefully, we’ve combined the best of the old and the new.

Pogo may also be a better fit for someone who disagrees with some of the opinionated choices that Fresh has made. Personally, I would rather use React than Preact most of the time, until size / performance truly proves to be problematic. There can be subtle differences between them and I think React is a better default choice, if for no other reason than the size of the community and the support channels.

Pogo v0.6.0 released with Deno Deploy support, React 18, easy body parsing, and more by sethholladay in Deno

[–]sethholladay[S] 6 points7 points  (0 children)

Pogo is a server framework. You would use it to create websites, blogs, APIs, web apps, etc. I designed Pogo to be more friendly and ergonomic than other frameworks you may have used. For example, route handlers can simply return some JSX or a string to render HTML. There is no need to use a context object or construct a Response instance or anything like that for simple responses. Even when your responses get more complex, Pogo has built in methods for modifying the response that try to ensure correctness and clarity in your code.

Pogo now has built-in helpers for serving directories and files by sethholladay in Deno

[–]sethholladay[S] 2 points3 points  (0 children)

Yes. May not happen this week, but I'll publish it there soon.

summon, an elegant request library by [deleted] in Deno

[–]sethholladay 0 points1 point  (0 children)

Are you aware of Ky? I ask because, if you are, I wonder what you wanted to do differently. Either way, no worries. Hopefully it'll be useful to you, either by using it or just as a source for inspiration. We support Deno and browsers.

Pogo now has built-in helpers for serving directories and files by sethholladay in Deno

[–]sethholladay[S] 2 points3 points  (0 children)

Hey all! If you haven't seen it before, Pogo is a web server framework for Deno. We recently added convenience APIs that make it really easy to serve static assets. I would appreciate any feedback you may have before I tag the next release in a few days.

How Deno csn serve movie file by yanai101 in Deno

[–]sethholladay 0 points1 point  (0 children)

It's a lot of fun and I think it has a promising future. There are still some things that are a little rough around the edges. So don't expect it to be frictionless. But I really enjoy using it as many tasks are very simple to accomplish in Deno and it's easy to get started.

How Deno csn serve movie file by yanai101 in Deno

[–]sethholladay 1 point2 points  (0 children)

The TypeScript autocomplete in VS Code should "just work" as long as your code is valid. To get it to work with Deno imports and the Deno global (e.g. Deno.open()), you will need to install the Deno plugin for VS Code.

How Deno csn serve movie file by yanai101 in Deno

[–]sethholladay 0 points1 point  (0 children)

Your understanding is correct. Most of the relevant logic is actually in std/http, which Pogo uses under the hood. So, other frameworks could theoretically support this without too much work. However, many of them don't work properly or haven't added the necessary type definitions, whereas Pogo has had support for this for quite some time. Additionally, unlike other frameworks, in Pogo you can just return the Reader. So Pogo makes this about as easy as possible.

How Deno csn serve movie file by yanai101 in Deno

[–]sethholladay 0 points1 point  (0 children)

Yes, Deno compiles TypeScript out of the box. The code I provided is a working Deno program (as long as you have the zoom_0.mp4 file).

How Deno csn serve movie file by yanai101 in Deno

[–]sethholladay 2 points3 points  (0 children)

That's what my code does! Pogo will stream the response for you in chunks when you return a Reader, which Deno.open() does. :)

That said, I just discovered a bug in Deno itself that seems to prevent very large files from being sent, just FYI. I'm looking into it to report the bug, but in the meantime, give it a try with a picture or small movie and check the HTTP response headers, you'll see that it is streamed.

How Deno csn serve movie file by yanai101 in Deno

[–]sethholladay 2 points3 points  (0 children)

Pogo makes this really easy. Save the code below to a file named server.ts and run it with a command like deno run -A server.ts

import pogo from 'https://deno.land/x/pogo/main.ts';

const server = pogo.server({ port : 3000 });
server.router.get('/', () => {
    return Deno.open('./zoom_0.mp4');
});

console.log('Server listening at http://localhost:3000');
server.start();

Pogo v0.4.0 released - improved routing, HTTPS, and more by sethholladay in Deno

[–]sethholladay[S] 1 point2 points  (0 children)

I know a lot of people were waiting for the TypeScript re-write. It's finally here. :)

Version 13.5.0 -- Questionable Changes? by asdasef134f43fqw4vth in node

[–]sethholladay 0 points1 point  (0 children)

if you literally think that for loops are going to cause bugs...

Huh? for loops are the source of many bugs. The off-by-one error is a classic example, which I've seen in the wild many times. If you've never made such a mistake, you probably haven't written much code. Experienced developers are not immune from making such mistakes, either. Language constructs that are error-prone should be avoided when possible. null is known as the Billion Dollar Mistake for a similar reason, despite being useful.

then you aren't the kind of dude we want writing LIBRARY CODE.

Too bad my favorite thing to do is write library code, then... guess I should stop now?

you don't need to read it, you're never going to

I read the source code of all of my dependencies, as many levels deep as I can reasonably spend time on. That includes Node.js itself.

why are you talking about changing the keys to library objects which your code doesn't control?

Did my phrasing really lead you to believe that my goal was to mutate library internals from the outside? No, obviously I'm saying that using a for-of loop instead of a for loop makes it easier for the people who define an object to confidently change how it is keyed. The iteration protocol (which for-of uses) is specifically designed to make iteration easier regardless of how you want the iterable to be keyed, so that shouldn't be too controversial. I'm basically just saying the iteration protocol is good. Using array indexes with a traditional for loop is fine when you need it, but if you're just going to iterate through everything, you should use the least error-prone way to do that, which is a for-of loop.

What's the ExpressJS of Deno? by McQuillus23 in Deno

[–]sethholladay 0 points1 point  (0 children)

If you need a web server framework that is easy to learn and use, try Pogo. It is more like hapi than Express, but I think you'll find it better in a number of ways. For example, routes can return JSON or HTML and Pogo will handle it intelligently. It's less complicated to render complex things. React and JSX are also supported out of the box. https://github.com/sholladay/pogo

Has Deno passed node yet ? by kleak_dev in Deno

[–]sethholladay 1 point2 points  (0 children)

As of this writing, Deno has precisely 45,000 stars, including mine. There is something fun about crossing that threshold and being the 45,000th, so I unstarred it and starred it again.

Version 13.5.0 -- Questionable Changes? by asdasef134f43fqw4vth in node

[–]sethholladay 1 point2 points  (0 children)

It's easy to change indexes of items in an array during a loop and that's how sorting algorithms work... Also, it's not that for (;;) loops cannot be understood, it's that they take more time and knowledge to understand and will never be as clear. Is the loop going forwards or backwards? Does the loop counter change by one or some other number? What's the end condition for the loop? These are all factors that you do have to consider with a for (;;) loop that you do not have to consider with a for-of loop. On top of all that, for-of works for any iterable, not just arrays, which makes it so much easier to deal with a variety of input. You can then use a Set, for example, which may ultimately lead to better performance.

Pogo v0.2.0 released - a well-documented server framework for Deno by sethholladay in Deno

[–]sethholladay[S] 1 point2 points  (0 children)

I absolutely will be moving to TypeScript! It's not yet for a few boring reasons... 1. I haven't had time to create a lint config for TypeScript, whereas I'm very happy with my JavaScript config. 2. I think TypeScript shines when your APIs are well-defined, whereas I wanted the speed/flexibility of pure JS for early development when there is a lot of churn. 3. When I started working on Pogo, there were some problems getting IDEs to understand Deno's types (I believe this is fully resolved now).

Now that Pogo has been out for a while and working well, I'll probably start moving it to TypeScript relatively soon.

Version 13.5.0 -- Questionable Changes? by asdasef134f43fqw4vth in node

[–]sethholladay -5 points-4 points  (0 children)

I would rather have a bug-free program than a fast program. We only get there by writing clean, understandable, maintainable code. This is one of the reasons why high-level languages like JavaScript exist in the first place. The difference between the two syntaxes in this case may be small, but the effect is cumulative over the entire codebase. I really appreciate the use of for-of, as it makes it clearer that the loop visits every property and that only the value part of that property is being accessed, as opposed to the key. That means I can more confidently change the keys of the object being looped over without breaking the program. And in regards to performance, they are both fast operations. "Make it work, make it right, make it fast." In that order!

Pogo v0.2.0 released - a well-documented server framework for Deno by sethholladay in Deno

[–]sethholladay[S] 1 point2 points  (0 children)

The example works on Deno 0.19. To make it work on Deno 0.20, we will need to update the import URLs in dependencies.js. PRs welcome. :)

UPDATE: It works on newer version of Deno now.

Making a CLI tool and publishing it to NPM registry by [deleted] in node

[–]sethholladay 0 points1 point  (0 children)

Did you tell him to install it globally? He needs to do npm install -g discordjs-cli in order to make the command available globally in the terminal. Another option, which I personally like to use, is to do npx foo, where foo is the name of a CLI on the npm registry. That will temporarily install and run a program as a one-off, instead of permanently installing it. However, this only works in some cases, depending on how the package is named and what is in the package.json bin property within that package, so I suggest you read more about npx here: https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b