Archive

Archive for the ‘Ali’ Category

Photos from Qatar _172

November 1, 2024 Leave a comment

Street Photography using classic chrome,  and Sony RX100vii camera.

Categories: Ali

Loose Vs. more refined sketches

October 12, 2024 Leave a comment

Loose sketch: Drawing quickly, more free flowing lines, more into expressions rather than details, don’t focus on proportion, just add some colors and brush stroke

Normal Sketch Lines tend to be more defined and intentional. These sketches often serve as the groundwork for final pieces, cleaner lines, and more accurate proportions, useing varying line weights to indicate depth and focus, laying a solid foundation for further development.

Here is one of my Loose sketches, I use some water to wet the paper,  then draw the lines and the grass.

Here I use the pencil the a waterproof black 0.05 pen, then add some colors, and always wait for color to dray.

Although I  am sketching alot, but I still can’t draw from memory! Always I need a reference!.

Categories: Ali

Qatar, DohaPort _23

September 8, 2024 Leave a comment

DohaPort a photo taken in January 2024 using Sony RX100vii camera in Black and white setting.

Qatar | Expo2023 _5


Small size of Eiffel tower , in the international culture section in Expo2023-Doha,  the kids were happy to see it and lessons to me talking about my visit to France.

Check my instagram .  .  . Click-Here

Indoor Photography _6


Indoor photography of a stairs going up next to the kids playing yard in the Villaggio Mall,  i take the while sitting waiting for the kids to finish there game.

Photos from Qatar _132


Driving around in a hot sunny morning, I take the shot of a side road.

I use the Sony RX100vii camera with ISO 200, F4, shutter 1/1000s .

Nights Photography


This is a gas station,  I take the shot while driving on the opposite side of the road,  I did not change the settings or try twice. It’s a one-shot chance.

I use the Sony RX100vii camera,  ISO 3200 (bad), and shutter 1/80s, I note that after coming back home and checking the images.

Python: Simple Ticket System _Part1

June 18, 2024 1 comment

Subject: Writing a Simple Ticket System Application
Learning : Python, SQL, Logeic

In this part we all do the following:

  • Define the tables and the fields.(initially)
  • Write the code to create the Data Base.
  • Write the code to insert the data in selected tables.
  • write the functions names.(initially)
  • Create the main menu.
  • Create the menu for the lookups tables.

Define the Tables and the fields
After spending some time thinking about the project, we can figure out some out-line about most important tables and fields that we may need in this project. So here are what I will use and we may need to add or alter during the project.

Tables are not in any order ..

staff : st_id, name, mobile, email, position(manager, )
ticket: t_id, dep_id, date(today), asignto(st_id), ndescription, priority_id(High, Medium, Low), Status_id(Open, In Progress, Resolved, Closed)
updated_date, category
category: cat_id, cat_name
t_notes: tn_id, note
priority: pr_id, pri_level(High, Medium, Low)
Status: stat_id, stat(Open, In Progress, Resolved, Closed)

staff_job: sj_id, jobid, recived, finishd, status, note

departments: dep_id, dep_name


Create the Data Base
We will use the SQlite3 to create the database and the tables.
We will write the codes to create the table, and insert a Zero record, and in Lookups tables we will insert some more data such as in priority table we will insert [High, Medium, Low] in the priority level field.



#Code to create the status table.
sql_Ticket_status_t = “CREATE TABLE if not exists status_t (st_id INTEGER PRIMARY KEY AUTOINCREMENT, st_name text )”
c.execute(sql_Ticket_status_t)
db_conn.commit()

# Inserting ZERO records.
c.execute (“INSERT INTO status_t (st_name) VALUES(:st_name )”,{“st_name”:’0′})
db_conn.commit()

# Inserting Basic Information.
Ticket_status_list = [‘Open’, ‘In Progress’, ‘Resolved’, ‘Closed’]
for each in Ticket_status_list:
c.execute (“INSERT INTO status_t (st_name) VALUES(:st_name )”,{“st_name”:each})
db_conn.commit()




#Code to create the department table.
sql_Ticket_department_t = “CREATE TABLE if not exists department_t (dep_id INTEGER PRIMARY KEY AUTOINCREMENT, dep_name text )”
c.execute(sql_Ticket_department_t)
db_conn.commit()

# Inserting ZERO records.
c.execute (“INSERT INTO department_t (dep_name) VALUES(:dep_name )”,{“dep_name”:’0′})
db_conn.commit()

# Inserting Basic Information.
Ticket_department_list = [‘Human Resources (HR)’,’Marketing’,’Finance’,’Information Technology (IT)’,’Customer Servic’]
for each in Ticket_department_list:
    c.execute (“INSERT INTO department_t (dep_name) VALUES(:dep_name)”,{“dep_name”:each})
db_conn.commit()


# Code to create the category table.
sql_Ticket_category_t = “CREATE TABLE if not exists category_t (cat_id INTEGER PRIMARY KEY AUTOINCREMENT, cat_name text)”
c.execute(sql_Ticket_category_t)
db_conn.commit()

# Inserting ZERO records.
c.execute (“INSERT INTO category_t (cat_name) VALUES(:cat_name)”,{‘cat_name’:’0′})
db_conn.commit()

# Inserting Basic Information.
Ticket_category_list = [‘Technical Support’,’Billing Inquiry’,’Account Management’,’Product Feedback’,’Bug Report’,’Feature Request’,’General Inquiry’,’Training Request’,’Hardware Issue’,’Software Issue’]
for each in Ticket_category_list:
    c.execute (“INSERT INTO category_t (cat_name) VALUES(:cat_name)”,{“cat_name”:each})
db_conn.commit()

Code to create the status table.



Thats the code for three tables, the other will be the same with other table names and fields, I will not write them all save the time.

Main Menu
The main menu will be called to start/run the application, through the main menu we can jump to all other functions in the application. let’s see the cobe.

# The Main Menu.
def main_menu():
  while True :
    os.system(‘clear’)
     line2 =”Main Menu”
    header(line2,7,7)
    print(‘ ‘*5,’ 1. Add New Ticket.’)
    print(‘ ‘*5,’ 2. Edit a Ticket.’)
    print(‘ ‘*5,’ 3. Delete a Ticket.’)
    print(‘ ‘*5,’ 4. Show Tickets.\n’)
    print(‘ ‘*5,’ 5. [ SETTING ]’)
    print(‘ ‘*5,’ 99. Exit.’)
    user_select = input(“\n\t Select from the Menu: > “)

    if user_select == ‘1’ :
      print(‘   you select 1’)
    if user_select == ‘2’ :
      print(‘   you select 2’)
    if user_select == ‘3’ :
      print(‘   you select 3’)
    if user_select == ‘4’ :
       print(‘   you select 4’)
    if user_select == ‘5’ :
      setting_menu()
    if user_select == ’99’ :
      input(‘\n\n\t Thank you for using this Appliation. ‘)
       break



Helping Functions
In the Ticket application, when the user insert a record in any lookup tables [category, priority, status, departmen], say category, then he may inter something already there, so we need to check for that.
Also, when the user want to select a ticket priority, or a category, he want to see the list of categories to select from, so we create a function called show_list so he can select from.

Two functions that will help and works within other functions.

def show_list(dt,d_id):
“””
   Function to Display the Data we have in the Lookup Tables based on the user selection function.

   Return: None
“””

   pass



def check_availabilty(dt, d_id, check_id):
“””
   Function to check if the passed ID available in the data-set or not.

  Arguments:
     dt : Data-Table
     d_id : Name of id column.
   check_id : The id we want to search for.

   Return : True if ID is available, False if not.
“””

  pass


Functions Names
Here we list all [almost all] functions we may need in this application.



# ========== Category Function ==============

def ticket_category_menu () :
     pass

def add_category():
     pass

def edit_category():
     pass

def delet_category():
     pass

def show_category():
     pass


# ========== Priority Function ==============
def add_priority ():
     pass

def edit_priority ():
     pass

def delete_priority ():
     pass

def show_priority ():
     pass


# ========== Status Function ==============
def add_status():
     pass

def edit_status():
     pass

def delet_status():
     pass

def show_status():
     pass


# ========== Department Function ==============

def add_department():
     pass

def edit_department():
     pass

def delet_department():
     pass

def show_department():
     pass


# ========== Staff Function ==============

def add_staff():
     pass

def edit_staff():
    pass

def delet_staff():
     pass

def show_staff():
     pass



We almost done with part one, all base are ready to start coding, in next part [Part2], we will start writing the codes for two or three functions to manage the lookups table such as Add,Edit and Delete data from Category, Department, Priority .. tables.



:: Ticket System ::

Intorduction Part 1 Part 2 Part 3



..:: Have Fun with Coding ::.. 🙂

To Download my Python code (.py) files Click-Here



ali radwani ahradwani.com python projects codeFollow me on Twitter..

By: Ali Radwani

Categories: Ali

Photos from Qatar _121


Qatar, a picture of traditional boat used for fishing and some for cruise tourism in Doha Port and the Corniche area. I use Sony RX100vii camera sets to Portra400 picture profile.

Camera setting: ISO 500, 24mm, F8, and shutter speed 1/1667s

Photos from Qatar _120


FIFA World Cup Qatar 2022, the official countdown clock, located on Al-Corniche.

Photo taken by Sony RX100vii camera in Black and white ISO 500, 54mm, F8 and 1/1667s shutter speed.