Wednesday, December 14, 2016
Sunday, September 13, 2015
HackHands Review
Initial Sign Up
Experience
Conclusion
Thursday, November 21, 2013
9 Killer Questions to Ask an Interviewer
- How would you describe the general culture of the company and the workplace?
- Personalities at a company are important. If you don't like your co-workers and how management treats their employees, going to work will be painful.
- Why did you choose this company?
- This is a good, subtle question. Does the interviewer pause, or answer quickly? Are they enthusiastic/passionate about the answer, or does it take them a while to fumble through an answer? If they have to think long and hard to come up with something good about their company, this can be a red flag. If you've ever worked at a company you were passionate about, you will be able to answer this quickly.
- Will there be any form of training provided?
- With diminishing training budgets, its nice to work for a company that provides more than a log in to a site that provides Word and Excel training videos.
- What are some of the biggest challenges/successes facing the department currently?
- This will help you understand the culture and see where you might face some hurdles in the future.
- What process will be used to evaluate my employee performance?
- It's good to know up-front, how you will be graded on performance
- Who will be my direct supervisor?
- Are there many opportunities for professional development within the company?
- Again, training and being able to work with new technologies may be important to you.
- What is the usual time frame for making the hiring decision?
- Everyone should ask this to show interest in the position and let them know you may be on the market for a limited time.
- May I contact you if any further questions arise?
- It's good to follow up and try to remember the names of key people.
- What causes you the MOST frustration within the company?
- Try to find out where your future frustrations are going to come from and is it acceptable to you?
- If you could change 1 thing in the company (that would not cost a lot), what would it be?
- Try to gauge how happy their current employees are.
- Can you describe an advantage to working for this company that you have NOT had at previous employers?
- Again, the employee of a good company can quickly rattle off a few things.
- As close as possible, describe the "perfect" personality traits of a candidate you would like to hire.
- This question will help you determine their expectations for you.
- Describe some of the personal traits of former [or current] employees that you do not like.
- This one will 'really' let you know what their pet peeves are and help you determine what they really want in an employee. If they mention they hate 'clock watchers' or they don't like to 'hand hold' people through learning, that "could" be some clues to issues they have had with previous employees that they will be sensitive to.
Wednesday, October 2, 2013
Developer Take Aways from Monster and CareerBuilder Access
I've had this posting in a Word document for a while, and finally, I'm getting around to publishing it. A while ago, I was involved in the searching and recruiting of a new developer for our group. We were given access to Monster and Careerbuilder to facilitate the search since our HR department had no clue how to sort out all the skills we were looking for.
Friday, May 31, 2013
Fixing CORS issue in Web API: "Origin is not allowed by Access-Control-Allow-Origin"
This problem should be resolved in .NET Framework 5 and I've found several articles on how to incorporate "Nightly ASP.NET Build" feature into your existing Web API service. I'm not really comfortable with that and it can be hard to get it working properly.
All you have to do to fix this issue is add a few lines to your web.config under the system.webServer:
1: <system.webServer>
2: <httpProtocol>
3: <customHeaders>
4: <add name="Access-Control-Allow-Origin" value="*"/>
5: </customHeaders>
6: </httpProtocol>
7: <system.webServer>
Wednesday, February 27, 2013
DNN Manage Button Hidden Behind Another Module
The issue I have now is slightly different. I've written several modules that either:
- Do not display anything in the View (they work in the background), but you still need to access the Settings to make changes
- Do not display anything in the View if there is no data
I've come up with a simple fix for this that I include in my View.ascx file:
<% if(DotNetNuke.Common.Globals.IsEditMode()) { %>
<div runat="server" id="showIfEditMode" >
<br />
<br />
<br />
</div>
<% } %>
This adds some padding below the module when you are in Edit mode. That way, your Manage button will be visible even when there is nothing to display.
Monday, February 11, 2013
Sorting ArrayList with Linq
I needed a list of user to populate a DropDownList. In DotNetNuke, you can get an ArrayList of all users on the system with a call to: UserController.GetUsers(int PortalID).
The problem is the list is sorted by UserID, so when you open the DDL, you'll see all the users in what seems to be random order. I wanted the list to be sorted by LastName, FirstName without having to write some sort of IComparer.
This is a great use case for Linq ( I've heard a lot about it, but never used it).
ArrayList a = UserController.GetUsers(0);
var so = from UserInfo s in a orderby s.LastName,s.FirstName select s;
ddlUser.DataSource = so;
ddlUser.DataValueField = "UserID"; // Alias Name from Sproc
ddlUser.DataTextField = "DisplayName"; // Alias name from sproc
ddlUser.DataBind();
ddlUser.Items.Insert(0, new ListItem("Select One", "0")); // Adds items to DDL
If you are using a custom object (ie UserInfo), then you must explicitly declare the type.
When using LINQ to query non-generic IEnumerable collections such as ArrayList, you must explicitly declare the type of the range variable to reflect the specific type of the objects in the collection.
Wednesday, August 15, 2012
asp.NET Password Requirements
- Password Length
- Character Types
- Password Complexity
- Password History
- Encryption
- Attempts
<membership>
<providers>
<add
name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, ..."
connectionStringName="LocalSqlServer"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
applicationName="/"
requiresUniqueEmail="false"
passwordFormat="Hashed"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="1"
passwordAttemptWindow="10"
passwordStrengthRegularExpression=""
/>
</providers>
</membership>
To control the password complexity, you'll need to set the "passwordStrengthRegularExpression" under the "AspNetSqlMembershipProvider".
I'm not great with Regular Expressions, so I turned to StackOverflow for the following password requirements:
- At least 8 Characters (up to 100)
- Must have 3 of the 4 character types (Upper, Lower, Number, Symbol)
(?=^[^\s]{8,100}$)((?=.*?\d)(?=.*?[A-Z])(?=.*?[a-z])|(?=.*?\d)(?=.*?[^\w\d\s])(?=.*?[a-z])|(?=.*?[^\w\d\s])(?=.*?[A-Z])(?=.*?[a-z])|(?=.*?\d)(?=.*?[A-Z])(?=.*?[^\w\d\s]))^.*
An explanation of individual components:
• (?=^[^\s]{8,100}$) - contain between 8 and 100 non-whitespace characters
• (?=.*?\d) - contains 1 numeric
• (?=.*?[A-Z]) - contains 1 uppercase character
• (?=.*?[a-z]) - contains 1 lowercase character
• (?=.*?[^\w\d\s]) - contains 1 symbol
Notice after the length segment the double parens and later in the expression you'll see several
's. This allows for the either/or comparison of the 4 possible combinations that are allowed.
Also, check out RAD Regex Designer, for a FREE tool to test your Regular Expression!
Monday, July 16, 2012
Finding Duplicates in MS SQL Server
SELECT a.[dr_id]
,a.[sch_type]
,COUNT(*) as '# records'
FROM [LZ].[dbo].[lz_src_address1] a
where a.sch_type = '23'
group by a.dr_id, a.sch_type
having COUNT(*) > 1
You only include the fields that you need to determine if its a duplicate and put them in the GROUP BY clausing. the HAVING clause tells you if there is more than 1 record.
There are several ways to delete duplicates. They way you choose will depend on if you have a unique key for each row. If so, you can delete them with a single statement. If not, you may need to use a cursor and/or temp tables.
Friday, June 29, 2012
MS SQL UPDATE with a JOIN
In this example, I am updating the [aspnet_Membership] table, but I want to join the [aspnet_Users] table so I can do it user UserName. This script allows me to set the password of a user to my password so I can log in as that user. This is done by updating the ASP.NET Membership table. I would need to store the [Password] and [PasswordSalt] of this account if I wanted to change it back.
UPDATE m
SET m.[Password] = 'mrhLMUfIWCuTHDwOtm1s/I9ABMQsS=='
, m.[PasswordSalt] = 'suyp+Nsd2lmMPpQ=='
FROM [dnnDB].[dbo].[aspnet_Membership] m
JOIN [dnnDB].[dbo].[aspnet_Users] u on m.UserId = u.UserId
WHERE 1=1
AND u.UserName in
(
'FirstUser'
, 'SecondUser'
, 'ThirdUser'
)
Wednesday, March 14, 2012
View the Contents of a DataTable or DataView While Debugging
The Visual Studio debugger comes with four standard visualizers. These are the text, HTML, and XML visualizers, all of which work on string objects, and the dataset visualizer, which works for DataSet, DataView, and DataTable objects.
To use it, break into your code, mouse over your DataSet, expand the quick watch, view the Tables, expand that, then view Table[0] (for example). You will see something like {Table1} in the quick watch, but notice that there is also a magnifying glass icon. Click on that icon and your DataTable will open up in a grid view.
Friday, March 9, 2012
ASPX Hyperlinks: Opening automatically and in New Windows
1. Opening a Hyperlink in a new window:
ASPX
<asp:HyperLink ID="jiraLink"
runat="server"> Click here to Expand Window </asp:HyperLink>
Code-behind:
String jiraURL = "http://" + jiraServerURL +"/jira/secure/IssueNavigator.jspa?sId=" + sessionGUID;
jiraLink.NavigateUrl = jiraURL;
jiraLink.Target = "_blank";
And, to automatically open a Hyperlink, put this in the Page_Load:
Response.Write("<script type='text/javascript'>window.open('" + serverURL+ "','_blank');</script>");
Tuesday, February 28, 2012
DotNetNuke Update Custom Profile fields
You may need to make sure the custom property you have created is marked Visible, but this is the code that ended up working for me in DNN 6.1.2.
UserInfo _currentUser = DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo();
// Create Tokenstring sessionGuid = TokenLibrary.TokenSupport.CreateToken(_currentUser).ToString();if (sessionGuid == null || (sessionGuid.Trim().Length < 1 )
sessionGuid = "00000000-0000-0000-0000-000000000000";// Set User Property called "sessionGUID"_currentUser.Profile.SetProfileProperty("sessionGUID", sessionGuid);UserController.UpdateUser(_currentUser.PortalID, _currentUser);
Tuesday, January 31, 2012
Bulk File Renaming Utility
This utility is GUI based, but the link above is the command-line version. I also highly recommend you download the manual to see all the features it has.
When you download the command line version, it is called BRC64.exe ( and they have a 32bit version). I just dropped this into the Windows system directory so its available from the command line no matter what directory I am in.
If you type: BRC64.exe /? , you will get all the command line options.
The main concept is if you run the command with the options, it WILL NOT MODIFY the filenames until you add the /EXECUTE option. So, you can play around with all the options and it will show you what WOULD HAPPEN, then you add /EXECUTE to make it happen.
Examples:
-- This will insert ACME in front of all .X01 files, then remove the .X01 and add .txt as the suffix
brc64.exe /PATTERN:*.X01 /INSERT:ACME-:0 /REMOVEEXT /SUFFIX:.txt /EXECUTE
-- This will replace 2012 with 2011 in all .txt file and change .txt to .asc
brc64.exe /PATTERN:*.txt /REPLACECI:2012:2011 /REMOVEEXT /SUFFIX:.asc /EXECUTE
There are a lot more features, but you get the idea. Just remember, it WILL NOT perform the rename until you add the /EXECUTE, so you can experiment all day.
Thursday, October 27, 2011
Grails 2.0 SQL Server Configuration
Here are the quick steps:
1. Install JDK/JRE (I used 1.6.latest)
2. Unzip Grails 2.0RC1 to an C:\grails2rc1\ directory
3. Create environment variables for JAVA_HOME(point to jdk install)
4. Create environment variables for GRAILS_HOME(point to grails directory)
5. Add the following to PATH environment variable: ";%JAVA_HOME%\bin;%GRAILS_HOME%\bin"
6. Test that you can call "javac" and "grails --help" from C:\
7. Create a database for grails from Management Studio
8. Create a user/pass and give it access to this database(I usually give it dbo and sysadmin during the initial install phase. You should dial it back after that)
9. ** TRICK ** Make sure TCP/IP is ENABLED using SQL Server Configuration Manager, under SQL Server Network Configuration -> Protocols for MSSQLSERVER
10. Create a directory for your app (C:\work\apps)
11. Open a command prompt and "cd" to that directory
12. "grails create-app myapp" (This creates the Grails structure)
13. Download the latest jTDS Driver and extract the files to a temp directory
14. Copy the jtds-1.2.x.jar file to the directory C:\mayapp\lib
15. Your conf/DataSource.groovy should look something like this:
dataSource {
pooled = true
driverClassName = "net.sourceforge.jtds.jdbc.Driver"
dialect = "org.hibernate.dialect.SQLServerDialect"
}
... other stuff
development {
dataSource {
dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', ''
url = "jdbc:jtds:sqlserver://127.0.0.1:1433;databaseName=grails2rc1"
username = "grailsadmin"
password = "your-Pass123"
// logSql=true
}
}
... more
16. Create your 1st controller: "grails create-controller dashboard"
17. Save, then run "grails run-app"
Tuesday, May 24, 2011
Backing Up SQL Database to Network Drive - Operating system error 5(Access is denied)
I ran into this issue the other day while trying to run a backup and store it on a network drive. At first, I thought it was a file permissions issue so I checked in the Security Settings and Audit logs, but no matter what permissions I changed, it still did not work.
The issue ended up being that the account that the SQL Server service runs under needs to be a Domain account and have the proper permissions. There was also a few other configuration issues I stumbled across.
1. Local Security Policy: Under the Local Security Policy(or Group Policy), there is a policy called "Lock pages in memory" and this needs to be enabled for the domain service account that will be used for the SQL Server service (I also changed the SQL Agent service).
2. The next steps were to allow us to reconfigure SQL Server and allow the SQL Agent to run as domain account:
sp_configure 'show advanced options', 1;RECONFIGURE;sp_configure 'awe enabled', 1RECONFIGURE;sp_configure 'show advanced options', 1;RECONFIGURE;sp_configure 'Agent XPs', 1;RECONFIGUREsp_configure 'show advanced options', 0;RECONFIGURE3. Change your SQL Server Service and SQL Agent service Logon account to a domain account with privileges on the network drive.
Open Services -> Choose the Service -> Logon tab -> Choose "This Account" and enter DOMAIN\ACCT and enter the password.
Friday, March 25, 2011
Scheduled Task Not Running a Batch Job
I've recently ran into this several times, so I'm thought I'd document it here.
I've created batch jobs (.bat) that do various things, like copy, move, delete files, download stuff from SFTP servers, etc. In the past, I've just used my credentials to run these jobs, but if I changed my password, the jobs would fail. Now, our IT department created a service account for me to Schedule these tasks, but I've had many issues with Scheduled Tasks not working once I changed the credentials to the service account.
The scheduled task will not show an error code, it just won't work or it will be stuck in a "running" state.
Here is what I have found out:
1. The service account should be a local admin
2. Delete your old Scheduled Task
3. Log onto the server using the service account credentials
4. Re-Create the Scheduled Task while logged on as the service account and use the service account credentials
This applies to Scheduled Tasks that run a .BAT file. All my other scheduled tasks work normally.
Tuesday, February 15, 2011
Migrating users to DotNetNuke
While browsing Mitchel Sellers' blog, I found some SQL that allows me to migrate the 700+ user accounts in our MojoPortal to DotNetNuke. I've put it in a script and parametized it.
After I created this, I created a table from my old MojoPortal, which contains: UserName, FirstName, LastName, DisplayName, Email, and RoleName (Primary Role, which must exist in DNN before running the script). Then, I ran it through a cursor and added all the users.
** ADDITION NOTE: If you are using {owner}{prefix} in DNN, you'll need to modify the script.
-- =======================================================================================================-- Author: Larry Eisenstein-- Create date: 2/15/2011-- Description: Creates a DNN User by copying an existing user.-- This can be used to script a single account creation or migrating users from another system.-- This works by creating the NewUser from an existing user.-- The script was pulled from Mitchel Sellers website. He has a great blog, so you should visit it.-- http://www.mitchelsellers.com/blogs/articletype/articleview/articleid/84/creating-a-standard-dotnetnuke-user-via-sql.aspx-- -- -- Req: -- 1. Know the Username/Password of an existing user. The password for the user you create will be the password -- of this user-- 2. If you are assigning Roles, the RoleName MUST existing in the DotNetNuke site-- -- Defaults: I set up some defaults, but these can be changed via params or just change the defaults in the script.-- -- Notes: -- Stored Procs used: aspnet_Membership_CreateUser-- Tables Updated: users, Roles, UserPortals-- The password works by copying the encrypted password, passwordsalt of the ExistingUser to your new user. Then, you can-- just login with that user's password.-- ==========================================================================================================CREATE PROCEDURE [dbo].[AAA_MigrateUser_sp]
@ApplicationName varchar(255) = 'DotNetNuke', -- Search for applicationName in your web.config
@ExistingUserName varchar(255) = 'TestUser', -- This must be an existing DNN user
@FirstName varchar(255) = 'Migrated',
@LastName varchar(255) = 'UserAccount',
@DisplayName varchar(255) = 'Migrated UserAccount',
@NewUserName varchar(255),@RoleName varchar(255) = 'Registered Users',
@PortalId int = 0,@Email nvarchar(256) = 'TestUser@email.org'ASBEGINDECLARE @PasswordQuestion varchar(256),
@PasswordAnswer varchar(256),@Pw varchar(255),@PasswordSalt varchar(255),@PasswordFormat int,@IsApproved bit,@CurrentTimeUtc datetime,
@CreateDate datetime,
@UniqueEmail int,@UserId uniqueidentifier,
@DNNUserId int,@NumUsers intSELECT @PasswordQuestion = '',
@PasswordAnswer = '',@IsApproved = 1,
@CurrentTimeUtc = GETDATE(),
@CreateDate = @CurrentTimeUtc,
@UniqueEmail = 0
SELECT @NumUsers = COUNT(*)
FROM aspnet_UsersWHERE UserName = @NewUserNameIF(@NumUsers != 0)return -1SELECT @Pw = m.password,@PasswordSalt = m.passwordsalt,
@PasswordFormat = m.passwordformat
FROM aspnet_users uINNER JOIN aspnet_membership m ON (u.userid = m.userid)
WHERE u.UserName = @ExistingUserName-- Make the stored procedure callEXEC dbo.aspnet_Membership_CreateUser @ApplicationName, @NewUserName, @Pw,@PasswordSalt, @email, @passwordquestion, @PasswordAnswer,
@IsApproved, @CurrentTimeUtc, @CreateDate, @UniqueEmail,
@PasswordFormat, @UserId
-- Insert the record into the DotNetNuke users tableINSERT INTO users (Username, FirstName, LastName, IsSuperUser, Email,
DisplayName, UpdatePassword)
VALUES(@NewUserName, @FirstName, @LastName, 0, @Email, @DisplayName, 0)-- Get the new userid, from the DNN users tableSELECT @dnnuserid = useridFROM UsersWHERE username = @NewUserName-- Now, insert the record into the user portals tableINSERT INTO UserPortals (userId, PortalId, CreatedDate)
VALUES(@dnnuserid, @PortalId, GETDATE()) -- Now Give the user permissions to the User Group you specifiedIF(@RoleName != 'Registered Users' and @RoleName IS NOT NULL)
BEGININSERT INTO UserRoles (userId, roleId)
SELECT @dnnuserid,roleId
FROM RolesWHERE RoleName = @RoleNameEND-- Now Give the user permissions to the REGISTERED Users groupINSERT INTO UserRoles (userId, roleId)
SELECT @dnnuserid,roleId
FROM RolesWHERE RoleName = 'Registered Users'
ENDTuesday, December 14, 2010
Outlook 2007 Tip: Color Code Messages
The work around for me was to create a 'Custom Flag' with a 'Due Date' in the past. This will turn the text of the email in the Inbox view to Red.
You can also set up some Advance Formatting Rules to change the Font(color, size, underline, bold) based on the Category, but this takes some time. Here is the link for that: http://www.howto-outlook.com/howto/coloremailadvanced.htm
Here is a sample of what it looks like:
Monday, November 29, 2010
@schedule_uid is not a parameter for procedure sp_add_jobschedule
Msg 8145, Level 16, State 1, Procedure sp_add_jobschedule, Line 0
@schedule_uid is not a parameter for procedure sp_add_jobscheduleThe problem is that the parameters for the stored procedure, sp_add_jobschedule, have changed from SQL2005 to SQL2008, so you need to change the script to match.
- SQL 2005 uses @schedule_id (an integer) and SQL 2008 uses @schedule_uid (a uniqueidentifier)
- All you have to do is change the parameter name and data-type to the correct value
If it's @schedule_uid, change it to @schedule_id.
Then, find an un-used integer value in: select * from sysjobschedules (MSDB database)
- If you are going the other way, you can change the parameter to @schedule_uid, then create a new
uniqueidentifier by running: select newid()
