Skip to content

Instantly share code, notes, and snippets.

View jaapz's full-sized avatar

Jaap Broekhuizen jaapz

View GitHub Profile
var req = new Request.JSON({
method: 'get',
url: 'ajax/graphDataRequest.php',
initialDelay: 0,
delay: 60000,
onRequest: function() {
// do stuff
},
onSuccess: function(json) {
// do stuff
<?php
namespace VoetbalMoment\FrontendBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* VoetbalMoment\FrontendBundle\Entity\Pagina
*
* @ORM\Table(name="pagina")
// Find optimal move
private Best chooseMove( int side, int[][] board )
{
int opp; // The other side
int win;
Best reply; // Opponent's best reply
int simpleEval; // Result of an immediate evaluation
int bestRow = 0;
int bestColumn = 0;
int bestReply = 0;
jaapz@supergrover:~/Programmeren/Elementary/scratch/build$ gdb scratch
GNU gdb (Ubuntu/Linaro 7.4-2012.02-0ubuntu2) 7.4-2012.02
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
jaapz@ieniemienie:~/Programmeren/Elementary/gdrive/build$ make
[ 14%] Generating src/GDrive.c, src/GoaAuthorizer.c, src/Widgets/WebView.c, src/Widgets/FileView.c, build/src/Config.c
/home/jaapz/Programmeren/Elementary/gdrive/src/GDrive.vala:165.3-165.21: error: The name `insert_tab' does not exist in the context of `Granite.Widgets.DynamicNotebook'
notebook.insert_tab (new Granite.Widgets.Tab (title, new ThemedIcon (icon_name), scroll_view), -1);
^^^^^^^^^^^^^^^^^^^
/home/jaapz/Programmeren/Elementary/gdrive/src/GoaAuthorizer.vala:75.24-75.27: warning: Argument 1: Cannot pass null to non-null parameter type
soup_uri.set_query (null);
^^^^
/home/jaapz/Programmeren/Elementary/gdrive/src/GoaAuthorizer.vala:76.27-76.30: warning: Argument 1: Cannot pass null to non-null parameter type
soup_uri.set_fragment (null);
jaapz@ieniemienie:~/Programmeren/Elementary/gdrive/build$ make
[ 14%] Generating src/GDrive.c, src/GoaAuthorizer.c, src/Widgets/WebView.c, src/Widgets/FileView.c, build/src/Config.c
/home/jaapz/Programmeren/Elementary/gdrive/src/GoaAuthorizer.vala:75.24-75.27: warning: Argument 1: Cannot pass null to non-null parameter type
soup_uri.set_query (null);
^^^^
/home/jaapz/Programmeren/Elementary/gdrive/src/GoaAuthorizer.vala:76.27-76.30: warning: Argument 1: Cannot pass null to non-null parameter type
soup_uri.set_fragment (null);
^^^^
Compilation succeeded - 2 warning(s)
Scanning dependencies of target gdrive
void update_libunity_quicklist () {
var launcher = Unity.LauncherEntry.get_for_desktop_id (app_launcher);
var quicklist = new Dbusmenu.Menuitem ();
foreach (var plug in plugs) {
var item = new Dbusmenu.Menuitem ();
item.property_set (Dbusmenu.MENUITEM_PROP_LABEL, plug["title"]);
@jaapz
jaapz / gist:7563366
Last active December 28, 2015 21:19
calculateSeriesAverage: function() {
var total, firstHour, lastHour, dit, models;
dit = this;
total = 0;
firstTimestamp = this.first().get('timestamp');
lastTimestamp = this.last().get('timestamp');
this.each(function(model, i) {
var width, height, opp, next;
@jaapz
jaapz / gist:7822021
Last active December 30, 2015 11:19
class Compri(object):
# De plek waarop de naam van het veld in deze lijst staat komt overeen met de plek waarop het in het 'parts' text staat. Dus
# slotactie staat op positie 0 in parts, perstijd1 op positie 1 in parts, etc.
_name_to_number_map = ['slotactie', 'perstijd1', 'tijdstemp1', ...]
def __init__(self, parts):
self.fill_with_parts_data(parts)
def fill_with_parts_data(self, parts):
""" Fills fields on this class with the data in parts.
@jaapz
jaapz / events.py
Last active December 31, 2015 00:59
from axel import Event
error = Event(asynch=True)