News for hackers. Stuff that matters.

batiste

Re:The crash of Air France flight 447 (2021) on Friday August 11, 2023 @03:52PM (#37093188)
There should be a calm AI voice stating what they should be doing based on some heuristics. Based on angle of attack, engine power and the last recorded reliable speed, I feel a simple system should be able to make projection of the current speed and throw some warning when pilot input are becoming real stupid.
I have met people that thinks HTTP calls are great!

- "But it tests more things!"

Well ok, but those are integration tests, not unit tests... It is unacceptable that a unit tests can fail because of external system...

It has been a long time I have met somebody stupid enough to push this kind of meaningless rules forward.

Test setup is sometimes very complicated AND expensive. Enforcing only 1 assertion per test is moronic beyond description.

Re:To Ruby from Python on Saturday July 16, 2022 @09:17AM (#32117722)
Yeah, the optional parenthesis is one my biggest complaint with the language.

It just makes things less readable, with not other benefits than making the code look more clever than it is.

Re:To Ruby from Python on Saturday July 16, 2022 @04:42AM (#32116242)
It really doesn't... After years using Ruby my mind never managed to parse its complicated grammar.
Re:GraphQL Is a Trap? on Friday May 06, 2022 @01:10PM (#31287549)
You don't necessarily have a single SQL database behind a GraphQL server. You could have one of a mix of the above:

- Legacy internal REST APIs

- NoSQL Databases

- Various SQL Databases

- Some static text files

- Some REST APIs from a third party

Re:GraphQL Is a Trap? on Friday May 06, 2022 @12:58PM (#31287388)
What I really like about GraphQL is that it completely get rides of the silly verb questions such as

- POST or PUT or PATCH?

- Why can't my GET or DELETE requests have a JSON body?

It is just a better interface, even if it where to be used exactly as REST without any nesting. I used the Appollo server in NodeJS and it was so natural to make parallel queries and let the query planner take care of the parallelism for me...

Re:I am the healthiest person I know, and I got cancer on Tuesday March 08, 2022 @05:10AM (#30598336)
> Genetically engineered food that is flooded in pesticides

Nhaa, I don't think so. Glyphosate residue are not a real concern for me.

Other things that are way higher on my list, that are considered "natural":

Sun exposure

Radeon gas

Alcohol and tobacco consumption

Re:Django 4.0 release candidate 1 released on Monday November 22, 2021 @08:20AM (#29306029)
Love Django. But we are using Django with Gunicorn at work and we are having massive concurrency issues (1 process, gthread)... More than 4 concurrent requests waiting on a slow IO and the whole thing melts down...

FastAPI doesn't have those issues at all...

Re:Reddit’s disrespectful design on Saturday June 26, 2021 @11:26AM (#27642684)
I still use the old design to this day...
Re:I don't care about cookies on Saturday March 20, 2021 @08:07AM (#26522614)
> if you don't do shady shit your site doesn't need a popup asking for consent.

This what I have been explained. Any sort data sharing, like introducing Google Analytics in your website and you need a disclaimer.

Really cool, I should have a serious look at this non-virtual dom thing. All the examples make it look like this project is dependable. Sorry for the plug but I somehow explored similar path when creating the Blop language, maybe the author might be curious: https://github.com/batiste/blop-language Maybe I should get rid of the virtual DOM lib. I use?
I would say, between 5% and 10%. I am paying CHF 2200 in Zurich for a 2 rooms and we share the rent.
Re:The Cost of JavaScript Frameworks on Friday May 08, 2020 @02:21PM (#23117817)
You could do some Ajax request with jQuery and update the page.
Re:Rob Pike interview on Thursday April 30, 2020 @12:18PM (#23032562)
Lord I hate YAML. 10 years after seeing for the first time I still haven't memorised the intricacies and feel unsafe modifying any file.
Re:What I wish I knew about React on Wednesday April 29, 2020 @07:08AM (#23017805)
Well, I did something a bit similar my own language: https://github.com/batiste/blop-language/commit/90e7704e125f... Not sure where classes are an issue with doing anything like this
Re:What I wish I knew about React on Wednesday April 29, 2020 @04:05AM (#23016654)
Would it be possible to have a single method on a class that behaves like whatever useEffect is doing?
Re:Redux – Not Dead Yet (2018) on Thursday April 09, 2020 @11:23AM (#22823418)
I concur. I used React for a year or so I never used this feature once. I was too busy writing all the necessary boilerplate.
Re:State of JavaScript 2019 on Thursday December 19, 2019 @08:34AM (#21834724)
I implemented a similar feature in the Blop language, but by simply using a Proxy

https://github.com/batiste/blop-language

Not sure why they claim proxies are complicated... I found it was a piece of cake to implement a working library for state management using a Proxy.

So, this is a reverse vaccin?
Re:Running GitHub on Rails 6.0 on Wednesday September 11, 2019 @04:19AM (#20937702)
If you do not know Ruby, it is neither easy nor fast. You have to learn a brand new language and Ruby is quite a departure from C-like languages that most people are familiar with. Then you have to learn Rails and its conventions.

It is a huge mountain of work you have ahead yourself if you are a newbie in both domains.

Sure you might be able to slap together a simple CRUD app following a tutorial but truly knowing what you are doing will take months, if not years. It is a huge investment.

Re:Running GitHub on Rails 6.0 on Tuesday September 10, 2019 @03:23AM (#20925846)
For once a fair criticism of Django by someone who seems to know the framework well.

I don't quite share the same experience with i18n though. I always found Django statical code analysis to extract translation keys to be superior in many ways to other translation systems. It is giving useful context that are stored in the PO files and good translation tools use them. I also never had any issue with string based keys. You can chose an english based key or an abstract whatever you prefer.

Some of the annoyance you mentioned, that I agree completely, are more of a language issue like: reloader, or dependency management.

For multiple environments there is a very simple pattern you can put in place using an environment variable and conditional imports. something like:

  from settings.base import *
  
  if env == 'prod':
    from settings.prod import *
Principally the file organisation that pretty much forces you to stick all your controllers in one single directory. If you want to create a truly modular application (think microservices) RoR defaults seemed to work against you.
Did RoR people ever fixed their monolith inducing architecture?
Re:Why I believe Rails is still relevant in 2019 on Tuesday March 19, 2019 @04:40AM (#19429063)
I think the best is to have nicely designed modular monolith application. Sadly this something that Rails backwards conventions makes very hard to achieve.
Re:Alternatives to JSX on Tuesday February 26, 2019 @03:57AM (#19252922)
> JSX is a simple wrapper around a JS call, it is trivial to mentally convert from JSX to what the real JS is.

Then maybe it is an indication is not worth very much. Why not using something like hyperscript instead if it is just some javascript.

> JSX is also super copy-pastable. Less logic and all that.

In my experience the copy-paste-reuse in FE is a red herring. And React is no exception. And a logic less templating is not necessarily helping with a flexible/reusable piece of code.

> JSX being simple also makes the learning curve simple.

Not so sure about that. I think I would have personally preferred not having to learn a new DSL if some basic function call in Javascript can do the same job.

I guess I have been scared by colleagues using ugly ternary operator expressions with React.

I also used so many template languages in the past: PHP, Django, Pug, Rails, etc, etc. That I try to reproduce similar features/mistakes.

Re:Alternatives to JSX on Monday February 25, 2019 @10:00AM (#19246058)
My problem with JSX is that if you introduce a DSL, why would you limit it to basic function calls/expressions?

I created a small language to demonstrate what I mean https://github.com/batiste/blop-language

Re:Amiga Music Tracker in JavaScript on Wednesday January 30, 2019 @02:31PM (#19038434)
It works incredibly well even on my Android cellphone... I am surprised.
Re:Richard Stallman: We Can Do Better Than Bitcoin on Monday November 26, 2018 @05:27AM (#18532346)
Edit: I answered completely off base. Misunderstood the question. My hunch on the original question: Maybe some system only allow injected JS? Wordpress anyone? Not quite sure.

Yes, I learned it not so long ago in fact and I am a bit ashamed of it.

Try to save this into a HTML file:

  <html>
  <body>
  <script>
  let someJSON = {"hello": "</script><script>alert('powned')</script>"}
  </script>
If you execute just the JavaScript in your browser console: perfectly fine, valid JS. Now open the HTML file in a browser: powned.

This the because the browser has a HTML parsing phase, and only after JS is executed.

When <script> is parsed, then the HTML parser is looking for the next </script>. It doesn't matter if the </script> happened to be inside the context of a JavaScript string. At this point the browser doesn't know about JS.

Older »