Posts

Showing posts from March, 2021

Exploring development timing through building a simple trading game

Image
Exploring development timing through building a simple trading game One of the things I have struggled with in the past is creating accurate estimates for how long projects will take to complete. This is clearly something that expands with experience but by better analysing where I am going wrong, I believe I can steepen my learning curve. What was the project? The project on which I chose to explore time estimations was a simple trading game. In the game users start with a little bit of cash; £100 and have the ability to post bids and offers on a single stock. The server would then run a matching algorithm that would match compatible bids and offers and give both users the average of the bid and offer prices. The price at which each trade is carried out is then reported to a graph on the webpage, these are polled. Where the idea came from The idea came from a long train of thought which started with a virtual races betting with some friends. I got annoyed because the odds weren&#

The lemon grove at the creperie: Maths behind economic intuition

Image
 There are a lot of things we have an intuition about in economics. If you haven't studied it you might not realise these often have a mathematical formalism. Two farms Take the following example I got from a blog   Having two farms that can be harvested in six months isn't equal to having one farm that can be harvested in three months and another that can be harvested in nine months. How do I take into account the amount of time involved? So intuitively there is a benefit from having a smaller output after a shorter time, but how do we quantify how much better it is? This is where a concept called discounting comes in. Discounting allows you to calculate the value of things based on how you value money now compared to in a years time. If I offered you £100 now, I'd not be surprised if you took me up on the offer. If, however, I give you a second option, I'll give you £x in exactly a years time. How much would I have to give you in a years time for you to choose to take

But can't you just use integration on the arc length?

Image
 I recently came across the following video  It made me think surly this can be derived in the same way as one can derive the formula for a circle. I'd gone through that derivation a number of times at school and since the formula for an ellipse is so close thought the same approach would surly work for an ellipse. I decided to give it a go believing that I surely wouldn't get the answer I expected but it would be interesting to see why the arc-length method wouldn't work. At this point, if I had to guess I would guess that the impossibility lay in the issue with integration. The formula for a circle can be represented parametrically as: To adapt this to an ellipse one simply needs to add constants in front of each trigonometric function: The arc length of a line can be calculated by the following identity which follows from Pythagoras: Using this identity we can get a formula for s in terms of x and y. However, this is where the signs of the problem begin as to fin

What is intelligence anyway?

I have before briefly mentioned a definition for intelligence that is useful to consider when investigating AI. I’d like to go deeper into what my understanding of intelligence is. I have a deep interest in understanding the fundamentals of intelligence, what is it really that allows humans to outperform machines that are by most measures far superior in their computational power. I discuss a lot with friends and colleges the facets of what they believe intelligence to be and what different elements mean. This search has not just led to a Masters in artificial intelligence but to look deeper to read numerous books on epistemology, a topic I believe was missing in my degree. Epistemology is the study of knowledge. By most measures of intelligence and especially in its colloquial use intelligence has something to do with knowledge. Epistemology is the school of philosophy dedicated to making arguments about what it means to know something. It goes a lot deeper into the topic than the qu

Validating SQLalchemy

Image
I have used SQLalchemy for a few projects and one of the things that annoys me, not so much from the structure, but the effects of code inside strings. All code is text which is parsed, however, we have inside IDE’s and for me inside VIM the ability to see the syntax errors as we are coding. No such thing exists for the code inside the strings which specify the joins of the relations in SQLalchemy. For this project, there are some core things the program needs to be able to do. Discover the file which contains the table object mappings Look for relation strings in those objects Validate the syntax of those strings Check that tables/columns referenced are valid Maybe enforce a syntax styling rule The file discovery shouldn’t be too taxing; most SQLAlchemy projects have a single folder in which the table objects are stored and each table needs to inherit from an sqlalchemy declarative base object. I thought that this project would be a good opportunity to learn elements of Python’s AST m

Fully immersive coding

Image
 A few years ago I got a Motorola XForce after having seen the following youtube review: Iframe loading error. The phone has an AMOLED screen which means that pixels that are showing black are actually off, as opposed to other screens where a black pixel is blocking as much of the backlight as possible. This leads to really deep blacks which don’t use up the battery as fast as a regular screen because the backlight doesn’t have to be powered. This made the screen on the Moto X look really good, this was added to by the fact that it was a quad HD screen. That gave me an idea. I use a terminal with a black background all day, would the extra contrast from using the AMOLED screen be better on my eyes? Would coding in VR eliminate all distractions? Years later I have now got myself a Chromebook with an AMOLED screen which I use for coding hobby projects, and it is very pleasant. Even with my new laptop screen, I’ve been intrigued by the idea of using a V

Code path-finding and architectural dependency enforcement

  One of the development tools I would like is a code pathfinder. I don’t mean something that can jump to the definition of a function from somewhere it is called, I have that already in VIM using exuberant ctags. I can even use that to find the usages of a function from its declaration, what I want is more. Something deeper. Given two functions, an answer to the question “Is there a call path from one to the other?” and then visibility on some of the shortest paths through the call stack between those functions. There are a few other graph-based analysis tools I want to build to aid in development. When working on large projects there are some important architectural constraints that start to become more important. Especially when working on a larger team these ideals and ideas that the original developer might try to put into the architecture of a new component get diluted down. Once diluted, things that should make the code easier to read, such as one point of entry and one point of

Tablecloth analogy for Quantum mechanics

Image
I have always found the question of where particles come from hard to ignore. It’s a question Feynmen struggled to answer when his father asked him.* I recently read a book; Something Deeply Hidden, whose author, Sean Carroll advocates the many-worlds interpretation of quantum mechanics. In his opinion, many-worlds satisfies Occam's razor by being the simplest interpretation. He argues that because the equations of quantum mechanics can be interpreted directly with no additions for the no collapse of the wave function by an observer. He argues that the many-worlds interpretation doesn't need to explain the observer problem because it isn't there. By requiring nothing more than the fundamental equations themself the interpretation is the simplest. You might question here that if there is no collapse of the wave function when an observation takes place, why do we see an experimental difference between when (taking the double-slit experiment as an example) we observe one slit

Popular posts from this blog

Some thoughts on solving transcendental equations

Too whet an appetite for DRY principles

Structural engineering with cardboard