Writing Code is fun, see here :)

 

Some really nice comments I have picked during a peer review.

// Server Side Validation Functions 
private bool ValidateGeneralDOB(object fieldValue) 
{ 
  DateTime dt;

  if(fieldValue==null) 
    return false; // are you kidding me, you should be born :( 

  else if (!DateTime.TryParse(fieldValue.ToString(),out dt)) 
    return false; // you should be born on a valid date 

  else if(dt>DateTime.Now.AddYears(-20)) // to little :) 
   return false; 

  else if (dt < DateTime.Now.AddYears(-90)) // to old :| 
   return false;

 // your are the one we are looking for 
  return true; 
}

 

 

About CAE Solutions


Web: http://www.caesolutions.com/


Linkedin: https://www.linkedin.com/company/301183/


Sally Verrilli post on how CAE Solutions helped UnitedHealth Group with a system that is dying or dead: https://lnkd.in/eecCsuu


An extract from her post:


Who’s been here?

You work in a big company.

You lead a department that has a system that is dying or dead.
You don’t need the space shuttle.
You need something to keep you in orbit for a year or two.
Your system need isn’t big enough to merit capital.

This was my situation last year.  I had to have a system that worked within 1 year or I was screwed. My internal team was in transition and I didn’t know if they would be stable enough or able enough to get this done after I announced the death of the legacy system. (Back then, we were new to each other.  Now I know they CAN.)

My budget wasn’t big but I knew I had to do something.
I needed to up my odds of success.

The vendor that helped build my new, interim system is CAE Solutions. It wasn’t easy;  but it got done and done on time and on budget.  The new system has been up and running with great success for 11 months now, and we are headed into our second busy season with it.

I have no vested interest in CAE, and this is not a sales pitch.  I took a chance and it worked out.  System builds rarely have happy endings for many reasons.  This one did.  Call Anil Gupta at CAE solutions if you need help. It worked for me.

Conflicting extensions for PHP development have been detected: Visual Studio

So you want to dedug PHP within Visual Studio.

You went ahead and installed extension 1 PhpTools from downloaded msi “PhpTools.xxxx.msi” from visualstudiogallery.

And for complete the installation, you also installed extension 2(like I did) Vs.php from installer “php vsphp_en_xxxx_web_installer.exe downloaded from URL

Then Visual Studio throws up below exception.

—————————
Microsoft Visual Studio
—————————
Conflicting extensions for PHP development have been detected:
– VS.Php
Continuing using of Visual Studio may result in an unpredictible behaviour. To fix this issue, please uninstall conflicting extension above and restart Visual Studio.

—————————
OK
—————————

Why???

Because both these extensions are not supported by Visual Studio at same time, as they are conflicting in nature.

Why conflicting?  Because both extensions extend same features of Visual Studio and studio is saying that configuration of extension 1 has been or may be overwritten by extension 2.

So we need to uninstall one of these to use another.

How to install phpUnit on Windows?

1. Install Composer-Exe from link

2. Edit/Create composer.json into C:\cygwin64\home\Administrator

3. Add below dependency to composer.json

{
“require-dev”: {
“phpunit/phpunit”: “3.7.*”
}
}

3. run cmd command -> composer install -dev, below output will ensure phpUnit installation.

composer install -dev
Loading composer repositories with package information
Installing dependencies (including require-dev)
– Installing symfony/yaml (v2.5.7)
Downloading: 100%

– Installing phpunit/php-text-template (1.2.0)
Downloading: 100%

– Installing phpunit/phpunit-mock-objects (1.2.3)
Downloading: 100%

– Installing phpunit/php-timer (1.0.5)
Downloading: 100%

– Installing phpunit/php-token-stream (1.2.2)
Downloading: 100%

– Installing phpunit/php-file-iterator (1.3.4)
Downloading: 100%

– Installing phpunit/php-code-coverage (1.2.18)
Downloading: 100%

– Installing phpunit/phpunit (3.7.38)
Downloading: 100%

phpunit/phpunit-mock-objects suggests installing ext-soap (*)
phpunit/php-code-coverage suggests installing ext-xdebug (>=2.0.5)
phpunit/phpunit suggests installing phpunit/php-invoker (~1.1)
Writing lock file
Generating autoload files