Monday 29 February 2016

Set date of a Date Picker in Objective C


datepicker.png
In objective C, UIDatePicker is the best way to display date and time options. We can set date of our choice in a Date picker. Also we can set minimum and maximum date.
Here I am creating UIDatePicker first.
  1.       UIDatePicker *pickerDate=[[UIDatePicker alloc]initWithFrame:pickerFrame];
  2.       pickerDate.datePickerMode=UIDatePickerModeDateAndTime;
We can set limits also. Here is the code:-
  1. //Here I am setting 1 Hour interval to the current date.
  2.       NSDate *date = [NSDate dateWithTimeInterval:3600.0 sinceDate:[NSDate date]];
  3.       [pickerDate setMaximumDate:date];
  4.       [pickerDate setMinimumDate:pickerDate.date];
Here is the code to add time in seconds to set the interval.

Programatically Creating Custom csv files in Magento


magento.png
It's simple to create custom csv in magento . follow the steps to create custom csv.
Create a controller to access data that you want to export in csv file like as below:
  1. public function createcsvAction(){
  2.       $param     = $this->getRequest()->getPost();
  3.         $csv = '';
  4.               $_columns = array(
  5.                   "Shop Number",
  6.                   "Shop Name",
  7.                   "Total Sales ",
  8.                   "Orders Sum" ,
  9.                   "Orders Average ",
  10.                   "Total Year To Date Sales ",
  11.                   "Year To Date Orders Sum" ,

To read full blog about Programatically Creating Custom csv files in Magento visit Findnerd.

You can also post Blogs at Findnerd and also ask tech queries on topics like Javascript, Java C, iOS, Android programming Question and Answers etc.


Thursday 25 February 2016

How to use filters in AngularJS?


ANGULARJS FILTERS.jpg

A filter is used to format data to be displayed to the user. These can be used in controllers,templates or services and we can also easily define our own filters. Some of the built-in filters in AngularJS are :- 1.uppercase - formats or converts text to uppercase text. 2.lowercase - formats or converts text to lowercase text. 3.filter - selects or filters a subset from an array based on certain criteria. 4.order by - sets an order based on certain criteria. 5.currency - formats text into currency format. 6.date - It formats a date to a specified format.

For full blog about How to use filters in AngularJS? visit Findnerd.


Wednesday 24 February 2016

Invalid method Mage_Catalog_Block_Product_View::_isSecure(Array())


magento error.jpg
I have faced the issue of Invalid method Mage_Catalog_Block_Product_View::_isSecure(Array()) after creating the copy of rwd theme in magento1.9.0. So would like to tell about the solution, if somebody will face the same problem then just copy the following function in Abstract.php file exists in 'app/code/core/Mage/Core/Block/' file -
  1. protected function _isSecure()
For such more Blogs related to PHP. Javascript etc. visit Findnerd.

Monday 22 February 2016

Phone number validation using libPhoneNumber Library


55.png

libPhoneNumber

libphoneNumber Library is used to validate the phone number and it is a google's library mostly used by google products and Whatsapp
phone number validation is important for app so that you can get valid number from your users. Any verification code, messages that you want to send them will have less chances of being missed.
Read full Blog about Phone number validation using libPhoneNumber Library at Findnerd.

About Findnerd
FindNerd was started as a Q&A Portal and Knowledge Base for people of Evon Technologies. Gradually, we, at the company, made it more interactive and evolved it as a Collaboration Tool. It began to get exciting and next; we branched out and evolved it as a Project Management tool and Employee Productivity Management tool too. Soon, we realized that now when we have savoured the taste of the multi-functional platform, why not to present it to the world to use!
Read more about Findnerd here>> Findnerd-A Social Network for Developers

Sunday 21 February 2016

JDBC/ODBC alternative in Java 8


java8.jpg

The JDBC/ODBC driver is the type 1 driver it is also known as JDBC-ODBC bridge. It is ODBC driver to connect the database that convert the JDBC calls to ODBC function calls. Type 1 driver is fully platform dependent and use the native libraries of operating system. The ODBC driver must be installed in operating system. The Sun Microsystem provide JDBC-ODBC driver name as sun.jdbc.odbc.JdbcOdbcDriver but Oracle's JDBC-ODBC Bridge was removed in Java 8 for following reasons:-
Disadvantages
  1. Performance issue the calls have to go through the JDBC bridge to the ODBC driver so it is slower than other types of drivers.
  2. The ODBC driver must be installed on the client machine.

Also visit Findnerd to read and post tech blogs and can also Ask tech Query over Findnerd.

Thursday 18 February 2016

How to call another controller function in a controller in cakephp


CakePHP.jpg

Hello reader's In this tutorial we will discuss about "How to call another controller function in a controller in cakephp".
For doing this, first of all import controller function in your controller that function you want to call.
Once you import the controller, crate an object of that controller than call the function through the created object(which have pointed the imported controller).
Here is a demo.
  1. /*Author: Jaydeep Dhoundiyal* /

  2. <?php

  3. //Import controller
  4. App::import('Controller', 'Users');

  5. class ReportsController extends AppController {


You can also read such more blogs about CakePHP, Javascript, Android at Findnerd.

You can read more about Findnerd here>> Findnerd-A Social Network for Developers

Wednesday 17 February 2016

Configure the mail server settings in Liferay 6.2


Liferay.jpg
How to configure mail in liferay 6.2
step 1. Click on control panel-->Server Administration--> Mail
Step 2. Configure the mail server settings Incoming POP Server: pop.gmail.com Incoming Port:995 Use a Secure Network Connection: Checked(YES) User Name:Your gmail address Password:your gmail password Outgoing SMTP Server: smtp.gmail.com Outgoing Port: 465 Use a Secure Network

Read full blog about Configure the mail server settings in Liferay 6.2 visit Findnerd(A social Network for Developers).

Read about Findnerd here>> Findnerd-A Social Network for Developers

Tuesday 16 February 2016

Present UIViewController in swift from storyboard or XIB


customswift.jpg
Hi All,
If you want to present UIViewController in swift from storyboard . For example :-
FirstViewController.swift is a viewcontroller in your Storyboard with storyboard Identifier FirstViewController then to present this viewcontroller use this code.

  1. let captureViewCon:UIViewController = (self.storyboard?.instantiateViewControllerWithIdentifier("FirstViewController"))!



Useful built-in directives in AngularJS


AngularJS Directives.jpg
A  Directive helps us to control the rendering of the HTML inside an AngularJS application. It makes AngularJS responsive. It adds functionality to the application. AngularJS has its built in set of directives. Some commonly used directives are as follows :-
1.ng-class -It is used to dynamically set the CSS class on HTML. It is very simple you just need to bind a variable into the directive “ng-class” and change it from the controller.
2.ng-repeat -ng-repeat is used to iterate over the properties of an object. It instantiates or clones a template once for each item in a collection. Usage :-
  1. <li ng-repeat="name in names">
  2. {{ name }}
  3. </li>

Sunday 14 February 2016

How to send mail from Any Button in OpenERP/Odoo ?


mail.jpg

OpenERP enables utilizer to send and receive emails when an action is done from OpenERP. We can configure emails to be send when a sale is verify or invoice is paid etc. But to implements these type of functionality, we require to update the functions that is being called from these button actions.

We require to call the send_mail function in these button actions to send mail. OpenERP enables to send mail utilizing “Automated Actions” but we cannot configure it when a button action is done for example when a report is printed from a button action. This requires conversion in code.

We have developed a module in such a way that the utilizer will be able to configure to which button action mail is to be send. Utilizer requires some technical erudition about OpenERP like button denomination, button type etc. Module integrates an incipient menu in location “Settings -> Button Mail Configuration > Button Mail Configuration” where utilizer will be able to configure the button actions.

Thursday 11 February 2016

Understanding $emit, $broadcast and $on in AngularJS


Angularjs.jpg

Sometimes we need to send data from one controller to another. There are services provided by AngularJS for communication(event-based) between the controllers. $on, $emit, $broadcast are the services for the communication between the controllers.
$on :- $on is used to catch the event dispatched by $broadcast and $emit. Basically it’s a method of scope and listens on events of a given type.
$broadcast : - $broadcast is the service that dispatches an event downwards to the child scopes. The life cycle of the event starts at the scope where the $broadcast is called. For example :-
  1. app.controller(“Eg1ctrl”, function ($scope) {
  2. $scope.$broadcast('eventName', { Tips: tip });
  3. });
Here is not the end…
See ful blog about Understanding $emit, $broadcast and $on in AngularJS visit Findnerd.
Also visit Findnerd for such more interesting articles related to Javascript, Android, AngularJS etc.

Wednesday 10 February 2016

How to declare an Array in Swift


arrayinswift.jpg

Hi Readers!
There are different ways to declare Array in Swift. I will write few examples below:
Example 1:
  1. let a : Array? = ["hello","hi"]
Now in above example this is a constant array. You cannot add/append an element in it.
Example 2: Below both versions of declaring array are same
  1. var a2 = Array<String>()
  2. var a3 = [String]()
Here is not the end….
See full Blog about How to Declare an Array in Swift visit Findnerd.