TodayILearned, Work Projects

TIL… Another way that IE is ‘special’

Today I learned another way in which InternetExplorer is ‘special’. One of my team-mates was hunting down a bug in a recent project of ours. A critical link on the page was not working in IE. Strange thing was that Chrome was able to handle it just fine.

Turns out the link had use back-slashes(\) rather than forward-slash(/) after the link protocol. As a result IE was unable to redirect to the next page properly.

The solution was simple enough, swap the \ with / and viola IE is happy again. Oh the joys of milti-browser support 😛

Advertisements
Standard
TodayILearned, Work Projects

TIL… ASP.Net Form Validation Easy-Mode

Today I learned there is an easy-mode for form validation in ASP.NET! I was creating a series of CRUD pages for our in-house admin system, for entering a new data-type. This of course meant adding a new view for creating said data.

I mentioned in passing to a team-mate that there had to be a better way that manually validating every property and providing a response model with an error property for each entry, or worse a generic error list displayed randomly at the top of the page like other parts of the admin tool.

To my delight, there was a better way. ‘Easy-mode’ it actually a decorator called DataAnnotations. Further you can check on the complete Validation-State of the model by called ModelSate.IsValid ( which is MVC magic), and further you can show the set of errors by rendering the summary on the view with Html.ValidationSummary ( which is also MVC magic).

Standard
TodayILearned, Work Projects

TIL… How to debug NHibernate Queries

My Blog has moved! You can find my latest content at daniel.scheufler.io! Please continue reading here.

Today I learned how to debug an NHibernate Query. I was writing a new entity, and map to be accessed thru NHibernate from a SQL datbase. The table had certain fixed-size columns, and I had specified this size in the mpa. However everytime I tried to save, I received a truncation error.

However at the C# level, I couldn’t tell what query was actually being run. I needed to go deeper. Thankfully someone on the team know how to do taht. they pointed me at Sql Profiler which I beleive is installed with either SQL Databse or with the Management Studio. either way, I ran the profiler, so that it would collect all StoredProc and TSQL events, as well as RPCs. This allows you to see the actual SQL query that NHibernate created for your entity. Turns out that NHibernate had mapped the fixed-size string to nvarcahr(4000) rather than nvarchar(10).

Digging deeper, I realized that my migration was the culprit as it had created the columns incorrectly. I had used FluentMigrator initially. This time I went back and wrote the SQL statements by hand so that I could be certain of the data types. Once I created the proper types, and ran NHibernate again the problem was resolved.

Standard
TodayILearned, Work Projects

TIL … How to spoof my domain…

Before we begin today, I want to provide a quick update, as my blog has been inactive for a while. I started a new position in September of last year, right after Harvey force myself and my family out of out apartment. Thankfully all is well, but it has taken some time for me to get back on my feet.

During this absence, I have met many new colleagues, and found several new mentors. One such mentor is Claudio Lassala. to say the least he is impressive. And among the things I have learned from him is a better way to find blog-post topics and a new form in which to show them. I am going to give this new form a try for a while in my ‘Today I Learned…’ series going forward. If you are interested in seeing his execution, he keeps a blog full of excellent resources here: https://lassala.net/

Without further ado, Today I learned how to spoof my domain, so that third-party(s)  will trust my test environment. I was working on integrating a third-party script for product reviews. But during my testing,  I found the node never loaded. Peeking into the dev-tools I saw the reason.

The third-party response indicated that localtest.me was not configured in their system. This made some sense, given I was using a pre-compiled script from my client. It appeared that needed to convince the third-party API that I was in fact part of my client’s network.

After some searching and instruction by senior team members, I found a solution. I needed to add a hostfile entry for test.{clientComain}.com. Then I had to add an IIS bind to my test site so it would response to test.{clientDomain}.com. Run the app again, and viola! It works like magic.

I hope you found this quick summary to be helpful.  If you are having trouble finding your hostfile. I found mine in C:\Windows\System32\drivers\etc. Be warned, I do not know the full implications of editing the Hostfile. Beyond here be dragons.

Standard
Perspective

ROI of Training

What kind of investments do you make? Do you favor immediate returns on investment? Or do you favor guaranteed returns? How long are you willing to wait? Time spent in training or practice is equal to making an investment. Different methods or focuses produce different results.

Much of the training available in the software industry focuses on new frameworks. With a myriad to choose from, there is no shortage. There are many introductory courses. All encourage picking up the tool and applying it to basic problems. Yet these frameworks are subject to change. Two years down the line the framework will change. Sometimes in two years it can become obsolete. In other cases, it becomes an industry standard.

All in all, these skills degrade. Some of the degradation comes from market changes. Lack of practice also contributes to the decay. How often do you truly use that obscure array access format in language so-and-so? Rarely, for most of us. Yet there is a class of training and investments that are less likely to degrade: People skills.

People skills are usually presented in management or leadership courses. They are an investment class of their own. The opportunities to practice people skills are vastly more numerous. As a result they do not suffer as much ‘lack-of-practice’ degradation. Furthermore, people skills remain in demand for many higher level positions. Want to be a consultant? You need People skills. Want to start your own company? You’re gonna need people skills. But these skills are difficult to acquire. In fact, these skills are in high demand precisely because they are difficult to acquire.

People skills are also applicable across industries, if you ever wanted to move. The skills of a software developer carry over any industry we develop for. Much the same way, the core skills of a manager translate well across industries. As career capital, they pay large dividends.

The best investment for anyone strong depends on what they want from life? I enjoy the challenge and rewards of programming. But I am interested in the role of management, and in its unique challenges. With an eye to the future, people skills appear to be the best investment. The skills suffer less degradation with time, and have remained in demand over the long haul. What do you value in your investments? Do you want to expert in technologies? Or do you want to diversify? Hopefully this perspective provides another lens for reflections.

Standard
Perspective, Software Development

What are you looking for in your interview?

What’s the point of an interview? Before you jump to an answer, do you give your candidate’s coding tests? Some white-board challenges? Have you ever wondered why? Do you think it’s the best way? Recently I’ve encountered opinions that counter the traditional wisdom filtering candidates. Interviewing.io shared data that shows LinkedIn Endorsements don’t correlate to a candidate’s actual skill.

Recently, respected programmers have taken to Twitter to ‘confess their programming sins’. This prompted a discussion on the technical interview questions by The Outline. There is even a small industry to prepare candidates for Whiteboard Challenges. In the end, the hubbub about Whiteboard challenges comes from the fact we are using them wrong.

We interview this way because Employers need to feel comfortable about a candidate. For Software, this means verifying the skills of the candidate. And to a lesser extend verifying their ability to communicate. This sums up the entire purpose of an interview.

But what does my answer to a whiteboard challenge actually mean? Is there such a thing as a ‘correct’ response? At a deeper level, does my answer truly reflect my skills as a developer? I say it does not. It does not reflect your skills, unless you are referring to the ability to communicate/reason by drawing boxes and lines.

Don’t get me wrong though. The ability to present your designs on a whiteboard is a useful skill. But it is not the skill that an employer wants to check. Unfortunately, there isn’t a good way to measure some of the skills without seeing actual work. ‘Take-home tests’ in the interviewee’s preferred language are much more useful. Whiteboard challenges do not demonstrate the same skills.

That is not to say you should toss out Whiteboard challenges . What we need is to change our thinking. Whiteboard challenges may not show an interviewee’s ‘coding’ skills. But they do show the manner in which an interviewee thinks. If you ask someone to write out an algorithm on a whiteboard, you will see how they think about the algorithm. You will see how they remember it. If you ask them to create a new algorithm, something unique, you can learn how they explore a new problem. You’ll see what details they pay attention to. Moreover, you can introduce new requirements after they get started. This reveals how they will adapt.

All these insights are useful to know. But they are far less tangible/measurable. As with most hard to measure qualities, we tend to fail at measuring them. As a result, the tools created to measure them begin to be mis-used or mis-applied to find other tidbits. It ends up like using a fork to eat soup. It’s not very effective and wears you and your server out trying to get anything done.

So, if an interview is about revealing the skills of the interviewee, then we need technical interview questions. But using Whiteboard challenges still provides some benefits. But we cannot use whiteboard challenges as a litmus for programming skills. Instead, we should use them to pose unusual challenges which expose the way the interviewee thinks. This new form can also reveal how interviewees adapt to adversity. Those insights combined with more traditional evaluations will help businesses to find stronger, more suitable candidates. These candidates will be stronger not merely from a technical perspective but also from a cultural one. All it takes is using the tool for its proper purpose.

Standard
Perspective

Dungeons and Dragons and Leadership Training?

‘Roll Initiative!’ – A common call to arms in Dungeons and Dragons. I will freely admit; I still play on occasion with some of my college buddies. But this week during some quiet reflection a strange idea dawned on me. You could use DnD to practice a different forms of leadership.

Now of course, pretending to be someone else is part and parcel for role-playing in general. But I specifically thought in terms of business. If you do a quick search for Software Development managers, you can find a variety of ideas on the topic. These include books like Peopleware. There are also in-depth discussions on topics such as ‘Sovereign Software Development’[here and here]. Nearly all mention the short-comings of management practices. Nearly all offer various ways around it. One weakness that I’ve found mentioned a handful of times is the way in which a manager leads their team.

In a standard manager-employee relationship, the manager has authority through their title. This authority allows them to direct employees. This template can be made more complex with additional layers, or by cross-reporting to different people; all of which serve to confuse the issue and can lead to other troubles. Other models exist and the community likes discussing them. Many follow the pattern of servant leadership. Here the manager governs not by title-given authority. Instead managers govern by consensus, or by authority awarded them by the people they serve. Both of these increase the autonomy of the developers relative to their managers.

But that very idea can be daunting and even frightening to a manager used to the traditional role. And this is where DnD comes in. I’ve seen several situations in which a player’s out-of-game personality bleeds into their character. It can be quite a trick to wholly separate your thoughts from your characters. But in this case, that blurred line could be useful. If a manager encountered a mock-leadership situation, they could practice their methods. DnD offers an excellent environment for this activity.

To take a personal example, I wind up being the de facto leader in my player group. Generally, I will suggest an idea for our group, and ask for input. And usually the group says, ‘Sounds good.’ And that is that. Lately, I’ve been worried that I am unintentionally killing their creativity by proposing my own solution rapidly after being presented the challenge. I plan to try ask for input first this time. I can then propose my ideas as a modification to the ideas. I will try this next game and see if the results are more enjoyable for all of us.

By taking a bit of the real-world within me into the game I can see how I could take a bit of the game back into the real world. Just because it is a game, doesn’t mean the lessons we learn in it are inapplicable to our work in the real world. Perhaps it’s time to roll some dice?

Standard