December 16, 2009

Impersonator.cs

#region Namespaces
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Runtime.InteropServices;
using System.Security.Principal;
using System.Text;
#endregion

namespace WF
{
public class Impersonator : IDisposable
{
#region Declarations
private WindowsImpersonationContext _impersonatedUser = null;
private IntPtr _userHandle;
#endregion

#region Impersonator
public Impersonator()
{
_userHandle = new IntPtr(0);
string user = ConfigurationSettings.AppSettings["StrAdmin"].ToString();
string userDomain = ConfigurationSettings.AppSettings["StrDomain"].ToString();
string password = ConfigurationSettings.AppSettings["StrAdminPswd"].ToString();

bool returnValue = LogonUser(user, userDomain, password, LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT, ref _userHandle);
if (!returnValue)
throw new ApplicationException("Could not impersonate user");
WindowsIdentity newId = new WindowsIdentity(_userHandle);
_impersonatedUser = newId.Impersonate();
}
#endregion

#region IDisposable Members

public void Dispose()
{
if (_impersonatedUser != null)
{
_impersonatedUser.Undo();
CloseHandle(_userHandle);
}
}

#endregion

#region Interop imports/constants
public const int LOGON32_LOGON_INTERACTIVE = 2;
public const int LOGON32_LOGON_SERVICE = 3;
public const int LOGON32_PROVIDER_DEFAULT = 0;

[DllImport("advapi32.dll", CharSet = CharSet.Auto)]
public static extern bool LogonUser(String lpszUserName, String lpszDomain, String lpszPassword, int dwLogonType, int dwLogonProvider, ref IntPtr phToken);

[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
public extern static bool CloseHandle(IntPtr handle);
#endregion
}
}

December 08, 2009

stsadm is not recognized as an internal or external command, operable program or batch file.

Add stsadm.exe to paths, in other words, make Windows able to execute stsadm no matter what folder you are in.

Click Start > Control panel > System > Advanced system setings

Under “System Variables” click Path (You will need to scroll down a bit). Click edit. At the end of the line add:

;C:\Program Files\Common Files\microsoft shared\Web Server Extensions\12\BIN

November 17, 2009

Indian Forest Officer (UPSC) Info

The competitive examination for the Indian Forest Service is conducted by Union Public Service Commission (UPSC).
IFS exam is conducted annually in July. The recruitment exam consists of six different papers.
Candidates try to score maximum out 1400 marks allotted for written exam.
The written test is followed by an interview carrying 300 marks, conducted only for candidates selected in written test.

Pattern of the Written Exam (Total 1400 Marks):

Paper I (300 marks):

General English

Paper II (300 marks):

General Knowledge

Paper III, Paper IV, Paper V, Paper VI (4 x 200 = 800 Marks):

Any two subjects to be selected from the list of the optional subjects (Two Papers per Subject).

Interview for Personality Test (300 Marks):

Only for shortlisted candidates who may be called by the Commission.

Syllabus for the IFS Exam:

The standard of papers in General English and General Knowledge will be such as may be expected of a Science or Engineering graduate of an Indian University.

The Scope of the Syllabus for optional subject papers for the examination is Broadly of the Honours Degree level
i.e. A level Higher than the Bachelors Degree and lower than the Masters Degree. In the case of Engineering subjects, the level corresponds to the Bachelors Degree.

1. Syllabus for General English

Candidates will be required to write an essay in English.
Other questions will be designed to test their understanding of English and workmanlike use of words.
Passages will usually be set for summary or précis.

2. Syllabus for General Knowledge

General Knowledge including knowledge of current events and of such matters of every day observation
and experience in their scientific aspects as may be expected of an educated person who has not made
a special study of any scientific subject. The paper will also include questions on Indian Polity including
the political system and the Constitution of India, History of India and Geography of a nature which the candidate
should be able to answer without special study.

3. Syllabus for Optional Subjects:[Two papers---Forestry and Mathematics]

A total of EIGHT (8) questions are asked in each question paper of optional subjects.
All questions carry equal marks. Each paper is divided into two parts, viz.
Part A and Part B, each part containing four questions. Out of eight questions,
five questions are to be attempted.
One question in each part will be compulsory.
Candidates will be required to answer three more questions out of the remaining six questions,
taking at least one question from each Part. In this way,
at least two questions will be attempted from each Part i.e.
one compulsory question plus one more.

4. Personality Test: The candidates will be interviewed by a Board of competent and unbiased observers
who will have before them a record of this career. The object of the interview is to assess the personal
suitability of the candidate for the Service. The candidate will be expected to have taken an intelligent
interest not only in his/her subjects of academic study but also in events which are happening around him
both within and outside his own State or country, as well as in modern currents of thoughts and in new discoveries
which should rouse the curiosity of well-educated youth. The technique of the interview is not that of a strict cross
examination, but of a natural, though directed and purposive conversation, intended to reveal mental qualities of the
candidate. The Board will pay special attention to assessing the intellectual curiosity,
critical powers of observation and assimilation, balance of judgment and alertness of mind, initiative, tact,
capacity for leadership; the ability for social cohesion, mental and physical energy and powers of practical application;
integrity of character; and other qualities such as topographical sense, love for out-door life and the desire to explore unknown and out of way places.


Forestry Paper I

Section A

1. Silviculture - General:

General Silvicultural Principles: ecological and physiological factors influencing vegetation,
natural and artificial regeneration of forests; methods of propagation, grafting techniques; site factors;
nursery and planting techniques-nursery beds, polybags and maintenance, water budgeting, grading and hardening of seedlings;
special approaches; establishment and tending.

2. Silviculture - systems:

Clear felling, uniform shelter wood selection, coppice and conversion systems. Management of
silviculture systems of temperate, subtropical, humid tropical, dry tropical and coastal tropical
forests with special reference to plantation silviculture, choice of species, establishment and management
of standards, enrichment methods, technical constraints, intensive mechanized methods, aerial seeding thinning.

3. Silviculture - Mangrove and Cold desert:

Mangrove: habitat and characteristics, mangrove, plantation-establishment and rehabilitation of
degraded mangrove formations; silvicultural systems for mangrove; protection of habitats against natural disasters.
Cold desert - Characteristics, identification and management of species.

4. Silviculture of trees:

Traditional and recent advances in tropical silvicultural research and practices. Silviculture of some of the economically
important species in India such as Acacia catechu, Acacia nilotica, Acacia auriculiformis, Albizzia lebbeck, Albizzia procera,
Anthocephalus Cadamba, Anogeissus latifolia, Azadirachta indica, Bamboo spp, Butea monosperma, Cassia siamea, Casuarina equisetifolia,
Cedrus deodara, Chukrasia tabularis, Dalbergia sisoo, Dipterocarpus spp., Emblica officindils, Eucalyptus spp, Gmelina Arborea,
Hardwickia binata, Largerstroemia Lanceolata, Pinus roxburghi, Populus spp, Pterocarpus marsupium, Prosopis juliflora, Santalum album,
Semecarpus anacardium,. Shorea robusta, Salmalia malabaricum, Tectona grandis, Terminalis tomemtosa, Tamarindus indica.

Section B

1. Agroforestry, Social Forestry, Joint Forest Management and Tribology:

Agroforestry - scope and necessity; role in the life of people and domestic animals and in integrated land use,
planning especially related to (i) soil and water conservation; (ii) water recharge; (iii) nutrient availability to crops;
(iv) nature and eco-system preservation including ecological blances through pest-predator relationships and (v) providing
opportunities for enhancing bio-diversity, medicinal and other flora and fauna. Agro forestry systems under different agro-ecological zones;
selection of species and role of multipurpose trees and NTFPs, techniques, food, fodder and fuel security. Research and Extension needs.

Social/Urban Forestry: objectives, scope and necessity; peoples participation.

JFM - principles, objectives, methodology, scope, benefits and role of NGOs.

Tribology - tribal scene in India; tribes, concept of races, principles of social grouping, stages of tribal economy, education,
cultural tradition, customs, ethos and participation in forestry programmes.

2. Forest Soils, Soil Conservation and Watershed management:

Forests Soils, classification, factors affecting soil formation; physical, chemical and biological properties.

Soil conservation - definition, causes for erosion; types - wind and water erosion; conservation and management of eroded soils/areas,
wind breaks, shelter belts; sand dunes; reclamation of saline and alkaline soils, water logged and other waste lands. Role of forests in conserving soils.
Maintenance and build up of soil organic matter, provision of loppings for green leaf manuring; forest leaf litter and composting;
Role of microorganisms in ameliorating soils; N and C cycles, VAM.

Watershed Management - concepts of watershed; role of mini-forests and forest trees in overall resource management,
forest hydrology, watershed development in respect of torrent control, river channel stabilization, avalanche and landslide controls,
rehabilitation of degraded areas; hilly and mountain areas; watershed management and environmental functions of forests;
water-harvesting and conservation; ground water recharge and watershed management; role of integrating forest trees,
horticultural crops, field crops, grass and fodders.

3. Environmental Conservation and Biodiversity:

Environment; components and importance, principles of conservation, impact of deforestation; forest fires and various human activities like mining,
construction and developmental projects, population growth on environment.

Pollution - types, global warming, green house effects, ozone layer depletion, acid rain, impact and control measures, environmental monitoring;
concept of sustainable development. Role of trees and forests in environmental conservation; control and prevention of air, water and noise pollution.
Environmental policy and legislation in India. Environmental Impact Assessment. Economics assessment of watershed development vis-a-vis ecological and
environmental protection.

4. Tree Improvement and Seed Technology:

General concept of tree improvement, methods and techniques, variation and its use, provenance, seed source, exotics;
quantitative aspects of forest tree improvement, seed production and seed orchards, progeny tests, use of tree improvement in natural forest
and stand improvement, genetic testing programming, selection and breeding for resistance to diseases, insects, and adverse environment;
the genetic base, forest genetic resources and gene conservation in situ and ex-situ. Cost benefit ratio, economic evaluation.

Forestry Paper II

Section A

1. Forest Management and Management Systems:

Objective and principles; techniques; stand structure and dynamics, sustained yield relation; rotation, normal forest, growing stock;
regulation of yield; management of forest plantations, commercial forests, forest cover monitoring. Approaches viz.,
(i) site-specific planning, (ii) strategic planning, (iii) Approval, sanction and expenditure, (iv) Monitoring
(v) Reporting and governance. Details of steps involved such as formation of Village Forest Committees, Joint Forest Participatory Management.

2. Forest Working Plan:

Forest planning, evaluation and monitoring tools and approaches for integrated planning; multipurpose development of forest resources
and forest industries development; working plans and working schemes, their role in nature conservation, bio-diversity and other dimensions;
preparation and control. Divisional Working Plans, Annual Plan of Operations.

3. Forest Mensuration and Remote Sensing:

Methods of measuring - diameter, girth, height and volume of trees; form-factor; volume estimation of stand, current anuual increment;
mean annual increment. Sampling methods and sample plots. Yield calculation; yield and stand tables, forest cover monitoring through remote sensing;
Geographic Information Systems for management and modelling.

4. Surveying and Forest Engineering:

Forest surveying - different methods of surveying, maps and map reading. Basic principles of forest engineering.
Building materials and construction. Roads and Bridges; General principles, objects, types, simple design and construction of timber bridges.

Section B

1. Forest Ecology and Ethnobotany:

Forest ecology - Biotic and aboitic components, forest eco-systems; forest community concepts; vegetation concepts, ecological succession and climax,
primary productivity, nutrient cycling and water relations; physiology in stress environments (drought, water logging salinity and alkalinity).
Forest types in India, identification of species, composition and associations; dendrology, taxonomic classification, principles and establishment of
herbaria and arboreta. Conservation of forest ecosystems. Clonal parks,

Role of Ethnobotany in Indian Systems of Medicine; Ayurveda and Unani - Introduction, nomenclature, habitat, distribution and botanical features of
medicinal and aromatic plants. Factors affecting action and toxicity of drug plants and their chemical constituents.

2. Forest Resources and Utilization:

Environmenatlly sound forest harvesting practices; logging and extraction techniques and principles, transportation system, storage and sale;
Non-Timber Forest Products (NTFPs) definition and scope; gums, resins, oleoresins, fibres, oil seeds nuts, rubber, canes, bamboos, medicinal plants,
charcoal, lac and shellac, Katha and Bidi leaves, collection; processing and disposal.

Need and importance of wood seasoning and preservation; general principles of seasoning, air and kiln seasoning, solar dehumidification,
steam heated and electrical kilns. Composite wood; adhesives-manufacture, properties, uses, plywood manufacture-properties, uses,
fibre boards-manufacture properties, uses; particle boards manufacture; properties uses. Present status of composite wood industry in
India in future expansion plans. Pulp-paper and rayon; present position of supply of raw material to industry, wood substitution,
utilization of plantation wood; problems and possibilities.

Anatomical structure of wood, defects and abnormalities of wood, timber identification - general principles.

3. Forest Protection & Wildlife Biology:

Injuries to forest - abiotic and biotic, destructive agencies, insect-pests and disease, effects of air pollution on forests and forest die back.
Susceptibility of forests to damage, nature of damage, cause, prevention, protective measures and benefits due to chemical and biological control.
General forest protection against fire, equipment and methods, controlled use of fire, economic and environmental costs; timber salvage operations
after natural disasters. Role of afforestation and forest regeneration in absorption of CO2. Rotational and controlled grazing, different methods of
control against grazing and browsing animals; effect of wild animals on forest regeneration, human impacts; encroachement, poaching, grazing, live fencing,
theft, shifting cultiation and control.

4. Forest Economics and Legislation:

Forest economics-fundamental principles, cost-benefit analyses; estimation of demand and supply; analysis of trends in the national and
international market and changes in production and consumption patterns; assessment and projection of market structures; role of private
sector and co-operatives; role of corporate financing. Socio-economic analyses of forest productivity and attitudes; valuation of forest goods and service.

Legislation-History of forest development; Indian Forest Policy of 1894, 1952 and 1990. National Forest Policy, 1988 of People's involvement,
Joint Forest Management, Involvement of women; Forestry Policies and issues related to land use, timber and non-timber products, sustainable forest management;
industrialisation policies; institutional and structural changes. Decentralization and Forestry Public Administration. Forest laws, necessity; general principles,
Indian Forest Act 1927; Forest Conservation Act, 1980; Wildlife Protection Act 1972 and their amendments; Application of Indian Penal Code to Forestry.
Scope and objectives of Forest Inventory.

Mathematics Paper I

Section-A

Linear Algebra

Vector, space, linear dependance and independance, subspaces, bases, dimensions. Finite dimensional vector spaces.

Matrices, Cayley-Hamiliton theorem, eigenvalues and eigenvectors, matrix of linear transformation, row and column reduction,
Echelon form, eqivalence, congruences and similarity, reduction to cannonical form, rank, orthogonal, symmetrical, skew symmetrical, unitary,
hermitian, skew-hermitian forms-their eigenvalues. Orthogonal and unitary reduction of quadratic and hermitian forms, positive definite quardratic forms.

Calculus

Real numbers, limits, continuity, differerentiability, mean-value theorems, Taylor's theorem with remainders, indeterminate forms, maximas and minima,
asyptotes. Functions of several variables: continuity, differentiability, partial derivatives, maxima and minima, Lagrange's method of multipliers,
Jacobian. Riemann's definition of definite integrals, indefinite integrals, infinite and improper intergrals, beta and gamma functions. Double and
triple integrals (evaluation techniques only). Areas, surface and volumes, centre of gravity.

Analytic Geometry:

Cartesian and polar coordinates in two and three dimesnions, second degree equations in two and three dimensions, reduction to cannonical forms,
straight lines, shortest distance between two skew lines, plane, sphere, cone, cylinder., paraboloid, ellipsoid, hyperboloid of one and two sheets and their properties.

Section-B

Ordinary Differential Equations:

Formulation of differential equations, order and degree, equations of first order and first degree, integrating factor, equations of first order but not of first degree,
Clariaut's equation, singular solution.

Higher order linear equations, with constant coefficients, complementary function and particular integral, general solution, Euler-Cauchy equation.

Second order linear equations with variable coefficients, determination of complete solution when one solution is known, method of variation of parameters.

Dynamics, Statics and Hydrostatics:

Degree of freedom and constraints, rectilinerar motion, simple harmonic motion, motion in a plane, projectiles, constrained motion, work and energy,
conservation of energy, motion under impulsive forces, Kepler's laws, orbits under central forces, motion of varying mass, motion under resistance.

Equilibrium of a system of particles, work and potential energy, friction, common catenary, principle of virtual work, stability of equilibrium,
equilibrium of forces in three dimensions.

Pressure of heavy fluids, equilibrium of fluids under given system of forces Bernoulli's equation, centre of pressure, thrust on curved surfaces,
equilibrium of floating bodies, stability of equilibrium, metacentre, pressure of gases.

Vector Analysis:

Scalar and vector fields, triple, products, differentiation of vector function of a scalar variable, Gradient, divergence and curl in cartesian,
cylindrical and spherical coordinates and their physical interpretations. Higher order derivatives, vector identities and vector quations.

Application to Geometry: Curves in space, curvature and torision. Serret-Frenet's formulae, Gauss and Stokes' theorems, Green's identities.

Mathematics Paper II

Section-A

Algebra:

Groups, subgroups, normal subgroups, homomorphism of groups quotient groups basic isomorophism theorems, Sylow's group, permutation groups,
Cayley theorem. Rings and ideals, principal ideal domains, unique factorization domains and Euclidean domains. Field extensions, finite fields.

Real Analysis:

Real number system, ordered sets, bounds, ordered field, real number system as an ordered field with least upper bound property, cauchy sequence,
completeness, Continuity and uniform continuity of functions, properties of continuous functions on compact sets. Riemann integral, improper integrals,
absolute and conditional convergence of series of real and complex terms, rearrangement of series. Uniform convergence, continuity, differentiability and
integrability for sequences and series of functions. Differentiation of fuctions of several variables, change in the order of partial derivatives, implict
function theorem, maxima and minima. Multiple integrals.

Complex Analysis: Analytic function, Cauchy-Riemann equations, Cauchy's theorem, Cauchy's integral formula, power series, Taylor's series, Laurent's Series, Singularities, Cauchy's residue theorem, contour integration. Conformal mapping, bilinear transformations.

Linear Programming:

Linear programming problems, basic solution, basic feasible solution and optimal solution, graphical method and Simplex method of solutions. Duality.

Transportation and assignment problems. Travelling salesman problmes.

Section-B

Partial differential equations:

Curves and surfaces in three dimesnions, formulation of partial differential equations, solutions of equations of type dx/p=dy/q=dz/r; orthogonal trajectories,
pfaffian differential equations; partial differential equations of the first order, solution by Cauchy's method of characteristics; Charpit's method of solutions,
linear partial differential equations of the second order with constant coefficients, equations of vibrating string, heat equation, laplace equation.

Numerical Analysis and Computer programming:

Numerical methods: Solution of algebraic and transcendental equations of one variable by bisection, Regula-Falsi and Newton-Raphson methods, solution of system of
linear equations by Gaussian elimination and Gauss-Jordan (direct) methods, Gauss-Seidel(iterative) method. Newton's (Forward and backward) and Lagrange's method of
interpolation.

Numerical integration: Simpson's one-third rule, tranpezodial rule, Gaussian quardrature formula.

Numerical solution of ordinary differential equations: Euler and Runge Kutta-methods.

Computer Programming: Storage of numbers in Computers, bits, bytes and words, binary system. arithmetic and logical operations on numbers.
Bitwise operations. AND, OR , XOR, NOT, and shift/rotate operators. Octal and Hexadecimal Systems. Conversion to and form decimal Systems.

Representation of unsigned integers, signed integers and reals, double precision reals and long integrers.

Algorithms and flow charts for solving numerical analysis problems.

Developing simple programs in Basic for problems involving techniques covered in the numerical analysis.

Mechanics and Fluid Dynamics:

Generalised coordinates, constraints, holonomic and non-holonomic , systems. D' Alembert's principle and Lagrange' equations, Hamilton equations, moment of intertia,
motion of rigid bodies in two dimensions.

Equation of continuity, Euler's equation of motion for inviscid flow, stream-lines, path of a particle, potential flow, two-dimensional and axisymetric motion,
sources and sinks, vortex motion, flow past a cylinder and a sphere, method of images. Navier-Stokes equation for a viscous fluid.

November 13, 2009

Active Directory Concepts

Local Security Settings

Account Policies

Password Policy

1. Enforce Password History
To remember passwords so that user cannot use the same
password while resetting or changing.
Default
24 - Domain Controller
0 - Stand Alone Servers
2. Maximum Password Age
No. Of Days after which the password expires.
0 - Never Expires
3. Minimum Password Age
Min No. Of Days after which a password can be
changed.
>0 - To enforce Password History.
4. Minimum Password Length
length of the password
Default
7 - Domain Controller
0 - Stand Alone Server
5. Password Complexity
Enabled/Disabled
6. Store passwords using reversible encryption
Enabled/Disabled

Account LockOut Policy

1. Account Lockout Threshold
No. Of failed logon attempts that causes a user
account to be locked out.
0 - Account Never Locks out.
2. Account Lockout Duration
No. Of minutes a locked out account will remain
locked out before getting unlocked.
0 - Admin must unlock
>0 - Must be Greater than reset time.
3. Reset Account Lockout
No. of minutes that must elapse after a failed
logon attempt before the counter is reset to zero.
If account lockout threshold is specified, reset time
must be less than or equal to account lockout
duration.

Start -- Run -- Cmd

1. net accounts
2. net accounts \lockoutthreshold:0
3. net accounts \lockoutduration:1
4. net accounts \lockoutwindow:0

if \lockoutthreshold:6 then

1. net accounts \lockoutthreshold:6
2. net accounts \lockoutduration:1
3. net accounts \lockoutwindow:1

It says, in one min if we get six invalid attempts
the account will be locked out for one min.
The way we read this is 3....1....2

Feedback with sharepoint Blog template

1. Site Level..Site Settings.
2. Sites and Workspaces.
3. Create
4. Select Collaboration Blog template
5. Go to Site Actions---Navigation for Feedback site.
6. Global: Display the Same Navigation items as the parent site.
7. Current: Display the Same Navigation items as the parent site.
8. Delete all folders in Navigation.
9. Go To site action..Global navigation[Main Site]
10. Add Heading and Set Audience.
11. Add Links to that Folder.
Note: Url shud be Relative like /sites/....etc
12. Get Urls from New Post with redirect to all posts.
13. All Posts.aspx...Remove unnecessary Web Parts
14. New Post.aspx....Remove unnecessary web parts
15. default.aspx.....Remove unnecessary web parts
16. Click on any post and edit the page.
17. Modify Shared web part for the list.
18. Edit the Current View and Uncheck what all we dont need.
19. Same in Default.aspx
20. For List...Settings..List Settings.
21. Versioning Settings and set the required content approval.
22. Advanced Settings and set Read Access to Only their Own
and Edit access to Only Their Own.
23. Permissions for this list.
24. To create one new permission level..click People and groups for the main site.
25. Click Site Permissions
26. Settings....Permission Levels.
27. Edit Permission Levels
28. Add a Permission level
29. Check...
List Permission: Add Items,Edit Items, View Items, Open Items.
Site Permission: View Pages,Open,Edit Personal Info
Personal Permission: Check ALL
30. Then Go To List.
31. Settings...List Settings...Permission for the list.
32. Assign our new permission level to the desired groups.
33. Hide any Columns from View in the list by clicking on the column from list settings.
34. To Hide any rows from the NewpOst.aspx, Open Sharepoint Designer.
35. Access Windows auth Url and open Our sites and workspace.
36. Lists...Posts...NewPost.aspx...Check Out.
37. After The Code Block
</WebPart>
</WebPartPages:ListFormWebPart>
</ZoneTemplate></WebPartPages:WebPartZone>
<IMG SRC="/_layouts/images/blank.gif" width=590 height=1 alt="">
</td>
</tr>
</table>
38. Add Code Block Before </asp:Content>
<script language="javascript" type="text/javascript">
_spBodyOnLoadFunctionNames.push("hideRows");
function hideRows()
{
var pageTables = document.getElementsByTagName('table');
var cName = null;
var formTables = null;
for(var i=0; i < pageTables.length; i++){
cName = pageTables[i].className;
if (cName == "ms-formtable"){
formTables = pageTables[i];
}
}
var rows = formTables.rows;
rows[rows.length-2].style.display = "none";
rows[rows.length-3].style.display = "none";

}
</script>39. Check In or Publish.
40. IIS Rest Probably and Check the Site.

November 12, 2009

Search In Sharepoint

Search functioanlity

1. Get the Url for the one which you want to implement search.
Note: Url needs to be a windows Url, Forms will be automatically taken care.
Note: Forms Based Auth Url will not be set to crawled.
2. Go to central Admin age
3. Go to Shared Services Administration.
4. Create a New SSP with new admin application and new site location url.
5. Select the Index server, if none create one from central admin
6. Change Associations for web applications.
7. Search Settings
8. Content Sources and Crawl Schedules
9. New Content Source
10. Enter the Windows Url's in Start addresses for Sharepoint Sites.
11. Schedule Full Crawl and Incremental Crawl
12. Again Search Settings
13. File Types
14. Enter all extensions we use in our site.
Note: If this file type is not there here, default image will be seen in search results
15. Crawl Logs
Note: All crawled Content, Errors will be logged here.
16. Default Contenet Access Acount
17. Reset All Crawled Content
18. Site Level...site Settings.
19. Search settings
20. Use Custom Scopes..Give the Search center Url
Note: Create the Search Center from Sites and workspaces before this step.
21. View Scopes.
Note: Scopes will be visible in drop downs
22. New Scope and attach to Display Group.
23. Click on Scope and New Rule
24. Choose the Behaviour for that Scope.
25. Go to central Admin Again
26. Shared Services, Search Settings.
27. Start Full Crawl and Searh.
Note: For Folders there wont be any file type extension so,
it will give default IE image in search results.
To fix that we need to modify the Search Core Results Web Part.
28. Code Block
<!-- This template is called for each result -->
<xsl:template match="Result">
<xsl:variable name="id" select="id"/>
<xsl:variable name="url" select="url"/>
<span class="srch-Icon">
<a href="{$url}" id="{concat('CSR_IMG_',$id)}" title="{$url}">
<img align="absmiddle" src="{imageurl}" border="0" alt="{imageurl/@imageurldescription}" />
</a>
</span
>
Add Code Block
<xsl:variable name="isdoc" select="isdocument"/>
After Code Block
<xsl:variable name="id" select="id"/>
<xsl:variable name="url" select="url"/>
and replace Code Block
<img align="absmiddle" src="{imageurl}" border="0" alt="{imageurl/@imageurldescription}" />
by Code Block
<xsl:if test="$isdoc = 0">
<img align="absmiddle" src="/_layouts/images/folder.gif" border="0" alt="{imageurl/@imageurldescription}" />
</xsl:if>
<xsl:if test="$isdoc = 1">
<img align="absmiddle" src="{imageurl}" border="0" alt="{imageurl/@imageurldescription}" />
</xsl:if>
29. If any new images place in
\\cxiricdc02\c$\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\IMAGES
30.Note: Change the DOCICON.XML in \\cxiricdc02\c$\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\XML
Add <Mapping Key="pdf" Value="pdf_icon_002.gif"/> in the <ByExtension> Tag.
31. IIS Reset and You are Good to Go with search Functionality.

Sharepoint Development Picture

1. Windows Server 2003/2008
Note: Install Service Pack 3
2. Install SQL Server 2005/2008.
3. Install WSS 3.0
4. Install MOSS 2007.
Note: Avoid Service Packs
5. COnfigure Moss 2007 using
Sharepoint Products and Technologies
Configuration Wizard.
6. Central administration
7. Create a SSP
8. Configure Central Admin Page
9. Create a Site Collection
10.Authentication
11.Role Provider, Register in GAC
12.Web.Config for Membership provider
and Role Provider.
13. Custom Lists
14. People and Groups
15. Permission Levels.
16. Site settings
17. Create Sites and workspaces
18. Blog for Feedbacks
19. Search Center
20. Shared Services in central
21. Content sources
22. Crawling
23. Reports
24. Report Server Configuration
25. Native Mode/Integrated Mode
26. Navigation
27. Sharepoint Designer
28. Workflows for Lists
29. Active Directory
30. IIS

November 04, 2009

Search for Folders[To Bring folder icon instead of default IE]

If no extension, search will give default IE Icon.
Just find this code in the XSL for the core result webpart:

Code Block
<!-- This template is called for each result -->
<xsl:template match="Result">
<xsl:variable name="id" select="id"/>
<xsl:variable name="url" select="url"/>
<span class="srch-Icon">
<a href="{$url}" id="{concat('CSR_IMG_',$id)}" title="{$url}">
<img align="absmiddle" src="{imageurl}" border="0" alt="{imageurl/@imageurldescription}" />
</a>
</span>

Add
Code Block
<xsl:variable name="isdoc" select="isdocument"/>

After
Code Block

<xsl:variable name="id" select="id"/>
<xsl:variable name="url" select="url"/>

and replace
Code Block
<img align="absmiddle" src="{imageurl}" border="0" alt="{imageurl/@imageurldescription}" />

by
Code Block

<xsl:if test="$isdoc = 0">
<img align="absmiddle" src="/_layouts/images/folder.gif" border="0" alt="{imageurl/@imageurldescription}" />
</xsl:if>
<xsl:if test="$isdoc = 1">
<img align="absmiddle" src="{imageurl}" border="0" alt="{imageurl/@imageurldescription}" />
</xsl:if>

It is not as clean as I would because I hard-coded the src path.
I did not find out where the {imageurl} variable is extracted (if someone could help).

October 12, 2009

Sharepoint: XML File Upload, File Level,Folder Level, Group Creation etc

---XML Doc---
<?xml version="1.0" encoding="utf-8" ?>
Products>
<Product Name="Product1">
<File>
<Title>1.txt</Title>
<Groups>One,Two,Three</Groups>
</File>
<File>
<Title>2.txt</Title>
<Title>3.txt</Title>
<Groups>Two</Groups>
</File>
<File>
<Title>4.txt</Title>
<Title>5.txt</Title>
<Groups>Three</Groups>
</File>
</Product>
<Product Name="Product2">
<File>
<Title>6.txt</Title>
<Title>7.txt</Title>
<Groups>Four,Six</Groups>
</File>
</Product>
<Product Name="Product3">
<File>
<Title>8.txt</Title>
<Title>9.txt</Title>
<Groups>Five</Groups>
</File>
</Product>
<Product Name="Product4">
<File>
<Title>10.txt</Title>
<Title>11.txt</Title>
<Groups>Five,Six</Groups>
</File>
</Product>
</Products>
---Button Click---
DirectoryInfo Dir = new DirectoryInfo(@"FolderURL");
FileInfo[] CxiFiles = Dir.GetFiles();
foreach (FileInfo fi in CxiFiles)
{
XmlTextReader Reader = new XmlTextReader(Dir.ToString() + fi.ToString());
Reader.WhitespaceHandling = WhitespaceHandling.None;
XmlDocument XmlDoc = new XmlDocument();
XmlDoc.Load(Reader);
Reader.Close();
XmlNode RootNode = XmlDoc.DocumentElement;
Children(RootNode, 1);
lines = lines.Replace("|", "\r\n");
}

------Main Logic---
private void Children(XmlNode xnod, Int32 intLevel)
{
SPSecurity.RunWithElevatedPrivileges(delegate()
{
XmlNode xnodWorking;
XmlNode node1;
string ListName = "Docs";
SPSite siteCollection = new SPSite(@"URL");
SPWeb siteWeb = siteCollection.RootWeb;
SPListCollection spList = siteWeb.Lists;
SPFolder spFolder = null;
if (xnod.Name.Substring(0, 4) == "Prod")
{
if (siteWeb.GetFolder(ListName + "/" + xnod.Attributes[0].Value).Exists == true)
{
spFolder = siteWeb.Folders[ListName].SubFolders[xnod.Attributes[0].Value];
SPListItem item = spFolder.Item;
item["DocType"] = "Folder";
item["Product Name"] = spFolder.Name;
item.Update();
}
else
{
spFolder = siteWeb.Folders[ListName].SubFolders.Add(xnod.Attributes[0].Value);
SPListItem item = spFolder.Item;
item["DocType"] = "Folder";
item["Product Name"] = spFolder.Name;
item.Update();
}
}
if (xnod.Name.Substring(0, 4) == "File")
{
node1 = xnod.FirstChild;
while (node1 != null)
{
spFolder = siteWeb.Folders[ListName].SubFolders[xnod.ParentNode.Attributes[0].Value];
spFolder.Item.BreakRoleInheritance(false);
siteWeb.AllowUnsafeUpdates = true;
if (node1.Name.Substring(0, 1) == "T")
{
string FilePath = @"C:\Source Folder\" + node1.InnerText;
string FileName = System.IO.Path.GetFileName(FilePath);
string DocType = node1.Attributes["DocType"].Value;
System.IO.FileStream Strm = new System.IO.FileStream(FilePath, System.IO.FileMode.Open, System.IO.FileAccess.Read);
System.IO.BinaryReader reader = new System.IO.BinaryReader(Strm);
Byte[] filecontents = reader.ReadBytes(Convert.ToInt32(Strm.Length));
reader.Close();
Strm.Close();
spFolder.Files.Add(System.IO.Path.GetFileName(FilePath), filecontents, true);
SPListItem item = file.Item;
item["DocType"] = DocType;
item["Product Name"] = spFolder.Name;
item.Update();
node1 = node1.NextSibling;
}
else
if (node1.Name.Substring(0, 1) == "G")
{
//string Grps = xnod.FirstChild.NextSibling.InnerText;
string Grps = node1.InnerText;
string[] grps = Grps.Split(',');
foreach (string g in grps)
{
try
{
if (siteWeb.SiteGroups[g] != null)
{
SPGroup group2 = siteWeb.SiteGroups[g];
SPRoleDefinition RoleDefinition = siteWeb.RoleDefinitions["Read"];
SPRoleAssignment RoleAssignment = new SPRoleAssignment((SPPrincipal)siteWeb.SiteGroups[g]);
RoleAssignment.RoleDefinitionBindings.Add(RoleDefinition);
siteWeb.RoleAssignments.Add(RoleAssignment);
spFolder.Item.RoleAssignments.Add(RoleAssignment);
SPList lst = siteWeb.Lists[ListName];
SPListItemCollection items = lst.Items;
foreach (SPListItem item in items)
{
foreach (XmlNode x in node1.ParentNode.ChildNodes)
{
if (item.Name == x.InnerText)
{
item.BreakRoleInheritance(false);
item.RoleAssignments.Add(RoleAssignment);
item.Update();
}
}
}
}
}
catch (SPException ex)
{
SPMember member = siteWeb.SiteUsers["admembershipprovider:krish.banerjee"];
SPUser usr = siteWeb.SiteUsers["admembershipprovider:krish.banerjee"];
siteWeb.SiteGroups.Add(g, member, usr, g);
AddToValidDomains(g);
SPGroup group2 = siteWeb.SiteGroups[g];
SPRoleDefinition RoleDefinition = siteWeb.RoleDefinitions["Read"];
SPRoleAssignment RoleAssignment = new SPRoleAssignment((SPPrincipal)siteWeb.SiteGroups[g]);
RoleAssignment.RoleDefinitionBindings.Add(RoleDefinition);
siteWeb.RoleAssignments.Add(RoleAssignment);
spFolder.Item.RoleAssignments.Add(RoleAssignment);
SPList lst = siteWeb.Lists[ListName];
SPListItemCollection items = lst.Items;
foreach (SPListItem item in items)
{
if (item.Name == node1.PreviousSibling.InnerText)
{
item.BreakRoleInheritance(false);
item.RoleAssignments.Add(RoleAssignment);
item.Update();
}
}
}
}
spFolder.Update();
node1 = node1.NextSibling;
}
}
}
if (xnod.NodeType == XmlNodeType.Element)
{
if (xnod.HasChildNodes)
{
xnodWorking = xnod.FirstChild;
while (xnodWorking != null)
{
Children(xnodWorking, intLevel + 1);
xnodWorking = xnodWorking.NextSibling;
}
}
}
lblError.Text = "Success";
});
}

Feedback Workflow Attributes: Sharepoint

Just a quick handy for creating a Sharepoint workFlow sending an email.

1. Actions for Post WorkFlow
1. Subject: CurrentItem:Title
2. Posted By: CurrentItem:PostedBy
3. EncodedAbsoluteUrl/../Post.aspx?ID=CurrentItem:ID
4. span...p..b..body...b..p..span
5. Thanks
2. Actions for Comments WorkFlow
1. Subject: CurrentItem:PostTitle
2. Posted By: Feedbacks..PostedBy..Feedbacks:CreatedBy...Comments:CreatedBy
3. Url: Feedbacks...EncodedUrl...Feedbacks:ID...Comments:PostID
4. Ur;/../Post.aspx?ID=
5. ID: Feedbacks...ID...Feedbacks:ID...Comments:ID
6. Thanks

October 07, 2009

Scopes---Sharepoint

Step 1: Go to "Site Actions", "Site Settings" and under "Site Collection Administration" click on "Search Scopes".

Step 2: Click on "New Scope" and give it a title. Usually the document library you wish to search. Click "OK"

Step 3: Now we need to add a rule. Go to the document library you wish to search and grab the URL. Then repeat Step 1 to get back to the search scope settings page. Click on the search scope you created in Step 2. Under the "Rules" section click on "New Rule". Select "Web Address" and enter the URL of your document library. Click "OK".

Step 4: Click on "New Display Group" and give it a title and a description. In the "Scopes" section select the scope you created in Step 2. The "Default Section" should automatically become the scope you selected.

Step 5: Wait for the server to recognize the new scope and display group.

Step 6: Go back to the page you wish to add a search box. Go to "Site Actions", "Edit Page", click on "Add a Web Part". Select the "Search Box" web part and click "Add".

Step 7: The page should be in "Edit Mode". In the "Search Box" web part click on the "edit" button and go to "Modified Shared Web Part".

Step 8: Expand the "Miscellaneous" section. Uncheck "Use site level defaults". In the "Scope Display Group" sub-section the default display group scope will be "Search Dropdown" change this to the display group you created in Step 4. You cannot browse through the display groups so you will have to type your display group in exactly. Click on "OK".

Step 9: Exit out of "Edit Mode". Your search box should now have the new search scope you created in Step 2 as the default choice.

October 06, 2009

Open A Document in new Window..Sharepoint

Hi All,

Let's take one scenario where your client does not have office installed and you also want to deal with document library.

Now we know that there is a settings in document library settings that if client do not have office installed at machine, then MOSS will automatically open document in the browser window. it automatically check for the availability of office at client side and if not found then opens it in same browser.

The settings for this is as follows :

(1) Go to your document library.
(2) Click on Settings-> document library settings
(3) Click on advanced settings
(4) Check for "Browser-enabled Documents" section and select Display as a Web page.
(5) Press OK.

Now you have set this option and if your client does not have office installed then MOSS will automatically open document in browser.

but but but.....notice that it opens in same browser...So if you want that document opens in new windows, not in the same browser then.....???

so Here is a trick to go for it :

But remember that this change will apply to all document libraries of all web applications. Because we are going to change the Global onet.xml. So be aware..

Here we go..
(1) Open C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\GLOBAL\XML
(2)Open ONET.XML
(3)Search for this line onfocus="OnLink(this)" HREF="
(4)Change it to OnLink(this)" target="_new" HREF="
(5)Rest the IIS and just check.....
now all documents will open in new window..
Source: http://www.sharepointkings.com/2008/07/open-documents-in-new-window.html#

Sharepoint Errors and Solutions

1. Constraint violation Occured:
Solution: delete from AD and create again.
2. Invalid Padding Cryptographic Exception
Solution: In web.config of site, Add this under system.web
<machinekey validationKey="6DFDCDE9B71CA61A8DB213CA721B94E4636322D8B675CCD7"
decryptionKey="D0AA80E9A03C73823C7108E11046986717152C97EAEA7C02" validation="SHA1" />
3. Contsratint Violation from Directory Services
Solution: Attribute Editor in AD, attributeMapFailed.....
4. Service Unavailabe when accesing Sites
Solution: Application Pool may be disabled.
1. Configurable in Application Pool Properties ...the password might be changed.
5. net accounts [For Setting Password Policy in AD]
net accounts /minpwage:7
net accounts /minpwlen:7
net accounts /uniquepw:5
6. If role provider doesn't work..see the trust level = "Full" or not.
7. For Account Password Lockout Policy
.....Local Policy settings[Default Grayed Out]
.....From command Line
.....First Set net accounts /lockoutthreshold:30
...............net accounts /lockoutduration:30
...............net accounts /lockoutwindow:30
.....Now you can play aorund from UI itslef
8. You do not have nbecessar permisions...while deploying workflows using sharepoint designer.
Solution:
Click Start, point to All Programs, point to Microsoft Office Server, and then click SharePoint 3.0 Central Administration.
Click the Operations tab.
Under Security Configuration, click Service Accounts.
Click Web application pool, and then click Windows SharePoint Services Web Application in the Web service box.
In the Application pool box, click the application pool that you want to change.
Under Select an account for this component, click Configurable, and then type the user name
and the password for the different user account.
9. Encoded Absolute URl in Custom Workflow email..getting the last part as number.
Solution: [EncodedAbsoulteURL]/../Post.aspx?ID=[ID]
For Comments: Same as above with Lookup to parent one with ID's....I mean relate with PostId
10. How-To Delete SharePoint Shared Services Provider (SSP)
Dont Delete the databases before making sure in website they are deleted, otherwise ssp cannot be deleted.
stsadm -o deletessp -title YourSSPTitleHere -force
11. To Run stsadm commands from anywher
....Start---Control Panel---System---Advanced---Environmental variables---Path---Edit.
At the end of line add ;C:\Program Files\Common Files\microsoft shared\Web Server Extensions\12\BIN
12. Windows SharePoint Services Web Application [Never Ever Restart This Service]
When you stop the Web Application service,
it actually undeploys all the vdirs from IIS
and deletes the IIS web sites. Starting it deploys these again.
13. Crawling can be done only against Windows Authentication Websites.
If we have any forms based authentication then extend the website and give that url in the content sources crawling.
14. Internet Not Working in Server.
Server-->Set up DNs Correctly in TCP-IP Properties with Corect Primary IP.
15. Error:
One or more field types are not installed properly. Go to the list settings page to delete these fields.
Solution: Reset IIS first. if still prevails..it's problem with definitions change for the columns and column removals. Dont remove any column and it will work.
16. Restricting Access to tabs in Menu
Solution: Give Relative URL Like /sites/.... instead of absulute URL.
17. IP Address not resolving.
Solution: Central Admin..Operations...Alternative Access mapping..Give The Ip address in the Internet section
18. In the GetItems(SPQuery)..the SPQUERY should not have the query tag, otherwise it will bring all the items.

October 01, 2009

Create a New SharePoint Permission Level and Bind it to an Existing SharePoint Group

This example will create a new permission level, called Example_xxxxxxxxxxx. After creation, it binds the permission level to an existing SharePoint Group called Foo.

using (SPSite site = new SPSite( "http://moss/sites/PermExample" ))
{
using (SPWeb rootWeb = site.RootWeb)
{
string permissionLevelName = "Example_"+System.DateTime.Now.Ticks.ToString();

// Create a new Permission Level
SPRoleDefinition newPermissionLevel = new SPRoleDefinition();
newPermissionLevel.Name = permissionLevelName;
newPermissionLevel.Description = "Example Permission Level";
newPermissionLevel.BasePermissions =
SPBasePermissions.AddListItems |
SPBasePermissions.BrowseDirectories |
SPBasePermissions.EditListItems |
SPBasePermissions.DeleteListItems |
SPBasePermissions.AddDelPrivateWebParts;

// Add the permission level to web
rootWeb.RoleDefinitions.Add(newPermissionLevel);

// Bind to the permission level we just added
newPermissionLevel = rootWeb.RoleDefinitions[permissionLevelName];

// Create a new role Assignment using the SharePoint Group "Foo"
SPRoleAssignment roleAssignment = new SPRoleAssignment( (SPPrincipal)rootWeb.SiteGroups[ "Foo" ] );

// Add the Permission Level to the Foo SharePoint Group
roleAssignment.RoleDefinitionBindings.Add(newPermissionLevel);

// Add the new Role Assignment to the web
rootWeb.RoleAssignments.Add(roleAssignment);

rootWeb.Close();
}
site.Close();
}

July 20, 2009

Superstitions and Explanations

Half Knowing is not healthy especially in Superstitions..so here you go.

Most superstitions were born with an aim to protect and were based on sound reasoning. With time, however, much of the reasoning has been forgotten and the beliefs appear unsubstantiated. But there are also many beliefs that have no reason behind them.

Many omens relate to animals, birds and reptiles. The most auspicious omen is to see an elephant when one is on a journey, for it represents Ganesha, the god of good luck and the remover of obstacles. The cawing of a crow in one's house foretells the coming of guests. A peacock seen while on a journey is said to be good but hearing its shrill call indicates robbery by highway men. A dog howling near a sick man's chamber predicts his death. Seeing a cat or a cow's face early in the morning brings ill luck. A sparrow is encouraged to build a nest in a new house for good fortune. A yellow or white substance dropped on the threshold by a cow indicates the gain of gold or silver. To protect cats, which were useful in destroying rats and other pests, the Brahmins imposed a ban on its killing, to be redeemed expensively with an offering of a golden cat to a Brahmin.

The wall lizard boasts the most superstitions. Every movement of this reptile holds some significance, indeed, a science called the Gowli Shastra enumerates these. The colour, spots, stripes, chirping or twittering of the lizard and where it falls on a person's body are said to indicate future happenings.

Leaving on a journey is a very important occasion and precautions have to be taken depending on the importance of the journey. The astrologer is consulted to select an auspicious time to begin. There are several beliefs linked with starting on a journey. A sneeze or terms of dissuasion like "Stay, don't go", or "Where are you going?" used accidentally by someone at this crucial time are ill omens and a person must start again if this happens. It is considered auspicious to see cowdung, cereals, paddy, cotton, hay or a newly wed before starting on a journey.

There is also a strong belief in the power of dreams, as divine warnings. Dreaming of gods, demons, auspicious animals or any other auspicious thing is good. Whereas, dreaming of gold or iron, falling stars or earthquakes is bad. There are many people who claim to be able to decipher dreams and their talents are employed by believers.

Daily life is governed by do's and don'ts for each day of the week. Thus Monday is not an auspicious day for shaving or Tuesday for washing one's hair or Saturday for buying oil.

Most of these superstitions are linked to the respective planets presiding over each day (see Hindu Calendar). The kitchen is virtually the temple of a Hindu home and the highest levels of hygiene are expected to be maintained. Most Hindus do not enter a kitchen with their shoes on, as it is said to induce the wrath of the gods. This belief originated when kitchens were traditional, with mud stoves in a corner. Families sat on the floor and ate off plates or leaves placed on the ground. This required the kitchen to be absolutely clean. Another belief linked to this was that before eating their food, people sprinkled water around their plates supposedly in remembrance of their ancestors. Actually, the water around the plate acted as a barrier against the ants and insects that crept about the kitchen floor.

There are other common beliefs devised for protection. One should neither clip one's nails at night nor use scissors for fear of angering evil spirits. This diktat prevailed in the days before electricity as a deterrent to injuring one's fingers in the dark, but many mothers still enforce this rule at home, the reasoning being lost in time. A persistent belief is that one must not sweep the floor after the sunsets, otherwise Lakshmi would also be swept away. This too is a pre-electricity precaution against inadvertently losing fallen valuables.

Some other popular superstitions are if a person hiccups, it is believed that someone is talking about him or remembering him. One theory holds that this is a way of keeping alive the memory of family members who are travelling or live far away.

The falling of utensils on the floor foretells the coming of guests. Breaking a mirror is extremely inauspicious. This belief is meant to urge caution while handling something as fragile and potentially injurious as glass, as most people were barefoot inside the house.

To protect foolhardy wanderers from snakes and other lurking dangers, it is held that evil spirits infest trees and empty houses, resulting in a lively fear of going to these places at night.

There are also many superstitions related to a pregnant woman, which originated for her protection. Some of the most widespread are: A pregnant woman should not wander out alone at night or enter an empty house because evil spirits might infest her. The husband of a pregnant woman should not build a house as that might rouse the wrath of the earth spirit. He must not bathe in the sea for the seashore is thick with ghosts. All these rules were imposed on people, as ways to protect the prospective mother and father against any dangers. In addition, when a woman is pregnant, her husband's presence is important for moral support and help with the chores. Therefore unnecessary journeys or the involvement of the husband in any major tasks is postponed.

There is a superstitious belief in some parts of the country that when a child is born, its father must not see its face till it is six months old as it might lead to ill-luck. Therefore some time before the child is born, the mother is sent to her parents' home. This serves two practical purposes: the mother is pampered by her own mother, and so is the baby, as all the mother's attention is centered on her child, with no distractions of looking after her husband or doing other chores.

In the post-partum period and while menstruating, a woman is debarred from attending any ceremony. She is also not allowed to enter the kitchen or mingle with others, as she is believed to be impure and unclean at this time. The underlying idea is that a woman at this time requires complete rest and a religious edict protects her from unnecessary exertion. Personal appearance, gait, manner and speech are all said to indicate the future. The location, size and number of moles on the body brand someone as auspicious or inauspicious. It is believed that the presence of a sign resembling a wheel on any part of the body is extremely lucky. The right side of the body is considered to be more auspicious than the left. This is so because the left hand is used for all 'unclean' actions. Therefore a man ensures that he first puts his right foot into a house. All ceremonies are conducted with the right hand. Gifts are also given and accepted only with the right hand.

When the right hand itches it means good luck and the reverse applies to the left hand. This relates simply to the clean (right) and unclean (left) sides of the body. Paradoxically, twitching of the right eye is considered inauspicious and of e left eye, auspicious.

Marriage, one of the most important events in life, has many superstitions associated with it. It is believed that a new bride brings luck and prosperity with her and that her fortune is mingled with that of the groom's family. For the first one year of marriage, all happenings in the family are monitored and accordingly the bride is termed auspicious or inauspicious. Any good or bad occurrence in the family during this time is said to result from the presence of the bride. A new bride is however, generally considered to be auspicious.

On the other hand, widows were considered especially inauspicious. This belief probably stemmed from her traditional financial powerlessness. Widows were debarred from attending any auspicious ceremony, as it was believed that their presence might negatively affect its success. A new bride was protected from the glance of a widow for the same reason. Therefore widows had separate areas to live in where they cooked their own food. They were not allowed to eat meat, onions, garlic or spices for these were considered excitatory, and a widow was supposed to suppress, not inflame her passions. Most of these rules have fallen into disuse now.

A barren woman is still considered inauspicious by many, given the patriarchal social system and its emphasis on children especially sons. Such a woman, though not debarred, is avoided during all auspicious occasions by those with a rigidly traditional outlook. During the nuptial bath and other ceremonies related to marriage, which require the presence of suhagans, it is generally women with sons, pregnant women or the newly married, who participate. A barren woman is not brought near a bride or child for whom a ceremony is being performed for fear that her ill fate will rub off onto them.

People are also very superstitious about their mornings. It is believed that the whole day is affected by the morning. Seeing a bride, the statue of a deity, or a Brahmin is considered auspicious, while sighting widows, barren women and unlucky people is considered inauspicious. To avoid the risk

of seeing anything unpleasant in the morning, many people look at the palms of their hands as soon as they awaken and recite this invocation: "In the tips of the fingers resides Lakshmi; in the middle, Sarasvati; in the palm of the hand resides Parvati; looking at my hands, I begin my day."

There are also many superstitions related to death. The most important among them is that food is not cooked in a house where death has occurred. At this time, all the members of the family are considered to be unclean and do not enter the kitchen. Neighbors are expected to cook and send food for them. This belief probably results from the fact that when a death occurs in a family, the relatives of the deceased are , and have neither the desire nor the time to cook. This practice also reinforces the sense of community at times of trouble.

Hinduism - A Way of Life

Caste System/ State of Mind
1. Priests
2. Warriors/Rulers
3. Merchants/Farmers
4. Laborer
5. Sin People

According to Individual Personal Actions he will be in one of the above State's at that particular moment.

God
1. Creator
2. Preserver
3. Destroyer

Karma
1. Good Begets Good
2. Bad Begets Bad

Reincarnation
1. Good Karma - Higher Caste/State
2. Bad Karma - Lower Caste/State

Niravana
1. Tuning into the Brahma Within.

Sri Rama
1. As a Son
2. As a Brother
3. As a Husband
4. As a Priest
5. As a Warrior
6. As a Merchant/Farmer
7. As a Relative
8. As a Friend
9. As a Student
10. Elder's / Youngster's
11. Friends/Foe's
12. Small/Big

Man/Women
1. Food
2. Sleep
3. Fear
4. Sex & Pleasure
5. Dharma - Control & Discipline

Yoga Sutras
1. Maitribhavana
Be Friendly with Others
2. Karunabhavana
Be Kind to Others
3. Muditabhava
Be in Touch with others who are more knowledgeable
and respectable in this Society
4. Upekshabhava
Keep away from those who always keep expectations from you.

Sarvagamanamachara Prathamam Parikalpate
Aacharaprabhavo Dharma Dharmasya Prabhurachyutaha

To be with Correct Aachara is given first priority as per our Dharma Shastra.
Being in good achara will only give birth to Dharma.
And Being to Dharma only once can achieve Darshana to God.
Those who live according to Dharma are treated as Pavithra Atma and full of Character.
Only these kind of People are given importance in society and are liked by God.

July 16, 2009

Create an EXE file from Windows Application

Visual Studio 2005 Setup and deployment Projects provides to make a exe in .NET windows application is easy and rapidly

Visual Studio provides templates for four types of deployment projects: Merge Module Project, Setup Project, Web Setup Project, and Cab Project. In addition, a Setup wizard is provided to help step you through the process of creating deployment projects. You can see the templates and the wizard in the New Project dialog box under the Setup and Deployment Projects node.

The following are guidelines for choosing the right type of deployment project for your project.

1)Merge Module Project : Packages components that might be shared by multiple applications.

2)Setup Project : Builds an installer for a Windows-based application.

3)Web Setup Project : Builds an installer for a Web application.

4)Cab Project : Creates a cabinet file for downloading to a legacy Web browser.

5)Smart Device Cab Project : Creates a Cab project to deploy device applications.

This topic demonstrates deployment using a Setup and Deployment Project.

Setup Projects

Setup projects allow you to create installers in order to distribute an application. The resulting Windows Installer (.msi) file contains the application, any dependent files, information about the application such as registry entries, and instructions for installation. When the .msi file is distributed and run on another computer, you can be assured that everything necessary for installation is included; if for any reason the installation fails (for example, the target computer does not have the required operating system version), the installation will be rolled back and the computer returned to its preinstallation state.

After you have developed your windows apllication,now you want to make a exe.how can? These steps are gives the guidance to you…

1, Go to file menu > click Add > new project >now “Add New Project” Dialog appear.

2.Select “Other Project Types” and click “Setup and Deployment” projects,Choose “Setup Project”give name project name in name text box finally click OK.

3.New project appear in solution explorer,for example you give the name “MyEXE”..it will display with this name.

4.right click the MyEXE > go View > click “File System”

5.You can see the “File System on TargetMachine”under three folders
Application Folder
User’s Desktop
User’s Program Menu

6.Select Application Folder and right click Add>Project Output>select Primary output

7. select User’s Desktop richt click on the second window>click create new shortcut>select output file from Application folder>change the file name from primary output name to MyEXE

next >>

same procedure follows the user’s program menu also

8.If you want to change the Manufactures name for exe,just right click the project go to properties

change the properties as per you requirement

9.Finally Build the new project After successfully Build the project myEXE(Setup) will be appear in Application Debug or Release folder(depend upon the properties settings)

EXE available @ this location

When you want to install the EXE on the client machine,you should be installed .NET Framework on that mc because,Applications and controls written for the .NET Framework version 2.0 require the .NET Framework Redistributable Package version 2.0 to be installed on the computer where the application or control runs.

July 14, 2009

Fruits

EATING FRUIT - Guide

We all think eating fruits means just buying fruits, cutting it and just popping it into our mouths. It's not as easy as you think It's important to know how and when to eat..

What is the correct way of eating fruits?

IT MEANS NOT EATING FRUITS AFTER YOUR MEALS! - FRUITS SHOULD BE EATEN ON AN EMPTY STOMACH.

If you eat fruit on an empty stomach, it will play a major role to detoxify your system, supplying you with a great deal of energy for weight loss and other life activities.

FRUIT IS THE MOST IMPORTANT FOOD - Let's say you eat two slices of bread and then a slice of fruit.. The slice of fruit is ready to go straight through the stomach into the intestines, but it is prevented from doing so.

In the meantime the whole meal rots and ferments and turns to acid.. The minute the fruit comes into contact with the food in the stomach and digestive juices, the entire mass of food begins to spoil.

So please eat your fruits on an empty stomach or before your meals! You have heard people complaining - every time I eat water-melon I burp, when I eat durian (fruit from Asia with a foul smell yet delicious flavor) my stomach bloats up, when I eat a banana I feel like running to the toilet etc. - actually all this will not arise if you eat the fruit on an empty stomach. The fruit mixes with the putrefying other food and produces gas and hence you will bloat!

Graying hair, balding, nervous outburst, and dark circles under the eyes - all these will not happen if you take fruits on an empty stomach.

There is no such thing as some fruits, like orange and lemon are acidic, because all fruits become alkaline in our body, according to Dr. Herbert Shelton who did research on this matter. If you have mastered the correct way of eating fruits, you have the Secret of beauty, longevity, health, energy, happiness and normal weight.

When you need to drink fruit juice - drink only fresh fruit juice, NOT from the cans.. Don't even drink juice that has been heated up. Don't eat cooked fruits because you don't get the nutrients at all. You only get to taste.
Cooking destroys all the vitamins.

But eating a whole fruit is better than drinking the juice. If you should drink the juice, drink it mouthful by mouthful slowly, because you must let it mix with your saliva before swallowing it.

You can go on a 3-day fruit fast to cleanse your body. Just eat fruits and drink fruit juice throughout the 3 days and you will be surprised when your friends tell you how radiant you look!

KIWI: Tiny but mighty. This is a good source of potassium, magnesium, vitamin E & fiber. Its vitamin C content is twice that of an orange.

APPLE: An apple a day keeps the doctor away? Although an apple has a low vitamin C content, it has antioxidants & flavonoid which enhances the activity of vitamin C thereby helping to lower the risks of colon cancer, heart attack & stroke.

STRAWBERRY: Protective Fruit. Strawberries have the highest total antioxidant power among major fruits & protect the body from cancer-causing, blood vessel-clogging free radicals.

ORANGE: Sweetest medicine, eating 2 to 4 oranges a day may help keep colds away, lower cholesterol, prevent & dissolve kidney stones as well as lessens the risk of colon cancer.

WATERMELON: Coolest thirst quencher. Composed of 92% water, it is also packed with a giant dose of glutathione, which helps boost our immune system. They are also a key source of lycopene - the cancer fighting oxidant. Other nutrients found in watermelon are vitamin C & Potassium.

GUAVA & PAPAYA: Top awards for vitamin C. They are the clear winners for their high vitamin C content. Guava is also rich in fiber, which helps prevent constipation. Papaya is rich in carotene; this is good for your eyes.

Drinking Cold water after a meal = Cancer! Can you believe this??

For those who like to drink cold water, this article is applicable to you.

It is nice to have a cup of cold drink after a meal. However, the cold water will solidify the oily stuff that you have just consumed. It will slow down the digestion.. Once this 'sludge' reacts with the acid, it will break down and be absorbed by the intestine faster than the solid food. It will line the intestine. Very soon, this will turn into fats and lead to cancer. It is best to drink hot soup or warm water after a meal.

A cardiologist says if everyone who gets this mail sends it to 10 people, you can be sure that we'll save at least one life. Read this...It could save your life!

July 13, 2009

C# Text/Excel Export

------------------> Text Dump <-----------------------

System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;
response.ClearContent();
response.Clear();
response.ContentType = "text/plain";
response.AddHeader("Content-Disposition", "attachment; filename=" + FileName + ";");
response.Flush();
response.End();

------------------> Excel Dump <----------------------

public static void ExportDataSetToExcel(DataTable ds, string filename)
{
HttpResponse response = HttpContext.Current.Response;
// first let's clean up the response.object
response.Clear();
response.Charset = "";
// set the response mime type for excel
response.ContentType = "application/vnd.ms-excel";

response.AddHeader("Content-Disposition", "attachment;filename=\"" + filename + "\"");
// create a string writer
using (StringWriter sw = new StringWriter())
{
using (HtmlTextWriter htw = new HtmlTextWriter(sw))
{
//instantiate a datagrid
DataGrid dg = new DataGrid();
dg.DataSource = ds;
dg.DataBind();
dg.RenderControl(htw);
response.Write(sw.ToString());
response.End();
}
}
}

January 11, 2009

= Aloha & Mahalo Daily =


1. Practice random acts of connection.
Really. It works. Wave to a firefighter. Smile at a cop. Salute a soldier. Hang with a kid. Have a friendly conversation with the cashier. Leave an outrageously generous tip. Drop into a shelter. Volunteer at a literacy program. Show up at a community fund-raising event. Serve others. When you give, you feel more connected to other people.And if you're not naturally motivated to reach out to others, think selfishly: any altruistic gesture—from buying someone a coffee to letting another driver in front of you—puts you on the fast track to feeling good.
2. Make at least one just-for-fun phone call a day.Water your field of dreams—your energy field! Call a friend who is consistently fun to talk to. Just for the heaven of it! … not for business or to have any other need met. Simply ring someone up for a sociable hello without any agenda or expectation.
3. Look upon life as a Mystery School.Welcome serendipity. Invite surprise. Cultivate spontaneity. Notice synchronicity. Know that the whole of your life—events, situations and people—has been secretly structured by your soul in order to bring you the experiences you want to have this lifetime. Approach life as if the whole of creation is conspiring to bring you goodness …because it is! Realize that unpleasant people and situations are deliberately placed in your path as a challenge to help you grow big enough to embrace even them.
4. Have an exciting destination.Seek wonder. Go toward joy, ease and adventure—not simply away from boredom, pain, struggle and fear. Don't dwell on the old. Focus on your destination—move towards a fun future.
5. Rejoice each step of the way.To keep from being overwhelmed—yet still make headway—break your larger goals down into more manageable steps. It's easy to become discouraged if each step looms large and requires a major expenditure of time. Take at least one action a day—no matter how minor. Then you can make some progress only if you have a few minutes. It may be something as little as gathering or setting out the materials for the next stage.As you take small steps, check them off as achieved. Give yourself a pat on the back for your progress. Always focus on the advancement you've made as being just as important as the distance you have yet to go.
6. Strive for success—not for perfection.Give up perfectionism! Perfectionism goes hand in hand with fear of success and failure. We feel in order to succeed we must be perfect. As perfectionists, we insure that we will never be satisfied with who we are. Giving up perfectionism means seeing the good in our lives rather than the faults, focusing on what is working rather than what is not working. Celebrate success in one aspect of your life each day. Look for the positive. Ask, "What did I do that was on the mark? Which parts of my day went well? What am I happy about?" This approach and attitude helps take the sting out of the aspects of your life that seem lacking.
7. Take a daily mini-vacation.Take 15 minutes each day to do . . . nothing! Nothing of any significance whatsoever. We need time each day to not race against the clock or be productive. As we slow down, our spirit is free to be restored and creative. Go on a walk. Listen to music. Sit on the couch. Dance, run, jog, skip or stretch. Write, paint or sketch. Pet an animal or plant. Listen to the wind. Take yourself on a date. Do something that is alive and energizing for you. The point is to relax. No multi-tasking. Don't live in your daily planner.And take a break from technology for a while. Turn off your phone, fax and pager. Our modern conveniences have made us more accessible and vulnerable to other's agendas and demands.
8. Just say "No."Consider everything you habitually say "Yes" to each day. Community involvement. Errands for family. Favors for friends. Daily calls. Regular visits. Take time to consult with your spirit. Ask, "Is this activity at this time, in this way, really serving me? Is this the wisest use of my time and energy for all concerned in the long run? Is this activity giving me more energy than it is ultimately taking?
If the answer to these questions is "No," then your answer to the activity should be "No."In saying "No" to the people and events that aren't intuitively right for you, you are actually saying "Yes" to yourself—and to the people and values that mean the most to you. If you allow yourself to be tied up with disharmonious, non-aligned situations, you can't be available to share your true gifts with your family, friends and the world at large.
9. Give yourself a place lift.Do you long for more expanse, efficiency, easy flow and elbow room in your life? By intuitively re-arranging the elements of your daily life, you can create the space to nurture the fun, freedom, opportunities and effectiveness you desire. By clearing out the old, dead elements of your life, you create a natural vacuum and an unblocked channel for fresh, new energy and ideas to come into your private and professional life.
10. Share your life experience.Keep in mind that not everyone knows what you know. Your personal experiences can be valuable to others. You might be surprised by what some people don't know about life! I always am. We thrive when we feel we are valued and have left the world a better place at the end of each day. Leave a grand legacy. Happiness comes from sharing happiness. There are few joys that are as complete as bringing joy to another human being. Joy defies the laws of economics in that it's not something that we have less of when we give it away. Joy is something that grows greater for the giver as it is given. The more you give, the more you have.

January 04, 2009

= Distractions =

One more eye opening Topic needy for most of us.
Source: http://freelancefolder.com/improve-your-professional-productivity-get-rid-of-distractions/
Do you often feel that you are doing everything under the sun but the actual work? You know, the activity that gets you money? Distractions can be a big problem when you work on your own: although you have deadlines and commitments there is nobody breathing down your neck to see what you are actually doing.

You never realize when you stop your work and start playing an online game, chatting with someone you know, reading “interesting” stuff on various blogs and leaving prodigal comments, conversing over the phone, discussing politics with your spouse, or doing any of those hundred things that help you spend your time but don’t give you any real return.

I know a client who until a couple of years ago was running his online business from his basement (now he has an office); most of the time when his wife thought that he was promoting his work or processing client-queries he was playing online games. And he knew he shouldn’t be doing that because he repeatedly used to confess to me whenever we interacted while doing work.

The problem with such distractions is that you don’t even realize that you are wasting your precious time until you notice how much work is still left at the end of the day. Consequently you end up doing your professional work at the time when you could be spending some quality time with your loved ones. In fact this is the biggest casualty of not sticking to your professional work: you are working even during the non-working hours, totally messing up your personal as well as family life.

Here are a few steps you can take to make sure that you minimize the distractions when you are supposed to be working on your projects.

If possible, cut yourself from the online world
Do you really need to be online while working? If your project work simply involves using your desktop application, your imagination and your skill you should completely go offline. This means closing all instant messaging applications, e-mail applications, browsers, and all those interactive tools that keep on fetching things from the Internet and presenting them to you.

Stop attending to the phone
Do you get lots of business queries over your phone? If not, then don’t attend to the phone while you’re working; let someone else in the house pick it up or if you are alone then switch on the answering machine. If you do get lots of business calls then keep a separate phone number for your business so that you only take those calls. Let your friends and relatives know when they can call you; after all they couldn’t have kept calling you had you been going to an office.

You freelance and work under nobody doesn’t mean you are available for social chats all day.

Communicate to your family that you should not be disturbed when you are working
Of course your wife or husband wants you to hold the baby just when you are going to write the most crucial line you have ever written, otherwise it is going to be catastrophic.

If you set some rules then they will grow out of this habit of running to you just because you are there in the next room (OK, I know it is easier said than done). Similarly, don’t let your work space become a playground for your children; you should maintain some sanctity and draw a line that cannot be crossed. This will save you not only your creative moments but also your hardware and software and other paraphernalia present on your working table.

Work in a separate room if possible
Last year I moved to the sitting room to keep an eye on the baby while my wife worked on her computer; this was because the computer could not be moved around and I had a laptop. But soon it became a free for all situation; everybody in the house needed my attention or my counsel for everything.

There were times when I could only achieve three to four hours of professional work during the whole day. And of course the baby always wanted to be on top of my table and bang on my laptop keys. Eventually I had to take a stand and move to a separate — fortunately a spare — room.

Eliminate noises that distract you
Are there lots of noises coming from outside? Are you in the habit of playing music all the time while you’re working? All these things significantly affect your productivity. Make your room as silent as possible, especially when you are a professional writer or a blogger.

Avoid that habit of perpetually testing new software or tools
Unless you write software reviews or your present software really sucks, avoid that overwhelming desire to download some new tool or plugins recommended by that blogger; they can be a big waste of time and you can even end up losing crucial data.

For instance I was recently obsessed with installing Ubuntu (a Linux version); I downloaded it and burned the ISO image on a CD. The installation involved partitioning my current hard disk and taking complete backup, or jeopardize my existing data and other installations. This could mean an involvement of a day or even more.

Besides I was not sure whether the current software and tools I’m using for my professional work will work in Ubuntu or not. On the other hand my current Windows installation is working fine and frankly I don’t need to switch to another operating system and spend days first learning it and then configuring it to my needs. So whenever there is an inclination to try out new software or upgrade the existing one just ask yourself if you really need to do that.

Don’t read too much on the Internet
If you are reading in order to research for your project then it is another thing, but otherwise don’t spend too much time reading all those blogs and websites (make sure you keep reading this one though :) ).

I agree that reading helps you grow and improve your skills but read only when you have no professional work pending.

Get rid of the extra software and files
Do you have lots of extra software and files on your computer or laptop? Extra software and files not only slow down your system they also clutter your navigation and make maintenance and backup needlessly tedious. So dedicate some time to cleaning up your computer, it will be a worthwhile activity.

Keep the necessary stuff handy
Are you constantly searching for a pen, pencil, important papers, and other stuff that you regularly need to work? You end up spending lots of time just trying to find these things; in your drawers, in your room, or in your house.

If you develop the habit of organizing your things and keeping them at their designated spots you will notice how much time you eventually save and how much time you can save.

= New Year Resolutions For Anybody =

365 Days of Year 2009.
24 Hours a Day.
60 Minutes of an Hour
.


What is the best way of utilizing this time? Here we go.
These are the Top Eleven Resolutions of any new year one can follow and start right away with whole new energy, thoughts and Style.

1. Spend More Time with Family & Friends.
2. Fit in Fitness.
3. Tame the Bulge.
4. Quit Smoking.
5. Enjoy Life More
6. Quit Drinking.
7. Get Out of Debt.
8. Learn Something New.
9. Help Others.
10. Get Organized.


One Last But Not At All Least. Identify your Goals for this year which takes you towards Your Life Goals, For That Your Goals have to be Splitted in Various Regions of Life Style just for our Clarification. And the Fields are:

1. Family and Home.
2. Finacial and Career.
3. Spiritual and Ethical.
4. Physical and Health.
5. Social and Cultural.
6. Mental and Educational.


Selamat Pagi....Good Morning...Good Day.....Just Learnt this New Word!!! :)

= January 2009 Activation =

Happy New Year. May this year is the year for your dreams, passions, everything you believe, your wishes, your desires, your thoughts, your emotions, your feelings and your Hopes. May this year is the year for your special moments as you live everyday.
Have Fun and Be Good.This is the standard greeting i usually sent for every new year to my friends as those words when combined gives the perfect sense of a beautiful life and is a way of remembering we have so many elements to live by everyday.

The above sketch is the mass email greeting for all my close friends on 31st night..may be missed some coz of not having email address. It's beautiful right. So That was the sketch for last day in 2008. What about 2009, as everyone is going into 2009 with whole new ideas and thoughts I also thought of stepping into 2009 with whatever i am good at...i.e Drawing and Dancing. So Below are the Sketch done in Jan 1st week and One of my Dance Videos.
Yes, I dance too. Dancing is also an interest of me founded in 8th class when Drawing became the First interest. Music is the language of my Soul and I believe everybody's Soul. I like hearing to slow songs and my feet move for the fast beats. So here you go with the video below.Try Seeing in Youtube as you can get a Option to see in High Quality. Hope You Like It.

SonarQube with Jenkins Setup using Docker Images

https://funnelgarden.com/sonarqube-jenkins-docker/  https://medium.com/@hakdogan/an-end-to-end-tutorial-to-continuous-integration-and-con...