polychromatic thoughts……………..

September 6, 2008

MOBIVISION WRKSHOP DAY2-PYTHON

Filed under: linux — maniacmind @ 4:10 AM

Sorry guys for the delay in uploading the documentation…so without any further delay lets get started…………before that all the scripts done in class are uploaded on
http://www.esnips.com/web/shane2418sStuff
DAY 2
the day started with a brief revison and then we started with the following stuff…. firstly we started with pop up menu…..

import appuifw

# create a list with the content in []
L = [u"Python", u"Symbian", u"Mlab"]

# create the pop-up menu including the list of content
#and a label
# syntax--> appuifw.popup_menu(list , label)
test = appuifw.popup_menu(L, u"Select + press OK:")

# the variable test holds the indicator which list item (position in the list)
# has been selected
# trigger some action (here we print something)
if test == 0 :
    appuifw.note(u"Python, yeah", "info")
elif test == 1 :
    appuifw.note(u"Symbian, ok", "info")
elif test == 2 :
    appuifw.note(u"Mlab, cool students", "info")



well we hae seen single query earlier lets now see multiple query....
# This script creates 2 text input fields on one screen
# It uses the multi_query function of the appuifw module

import appuifw

# syntax-->  appuifw.multi_query(label1, label2)
data1,data2 = appuifw.multi_query(u"Type your first name:",u"Type your surname:")

# print the reuslts on the screen
  print data1
  print data2

Now lets move to the selection list…i.e a list from which we select single item

# This script executes a dialog  that allows the users to select an item
#in a list and returns the index (of the list) of the chosen item
#syntax --> appuifw.selection_list(choices=list , search_field=0 or 1)


import appuifw

# define the list of items (items must written in unicode! )
L = [u'cakewalk', u'com-port', u'computer', u'bluetooth', u'mobile', u'screen', u'camera', u'keys']

# create the selection list
index = appuifw.selection_list(choices=L , search_field=1)

# use the result of the selection to do some action
#(here we just print something)
if index == 0:
    print "cakewalk was selected"
else:
    print "thanks for choosing"

# the search_field=1 (set to 1) enables a search  for
# looking up items in the list. i.e to activate the find pane
# if search_field=0 no search pane is enabled.
selection list

selection list

After the selection list lets move on to other list called the multi -selection list there is two types of multi-selection lists:- i) with checkbox ii)with check mark

# 1. with checkbox:

import appuifw

# define the list of items (items must written in unicode!)

L = [u'cakewalk', u'com-port', u'computer', u'bluetooth', u'mobile', u'screen', u'keys']

# create the multi-selection list with checkbox

index = appuifw.multi_selection_list(L , style=’checkbox’, search_field=1)

# create a new list (Lnew) that inlcudes only the selected items and print the new list (Lnew)

Lnew = index print Lnew

2.with check mark i

mport appuifw

# define the list of items (items must written in unicode!)

L = [u'cakewalk', u'com-port', u'computer', u'bluetooth', u'mobile', u'screen', u'camera', u'keys']

# create the multi-selection list

tuple = appuifw.multi_selection_list(L , style=’checkmark’, search_field=1)

# create a new list (Lnew) that inlcudes only the selected items and print the new list (Lnew)

Lnew = tuple print Lnew After that we moved on to the functions…i.e HOW TO DEFINE A FUNCTION AND HOW TO CALL IT

# defining a function :lets take an example here.....

import appuifw
function

function .eg+comments

Before moving on further i wou
ld like to explain about the exit key handler.. The exitkey handler gets activated when you press the right (exit) softkey. By assigning an extra function to the .exit_key_handler you can define what shall happen when it is pressed.

import appuifw
def quit():
     print "exit key pressed"
     app_lock.signal()
appuifw.app.exit_key_handler = quit
appuifw.app.title = u"First App!"
appuifw.note(u"Application is now running")
app_lock = e32.Ao_lock()
app_lock.wait()
print "Application exits"

Besides importing the familiar appuifw module, we also need a module named e32. This module offers many useful low-level utility objects and functions related to Symbian OS functionalities. Here we
need the object e32.Ao lock(). We define a new function, quit(), that takes care of shutting down
the application when the user presses the Exit key. Since we could have a number of functions to perform various tasks, we need to tell Python which function is dedicated to handling the Exit events.
This is done by assigning the function name (not its value) to the special appuifw.app.exit key handler variable. When the user presses the Exit key, the function that this variable refers to is called by
the UI framework. In many situations, Python expects you to provide a function name that is used to call the corresponding function when some event has occurred. Functions of this kind are called callback functions.

now lets see a python script
—————————————————————————————————————————————-

import appuifw
import e32 #importing e32 module

def exit_key_handler():
     app_lock.signal()    # stops the scheduler 

round = appuifw.Text()
round.set(u'hello')

# put the application screen size to full screen
appuifw.app.screen='full' #(a full screen)

# other options:
#appuifw.app.screen='normal' #(a normal screen with title pane and softkeys)
#appuifw.app.screen='large' #(only softkeys visible)

app_lock = e32.Ao_lock()  # create an instance of the active object 

appuifw.app.body = round

appuifw.app.exit_key_handler = exit_key_handler
app_lock.wait()   # starts a scheduler -> the script processes events (e.g. from the UI) until lock.signal() is  callled.

——————————————————————————————————————————————
here is another python script covered just try to understand it……….try to figure it out what’s happening i m not telling u…..(for any doubts leave a comment or mail me on 1988.shashank@gmail.com…)

import appuifw
import e32

appuifw.app.screen='large'

# create your application logic ...

def item1():
print "hello"

def subitem1():
print "aha"

def subitem2():
print "good"
#creating a menu and submenu
appuifw.app.menu = [(u"item 1", item1),
(u"Submenu 1", ((u"sub item 1", subitem1), (u"sub item 2", subitem2)))]

def exit_key_handler():
app_lock.signal()

appuifw.app.title = u"drawing"    #gives the title of the page

app_lock = e32.Ao_lock()

appuifw.app.body = ...

appuifw.app.exit_key_handler = exit_key_handler
app_lock.wait()

——————————————————————————————————————————————–
i think all the stuff till the second day is covered here if anything is missing please notify me remember

to error is human

will cover rest of the portion by sunday (7th sept,08please bear patience)

September 1, 2008

MOBIVISION WORKSHOP DAY ONE………….

Filed under: computers, linux — maniacmind @ 11:49 PM

WELL TODAY A LOT MANY PEOPLE TURNED UP FOR THE WORKSHOP…about 200 people that too after leaving those without the delegate cards…i really felt bad those guys i wanted them all to attend the workshop after all we believe in freedom we believe in open source…………

so without wasting time of anyone i start with what all been taught today in the workshop leaving behind the installation process i will start with python portion

started with the modules….

what is a module….?

Technicallty saying module can be defined as a file that contains a collection of related functions and realted data grouped together…..or in a very crude way its something like iostream in c++

we started with appuifw module which stands for( APPLICATION  USER INTERFACE FRAMEWORK)

To use a module in our code we have to import it in the beginning  of the script only….

import appuifw

To call or address the function in a module
lets start with the function note of module appuifw
syntax

appuifw.note(text[,type[,global]])

The sample code given was

appuifw.note(u"hello world","info")

“info” gives the i symbol in the note it stands of any thing informing the user about something……like keypad getting locked or unlocked.Here u used in the symbol represents the unocode(about Unicode i would rather suggest you to refer wikipedia)
in place of “info” we can also use “error” and “conf”
i would suggest the people to try it out themselves and see what they do…………………
after the note function we moved on to query function………………
single feild dailog query
syntax

query(label,type[,initial value])

sample code
rather than using all the types of query function I’ll use all of them together…………

appuifw.query(u"type yor name:","text")
appuifw.query(u"number","number")
apappuifw.query(u"enter a date:","date")
apppuifw.query(u"enter a time:","time")
apppuifw.query(u"passwod:","code")
appuifw.query(u"u are working on python s60","float")

the initial vales can also be included
i would like to write something more
1—>for text fields,return value is Unicode string.
2–>for date fields the date is calculate in seconds since due to epoch.
(goggle out epoch)
(PS: I would suggest people to try all that given above by themselves i anyone face any problem i can be reached 99986411323 or leave a comment i would surely try to help to solve the problem
this is all for today will be back tomorrow with the progress of second day……………

June 5, 2008

Reached delhi at last……

Filed under: Uncategorized — maniacmind @ 8:23 AM

well after another sem in manipal…at last i reached delhi and enjoying a short stay here.will be going to home in few days …..missing home a lot.but some bad news too my hard disk has crashed again …

April 18, 2008

MANIPAL BLOGGERS MEET

Filed under: personal — maniacmind @ 5:10 PM

money...pal bloggers meet

Well today by sheer fate i was kicked out of the class by my chemistry teacher.While wondering what to do i meet Ankur,Ankit and Ravi going for manipal bloggers meet so i decided to join them.it was a wonderful experiece to attend such a workshop it was one of the best events i attended in manipal so far.The event kick started right away after we reached there.The opening talk was by Annie Zaidi a “tehelka ” jounralist.

She talked about the “BLOGGING AND JOUNRALISM”

the few points rather question raised by her were

why jounralist blog?

what reader think ?

and also she talked about power of blogging

but what i found best was her quotes which i like to share here

“They create enthuiasm,but not crediblity” which she said in ref. to blogger journalism

“They want to express,but not find out”

This showed the essense of the whole talk .She shared her view about the credibility and professionalism of the amateur journalist bloggers.

Her speech was followed by a talk on medical blogging by Dr. Raj Warrier vice chancellor of our university.He was talking so slowly that u can hardly understand anything.it was followed by highly appreciable talk by Chandrahas Choudhury on “BLOGGING AND LITERATURE” i kinda liked this talk.After that we had blah blah blah by some satyam guy on corporate blogging.

Now came the tormentor i don’t exactly remember his name but he rocked us all he was the one who extracted public response by raising arguments and discussion. and after racking the brains of all we got a short break followed by a surprise.

In place of ankur some other guy started his talk i would rather say advertising his blog or so called site.Though Vishal sir editor of our ed-board asked just one question mercilessly to kick him out of the stage. Our whole group was happy now as its was Ankur’s turn to get everyone’s attention he involved public easily as usual but some were fuming bcoz of his usual habit of taking technical topics which few people understand.after a one on one fight about WEB 2.O he setlled down content to get some public response but unaware about what’s happening next.

Ravi not to my surprise took a out of the topic to speak on “anonymous”. i don’t want to start a argument here but the topic envolved everyone present in the convention.although ravi was open to all sorts of questions about his point of veiw everyone in the veiwers were fighting war of words among them selfs so Ravi escaped any weird sort of questioning( i wished someone could have challenged him there i would have added more spice) .After this talk i m pretty sure anyone out there seeing any “anonymous” post or comment will remember Ravi for sure.After that we got to leave unwillingly as we were receiving calls from our seniors

April 11, 2008

windows going down………?

Filed under: Uncategorized — maniacmind @ 11:36 AM

SAO PAOLO, Brazil–At a Las Vegas conference on Thursday, Gartner analysts warned that Windows is in danger of collapsing, according to a report in ComputerWorld.

. Although Microsoft faces challenges from Linux and piracy here, looking out from the company’s futuristic offices, it hardly seemed like either the building or the Windows empire was in imminent danger of collapse.

Seriously, though, Gartner analyst Michael Silver appears to be noting some important long-term issues that threaten to make it harder for Microsoft to maintain its dominant position in the market. These threats are not new, but nonetheless all bear consideration. First, Microsoft has had an inordinantly difficult time upgrading its core product. Although Microsoft has said it will not go as long before its next release of Windows as it did between XP and Vista, even the possible sped-up timetable hardly shows a product that can quickly adapt to change.

Meanwhile, while Apple was able to build the iPhone on OS X, Microsoft has had to extend another lifeline to Windows XP because its latest product can’t even fit onto the cheap mini-laptops from HP, Asus, and others.

“Windows as we know it must be replaced,” Gartner said in its presentation, again according to ComputerWorld. Meanwhile, the company faces other threats, such as a diminished role for the operating system in a world of hypervisors.

Is it really all doom and gloom, though?

Sure Apple has been gaining ground and, more than ever, the same Internet applications can run on multiple platforms. That said, Microsoft still holds a huge share of mind among developers, meaning that there will likely to continue to be a whole host of applications that come out first or only on Windows. That, in turn, will make it different for mainstream businesses to shift to an alternative to Windows.

What is of concern is the trend. Windows appears to be harder than ever to update and improve. Windows Live offers an option to build on the value of Windows without going under the hood, but in this areas rivals too are investing big bucks.

I think it is an overstatement to say Windows is collapsing. Empires don’t really collapse. Rather they become large, difficult to control and eventually unable to defend against a large rival. Gartner may have used the wrong term, but its warning seems nonetheless prudent.

March 8, 2008

earth the majestic beauty

Filed under: Uncategorized — maniacmind @ 4:03 PM

earthatnigh-asia1.jpg

well found these pics while surfing these are amazing…………………

March 6, 2008

orderal over……….

Filed under: Uncategorized — maniacmind @ 6:34 PM

well after 4 days of brain stroming and lot of disappointments the sessionals ended what i can see from now is  the result  s howing zeros more than ever i my life & i think  this was the worst exam i had ever given. hoping for good results nxt time but still i m totally down after these. i knew what was coming still never made my mind for studying.well still can’t crub my tendency to party or to do anything but not studies

« Previous PageNext Page »

Blog at WordPress.com.