Monday, October 25, 2021

Coding

 


I'm not sure where I heard this, and it wasn't worded this way, but it helps to think about coding this way.

Basically, any program you write is just meant to translate your problem into an already solved problem in computer science, or put another way, translate your input data into data that can be passed to an existing algorithm.

Tuesday, September 28, 2021

Python Particle Simulation Update

 I don't have much to update about, other than the fact that the simulation still makes sense.  I haven't run into any problems that will prevent me from completing it.  I think I have found some python libraries that will help me in calculating intersection and with graphically displaying the simulation.  Currently I am using the following:

Pyglet - for graphics and possibly for timing of events

Sympy - for calculating intersection of particles using Rays

That's about all that is happening in my coding life right now.

Thursday, September 16, 2021

Python Particle Simulation

 I have started working on a particle simulator in python.  I have limited knowledge of Quantum Mechanics, but thinking about the weird way particles and entanglement work has lead me to some ideas that I want to try in a computer simulation of particles.  My idea is that certain properties not existing, or being described by probability functions will allow the simulation to run very fast with large numbers of particles.

I have been thinking about this for several years and made other attempts to get started. The current attempt is the furthest I have ever gotten. I have finally gotten it clear in my head what I want to do.

I am going to setup an array of particles.  Each particle will have a position and a direction.  When 2 particles interact I will optionally create more particles and select new directions for each particle.  At that point I will, using the direction of each particle, look for future interactions with other particles.  These interactions will go onto a queue that will be processed starting with the earliest event in time.

My thought is that doing this will mean that I only need to loop over the particles when an interaction happens, not for every frame like you would in a traditional animation type program.

I still haven't worked out all the details.  It is possible that it just doesn't work, or doesn't make sense in some way.

Wednesday, March 18, 2020

Canvas Paint

Here is another small JS project that I built quite a few years ago.  It was basically just an exploration of the canvas tag, which was somewhat new at the time.  I called it "Canvas Paint".  It allows you to draw on the canvas.  You can change the color and width of the brush by changing the numbers in the boxes and clicking either "Set Color" or "Set Width".

Wednesday, March 11, 2020

Life Game

Previously I posted about a game (really a simulation) that I made several years ago.  I called it the Fish Game.  A few years later I made another very similar simulation that I called "Life Game".

It is similar, but quite a bit more complex, and I think somewhat better written code.  In this version there are three life forms; fish, bugs, and plants.  The fish eat the bugs.  The bugs eat the plants.  The plants gain energy each frame as if they are getting energy from the sun.  Each life form has a fairly large set of properties.  These are copied to the individual life forms as they are created.

Tuesday, March 3, 2020

Custom Thumbnails for Magento 2 Products

I recently migrated a site from Magento 1 to Magento 2.  The product image thumbnails work differently in Magento 2.  In Magento 2 they use a JS library called Fotorama.  It has several options that can be modified in the view.xml if you have a custom theme setup.  However, none of the thumbnail options match the way that the thumbnails work in Magento 1, and my client wanted them to look more like the old version.


Friday, February 28, 2020

Fish Game

Many years ago, probably about twelve to fifteen, I was working on building a custom e-commerce system using Adobe Coldfusion.  I was a young developer and so were the rest of the developers I worked with.  Non of us were really qualified to build such a complex system, but we didn't know that, so we did it anyway.  It ended up working fine for the customers we had.  I'm sure I would not be happy with most of the code if I saw it today.


Coding

  I'm not sure where I heard this, and it wasn't worded this way, but it helps to think about coding this way. Basically, any progra...