Monday, February 25, 2013

Exploring Photography In-Depth for News Production


Visual media is gaining more and more importance in the journalism field. Students at the Olivet College of Journalism of Olivet University have been putting classroom knowledge into practice. Every week, students participate in various projects ranging from ministry collaborated work or the schools school paper department.  In connection with their advanced photography class assignments, they were asked to produce three pieces of photographic work.
 
Besides learning about the techniques of using professional grade cameras and other photographic equipment, the advanced course aims to nurture students' artistic sense in terms of visual presentation. During the class, students have learned about common photographic styles such as diagonal or curving leading lines, shapes & form, patterns & texture, repetition or rhyme, etc.
 
Furthermore, by examining the current news photographs from leading newspapers and magazines, photographic works of award-winning photojournalists and artists, students have gained useful insights of how to produce excellent photographs. An excellent photograph does not only efficiently communicate with the reader a specific and powerful message, but it should also include strong artistic elements.
 
Looking forward, Olivet College of Journalism will be launching more courses that focus on news production on visual media platforms, which can equip them with the tools necessary for performing effectively in the field.

source from Olivet University

Thursday, February 21, 2013

Olivet Nazarene University, Olivet University and Olivet Oil

Olivet Nazarene University has its name so similar to Olivet University, so that I am quite interested in learning how Olivet Nazarene University is.


When go to their fast facts page,  I am happy to find they are Christian University also, backup by a service of the Church of the Nazarene, theologically grounded in the Wesleyan tradition.
In fact, Olivet is an oil that is so special in Bible, they must known this too so that they picked this name. Olivet oil is used to anoint the King. So if human can repent, man should accept Jesus as King by anointing him with Olivet oil, but sadly , as we know, Jesus was crucified and rejected.
Gethsemane is the place who is used to produce Olivet oil and it is the place where Jesus prayed before going to the cross (Luke 22:43–44)




It is hard to image how Jesus feel when he was at Gethsemane, where he should be anointed by people with the oil that place produces. However , he knew man is so disobey and evil so that he has to go to the cross. However, he believes that, even this evil, God will turn this into his glory, as we know later, Jesus resurrected.

Wednesday, February 20, 2013

Trip to MIT




Round Dome

Olivet University Attends 66th ABHE Annual Meeting


According to news source from Olivet University, Olivet University leaders made a strong presence this week at the 66th Annual Meeting of the Associations for Biblical Higher Education (ABHE).
 
Presidents, Academic officers, and other administrators of ABHE-member schools gathered for the annual event in Orlando, Fla. under the theme of "Quality Assurance and Disruptive Innovation: Can They Coexist?"
 
This year's meeting celebrated the recent dedication of "The Frances and Henry Weber Center for Leadership Development," which serves as the new home for ABHE. Attendants from the event had the opportunity to tour the new headquarter office during its open house event Thursday evening. Citing Psalm 126, the ABHE President Dr. Ralph Enlow, Jr. wrote that moving to the new center was "like a dream” in his report. Mr. Henry Weber, the leading donor for the new ABHE office, was also present at the event greeting guests.
 
Keynote speakers for the plenary sessions included Steve Moore, the President of Mission Nexus, and Riad Kassis, the International Director of the International Council for Evangelical Theological Education (ICETE). David Klob from Kingswood University led worships at the event with a choir comprised of students from ABHE institutions. The meeting also provided over 30 workshops from numerous presenters.
 
Olivet University had seven representatives in attendace to support the Biblical Higher Education movement, which included Dr. Tracy Davis, the University President, Dr. Walker Tzeng, the COO, Dr. John Xiao, the Dean of Olivet College of Business, Mr. Nathanael Tran, the Dean of Administration, Mr. Jonathan Park, the Program Director of Olivet Theological College & Seminary, and Dr. William Wagner and Dr. Joseph Ray Tallman, the Co-presidents of Zinzendorf School of Doctoral Studies.  Both Dr. Davis and Dr. Tzeng serve in ABHE as the Chair of the Nominating Committee and a member on the Board of Directors, respectively.
 
ABHE has over 100 Bible-based institutions, which Olivet University is an accredited member. The next annual meeting will take place at the Wyndham Hotel in Orlando, Florida from Feb. 19-22, 2014.

Saturday, February 16, 2013

Ralph Dana Winter and Olivet University

Ralph Dana Winter (December 8, 1924 – May 20, 2009) was an American missiologist and Presbyterian missionary who became well known as the advocate for pioneer outreach among unreached people groups. He was the founder of the U.S. Center for World Mission(USCWM), William Carey International University, and the International Society for Frontier Missiology.
Surely he is one of the greatest missiologist in USA and he has shown great encourage ,care for Olivet University, the young but fast up growing Christian University.

Flicker of Olivet University source

The images shows his dedication on Olivet University Library in 2007 , which is under his great name. You can find the library link at http://www.olivetuniversity.edu/library/
or click here
Ralph Dana Winter at Olivet University


Preferences

Students Explore Social Media Business Models through Participating in R&D Projects


Ministry Practicum students from Olivet College of Business (OCB), are merging ideas and practice with the University's R&D department.  The collaboration will be to explore new trends in social media business models.  OCB and Olivet's IT students are taking part in various news platform projects that allow users to share articles, vote, and submit content. 

Other projects involve social platforms to share photos, videos, location based on city-related information and topics.

With the websites in development, the business students conjure ideas on how to effectively improve customer user experience while monetizing on their participation.  Working alongside industry professionals and mentors, the students craft their business plans to ensure marketing, finance, and strategic approaches are in place before implementing the project. 

The goal is to line up several prospective startups that may potentially become business ventures after the students' graduation.  Through the experience, OCB grads gain the opportunity to take their idea from concept to reality.


Tuesday, February 12, 2013

Sing with Grace in Olivet University

One of my favorite praise song is how great is our God, which can be found via here in youtube.
At Olivet University, there would be regular praise concert, hmm, not necessarily named concert, because everyone is welcomed to sing and praise to God by sincere heart.

One of the great moment always stays in praising. During the praising, Olivet University students feel freedom and get refreshed.
Sing with grace Olivet University
One Olivet University student sing gracefully

















At the basement, there will be pianos for practicing, however, it is not allowed to practiced during class time..
God Create beautiful world


















 from Olivet University

Monday, February 11, 2013

OCB Ethics Course: Faith, Values In and Out of the Workplace


The Olivet College of Business delves into the ethical aspects of individuals and corporate decision-making in the marketplace with this quarter's Ethics and Responsibilities course.  Led by OCB faculty member Maria George, this course is part of the Olivet College of Business MBA curriculum. 
George will guide the participants towards better understanding of acquisition and utilization of resources for making ethical decisions within the context of managerial practice.  Through this course students will be able to better understand, acquire, and utilize Christian-based ethical guidelines and to discover what is the highest and ultimate end.

"Ethics is a core principle in business as well as faith. In a corporation, managers and employees are responsible for adhering to core underlying values which will influence all decisions throughout the value chain," states George. 

"Choosing what is moral may involve rejecting the route that will bring in the largest profits.  Living justly and adhering to ethical values means walking the straight and narrow path.  In one's personal life as well as in business, individuals make better decisions if they live by a principle-based life, which will guide a sound vision of human flourishing,.. As individuals and as corporations our goals ought to demonstrate a commitment to moral standards beyond ourselves. Participants should be able to hone ethical ideals by which all activities in their public and private lives can be assessed, " adds George.
Maria holds an MBA degree as well as a Master's Degree in Ethics and Journalism. She has had a rich working and teaching experience in business law.


Forget About it

An elderly husband and wife visit their doctor when they begin forgetting little things. Their doctor tells them that many people find it useful to write themselves little notes.

When they get home, the wife says, "Dear, will you please go to the kitchen and get me a dish of ice cream? And maybe write that down so you won't forget?"

"Nonsense," says the husband, "I can remember a dish of ice cream."

"Well," says the wife, "I'd also like some strawberries and whipped cream on it."

"My memory's not all that bad," says the husband. "No problem -- a dish of ice cream with strawberries and whipped cream. I don't need to write it down."

He goes into the kitchen; his wife hears pots and pans banging around. The husband finally emerges from the kitchen and presents his wife with a plate of bacon and eggs.

She looks at the plate and asks, "Hey, where's the toast I asked for?"

Sunday, February 10, 2013

Another Program of Buffer Overflow


#include <stdio.h> 
#include <stdlib.h> 
#include <string.h>

int check_authentication(char *password) {
 int auth_flag = 0;
char password_buffer[16];

strcpy(password_buffer, password);
if(strcmp(password_buffer, "brillig") == 0) auth_flag = 1;
if(strcmp(password_buffer, "outgrabe") == 0) auth_flag = 1;
return auth_flag; 
}

int main(int argc, char *argv[]) { if(argc < 2) {
printf("Usage: %s <password>\n", argv[0]);
exit(0); }
if(check_authentication(argv[1])) 
{ printf("\n-=-=-=-=-=-=-=-=-=-=-=-=-=-\n"); printf(" Access Granted.\n"); printf("-=-=-=-=-=-=-=-=-=-=-=-=-=-\n");
} else {
printf("\nAccess Denied.\n");




Olivet University

Friday, February 8, 2013

Subdomain brute-forcing


Command:

wget http://dnsmap.googlecode.com/files/dnsmap-0.30.tar.gz
tar -xvzf dnsmap-0.30.tar.gz
cd dnsmap-0.30
make
sudo make install
dnsmap example.com (any domain)
dnsmap example.com -f example.txt

...

Olivet University

Geo-Location a domain


Using MaxMind and Pygeoip

wget -N -q http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz

gzip -d GeoLiteCity.dat.gz
ls -alh GeoLiteCity.dat
wget http://pygeoip.googlecode.com/files/pygeoip-0.1.3.zip
unzip pygeoip-0.1.3.zip
cd pygeoip-0.1.3
wget http://svn.python.org/projects/sandbox/trunk/setuptools/ez_setup.py
wget http://pypi.python.org/packages/2.5/s/setuptools/setuptools-0.6c11-py2.5.egg
python setup.py build
sudo python setup.py install
cd ..

MacBook-Pro:security w$ python
Python 2.7.1 (r271:86832, Jul 31 2011, 19:30:53)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygeoip
>>> gip = pygeoip.GeoIP('GeoLiteCity.dat')
>>> rec = gip.record_by_name('yourdomain.com')
>>> for key,val in rec.items():
...   print "%s: %s" % (key,val)
...

Olivet University

Thursday, February 7, 2013

C structure memory research using time


#include <stdio.h> 
#include <time.h>

void dump_time_struct_bytes(struct tm *time_ptr, int size) 
{ int i;
 unsigned char *raw_ptr;
printf("bytes of struct located at 0x%08x\n", time_ptr); raw_ptr = (unsigned char *) time_ptr;
for(i=0; i < size; i++)
{
printf("%02x ", raw_ptr[i]);
if(i%16 == 15) // Print a newline every 16 bytes.
printf("\n"); }
printf("\n"); }

int main() {
long int seconds_since_epoch;
struct tm current_time, *time_ptr;
int hour, minute, second, i, *int_ptr;
seconds_since_epoch = time(0); // Pass time a null pointer as argument. 
printf("time() - seconds since epoch: %ld\n", seconds_since_epoch);
time_ptr = &current_time; // Set time_ptr to the address of // the current_time struct.
localtime_r(&seconds_since_epoch, time_ptr);
// Three different ways to access struct elements: hour = current_time.tm_hour; // Direct access
minute = time_ptr->tm_min; // Access via pointer second = *((int *) time_ptr); // Hacky pointer access

printf("Current time is: %02d:%02d:%02d\n", hour, minute, second); 
dump_time_struct_bytes(time_ptr, sizeof(struct tm));
minute = hour = 0; // Clear out minute and hour. 
int_ptr = (int *) time_ptr;

for(i=0; i < 3; i++) {
printf("int_ptr @ 0x%08x : %d\n", int_ptr, *int_ptr); 
int_ptr++; // Adding 1 to int_ptr adds 4 to the address,
} // since an int is 4 bytes in size. 
}

Unix setuid demo

uid.c

#include <stdio.h>

int main() {
printf("real uid: %d\n", getuid());
printf("effective uid: %d\n", geteuid());

}

command:


MacBook-Pro:security w$ gcc -o uid uid.c
MacBook-Pro:security w$ ls -l uid
-rwxr-xr-x  1 w  staff  8784 Feb  7 17:37 uid
MacBook-Pro:security w$ ./uid
real uid: 501
effective uid: 501        still all 501
MacBook-Pro:security w$ sudo chown root ./uid
MacBook-Pro:security w$ ls -l uid
-rwxr-xr-x  1 root  staff  8784 Feb  7 17:37 uid         
MacBook-Pro:security w$ ./uid
real uid: 501
effective uid: 501
MacBook-Pro:security w$ chmod u+s ./uid
chmod: Unable to change file mode on ./uid: Operation not permitted
MacBook-Pro:security w$ sudo chmod u+s ./uid
MacBook-Pro:security w$ ls -l uid
-rwsr-xr-x  1 root  staff  8784 Feb  7 17:37 uid
MacBook-Pro:security w$ ./uid
real uid: 501
effective uid: 0


Grand Canyon Trip

   On helicopter over Grand Canyon







If you visit Grand Canyon you would truly believe God.  I wish every student of Olivet University can visit there.

Python Resources recommended from Olivet University

Here are some very good Python resource links, which we use in Olivet University teachings, just share here




http://www.activestate.com/ASPN/Downloads/ActivePython/

http://www.python.org/doc/current/

http://www.hetland.org/python/instant-python.php

http://diveintopython.org/

http://www.networkcomputing.com/unixworld/tutorial/005/005.html

http://www.vex.net/parnassus/

http://starship.python.net/

http://www.onlamp.com/python/

http://www.faqts.com/knowledge_base/index.phtml/fid/199

http://www.ddj.com/topics/pythonurl/

http://www.thekompany.com/projects/vp/

http://www.pythonware.com/products/works/

http://archaeopteryx.com/wingide

http://www.python.org/windows/pythonwin/

Witz


Schwimmen Verboten

Hans faellt in einen See. Er wird gerettet.\"Warum bist du denn nicht geschwommen?\" wird er gefragt. \"Wieso? Hier steht doch: \"Schimmen verboten\" !


eberladung

\"Ihr Wagen ist voellig ueberladen! ich muss leider Ihnen den Fuehrerschein abnehmen\", sagt der Polizist zu einem Autofahrer.
\"Aber das ist doch laecherlich: der Fuehrerschein wiegt hoechstens 50 Gramm.\"

Superstereoanlage

Ein Nachbar fragt,\" Wuerden Sie mir netterweise fuers Wochenende Ihre Superstereoanlage leihen?\"
\"Geben Sie eine Party?\"
\"Nein, ich moechte nur mal richtig ausschlafen.\"

Verkehrte Richtung

Auf der Autobahn in Richtung Muenchen hoert ein Autofahrer folgende Meldung
im Verkehrsfunk:\" Achtung, auf der Autobahn in Richtung Muenchen kommt Ihnen ein Wagen in verkehrter Richtung entgegen!\" Der Fahrer sagt:\" Was heisst einer,sondern Hunderte!\"


Datum

\" Welches Datum haben wir heute?\"
\"Tja, keine Ahnung.\"
\"Sieh doch mal in der Zeitung nach.\"
\"Hab ich schon, aber die ist von gestern.\"


Ballett

Jan sieht zum ersten Mal Ballett. Er wundert sich, dass die Taenzerinnen
dauernd auf den Zehen stehen. \"Sag mal, jens\",fragt er seinen
Freund,:warum waehlen die nicht gleich groessere Maedchen aus?\"


Muentze Werfen

Max trifft besonders spaet im Kegelklub ein.“Ich habe es heute einer
Muentze ueberlassen zu entscheiden, ob ich herkommen oder bei meiner Frau
bleiben soll.” Dann setzt er nachdenklich hinzu:“Und ich musste zwoelfmal
werfen.”

Sport Treiben

“Du musst mehr Sport treiben, Irma! Denk mal an unsere Vorfahren, die
waren alle kraeftig und gesund.”
“Na und ?”sagt Irma ungeruehrt,“trotzdem lebt kein einziger mehr.”

Neue Schuhe

“Sie haben so einen kostbaren Mantel an; aber warum tragen Sie so
schaebige Schuhe?”
“Na ja, koennen Sie mir vielleicht verraten, wie ich in einem Restaurant
zu ein Paar neuen Schuhen kommen soll?”

In der Schule

Am Morgen sagt Klaus zu seiner Mutter,“Mutti, ich moechte heute mal zu
Hause bleiben, ich fuehle mich gar nicht wohl!”
“Wo denn?!” fragt Mutter.
“In der Schule!” antwortet Klaus.

Dampfer

Joerg erkuendigt sich beim Kapitaen:“Geht so ein Dampfer eigentlich oefter
unter?”
“Ne, nur einmal, und dann bleibt er meistens unten.”

Zwillingsbrueder

Von Zwillingsbruedern ist der eine kuerzlich verstorben. Ein alter Freund
trifft den Ueberlebenden und fragt unsicher:“Sag mir einmal, einer von
euch ist gestorben. Dein Bruder oder du?”

My solution to Google Python Class Babynames homework


def extract_names(filename):
  """
  Given a file name for baby.html, returns a list starting with the year string
  followed by the name-rank strings in alphabetical order.
  ['2006', 'Aaliyah 91', Aaron 57', 'Abagail 895', ' ...]
  """
  # +++your code here+++
  names = []

  f = open(filename, 'rU')
  text = f.read()

  year_match = re.search(r'Popularity\sin\s(\d\d\d\d)', text)
  if not year_match:
    sys.stderr.write('Couldn\'t find the year!\n')
    sys.exit(1)
  year = year_match.group(1)
  names.append(year)

  tuples = re.findall(r'<td>(\d+)</td><td>(\w+)</td>\<td>(\w+)</td>', text)

  names_to_rank = {}
  for rank_tuple in tuples:
    (rank, boyname, girlname) = rank_tuple
    if boyname not in names_to_rank:
      names_to_rank[boyname] = rank
    if girlname not in names_to_rank:
      names_to_rank[girlname] = rank

  sorted_names = sorted(names_to_rank.keys())

  for name in sorted_names:
    names.append(name + " " + names_to_rank[name])

  return names


def main():
  # This command-line parsing code is provided.
  # Make a list of command line arguments, omitting the [0] element
  # which is the script itself.
  args = sys.argv[1:]

  if not args:
    print 'usage: [--summaryfile] file [file ...]'
    sys.exit(1)

  # Notice the summary flag and remove it from args if it is present.
  summary = False
  if args[0] == '--summaryfile':
    summary = True
    del args[0]

  # +++your code here+++
  # For each filename, get the names, then either print the text output
  # or write it to a summary file
  for filename in args:
    names = extract_names(filename)
 
    text = '\n'.join(names)

    if summary:
      outf = open(filename + '.summary', 'w')
      outf.write(text + '\n')
      outf.close()
    else:
      print text

if __name__ == '__main__':
  main()

Wednesday, February 6, 2013

How New York State describe Olivet University

Fun to see as below:


Olivet University is a private Christian institution in the Presbyterian tradition, located in San Francisco, California. Olivet University has applied to the Board of Regents for permission to operate in New York State. Education Law §224(1)(a) and §3.56 of the Regents Rules prohibit any operation by out-of-state higher education institutions in New York without prior permission of the Board.

Olivet seeks authorization to offer seven courses from its Master of Business Administration (M.B.A.) program at a leased facility in New York City. These are Business Strategy, Leadership, Marketing Management, Ministry Practicum for Capstone I, Ministry Practicum for Capstone II, Introduction to Translation and Interpretation, and Specialized Language Workshops. The first three courses are part of the University’s Business core curriculum for the M.B.A. degree. The Capstone courses are part of a required project done in concert with an Olivet affiliate company or organization. The final two are electives. The M.B.A., of which these seven courses will be a part, includes a Professional core of 40 quarter credits (10 courses), 12 quarter credits of Theology (3 courses), 10 quarter credits of Ministry Practicum (3 courses) and 8 quarter credits of open electives (2 courses).
Olivet University began as a small Bible college in 1992 and now has seven individual college divisions organized under Olivet University. It occupies a 40,000 square foot main campus building in San Francisco. The program areas are theology, music, journalism, art and design, technology, business and language education. The University’s mission is to train men and women as Biblical scholars and leaders, and to equip them with practical skills related to ministry. Olivet University states that its planned operation in New York City fits with the Olivet University’s strategic goal of enhancing interaction with its affiliate ministries.

Olivet University believes that its proposed limited course offering would not be in direct competition with M.B.A. programs in the New York City region since none of the institutions offering them shares Olivet University’s distinctiveness as a Christian institution in the Presbyterian tradition.

Olivet University states that the courses proposed to be offered in Manhattan will have the same content as those delivered at the main campus, and the credits will all apply to its M.B.A. program. The instructional delivery methods used at the New York City facility will consist of lecture and laboratory instruction. Olivet University also offers a wide variety of courses on-line through its San Francisco campus. Any on-line courses that students in New York enroll in on an individual basis will continue to be coordinated and administered through the main campus in San Francisco.

Enrollment projections for the Manhattan location are 15 students in the first year and 40 by the third year. Initial enrollment is expected to draw from students in New York City currently taking on-line courses from Olivet.
The University has hired one full-time faculty member as the academic director for the New York location. He has a doctoral degree and a background in applying new technologies to business ventures. Olivet University proposes to hire one full-time academic administrator. Qualifications for teaching translation and language-related M.B.A elective courses include professional experience as a translator and at least a master’s degree. Additional adjunct faculty, three or more, will be hired as needed.

Olivet University’s leased facility occupies part of an office building located at 6 Barclay Street in lower Manhattan. Faculty would be available for student advisement at this location. In addition, Olivet’s financial and other student support services would be available to all students online.

Olivet University states that it has an extensive collection of educational resources available in the University Library system online and in print. Olivet’s facility in Manhattan has its own collection of print resources onsite which will support its curricular offerings. Books are loaned throughout the University’s library system.

To assess likely demand and need, Olivet University conducted surveys of church members, campus ministry students, on-line business students, and alumni residing in New York. These showed a strong interest in the opportunity to take courses in Manhattan, according to the University. The University has also secured letters from ministry leaders in the New York City area expressing confidence that the courses will help meet their workforce needs. Supporters also include growing digital media companies developed by Olivet graduates.
Olivet University reports that over 90 percent of members of its 2010 graduating class were employed as of December 2011, with 80 percent employed by an affiliate ministry in the field of preparation.

Projections of national, State, and local labor market needs in the areas of ministry and business estimate the following growth rates. On the national level, the 2010-2011 edition of the “Occupational Outlook Handbook” projects a 7 to 13 percent growth for clergy and a 12 percent increase in the demand for managers. The New York State Department of Labor’s current “Labor Statistics” publication projects a “very favorable” outlook for both clergy and managers statewide. For the New York City area, the same publication projects a “favorable” outlook for some management positions and a “very favorable” one for others.

Consistent with its master planning process, the Department conducted a canvass of all degree-granting institutions in the New York City region. The Department received responses from four institutions. Two institutions responded that they had no comment and one responded they would not be affected by the proposed offerings. The fourth institution withdrew an objection after communication from Olivet University satisfactorily resolved concerns. 

source : http://www.regents.nysed.gov/meetings/2012Meetings/November2012/1112hea1.pdf

Beginning Arduino: Control LED


Arduino is quite famous not as a open source hardware. One basic example here:

LED blinking

int led = 13;

void setup() {              
  // initialization
  pinMode(led, OUTPUT);  
}


void loop() {
  digitalWrite(led, HIGH);  
  delay(1000);              
  digitalWrite(led, LOW);  
  delay(1000);              
}

Basically the idea is delay(1000) which is one second and turn the pin led to High/low

If add a user to control this:

int led = 13;

int keyF = 11;  // user button switch ==> faster
int keyS = 12;  // user button switch ==> slower

#define MAX_SELECT 4
int tperiod[MAX_SELECT] = {1000, 500, 250, 125};  // blink rates: 1/2sec,1/sec,2/sec,4/sec
int tselect;

void setup() {              
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);  
  pinMode(keyF, INPUT);
  pinMode(keyS, INPUT);
  tselect = 1;    
}


void loop() {
  if (ledState == HIGH)
    ledState = LOW;          
  else
    ledState = HIGH;          
  digitalWrite(led,ledState);

  delay(1000);                

  if (readUserKeyF()) tselect = blinkFaster();
  if (readUserKeyS()) tselect = blinkSlower();
}

int blinkFaster(void) {
  if (tselect < MAX_SELECT-1)
    return (tselect+1);
  else
    return tselect;
}
int blinkSlower(void) {
  if (tselect > 0)
    return (tselect - 1);
  else
    return tselect;
}

int readUserKeyF(void) {
  if (digitalRead(keyF) == LOW) return 1;
  else return 0;
}
int readUserKeyS(void) {
  if (digitalRead(keyS) == LOW) return 1;
  else return 0;
}
Line connection as:

Arduino


Get Drupal 7 image field url in Computed fields

Demo:


<?php

 $node = menu_get_object();

 $image = array_pop(field_get_items($entity_type, $entity, 'field_image'));

 $fid = $image['fid'];

 $url =file_create_url(file_load($fid)->uri);

?>

Notice array_pop still returns an array and we should use file_load to load the file as a node, finally use file_create_url


How to get Drupal 7 fields out in code

Demo:

<?php

if (arg(0) == 'node' && is_numeric(arg(1)))
 {
   $nid = arg(1);
  }

$node = node_load($nid);
$node_wrapper = entity_metadata_wrapper('node', $node);

$format =  $node_wrapper->field_format->value();


$result = field_view_field('node', $node, 'field_feedcategory', array('default'));

$category = $result['#object']->field_feedcategory['und'][0]['taxonomy_term']->name;

?>

Drupal 7 is more complex than Drupal 6 in its entity structure ( just combined user and node) and its language integration ..  It adds many complexity when we try to get the content type fields out when it comes to taxonomy or image/files etc
entity_metadata_wrapper turns out to be a good tool and also you can use function like field_view_field

Notice ->field_feedcategory['und'][0]['taxonomy_term']->name;  ['und'] means language。


C program for buffer overflow


#include <stdio.h> 
#include <string.h>
int main(int argc, char *argv[])
 { 
 int value = 5;
 char buffer_one[8], buffer_two[8];
 strcpy(buffer_one, "one"); /* Put "one" into buffer_one. */ strcpy(buffer_two, "two"); /* Put "two" into buffer_two. */
 printf("[BEFORE] buffer_two is at %p and contains \'%s\'\n", buffer_two, buffer_two); 
 printf("[BEFORE] buffer_one is at %p and contains \'%s\'\n", buffer_one, buffer_one); 
 printf("[BEFORE] value is at %p and is %d (0x%08x)\n", &value, value, value);
 printf("\n[STRCPY] copying %d bytes into buffer_two\n\n", strlen(argv[1])); 
 strcpy(buffer_two, argv[1]); /* Copy first argument into buffer_two. */
 printf("[AFTER] buffer_two is at %p and contains \'%s\'\n", buffer_two, buffer_two); 
 printf("[AFTER] buffer_one is at %p and contains \'%s\'\n", buffer_one, buffer_one); 
 printf("[AFTER] value is at %p and is %d (0x%08x)\n", &value, value, value);
}

Tuesday, February 5, 2013

This quarter's Software Engineering Syllabi. Olivet University


SE 532Software Engineering Processes

COURSE DESCRIPTION:

This course covers all the latest developments in software engineering. Detailed explanation of the software engineering activities of specification, design, development, verification and validation and management and how these important topics work together. Different models of the software engineering process are compared and contrasted. This course provides an overview of Software Design Patterns and UML and gives explanation  about how they can facilitate the overall development process.

RELATION TO THE COLLEGE STATEMENT OF MISSION:
This course provides students with knowledge of software engineering principles and best practices. It advances the mission of Olivet University by equipping students with the practical skills to communicate the Gospel through software development – which is particularly important for effectiveness in the ‘network generation.’

COURSE OBJECTIVES:

Upon completing this course, a student should be able to:
(1) Understand the main technical activities associated with software engineering: requirements specification, design, implementation, testing and maintenance.
 (2) Understand the importance of quality assurance, human factors, professional issues and project management in software development.
 (3)  Understand common design patterns
(4) Be able to identify appropriate patterns for design problems
 (5) Analyze and design the object-oriented concepts of a software using Unified Modeling Language (UML)

COURSE REQUIREMENTS:

A. Reading:
Carefully read all the assigned reading from the textbook.

B. Exams:
The course will have one midterm and one final.

COURSE TEXTBOOKS:

Required Textbooks:
-          Object-Oriented Software Engineering: Using UML, Patterns and Java, Second Edition by Bernd Bruegge (Author), Allen H. Dutoit (Author)

Optional Textbooks:
-          Object-Oriented Software Engineering: Practical Software Development using UML and Java  by Timothy Lethbridge (Author), Robert Laganiere (Author)
-          Software Engineering: (8th Edition) (International Computer Science Series)
by Ian Sommerville (Author)
-          The Mythical Man-Month: Essays on Software Engineering, 20th Anniversary Edition  by Frederick P. Brooks (Author)
-          Design Patterns Explained: A New Perspective on Object-Oriented Design (2nd Edition) (Software Patterns Series) by Alan Shalloway (Author), James Trott (Author)
-          UML Distilled: A Brief Guide to the Standard Object Modeling Language (3rd Edition) (The Addison-Wesley Object Technology Series) by Martin Fowler (Author)
-          UML 2.0 in a Nutshell (In a Nutshell (O'Reilly)) by Dan Pilone (Author), Neil Pitman (Author)

Team Projects
Class will be divided into 4-6 person teams.  Each team will be provided a set of high-level requirements to be implemented, integrated, and tested.  Each team’s requirements will be implemented using a selected set of the software engineering processes covered in the course.  Activities will begin with project planning and culminate in a review of the team results.  Each team will be required to maintain a project notebook and provide three presentations during the development of the project.  The first two presentations will review the objectives and architecture of the selected software system.  The final review will compare actual results to initial plans and then develop a set of lessons learned for future projects (what worked well, what did not work well, and for elements that did not work well, recommendations for improving the process). 
Teams may define their own project (subject to instructor approval) or select a project from a list provided by the instructor.  Teams will also be allowed to select their own development environment and languages, but must be able to demonstrate the application and provide access to the source code to the instructor (e.g., students may not use employer tools/environments that are not accessible to the instructor).



Grading

  1. Individual work:  60%
·         First Midterm (20%)
·         Second Midterm  (20%)
·         Third Midterm  (20%)
2.      Team work:  40%
-          Each of 3 presentation/notebook updates (10%)
-          Final project notebook (10%)


Sample Team Project:
Creation of multi-user, Web-based system(ARENA) for organizing and conducting tournaments. ARENA is game independent in the sense that organizers can adapt a new game to the ARENA game interface, upload it to the ARENA server, and immediately announce and conduct tournaments with players and spectators, located anywhere on the Internet.
Organizers can also define new tournament styles describing how players are mapped to a set of matches and how to compute an overall ranking of players by adding up their victories and losses(hence, figuring out who won the tournament).To recoup their operational  costs, organizers can also invite potential sponsors to display advertisement banners during games.
After each lecture we will discuss issues, design decisions and trade-offs specific to the lecture in the context of ARENA and we’ll emphasize the dependencies with previous lectures.


COURSE SCHEDULE:

Week              Topic                                                                          Reading

Week 1            Introduction to Software Engineering                       Ch 1 - from required book                 definition, concepts, development activities,
managing software development,ARENA  case study,
further readings,exercises

Week 2            Modelling with UML                                                 Ch 2
introduction,diagram types,modeling concepts,                          
 further readings, exercises

Week 3            Project organization and communication                    Ch 3
introduction,organization concepts,
communication concepts,organizational activities,
further readings, exercises

Week 4            Requirements definition                                             Ch 4
introduction, concepts, activities, managing
requirements elicitation, further readings,
exercises

Week 5            Analysis                                                                      Ch 5
introduction, concepts, activities, managing
analysis, ARENA case study , further readings,
exercises

Week 6            System design - decomposing the system                  Ch 6-Ch 7
and addressing design goals
introduction, concepts, activities, managing
system design, ARENA case study ,
further readings, exercises

Week 7            Object design- reusing patterns solutions                         Ch 8
introduction, concepts, activities, managing
resuse, ARENA case study , further readings,
exercises

Week 8            Object design- specifying interfaces                                 Ch 9
introduction, concepts, activities, managing
object design , ARENA case study ,
further readings, exercises

Week 9            Mapping models to code                                            Ch 10 
introduction, concepts, activities, managing
implemenation, ARENA case study , further readings,
 exercises

Week 10          Testing                                                                        Ch 11 
introduction, concepts, activities, managing
testing, further readings, exercises

Week 11          Rationale Management                                               Ch 12
introduction, concepts, activities – from issues
to decisions, managing rationale
further readings,exercises

Week 12          Configuration Management                                        Ch 13
introduction, concepts, activities,
 managing configuration management ,
further readings, exercises

Week 13          Project Management                                                   Ch 14
introduction, concepts, activities,
further readings, exercises

Week 14          Software Life Cycle                                                   Ch 15
introduction, IEE1074 standart,
life cycle models,further readings, exercises

Week 15         Putting It All Together                                                Ch 16
             introduction,project environment ,
                          methodology issues,spectrum of methodologies,
            case studies,futher reading, exercises


Google PageRank checksum PHP algorithm revealed

In a blog entry, the Google PageRank checksum algorithm was revealed.
The Google PageRank functionality in Google Toolbar works by querying Google’s server for information on the PageRank of a specific page. This might seem easy enough to implement in your own program/website, but the problem is that the toolbar calculates a checksum on the page URL before querying the server, and the server only responds if the checksum is correct. Fortunately the checksum algorithm was reverse engineered from Google Toolbar 7. I was provided the hand decompiled version of the algorithm in C from a friend. Then I went ahead and rewrote it in PHP for web development usage. You can find both versions below.

As an example, the query URL for the page ‘http://en.wikipedia.org/wiki/Cypherpunk’ is http://toolbarqueries.google.com/tbr?client=navclient-auto&features=Rank&q=info:http://en.wikipedia.org/wiki/Cypherpunk&ch=783735859783

Any other query with a checksum other than 783735859783 will result in a ‘403 forbidden’ response.
Enjoy.
PHP CODE:
<?php
/* the floating point hacks are due
   to PHP's bugs when handling
   large unsigned integers */
functionfch($csm)
{
    if($csm< 0)
        $csm+= 4294967296.0;
    $a= (int)fmod($csm, 10);
    $t= 1;
    $b= (int)($csm/ 10);
    while($b) {
        $c= $b% 10;
        if($t)
            $c= (int)($c/ 5) + ($c* 2) % 10;
        $b= (int)($b/ 10);
        $a+= $c;
        $t^= 1;
    }
    
    $a= 10 - $a% 10;
    if($a== 10)
        returnord('0');
    
    if($t)
        returnord('0') + (int)(($a& 1 ? $a+ 9 : $a) / 2);
    returnord('0') + $a;
}
functionchecksum($str)
{
    if(strlen($str) == 0)
        return0x1000;
        
    /* the floating point hacks are due to PHP's bugs when handling integers */
    $a= 5381.0;
    for($i= 0; $i< strlen($str); $i++)
        $a= fmod($a+ ($a* 32) + ord($str[$i]), 4294967296.0);
    if($a> 2147483647.0)
        $a-= 4294967296.0;
    $a= (int)$a;
    $b= 0.0;
    for($i= 0; $i< strlen($str); $i++)
        $b= fmod(($b* 64) + ($b* 65536) - $b+ ord($str[$i]), 4294967296.0);
    if($b> 2147483647.0)
        $b-= 4294967296.0;
    $b= (int)$b;
    
    $a= (($a>> 6) & 0x3ffffc0) | (($a>> 2) & 0x3f);
    $c= (($a>> 4) & 0x3ffc00) | ($a& 0x3ff);
    $d= (($c>> 4) & 0x3c000) | ($c& 0x3fff);
    $c= ((($d& 0x3c0) << 4) | ($d& 0x3c)) << 2;
    $a= $b& 0x0f0f;
    $e= $b& 0x0f0f0000;
    $b= (($d& 0xffffc000) << 4) | ($d& 0x3c00);
    return($b<< 10) | $c| $a| $e;
}
$csm= checksum($page);
printf($PR_SERVER. "%s&ch=7%c%u\n", $page, fch($csm), $csm);
?>
The author of the PHP code is