This blog shares my journey as a software engineer, along with personal reviews and life experiences I’ve gained along the way. “I have not failed. I've just found 10,000 ways that won't work.” — Thomas Edison. If you enjoy my content, please support it by clicking on ads (free for you, big help for me!) or by buying me a coffee on Ko-fi. Thank you!
Friday, December 22, 2017
Merry Christmas to All!
Friday before Christmas 2017, wanted to let all my readers know I wish them a very Merry Christmas and hope Santa brings them there wish list. You must Believe to Receive! Merry Christmas!
C# reminder of the day sealed
When the keyword "sealed" is applied to a class, the sealed modifier prevents other classes from inheriting from it. In the following example, class B inherits from class A, but no class can inherit from class B
Code sample
class A {}
sealed class B : A {}
Source - MSDN
SharePoint 2013 --- I'm Back
Wow, back at developing in SharePoint, who knew...
Well my new co-working SharePoint Kerry, gave me some insight on SharePoint Application Permissions DUH! I an knocking the cobwebs out of my head using SharePoint Again.
Central Admin > Application Management > Select the "App" > On the ribbon User Policy --- *DUH*!
Adding or updating Web application policy with new users or groups will trigger a SharePoint Search crawl over all content covered by that policy. This can reduce search crawl freshness and increase crawl load. Consider using security groups at the policy level and add/remove users from security groups to avoid this.
Thursday, October 26, 2017
AWS - Impressed
Setup a .NET Core Server in < 5 minutes - http://mmwebs-dev.us-east-1.elasticbeanstalk.com/
Try Amazon Music Unlimited 30-Day Free Trial
Try Amazon Music Unlimited 30-Day Free Trial
Monday, July 10, 2017
SQL Server Configuration Manager error: Cannot connect to WMI provider Permission Denied
1. Open CMD as Administrator
2. Change Directory to cd C:\Program Files (x86)\Microsoft SQL Server\110\Shared --- ENTER
3. mofcomp sqlmgmproviderxpsp2up.mof
Try to open SQL Server Configuration Manager ---
CREDIT - https://www.youtube.com/watch?v=SuCUSH0RAVo
Wednesday, June 14, 2017
Perfmon how to resize counter frame at bottom of the window
Workaround:
When Performance Monitor opens, one or more default counters are in the legend pane and only the first is visible. The legend pane is not resizable.
Right click in the legend pane and select Remove All Counters.
Re-add the desired counters and and the legend pane resizes to fit all/most as needed.

Monday, June 05, 2017
JavaScript Refresh Time
There are 7 basic types in JavaScript.
number for numbers of any kind: integer or floating-point.
string for strings. A string may have one more more characters, there’s no separate single-character type.
boolean for true/false.
null for unknown values – a standalone type that has a single value null.
undefined for unassigned values – a standalone type that has a single value undefined.
object for more complex data structures.
symbol for unique identifiers.
The typeof operator allows to see which type is stored in the variable.
Two forms: typeof x or typeof(x).
Returns a string with the name of the type, like "string".
For null returns "object" – that’s the error in the language, it’s not an object in fact.
In the next chapters we’ll concentrate on primitive values and once we’re familiar with that, then we’ll move on to objects.
New great online tool - http://plnkr.co/
Also Must READ!!!!

Tuesday, April 11, 2017
How to catch an error and send via email and log to the server (aka simple text file not event log). (VB.NET)
Catch ex As Exception
'Log to exception table
Dim strError As String
strError = Now().ToString() & "Error: (Class=PromoCode;Method=IsEmailRequired)" &
";" & vbCrLf & "PromoId = " & promoCodeId &
";" & vbCrLf & vbCrLf & "Exception " & ex.ToString()
MiscFunctions.SendExceptionEmail(strError)
MiscFunctions.WriteLogRecord(strError)
myPromoCode = Nothing
Return myPromoCode
End Try
'---------------------------------------------------------------------------
'Description: Email Exception Error
'---------------------------------------------------------------------------
Public Shared Sub SendExceptionEmail(ByVal errorException As String)
Dim myMail As New MailMessage()
myMail.From = New MailAddress("error@domain.com")
myMail.Subject = ConfigurationManager.AppSettings("CoreHTTPPath") & " error exception"
'Create an email from the email addresses in the app.config file
Dim emailTo As String = System.Configuration.ConfigurationManager.AppSettings("AdminEmails").ToString()
Dim strEmailArray() As String
strEmailArray = Split(emailTo, ";")
For Each email As String In strEmailArray
myMail.[To].Add(email)
Next
Dim sb As New StringBuilder()
sb.Append("www.domain.com error exception: " & vbCrLf & vbCrLf)
sb.Append(errorException)
Dim strBody As String = sb.ToString()
myMail.Body = strBody
myMail.IsBodyHtml = False
Dim smtp As New SmtpClient()
Try
smtp.Send(myMail)
myMail = Nothing
Catch ex As System.Exception
WriteLogRecord(Now().ToString() & " Error: (Function Sending errorException) " & ex.ToString)
End Try
End Sub
Public Shared Sub WriteLogRecord(ByVal strErroMsg As String)
Dim objWrite As IO.StreamWriter
Dim strDateTime As String = Now().ToString()
strDateTime = Replace(strDateTime, "/", "-")
strDateTime = Replace(strDateTime, ":", "")
objWrite = IO.File.AppendText(System.Configuration.ConfigurationManager.AppSettings("EmailErrorLogs") & "/EmailErrorLog.log")
objWrite.WriteLine(strErroMsg)
objWrite.Close()
End Sub
'Log to exception table
Dim strError As String
strError = Now().ToString() & "Error: (Class=PromoCode;Method=IsEmailRequired)" &
";" & vbCrLf & "PromoId = " & promoCodeId &
";" & vbCrLf & vbCrLf & "Exception " & ex.ToString()
MiscFunctions.SendExceptionEmail(strError)
MiscFunctions.WriteLogRecord(strError)
myPromoCode = Nothing
Return myPromoCode
End Try
'---------------------------------------------------------------------------
'Description: Email Exception Error
'---------------------------------------------------------------------------
Public Shared Sub SendExceptionEmail(ByVal errorException As String)
Dim myMail As New MailMessage()
myMail.From = New MailAddress("error@domain.com")
myMail.Subject = ConfigurationManager.AppSettings("CoreHTTPPath") & " error exception"
'Create an email from the email addresses in the app.config file
Dim emailTo As String = System.Configuration.ConfigurationManager.AppSettings("AdminEmails").ToString()
Dim strEmailArray() As String
strEmailArray = Split(emailTo, ";")
For Each email As String In strEmailArray
myMail.[To].Add(email)
Next
Dim sb As New StringBuilder()
sb.Append("www.domain.com error exception: " & vbCrLf & vbCrLf)
sb.Append(errorException)
Dim strBody As String = sb.ToString()
myMail.Body = strBody
myMail.IsBodyHtml = False
Dim smtp As New SmtpClient()
Try
smtp.Send(myMail)
myMail = Nothing
Catch ex As System.Exception
WriteLogRecord(Now().ToString() & " Error: (Function Sending errorException) " & ex.ToString)
End Try
End Sub
Public Shared Sub WriteLogRecord(ByVal strErroMsg As String)
Dim objWrite As IO.StreamWriter
Dim strDateTime As String = Now().ToString()
strDateTime = Replace(strDateTime, "/", "-")
strDateTime = Replace(strDateTime, ":", "")
objWrite = IO.File.AppendText(System.Configuration.ConfigurationManager.AppSettings("EmailErrorLogs") & "/EmailErrorLog.log")
objWrite.WriteLine(strErroMsg)
objWrite.Close()
End Sub
Thursday, February 23, 2017
Count Columns in Table in SQL Server
SELECT COUNT(COLUMN_NAME)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_CATALOG = 'DbName' AND TABLE_SCHEMA = 'dbo'
AND TABLE_NAME = 'TableName'
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_CATALOG = 'DbName' AND TABLE_SCHEMA = 'dbo'
AND TABLE_NAME = 'TableName'
Thursday, February 16, 2017
IIS App Pool Recycle Logs
If you need to view information about application pool recycle set a custom view in Windows Event Viewer.
1. Start Search Event Viewer
2. Select Custom Views > Actions: Create Custom View
3. Logged what ever time you need
4. Select all event levels
5. By Source (WAS) Very Important
Click OK.
1. Start Search Event Viewer
2. Select Custom Views > Actions: Create Custom View
3. Logged what ever time you need
4. Select all event levels
5. By Source (WAS) Very Important
Click OK.
Thursday, February 02, 2017
SQL Tips
http://sqlhints.com/2012/05/03/how-to-set-default-database-in-sql-server-mangement-studio-a-time-saving-tip/
Great new site I found above.
Captain SQL Jason also taught this old dawg some new tricks. He told me I am not allowed to share them. They help us Veterans in the field keep our jobs. :)
Great new site I found above.
Captain SQL Jason also taught this old dawg some new tricks. He told me I am not allowed to share them. They help us Veterans in the field keep our jobs. :)
Monday, October 17, 2016
Regular Expressions
To match a string that contains only those characters (or an empty string), try
"^[a-zA-Z0-9_]*$"
This works for .NET regular expressions, and probably a lot of other languages as well.
Breaking it down:
^ : start of string
[ : beginning of character group
a-z : any lowercase letter
A-Z : any uppercase letter
0-9 : any digit
_ : underscore
] : end of character group
* : zero or more of the given characters
$ : end of string
If you don't want to allow empty strings, use + instead of *.
EDIT As others have pointed out, some regex languages have a shorthand form for
[a-zA-Z0-9_]
. In the .NET regex language, you can turn on ECMAScript behavior and use \w
as a shorthand (yielding ^\w*$
or ^\w+$
). Note that in other languages, and by default in .NET, \w
is somewhat broader, and will match other sorts of unicode characters as well (thanks to Jan for pointing this out). So if you're really intending to match only those characters, using the explicit (longer) form is probably best.
http://www.analyticsmarket.com/freetools/regex-tester
Thursday, October 13, 2016
Page size calculation formula
Commit charge:
1. Run Performance Monitor (Perfmon)
2. Go to Data Collector Sets\User Defined
3. Right click on User Defined and select New
4. Select Create Manually and next
4. Check Performance counter
5. Add the following counters:
Memory\Committed Bytes – Committed Bytes is the amount of committed virtual
memory, in bytes.
Memory\Committed Limit – Amount of virtual memory that can be committed without
having to extend the paging file
Memory\% Committed Bytes In Use – Ratio of Memory\Committed Bytes to the
Memory\Commit Limit
Make sure you collect the information over a long
period (one week at least), and the server is running at peak usage.
The page file size formula should be:
(Max value of Committed Bytes + additional 20%
buffer to accommodate any workload bursts)-RAM size
For example: If the server has 24 GB RAM and the
maximum of Committed Bytes is 26 GB, then the recommended page file will be:
(26*1.2)-24) = 7.2 GB
Tuesday, September 06, 2016
DBA Secret KeyStroke by Jason "CPT SQL" Miller
ALT+F1 with Object Highlighted in SSMS all you ever wanted to know (aka Table Definition) and if your other developers never teach you this, you should beat them with a stick. I am HAPPY, today is a good day.
Friday, July 22, 2016
Rest hiberfil.sys by Alex --- Awesome article. Source - http://thetechcookbook.com/reset-hiberfil-sys-file/
Reset hiberfil.sys file
If the Hiberfil.sys file located on your local hard is growing quite large it might be time to reset the Hiberfile.sys file to default. This is also handy if you find your machine is not functioning correctly after a Hibernate then it indicates that there may be a corruption inside the Hiberfile.sys file.
Step One::
Click on Start -> Inside the search field type on CMD -> Right click on cmd.exe and choose Run as Administrator.
Step Two::
Enter in the following command powercfg -h off -> Press Enter
Restart the computer
Step Three::
Once the machine is turned back on open Command Prompt as admin again and enter in powercfg -h on
Wednesday, July 06, 2016
Microsoft Azure - www.mmwebs.biz
On the 4th I have moved www.mmwebs.com to use Microsft Azure, still some configuration to go, but thus far everything is running. Custom domain transfered. Now I have to get the DBs running.
Monday, June 27, 2016
.NET Authorization note to self
Authorize only 1 person(s) and deny all others and anonymous.
<authorization>
<allow users="you@email.com" />
<deny users="*" />
<deny users="?"/>
</authorization>
<authorization>
<allow users="you@email.com" />
<deny users="*" />
<deny users="?"/>
</authorization>
Subscribe to:
Posts (Atom)