Tag Archives: Heaven

What is Scope and RootScope in Angular JS? with examples

By | August 10, 2017

Scope Scope is the binding part between the HTML (UI) and the Javascript (the Controller). Scope object contains the available properties and methods. Scope is accessible in both HTML and Javascript. Scope Example [html] <div ng-app="myApp" ng-controller="myCtrl"> <h1>{{ name }}</h1> </div> <script> var app = angular.module(‘myApp’, []); app.controller(‘myCtrl’, function($scope) { $scope.name = "Coderz Heaven"; }); </script> [/html] Root… Read More »

How to load a spinner with values from SQlite Database in android?

By | November 18, 2012

Here is a simple example showing how to load a database values in a spinner in android. OK we will start. This is the layout for the spinner row. spinner_row.xml [xml] <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation = "vertical" android:id="@+id/tv" android:layout_margin="10dp"> </TextView> [/xml] This is the layout for the interface. activity_main.xml [xml] <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"… Read More »

Changing the style or theme of default alertDialog in Android.

By | February 3, 2012

Hello everyone, Here is a simple example showing how to change the theme of default AlertDialog in android. Check this post before for understanding how to use styles. http://www.coderzheaven.com/2012/04/17/inherit-styles-extend-styles-android/ To start first create a fresh project named AlertTest. In the AlertTestDemo.java file copy this code [java] package com.coderzheaven.pack; import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; import android.os.Bundle;… Read More »

Customizing a spinner in android.

By | July 18, 2011

Hello everyone……… You all knew that a spinner or combobox is an inbuilt widget in android. And Like any other widgets spinners are also customizable. Here is a simple example to customize a spinner. First we will look at the java code. The getView method is called for each row in the spinner. So with the help of… Read More »

Customizing a spinner in android.

By | July 18, 2011

Hello everyone……… You all knew that a spinner or combobox is an inbuilt widget in android. And Like any other widgets spinners are also customizable. Here is a simple example to customize a spinner. First we will look at the java code. The getView method is called for each row in the spinner. So with the help of… Read More »

Customizing a spinner in android.

By | July 18, 2011

Hello everyone……… You all knew that a spinner or combobox is an inbuilt widget in android. And Like any other widgets spinners are also customizable. Here is a simple example to customize a spinner. First we will look at the java code. The getView method is called for each row in the spinner. So with the help of… Read More »

Customizing a spinner in android.

By | July 18, 2011

Hello everyone……… You all knew that a spinner or combobox is an inbuilt widget in android. And Like any other widgets spinners are also customizable. Here is a simple example to customize a spinner. First we will look at the java code. The getView method is called for each row in the spinner. So with the help of… Read More »

Customizing a spinner in android.

By | July 18, 2011

Hello everyone……… You all knew that a spinner or combobox is an inbuilt widget in android. And Like any other widgets spinners are also customizable. Here is a simple example to customize a spinner. First we will look at the java code. The getView method is called for each row in the spinner. So with the help of… Read More »

Simple String Concatenation Example in JAVA

By | June 25, 2011

Hi, Given below is a simple concatenation example in JAVA where two strings are joined together to form a single string. [java] public class MainClass { public static void main(String[] arg) { String yourString = "Coderz" + "Heaven"; System.out.println(yourString); } } [/java] And…the output will be.. “CoderzHeaven” 🙂

jQuery Hide & Show Toggle – An Example

By | April 28, 2011

Hi, Want to try out a simple hide and show toggle using jQuery? The example given below shows how you can simply hide and show a paragraph in html using jQuery. Try it out! [html] &lt;html&gt; &lt;head&gt; &lt;script type=&quot;text/javascript&quot; src=&quot;jquery.js&quot;&gt;&lt;/script&gt; &lt;script type=&quot;text/javascript&quot;&gt; $(document).ready(function(){ $(&quot;#hideMe&quot;).click(function(){ $(&quot;p&quot;).hide(); }); $(&quot;#showMe&quot;).click(function(){ $(&quot;p&quot;).show(); }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;p&gt;Coderz Heaven! Click ‘HideMe’ for… Read More »

jQuery Hide & Show Toggle – An Example

By | April 28, 2011

Hi, Want to try out a simple hide and show toggle using jQuery? The example given below shows how you can simply hide and show a paragraph in html using jQuery. Try it out! [html] &lt;html&gt; &lt;head&gt; &lt;script type=&quot;text/javascript&quot; src=&quot;jquery.js&quot;&gt;&lt;/script&gt; &lt;script type=&quot;text/javascript&quot;&gt; $(document).ready(function(){ $(&quot;#hideMe&quot;).click(function(){ $(&quot;p&quot;).hide(); }); $(&quot;#showMe&quot;).click(function(){ $(&quot;p&quot;).show(); }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;p&gt;Coderz Heaven! Click ‘HideMe’ for… Read More »

jQuery Hide & Show Toggle – An Example

By | April 28, 2011

Hi, Want to try out a simple hide and show toggle using jQuery? The example given below shows how you can simply hide and show a paragraph in html using jQuery. Try it out! [html] &lt;html&gt; &lt;head&gt; &lt;script type=&quot;text/javascript&quot; src=&quot;jquery.js&quot;&gt;&lt;/script&gt; &lt;script type=&quot;text/javascript&quot;&gt; $(document).ready(function(){ $(&quot;#hideMe&quot;).click(function(){ $(&quot;p&quot;).hide(); }); $(&quot;#showMe&quot;).click(function(){ $(&quot;p&quot;).show(); }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;p&gt;Coderz Heaven! Click ‘HideMe’ for… Read More »

Compare two strings in C Sharp/C# – Case Insensitive

By | April 27, 2011

Hi, Sometimes you may need to check whether two strings are equal or not equal by checking case insensitive. See the example below to see how to achieve the same using C Sharp /C#. [csharp] using System; class MainClass { public static void Main() { string strOne = "heaven"; string strTwo = "HEAVEN"; if(String.Compare(strOne , strTwo , true)… Read More »

How to create a text file in C# ?

By | April 23, 2011

Hi, How can you create a text file in C# and write to it? Sometimes you may need to create a text file using C sharp program. Here is how you can do that. [csharp] using System; using System.IO; class MainClass { static void Main(string[] args) { StreamWriter yourStream= null; string yourString= "I Love Coderz Heaven!"; try {… Read More »