Posts

Showing posts with the label Lua Example

Class Attributes Python Code Example

Example 1: declare class python # To create a simple class : class Shape : def __init__ ( ) : print ( "A new shape has been created!" ) pass def get_area ( self ) : pass # To create a class that uses inheritance and polymorphism # from another class : class Rectangle ( Shape ) : def __init__ ( self , height , width ) : # The constructor super . __init__ ( ) self . height = height self . width = width def get_area ( self ) : return self . height * self . width Example 2: class python class MyClass ( object ) : def __init__ ( self , x ) : self . x = x Example 3: python object with attributes class Object ( object ) : pass a = Object ( ) a . somefield = somevalue Example 4: python class class Dog ( object ) : def __init__ ( self , name , age ) : self . name = name self . age = age def speak ( self ) : print ( "Hi I'm ...

Add Row Sql Code Example

Example 1: sql insert query --sql insert quest example INSERT INTO table_name ( column1 , column2 , column3 , ... ) VALUES ( value1 , value2 , value3 , ... ) ; Example 2: how to add records to sql table INSERT INTO Customer ( FirstName , LastName , City , Country , Phone ) VALUES ( 'Craig' , 'Smith' , 'New York' , 'USA' , 1 - 01 - 993 2800 ) Example 3: sql insert -- Note: This is specifically for SQL - Oracle -- --------------------------------------------------------------- -- OPTION 1: Insert specific values (other values will be null) -- syntax INSERT INTO < TABLE_NAME > ( < column1 > , < column2 > , < column3 > , ... ) VALUES ( < value1 > , < value2 > , < value3 > , ... ) ; -- example INSERT INTO SALES ( SALE_ID , ITEM_ID , QUANTITY , AMOUNT ) VALUES ( 631 , 13 , 4 , 59.99 ) ; -- --------------------------------------------------------------- -- OPTION 2: Insert ...