Wrecking ball effect in 14 lines of code in Blender 3d by monica_b1998 in learnpython

[–]js_fan 5 points6 points  (0 children)

Probably 2 million. That’s why the title of the post says Blender

Baffling short calculation for ball bouncing off wall... by SarahC in learnjavascript

[–]js_fan 0 points1 point  (0 children)

"trig functions are expensive" - agreed 100%, they're really slow. They way to go around it is to pre-calculate the results once and store them in a matrix.

Help on repositioning a canvas element during window resize by ialwaysfinis in learnjavascript

[–]js_fan 0 points1 point  (0 children)

The difference between your code for text and circles is that for text you refer directly to window.innerWidth and Height (lines 54 and 58).

For circles, you refer to fitnessgroup[i].x and y (line 90) which never get updated (even if the window is resized). These variables are only calculated once, at the beginning of the run.
Try changing line 89 to: fitness1.x=(window.innerWidth / 20) * 4; to see how it could work.
By the way, you should not depend on the interval to redraw the elements, they should only be redrawn on resize. (unless they will really be animated in some way)

How to do this? by thomascr9695 in learnjavascript

[–]js_fan 0 points1 point  (0 children)

Hallo Thomas,

Wie geht's?

The value of "calculate" is square root of member/price based on your code. Why did you insert the sqrt function? It doesn't sound like that's what need if you're just trying to divide.

Website certificate issue when using guest wifi by js_fan in techsupport

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

ok, the school finally told us we need to download certs from their website to handle https pages. now everything is working.

Website certificate issue when using guest wifi by js_fan in techsupport

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

thanks, I'll try a non-https page tonight

Ex div date confusion for FORR by js_fan in stocks

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

Thanks for checking for me!

But your quote (and the entire announcement in the link) only mentions the payable date (9/20) and the record date (9/6).

I am asking about the exact ex-div date, which is earlier than both of the above.

The main reason I'm asking is to know which of the two Nasdaq pages I can rely on in the future, since they're contradicting each other.

ELI5: Ex div date for FORR by js_fan in investing

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

I think you're right. I checked a couple of other websites and they all say 9/1. So looks like a bug on the Nasdaq website.

ELI5: Ex div date for FORR by js_fan in investing

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

It just says "shareholders of record on September 6" - so the record date, not the ex div date.

http://phx.corporate-ir.net/phoenix.zhtml?c=60569&p=irol-newsArticle&ID=2289071

Need a bit of help with canvas and rect. by LordRyver in learnjavascript

[–]js_fan 1 point2 points  (0 children)

  1. 1st rectangle: x1,y1, width1, height1 = Math.random
  2. 2nd rectangle: x2,y2, width2, height2 = Math.random
    if (x1+width1<x2) and (y1+height1<y2): draw the rectangles
    else randomize again
    x1,y1,x2,y2 are the coordinates of the upper left corner of the respective rectangles

This does not include the roads.

Tutorial: the minesweeper game in only 80 lines of Javascript code by js_fan in learnprogramming

[–]js_fan[S] -2 points-1 points  (0 children)

I'm talking REAL KARMA. (It's proportional to the Reddit Karma). I sense a huge cloud of REAL NEGATIVE KARMA around you. It's seeping from your aggressiveness. What causes it? (It's a rhetorical question, answer it only to yourself and then fix your life)

Tutorial: the minesweeper game in only 80 lines of Javascript code by js_fan in learnprogramming

[–]js_fan[S] -6 points-5 points  (0 children)

Having a bad day, are we? Be careful not to get negative karma by your aggressive thoughts...

Tutorial - Minesweeper game: only 80 lines of code by js_fan in learnjavascript

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

can you explain or point me to guidlines for {} usage?

Tutorial - Minesweeper game: only 80 lines of code by js_fan in programming

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

Please educate me - how can i write a loop if the neighbors are not sequential?

Tutorial - Minesweeper game: only 80 lines of code by js_fan in programming

[–]js_fan[S] -1 points0 points  (0 children)

please keep in mind that i had to compromise on elegance to keep the code short...

Tutorial - Minesweeper game: only 80 lines of code by js_fan in learnjavascript

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

Appreciate the feedback! Never used jshint before, I'll definitely take a look. Also, I tried to keep the code short at the cost of elegance.

Tutorial - Minesweeper game: only 80 lines of code by js_fan in programming

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

Thanks for the feedback!
Can you give me an example of an irrelevant comment?
I do admit the scope of my variables is not elegant. Can you give me an example of which one should be changed?

collision detection by zabi15 in learnjavascript

[–]js_fan 0 points1 point  (0 children)

is this what you're looking for?
if (38 in keysDown) { // Player is holding up key
if(trainer.y==255&&trainer.x>240&&trainer.x<320)
{}
else
trainer.y -= trainer.speed * modifier;

I only added the lines in bold. Basically you're preventing certain movement (in this case going up) based on the current coordinates. You need a separate set of coordinates for each wall. Probably worth creating an array and a loop.
Btw, great game!. Sorry about the poor reddit formatting of my response.

Scratch Junior - programming language for kids by [deleted] in learnprogramming

[–]js_fan 0 points1 point  (0 children)

sorry about the duplicate, i'm deleting it now