A Few MVC SQL Tips and Tricks

I have been working with Visual Studio 2015, MVC .NET and MS SQL lately, and ran into several things that I had to keep looking up over and over, so I thought there may be someone else out there in the same boat.

Note: These are all tips for working code-first in Visual Studio.

  1. In your Model, say you want to have a table’s Primary Key auto-increment. Sure you add [Key], but you also need to add this: [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
    auto_increment
  2. Here is a handy snippet you need to add to Global.asax in order to add more than one controller to your project:
    Database.SetInitializer<YourProjectContext>(new DropCreateDatabaseIfModelChanges<YourProjectContext>());
    In my screenshot, the name of my project is IceCream. If you don’t know the name of your project context, it should just be the name of your project with “context” on the end. I know that’s pretty basic, but as a new coder, it sometimes throws me. Global.asax is located at the very bottom of your Solution Explorer.
    if_model_changes

Launch House Game Dev Meetup

I have made and sold art for years and still have a hard time (sometimes) calling myself an Artist. So I feel almost funny being at a game development meetup when I have never even tried to make a game. It isn’t “impostor syndrome” it’s just, I’m not sure if I am passionate about it. Not sure what I bring to the proverbial table. But I am here today, at the Shaker Launch House, with about 10 other people working on their own games. I don’t have a specific game idea to work on, but I brought art supplies and am working through some Unity 3D demos. In fact, I watched a lot of tutorials yesterday on beginning game development, and they said the important thing is to “start making a game out of what you can do” as opposed to “start with a great idea”. If you start with a great story to tell, and it is leagues out of your capacity to tell it, you will get stuck and quit. If you make a game that is just “two dots moving” (or..something), then you can actually finish a thing and then move on to the next one with one complete project under your belt (and experience).

My favorite games are ones with interesting characters and stories, and honestly, most of them are 2D not 3D. (In fact, I still like interactive fiction/text adventures.) But Unity does 2D as well. I should learn 3D since I sculpt and I’d like to see if I can print something in 3D. So many skills overlap!

I’ve always wanted to write and illustrate stories and books – art books? nature books? field guides? story books? I just love books. I did not really think about making games (I feel like all of my friends have always wanted to make games). I’m still not sure it is my platform, but I really want the experience of learning new things. And good games tell stories.

IMG_1158
Launch House Angel?

 

The End of the Beginning

We Can Code IT is officially over, except for the part that isn’t: The career fair, and the actual receiving of the certificate.

So the job search has begun. In addition to preparing for the career fair, where you can do a large amount of job searching at the same time.

I had my first interview today. It was hard, and I learned a lot through it:

  • You will be asked questions that you can’t answer off the top of your head.  This is OK. They want to see you work through the problem.
  • If a recruiter tells you the kind of typical questions, be prepared to answer them. My recruiter was spot on with the questions that were asked. Additional searches online for typical interview questions was also helpful.
  • The interviewer is on your side. They are not trying to make you fail. Even if you are fumbling around and not knowing something, they want to watch you figure it out, instead of freeze up and die.

For what it’s worth, no amount of reading stuff online is really the same as sitting in front of an interviewer.  Neither is any amount of reading stuff online the same as actually coding and solving problems. So make sure to keep your skills sharp, and do a power pose before the interview!

 

Plants and Database Design

I’m still working on my web app, Identiflora. As I work I’m referencing both the National Audubon Society Field Guide to Wildflowers and Newcomb’s Wildflower Guide. Both books mean a lot to me. I remember when my parents gave me the Audubon book as a teen, and it has been trekked around and loved, and dropped in water so I am probably due for a new copy. The Newcomb’s was my friend throughout Plant Taxonomy class in college (my favorite class!), and is still my favorite plant guide.

I am loosely basing my plant site on the questions proposed at the beginning of Newcomb’s key system: Flower shape (simple symmetrical petals? irregular shape? composite like a dandelion?), plant shape (leaves opposite? alternate? whorled?), leaf shape (simple or compound, toothed or divided or entire?).

In order to make an MVC MS SQL relational database of plants that a user can easily navigate, I need to consider these questions (and the answers). It will help me determine where to split up my database for data normalization. If the only options for plant shape are opposite, alternate or whorled, a table with a column of  records reading “opposite/opposite/opposite/whorled/alternate/alternate” is very redundant. This breaks the DRY principle (Don’t Repeat Yourself). Splitting that into a separate table of only those three options (opposite, alternate, whorled), makes the data integrity of the overall database much better.

I’m just a novice at database design; I’m excited to learn as I go!

On the.. What Week Is This? Week of Bootcamp

It has been too many weeks since I updated. Summary: We Can Code IT is both difficult and rewarding.

This code school is experiencing some growing pains, and I’ve benefited by being introduced to a lot of great instructors, as the list of instructors keeps growing: Mel McGee (the CEO of WCCI), Lauren Holloway, Jarryd Huntley, and James M. Allen. We even had a guest presentation by Susie Sharp, and resume coaching by Patti Substelny.

Create! Make things. You will learn so much. And you won’t get it all right the first time, so fail fast and keep going, and getting better. And Make connections.

Now, nearing the end of the course, I am working on both a portfolio page, and a passion project. I’ve talked about the passion project (Identiflora) before. I don’t think the current version is going to look anything like it did in my head – but I will keep improving it in the future, I just need to get a MVP (Minimally Viable Product), as ‘they’ say. Creating something is better than creating nothing!

In fact, that is the first part of my takeaway from this: Create! Make things. You will learn so much. And you won’t get it all right the first time, so fail fast and keep going, and getting better.

The second part is: Make connections. I have made a lot of connections with the coders in my cohort, and the instructors. And there are hackathons and game dev meetups and other coding opportunities around here that I need to get involved in. Anyone who is farther along in the coding journey can help you when you start down that path. They might be able to shave hours off of your coding snarl, or introduce you to someone who needs your help, or someone with a job offer. Coding sounds like an isolated-in-a-basement-drinking-coffee-all-night career, but in reality you can only thrive and progress when you reach out and make connections.

On the Second Week of Code Bootcamp

So, I just completed my second week of immersive full-time code study at We Can {Code} IT. I feel bad for people who have to go work a day job and/or have kids to take care of after school, because I sure don’t have any energy left! Who knew that sitting in a classroom could tire you out so much?

Anyway, I am proud to say that so far I’m keeping up with class. We have been studying all the fundamentals of C# (or basically any other object oriented programming language): loops, arrays, if-then statements, strings, etc.

Having spent a year trying to teach this to myself put me in a good starting position but my “I already get this” moments are just about done. Starting today (that is, this weekend) we were informed that we had better buckle down because it is going to ramp up in difficulty next week.

I’m excited and scared, because I still have issues with my understanding of some of the basics. Well, I understand them, but I still make mistakes with picking the correct loop type to use and placing my statements in the right order to get the result I am after. I am not the quickest in the class, and seeing other people have lightbulb moments before I do is something I am having to deal with. I wish I were 20 years younger!

But things are great so far! I have never had a bad day yet. I’ve had bad moments, but not a whole bad day. Can’t wait for Monday!

When I can’t stand to look at a screen any longer I draw.
Here, have a silver laced Wyandotte.

chicken

We Can {Code} It!

So Friday was my last day at work. Monday, February 29, 2016, I officially begin a three month stint at We Can {Code} It with 15 others in a brand new cohort. Friday, even though I was planning on it for a month, was nothing but tears. Everyone in the office asked if I am excited, and sure, I’m excited, but I’m also scared! I just jumped out of a perfectly good airplane…

cake

On Thanksgiving

 

thanksgiving

I was reflecting a little bit about thankfulness. Usually when you go around the table telling each other what you are thankful for people say “family, food, God, a job”, and those are all great things to be thankful for, but they are kind of surface level things. Then you dig a little deeper, and say you are thankful that you don’t have <disease X> like <person Y> has, or thankful you haven’t gone through <disaster Z>.  Er, no zombies involved. The deeper you think about thankfulness the more it really changes your perspective.

Thankfulness isn’t the same thing as happiness. You can look back on things and be thankful to have gone through them, even when they did not cause you any happiness at the time. Gratitude is such a healthy thing; a thing I need more of. I’m so caught up in complaining! How can I really show joy and complain at the same time? I can’t.

Happy Thanksgiving to all!  I am truly blessed to have so many friends, and a God who has promised to never give you more than you are able to handle, but always provide a way to make it through and do the right thing. (I Cor 10:13)

If you need some thoughtful encouragement in your life, I highly recommend reading Dr. Michael Peck’s Daily Prescriptions. They are always worthwhile.

Fall 2015 Teen Leadership Retreat

I know this isn’t related to what I have been blogging, but there is more to my life than just trying to learn JavaScript.

Two weekends ago my associate pastor and his wife, myself, and two other leaders, took a group of 14 senior-high teens down to Mohican State Park in Loudonville, Ohio, from Friday evening until Sunday morning (returning in time to attend Sunday School – I teach the preschool kids, and I sure was tired!). As a group we hiked Hog’s Hollow, and (most of us) climbed the all the stairs of the 80-foot-high Mohican State Park Firetower. Even I managed to finish the climb this year (last year I couldn’t make it to the top)! Maybe next year I’ll actually remember to take photos.

During this time of food, fellowship, training, and fun, the teens learned something we all need to be reminded of: the importance of setting a good example. It was a leadership retreat, because no matter who we are, to someone else we are a leader. These senior high teens are the ones that the junior high (and younger) children look up to. We reminded them that you may never know how much you are influencing someone else’s actions, and that you must make good decisions because others are watching you for guidance.

While there were plenty of study sessions and free time, the teens also learned the importance of solitude. Each teen had a span of 45 minutes out, alone, away from others, disconnected from phones and ipods, and a questionnaire with hard questions about the future, and what motivates them, and what changes they need to make. These are precious things to do that we rarely take time for in our frenetically connected world.

All in all it was a wonderful trip, and I am excited to see how it impacts these teens in the future as they become the leaders and examples to the other young people in our church youth group – and at home and school.

You’re a leader too. Set a good example.