Showing posts with label CS. Show all posts
Showing posts with label CS. Show all posts

Saturday, 11 January 2020

2019 in Retrospect


This year, I've had some progress on my pet projects. The progress rate was slower in Q4 as we have bought a house. We'll move there in 2020.

Maintaining a house will require some work and learning activities. I expect that the pace of my pet projects will be slower than before.

2019
  • TrafficControl (C++ / Qt) - Paused
    • No work on this project in 2019.
  • StockReader/StockAnalyzer (C# / SQL / MSVC) - Current focus
    • Creating a C# program that scans a folder for result files, extract stock records and parses the data to a database. I've got some experience with Microsoft Visual Studio by now and I'm still learning...
    • Next step will be to fix issues with data conversion to SQL
    • After that, I'll explore some Machine Learning algorithms and check if I can predict stock price changes based on key numbers.
  • ApartmentPredictor (Python) - Done
    • A Python script that made Linear Regression Analysis of past apartment prices in an area. The predictions were based on the apartment size and the monthly cost. 
  • Machine Learning Course at Stanford (Octave / Matlab)  - Done
    • I successfully attended and finished the course in Machine Learning from Stanford University.
    • I applied some machine learning for a pet project for a friend. The simulations indicated that the result was random to a very high degree,
  • TravelTimeCalculator (Java / SQLite / Android Studio) - Done
    • I've completed the project now. TravelTimeCalculator allows the user to compare travel time/cost between several positions on a map. They can also customize the travel cost to consider both travel time, economic costs and environmental cost.



  • Work (C / Python / 4G / 5G) At work, I've focused on test and some coding for 5G with focus on antenna calibration.
To Do in 2020:
Prio 1: The New House!
Prio 2: StockReader/StockAnalyzer

Saturday, 25 May 2019

StockAnalyzer: Connecting to the Database and Designing It

As I have mentioned before, I will process the data in three steps:
  • A C#-app for Windows that will populate the database (ongoing)
  • A web app that will analyse the database and look for inconsistencies
  • A Python script (or possibly Matlab script) that will perform machine learning on the data set.
In the last blog post, I created the database that I will work with. Now. I'll start populating it.

The first step is to connect to the database. I'll use an example that I found:

The language setting is Swedish.
For non-Swedish speakers, the error message
says that the key attachdbfilename is invalid.
The key attachdbfilename is invalid. The DataDirectory needs to be changed to an actual library. I'll start by fixing the connectionString and using a standard SQL query:

I can now connect to the database and launch a simple query!

The First INSERT and SELECT to the Database
I extended the query to the database. First, I populated the database with some dummy data. After that, I selected all rows in the database and presented them as a message box:
It shouldn't be possible to add more than one record of a particular stock for a particular date. I will add a UNIQUE constraint. I will fix that soon.

Next, I need to plan how to design the application, with different classes and layouts for the user interface.

Side Note:
I added  the project to my GitHub account, using instructions on GitHub.



The updated code is available at https://github.com/cutetrains/StockToDatabase