GOD BLESS AMERICA #MAGA Congratulations President Elect Donald Trump!
Robert Dannelly blog, Over the internet you can find me by "robert dannelly blog". The blog is an ongoing blog of my software engineering over technologies C#, VB.NET, Java, React, JavaScript, .NET Core Current, SQL Server 7 - Current Version, GIT, GitHub, Jira, Azure, AWS and HTML5. “I have not failed. I've just found 10,000 ways that won't work.” Thomas A. Edison, please click on all links to help support this blog. Thank you. “As an Amazon Associate, I earn from qualifying purchases.”
Wednesday, November 09, 2016
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>
Wednesday, June 08, 2016
UDL
Create Database Pop Up the .udl https://msdn.microsoft.com/en-us/library/e38h511e(v=vs.71).aspx must research and learn more credit to CT...
Tuesday, May 24, 2016
Thursday, May 19, 2016
First NuGet Package Published
Feeling pretty good about my career with my first NuGet Package. I hope this helps out other .NET Developers with CyberSource Transition on June 30, 2016 - https://www.nuget.org/packages/UnofficialCyberSourceByMoojjoo/
Friday, May 06, 2016
Update Incrementer with T-SQL instead of using a cursor
SQL TIP: Auto Increment in an UPDATE statement. - Credit - http://haacked.com/archive/2004/02/28/sql-auto-increment.aspx/
DECLARE @counter int SET @counter = 0 UPDATE #tmp_Users SET @counter = counter = @counter + 1
Friday, April 29, 2016
Thank you XML and NotePad++
Use the XML Tools plugin for Notepad++ and then you can Auto-Indent the code with Ctrl + Alt + Shift + B .For the more point-and-click inclined, you could also go to Plugins --> XML Tools --> Pretty Print. Search "XML TOOLS" from the "Available" option then click in install.Jan 28, 2015
How to indent HTML tags in Notepad++ - Stack Overflow
stackoverflow.com/questions/.../how-to-indent-html-tags-in-notepad
Windows 7 - Change Login Screen
Reference and Credit - http://www.tomshardware.com/forum/52395-63-change-windows-splash-screen-lock-screen
click start type regedit and hit enter
right click on HKEY_LOCAL_MACHINE and select find
type OEMBackground and hit enter
(the path should be Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background )
(if it is not there you need to create it*right click on background and select new DWORD name it OEMBackground set it from 0 to 1)
double left click on OEMBackground and change the value from 0 to 1
click start and type %windir%\system32\oobe
in the oobe folder create a folder named info
in that folder create a folder named backgrounds
now rename your picture that you want displayed durning logon/lock screen backgroundDefault.jpg
everything is case sensitive so if you have to copy and paste the names. the picture needs to be under 244kb.
trick to get a picture under the 244kb
right click on the picture and select open with > select paint
press ctrl+w
this will bring up a box under horizontal and vertical select the amount you want to reduce the picture in %
=)
click start type regedit and hit enter
right click on HKEY_LOCAL_MACHINE and select find
type OEMBackground and hit enter
(the path should be Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background )
(if it is not there you need to create it*right click on background and select new DWORD name it OEMBackground set it from 0 to 1)
double left click on OEMBackground and change the value from 0 to 1
click start and type %windir%\system32\oobe
in the oobe folder create a folder named info
in that folder create a folder named backgrounds
now rename your picture that you want displayed durning logon/lock screen backgroundDefault.jpg
everything is case sensitive so if you have to copy and paste the names. the picture needs to be under 244kb.
trick to get a picture under the 244kb
right click on the picture and select open with > select paint
press ctrl+w
this will bring up a box under horizontal and vertical select the amount you want to reduce the picture in %
=)
Tuesday, April 19, 2016
Fancybox Modal Window onFocus or $('#ID').onFocus();
How to give focus to a modal window?
Be patient. Add a timer. That did it for me.
This was a 2 day R&D problem. After adding the timeout BAM --- Focus achieved. This really was a tricking thing to figure out, but think about it if the HTML DOM ELEMENT is not there it cannot set focus.
Be patient. Add a timer. That did it for me.
This was a 2 day R&D problem. After adding the timeout BAM --- Focus achieved. This really was a tricking thing to figure out, but think about it if the HTML DOM ELEMENT is not there it cannot set focus.
$(document).ready(function setFocus() { setTimeout(function () { $('#txtEmailAddress').focus(); }, 420); // After 420 ms return false; });
Wednesday, April 13, 2016
BootStrap, JQuery, and JavaScript Validation Oh My... Nice Solution.
You need jQuery library and bootstrap to perform the following code.
Nice Page Header ON TOP
Next is the server control or button either one.
Finally the nice jQuery
Nice Page Header ON TOP
<div id="message"> <div> <div class="alert alert-danger alert-dismissable"> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> <span id="alertMsgTxt" style="font-size:1.5em;font-weight:bold" ></span> </div> </div> </div>
Next is the server control or button either one.
<asp:TextBox ID="txtEmailSignup" TextMode="email"
runat="server" CssClass="form-control" title="Email Sign Up SHOE SHOW Sales and News" placeholder="Enter your email address" />
Finally the nice jQuery
<script> $(document).ready(function () { $(document).on('click', '#lnkEmailSubmit', function () { var emailaddress = ''; emailaddress = $('#txtEmailSignup').val(); if(!validateEmail(emailaddress) || emailaddress === ''){ $('.alert').show(); window.scrollTo(0, 0); $('#alertMsgTxt').html('Invalid Email, please click here to try again.'); } }) }); function setFocus() { $('.alert').hide(); document.getElementById("txtEmailSignup").focus(); } function validateEmail($email) { var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; return emailReg.test( $email ); } </script>
Friday, March 25, 2016
Tuesday, February 16, 2016
ASP.NET Web Forms set default button on page load
In the Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Main_Form.DefaultButton = "lnkLookUpGuestOrders" End Sub
Friday, January 15, 2016
How to CACHE using .NET
Add <?xml .... > script below to the directory you want to CACHE for 365 days - if it is static than why have the client retrieve it, over and over again --- BAD HIT ON SPEED OF SITE. Note for CSS and Scripts it is best practice to have a version number on the file and update the reference.
Example
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" />
</staticContent>
</system.webServer>
</configuration>
Always add ?v=x.x and increment when you make changes to the css or js files. If not end-users will get older versions of your CSS or JS and will cause a nightmare and lose potential customers or clients.
Example
<link rel="stylesheet" type="text/css" href="/framework/css/global.min.css?v=2.0" media="screen, print" />
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" />
</staticContent>
</system.webServer>
</configuration>
Always add ?v=x.x and increment when you make changes to the css or js files. If not end-users will get older versions of your CSS or JS and will cause a nightmare and lose potential customers or clients.
Subscribe to:
Posts (Atom)