Month: June 2014

Creating a Swift Playground in XCode and adding it to a Git Repo on BitBucket


clockworkcode

In a previous post Creating a Swift Project in Xcode 6 and adding it to a git repo on BitBucket, I created a sample OXS command line project. I now want to create a collection of sample playgrounds to test out all of the language features of swift. Setting this up is essentially following the same set of steps but instead of section “Create a sample swift project (OSX command line tool)” do this instead:

Create a playground

  • Open XCode
  • File > New > File…
  • Choose template iOS > Source > Playground
  • Click Next
  • Save As: Sample.playground
  • Choose a suitable location e.g. ~/dev/repos/swift/samples
  • Click Create
  • A playground file will now open
  • Close the playground and follow the next section

Create a Git repo for the playground folder

Open a terminal window at e.g. ~/dev/repos/swift/samples

Now follow the instructions in the previous post from section “Create a Git Repo on BitBucket”

View original post 12 more words

Advertisements

Using UIPageControl as a container UIViewController


My Memory

Setting up the interface

To setup the user interface in Interface Builder, you’ll need to create a UIPageControl and a UIScrollView within a UIViewController, and as many other UIViewControllers as to need.

Setting up the PageViewController class

The PageViewController will contain 2 subview a UIScrollView and a UIPageControl. The UIScrollView will contain the views while the UIPageControl will navigate and control which part of the UIScrollView is visible.
You’ll also need some mechanism for calling addChildViewController: on the view controller, I’m my example I did this by sub-classing PagerViewController, but you could also do this before the view controller is push into view.

So, the public interface should look like this:

@interface PagerViewController : UIViewController 
 
@property (nonatomic, strong) IBOutlet UIScrollView *scrollView;
@property (nonatomic, strong) IBOutlet UIPageControl *pageControl;
 
- (IBAction)changePage:(id)sender;
 
@end

On to the implementation file. First of all, I want to handle all the view appearence at…

View original post 942 more words

How to Check Your Xampp Version


Code with Simplest Code

  1. Run your xampp (apache is activated)
  2. Go to “localhost/xampp/” with your browser
  3. Your xampp version is on the top left

Other way

  1. Open your Xampp Control Panel
  2. Click on “Help” button
  3. Click “Read Me”
  4. On the first line: ####ApacheFriends Xampp version xxx####

View original post

Type 1:Usage of picklist in vf & Apex


Salesforce23

Picklist fields contain a list of one or more items from which a user chooses a single item. They display as drop-down lists in the Salesforce user interface. One of the items can be configured as the default item.For more Details http://www.salesforce.com/us/developer/docs/api/Content/field_types.htm

Example:Displaying the picklist in Visulaforce page.

<apex:page controller=”vfpage1″ sidebar=”false” showHeader=”false”>
<apex:form >
<apex:selectList value=”{!myVal}” multiselect=”true”>
<apex:selectOptions value=”{!myOptions}”/>
<apex:actionSupport event=”onchange” reRender=”one”/>
</apex:selectList>
<br/>
<apex:outputLabel id=”one”> <b>The selected value is : {!myVal} <b></apex:outputlabel>
</apex:form>
</apex:page>
Controller:
public class vfpage1 {
public String myVal { get; set; }
public List<selectoption> getMyOptions() {
List< selectOption> ls= new list<selectOption>();
selectOption s0=new selectOption(‘Null’,’-Null-‘);
selectOption s1=new selectOption(‘1′,’One’);
selectOption s2=new selectOption(‘2′,’Two’);
selectOption s3=new selectOption(‘3′,’Three’);
ls.add(s0);
ls.add(s1);
ls.add(s2);
ls.add(s3);
return ls;
}

}
OutPut:
one

View original post

Type 2:Usage of picklist in vf & Apex


Salesforce23

Example: Creating Picklist in Visualforce page (In Sobject its not Picklist)
Lets take an example that we have one Sobject Employee__c and the Field name  is EmpName(std field)

<apex:page controller=”vfpage2″ sidebar=”false” showHeader=”false”>
<apex:form >
<apex:selectList size=”1″ value=”{!selectedValue}”>
<apex:selectOptions value=”{!values}”/>
<apex:actionSupport event=”onchange” reRender=”one”/>
</apex:selectList>
<br/>
<apex:outputLabel id=”one”> <b> The selected Employee Name is : {!selectedValue}</apex:outputlabel>
</apex:form>
</apex:page>

Controller:
public class vfpage2 {
public String selectedValue { get; set; }
public List<selectoption> getValues() {
List< selectOption> ls= new list<selectOption>();
List<Employee__c> emp=[select empName from Employee__c];
for(Employee__c e:emp){
ls.add(new selectOption(e.empName,e.empName));
}
return ls;
}

}
OutPut:
one

View original post

Type 3:Usage of picklist in vf & Apex


Salesforce23

Exapme: Creating Picklist In Visualforce Page itself

<apex:page controller=”zvf5″ sidebar=”false” showHeader=”false”>
<apex:form >
<apex:selectList value=”{!myVal}” size=”3″ multiselect=”true”>

<apex:selectOption itemvalue=”One” itemlabel=”1″/>
<apex:selectOption itemvalue=”Two” itemlabel=”2″/>
<apex:selectOption itemvalue=”Three” itemlabel=”3″/>
<apex:selectOption itemvalue=”Four” itemlabel=”4″/>
<apex:selectOption itemvalue=”Five” itemlabel=”5″/>
<apex:actionSupport event=”onchange” reRender=”one”/>
</apex:selectList>
<br/>
<apex:outputLabel id=”one”> <b>The selected value is : {!myVal} </b></apex:outputlabel>
</apex:form>
</apex:page>

Controller:
public class zvf5 {

public String myVal { get; set; }
}
one

View original post

Type 4:Usage of picklist in vf & Apex


Salesforce23

Some times we need to display picklist in Vf page which is of type picklist in Sobject. Acutally we are not displaying the picklist values but then picklist record values which may have redundency…lets take an example .

Controller

Out put: Here it is displaying the totla number of picklist values present in the records but not the picklist values present in it.

 one
To Resolve this we Use Map , By Using Map We can get all unique values in the map and we can store in list to display finally.
and the for this is

one

View original post