In the below code example I have created a Tab layout, here I have created two methods, first is add text value and second in declare icons.You can see below example code it clearly describes How to add icon with text in tab layout.
...
In order to write a unit test case for model in rails 4, Let's suppose that we have a model city.rb which has some validations and associations.
#Rails 4.1.14.2 & ruby-2.1.7
Model path: my_app/app/models/city.rb, like...
class ...
In 2016, Google made the record of 100 Billions monthly searches. Google has amazing average of 2.3 millions searches per second. Google covers over 70% market among the various search engines. As an SEO expert, we have to give special focus to G...
Super Global variables are an assosciative array, that are predefined in PHP. Superglobal means they are always accessible and can be used in function, class or file.
They are available in all scopes on script. We can use these variables dir...
To deploy ASP.NET application in IIS follow the below steps:
1. Firstly, we need to check whether all IIS related components are installed or not.
2. For ensuring this we need go to Control Panel and Click on Programs th...
Hello reader's, we all have seen preloaders whenever we visit any website, at the loading time it appears at the window panel. I have just tried to create a preloader using bright colours with a punch of animation over it which therefore seem...
Its a command prompt like Unix/Linux shell where we can entered command and get output in interactive mode. REPL, i.e. Read Eval Print Loop, environment is bundled with Node.Js and REPL performs the following tasks.
Read &n...
In Odoo first, you have to install accounting module and in our system add existing fields and inherit the accounting module in our own module.
We will follow these step given below:
Step1- First we create our own module and inher...
If you want to show a menu badge in OpenERP/Odoo then you should follow the below code:
class Shiva(models.Model):
_name = 'Shiva'
_inherit = ['ir.needaction_mixin']
STATES = [
('healthy', "Healthy Sh...
There is some functionality which we cannot test on Android Emulator and Genymotion So we use Android actual device.
But we have to attach device always when we need debug app.
There is very clean and useful Android Studio Plugin which help...
In this post, you will learn how to start any application using Ionic Framework. We will start with the downloading process of ionic and all the dependencies that are needed for developing any application.
Also we need to know the platforms th...
To fetch a particular data with the help of id on click of a drop down, We have to make a database with table named products and in that table we have to add various columns like id, name, cost, color.
Then write following code in the ProductC...
A special type of class where only one instance per process is created and used is Singleton class. Singleton classes are commonly used the time when general services were offered by some classes. In Singleton class we can store values and wherev...
To convert a byte array to hexadecimal string we use a following two methods:
Method 1:
In first method we use a BitConverter.ToString( Byte[] )
This method convert the define array of bytes to the hexadecimal string format.
...
In C#.net, GridView is use to display tabular data. With GridView it is not mandatory to specify column mappings. If not specified it automatically reads the column name from the data-table to which it is bound. However we must ensure that we spe...
If you want to catch SQL constraints violations in OpenERP/Odoo controllers this tutorial will help you,
So, You can add an SQL constraint to Odoo model without facing any difficulty, to do this we have to use the _sql_constraints list. O...
Angular UI Bootstrap provides $uibModal service to create modal windows. Before using this you need to create a template, controller and reference them with $uibModal service.
It has only one method i.e. open(options).
$uibModal's open ...
QueryString explained with example in ASP.NET
QueryString is the property of Request object which is used to pass variable values between html pages or between web forms. It is easier to pass data between web forms through QueryString.
Exam...
how to prevent countdown timer for being restart when you hit refresh in your browser
<div id="quiz-time-left"> </div>
<script type="text/javascript">
var total_seconds = 60*10 ;
var minutes = parseInt(total_se...
Active records provide us with ways to set constraints in our queries to specify the order in which we have to get the records from the table.
This can be done through the following ways:
order
This method is used to get recor...
Xpath functions: Sometimes we need to create generic xpath to locate a web element. We can create generic xpath using the xpath functions. Some of the commonly used xpath functions are as follows:
1. contains()
2. starts-with()
3. last()
4....
Active records gives us different ways to retrieve single objects from it.
Those methods with examples are given below :
find
The find method allows us to retrieve a single object or we can say single record from the database ...
In this web journal, I'll demonstrate to you generally accepted methods to bring the information from the database and showing the got information in the drop down. I do have a database named CakePHP and in that database I have one table name...
In my previous articles we learned how to perform CRUD operation using MySQLi Procedural and Object Oriented style. On performing CRUD operations, the data of MySQL table are affected. This article provides the details of functions which can be u...
Introduction to Testing:
The question that always arises is that why we should test a software/code? can't developers code like we need not to write test cases for it to ensure its correctness and quality.
The answer to above ques...
Introduction of HTML5 Placeholder
HTML5 is one of the great inventions for web world. HTML5 introduce many new and important attributes, some are HTML based and some are through JavaScript API form. HTML5 Input “Placeholder” is one...
Consider the following scenario.
Let us say we have a User model and users ,its corresponding table in the database has a column role_id along with other columns.
During the time of the attachment of the role_id to users table ,we could hav...
form_for
<%= form_for(@article) do |f| %>
<%= f.label :title %>
<%= f.text_field :title %>
<%end%>
In this example i supplied an object of article to the form_for method.
It will generate the f...
how to implement thumbnail for image in rails.
step 1:-
go to uploader inside views where you have written image uploader code for uploading image. uncomment this section
#Create different versions of your uploaded files:
ve...
Hi Friends,
Few days back I was facing an issue that once I was creating an application in development mode, I needed to sign up to my application with fake emails, so that was very troublesome process, so I found out about seeds in rails.
...
Many Programmers feel comfortable to use Postgre SQL rather than MongoDB, member of MEAN Stack.
We are going to integrate Postgresql with NodeJS
To install NodeJS, please go through this Article
Now, when we are finished with Installatio...
Hello friends, I hope you all are doing well, so today I would be discussing rails view in ruby in rails. View in ruby is used to display the data which is requested by controller from web with the help of shareable variables. We usually end view...
A callback is a function which is called after completion of a current running task. In Nodejs, all APIs are fully supports the callbacks asynchronous i.e. Non-Blocking Code features of NodeJs.
Due to Non-Blocking features NodeJs makes highly ...
In the below example I have created a GridView with in Viewpager. Here in activity_main.xml layout , I have added ToolBar, ImageView , TextView, TabLayout, Viewpager. In second step I have created three fragments xml layouts. In fragment_three.xm...
find method: The find method is used to find the particular object that matches with the parameter supplied to it.
article = Article.find(11) #It is used to find the article whose primary key is 11.
# => #<Article id: 11, name: ...
Here we want to render a custom page like the user's profile page after a successful account updation.The solution is fairly simple,however one prerequisite i am assuming that we have already run rails generate devise:controller user co...
Hello
Today we would discuss about the importance of Audit Trails in PIM Desktop.
Audit Trail
An audit trail comprises the transaction with a record of each stage involved in it. It aids in simplifying problem administration by tracing t...
We often stuck, how to manipulate Date in our rails Application.
We have two Date objects in Ruby
Time.now() // This will give Today's date
#=> 2016-05-17 17:02:28 +0530
Date.new() // This will need some arguments to pa...
We can apply constraints with the help of coding also.
Suppose we have a button and we have to give constraints to it so below coding can help us to do so.
Lets make a custom button first.
UIButton *firstButton;
firstBut...
As we all know that in each and every framework and project we will use form and html.Similarly by using Laravel 4.x we will create form and use html.
Opening A Form:
For opening a form in laravel 4.x the following syntax is used:...
Hello Readers,
This tutorial will guide you about overriding mage core file using config.xml. Here i am gonna give an examples which guide you about "how to override magento blocks, Models & controllers. Always remember, it is not a goo...
We are assuming you are already familiar with Retrofit. If not then first go to this. We have used multipart request for uploading image on server using Retrofit.
Following are the simple and easy steps for image uploading using Retrofit:-
...
Regular expression also supports a number of special characters that may be affect the way for matching a pattern.
For example: Enter the regex: sri.....
&n...
1) Create a "testDB" database.
use testDB
2) Create a collection name "users" and adding the value together using single command.
db.logins.insert({username:"neetu"})
or
First create a collecti...
Hi, this blog is to help you to know about 0/1 knapsack problem and how to solve it using Java.
Problem Definition
Suppose there is a thief who came to steal thing from someone's home. He has a knapsack(shoulder bag) ...
ArrayList is an heterogeneous collection of objects where each object can be indexed individually. While writing an application there could be some scenarios where we have ArrayList object filled with data and we want that data in delimited forma...
Hello reader's. I have created a 3D spinning cubes using CSS3 by simply using the transform,animation and transition property over the elements.
In my example, I have taken a cube element comprising of each face of the cube having its own ...
In this post, you will know the reasons behind having the ReferenceError in your console log. Also we will discuss some common case with examples.
There is a common javascript error like this line: you are trying to access a variable or call a f...
Irrespective of the technologies used like .Net,Java or PHP software versioning plays a critical role in software development. In this blog we will go through a set of best practices for successful implementation of version control in an organiza...
Hello Readers,
In this post we will discuss to generate popup on click on button using $ionicPopup service in ionic framework.
Basically, Usage of popup windows in application is to guide the user to what to do next?
$ionicPopup provides...