text:
<?php

namespace MS\RpcBundle\DependencyInjection\Compiler;

use MS\RpcBundle\Service\Proxy;
use MS\RpcBundle\Service\ProxyGenerator;
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;

class AddProxiesCompilerPass implements CompilerPassInterface
{
    /** @var  ProxyGenerator */
    protected $proxyGenerator;

    /**
     * @param ContainerBuilder $container
     */
    public function process(ContainerBuilder $container)
    {
        $directory = $container->getParameter('ms_rpc.proxy.directory');
        $namespace = $container->getParameter('ms_rpc.proxy.namespace');
        $baseTrait = $container->getParameter('ms_rpc.proxy.base_trait');
        $this->proxyGenerator = new ProxyGenerator($directory, $namespace, $baseTrait);

        $services = $container->findTaggedServiceIds('ms.rpc.proxy');
        foreach ($services as $id => $tags) {
            $definition = $container->findDefinition($id);

            $this->addProxy($definition, $id, $tags);
        }
    }

    /**
     * @param Definition $definition
     * @param string     $id
     * @param array      $tags
     *
     * @throws InvalidConfigurationException
     */
    protected function addProxy(Definition $definition, $id, $tags)
    {
        $interfaceOrClass = $definition->getClass();
        if (!interface_exists($interfaceOrClass) and !class_exists($interfaceOrClass)) {
            $message = sprintf('RPC Proxy service definition supplied class (%s) does not exist', $interfaceOrClass);
            throw new InvalidConfigurationException($message);
        }

        $tag = reset($tags);
        if (!isset($tag['connection'])) {
            $message = sprintf('RPC Proxy service definition supplied tags does not specify a connection', $interfaceOrClass);
            throw new InvalidConfigurationException($message);
        }
        $connection = $tag['connection'];

        $remote_service = $id;
        if (isset($tag['remote_service'])) {
            $remote_service = $tag['remote_service'];
        }

        if (!is_subclass_of($interfaceOrClass, Proxy::class)) {
            $proxyClass = $this->proxyGenerator->generateProxyClass($interfaceOrClass);

            $definition->setClass($proxyClass);
        }

        $definition->setArguments([new Reference($connection), $remote_service]);
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="Hoe help je scholen en docenten op weg naar gepersonaliseerd leren?">
    <meta name="google-site-verification" content="YBBcJaRKMNdKwlee-ofemULgjYZBxY5N5bgv0skRqIY" />

    <title>Waarom - Eduraam</title>

    <link rel="canonical" href="http://www.eduraam.nl/waarom/">

    <link rel="stylesheet" href="/css/bootstrap.min.css">

    <link rel="stylesheet" href="/css/clean-blog.css">

    <link rel="stylesheet" href="/css/syntax.css">

    <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href='//fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
    <link href='//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>

            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                Toggle navigatie

            </button>
            Eduraam

                    Waarom

                    Hoe

                    Wat

                    Contact

Waarom

                    ...is dit een goed idee?

Achtergrond

Ooit zijn we begonnen vanuit een interesse in game-based learning. Via het ontwikkelen van een Nederlandse versie van de Khanacademy, het bouwen van diverse e-learning omgevingen en het werken aan learning analytics projecten voor o.a. de Universiteit van Amsterdam, zijn we steeds dieper verzeild geraakt in het ingewikkelde ecosysteem van het (Nederlandse) onderwijs.

De vraagstukken die ons bezig houden hebben te maken met hoe onderwijs gepersonaliseerd kan worden, hoe onderwijs verbeterd kan worden, relevanter en uitdagender, inspirerender en effectiever. Deelvragen die daaruit voortvloeiden waren:

Wat is er nodig op scholen om niet voornamelijk bezig te zijn met het volgen van de methode?

Hoe kan er op scholen effectief gebruik worden gemaakt van de enorme hoeveelheid kennis en informatie die er via het web beschikbaar is?

Hoe kunnen we er voor zorgen dat docenten de beschikking hebben over de beste onderwijstoepassingen die er beschikbaar zijn?

Als uit onderzoek blijkt dat iets goed werkt, hoe kunnen we zorgen dat die kennis niet alleen beschikbaar komt, maar ook toegepast wordt?

We hebben in de afgelopen jaren vele bevlogen, enthousiaste en kundige mensen in en om het onderwijs ontmoet. Het is voor ons volkomen helder dat die mensen allemaal nodig zijn, om het onderwijs structureel te veranderen. Het probleem dat we tegenkwamen, was dat de markt in het onderwijs verdeeld is: de grote uitgeverijen hebben een machtspositie, doordat ze goed ingevoerd zijn in het onderwijs. Scholen maken al jaren gebruik van de methodes die zij leveren en voor nieuwkomers is het lastig daar tussen te komen. Een aantal partijen is dat gelukt, zoals bijvoorbeeld Snappet en Oefenweb (Rekentuin en Taalzee) in het primair onderwijs. Beide zijn voorbeelden van een aanpak waarbij een "digital first" aanpak is gehanteerd. Dus niet het vertalen van de methode in losse oefeningetjes, maar bedenken hoe je (in dit geval reken)onderwijs opzet als je de voortgang van elke leerling individueel bij kan houden en in kan spelen op de voortgang of fouten die hij of zij maakt.

                Please enable JavaScript to view the comments powered by Disqus.

Eduraam is een initiatief van Perceptum - Science Park 402 - 1098 XH Amsterdam +3120 705 1000

redpajama_set_name: RedPajamaGithub


text:
package gnu.kawa.models;
import java.awt.*;
import java.awt.geom.*;
/* #ifdef with:JFreeSVG */
// import org.jfree.graphics2d.svg.SVGGraphics2D;
/* #endif */

public class SVGUtils {
    public static final String JFREESVG_UNAVAILABLE
        = new String("[JFreeSVG is unavailable]");
    public static String toSVG(Paintable p) {
        /* #ifdef with:JFreeSVG */
        // Rectangle2D bounds = p.getBounds2D();
        // SVGGraphics2D g2 = new SVGGraphics2D((int)Math.ceil(bounds.getWidth()),
        //                                      (int)Math.ceil(bounds.getHeight()));
        // g2.setPaint(Color.BLACK);
        // g2.translate(bounds.getMinX(), -bounds.getMinY());
        // p.paint(g2);
        // return g2.getSVGElement();
        /* #else */
        return JFREESVG_UNAVAILABLE;
        /* #endif */
    }
}


text:
using System.Collections.Generic;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace Citrina
{
    public class Stats : IStats
    {
        /// <summary>
        /// Returns statistics of a community or an application.
        /// </summary>
        public Task<ApiRequest<IEnumerable<StatsPeriod>>> GetApi(int? groupId = null, int? appId = null, int? timestampFrom = null, int? timestampTo = null, string interval = null, int? intervalsCount = null, IEnumerable<string> filters = null, IEnumerable<string> statsGroups = null, bool? extended = null)
        {
            var request = new Dictionary<string, string>
            {
                ["group_id"] = groupId?.ToString(),
                ["app_id"] = appId?.ToString(),
                ["timestamp_from"] = timestampFrom?.ToString(),
                ["timestamp_to"] = timestampTo?.ToString(),
                ["interval"] = interval,
                ["intervals_count"] = intervalsCount?.ToString(),
                ["filters"] = RequestHelpers.ParseEnumerable(filters),
                ["stats_groups"] = RequestHelpers.ParseEnumerable(statsGroups),
                ["extended"] = RequestHelpers.ParseBoolean(extended),
            };

            return RequestManager.CreateRequestAsync<IEnumerable<StatsPeriod>>("stats.get", null, request);
        }

        /// <summary>
        /// Returns stats for a wall post.
        /// </summary>
        public Task<ApiRequest<IEnumerable<StatsWallpostStat>>> GetPostReachApi(string ownerId = null, int? postId = null)
        {
            var request = new Dictionary<string, string>
            {
                ["owner_id"] = ownerId,
                ["post_id"] = postId?.ToString(),
            };

            return RequestManager.CreateRequestAsync<IEnumerable<StatsWallpostStat>>("stats.getPostReach", null, request);
        }

        public Task<ApiRequest<bool?>> TrackVisitorApi(string id = null)
        {
            var request = new Dictionary<string, string>
            {
                ["id"] = id,
            };

            return RequestManager.CreateRequestAsync<bool?>("stats.trackVisitor", null, request);
        }
    }
}


text:
<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="default.xsl" ?>
<resultset method="POST" mode-type="table" on_line_click="contacts.srm?edit" title="List of Contacts">
<navigation>
<target label="Contacts" url="xdoc.htm?contacts.srm" />
<target label="Calendar" url="xdoc.htm?cal.srm" />
</navigation>
<buttons>
<button label="bogus" type="bogus" />
<button label="fake" type="bogus" />
</buttons>
<buttons>
<button type="add" label="Create Contact" task="contacts.srm?create" />
<button type="jump" label="Export" url="contacts.srm?export_contacts" />
<button type="jump" label="Export Tables" url="contacts.srm?export_big" />
<button type="jump" label="Import" url="xdoc.htm?contacts.srm?import_contacts_form" />
</buttons>
<result rndx="1" row-name="row">
<schema name="row" title="{$name} Family ({$city}, {$state})">
<field name="id" type="INT" primary-key="true" auto-increment="true" sort="number" not-null="true" length="4" />
<field name="fname" type="VARCHAR" length="32" />
<field name="lname" type="VARCHAR" length="32" />
<field name="phone" type="VARCHAR" length="25" />
</schema>
<row id="1" fname="Chuck" lname="Jungmann" phone="612-719-3157" />
<row id="2" fname="Jessie" lname="Dunnagan" phone="612-581-8040" />
<row id="3" fname="Rachel" lname="Jungmann" phone="612-555-5555" />
<row id="7" fname="Mary" lname="Jungmann" phone="651-631-0653" />
<row id="8" fname="Gary" lname="Brown-Green" phone="651-451-7360" />
</result>
<info rndx="2" type="variables" row-name="family">
  <family name="Jungmann" address="1234 Main Street" city="Hopkins" state="MA" />
</info>
</resultset>


text:
package com.google.jam.creators;

import com.google.jam.WrongRoundFormatException;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.function.Function;

public class StandingOvationRoundFunction
        extends AbstractRoundFunction
        implements Function<List<String>, Collection<String>> {

    @Override
    public Collection<String> apply(final List<String> strings) {
        final int queueLength = parseLength(strings);
        if (queueLength != strings.size()) {
            throw new WrongRoundFormatException();
        }
        return new ArrayList<>(strings);
    }
}


text:
enum TypeActionEvent{
    type_ClueContact, //clue contact(Đầu mối liên hệ)
    type_ProposeProduct, //propose product (sản phẩm đề xuất)
    type_Sale, //san pham da ban
    type_Task, // cong viec
    type_Note, //Ghi chú
    type_Calendar // lich
};

@interface CompetitorsViewController : BaseViewController<UITableViewDataSource, UITableViewDelegate,SelectIndexDelegate,OpportunityProductDelegate,TaskActionCellDelegate,ComplainDetailViewControllerDelegate,EditCalendarOpportunityViewControllerDelegate,EditCalendarLeadViewControllerDelegate,ComplainsViewDelegate,UITabBarDelegate,UIActionSheetDelegate,UISearchBarDelegate>

@property (nonatomic) enum TypeActionEvent typeActionEvent;

@property (nonatomic,retain) NSString *itemId;

//Header
@property (weak, nonatomic) IBOutlet UIView *headerViewBar;
@property (weak, nonatomic) IBOutlet UILabel *fullNameLB;

@property (weak, nonatomic) IBOutlet UIButton *btnHome;
- (IBAction)homeBack:(id)sender;

@property (weak, nonatomic) IBOutlet UIView *mainView;

@property (weak, nonatomic) IBOutlet UIView *leftInMainView;

@property (weak, nonatomic) IBOutlet UIView *leftViewHeader;

@property (weak, nonatomic) IBOutlet UILabel *leftLabelHeader;

@property (weak,nonatomic) IBOutlet UISearchBar *searchBar;

@property (weak, nonatomic) IBOutlet UIView *rightInMainView;
@property (weak, nonatomic) IBOutlet UIView *rightViewHeader;
@property (weak, nonatomic) IBOutlet UIScrollView *scrollViewInfo;

#pragma  mark righview button

@property (weak, nonatomic) IBOutlet UIButton *btnClueContact;

@property (weak, nonatomic) IBOutlet UIButton *btnProposeProduct;

@property (weak, nonatomic) IBOutlet UIButton *btnActionSale;
@property (weak, nonatomic) IBOutlet UIButton *btnTask;
@property (weak, nonatomic) IBOutlet UIButton *btnCalendar;
@property (weak, nonatomic) IBOutlet UIButton *btnNote;

@property (weak, nonatomic) IBOutlet UIButton *btnEdit;
- (IBAction)actionEdit:(id)sender;

@property (weak, nonatomic) IBOutlet UIButton *btnDelete;
- (IBAction)actionDelete:(id)sender;

@property (strong, nonatomic) IBOutlet UILabel *lblCode;

@property (strong, nonatomic) IBOutlet UILabel *lblName;
@property (strong, nonatomic) IBOutlet UILabel *lblNextTaskTitle;
@property (strong, nonatomic) IBOutlet UILabel *lblNextTaskDetail;
@property (strong, nonatomic) IBOutlet UILabel *lblStartDateTitle;
@property (strong, nonatomic) IBOutlet UILabel *lblStartDateDetail;
@property (strong, nonatomic) IBOutlet UILabel *lblEndDateTitle;
@property (strong, nonatomic) IBOutlet UILabel *lblEndDateDetail;
@property (strong, nonatomic) IBOutlet UILabel *lblCustomerTitle;
@property (strong, nonatomic) IBOutlet UILabel *lblCustomerDetail;
@property (strong, nonatomic) IBOutlet UILabel *lblOpportunityLevelTitle;
@property (strong, nonatomic) IBOutlet UILabel *lblOpporttunityLevelDetail;
@property (weak, nonatomic) IBOutlet UILabel *lblTypeDetail;
@property (weak, nonatomic) IBOutlet UILabel *lblEndDateRealDetail;
@property (weak, nonatomic) IBOutlet UILabel *lblNoteDetail;
@property (weak, nonatomic) IBOutlet UILabel *lblDescriptionDetail;
@property (weak, nonatomic) IBOutlet UIView *footeView;
@property (weak, nonatomic) IBOutlet UILabel *barLabel;

- (IBAction)actionClueContact:(UIButton *)sender;

- (IBAction)actionProposeProduct:(UIButton *)sender;

- (IBAction)actionActionSale:(UIButton *)sender;
- (IBAction)actionTask:(UIButton *)sender;
- (IBAction)actionCalendar:(UIButton *)sender;
- (IBAction)actionNote:(id)sender;

@property (weak, nonatomic) IBOutlet UILabel *lblTitleCode;
@property (weak, nonatomic) IBOutlet UILabel *lblTitleName;
@property (weak, nonatomic) IBOutlet UILabel *lblEndDateRealTitle;
@property (weak, nonatomic) IBOutlet UILabel *lblTypeTitle;
@property (weak, nonatomic) IBOutlet UILabel *lblNoteTitle;
@property (weak, nonatomic) IBOutlet UILabel *lblDescriptionTitle;
@property (weak, nonatomic) IBOutlet UIImageView *imgStartDate;
@property (weak, nonatomic) IBOutlet UIImageView *imgEndDateReal;
@property (weak, nonatomic) IBOutlet UIImageView *imgEndDate;

@property (weak, nonatomic) IBOutlet UITableView *tbData;

@property (weak, nonatomic) IBOutlet UIButton *btnAdd;
- (IBAction)actionAdd:(id)sender;

////////////// KHAI BAO BIEN CHUNG//////////
@property (nonatomic, retain) UIPopoverController *listPopover;
////////////// KHAI BAO BIEN CHUNG//////////

@property (strong, nonatomic) IBOutlet UIView *viewTableIphone;
@property (weak, nonatomic) IBOutlet UITabBar *tabBarItems;

@end


text:
package wal

import (
	"encoding/binary"
	"hash"
	"io"
	"os"
	"sync"

	"github.com/coreos/etcd/pkg/crc"
	"github.com/coreos/etcd/pkg/ioutil"
	"github.com/deepfabric/indexer/wal/walpb"
	"github.com/pkg/errors"
)

// walPageBytes is the alignment for flushing records to the backing Writer.
// It should be a multiple of the minimum sector size so that WAL can safely
// distinguish between torn writes and ordinary data corruption.
const walPageBytes = 8 * minSectorSize

type encoder struct {
	mu sync.Mutex
	bw *ioutil.PageWriter

	crc       hash.Hash32
	buf       []byte
	uint64buf []byte
	curOff    int64 //offset of under-layer io.File
}

func newEncoder(w io.Writer, prevCrc uint32, pageOffset int) *encoder {
	return &encoder{
		bw:  ioutil.NewPageWriter(w, walPageBytes, pageOffset),
		crc: crc.New(prevCrc, crcTable),
		// 1MB buffer
		buf:       make([]byte, 1024*1024),
		uint64buf: make([]byte, 8),
		curOff:    int64(pageOffset),
	}
}

// newFileEncoder creates a new encoder with current file offset for the page writer.
func newFileEncoder(f *os.File, prevCrc uint32) (*encoder, error) {
	offset, err := f.Seek(0, io.SeekCurrent)
	if err != nil {
		return nil, errors.Wrap(err, "")
	}
	return newEncoder(f, prevCrc, int(offset)), nil
}

func (e *encoder) encode(rec *walpb.Record) (err error) {
	e.mu.Lock()
	defer e.mu.Unlock()

	e.crc.Write(rec.Data)
	rec.Crc = e.crc.Sum32()
	var (
		data []byte
		n    int
	)

	if rec.Size() > len(e.buf) {
		if data, err = rec.Marshal(); err != nil {
			err = errors.Wrap(err, "")
			return
		}
	} else {
		if n, err = rec.MarshalTo(e.buf); err != nil {
			err = errors.Wrap(err, "")
			return
		}
		data = e.buf[:n]
	}

	lenField, padBytes := encodeFrameSize(len(data))
	if err = writeUint64(e.bw, lenField, e.uint64buf); err != nil {
		return
	}
	e.curOff += int64(8)

	if padBytes != 0 {
		data = append(data, make([]byte, padBytes)...)
	}
	if _, err = e.bw.Write(data); err != nil {
		err = errors.Wrap(err, "")
		return
	}
	e.curOff += int64(len(data))
	return
}

func encodeFrameSize(dataBytes int) (lenField uint64, padBytes int) {
	lenField = uint64(dataBytes)
	// force 8 byte alignment so length never gets a torn write
	padBytes = (8 - (dataBytes % 8)) % 8
	if padBytes != 0 {
		lenField |= uint64(0x80|padBytes) << 56
	}
	return lenField, padBytes
}

func (e *encoder) flush() (err error) {
	e.mu.Lock()
	defer e.mu.Unlock()
	if err = e.bw.Flush(); err != nil {
		err = errors.Wrap(err, "")
	}
	return
}

func writeUint64(w io.Writer, n uint64, buf []byte) (err error) {
	// http://golang.org/src/encoding/binary/binary.go
	binary.LittleEndian.PutUint64(buf, n)
	if _, err = w.Write(buf); err != nil {
		err = errors.Wrap(err, "")
	}
	return
}


text:
package me.phoboslabs.illuminati.ApiServerSample.service1;

import me.phoboslabs.illuminati.ApiServerSample.model.TestModel;
import me.phoboslabs.illuminati.annotation.Illuminati;
import me.phoboslabs.illuminati.annotation.enums.PackageType;
import org.springframework.stereotype.Service;

@Service
public class ApiSampleService1 {

    public String sampleTest () {
            return "illuminati Cool";
    }

    @Illuminati(packageType = PackageType.SERVICE)
    public String sampleTestByObject1 (TestModel testModel) {
        this.sampleTestByObject12(null);
        return "illuminatu param test";
    }

    @Illuminati(packageType = PackageType.SERVICE)
    public String sampleTestByObject12 (TestModel testModel) {
        return "illuminatu param test";
    }
}


text:
module Colppy
  module Utils
    module_function

    ATTRIBUTES_MAPPER = {}
    DATA_KEYS_SETTERS = []

    def rename_params_hash(params, mapper, setter)
      params.each_with_object({}) do |(key, value), hash|
        if new_key = mapper[key]
          hash[new_key] = value
        elsif setter.include?(key)
          hash[key] = value
        else
          hash[:unhandle] ||= {}
          hash[:unhandle][key] = value
        end
      end
    end
  end
end