Rails Server setup with Passenger and nginx
Hi friends,
Today I am going to tell you how to setup rails server with nginx and passenger. First you need to login to your server using ssh using the command
ssh -i server_pem_key_path user@...
Hi All,
To add image as background image in JPanel ,JLabel is used for example:-
setLayout(new BorderLayout());
try {
image = ImageIO.read(new File("D:\\New folder (2)\\fish.jpg"));
...
We can use jQuery UI to implement a tooltip in our pages. It contains a set of user interface interactions.Tooltip is used to show some additional information in the context of each field.
This is how you can use Jquery UI:
<!doctype ht...
We can use the history.back() method which loads the previous URL in the history list. It functions the same as clicking the Back button in the browser.
Here is the code snippet to show it's usage :,
<html>
<header ng-controller=...
1> To delete an element from an array, use reject as shown below:
arr = ['a','b','c','d','e']
arr.reject! { |i| i.match('d')}
Result :=> ["a", "b", "c", "e"]
2> To delete particular keys from the array whose elements are ...
Hello,
Most of the time we have a bit of confusion between the jQuery .bind(), .live(), .delegate(), and .on() methods and when they should be used. Here I am sharing some information regarding this:
bind() Method:
Syntax: .bind( eventTyp...
STI can be considered where single table can be used to represent multiple models based on different type. The parent model inherits from ActiveRecord::Base. Other models inherit from parent model. Data store and accessed from same table for all ...
Canvas can be used to draw graphs, shapes, images, and to make animations.
Here is the example below for making the game in canvas
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
...
Hello Guys
Here, I am writing blog for deleting user by userId in liferay from custom portlet.
User : The extended model interface for the User service. Represents a row in the "User_" database
table, with each column mapped to a prop...
In Javascript, this method is used to get the elements of specified tag name.
Parameter values :
Parameter : String -> This is required. And you give the tagname of that element you want to get .
Syntax:
document.getElementByTagName("na...
This post demonstrates how to display an image prior to uploading it on server.
This demo uses the JavaScript's readAsDataURL method of reader API which will read image as url.
<html>
<head>
<script src="https://a...
In CakePHP pagination is provided by a Component defined in the controller for making paginated queries much easier.
PaginatorHelper View is used for generating pagination links & buttons in a simpler way.
Setting up the Query:
Le...
If you want to make Search views in OpenERP(Odoo) follow the below mentioned code and paste it in your .xml file: -
<="" field="">
<record model="ir.ui.view" id="course_search_view">
<field name="name">cour...
Middleware is the core idea of Express.js used behind processing the request and routing. By seeing how middleware functions, you can make more maintainble applications with less code. The minute a solicitation is gotten by an Express.js applicat...
Hello,
Here I am sharing some information related to circular graphs using Javascript.
JavaScript provides a library that generates circular graphs in SVG.
We need to include circles.js or circles.min.js file in the HTML file. It can be do...
If you want to make Form view in OpenERP(Odoo) follow the below mentioned code and paste it in your .xml file: -
<group colspan="4">
<group colspan="2" col="2">
<separator string="General stuff" colspan="2">
...
While getting date in rails we do have a requirement where we need to show suffix attached to date like 2nd,3rd etc. There is no direct rails date function to get the same so in order to get date in the following format
Thu, Nov 5th 2015
...
Below code will help you to created SeekBar function in android. In android SeekBar is used by the end user, the user can drag the left and right to move the progress of runing file like audio song, video song etc. In the below code example, I h...
If you want to make tree view in OpenERP(Odoo) follow the below mentioned code and paste it in your .xml file: -
<tree string="Idea list">
<field name="name">
<field name="inventor_id">
</field></field>...
If you want generic view declaration in OpenERP(Odoo) use the below mentioned code by pasting it in your .xml file: -
<record model="ir.ui.view" id="view_id">
<field name="name">view.name</field>
<field name="mo...
Hello Readers ,
While doing web development many times we stuck with the concept of str_replace .
For understanding this, let's suppose we have one email template file stored in project directory and when we going to replace any string dyna...
Hello Readers
Urlencode can be used to encode the given string that can be used as a url. Urlencode replaces the ASCII characters with % followed by two hexadecimal digits.
OR
Other non-alphanumeric characters are converted % followed...
In JSTL, the functionality if-else is provided by choose-when-otherwise statement .
<c:choose> tag is an enclosing tag for <c:when> and <c:otherwise>. And it is also known as mutual exclusion as only a block of code withi...
There was a requirement of hiding all the wesite URL in a message except for a particular one. While looking for a solution I came across a particular solution which I think might help other .
params[:meal_note] = params[:meal_note].gsub(/...
Here is the example to validate the file extension and size before upload. Regular expression has been used to validate the file extension. And to validate file size, we use size property of file input i.e., img.files[0].size. Onclick event of bu...
We can use rescue in single line to return a value if code of that line raise an error/exception, example shown below-:
Let say we have a hash:
person = {:name => "ABC"}
person[:name].downcase # "abc"
...
Here is the sample code implementing ajax call to send the data of a form to the controller and receiving json response from controller.
Student.java
Create a java bean class and generate setter and getter.
public class Student
{
...
Using below code I have created Digital clock app in android. Android digital clock is used to show time in android app. In android, digitalclock is the sub class of TextView class. Here below code example will help you create Digital Clock funct...
We can use the serialize() method to get the data of a form. This method creates a text string in URL-encoded notation by serializing form values. It helps to select more than one element of the form.
Syntax:
$(selector).serilaize();
...
Hello Reader's! If you are developing the contents with Iframe window and you want make it show the click inside and outside the iframe, Then you can use the code below:-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
&...
Action- There are different types of actions in Odoo:
1- Window: Opening of a new window
2- Report: The printing of a report
3- Custom Report: The personalized reports or RML Report: The XSL:RML reports
4- Execut...
If you want to build an Odoo module in OpenERP(Odoo) follow the below mentioned step.
For creation of any module in Odoo you have to make four files,given below-
1-__init__.py // its indicate the import instructions for various Python fi...
If you want to Start/Stop the Odoo server in OpenERP(Odoo) follow the below mentioned step-
Step-1 Go to the start menu-> Service-> search service ->Select line and click on it.
Step-2 After that Restart/Start/Stop's buttons .
That...
In the previous part, Java Interview Questions and Answers Part I and Java Interview Coding problems for Freshers- Part II, we have explained some basic questions of Java. This part is in continuation with the previous Java Interview Questions an...
Hello All,
Working with the SQL Database, I wanted to search a specific column in all the tables of database and to do that I use the following code packet.
SELECT TABLE_NAME,COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME LI...
If you want to remove duplicate entries from your array list you can use hash set to make all items unique rather than use of algorithms.
Set is a ordered collection of items and contains only unique items. And Hashset creates a collection th...
One is likely to mistake Odoos technical models for directly fulfilling business needs. The models actually enable to add capabilities to business objects, by eliminating the need of building them by hand.
Odoo's email and messaging system, ca...
If you want to setup editing in the Odoo administration in OpenERP(Odoo) follow the below mentioned code and paste it in your model.py file -
model.py
'data': [
'security/ir.model.access.csv',
'templates.xml',
...
Hello readers today we discuss about the Godaddy shared server issue.
Yesterday I faced issue in Godaddy shared server. When I navigate our site sometime link break and blank page come, but when I reload or refresh again the page is working fi...
If you want to make field edition in OpenERP(Odoo) follow the below mentioned code and paste it in your models .py file: -
_name = 'test.demo'
name = fields.Char()
biography = fields.Html()
academy/templates.xml
...
including both of them to.info file
scripts[] = hello_world.js
stylesheets[screen][] = hello_world.css
Adding a JavaScript file and a CSS file to a page
$path = drupal_get_path('module', 'hello_world');
drupal_add_js($path . ...
There could be a situation where you need to call login on multiple pages or block the below snippet of code could be helpful in this situation
Calling the form function directly could help you getting the login form in a block or page
...
Hello Friends,
If you want to use urls and routing in OpenERP(Odoo) paste the below mentioned code in your .controllers.py file: -
'Url': url.search([])
})
@http.route('/academy//', auth='public', website=True)
d...
Hello Reader's, If your webpage is taking too long to take data from database and you want to fix a loading icon for the time then you can use the following Javascript based code for that:-
First Step:-
Write the following code just after yo...
Hello Reader's!, If you are developing the html 5 based form and need to show the progress bar of file uploading then you can use the following code written in PHP and Javascript:-
The PHP html file will be go like this:-
<?php
//get ...
syntax :
t($string, array $args = array(), array $options = array())
Every string that may be displayed to a user should be wrapped in the t() function actually it takes the responsibility for translating strings from one language into ot...
Ruby is a object oriented programming language , it support to provide a specific implementation to the methods of subclasses that is already defined in superclasses . If there is any method in subclasses is same as the method of superclass then ...
Source: pinagkaiba.blogspot.com
For ages, marketing has been the most important cog in the wheel of brand establishment, and with technology advancement, it has only become easier and more effective to reach out masses to market a prod...
Hello Reader's If you have writing the code that makes the cookies for valid lifetime then you just need to set big number for it's validity. As the example below PHP code:-
Maximum value: 2147483647
setcookie("CookieName", "CookieValue", ...
if you want to capture the screen shot of the screen in swift use the code below. this function will return an image that can be used as background image of a view
The size of the captured image is same as the size of device.
func caputreSc...