Archive

Archive for the ‘Problem’ Category

Python code: Date Validation

November 29, 2018 Leave a comment



Python: Date Validation

As in any application there is lots of functions and procedures helping the application, some of these functions are directly related to the menu bar other are there just to work on back ground to perform a task and return something that another function need to complete an action.

Here is a python code to ask the user to input a date and check if the date is in the format we want to be.

I am new in python so maybe there is a code or a function to perform this, so if any one can help in this.


#python code: Date Validation

def valid_date():

my_date=input(‘Enter the date as dd/mm/yyyy :’)

try:

d,m,y=(my_date.split(‘/’))

if len(d)==1: d=’0’+d

if len(m)==1: m=’0’+m

if len(y)==2: y=’20’+y

if int(d)>31: print(‘Day must be less then 31’), brake

if int(m)>12: print(‘Mounth must be less then 12’), brake

my_date=d+’/’+m+’/’+y

return my_date

except:

print(‘Enter a valid date.’)

return ‘false’

vd=valid_date()
if vd == ‘false’ : valid_date()
else:
print(‘OK’, vd)

Advertisements

Python Project

November 23, 2018 Leave a comment

Python Project:

Two months back I start to learn #Python “Python is a #computer #programming #language “, you can say it grabbed me very quickly. I start to read some #sample #code from the net, then downloading the requirement and after 10 working days I was writing #codes in python and doing what I love Solving #mathematics puzzles with #python’.

So I decide to contribute in training or publishing python language by posting some codes block with explaining and comments, also by developing an application so we will learn on a real example.

I am publishing some codes on my Twitter (@h_ta3kees):

https://twitter.com/h_ta3kees?s=09

and I will do the same here on my blog.

The coming posts will be about the application that we will start develop I will call it ‘Expenditure App’.

My New iPhone 4, a stupid lock phone!!

March 14, 2011 2 comments



I purchased this iPhone 4 from the internet (amazon.com) there was nothing saying that it’s lock to AT&T and can’t be used out side USA (I wonder where is the customer rights to select a carrier), once i received it i notes that it will not work on Qatar, i am waiting for the unlock solution for OS 4.2.1 BB 3.10.01… No thing till now. For now all i can do is jailbreak it and hope the unlock will be soon released..










New Battery and Grip..

December 14, 2010 4 comments

Last week I had a problem with my New Battery for the Nikon D90 [Read the post]. I went to the Nikon Agent – Qatar, they claimed that there where no warranty on the batteries and the chargers; so they can’t change it or re-fund, I decide to get new one and I ask for the price it increased from 41$ to 45$.. Why??

anyway ..

I search the net [Amazon.com] and I fond a battery grip + remote + 2x batteries for 64$, it takes 10 days to be delivered [international transportation-Aramex] I just received it and here it is.


It’s not bad, nice shape and material, Made In China 🙂 , and the remote was missed!! so no remote..
The batteries are without brand, no name on it I hope it will work fine with me.


[Click the image to enlarge]

Problem with my D90 Battery

November 26, 2010 4 comments

I have two Batteries(EN-EL3e) for my Nikon D90 (A and B), last time i get the empty signal for one of them (A) and i replace it with the other(B), but i forget to re-charge the empty one(A), i can’t remember for how long time. (15 day’s or more).

Yesterday i run out of charge(B) and then i realize that i did not charge my (A) battery so i pluged it and here is what happen:

When i charged it, the light on the charger started blinking 3 times then stops (no lights). i’d change the charger .. keep the battery in the charge for 6 hours..cleaned the connectors on the battery,,. no thing…

Some websites and posts suggest to Freeze it overnight, so I did 12hours in the freezer.. and no thing.. I think it’s dead.

I think the reason is that I let it to be empty without charges, I will get new one next week and make sure that it will not go to ZERO charge level.
[New one cost $41 in Nikon Agent – Qatar]

Ali,