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

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

Addendum: Keep Going In Spite of Rejection

I am listening to to Writing Excuses podcast, and they just said something that I really wanted to add to follow up the post I made on failure.

“There is no easy way. This is so much harder than you think it is going to be. Do it anyway because it is so much better than you dream.”

– Howard Tayler.

“Rejection is not negative-validation. You should not be requiring external validation to continue working on your craft. Keep writing. Those things you are tempted to see as negative validation will happen throughout your professional career, and if you can’t write while this is happening, you will have a problem. Learn how to keep writing.”

– Brandon Sanderson

On Quora I have been seeing some negative comments on the likelihood of becoming a web developer in mid-career.  While that may be true, I am going to take these writing quotes and apply them to everything. I know I crave too much validation (I have been compared to Rarity, I’ll let you Google that one.) I want people to say my art is pretty and my story is cute and pat my head over the tiniest thing. No one but your mother will do that in the real world (though, on the Internet you can surround yourself with a circle of people who always like your work, but that’s just a bubble).

Anything worth doing is going to be hard – right at the beginning of Eloquent Javascript it points out the difficulty of the journey. As David says in 2 Samuel 24:24 you can’t offer up something that costs you nothing and expect to reap blessings from it.

Everything takes hard work.

Living in a State of Failure

That may sound like a very depressing title, but keep reading.

I’ve been listening to Code Newbie podcast, especially Episode 60, Impostor Syndrome (an interview with Alicia Liu). I, according to the episode, really don’t have Impostor Syndrome. Few people do. She’s pointed out that it has become a buzzword. Right now my feelings of “code inadequacy” are not from any syndrome, they are from learning new stuff. Of course I am not good at new stuff, I am still struggling to learn it!

That being said, I do wonder if “this is the right thing to pursue”. Alicia Liu does touch on this, that while coding is the new hotness, it really isn’t for everyone. The thing she said that resonated with me, is that coding as a job is (paraphrase mine) living in a state of failure. Nothing you code is going to work right the first time. I think it’s good to know this going in. I am kind of a perfectionist. I don’t like failing. I don’t like error messages. When I was a full time technical editor/writer my goal was to comb every document so well that the QA department wouldn’t find anything to bleed red ink on. But, after years, I finally realized that when someone marks everything you did up and changes it, it really isn’t personal. A second set of eyes is always going to see things to change, or point out how they would have done something differently. I’m still learning this, honestly, it’s hard to get it to sink in. But I’m hoping that this will help me for code reviews in the future. Knowing that your ugly code is being changed, not because you are a failure, but because that’s part of the process, and that you’ll get better with time. The code is still going to get thrown out, but it isn’t a personal attack.

What do you think?

Odin and Cold Turkey and Focus

Mt Rushmore
Mt Rushmore Looks Just Like I Expected

Well I haven’t blogged for a long time, and for this I apologize! In September I took some vacation time and went to South Dakota. It was gorgeous, and the weather was amazing! (I also went to Salt Lake City Comic Con.) But I’m not going to turn this into a “someone else’s boring vacation photos blog”.

I also have been, in October, participating in Inktober. Participants create (or are supposed to create) an original ink drawing every day in October. I didn’t manage to do all the days, but I had a good time anyway. If you want to see more of my art let me know in the comments.

Prince or Frog?
Prince or Frog?

 

 

 

 

 

 

 

 

I spent a few days re-evaluating my study path. I’ve been frustrated by Udacity and have canceled my subscription (at least for the time being). In the interim I’ve discovered The Odin Project.

The thing it offers (and Udacity also offered this) is a plan. I must face that you can’t learn an appreciable amount of web development skills just by noodling around taking online tutorials. I really need a path and a plan. I just don’t have self discipline. I’m sure some people have learned this way, but it doesn’t work for me.

Another useful thing I have discovered is Cold Turkey. It’s a program that helps you focus on what you are doing, and not spend all day reading random things on Twitter and Wikipedia. (Oh yeah, that focus and plan thing.) I’ll let you know how it is working.

A final kick-in-the-pants motivation tool is basically everything Shawn Blanc ever wrote. He has a course on living a focused life. I haven’t taken it, yet, but I get his motivational e-mails, and they are always full of passion and challenge! You may enjoy them too.

Game Development, JavaScript, and Persistence

Well, this week I have been taking a break from my Udacity project (in a sense) by strengthening my JavaScript and HTML5 Canvas understanding before going back to tackle FEND “Project 3: Frogger Clone”.  Here is some information that has been helping me:

Zenva has a class on making an HTML5 game from scratch. The instructor is fantastic and goes over every line of code. I highly recommend this.

After that course, I went back to my Project 3, and felt I understood a bit more of the direction I should take it. But my core knowledge of JavaScript is still lacking, and I didn’t know how to actually get from point a to point b. Currently I am working my way through Eloquent JavaScript by Marijn Haverbeke, seriously this time, taking notes, working through the exercises in the provided code sandbox.

As I am working through Eloquent Javascript, sometimes I have been hunting up further resources to explain the things in it. For this I am greatly indebted to JavaScript Is Sexy.com  even if the name makes me die a little bit inside.  Get a load of this explanation of Variable Scope!

This week I have discovered a really great podcast, too! It’s called Lostcast by Lost Decade Games and is all about game development. It’s from a very realistic perspective, unlike some of the other podcasts I’ve found.  You can join their forum too, they are great guys. They have encouraged me greatly with art tips.

Lately I’ve felt like I’ve had to concentrate on studying coding, and leave my art and craft skills to rot on the back burner (…that’s a kind of mixed metaphor). But it sounds like there are plenty of reasons to keep honing both art and coding hobbies together. Thank you Matt Hackett! I also look at Rob Stenzinger, another “coding artist”. Also add The John Su to the list of “coding artists I admire who are far more talented in their sleep than I am while concentrating very hard on something, like coding and art.” It’s a surprisingly long list.

Finally, here is a very informative blog post explaining what an entry-level front end (mostly JavaScript) developer really should understand in order to get a job.

I feel bad that all I do is link you to other people, but all these resources are  really great and I want to pass them along!