I started watching your videos recently and I really DO admire your work. I like how you think and your ability to explain what you are doing. You are an inspiration to me and I believe to many more people. I hope I will become as good as you someday. Please keep up the videos and know that what you are doing is amazing!
@TheCodingTrain
5 жыл бұрын
Thank you for the nice feedback!
@TheMrInfantaria
5 жыл бұрын
This.
@mikee.
5 жыл бұрын
I love these math based videos!
@mrz9900
5 жыл бұрын
DEFINITELY!
@avi12
5 жыл бұрын
I love how Dan uses some of the KZitem channels I'm subscribed to in such a fluent way And I watched all these videos, which makes it even better
@arnoudh6203
5 жыл бұрын
Ah yes, reading numbers the content I came here for
@katherinegaymes
5 жыл бұрын
near the end when you are trying to make the lines thicker, you put the formula in the stroke function instead of the stroke weight function
@TheCodingTrain
5 жыл бұрын
Oh, this is a bug, thank you! Feel free to pull request a fix to the code at github.com/CodingTrain/website! I just fixed it in the web editor version: editor.p5js.org/codingtrain/sketches/SJMl3u5xN
@justinward3679
5 жыл бұрын
Numberphile squad!
@qxtr5853
5 жыл бұрын
I feel like prof. Shifman over here is watching 3B1B Numberphile and all the other greats and stealing their content into a programming context :P
@kushagraverma9452
5 жыл бұрын
Here!
@sujals7108
5 жыл бұрын
@@qxtr5853 He's not stealing it, he's just making programs out of it.
@ob3vious
5 жыл бұрын
I know that the numberphile video contains the algorithm. Only if one adjacent pixel is toggled, toggle itself. Simple right?
@innoberger1632
5 жыл бұрын
In the for loop, when setting available to false, you could add a „break“ statement, which will increase performance a bit :)
@arnaud4059
5 жыл бұрын
I discovered The Coding Train a few weeks ago, and I've watched at least 15 coding challenge since then. It's so great to discover such awesome algorithms thanks to you ! Greetings from France :)
@TheCodingTrain
5 жыл бұрын
Thank you for watching!
@aladaris
5 жыл бұрын
This was the perfect video for showing tree data structures :) Leaf nodes will be your "placeable/valid" toothpicks
@TheCodingTrain
5 жыл бұрын
Oh, good point!
@moshadj
4 жыл бұрын
I think it might have been nice to have toothpicks know their parents and then figure out if there is any easy way to determine free edges based off parents to reduce the search space for non-payment connections.
@GalHorowitz
5 жыл бұрын
Huge optimization potential at 18:57 - you set available to false but don't break out of the loop, so when the amount of toothpicks gets large you have to check n^3 iterations which slows it down massively.
@TheCodingTrain
5 жыл бұрын
Oh great tip! I did not notice that at the time! If you would like to pull request this fix to the code I would incorporate it!
@GalHorowitz
5 жыл бұрын
@@TheCodingTrain Sent a pull request including both the p5js version and the processing version.
One easy optimization would be to break out of the loop in createA/createB when a collision is found
@TheCodingTrain
5 жыл бұрын
Good idea!
@xhir0
5 жыл бұрын
You're the reason I got into coding. ☺️
@morganstoodley8591
5 жыл бұрын
What a coincidence, I created this fractal just a day before you uploaded this amazing video!
@soyz6375
5 жыл бұрын
"There's no reason for me to have two separate functions here, but... why not?" DRY principle maybe :P
@nondeterministic
5 жыл бұрын
Daniel, you are better than my CS professors xD
@Otakutaru
5 жыл бұрын
I would hace made lenghts even. If you make a toothpick 2 units long, its ends would be +- 1. And every endpoint and middlepoint of every toothpick would be perfectly aligned with the grid.
@morphman86
5 жыл бұрын
A vector (in maths, not in processing) is a point in space and a direction. This would be very useful for a toothpick object, instead of having 4 values and a direction. Since you know the length of a toothpick, you only need to know where the toothpick starts. This means you can skip bx and by completely. Since you know the toothpick will be in a right angle at all times, you only need to know the length of it and its origin point. The length is constant, since all toothpicks have the same length, this can therefore be hard coded. You are now left with 2 integers, ax and ay, along with a direction. Two points making up a coordinate, that's exactly what a Processing Vector is, so convert the 2 integers into a single pvector and your toothpick now consists of a point in space and a direction. All the information you need! Oh... look at that, your toothpick is a mathematical vector. Rename it to mvector or just vector and you can reuse it in any program where you need a mathematical vector!
@TheCodingTrain
5 жыл бұрын
Thanks for this feedback!
@kevnar
5 жыл бұрын
Release an album of just you reading number sequences. Children can use it as a lullabye, and they'll become math prodigies.
@d_v_d1070
5 жыл бұрын
best x-mas gift ever Daniel, a coding challenge with the magical Processing 3 environment
@f.jideament
5 жыл бұрын
Is there any challenge about physics of atoms or molecules of specific matters? I mean, it may be so cool to visualize the real material reactions with their behaviours (behaviour means all the things about them like mol pH or magnetism or density etc.)
@binsitt
5 жыл бұрын
This is hilarious! Would have never guessed that a toothpick and a basically simple concept would outsmart THE compression algorithm of the internet in 2018. Also: Merry Chistmas!
@NatCo-Supremacist
5 жыл бұрын
the moment I saw that video when it was uploaded, I knew you'd make a coding video about it
@SafetyBoater
5 жыл бұрын
I just tweeted my program output to Daniel yesterday.
@MrMyhz
5 жыл бұрын
At 18:40 you could probably make it more consise and explicit by simply returning instead chaining ifs. E.g. return ( (ax == x && ay == y) || (bx == x && by == y) ); Alternatively: boolean aIntersect = (ax == x && ay == y); boolean bIntersect = (bx == x && by == y); return (aIntersect || bIntersect);
@devanshishah9481
5 жыл бұрын
30 seconds in the video and i feel happy
@richskater
5 жыл бұрын
ArrayLists are super wordy, but you can save a few characters on your declarations. ArrayList picks = new ArrayList(); Specifying the generic class isn't needed the second time. Similarly if you have one as a member variable, ArrayList m_picks; And initialize it in the constructor (or elsewhere) m_picks = new ArrayList();
@TheCodingTrain
5 жыл бұрын
Thanks for the tip!
@alator21
4 жыл бұрын
@@TheCodingTrain or List picks = new ArrayList();
@lonec1777
5 жыл бұрын
I really think you should use enumerators, because in the long run enumerators are amazing. Great video regardless!
@gregfletcher2360
5 жыл бұрын
This is so cool! Awesome coding challenge choice!
@nickdubbel
5 жыл бұрын
Could you please make an QR-code scanner?? That would be really cool. :)
@ob3vious
5 жыл бұрын
Yeah, I know exactly how. Watch a little video of Vsauce about it and it contains all you need
@tresthegoat
5 жыл бұрын
This was on my birthday and i use toothpicks. crazy world we live in. anyways very interesting and helpful
@benjamindragon598
5 жыл бұрын
Super cool Dan! More processing please!!!
@exmachina3840
4 жыл бұрын
Man you're really good 😵
@alekmoth
5 жыл бұрын
picks should know if their ends are available. they only check once and then never again because either they were not available or they have created and fill the hole. so instead of foreaching all picks, you should maintain a list of edges (those that can have edges)
@TheCodingTrain
5 жыл бұрын
Great point!
@talisman3d595
5 жыл бұрын
Can you do a coding challenge with Arduino? Have a button in a browser that triggers the arduino to do something in real life. Love your work mr. Shiffman!
@micky2be
3 жыл бұрын
Only new gen can create future gen. No need to go through all toothpicks.
@goswinvonbrederlow6602
2 жыл бұрын
(ax, ay) of one toothpick can never match (ax, ay) of another. You only have to check the other ends for intersect.
@prismaticjunimo7160
5 жыл бұрын
Finally the toothpicks video
@nerdiconium1365
5 жыл бұрын
lovely Japanese paper wall thing design
@abcrtzyn
5 жыл бұрын
And now that you have a toothpick object, you can do all sorts of things, like Buffon’s needles and calculate pi!
@TheNoNameHere
5 жыл бұрын
I think he already did the pi calculation?
@kemiimek
5 жыл бұрын
Instead of looping for every other toothpick and computing if there is a collision, could you use something like the following: loadPixels(); If t.dir == 1 x_pixel = t.x + len /2 + strokeWeight + 1; else y_pixel = t.y + len /2 + strokeWeight + 1; if pixels[x_pixel][y_pixel] != white then next.add(next_one) I mean it's pseudocode but you get the idea. With some boundary check you should be 10x faster on huge iterations
@TheCodingTrain
5 жыл бұрын
Thanks for the optimization note!
@shanzid01
5 жыл бұрын
God you deserve sooo many more subscribers!
@MinecrafterFlicker2
5 жыл бұрын
i love your videos
@PittsyPlays
5 жыл бұрын
Since it’s symmetrical couldn’t you just calculate the picks for one corner then flip and draw for one corner then flip and draw for the other half of the screen?
@OKay5067
5 жыл бұрын
Why do you use available? You could simply return null in the loop. Simpler and faster
@luisbeltran2572
5 жыл бұрын
Hi Daniel! We need a number reading session like Michael Steven's one. Oh i just noticed, Should it not be p_n(x,y) = [x,y] +- (len-1)/2 to get integer coordinates rather than p_n(x,y) = [x,y] +- len/2?
@TheCodingTrain
5 жыл бұрын
If I ever get to 1,000,000 subscribers I'll do one!
@sensei0101
5 жыл бұрын
Maybe easier to follow direction with Enum? public enum Direction { HORIZONTAL, VERTICAL } Awesome video btw
@manishgarhwal7119
5 жыл бұрын
Hi there. I have a Question for you. I am currently in 3 Year(6th Sem) of my Computer Science Engineering. I have learned Languages like HTML, CSS, JAVA(Android Programming) on a moderate level. I started learning Python but it does not provoke my interest. I wanted to ask you that i have decided to focus on any one Programming Language for the remaining time i am studying College, so which programming language should i go for? Thank You.
@nicholasjackson3959
5 жыл бұрын
Hi Manish. I've completed a 4 year Software Engineering degree in Australia, (CS equivalent) as well as 4 years of my PhD and also working as a Software Engineer at the same time. Speaking from my personal experience, deciding on a specific language is not always the most important factor. Learning the fundamentals of programming including proficient design paradigms is significantly more important. Over the years I've worked on several projects ranging from PHP, Python, Javascript, C, C++ you name it. Eventually they all share common components in their syntax structure (with some exceptions). However I find understanding how to design a program or project to be efficient and elegant in its structure is far more important. I hope this helps. Without any sort of context into your question, being an expert in a specific language might get you hired from some companies. Understanding how to develop for a specific project with the knowledge of proficient design will get you hired at a lot more companies.
@manishgarhwal7119
5 жыл бұрын
@@nicholasjackson3959 Thanks for your Guidance Nicholas.
@goswinvonbrederlow6602
2 жыл бұрын
It should be maxX = max(t.bx, maxX); because that is the right point.
@_fRiction_
5 жыл бұрын
Hey Dan, love your videos and the way you explain things. Could you try rendering Julia 4D Quaternion Fractal using p5.js?
@francoisst-pierre8579
5 жыл бұрын
I saw the problem completly different and I was wondering if we could juste add some varibles to the toothpick for know each of his edges are free or not. And in the loop when you place a toothpick you remove all toothpick from the array that have no free edge remaining. So you ll juste keep an array of the the toothpick that matters so you wont need to redraw the background again. I would like to know if it s efficient or if it s too long. Like this if you let it run for a while you will have less memory issu. Sorry for my english it s my sexondary langague i hope i was clear! By the way i love your videos!
@TechnicalManhoon
5 жыл бұрын
I made it in JAVA Graphics component but when I use loop it's taking too long to regenerate each next pick.
@shutup3198
4 жыл бұрын
I kicked a toothpick about a year ago and left half of it in my foot for two months
@sankethire7672
5 жыл бұрын
Please make a video on visualising the Riemann zeta function in p5js or Processing.
which macbook(s) do you use? I need it for reference since I 'need' a macbook but not sure to buy the newest one (nor that I can buy it)
@hariangr
5 жыл бұрын
@meme I saw Microsoft engineer use Thinkpad (in the Visual Studio yt channel),... what's up with that? and, unfortunately... no... I develop for mobile... I need mac to develop for iOS (I use flutter btw)
@diligar
5 жыл бұрын
Wouldn’t the length be even? Because you say ax = x + Len/2, so if x and ax are both integers, Len must be even?
@TheCodingTrain
5 жыл бұрын
with integer math in Processing (Java), for an odd number len/2 is equal to (len-1)/2. For example 5/2 = 2
@diligar
5 жыл бұрын
The Coding Train Oh right, integer division is a thing 😅 but still wouldn’t it be (len-1)/2 on both sides, so len-1 total?
@freemanwest
5 жыл бұрын
Oh please do the snowflake one next time! Cheers!
@joshuapaige8623
5 жыл бұрын
Question: Why don't you have to make a JFrame when you write the code? I've only been programming for a few months and I use eclipse for java so everytime I want to write a graphics program I need to specify the JFrame and then add a JPanel to it but you don't so I'm just wondering why. Thanks.
@TheCodingTrain
5 жыл бұрын
Indeed I use Processing (processing.org) which takes care of all the windowing.
@johncerpa3782
5 жыл бұрын
That was awesome
@CaelVK
5 жыл бұрын
man, processing really needs a dark theme
@raulgda121
5 жыл бұрын
I don't know on windows or mac, but on linux you can go at the source folder, open lib folder and there is a file called theme.txt, that contains every single color for everything on the interface. Just look up the colors you want on hexadecimal and edit this file (good idea to make a copy beforehand).
@goobloob2196
5 жыл бұрын
Keep it up
@ValerianAndStuff
5 жыл бұрын
what about to change toothpicks to triangles/squares/hexagons? what will happen then to the pattern?
@ButteryCowEgg
5 жыл бұрын
Ooo I just saw this video earlier today
@luisaisat
5 жыл бұрын
please draw a slinky (3d) please
@calebsherman886
5 жыл бұрын
Can you make a list of your favorite websites?
@lancesellner4829
5 жыл бұрын
Hey! New to the programming scene. I am on processing and I am wondering how i can get the bottom section to go away. It says "Console" and "Errors" Is there any way for me to hide that without getting rid of it completely?
@MrEmanuelep0109
5 жыл бұрын
May I ask you if you could try to remake Tic Tac Toe next week?
@valeriolai
5 жыл бұрын
Hey, I just downloaded Processing and I'm a bit confused about how to use it with Java or p5.js.. Do you have a series where you explain how to set them up once and for all? thanks in advance!
@TheCodingTrain
5 жыл бұрын
This is my workflow series (though I don't spend much time on Processing) kzitem.info/door/PLRqwX-V7Uu6Zu_uqEA6NqhLzKLACwU74X
@piechocinek
5 жыл бұрын
Please explain this to me How ax and bx are int type? ex. ax = 0 + 9/2; Which is: int ax= 4.5; Yet it still works 😓
@L33tSauceProductions
5 жыл бұрын
Whenever an integer is left with a decimal, it always throws away the decimal. Like 1/3 = 3.33333 but as int it would be just 3
@piechocinek
5 жыл бұрын
@@L33tSauceProductions I did not expect anyone to answer, so thanks ;D I am aware of that fact, but then the length of one pick when len=9 is actually 8. Overall i don't want to acuse him of anything, but in my understanding he didnt quite explain (on the whiteboard) how it actually works in the code
@a2zlearninghub67
5 жыл бұрын
Thats great sir 👌👌🤗
@IavraPlays
5 жыл бұрын
Why declare your variables as ArrayList, when you are never using implementation specific functions? Not sure, if Processing is different from regular Java, but you should always code against the interface (List). Also, instead of comparing every toothpick with every other toothpick twice, wouldn't it be easier to compute all possible new ones and for each duplicate, discard all of them? Could then use a growing index in the picks list to ignore old generations during each iteration, instead of the hacky boolean.
@TheCodingTrain
5 жыл бұрын
Thanks for these suggestions!
@hoblikdlouhovlasy2431
5 жыл бұрын
Hi Dan : ) , what macbook do you have? I am not apple fan and I wanna ask if apple is good for coding, I mean the compatibility with some IDEs, performance, ect.?
@TheCodingTrain
5 жыл бұрын
I have a recent macbook pro. It works well for me, but there is no perfect computer.
@nataliekidd2135
5 жыл бұрын
Wouldn't it have been easier for the toothpick class to keep track of its endpoints. So that they know if they are open or not. Then you wouldn't have to check the toothpick against all other toothpicks.
@TheCodingTrain
5 жыл бұрын
This is an important optimization that I missed yes!
@paligamy93
5 жыл бұрын
@19:35 if you're tired and you know it clap your hands *clap clap* if you're tired and you know it clap your hands *clap clap* if you're tired and you know it and you don't know what a *- operator is clap your hands clap clap z.z
@islandcave8738
3 жыл бұрын
Write it using a gpu shader to speed it up.
@WIJIJA
5 жыл бұрын
классные видео, очень благодарен,я с Украины не с России(cool videos, very grateful, I'm from Ukraine not from Russia)
@allroundgamingrounder4478
5 жыл бұрын
Hey bro in some of your videos you used a white-board...Where is it?
@ev4_gaming
5 жыл бұрын
oof... KZitem really doesn't like the output data, luckily i do
@carlosmorasalguero
5 жыл бұрын
First smarter every day, now numberphile, what comes next? Jesus Christ being born on Christmas eve?
@williamyounes7321
5 жыл бұрын
What coding language do you use? I'm trying to get into coding on my own time but don't know what language to use.
@mikee.
5 жыл бұрын
In this video he uses "Processing" which is based on Java. For starters I recommend JavaScript. You can follow TheCodingTrain's "p5js" tutorials! :)
@TheCodingTrain
5 жыл бұрын
This video uses Processing (which is built on top of the Java programming language). For more info, visit processing.org. I JavaScript + p5.js in my beginner series: kzitem.infoplaylists?view=50&shelf_id=14&sort=dd
@williamyounes7321
5 жыл бұрын
@@TheCodingTrain thank you, i was not expecting a reply from you at all, not to mention so quickly. This just proves how awesome of a youtuber you are.
@williamyounes7321
5 жыл бұрын
@@mikee. thanks
@rlasc84
5 жыл бұрын
In java 9 is much more simpliet to declare an array.
@TheCodingTrain
5 жыл бұрын
Oh, I should take a look! Not sure if Processing works with Java 9?
@rlasc84
5 жыл бұрын
@@TheCodingTrain you are right. Proccesing not working on java 9. But the diamond operator inference is since java 7. I'm not sure if proccesing supports the sintax.
@saidineshkolla5595
3 жыл бұрын
Can we make these with shape of "v" and " hexagon"....🙄
@TheNoNameHere
5 жыл бұрын
You could maybe use a linked list from java.util.* to iterate through them a bit faster?
@chrismanuel8993
5 жыл бұрын
u r god
@harshitjoshi3082
5 жыл бұрын
How about starting a Java for beginners series ?
@d74g0n
5 жыл бұрын
ha i just watched that numberphile vid.
@fearlessmonotheist1478
5 жыл бұрын
Admin add user details in his account then generate a uid for particular user .admin send that uid as a invite code to user by which user can sign up for that group. how can I do it. Sir can you tell me please please please please ?
@ad_cy6303
5 жыл бұрын
can u tell me what kind of laptop do u use for ur programs and the operating system also.....plssss cause i want to buy one laptop which is very good for programming...pls sir....
@mdminhajuddinkhan3014
5 жыл бұрын
Which programming language are you using in this video?
@TheCodingTrain
5 жыл бұрын
This video uses Processing (which is built on top of the Java programming language). For more info, visit processing.org and also this video might help kzitem.info/news/bejne/oqOip52BrJuqY6Q.
@rolfvankleef8439
5 жыл бұрын
Daniel, java.util.Optional is something that you would want to look at sometime.
@TheCodingTrain
5 жыл бұрын
Awesome, thank you for the tip!
@ryanjl9
5 жыл бұрын
Was not a huge fan of the fact that you loop through the entire array list every single frame. Completely looses scalability as it's a computations become O(n). As you increase the number of tooth picks, you no longer need to check the interior pick. I feel that storing the picks in a heap would have allowed you to keep track of which picks to check each frame. Finding what would be considered the first leaf node would be O(log(n)), and checking to see if a tooth pick should be placed would be as easy as checking length/2 + 1 + the center point and length/2 -1 - the center point (Math might be a bit off there). Anyways good video all the same. Enjoyed the content but the execution felt a little sloppy.
@TheCodingTrain
5 жыл бұрын
Yes, this is an important optimization, thank you!
@micha5899
5 жыл бұрын
Hi. Can I put HTML button into canvas using js?
@slyer7695
5 жыл бұрын
I love you 😂❤
@toastyPredicament
2 жыл бұрын
ill go watch bob ross now :
@jovannovakovic5975
5 жыл бұрын
2:57 😂
@toastyPredicament
2 жыл бұрын
PLEASE CAN THERE LET BE TWO?
@raulgda121
5 жыл бұрын
Why in the world isn't he suscribed to Numberphile?! I've been let down :(
@TheCodingTrain
5 жыл бұрын
I am I am! Not sure what account I was logged into when recording this.
@xSaDii
5 жыл бұрын
How can i submit a coding challenge?
@redhen
5 жыл бұрын
Here you go: github.com/CodingTrain/website/issues
@aleva7973
5 жыл бұрын
Do you know some chanel like this but based on C++?
@dianewilliams5830
5 жыл бұрын
javidx9 has many videos on C++ graphics/game programming based on his console game engine. He provides good explanations, but it assumes some prior knowledge of C++. Of course, it does not have the frivolity, energy, and showmanship of Daniel Shiffman, but I enjoy javidx9 English wit as well. C++ graphics will makes me really appreciate Processing and JavaScript.
@antoinelouchet2470
5 жыл бұрын
Please !!! Railwolker ! Make a coding challenge about this series ! (Nulberphil video): kzitem.info/news/bejne/p315m4iagpuFbIo Or even better of the music representation ! Probably your biggest french fan, and the video about Lisa's curves made me crazy !
Пікірлер: 191