Skip to main content

Posts

Showing posts with the label language

Types and Values In Corona

Lua is a dynamically typed language. This means that variables do not have types; only values do. There are no type definitions in the language. All values carry their own type. All values in Lua are first-class values. This means that all values can be stored in variables, passed as arguments to other functions, and returned as results. nil   — it usually represents the absence of a useful value. boolean   — represents two conditions 'false' or 'true' number   — represents real (double-precision floating-point) numbers. string   — represents arrays of characters. Lua is 8-bit clean: strings can contain any 8-bit character,   including embedded zeros. function   — click here to get more details table   — the sole data structuring mechanism in Lua.

Customize The Title Bar in Android

xml for custom title bar: < ?xml version="1.0" encoding="utf-8"?> < LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/titlebar> < TextView style="@style/MyRedTextAppearance" android:padding="7dp" android:id="@+id/txtvew_title" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:textColor="#FFFFFF" android:textSize="20dp" android:textStyle="bold" android:gravity="center"/> < /LinearLayout> main.xml: Include the above xml to the main xml as given below... < RelativeLayout xmlns:android="http://schemas.android.com/a...

Calculate Quadratic equation in c language

Simple program to get Quadratic equation in c language #include< stdio.h> #include< math.h> int main(){ float a,b,c; float d,root1,root2; printf("Enter a, b and c of quadratic equation: "); scanf("%f%f%f",&a,&b,&c); d = b * b - 4 * a * c; if(d Sample output: Enter a, b and c of quadratic equation: 2 4 1 The roots are real numbers. The roots of quadratic equation are: -0.293, -1.707