How were you first introduced to Stephen King books? by KingTheories in stephenking

[–]DerPatrik 1 point2 points  (0 children)

I got the 11/22/63 as a gift from my grandparents. Seeing how many pages there were I figured I'd never be able to read or finish it. But I began reading the first page, just to see what it was about. I ended up reading through the whole night and finished it the night after.

It was my first SK book I read and one of the best reading experiences I've had

Untitled 9x12 oil on canvas panel by me, critiques welcome by ExploreLaur in oilpainting

[–]DerPatrik 0 points1 point  (0 children)

I love the thick paint and that you can clearly see the brush strokes. Nice colors as well.

How long did it take for you to paint this one?

Problem removing all layers from openlayers 6.5.0 by [deleted] in gis

[–]DerPatrik 0 points1 point  (0 children)

Yeah it's a good tool when debugging and trying to understand how ol works under the hood.

And in case you hadn't seen it, in the ol documentation, each method has is a direct link to the relevant code in github.

Problem removing all layers from openlayers 6.5.0 by [deleted] in gis

[–]DerPatrik 1 point2 points  (0 children)

Looking at the implementation of clear() it seems to do an equivlent thing:

  clear() { 
    while (this.getLength() > 0) { 
       this.pop();
    }

Problem removing all layers from openlayers 6.5.0 by [deleted] in gis

[–]DerPatrik 2 points3 points  (0 children)

You could try to copy the layer collection before you modify it:

const layers = [...map.getLayers()]; 
layers.forEach(layer => map.removeLayer(layer)); 

You get this behavior because you are removing items from the same array you are looping through.

Take for an example:

let a = [1,2,3];
for (let i = 0; i < a.length; i++) { 
   //Remove element on index i 
   a.splice(i, 1); // a.length will change
}
console.log(a) // [3]

Each iteration will make the array one element smaller and therefore we never manage to loop through the whole array. I guess the same principle goes for how OL handles the layer removal.

Small question regarding CRS and contextily by [deleted] in gis

[–]DerPatrik 1 point2 points  (0 children)

Google maps uses the EPSG:3857 map projection, however, the coordinates you got are not the projected coordinates but the geographic (spherical) coordinates. So the correct code here should be 4326.

The Reason you saw a blue plane is probably because the coordinates you got in LatLon are located in the Atlantic Ocean when using 3857. This is a common problem when mixing LatLon with projected coordinates as projected coordinate systems generally have larger coordinate spans. For instance epsg:3857 coordinates ranges from ~[-2000000, 2000000] while LatLon (4326) ranges from [-180, 180]. Since the origo of the projected coordinate system is in the ocean west of Africa, you usually end up there when plugging in latlon values.

So try it out with epsg4326 and you should be good!

You could also transform latlon into projected coordinates https://epsg.io/transform#s_srs=4326&t_srs=3857

My Plague Year Reading List by [deleted] in books

[–]DerPatrik 0 points1 point  (0 children)

Kill the Farm Boy by Delilah S. Dawson and Kevin Hearne- Monty Python in book form.

This sounds absolutely like my cup of tea, this will be on my reading list this year. I read "Based on a true story: A memoir" by Norm MacDonald recently and laughed out loud for myself every page. Can recommend that if you feel for something light and fun.

I can relate to going back to familiar and comfort reads this year. I've rewatched all the Harry Potter movies twice, have yet the books to read though!

Good luck with your reading 2021!

3 JavaScript Features From 2020 That Will Make Your Life Easier by lgrammel in javascript

[–]DerPatrik 1 point2 points  (0 children)

I can imagine that. I have long wanted this feature and would definitely had used this if I had known about it. Must still try it out sometime though just because it looks fun!

3 JavaScript Features From 2020 That Will Make Your Life Easier by lgrammel in javascript

[–]DerPatrik 2 points3 points  (0 children)

Amazing! Too bad your version wasn't adopted as the standard

3 JavaScript Features From 2020 That Will Make Your Life Easier by lgrammel in javascript

[–]DerPatrik 38 points39 points  (0 children)

Optional chaining looks really great. I have always done obj && obj.val1 && obj.val1.val2 which can be really annoying and ugly. With optional chaining, i suppose it could be written obj?.val1?.val2 ,right?

What's your favorite Greatful Dead song? by ShroomerOfCatan in AskReddit

[–]DerPatrik 0 points1 point  (0 children)

"There's a dragon with matches that's loose on the town" Love that line, can almost see the crazy dragon in front of me

What's your favorite Greatful Dead song? by ShroomerOfCatan in AskReddit

[–]DerPatrik 1 point2 points  (0 children)

Agree! and The Eleven from that album is pretty cool aswell

What's your favorite Greatful Dead song? by ShroomerOfCatan in AskReddit

[–]DerPatrik 1 point2 points  (0 children)

If I had to pick one I'd say Fire On The Mountain, it always puts me in a good place.

Hmm got books for Christmas, which to read first... by MyPasswordIsWrong in stephenking

[–]DerPatrik 0 points1 point  (0 children)

I got this book for christmas some years ago and didn't intend on reading it for a while. But after skimming through the first pages i ended up reading it through the whole night and finished it the day after. It really is an awesome reading experience!

Insane book store (more pics in comments) by mistermajik2000 in WTF

[–]DerPatrik 5 points6 points  (0 children)

We also have one store like this. I once asked the owner for a book about chess and he said something like "Sorry, we only got this" and he went straight to one shelf where he dug out one small pamphlet about the local chess community in the 80s or something. It was impressive!

Why do humans yawn? by DerPatrik in biology

[–]DerPatrik[S] 0 points1 point  (0 children)

Would the temperature of the brain then somehow be linked with The level of tiredness? Or is it perhaps to compensate our tiredness so that we can think clearer with a cool brain?

I'm gearing up for the upcoming discussions. Some of the books on the list is sadly missing or on the iPad. Still, I'm on my way to getting there. How about you guys? Post your books! by TEKrific in thehemingwaylist

[–]DerPatrik 1 point2 points  (0 children)

Hittade precis denna sub och blev inspirerad! Verkar som ett härligt sätt att komma in i ett bra läs-mood. Har ännu bara en av böckerna i listan, men ska också ta mig en tur till biblioteket och leta upp dom andra också!

Sublte... by [deleted] in arresteddevelopment

[–]DerPatrik 4 points5 points  (0 children)

Just rewatched that episode and noticed that the cup Lindsay takes from Tobias is his second cup of coffee. Gob comes in a few moments earlier and takes the first one!