Category

programming

Problem Solving with code – Speeding Fine

We are going to start a series of posts on code problem solving. This will really help you guys that are self taught software developers. No matter how simple or complex we get with these problems it’s always good to take 10 to 20 mins and practice. All of these post will be using Java but feel free to post your solutions using whatever language you like. I would encourage you to take the extra time to write some unit tests so that you know if your code works or not.

Solve the problem on paper or a whiteboard using pseudocode first and post a picture of your solution in the comments below!

Here is an example of some really rough code on paper that I was writing to solve another problem.

The first problem we are going to talk about is speeding fine.

Below is the solution to the speeding fine problem. Post a link to an image of how you solved it or create your own gist for everyone to see.

How to create a bubble sort with Java and Haxe

There are tones of posts online that cover bubble sort. Lately I’ve been brushing up on my Java and also I like Haxe so here are two videos covering bubble sort in each of the two languages.

Java Bubble Sort Algorithm

 

import java.util.Arrays;

/**
 * Created by matthew.wallace on 2/10/17.
 */
public class Main {

    public static void main(String[] args) {

        int[] list = {4,6,2,90,245,3,21,356,42};

        System.out.println("before sort : " + Arrays.toString(list));
        int i,j,temp;

        for (i = 0; i < list.length - 1 ; i++) {
            for (j = 0; j < list.length - 1 - i ; j++) {

                if( list[j] > list[j + 1]) {
                    temp = list[j];
                    list[j] = list[j + 1];
                    list[j + 1] = temp;
                }
            }
        }

        System.out.println("after sort : " + Arrays.toString(list));
    }
}

 

Haxe Bubble Sort Algorithm

 

package ;
class Main {

    public function new() {

        var list:Array<Int> = [7,5,1,2,45,37,42,183,3];

        var temp:Int;

        trace("unsorted list : "+ list);

        for(i in 0...list.length - 1) {
            for(j in 0...list.length - 1 - i) {

                if ( list[j] > list[j + 1]) {
                    temp = list[j];
                    list[j] = list[j + 1];
                    list[j + 1] = temp;
                }
            }
        }

        trace("sorted list : "+ list);

    }

    public static function main() {
        new Main();
    }
}

Daily Haxe

Join the #dailyhaxe discord channel!

discord  haxe-logo

Let’s show off what we are all up to in the Haxe community. Join the #dailyhaxe channel on Discord and I’ll pick the most interesting of what is going on and post it for you guys. It will be a great way to meet the community and start conversations about what people are working on or looking to do in the Haxe community.

Don’t just do something, stand there

The worst thing I ever did for my back was become a full time Software Engineer. It’s a constant battle because for that long is not good for you. The last few years I make sure and drink a lot of water and coffee so I’m forced to leave the desk to go to the rest room or fill up my cup to keep the justices flowing. Another thing that has really help is getting an adjustable desk and chair. This way I can stand for 20 – 30 mins and then take a break.

Here are 5 health benefits to having this setup as sited by Smithsonian.com

  • Reduced Risk of Obesity
  • Reduced Risk of Type 2 Diabetes and Other Metabolic Problems
  • Reduced Risk of Cardiovascular Disease
  • Reduced Risk of Cancer
  • Lower Long-Term Mortality Risk

Needless to day … get a standing desk. I also find that it helps me focus more on the task at hand.

Below I’ve shared the “electric” adjustable standing desk that I use every day, the chair that I use when I do sit and the computer monitor arms that I bought. They won’t break the bank and the quality is good enough that you can rely on them to work for you for a long time.

How do I learn algorithms and data structures?

Great Answer from:  Hounshell

About Matthew Wallace

The lowdown on Matthew Wallace:
I’ve been a  software engineer for more than a decade. The technologies and languages I specialize in are many. Problem solving is something I really enjoy.

Languages I work in: Swift, Objective-C, Actionscript, Java, Ruby, Python, C++, Javascript

Niche Technologies that I work in: Video streaming platforms using Wowza (Java), FMS, WebRTC. I also have done realtime alert and chat systems using the same technologies such as FMS, XMPP, and others.

I tend to work in three main areas. Desktop, Web, and Mobile application development.

What you will get out of this:
My website is meant to showcase things I’m working, things I’m learning or interested it and also if you are looking for a software engineer, you’ve come to the right place. Feel free to reach out. I’d love to hear about what you are working on and what need I can fill or problem I can help solve.

Free online computer science lessons to students

starwars:

Disney and Code.org have teamed up to offer free online computer science lessons to students around the globe! By learning to code their own Star Wars game through Hour of Code, kids can be proud of the technological treats they construct.

Learn more at code.org/starwars