This file contains 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
private void copyDataBase() throws IOException{ | |
// Path to the just created empty db | |
String outFileName = DB_PATH + DB_NAME; | |
//Open the empty db as the output stream | |
OutputStream myOutput = new FileOutputStream(outFileName); | |
//transfer bytes from the inputfile to the outputfile | |
byte[] buffer = new byte[1024]; |
This file contains 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
generator.enemies = { | |
{ t = 1000, enemyType = 'worm' }, | |
{ t = 3000, enemyType = 'worm' }, | |
{ t = 6000, enemyType = 'worm' }, | |
{ t = 10000, enemyType = 'worm' }, | |
{ t = 10000, enemyType = 'worm' }, | |
{ t = 12000, enemyType = 'worm' }, | |
} |
This file contains 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
--usefull functions | |
function p(t) | |
print( t ) | |
end | |
--@see http://lua-users.org/wiki/MathLibraryTutorial | |
math.randomseed( os.time() ) | |
_W, _H = display.contentWidth, display.contentHeight |
This file contains 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
--генератор врагов в точке респауна | |
--создает экземпляры объектов в необходимое время | |
EnemyGenerator = {} | |
function EnemyGenerator:new(params) | |
local generator = {} | |
--координаты появления | |
generator.x = params.x |
This file contains 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
function bullet:enterFrame(e) | |
if (self.destroyed) then | |
self:destroy() | |
return true; | |
end | |
if ( self:isOut() ) then | |
self.destroyed = true; | |
end | |
This file contains 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
function bullet:enterFrame(e) | |
if ( self:isOut() ) then | |
self:destroy(); | |
end | |
... | |
self:checkCollision() | |
end | |
This file contains 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
function bullet:enterFrame(e) | |
if ( self:isOut() ) then | |
self:destroy(); | |
return true; | |
end | |
... | |
self:checkCollision() | |
end |
This file contains 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
<?php | |
//парсинг баша.орг.ру | |
#error_reporting(0); | |
set_time_limit(0); | |
ini_set('memory_limit', '512M'); | |
$db = new SQLite3('bash'); | |
#$db->query('DELETE FROM quotes;'); |
This file contains 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
function bullet:enterFrame(e) | |
if (self.destroied ) then | |
self:destroy() | |
return true; | |
end | |
--check self is out of screen | |
if ( self:isOut() ) then | |
self.destroied = true; | |
return true; |
This file contains 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
/** | |
* Виджет-блок с новостями, полученными по rss | |
*/ | |
public function widgetAction() | |
{ | |
require_once('Zend/Feed.php'); | |
try | |
{ | |
$feed = Zend_Feed::import('http://www.sports.ru/rss/all_news.xml'); |