Problem Solving with code – Sum Unique Numbers
In this lesson we are going to work on solving a somewhat simple problem. It’s really good practice for thinking about how you should structure your “if” statements.
Software Engineer – Mobile, Desktop, and Web
In this lesson we are going to work on solving a somewhat simple problem. It’s really good practice for thinking about how you should structure your “if” statements.
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.
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(); } }
Join the #dailyhaxe discord channel!
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.
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
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.
Kitura is aweb framework and web server that is created for web services written in Swift.
I’m really looking forward to giving this a try.
Great Answer from: Hounshell
“Read.
No, really, read.
The following are highly recommended.
Read everything about algorithm and design you can possible find. There are phenomenal books out there. The Sedgewick algorithm books are good. The Algorithm Design Manual by Skiena is good as well. Together these books follow me on every bookshelf at every job I go to, along with The Mythical Man-Month.
Then ask.
Talk to people you respect. Ask them what decision points they had and why they made the decisions they did. The good ones will always be able to tell you “I chose to do X because it’s better than A, B in these ways. I could have gone with C, but I felt this was a better choice because of this”.
Next, do.
Build stuff. Build stuff that you’ll never use. Build stuff that you’ll never need. Go write a program that solves a Sudoku puzzle. Now go do it again. And again. Build it 5 completely different ways. Build a program that generates Sudoku puzzles and feed it into the solvers. Find which solver is fastest. And then…
Find out why.
The “what” is almost never important. I mean, yeah, it is critical to finishing the project at hand, but at the end if you know the “what” without knowing the “why”, then you might as well never done it in the first place. You got a bullet point on your resume. Go get a cookie and congratulate yourself. The “why” is so much more important than the “what”.
And for the record Sudoku was an example. I spent a lot of free time going through that exercise with a ton of the logic puzzles on Kongregate and learned a lot on the way.
Unity VR Samples To Google Cardboard SDK
I’ve been meaning to try out google cardboard for a while. Here’s a great short tutorial on how to get started with unity and the Google cardboard SDK.
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.
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.