Hacker News new | past | comments | ask | show | jobs | submit | more redka's comments login

he seems to never blink


It's certainly not super obvious to setup but there are ways to use PlayCanvas with local setup[1]. I have Redirector[2] rules in my browser and that basically handles it. So with some tinkering you can have hot module replacement and front-end libraries integrated for a very smooth and web-dev-y modern workflow.

[1] https://github.com/thisredone/coffeescript-playcanvas-templa... [2] https://chrome.google.com/webstore/detail/redirector/ocgpenf...


I dunno. I implemented my games'[1] netcode on top of WebRTC and it runs just as well as proper UDP stuff. If you configure it be unreliable and pack everything into small binary commands then it behaves exactly like you'd want for a fast-paced multiplayer game. Obviously most web games use websockets for networking but it is certainly possible (albeit much more difficult) to have very fast netcode in a browser game.

[1] https://redka.games/mages


It's been awhile since I took a crack at WebRTC. Do you still need to go through all the peer negotiation even when you are just trying to get to a known server?


Yes, you still have to go through the negotiation. I put together a tutorial for a minimal Node.js Server + Browser Clients example a while back:

https://www.marksort.com/udp-like-networking-in-the-browser/


Bleh! I was really hoping they would have smoothed that out by now. I just want a damn UDP socket to my server!

I guess it's easier to piggyback on the security model of the P2P handshake than work out a separate model for client-server communication.

I built a pair of libraries for a nodejs<->browser DataChannel, it was a nightmare at the time though, and I'm sure totally obsolete by now.

Given how long it took for us to get %*@!$ data channels, I guess we'll get a simpler way to connect to a regular server in... 2030? (I watched WebRTC very closely from the Ericsson prototype was released... for awhile I was contemplating trying to pass data in the audio or video streams -_-)


What do you mean by "small binary commands"?


Instead of cramming ecoded json into the data channels, like you'd with websockets, you can build binary buffers with all the data that has to be communicated between server and client. For example movement commands like up/down/left/right alongside some flags like isJumping can be packed into a singe uInt8


Yup, delta compression and potential visibility sets are also a huge win as well.

The best thing is to design your gameplay to be "predictive", that's how we had ~300 player games like Subspace over 28.8/56k way back in the day.


Use websocket in binary mode, pack operations into tiny messages.


actually binary websockets won't do in this case since the underlying protocol is still TCP with automatic retransmission mechanism which kills performance for very fast-paced games. You have to use WebRTC in that case


So there's no reason to use binary commands when using something like socket.io?


not much but shaving off some bytes is good in itself


What about the tongue? After reading something strange in a book about meditation, where it said I should keep my tongue at the roof of my mouth, I got curious. Actually I was baffled because I couldn't do it. I literally could not keep a significant part of my tongue stuck to the roof of my mouth without significant effort and actually strain. I did a survey between my friends and only one of them (my brother) actually kept the tongue in the described position naturally. Surprisingly (this is highly anecdotal, but still interesting) he's the only person that I know that doesn't have any teeth issues - only once he'd visited a dentist with a small cavity. This got me researching and there's actually a British orthodontist (Dr. Mike Mew) who actively pushes the idea that we should keep our tongue at the roof of our mouth and that it's actually our natural tongue position that _would_ develop if we kept our ancestral dietary habits, e.g. chewing hard foods like meat from since we were little.


This sounds like an interesting theory. I'm not really sure where my tongue could rest that wasn't on the roof of my mouth. The vacuum kind of naturally sticks it up there. I'd have to force it down otherwise.


That’s quite interesting! When my mouth is closed, at least half of my tongue is always naturally touching the roof of my mouth. Despite my oral hygiene not being the best (I brush my teeth every day, but rarely floss), I’ve never had a cavity (I did have to get my wisdom teeth removed though). I notice it’s much easier for my mouth to produce saliva when my tongue is touching the roof of my mouth, which definitely helps (quoting the linked article: “saliva buffers the teeth against acid attack and bathes them in calcium and phosphate to remineralize their surface”).


My orthodentist referred me to a logopedist (specialist that deals with speech and swallowing disorders) to train my tongue position to prevent my teeth from getting crooked again. This indeed included training to position my tongue to the roof of my mouth, but also training to click loudly with my tongue and straining my lip muscles with a button and a rope. This was around ten years ago. I thought this connection between ortodentics and logopedists was already common? A quick search calls this myofunctional therapy.


I've been wondering about Mew and this tongue position thing for a while. I've been keeping mine on the roof of my mouth for well over a decade now, after getting scolded by a martial arts instructor for failing to do so naturally. But from what I understand, it's usually the lower half of the jaw that's too small. Mandibular advancement is sometimes done to treat sleep apnea. But if anything, keeping your tongue on the roof would expand the upper half, not the lower?


Wow this is the first time I've heard this. Anecdotally, I have relatively less than perfect dental hygiene habits compared to my wife and family, but despite consuming the same diet as them, I have had no dental trouble and only one cavity in my life, which was back in my teens. We often joke about how unfair this is.

My tongue naturally rests on the roof of my mouth.


Wow this is the first time I've heard this. Anecdotally, I have poor dental hygiene habits compared to my wife and family, but despite consuming the same diet as them, I have had no dental trouble and only one cavity in my life, which was back in my teens. We often joke about how unfair this is.

My tongue naturally rests on the roof of my mouth.


Like others have said that is incredibly interesting and the first I have also heard about it.

I happen to rest my tongue on the roof of my mouth all the time but I’ve also been vegetarian my entire life. So no hard meats for me.


It might be just me but I can't look at websites with black backgrounds and white or yellow letters. My eyes hurt and when I turn my head elsewhere I can see shadows of the website for a bit. I use dark(ish) themes everywhere but such high contrast somehow is too much.


i have exactly the same issue. so many websites nowadays choose to have dark themes which are essentially black backgrounds with white text and it is physically painful to read. if i'm invested enough in the article, i always try to change the user styles a bit to make it more bearable.


Yep, exactly. Last ditch resort is to modify the values via devtools myself but usually I just skip that site.


OTOH, deep-black backgrounds and green letters (with red/yellow/white highlights) is perfect if you're using an OLED screen. Maybe browsers need adjustable (and site-specific) brightness and contrast knobs, like monitors and TV's.


Love dark blacks on OLED.

However sometimes a dark navy blue would be better.


The problem is using `white` on black instead of `gray` on black. The latter provides plenty of contrast while still being easy to read.


I think new.css is themable.


Does this work with pnpm since node_modules/@prisma/client changes based on the project it's in?


It works fine with pnpm. The client package has a postinstall hook that generates the client after you install it.


I read this the other day[1]. See challenges listed in the middle. It does seem like it's not very easy at all.

[1] https://hackaday.com/2020/03/25/ventilators-101-what-they-do...


I'm working on bot implementation for my latest game[1]. I only ever made bots for my first game[2] but it was a breeze then. Now I needed to setup waypoints, pathfinding algorithms and some funky chasing logic but frankly I'm loving it. It's amazing how fruitful javascript community is! Libraries like rbush[3] (and really just a lot of different things by mourner) and ngraph.path[4] make things so much easier.

[1] https://redka.games/shootout [2] https://redka.games/mages [3] https://github.com/mourner/rbush [4] https://github.com/anvaka/ngraph.path


unfortunately im getting about 3fps on shootout


Could someone explain to me how could researchers come to these conclusions if there are different factors at play that surely impact the results? The article states that:

> Participants consumed a weekly average of 1.5 servings of processed meat, 3 for unprocessed, 2 for poultry and 1.6 servings of fish. People with higher intake were generally more likely to be smokers, drink more alcohol, have a higher body mass index (BMI) and a lower overall diet quality.

If that's the case then how is it possible for a cohort study to properly control for all of these? Isn't 7% increase in risk basically telling nothing then? The other thing is the methodology. The article says that they used "standard food frequency questionnaire" which I think means Food Frequency Questionnaire. This alone seems like it would have great effects on the efficacy of the research making the results even more questionable.


They use statistical methods to eliminate the confounding variables. But given that they do not understand the fallibility of doing that on extremely noisy data, the conclusions are telling us nothing.

They cannot control anything and it's all just questionnaires.

It's fine too look at these things but they seem to get blown out of proportion every single time, even when industry funded studies come out saying eggs or bacon is fine.

And yes, 7% increased risk is practically nothing. That's baseline risk multiplied by 1.07. It's noise all the way.


> They use statistical methods to eliminate the confounding variables.

Some of those anyway. You can only account for confounders that you know about a priori.

And given they used Food Frequency Questionnaires, it's mostly wasted efforts imho.


Tangentially related but what is the experience of introducing Sorbet into an existing Ruby codebase? How does it compare to rewriting Javascript code to Typescript? Does it provide benefits quickly or only after the whole thing is typed? Are there many gems already typed?


I work for one of the companies that partnered with Stripe and have been using Sorbet for ~1 year in prod now (before it was made public).

1. You can migrate class by class or even method by method. 2. You add type support to a method by prefixing it with a special lambda (Sig) that is read at class evaluation. 3. It provides its benefits right away. But really, most value comes from network effects. You won't get type warnings if the method you're calling isnt typed, because the return type cannot then be inferred. 4. No gems are typed right now. We type out type definitions for external dependencies in *.rbi files.

It's funny that you mention typescript because in that sense the two are quite similar. Types are defined either inline or in separate files .rbi/types.d

Opinions in the company are split probably roughly ~60/40 if Sorbet is worth the effort or not with support having a smallish majority.


I also had a similar question as the GP, but more specifically, is it useful for a Rails app? I'm trying to think how much code we actually have that performs "deeper" business-logic, and then it tends to be also used in very specific paths... There isn't a huge amount of that. So is Sorbet helpful for views/controllers/models/presenters as well?


What were the opposing side's concern or argument against it?

Using Rails?


> 1. You can migrate class by class or even method by method.

This is only if you can get it to run on your project. Far as I know, you can't segment it to just a few folders, can you? Our project has tens of thousands of files and even running it all night, it eventually hard crashes.


Does disabling it (using # typed: ignore) for all files but in that folder work? https://sorbet.org/docs/static


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: