Wednesday

resharper templates


To add new user-template in resharper from top menu in visual studio click on Resharper / Live templates select File Templates tab.
Find "User templates" and click on new template in toolbar .
Below is sample of command template:
Namespace variable will be "Default namespace for the current file".
Class variable will be "Current file name without extension".


       
namespace $NAMESPACE$
{
/// <summary>
/// $CLASS$ Linq Command
// </summary>
public class $CLASS$ : BaseLinqCommand, ILinqCommand
{
public $CLASS$() {
//constructor add your incoming params here
}

public bool CanExecute(Scope scope)
{
//add aditional validation here
return base.CanExecute(scope);
}

public void Execute(Scope scope)
{
//oly: main execution code goes here
}

}
}

Monday

testing svc web service

First you have to create test project in visual studio and add service reference, than you will be able to create test like this:
      
[Test]
public void BusinessWebserviceServiceTest01()
{
BusinessWebservice.ServiceClient client= new ServiceClient();
Debug.Write(client.getOpenInvoicesCount(1006469, 1, 1292071, "0"));
}

Thursday

isnumeric c#

Following function works like analog to vb isNumeric function
and checks that every character entered into myTextField is digit.

if (myTextField.Text.All(Char.IsDigit)){
// is numeric
}else{
// is not numeric
}

Wednesday

resizable div in jquery-ui with error label in asp.net

1.add links to jquery and css files.

<link type="text/css" href="../themes/start/jquery.ui.all.css" rel="stylesheet" />
<script type="text/javascript" src="../js/jquery-1.4.2.min.js "></script>
<script type="text/javascript" src="../js/jquery-ui-1.8.2.custom.min.js"></script>


2. add in document initialisation

<script type="text/javascript">
$(document).ready(function () {
$(" .resizable").resizable();
});
</script>

3.adding div in body below :

<div class='resizable' style='height:20px;overflow-x:hidden;overflow-y:hidden;width:100%'>
<asp:Label ID="ErrorLabel" runat='server' ForeColor=Red Font-Bold=true/>
</div>

Friday

software mistakes


  1. Don't bother with market research, because you just know lots of people are itching to buy your new product.

  2. Only release the product once it is perfect. However long that takes.

  3. Go into a market with very strong competition and compete with them head-on, because you only need a measly 1% of this market to get rich.

  4. Go into a market with no competition. How hard can creating a new market and educating all the potential customers be?

  5. Only think about marketing once the code is nearly complete.

  6. Write software for people who can't or won't buy software (e.g. 10 year olds, prisoners, Linux fanatics, people in developing countries, developers).

  7. Don' worry about marketing, because good software sells itself.

  8. Concentrate on the technology and impressing other developers.

  9. Don't listen to what your customers say, because you know best.

  10. Don't worry about usability. It took you thousands of hours to write the software. Surely the customer can spend an hour or two learning to use it.

  11. Embrace bleeding-edge technology.

  12. Don't worry about backups, because modern harddisks are very reliable.

  13. Don't even try. Just give your software away for free.



test smtp server with powershell

Send-MailMessage -SMTPServer smtp.domain.com -To [email protected] -From [email protected] -Subject "This is a test email" -Body ...