Join Todd McLeod for an in-depth discussion in this video Loading all pixels into a data structure, part of Code Clinic: Go.
- So our next step is we're going to do…a little bit more abstraction of our code…just to keep main really lean.…Then we're going to get all the pixel…for all of the images…and then the final thing in this video right here…is that we are going to count all of the pixels.…And so when we count all the pixels…we'll see that we have aggregated together…into a data structure 87, 020, 406 pixels…which is totally amazing to me…that this thing runs in like under 30 seconds…and it get the information, looks at 87,000,000 pixels.…
So how do we do the abstraction?…I've got another little challenge for you.…So this is where we left off,…we were loading an image…and we'd abstracted that out…and you can see here in folder 08main.go…same thing, same code.…I can compare between those two…and funk load image does change at all between those two.…But here in 08, I want to abstract some of this.…So what would you take out?…How would you abstract it?…How would you make it run?…Maybe you want to pause the video at this point.…Go right here to this folder,…
Todd introduces challenges and then provides overviews of his solutions in Go. Challenges include topics such as statistical analysis, searching directories for images, and accessing peripheral devices.
Skill Level Beginner
1. Problem 1—Exploring Lake Pend Oreille
2. Problem 2—Image Analysis
3. Problem 3—Eight Queens
4. Problem 4—Accessing Peripherals
5. Problem 5—Recursion and Directories
6. Problem 6—Building the Web
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.