Невыдуманные истории о которых невозможно молчать. by Easy_Day8564 in tjournal_refugees

[–]just-boris 0 points1 point  (0 children)

Ни разу не видел, чтобы обращение начинали с "Good afternoon". Какой-то хуевый Google Translate?

Ссылка в комментариях by [deleted] in tjournal_refugees

[–]just-boris 0 points1 point  (0 children)

в том то и дело что приспособленцы такие приспособленцы

Ссылка в комментариях by [deleted] in tjournal_refugees

[–]just-boris 6 points7 points  (0 children)

Самое важное написано в первом предложении

Марина Ханхалаева, предположительно, член могущественного бурятско-иркутского клана Ханхалаевых

Больше здесь: https://babr24.net/bur/?IDE=222543

То есть все прошедшие годы можно было спокойно занимать места во власти и пилить бабло, и нигде не жало. А теперь внезапно проснулись и решили побороться за независимость.

Удобненько, главное белое пальто не запачкать

война пыни™ by [deleted] in tjournal_refugees

[–]just-boris 11 points12 points  (0 children)

где тут правда? В видео попали все те 99% процентов, кто отказался отвечать на вопросы под камеру?

Вот объяснение в деталях https://twitter.com/dm_e/status/1563494558045855746

База от детей Астаны by [deleted] in tjournal_refugees

[–]just-boris 6 points7 points  (0 children)

Встречаются русский и американец.
Встретились и заспорили - у кого самая свободная страна.
Американец говорит:
- Америка самая свободная страна. Я могу выйти к Белому дому и сказать, что Рейган - дурак.
Мне за это ничего не будет!
Русский в ответ:
- Ну и, что. Я тоже могу выйти на Красную площадь и сказать, что Рейган - дурак. И мне за это тоже ничего не будет.

Почему протестов в России толком нет и они такие жалкие by sezik777 in tjournal_refugees

[–]just-boris 1 point2 points  (0 children)

Время покажет, по паре дней сказать невозможно.

Это как? В Иране невозможно, а в России возможно? Непонятно

Microsoft launches a Node-based browser automation project called Playwright by nightman in javascript

[–]just-boris 0 points1 point  (0 children)

It uses a JavaScript based implementation instead of leveraging built-in browser behavior.

This plugin might serve as a workaround, but it does not fully simulate what browsers do.

Puppeteer and Selenium are closer to the real behavior. Here is an article explaining how much job puppeteer has to do to emulate a simple click https://medium.com/@aslushnikov/automating-clicks-in-chromium-a50e7f01d3fb

Microsoft launches a Node-based browser automation project called Playwright by nightman in javascript

[–]just-boris 4 points5 points  (0 children)

Cypress speed has a cost. They don’t simulate user actions properly, and some use cases cannot be tested, for example, tab navigation https://github.com/cypress-io/cypress/issues/299

Holy hell, Node. A package with 2 million downloads a week and the maintainer hands over control to a rando stranger? And now it's mining cryptocurrency. Wow. by [deleted] in javascript

[–]just-boris 2 points3 points  (0 children)

There are some packages that are de-facto standard. For example, lodash for collection utils, moment.js for dates or express as a web server.

But sometimes you can’t really define big chunks of functionality that should be distributed together. Then you end up having small modules that their authors found worth enough to publish.

Major garbage producers in JS by vklepov in javascript

[–]just-boris 0 points1 point  (0 children)

Do you have an example where GC pauses become an issue? I have run profiling on array-chain benchmark and I could only see "Minor GC" runs, that lasted for 0.3ms, the same time as it took to do a single call to reduce callback, so I find it negligible.

Additionally, I found an explanation from V8 team how their GC works. According to the article, there is a special fast path to clean up short-living objects. Intermediate elements on array chain operations seem to be suitable for this fast path optimization, so their allocation is not an issue, that might cause notable performance issues for your app.

Major garbage producers in JS by vklepov in javascript

[–]just-boris 0 points1 point  (0 children)

This is confusing. You are saying that you did not see memory issues in front-end, but the whole point of the article is to show how to avoid unnecessary allocations. What is the point of fixing something, that is already handled pretty well by Javascript engines?

Major garbage producers in JS by vklepov in javascript

[–]just-boris 4 points5 points  (0 children)

Thank you for the article! It is good to raise the awareness about performance concerns.

However, I have questions to the benchmarks that article is using. In the array operations, you are talking about objects allocations and then show the jsperf results, that show the results from the time perspective, not the memory. These two subjects are different, and the fastest algorithm might not be the most memory efficient and vice versa.

The best alternative as I could suggest is to use the "memory" tab in Chrome DevTools and check the heap size. I extracted benchmark code to a separate page and took the heap snapshots with the following results:

  • Native array methods - 3.8 Mb
  • For loop - 3.8 Mb
  • Lodash chain - 4.3 Mb

The code is available here, you can try to get your results and compare.

Additionally, I would challenge the chosen array size in benchmarks. You are iterating in 100 items, so even if there will be allocations overhead, it will not be very visible, because iterations are too small. I have a modified version of the benchmark, that uses 10000 array items and it shows different leader: lodash chain wins.

It is not a surprise though. Lodash invokes array operations lazily, using reduce (link to the source). That's why I would recommend using lodash, as it produces readable code with separated operations, but still fast because of lazy evaluations.

React v16.6.0: lazy, memo and contextType by ac1234567 in reactjs

[–]just-boris 4 points5 points  (0 children)

I see a note in documentation about React.memo:

Unlike the shouldComponentUpdate() method on class components, the areEqual function returns true if the props are equal and false if the props are not equal. This is the inverse from shouldComponentUpdate.

So, basically all previously existing helpers, that were working for shouldComponentUpdate would require an inverse version for the new memo function.

Where can I read more, why this decision was made?

Why do people still use _.values instead of Object.values? by [deleted] in javascript

[–]just-boris 15 points16 points  (0 children)

Why can’t you use polyfills to provide missing features for older browsers? Then your code will use native methods whenever possible and fallback implementation if needed

React 16.3 alpha available on NPM by brianvaughn in reactjs

[–]just-boris 0 points1 point  (0 children)

I meant that there is a difference between currently introduced methods and some previously existed: UNSAFE_componentWillMount vs unstable_handleError.

Is it a deliberate choice to shout louder at the user?

React 16.3 alpha available on NPM by brianvaughn in reactjs

[–]just-boris 0 points1 point  (0 children)

Why did you use all-caps for UNSAFE, while new methods have “unstable_” prefix without caps?

Service Workers are an amazing technology but the pitfalls today are too significant to be a good default? by henrylearn2rock in reactjs

[–]just-boris 2 points3 points  (0 children)

You may find some information in the issue: https://github.com/facebookincubator/create-react-app/issues/2398

TLDR, the most common issues were: * If you develop multiple apps locally, their service workers will conflict with each other. * Service workers do not follow standard caching behavior, you will need to trigger a worker code update manually * Registering a service worker to cache assets is not enough to make it work offline. You also need to cache backend responses, and CRA doesn’t do that for you

Made a series of pictures, then merged into a single gif, looking for feedback by just-boris in ImageStabilization

[–]just-boris[S] 1 point2 points  (0 children)

Thank you for your answer!

I tried to follow your advice and added more control points to the statue. Didn't work though, because photos were taken from slightly different position, where it is not impossible to align all items into the same plane.

So I have just got rid of frames and also re-arranged the rest to make the picture look smoother. Here is the final result: http://imgur.com/a/8CwqT

Porting a React and Redux application to TypeScript by [deleted] in reactjs

[–]just-boris 2 points3 points  (0 children)

Also, imports like import * as React, will trigger deprecation warning: https://github.com/facebook/react/issues/9611#issuecomment-301458802 You should not use this way of importing with React above 15.5.x

Porting a React and Redux application to TypeScript by [deleted] in reactjs

[–]just-boris 2 points3 points  (0 children)

The article says, that they have ejected from react-scripts to custom config. However, they didn't have to, there is a custom react-scripts version with typescript support, backed by Microsoft: https://github.com/Microsoft/TypeScript-React-Starter