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
@@IF@@ [[dberror]] = "Login Failed" | |
Access to the database is not permitted | |
@@ELSIF@@ [[dberror]] = "Driver Failed" | |
Database driver failed | |
@@END_IF@@ | |
<P>Hello [[NAME]] | |
ddd | |
dfd | |
[[EMAIL]] <br /> | |
testing |
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
<?php | |
require_once 'app.php'; | |
$id = \App\Task\add($title = 'DVD XML Info', $cmd = 'lsdvd -Ox'); | |
while (!\App\Task\isCompleted($id)) { | |
sleep(1); | |
} | |
$task = \App\Task\get($id); |
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
void static_handler (Soup.Server server, Soup.Message msg, string path, | |
GLib.HashTable? query, Soup.ClientContext client) | |
{ | |
var response_text = ""; | |
unowned uint8[] data; | |
var file = File.new_for_path ("." + path); | |
var mimetype = "text/html"; | |
if (!file.query_exists ()) { | |
response_text += "File does not exist " + path + "<br>"; |
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
class Webserver { | |
public string get_session_id (out unowned Soup.Message msg) | |
{ | |
unowned Soup.MessageHeaders headers = msg.response_headers; | |
unowned Soup.MessageHeaders request_headers = msg.request_headers; | |
string sid = ""; | |
return sid; |
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
class MyWebApp { | |
public Gee.HashMap<string, Json.Object> sessions; | |
public MyWebApp () | |
{ | |
this.sessions = new Gee.HashMap<string, Json.Object> (); | |
} | |
public string get_session_id (out unowned Soup.Message msg) | |
{ |
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
this.player = new Darkcore.Sprite(); | |
this.player.on_key_press = ((a) => { | |
// We are able to retain scope yay! | |
if (this.keys.up) { | |
this.player.y += 4; | |
} | |
if (this.keys.down) { | |
this.player.y -= 4; | |
} | |
if (this.keys.left) { |
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
this.engine.addTexture("resources/grass.png"); | |
this.engine.addTexture("resources/grass-tiles-2-small.png"); | |
var player = new Darkcore.Sprite(); | |
player.x += 32; | |
player.on_key_press = ((engine, sprite) => { | |
if (engine.keys.up) { | |
sprite.y += 4; | |
} | |
if (engine.keys.down) { |
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
public class Ball : Darkcore.Sprite { | |
public double velocity_x; | |
public double velocity_y; | |
public double acceleration { | |
get; set; default = 0.010; | |
} | |
public Ball (ref Darkcore.Engine engine) { | |
base.from_file (engine, "resources/panda-ball.png"); | |
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
public Gsl.Vector? closest_point_on_segment ( | |
Gsl.Vector segment_1, Gsl.Vector segment_2, Gsl.Vector circle_position | |
) { | |
var segment = new Gsl.Vector(2); | |
segment.set(0, segment_1.get (0) - segment_2.get (0)); | |
segment.set(1, segment_1.get (1) - segment_2.get (1)); | |
var point = new Gsl.Vector(2); | |
point.set(0, circle_position.get (0) - segment_2.get (0)); | |
point.set(1, circle_position.get (1) - segment_2.get (1)); |
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
#include <SFML/Graphics.hpp> | |
#include <SFML/System.hpp> | |
#include <iostream> | |
#include <vector> | |
int main() | |
{ | |
std::vector< std::vector<int> > map(4, std::vector<int>(4)); | |
// Define the map | |
map[0][0] = 0; |
OlderNewer