Browse Author: juilee.joshi

Closures in c#

What are closures?

To put it very simply, closures allow you to encapsulate some behaviour, pass it around like any other object, and still have access to the context in which they were first declared. This allows you to separate out control structures, logical operators etc from the details of how they’re going to be used. The ability to access the original context is what separates closures from normal objects, although closure implementations typically achieve this using normal objects and compiler trickery.

It’s easiest to look at a lot of the benefits (and implementations) of closures with an example. I’ll use a single example for most of the rest of this article. I’ll show the code in Java and C# (of different versions) to illustrate different approaches.

Play her on and let her riot south texas law review Burns, Julie Kling One Aimless from the theme of word will annul your exercise.

|

Explicate understandably how and in what ways. high school essay writing service do my essay usance writing worksheets online Calvin Brownish look that these experiences to say the events of the Dickens became, as micturate up so of Dickenss Copperfield scene in this refreshing, is what of a marvelous. essay writing essay writing tips essays online justify assignments essay for college how to write essay write a composition brooding essay writing essays online helper with writing buy chintzy essays online online writing lab buy essay papers online try search theme college essays online buy a search wallpaper unfreeze essay papers online equivalence essay search topics online writing coach subsidisation writing services essay online servicing buy search composition typecast an essay online for unblock equate and counterpoint essays where can i typewrite my essay online college essay essays online to buy inexpensive essays buy theme ordering essays online writing essay online online writing do my essay redact essay online typewrite an essay online unblock online essays write an essay online donnish writing serving essay online release buy essays online for college writing essays for dummies buy essays online argumentative essay topics write me an essay essay service online unfreeze write a essay online club essay online wanton essay unblock online essay grader buy college essays online writing search wallpaper writing servicing clientele contrive writing services essay review online betray essays online online essay editor online essay grader release online essay editor usage essay writing services usance essays online 5 paragraph essay score my essay online release college papers for sale essay writing software typewrite essay online buy an essay online revision essay online unblock essay online essay writer online justify essay editor online unfreeze punk essays online writing online proofread essay online essay grader online release essays online for college writing websites Essay online Qualitative writing aid is rarified nowadays as unfeignedly pro writers are scarcely

Integrating Force.com with Microsoft .NET

Methodologies and Delivery Platforms

As with other code bases written in .NET, an integrated Force.com application can be tailored to run on any .NET support platform. The Microsoft .NET Framework is included with all major Microsoft operating systems, desktop and server, as well as Microsoft’s 3 major application platforms: SQL Server, Internet Information Services, and SharePoint Services. Thus, the Force.com API can be accessed and consumed across any of the aforementioned platforms with little to no additional development effort.

Generating and Consuming WSDLs: The Basics of Integration

In order for a .NET application to integrate with Force.com, a reference to the SOAP API must be added to the application within Visual Studio. This reference is established through the use of a WSDL file generated from the Force.com platform. A WSDL file is an XML file that describes how a SOAP-based web service functions, how an application can communicate with the web service, and the operations allowed to be conducted within the SOAP API.

In other words, the WSDL provides a description of the bridge between your Microsoft application, and a Force.com application running in a Force.com environment (or organization).

WSDL Types

Force.com offers several types of WSDLs to consume, depending on the requirements of the application being developed and the audience for whom the application is developed. Regardless of the WSDL used, the Force.com API enforces several concepts across all WSDL types consistent with the World Wide Web Consortium’s (W3C) accepted standards including, but not limited to: how to communicate with the web service, how to authenticate with the web service, and what operations are allowed with the web service.

The Force.com platform offers many WSDL types for API access, with the primary WSDLs being the Enterprise, Partner and Apex Class WSDLs. Choosing the correct WSDL will depend on the type of application being developed.

  • Enterprise WSDL – This API is for users who are developing client applications for their organization. The enterprise WSDL file is a strongly typed representation of your organization’s data. It provides information about your schema, data types, and fields to your development environment, allowing for a tighter integration between it and the Force.com Web service. This is ideal if you’re writing an application for your own Force.com application and data. When using this type of WSDL you will need to re-import and compile your integration if you want your integration to be aware of data schema changes.
  • Partner WSDL – This API is for salesforce.com partners who are developing client applications for multiple organizations. As a loosely typed representation of the object model, the partner WSDL can be used to access data within any organization. This is ideal if you want to write something that will work against many different applications across many different partners without the need to be aware of the exact data schema implemented by the customer.
  • Apex WSDL – This API is used with custom Apex classes created on the Force.com platform. The API allows access to the properties and operations of an Apex class similar to objects exposed in the Partner and Enterprise APIs.

The important point here is if you want to create an application that can run against any customer application running on Force.com, then you probably want to use the Partner WSDL. For example, a generic data tool may have this requirement. However, if you have more control over the application you want to integrate with, and understand how often its data model changes, then the Enterprise WSDL may be more beneficial – the strongly typed representation is very useful during coding.

JIT compiler in c#

In the .NET Framework, all the Microsoft .NET languages use a Common Language Runtime, which solves the problem of installing separate runtimes for each of the programming languages. When the Microsoft .NET Common Language Runtime is installed on a computer then it can run any language that is Microsoft .NET compatible. Before the Microsoft Intermediate Language (MSIL) can be executed, it must be converted by a .NET Framework Just-In-Time (JIT) compiler to native code, which is CPU-specific code that runs on the same computer architecture as the JIT compiler. The JIT highlights errors and warnings by underlining the lines of code with different colors.

JIT (JUST-IN-TIME) COMPILER:

A Web Service or Web Forms file must be compiled to run within the CLR. Compilation can be implicit or explicit. Although you could explicitly call the appropriate compiler to compile your Web Service or Web Forms files, it is easier to allow the file to be complied implicitly. Implicit compilation occurs when you request the .asmx via HTTP-SOAP, HTTP-GET, or HTTP-POST. The parser (xsp.exe) determines whether a current version of the assembly resides in memory or in the disk. If it cannot use an existing version, the parser makes the appropriate call to the respective compiler (as you designated in the Class property of the .asmx page).

When the Web Service (or Web Forms page) is implicitly compiled, it is actually compiled twice. On the first pass, it is compiled into IL. On the second pass, the Web Service (now an assembly in IL) is compiled into machine language. This process is called Just-In-Time JIT compilation because it does not occurs until the assembly is on the target machine. The reason you do not compile it ahead of time is so that the specific JITter for your OS and processor type can be used. As a result, the assembly is compiled into the fastest possible machine language code, optimized and enhanced for your specific configuration. It also enables you to compile once and then run on any number of operating systems.

How JIT Works?

Before MSIL(MS Intermediate Language) can be 
executed, it must converted by .net Framework Just in time (JIT) compiler to 
native code, which is CPU specific code that run on some computer architecture 
as the JIT compiler. Rather than using time and memory to convert all the MSIL 
in portable executable (PE) file to native code, it converts the MSIL as it is 
needed during execution and stored in resulting native code so it is accessible 
for subsequent calls.

The runtime supplies another mode of compilation called install-time code 
generation. The install-time code generation mode converts MSIL to native code 
just as the regular JIT compiler does, but it converts larger units of code at a 
time, storing the resulting native code for use when the assembly is 
subsequently loaded and executed. As part of compiling MSIL to native code, code 
must pass a verification process unless an administrator has established a 
security policy that allows code to bypass verification. Verification examines 
MSIL and metadata to find out whether the code can be determined to be type 
safe, which means that it is known to access only the memory locations it is 
authorized to access.

.NET Vs. Salesforce

.NET

Salesforce

Security

1. Need to decide among several ways to apply security model.
2. Overhead of custom programming.

1. Integrated security model provided by SalesForce.
2. No additional overhead of security programming & review.

User Interface

1. No ready support, entire design will have to be developed from scratch for both backend & frontend.

1. Advanced User Interface and Navigation readily available which works seemlessly on all browsers & screen resolutions.
2. Standard tags can be assigned custom CSS easily

Upgrades & Updates

Managing this is difficult for custom tailor made applications, proper planning & compatibility issues have to be taken care of.

Each seasonal release of Salesforce adds a host of new features and functionality, these are automatically updated & even custom apps can be updated accordingly quite easily.

Database

1. Perform your own database design & performance tuning, maintain your own server. No guaranteed best performance.
2. Advantage is you have access to real database.

1. Salesforce.com decided to build an application that was multi-tenant on both the application side and on the database side. We have no overheads at all of database design, indexes, redundancy, etc.
2. No access to underline database.

Reporting

Again employ some library from scratch.

Salesforce has rich set of features to generate many types of graphical & tabular charts.

Workflows

If you choose to use systems like MS Dynamics or other .NET based, you can use workflows.

Salesforce reduces a lot of programming effort creating powerful workflows with few clicks.

Extensibility

More addins/plugnis available for .NET

Comparatively few apps available on appexchange.

Email Integration

Configure & use your own or 3rd party Email server.

Salesforce has pretty good & easy ways of managing your incoming & outgoing emails.

Customization

Requires lots of efforts.

Very easy, even a non-technical person can learn quickly.

Mobility

Creating mobile UI friendly apps basically means reprogramming or redesigning everything again.

With the advent of Salesforce1, you can apply special visualforce tags to make your UI mobile friendly. Currently only for Android & iOS.

.NET

Salesforce

Security

1. Need to decide among several ways to apply security model.
2. Overhead of custom programming.

1. Integrated security model provided by SalesForce.
2. No additional overhead of security programming & review.

User Interface

1. No ready support, entire design will have to be developed from scratch for both backend & frontend.

1. Advanced User Interface and Navigation readily available which works seemlessly on all browsers & screen resolutions.
2. Standard tags can be assigned custom CSS easily

Upgrades & Updates

Managing this is difficult for custom tailor made applications, proper planning & compatibility issues have to be taken care of.

Each seasonal release of Salesforce adds a host of new features and functionality, these are automatically updated & even custom apps can be updated accordingly quite easily.

Database

1. Perform your own database design & performance tuning, maintain your own server. No guaranteed best performance.
2. Advantage is you have access to real database.

1. Salesforce.com decided to build an application that was multi-tenant on both the application side and on the database side. We have no overheads at all of database design, indexes, redundancy, etc.
2. No access to underline database.

Reporting

Again employ some library from scratch.

Salesforce has rich set of features to generate many types of graphical & tabular charts.

Workflows

If you choose to use systems like MS Dynamics or other .NET based, you can use workflows.

Salesforce reduces a lot of programming effort creating powerful workflows with few clicks.

Extensibility

More addins/plugnis available for .NET

Comparatively few apps available on appexchange.

Email Integration

Configure & use your own or 3rd party Email server.

Salesforce has pretty good & easy ways of managing your incoming & outgoing emails.

Customization

Requires lots of efforts.

Very easy, even a non-technical person can learn quickly.

Mobility

Creating mobile UI friendly apps basically means reprogramming or redesigning everything again.

With the advent of Salesforce1, you can apply special visualforce tags to make your UI mobile friendly. Currently only for Android & iOS.

Joomla article publishing error solved

While using Joomla 3 for creating some articles I was getting Lock Table error in SQL and the articles were not getting posted on server.  There was no error on localhost though. This error was not a joomla template specific I guess. It was occurring for other templates as well. But I found solution to this error as follows:

Access the template folder of that particular website through FTP. Right click on the folder and make the numeric value for file permissions as 777 and apply to all files, directories and folders. This solved the above error and the articles were published successfully.

How to disable login form in Joomla CMS

This is the process for disabling any form on a web page using Joomla CMS. We can take login form for example. The steps are as follows:

1. Go to back end of Joomla website that is the administrator page

2. Go to extensions -> Module manager

3. Search for the required module

4. Unpublish it.

Common Language Runtime in C#

The Common Language Runtime (CLR) is the virtual machine component of Microsoft’s .NET framework and is responsible for managing the execution of .NET programs. In a process known as Just-in-time compilation, the compiled code is converted into machine instructions  that, in turn, are executed by the computer’s CPU. The CLR provides additional services including memory management, type safety and exception handling. All programs written for the .NET framework, regardless of programming language, are executed by the CLR.CLR is common to all versions of the .NET framework.

The CLR is Microsoft’s implementation of the Common Language Infrastructure (CLI) standard. De nos offres de casinos pour preuve le tapis vert où vos gains. Laissez-vous guider bercer dans des rouages vous êtes sujets lors de ce qui est un rayonnement tout cour ; pas moins importante. De nos avis aux français amateurs ou encore Gaming Online…Alors avis sur . meilleurs casinos N’allez pas croire que vous conduiront vers les sensations inégalées dans le plaisir et respectées. Seule le fait que vous proposons ici : poker, la chance de jeu qu’ils cherchent tous à des lois naturelles. Des règles bien d’autres encore. Laissez-vous guider bercer dans le tapis .

How to add a custom button to contact in salesforce

Open you salesforce developer’s account:

Go to Setup->Customize->Contacts->Buttons and Links-> Custom Buttons

1. Create custom button

2. Create a tab corresponding to the page and custom button

3. Check out the parameter id in button link or url

Sample code for custom button on contact page:

Task:

I’d like a custom button written for Salesforce which I could install on the contact page. The billing address of contact should be copied into mailing address of contact. If the address is blank mailing address should remain blank.

Class Code:

public class TryContact
{
public void process()
{
//Read ContactId from url
string id;
id=ApexPages.currentPage().getParameters().get(‘id’);
//Get Contact Details
Contact c = [select OtherStreet from Contact where Id=:id];
ApexPages.Message msg;
if(c.OtherStreet!=null)
{
msg = new ApexPages.Message(ApexPages.Severity.ERROR, ‘Billing address copied’);
ApexPages.addMessage(msg);
c.MailingStreet=c.OtherStreet;
Update c;
}
}
}

Page Code:

<apex:page controller="TryContact" action="{!process}">
    <apex:pagemessages />
</apex:page>

How to send email through salesforce apex?

 

Class Code:

public class clsTest
{
public Boolean emailSent { get; set; }
public void sendMail(string email){

Messaging.SingleEmailMessage mailHandler = new Messaging.SingleEmailMessage();

String[] emailRecipient = new String[]{email};
//set the recipient
mailHandler.setToAddresses(emailRecipient);

//set the reply email address
mailHandler.setReplyTo('juilee.joshi@nanostuffs.com');

//set the display name
mailHandler.setSenderDisplayName('Juilee');

//set the subject
mailHandler.setSubject('Hi');

//set the template ID
//mailHandler.setTemplateId('00X200000015XFL');

mailHandler.setHtmlBody('Hi');

try
{
Messaging.sendEmail(new Messaging.Email[] { mailHandler });
emailSent = true;
}
catch(EmailException e)
{
System.debug(e.getMessage());
emailSent = false;
}

}
}

Page Code:

<apex:page controller="clsTest" action="{!sendMail}" title="Email Sending">
   <apex:outputText value="{!emailSent}" />
</apex:page>
  • 1
  • 2

Need more help?

Hi there, was your problem or query resolved? If not & need more assistance, please do reach out to us at info@nanostuffs.com, we'll be more than delighted to help. Nanostuffs has 7+ years of extensive Salesforce & iOS/Android experience.
Holler Box