This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env python | |
| import MySQLdb | |
| host = "localhost" | |
| passwd = "" | |
| user = "root" | |
| dbname = "mydbname" | |
| db = MySQLdb.connect(host=host, user=user, passwd=passwd, db=dbname) | |
| cursor = db.cursor() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct student | |
| { | |
| int id; | |
| string name; | |
| string classNumber; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| string students[30] = {"ahmed", "ali", "mostafa", .... }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| string months[] = { "Jan", "Feb", "Mar", "April", "May", "June", "July", "Aug", "Sep", "Oct", "Nov", "Dec" }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| string fifth = months[5]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for (int i = 0; i < 30; ++i) { | |
| cout << students[i] << endl; | |
| } | |
| for (int i = 0; i < 5; ++i) { | |
| cout << months[i] << endl; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var timer = NSTimer.scheduledTimerWithTimeInterval(0.1, target:self, selector: Selector("updateSlider"), userInfo: nil, repeats: true) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // in the mainView class we need to create an outlet for the slider, and the text label for the current time. | |
| @IBOutlet weak var audioPlayerBar: UISlider! | |
| @IBOutlet weak var timeViewer: UILabel! | |
| // updating slider function | |
| func updateSlider(){ | |
| let currentTime = Float(nsTimerToSeconds(audioPlayer.currentTime)) | |
| audioPlayerBar.value = currentTime | |
| timeViewer.text = "\(currentTime) / \(audioLengthSeconds)" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @IBAction func SliderChange(sender: UISlider) { | |
| audioPlayer.stop() | |
| var newTime = audioPlayerBar.value | |
| audioPlayer.currentTime = NSTimeInterval(newTime) | |
| audioPlayer.play() | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // PlaySoundViewControlerViewController.swift | |
| // Record Teen | |
| // | |
| // Created by abdelrahman mohamed on 7/16/15. | |
| // Copyright (c) 2015 abdelrahman mohamed. All rights reserved. | |
| // | |
| import UIKit | |
| import AVFoundation |
OlderNewer