Web Developer Recruitment in Faraconesh Corporation

Faraconesh Logo

I hardly ever use my blog to publish unrelated subjects to programming. This is one of them.

Our company Faraconesh Corporation is bound to hire new talented and professional .NET developers. If you like working with me in person in a small-growing company which offer good salary, insurance, flexitime working beside experts which are pioneers in Iran in their skills and you meet the following needs

At least 3 years of relevant experiences.

Deep knowledge of .NET, C#, SQL Server and NHibernate

Also ability to work in team and using issue trackers, source controls and the rest of teamwork tools

Ability to work with WPF, WCF, WF and REST count as advantages

You can send your resume to jobs@faraconesh.com or to me at n.hajloo@gmail.com.

Faraconesh Corporation appreciates in advance your kind request to join and will arrange a meeting with you in next few days.

This is the Persian text for this advertisement.

کروکی آدرس شرکت فراکنش در نقشه تهران کتاب اول
من به ندرت در این وبلاگ مطالب غیرمرتبط با برنامه نویسی می‌نویسم. این مطلب یکی از آنهاست.شرکت ما، فراکنش قصد استخدام چند برنامه‌نویس بااستعداد و حرفه‌ای دات نت را دارد. اگر شما دوست دارید که با من از نزدیک در یک شرکت کوچک رو به رشد که حقوق کافی، بیمه، زمان کار آزاد و کار شانه به شانه با متخصصینی که در زمینه کاری خودشان از پیشروان هستند همکاری کنید و نیز درصورتی که شرایط زیر را دارید

حداقل سه سال سابقه کار مرتبط

درک و تسلط کافی و عمیق از ‫.NET, C#, SQL Server و  NHibernate

همچنین توانایی کار گروهی و استفاده از ابزارهای کار تیمی مانند ایشوترکر ها و سورس کنترها

توانایی کار با WPF, WCF, WF و REST مزیت به شمار می‌آید

را دارید

می‌توانید رزومه کاری خودتان را به آدرس jobs@faraconesh.com و یا برای من به آدرس n.hajloo@gmail.com ارسال نمایید.

شرکت فراکنش از درخواست همکاری محبت آمیز شما از قبل قدردانی کرده و در چند روز آینده یک قرار ملاقات با شما تنظیم خواهد کرد

How to Build your Solution with Visual Studio Command Prompt

Working with command prompt always been a nice job, it helps you to schedule your routines and gives you more understanding of what’s going on the background. You will give more and on-time information; you can check the result as they happen. You can create a batch fileto build your solutions one after another and many other advantages.Visual Studio command prompt gives you all of the simple windows command prompt abilities plus some tools to control build and publish your source codesand many other abilities which you can find here. You can run Visual Studio command prompt from

[source code=””xml””]
Start Menu \ Visual Studio [2005|2008|2010] \ Visual Studio Tools \ Visual Studio 2008 Command Prompt
[/source]

You can use other prompts like – Visual Studio 2008 x64 Cross Tools Command Prompt – for general x64 system. None of them are different; the only difference is that they are provided for different platforms. As it is hard to run Visual Studio Command Prompt from Windows Task manager, you have to call it from a simple Command Prompt; it means that you have to run the following command in your Command Prompt. After that Visual Studio tools will include into your simple command prompt.

[source code=””xml””]
call "C:\Program Files (x86) \ Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86_amd64
[/source]

x86_amd64 will call x64 Cross Tools. To build your solutions you can use following commands

[source code=””xml””]
MSBuild YourSolution.sln /p:Configuration=Release
[/source]

Note that you can use a path like MSBuild D:\src\YourSolution.sln for your projects. As you all know .NET provide two different type of output for each project, Debug & Release. To specify the type of output you can use following code

[source code=””xml””]
MSBuild D:\src\YourSolution.sln /p:Configuration=Release
[/source]

What is Page Method and How to use it

JQuery Logo
JQuery Logo

I don’t know have you ever needed to use a server side method in a client (JavaScript or JQuery) function or not? PageMethod is the answer for this question. Actually PageMethod is not a complicated method it is just a simple method with 2 differences.

  1. All Web Methods should be Static
  2. And you need to add a [WebMethod] attribute to the top of method

[sourcecode language=”csharp”]
[WebMethod]
public static void GetMyData()
{
// your codes …
}
[/sourcecode]

And that’s all. Your WebMethod is ready to use in client scripts. The good news is that you can use these methods in both of Web Services and Asp.NET Ajax.
How to Use WebMethods in Client Side Scripts? Or How to call a server-side method in JQuery functions?

[sourcecode language=”csharp”]
<script>
function SendForm() {
PageMethods. GetMyData ();
}
</script>
[/sourcecode]

Where this kind of methods can be useful?

Just think that you have a web application which needs keyboard short-cuts to be enabled. Or an Ajax modal which try to pass some data to other server methods and some other examples.

You can find a good article about it here

‪Hidden Features of C#

framework logo

Today I was surfing StackOverFlow froum and I faced with an excellent wiki. So I decided to mentioned that in this post. Note that following features are not introduced by me, those are introduced by whom which came after the keyword.

You can also add a new hidden feature to this list, if you missed it, in this list. and it is better to use these feature to improve our programming skills.

You can find the original post here.

—————————————————————-

GNU Logo
GNU Logo

‪Title : ‪Hidden Features of C#

‪Publish Date : 02/05/2010

‪Version : 2.0

Original ‪Author : [StackOverFlow]

‪Author : Nasser Hadjloo

‪Author Mail : n.hajloo@gmail.com

‪Copyright (c) 2010 Nasser Hadjloo.

‪Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation;

‪with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled “GNU Free Documentation License”.

—————————————————————-

Here are the revealed features so far:

 

Keywords

yield by Michael Stum
var by Michael Stum
using() statement by kokos
readonly by kokos
as by Mike Stone
as / is by Ed Swangren
as / is (improved) by Rocketpants
default by deathofrats
global:: by pzycoman
using() blocks by AlexCuse
volatile by Jakub Šturc
extern alias by Jakub Šturc

Attributes

DefaultValueAttribute by Michael Stum
ObsoleteAttribute by DannySmurf
DebuggerDisplayAttribute by Stu
DebuggerBrowsable and DebuggerStepThrough by bdukes
ThreadStaticAttribute by marxidad
FlagsAttribute by Martin Clarke
ConditionalAttribute by AndrewBurns

Syntax

?? operator by kokos
number flaggings by Nick Berardi
where T:new by Lars Mæhlum
implicit generics by Keith
one-parameter lambdas by Keith
auto properties by Keith
namespace aliases by Keith
verbatim string literals with @ by Patrick
enum values by lfoust
@variablenames by marxidad
event operators by marxidad
format string brackets by Portman
property accessor accessibility modifiers by xanadont
ternary operator (?:) by JasonS
checked and unchecked operators by Binoj Antony
implicit and explicit operators by Flory

Language Features

Nullable types by Brad Barker
Currying by Brian Leahy
anonymous types by Keith
__makeref __reftype __refvalue by Judah Himango
object initializers by lomaxx
format strings by David in Dakota
Extension Methods by marxidad
partial methods by Jon Erickson
preprocessor directives by John Asbeck
DEBUG pre-processor directive by Robert Durgin
operator overloading by SefBkn
type inferrence by chakrit
boolean operators taken to next level by Rob Gough
pass value-type variable as interface without boxing by Roman Boiko
programmatically determine declared variable type by Roman Boiko
Static Constructors by Chris
Easier-on-the-eyes / condensed ORM-mapping using LINQ by roosteronacid

Visual Studio Features

select block of text in editor by Himadri
snippets by DannySmurf

Framework

TransactionScope by KiwiBastard
DependantTransaction by KiwiBastard
Nullable<T> by IainMH
Mutex by Diago
System.IO.Path by ageektrapped
WeakReference by Juan Manuel

Methods and Properties

String.IsNullOrEmpty() method by KiwiBastard
List.ForEach() method by KiwiBastard
BeginInvoke(), EndInvoke() methods by Will Dean
Nullable<T>.HasValue and Nullable<T>.Value properties by Rismo
GetValueOrDefault method by John Sheehan

Tips & Tricks

nice method for event handlers by Andreas H.R. Nilsson
uppercase comparisons by John
access anonymous types without reflection by dp
a quick way to lazily instantiate collection properties by Will
JavaScript-like anonymous inline-functions by roosteronacid

Other

netmodules by kokos
LINQBridge by Duncan Smart
Parallel Extensions by Joel Coehoorn

How to Extend SSRS Functionalities

SQL Server Reporting Services is one of the best Reporting Services which is available today; it has lots of functionalities and is easy to use. Today I’ll show you a way to extend SSRS functionalities.

—————————————————————-

GNU Logo
GNU Logo

‪Title : How to Extend SSRS Functionalities

‪Publish Date : 26/04/2010

‪Version : 1.0

‪Author : Nasser Hadjloo

‪Author Mail : n.hajloo@gmail.com

‪Copyright (c) 2010 Nasser Hadjloo.

‪Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation;

‪with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled “GNU Free Documentation License”.

—————————————————————-

There are sometimes which you cannot do, your desire work with SSRS default methods and Functions. For example CDate, IIF and etc are some of default SSRS commands. But what if you like to add your custom method to it? For example you need a method which take a Georgian date and return Persian Shamsi date. What can you do in these cases? Fortunately SSRS is a flexible service and you can easily extend it.

To extend SSRS, you need to create a class with desire methods, for example a class with a ConvertToPersiandate(dateTime georgiandate).

After that you have to build the project and Copy your DLL into following paths.

C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies
C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportManager\Bin
C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\bin

These paths changed to following path in 2008 version

C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies
C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportManager\Bin
C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\bin

The final step is to use it as a built-in SSRS command.
Just note that, you have to use complete Address for your method for example if you have these configurations

Name Space > Hadjloo.Web.Helpers.SSRS
Class Name > Converters
Methods in Class > ConvertToPersiandate(dateTime georgiandate) , ConvertToShortPersian (dateTime georgiandate) and etc

After That you have to add this DLL to your Report. To do this you should right click on the report and select Properties, then you should go to References tab and add this dll as a reference to your report.

SSRS 2008 Design Environment
SSRS 2008 Design Environment

Then in SSRS you have to use it like

=Hadjloo.Web.Helpers.SSRS. Converters. ConvertToPersiandate( First(MyGeorgianDate.value))

Note that in above case, First is a built-in command to get the first row value, and MyGeorgianDate is the DateTime field from the DataSet.

And also note that ConvertToPersiandate will have a red underline which is not important.

Which Items an inhouse-Framework should have

There are dozens of frameworks on the world which many companies use them. In addition most of software developing companies have a in-house framework which designed to reduce costs (includes time with increasing a procedure, or other similar items) and increase development speed.

—————————————————————-

GNU Logo
GNU Logo

‪Title : Which Items an inhouse-Framework should have

‪Publish Date : 11/04/2010

‪Version : 1.0

‪Author : Nasser Hadjloo

‪Author Mail : n.hajloo@gmail.com

‪Copyright (c) 2010 Nasser Hadjloo.

‪Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation;

‪with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled “GNU Free Documentation License”.

—————————————————————-

I don’t want to describe about a framework, but I tell a bit about it. And actually I will describe the necessary items which we have to put on our in-house framework.

What is an in-house framework? A framework which a company developed for a or the rest of his software’s, to increase functionality and share common procedures in all of his software’s. Note that a company may have a bunch of frameworks which provided for different kinds of applications.

framework logo

Which Items a Framework should have? This question has not a simple answer and in most cases we have to put on our in-house needs on it, but in most cases this framework should have some items which I’ll mention below. Note that you have to notice to your in-house needs to create an in-house framework and these items are not the only common items which your framework should have, these are only some of musts.

     1- Each framework should contain system base classes which our applications should use. Note that these are most common base classes and each base class which uses in just a class shouldn’t be here.

     2- Each framework should contain indeed Helpers which your company needs to use. For instance most of Iranian companies need a DateHelper which should convert Georgian calendar dates to Jalali dates.

     3- Each framework should have some classes to provide access to database. For example these classes should give an entity and save/update/delete/etc it from/to database. Something which ORM’s do nowadays but for your in-house framework it’s not bad to have some similar class if you do not use an ORM.

     4- Each framework should contain some Interface, abstract and other indeed enumerators which is common for all subsystems.

     5- A framework may have some common exceptions classes which may use in your business classes. Note that an exception which will use once on the system shouldn’t be here.

     6- Each framework should have a specific meaning, for example a developer should understand what your framework exactly can do?

The question which you may ask is that so where we should put our other classes which are not common? This is obvious; you have to put those in their application framework. The key point is that a framework will use in all of your subsystems and each application should have their own framework, so you have to put only common classes in the in-house framework and other indeed classes to their own application framework.

You can also add some other classes to your in-house application but note that they should be usable for the rest of your applications not only for a special application.

‪How to read Embedded Resource in c#

As you may know enterprise applications Embedd all of indeed resources into their assembly because of end users relief and prevention of loosing indeed files, in most cases embedding and using an embedd resource is so easy in dot net (c#) but if you embedd an xml resource and want to read it, you may be astound. in this article I’ll show you a way to read XML documents from EmbeddedResource in dot net 3.5

—————————————————————-

GNU Logo
GNU Logo

‪Title : ‪How to read Embedded Resource in c#

‪Publish Date : 14/12/2009

‪Version : 1.0

‪Author : Nasser Hajloo

‪Author Mail : n.hajloo@gmail.com

‪Copyright (c) 2009 Nasser Hajloo.

‪Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation;

‪with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled “GNU Free Documentation License”.

—————————————————————-

How To Embedd Resource
How To Embedd Resource

what is Embedded Resource?

Embedded Resources are whatever developer want to usein his/her assembly without informing end user that he/she is using them. this type of resources will embedd in assembly and will increasing assembly size. the important note about the embedded resource is that this type of files never resultto application change, because their embedd to assembly and end user can’t change them, so if you have and important resource that lack of that file will result to application error you should emmded that resource as an Emmbeded Resource.

Embedded Resource and Resource are so different and Resources will appear to end user and him/her can shange it, usually application translation packs are the commonly exampleof this type of resource, and end user with changing this file willface with translated application.

 

How to Embedd a Resource? embedding a resource in dot net is as easy of drinking a cup of coffee!. to embedd a resource, all you need is selct the object on Solution Explorer and then press F4 to open Properties window, in properties window you should , from the Advanced section you should select Embedded Reource in Build Action Property. all of this proccess showed in side picture.

using each type of embedded resource is different from others, and how to use an embedded image is different from how to use embedded xml resource. in this article I will describe how to use a xml embedded resource.

How To Read / Write into XML Embedded Resource? because of embeding xml into assembly, you should use a little Reflection to read/write data into embedded xml resource. all you should do is calling xml from inside of the assembly. for example

[sourcecode language=”html”]

System.Reflection.Assembly asm = Assembly.GetExecutingAssembly();

System.IO.Stream xmlStream = asm.GetManifestResourceStream("Hajloo.FOSS.UnicodeConverter.EnterpriseAppUnit.ucd.all.flat.xml");

XmlReader reader = XmlReader.Create(xmlStream, settings);

[/sourcecode]

in this example we create an object for our assembly (asm) and then use a Stream (you can use a xmlTextReader or vice versa) to read the xml, in this line of code we address the xml with complete path of XML. note that my XML name is ucd.all.flat.xml and dot between xml do not affect the clr to check another path, you should use complete Path + Name + Extension of the XML document.

in final line of code I create a XMLReader object (you can make a XMRWriter object to write inside of XML) to read (write) data from XML.

trick : if you can not find a correct path to your XML, in windows explorer right click on your assembly and then open it on Notepad++ or other editor. you can find all of you XML document inside of the assembly and you can see the fullpath of XML document here.

overload چیست و چگونه Overload بنویسیم

خیلی وقتها کدهایی می‌بینیم که دعا می‌کنیم ای کاش هیچ وقت با آنها روبرو نمی‌شدیم. چند روز پیش با یکی از این کدها روبرو شدم و به همین دلیل این مطلب را می‌نویسم، امیدوارم شخص ثالث هم این نوشته را ببیند و در کدنویسی از این روش یا روش‌های بهتر استفاده کند.

—————————————————————-

این مطلب زیر نظر مجوز GFDL منتشر می‌شود. و کلیه حقوق آن برای همگان آزاد است، بدین شرط که به کلیه شرایط موجود در مجوز GFDL ( که یک نسخه از متن انگلیسی مجوز GFDL در این محل و یک ترجمه غیر رسمی (فارسی) از متن مجوز GFDL که در مرداد ۱۳۸۳ توسط کاوه رنجبر تهیه شده است در این محل ) قرار دارد پایبند باشد.

GNU Logo
GNU Logo

عنوان مطلب : overload چیست و چگونه Overload بنویسیم

بخش ثانی : ندارد

تاریخ انتشار : 17/06/1388 مطابق با 08/09/2009

شماره نسخه : نسخه یک

نویسنده : ناصر حاجلو

ای-میل نویسنده : n.hajloo@gmail.com

Copyright (c) 2009 Nasser Hajloo.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation;

with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled “GNU Free Documentation License”.

—————————————————————-

 Overload چیست ؟ اورلود، یک متد هم نام با متد اصلی است که پارامترهای متفاوتی از آنچه که متد اصلی دارد، می‌گیرد. از آنجا که این متدها در نام شبیه به هم هستند پس باید در عمل هم کار یکسانی را انجام دهند، اما بسته به اینکه کاربر ( بخوانید برنامه‌نویس سطح بعدی ) چه مقادیری را در دسترس داشته باشد، از اورلودهای مختلف برای انجام عمل دلخواهش استفاده می‌کند.

برای مثال فرض کنید که می‌خواهید یک متد save برای یک آبجکت Person بنویسید. در حالت عادی شما باید یک متد بصورت زیر داشته باشید.

[sourcecode language="C#"]
 Public void Save(Person p)
{
 // در این قسمت این ابجکت را در پایگاه داده باید ذخیره کنید
}
[/sourcecode]

اما فرض کنید که کلاس Person حداقل دو صفت نام و نام خانوادگی را برای ایجاد یک آبجکت نیاز دارد پس برای ذخیره کردن این person باید یک overload هم برای ذخیره این دو صفت داشته باشیم برای نمونه فرض کنید.

[sourcecode language="C#"]
public void Save(string name, string lastName)
 {
 Person p = new Person(name,lastName);
 Save(p);
}
[/sourcecode]

توجه کنید که متد save در آبجکت person قرار ندارد و در لایه business قرار گرفته از این رو p.save در این مثال وجود ندارد. اما در یک روال پیاده سازی بهتر باید همه متدهای save برای person در کلاس person قرار گرفته باشد ( که بخاطر کوتاهی نگارش مطلب، در اینجا از آن صرف نظر کردم ) اما یک overload مناسب دیگر برای متد save می‌تواند متد زیر باشد.

[sourcecode language="C#"]
 public Save(List<Person> people)
{
 foreach ( Person p in people)
                  Save(p);
}
[/sourcecode]

همانطور که ملاحظه می‌کنید می‌توان overload های بسیار دیگری را نیز به این کلاس اضافه کرد تا در لایه‌های مختلف عملیات save ( یا هر عملیات دلخواه دیگری ) راحت‌تر و با معناتر انجام شود. هرچه طراح سیستم overload های بیشتری را برای پیاده‌سازی در نظر بگیرد کار با آن کلاس خاص راحت‌تر و با معناتر خواهد بود.
توجه کنید که در مثال‌های بالا همه overload ها فقط و تنها فقط یک متد اجرایی دارند و سایر overload ها برای انجام دادن کار خودشان به نوعی از آن متد استفاده می‌کنند. در این مثال سعی کردم با حداقل میزان کدنویسی نشان دهم که برای overload نویسی باید فقط و تنها فقط از یک نقطه تغییرات را اعمال کنیم تا هم کدنویسی معنایی را حفظ کنیم و هم تغییرات آینده را براحتی و از یک جا کنترل کنیم که این در بهره‌وری و کارآیی و خوانایی کد تاثیر چشم‌گیری دارد.

توجه داشته باشید که در یک طراحی خوب متد save باید در خود کلاس person پیاده‌سازی شود و در اینجا صرفا قصد نشان دادن چگونگی مقداردهی به overload های مختلف را داشتم. اگر شما راه بهتری برای نوشتن overload ها سراغ دارید، لطفا آن را با من در میان بگذارید.